CN107147743B - Communication method of Internet of things system based on simplified Internet of things communication protocol - Google Patents
Communication method of Internet of things system based on simplified Internet of things communication protocol Download PDFInfo
- Publication number
- CN107147743B CN107147743B CN201710517256.3A CN201710517256A CN107147743B CN 107147743 B CN107147743 B CN 107147743B CN 201710517256 A CN201710517256 A CN 201710517256A CN 107147743 B CN107147743 B CN 107147743B
- Authority
- CN
- China
- Prior art keywords
- coordinator
- data
- network
- command
- equipment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a communication method of an internet of things system based on a simplified internet of things communication protocol, which comprises the following steps: assigning a network ID to the coordinator; registering the terminal equipment; the APP of the mobile terminal sends a router rewriting command to the router, then sends a command containing the equipment ID, and adds the terminal equipment needing to be routed so as to enable the router to finish the rewriting process; the APP of the mobile terminal sends the control instruction to the coordinator, and the coordinator converts the control instruction into physical layer data and sends the physical layer data to the air; the terminal equipment judges whether the equipment ID is own, if so, corresponding operation is executed, a response data packet is sent to the coordinator, and the coordinator converts the response data packet into data conforming to the AT instruction set data format and outputs the data from the UART interface; otherwise, the MAC layer data is discarded. The invention can save sending and processing time, has better reliability and higher working stability, effectively reduces the problem of repeated codes in the application process and can realize low power consumption.
Description
Technical Field
The invention relates to the field of Internet of things, in particular to a communication method of an Internet of things system based on a simplified Internet of things communication protocol.
Background
The ZIGBEE communication protocol is suitable for requirements of low cost, low energy, high fault tolerance and the like of the wireless sensor. The basis of ZIGBEE is IEEE 802.15.4. However, IEEE deals only with low-level MAC layer and physical layer protocols, so the ZIGBEE alliance extends IEEE to standardize its network layer protocols and APIs. ZIGBEE is an emerging short-distance and low-speed wireless network technology, and is mainly used for short-distance wireless connection. It has its own protocol standard, and several thousands of tiny sensors coordinate with each other to realize communication. In the Internet of things or intelligent home systems, most ZIGBEE communication protocol products are available at present, but the protocol is complex and needs to run on an operating system, so that the real low power consumption cannot be realized, and in addition, the ZIGBEE protocol can only realize networking work by a coordinator.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a communication method for an internet of things system based on a simplified internet of things communication protocol, which can save sending and processing time, has good reliability and high working stability, effectively reduces the problem of duplicate codes in an application process, and can realize low power consumption, aiming at the defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a communication method of an Internet of things system based on a simplified Internet of things communication protocol is constructed, and the communication method is applied to the Internet of things system, the Internet of things system comprises an APP (application), a gateway, a coordinator, a plurality of routers and a plurality of terminal devices of a mobile terminal, the coordinator is connected with the gateway through a UART (universal asynchronous receiver/transmitter) interface and is also directly connected with the plurality of routers and the plurality of terminal devices, and the coordinator is also connected with other routers or terminal devices through the routers, and the method comprises the following steps:
A) the APP of the mobile terminal sends a network ID distribution instruction which accords with an AT instruction set data format to the coordinator through the gateway and the UART interface in sequence, and a network ID is distributed to the coordinator; the AT instruction set data format comprises a start character, an address, a separator, a command symbol, a numerical value and an end symbol, wherein the start character is ═ and the end symbol is #, the network ID is a 9-digit decimal number and is 4-byte data after being converted into a hexadecimal number, the high 6 digits of the network ID represent a password, the low 3 digits of the network ID represent a wireless physical channel, and the network ID is modifiable;
B) the APP of the mobile terminal sends a registration starting command which accords with an AT instruction set data format to the coordinator through the gateway and the UART interface in sequence;
C) long pressing any key of the terminal equipment, sending reported data to the coordinator by the terminal equipment according to an appointed wireless physical channel, adding the terminal equipment to the registry after the coordinator receives the reported data, then sending a current network ID to the terminal equipment, informing the terminal equipment of modifying the network ID, and exiting a registration mode;
D) the terminal equipment receives the current network ID and then works according to the current network ID and a wireless physical channel contained in the current network ID;
E) repeating the registration process from the step B) to the step D) until all the terminal equipment is registered;
F) when the coordinator cannot directly control the terminal equipment, the APP of the mobile terminal sends a route rewriting command containing a node ID to the corresponding router, and the corresponding router enters a route rewriting state, then sends a command containing an equipment ID, adds all terminal equipment needing to be routed, sends an ending command containing the node ID to the corresponding router, and enables the corresponding router to end a rewriting process; the equipment ID is 9 decimal numbers and is converted into 4 bytes of data after hexadecimal, the equipment ID is fixed after leaving a factory, the equipment ID at least comprises a type, a mode and parameters, the equipment ID represents a large type by the initial number, and the subsequent number represents a small type; the network ID and the equipment ID form an 8-byte address;
G) the APP of the mobile terminal sends a control instruction which accords with the AT instruction set data format to the coordinator sequentially through the gateway and the UART interface, and the coordinator converts the control instruction into physical layer data and sends the physical layer data to the air; the physical layer data comprises a 4-byte guide code, a 4-byte synchronous code, a 1-byte data length, a 1-byte packet sequence number, n-byte MAC layer data and 2-byte CRC check bits, wherein n is an integer greater than 1; the MAC layer data comprises a frame header, a network ID, a data format, the equipment ID, an operation command and a numerical value;
H) after receiving the physical layer data, the terminal equipment judges whether the equipment ID contained in the MAC layer data in the physical layer data is own, if so, the terminal equipment executes corresponding operation according to an operation command contained in the MAC layer data, and simultaneously sends a response data packet to the coordinator, and the coordinator receives the response data packet, converts the response data packet into data conforming to the AT instruction set data format and outputs the data from the UART interface; otherwise, discarding the physical layer data.
In the communication method of the internet of things system based on the simplified internet of things communication protocol, the network ID allocation command is a XXXXXXXYYY (identity) command, and the registration starting command is a 99999999999 (identity) command, R1 (identity) command.
In the communication method of the IOT system based on the simplified IOT communication protocol, the network ID of each coordinator is generated by the APP of the mobile terminal or the MAC address of the gateway, and terminal devices with the same network ID can communicate.
In the communication method of the internet of things system based on the simplified internet of things communication protocol, the command in the AT instruction set is capital letters or lowercase letters, the capital letters represent downlink data, the lowercase letters represent uplink data, 0-64 is reserved, the numerical value in the AT instruction set is 0-127, and the numerical value is 0X80-0XFF after being converted by A2R.
In the communication method of the IOT system based on the simplified IOT communication protocol, the terminal equipment obtains the network ID in a registration mode, the coordinator enters a registration mode firstly and waits for the terminal equipment to register, after the terminal equipment is registered, the coordinator stores an equipment registry, and an appointed wireless physical channel is adopted between the coordinator and the terminal equipment during the registration.
In the communication method of the internet of things system based on the simplified internet of things communication protocol, the byte length of the synchronous code is the data length of the MAC layer plus a packet sequence number of 1 byte.
In the communication method of the internet of things system based on the simplified internet of things communication protocol, the routing function of the router can be closed, and when the routing function is needed, the routing function is selected by the APP of the mobile terminal in advance, and then the routing function is written into the corresponding router after sequentially passing through the gateway and the coordinator.
In the communication method of the internet of things system based on the simplified internet of things communication protocol, the address is allocated to the terminal equipment according to the equipment ID.
In the communication method of the IOT system based on the simplified IOT communication protocol, the equipment ID in the downlink command sent by the coordinator is the ID of the target terminal equipment, and the equipment ID when the terminal equipment actively sends or responds to the coordinator command is the source address.
The communication method of the Internet of things system based on the simplified Internet of things communication protocol has the following beneficial effects: the method adopts a simplified AT instruction set, changes the beginning character 'AT' of the traditional AT instruction into 'and changes the carriage return line change character into' #, thus saving the sending and processing time, because the coding is shorter, the power consumption can be obviously reduced in a low-power wireless wake-up (WOR) system, the network ID is a 9-bit decimal number and is 4 bytes after being converted into a 16-bit number, the network ID can be modified, the high 6-bit number of the network ID represents a password, the low 3-bit number represents a wireless physical channel, because of 256 wireless physical channels, the method of manually selecting the channel is adopted, the reliability is better, the working stability is higher, the network ID and the equipment ID form an 8-byte address, the network ID can be modified by a user, the equipment ID is fixed when leaving a factory and can not be modified, and the problem of repeated codes in the application process can be effectively reduced by adopting the method, therefore, the method can save sending and processing time, has better reliability and higher working stability, effectively reduces the problem of repeated codes in the application process, and can realize low power consumption.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a communication method of an internet of things system based on a simplified internet of things communication protocol according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a symmetric network topology in the embodiment;
FIG. 3 is a diagram illustrating the conversion of the AT instruction set into hexadecimal data according to the embodiment;
FIG. 4 is a diagram showing the data format of the AT command set in the embodiment;
FIG. 5 is a diagram illustrating the conversion of AT command set to MAC layer data in the embodiment;
FIG. 6 is a diagram illustrating a MAC data to AT command set according to the embodiment;
fig. 7 is a data format diagram of physical layer data in the embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment of the communication method of the internet of things system based on the simplified internet of things communication protocol, the communication method of the internet of things system based on the simplified internet of things communication protocol is applied to the internet of things system, the internet of things system comprises an APP (application), a gateway, a coordinator, a plurality of routers and a plurality of terminal devices of a mobile terminal, the coordinator is connected with the gateway through a UART (universal asynchronous receiver/transmitter) interface and is also directly connected with the routers and the terminal devices, and the coordinator is also connected with other routers or terminal devices through the routers. The system of the internet of things adopts a medium-symmetry network topology structure, the schematic diagram of the symmetrical network topology structure is shown in fig. 2, as can be seen from fig. 2, each system only has one coordinator, the coordinator is connected with a gateway (specifically, an MCU of the gateway) through a UART interface, and the coordinator is responsible for establishing a network and is responsible for converting and forwarding data packets. The coordinator is internally provided with a registry (namely a device table), and the registry is established during registration. It is worth mentioning that the name of the APP of the mobile terminal may be internet of things communication.
The router is a node with a data forwarding function, and all nodes with power supplies can be used as routers (routing nodes). End nodes are battery powered devices that do not have routing functionality. In order to reduce network delay, only one-stage forwarding is adopted. The routing function of the router can be closed, when the routing function is needed, the node needing routing needs to be written into the router in advance, and the process generally comprises the steps of selecting the node on the APP of the mobile terminal, and then writing the routing function into the corresponding router after sequentially passing through the gateway and the coordinator.
In this embodiment, a flowchart of the communication method of the internet of things system based on the simplified internet of things communication protocol is shown in fig. 1. In fig. 1, the communication method of the internet of things system based on the simplified internet of things communication protocol includes the following steps:
step S01, the APP of the mobile terminal sends a network ID distribution instruction conforming to the AT instruction set data format to the coordinator through the gateway and the UART interface in sequence, and a network ID is distributed to the coordinator: in this step, the APP of the mobile terminal sequentially sends a network ID assignment command (for example, ID # command:xxxxxxyyyy) conforming to the AT command set data format to the coordinator via the gateway and the UART interface, and assigns a network ID to the coordinator. The AT instruction set data format diagram is shown in fig. 4, the AT instruction set data format includes a start character, an address, a delimiter, a command symbol, a numerical value, and an end symbol, where the start character is ═ and the end symbol is #, the simplified internet of things communication protocol adopts a simplified AT instruction set, the start character "AT" of a conventional AT instruction is changed to ═ and the return line-changing character is changed to "#", so as to save sending and processing time. The AT command can support more than 80% of internet of things devices, which can be referred to table 1 (described later in table 1), so that the development difficulty can be greatly simplified. For example: the APP of the mobile terminal sends a xxxxxxxyyy, ID # command (e.g.: 641223170, ID #) to the coordinator via the UART interface, and assigns a network ID to the coordinator. The requirement is different from the network ID of other coordinators in the internet of things system, and the wireless communication channel at a short range is different. For security, the network ID assignment principle is as random and discrete as possible.
It should be noted that, in this embodiment, the network ID is a 9-bit decimal number xxxxyy, and is 4 bytes of data after being converted into a hexadecimal number, the high 6-bit number xxxxxx of the network ID can be arbitrarily defined to represent a password, the low 3-bit yy of the network ID is 0 to 255 to represent a wireless physical channel, and because there are 256 wireless physical channels, a method of manually selecting a channel is adopted, which has better reliability and more stable operation. This definition of the network ID allows the password to be integrated with the wireless communication channel and can be represented by a 4 byte long integer. The network ID of each coordinator is generated by the APP of the mobile terminal or by the MAC address of the gateway, and only terminal devices with the same network ID can communicate. It is worth mentioning that the network ID is modifiable.
Step S02, the APP of the mobile terminal sends a registration start command conforming to the data format of the AT instruction set to the coordinator through the gateway and the UART interface in sequence: in this step, the APP of the mobile terminal sequentially sends a registration start command conforming to the AT instruction set data format to the coordinator through the gateway and the UART interface, where the registration start command is 9999999 # R1# command.
Step S03, pressing any key of the terminal device for a long time, the terminal device sending the reported data to the coordinator according to the appointed wireless physical channel, the coordinator adding the terminal device to the registry after receiving the reported data, then sending the current network ID to the terminal device, informing the terminal device to modify the network ID, and exiting the registration mode: in this step, any key of the terminal device is pressed for a long time, the terminal device sends the reported data to the coordinator according to the appointed wireless physical channel, the coordinator adds the terminal device to the registry after receiving the reported data, then sends the current network ID to the terminal device, informs the terminal device to modify the network ID, and exits the registration mode.
Step S04, after receiving the current network ID, the terminal device operates according to the current network ID and the wireless physical channel included in the current network ID: in this step, the terminal device receives the current network ID and then operates according to the current network ID and the wireless physical channel included in the current network ID.
Step S05 repeats the registration process of the above-described steps S02 to S04 until all terminal devices are registered: in this step, the registration process of the above steps S02 to S04 is repeated until all terminal devices are registered.
Step S06, when the coordinator cannot directly control the terminal device, the APP of the mobile terminal sends a route rewrite command including the node ID to the corresponding router, and causes the corresponding router to enter a route rewrite state, and then sends a command including the device ID, and after adding all the terminal devices that need to be routed, sends an end command including the node ID to the corresponding router, and causes the corresponding router to end the rewrite process: in this step, when the coordinator cannot directly control the terminal device, the APP of the mobile terminal sends a route rewriting command including the node ID to the corresponding router, and causes the corresponding router to enter a route rewriting state, and then sends a command including the device ID, adds all the terminal devices that need to be routed, and then sends an end command including the node ID to the corresponding router, and causes the corresponding router to end the rewriting process. Assuming that the coordinator is far away from the end device with device ID 730000222 and cannot directly control it, and needs a router with node ID 730000111, an operation flow is required to write 730000222 this device ID into the routing table of 730000111. The specific process is as follows: the APP of the mobile terminal firstly sends 730000111 and ZY # commands to the router, enters a route rewriting state, then sends 730000222 and WA # commands (730000222 and WM # commands are sent to the router if the commands are removed), adds all the routers needing to be routed, then sends 730000111 to the router, and ZX # commands end the rewriting process.
It is worth mentioning that the device ID on each terminal is a 9-digit decimal number, the device ID is converted into 4-byte data after hexadecimal, the device ID is factory-fixed and can not be modified, the device ID at least comprises a type, a mode and parameters, the device ID represents a large type by the beginning number, and the subsequent numbers represent a small type; that is, different types of terminal devices are distinguished by the first digit, and the coordinator acquires the device ID of the terminal device after the terminal device is registered, and stores the device ID in the registry.
The simplified Internet of things communication protocol is simplified, the two addresses are not used simultaneously, only one address is used, the address when data is downloaded is the address of the target device, and the address when data is uploaded is the address of the source device. That is, the device ID in the downlink command issued by the coordinator is the ID of the target terminal device, and the device ID when the terminal device actively transmits or responds to the coordinator command is the source address. In this embodiment, address allocation is performed for the terminal device according to the device ID. The address allocation table of the terminal device is shown in table 1, and in table 1, the simplified internet of things communication protocol allocates addresses to various devices for smart homes and internet of things, so that the device types and main parameters can be identified only by device IDs. The contents of table 1 are specifically as follows:
TABLE 1
In this embodiment, the network ID and the device ID constitute an 8-byte address. The network ID is user modifiable and the device ID is factory fixed and not modifiable. The method can effectively reduce the problem of repeated codes in the application process. Even if the device IDs are the same, as long as the network IDs are different, false control cannot be caused.
Step S07, the APP of the mobile terminal sends the control instruction conforming to the AT instruction set data format to the coordinator through the gateway and the UART interface in turn, and the coordinator converts the control instruction into physical layer data and sends the physical layer data to the air: in this step, after the terminal device is registered, the terminal device can be controlled by the coordinator. Specifically, the APP of the mobile terminal sequentially sends a control instruction conforming to the data format of the AT instruction set to the coordinator through the gateway and the UART interface, and the coordinator converts the control instruction into physical layer data and sends the physical layer data to the air, where fig. 3 is a schematic diagram of the embodiment in which the AT instruction set is converted into hexadecimal data, for example: when controlling a three-bit switch, the APP of the mobile terminal sends 735000133, M7# command to the coordinator, and the coordinator converts 735000133, M7# command into physical layer data (over-the-air data packet) in format FE AA CA 5B 07544536 CF 2B 4D 87, and then sends it over-the-air.
Fig. 7 is a data format diagram of physical layer data in this embodiment, in fig. 7, the physical layer data includes a 4-byte preamble, a 4-byte synchronization code, a 1-byte data length, a 1-byte packet sequence number, n-byte MAC layer data, and 2-byte CRC check bits, where n is an integer greater than 1; the MAC layer data comprises a frame header, a network ID, a data format, a device ID, an operation command and a numerical value. The simplified Internet of things communication protocol is characterized in that an AT instruction set is adopted for communication, the length of data converted into an MAC layer is only 12 bytes, the AT instruction set can support more than 80% of Internet of things equipment, and the development difficulty can be greatly simplified. Due to the fact that the code is short, power consumption can be obviously reduced in a low-power wireless wake-up (WOR) system, and through practical tests, the power consumption of the ZIGBEE wireless wake-up system is only one fifth of that of ZIGBEE.
In the physical layer, the air rate can be freely defined, and a 10K rate is preferably used. The sync code can be freely defined, and the byte length of the sync code is the MAC layer data length plus a 1-byte packet sequence number. When the packet sequence number is automatically increased by 1 for each transmission, the cycle is between 0 and 255. The polynomial for the CRC check bits may be chosen to be CRC-CCITT or CRC-IBM, with software calculations if hardware does not support it.
It should be noted that in the present embodiment, when the coordinator receives the AT command set, it converts the AT command set into MAC layer data and transmits the MAC layer data in an RF manner, as shown in fig. 5. On the contrary, when receiving the RF data of the MAC layer, it is converted into an AT command set and outputted from the UART interface, see fig. 6.
Step S08, after receiving the physical layer data, the terminal device determines whether the device ID included in the MAC layer data in the physical layer data is its own: in this step, after receiving the physical layer data, the terminal device determines whether the device ID included in the MAC layer data in the physical layer data is its own, and if the determination result is yes, performs step S09; otherwise, step S10 is executed.
Step S09, the terminal device executes corresponding operations according to the operation commands contained in the MAC layer data, and sends a response packet to the coordinator, and the coordinator receives the response packet, converts the response packet into data conforming to the AT command set data format, and outputs the data from the UART interface: if the judgment result of the above step S08 is yes, the present step is executed. In this step, the terminal device executes corresponding operations according to the operation commands contained in the MAC layer data, and simultaneously sends the response data packet to the coordinator, and the coordinator receives the response data packet, converts the response data packet into data conforming to the AT instruction set data format, and outputs the data from the UART interface. For example: the three lamps are lighted, and simultaneously, a response data packet FE AA CA 5B 07544536 CF 2B 6D 87 is sent to the coordinator, and the coordinator receives the response data packet FE AA CA 5B 07544536 CF 2B 6D 87 and converts the data packet into an AT command 735000133, m7# and outputs the AT command from the UART interface.
Step S10 discards physical layer data: if the judgment result of the above step S08 is no, the present step is executed. In this step, the physical layer data is discarded and the table lookup process is performed. The invention can save sending and processing time, has better reliability and higher working stability, effectively reduces the problem of repeated codes in the application process and can realize low power consumption.
It should be noted that in this embodiment, the commands in the AT instruction set are generally capital letters or lowercase letters, the capital letters represent downlink data, the lowercase letters represent uplink data, and 0 to 64 are reserved. The values in the AT command set are 0-127, converted to 0X80-0XFF by A2R. In the AT instruction set, the command is 1 byte and the data is also 1 byte.
In this embodiment, the terminal device obtains the network ID through a registration mode, the coordinator enters a registration mode first, waits for the terminal device to register, and stores the device registry after the terminal device registers, so that only the registered terminal device can control the device registry. During the registration period, the coordinator and the terminal equipment adopt the appointed wireless physical channel, and the wireless physical channel can be freely appointed.
In a word, the simplified internet of things communication protocol has the characteristic of low power consumption, code matching control can be performed between terminal devices under the condition that no coordinator exists, the simplified internet of things communication protocol can be used on an internet of things product, and the simplified internet of things communication protocol can be named as an AllGo protocol. The invention can save sending and processing time, has better reliability and higher working stability, effectively reduces the problem of repeated codes in the application process and can realize low power consumption.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A communication method of an IOT system based on a simplified IOT communication protocol is characterized in that the communication method is applied to the IOT system, the IOT system comprises an APP (application), a gateway, a coordinator, a plurality of routers and a plurality of terminal devices of a mobile terminal, the coordinator is connected with the gateway through a UART (universal asynchronous receiver/transmitter) interface and is also directly connected with the plurality of routers and the plurality of terminal devices, and the coordinator is also connected with other routers or terminal devices through the routers, and the method comprises the following steps:
A) the APP of the mobile terminal sends a network ID distribution instruction which accords with an AT instruction set data format to the coordinator through the gateway and the UART interface in sequence, and a network ID is distributed to the coordinator; the AT instruction set data format comprises a start character, an address, a separator, a command symbol, a numerical value and an end symbol, wherein the start character is ═ and the end symbol is #, the network ID is a 9-digit decimal number and is 4-byte data after being converted into a hexadecimal number, the high 6 digits of the network ID represent a password, the low 3 digits of the network ID represent a wireless physical channel, and the network ID is modifiable;
B) the APP of the mobile terminal sends a registration starting command which accords with an AT instruction set data format to the coordinator through the gateway and the UART interface in sequence;
C) long pressing any key of the terminal equipment, sending reported data to the coordinator by the terminal equipment according to an appointed wireless physical channel, adding the terminal equipment to a registry after the coordinator receives the reported data, then sending a current network ID to the terminal equipment, informing the terminal equipment of modifying the network ID, and exiting a registration mode;
D) the terminal equipment receives the current network ID and then works according to the current network ID and a wireless physical channel contained in the current network ID;
E) repeating the registration process from the step B) to the step D) until all the terminal equipment is registered;
F) when the coordinator cannot directly control the terminal equipment, the APP of the mobile terminal sends a route rewriting command containing a node ID to the corresponding router, and the corresponding router enters a route rewriting state, then sends a command containing an equipment ID, adds all terminal equipment needing to be routed, sends an ending command containing the node ID to the corresponding router, and enables the corresponding router to end a rewriting process; the equipment ID is 9 decimal numbers and is converted into 4 bytes of data after hexadecimal, the equipment ID is fixed after leaving a factory, the equipment ID at least comprises a type, a mode and parameters, the equipment ID represents a large type by the initial number, and the subsequent number represents a small type; the network ID and the equipment ID form an 8-byte address;
G) the APP of the mobile terminal sends a control instruction which accords with the AT instruction set data format to the coordinator sequentially through the gateway and the UART interface, and the coordinator converts the control instruction into physical layer data and sends the physical layer data to the air; the physical layer data comprises a 4-byte guide code, a 4-byte synchronous code, a 1-byte data length, a 1-byte packet sequence number, n-byte MAC layer data and 2-byte CRC check bits, wherein n is an integer greater than 1; the MAC layer data comprises a frame header, a network ID, a data format, the equipment ID, an operation command and a numerical value;
H) after receiving the physical layer data, the terminal equipment judges whether the equipment ID contained in the MAC layer data in the physical layer data is own, if so, the terminal equipment executes corresponding operation according to an operation command contained in the MAC layer data, and simultaneously sends a response data packet to the coordinator, and the coordinator receives the response data packet, converts the response data packet into data conforming to the AT instruction set data format and outputs the data from the UART interface; otherwise, discarding the physical layer data.
2. The communication method of the internet of things system based on the simplified internet of things communication protocol as claimed in claim 1, wherein the network ID assignment command is xxxxxxxyyy, ID # command, and the registration start command is 9999999, R1# command.
3. The communication method of the IOT system according to claim 2, wherein the network ID of each coordinator is generated by the APP of the mobile terminal or the MAC address of the gateway, and the terminal devices with the same network ID can communicate.
4. The communication method for the IOT system according to any one of claims 1 to 3, wherein the commands in the AT command set are capital letters or lowercase letters, the capital letters represent downlink data, the lowercase letters represent uplink data, 0-64 is reserved, the values in the AT command set are 0-127, and the converted values are 0X80-0XFF after A2R.
5. The communication method of the IOT system based on the IOT communication protocol as claimed in claim 4, wherein the terminal device obtains the network ID through registration, the coordinator enters a registration mode first and waits for the terminal device to register, after the terminal device registers, the coordinator stores a device registration table, and an agreed wireless physical channel is adopted between the coordinator and the terminal device during registration.
6. The communication method of the IOT system based on the simplified IOT communication protocol according to claim 4, wherein the routing function of the router can be closed, and when the routing function is needed, the routing function is written into the corresponding router after being selected by the APP of the mobile terminal in advance and passing through the gateway and the coordinator in sequence.
7. The communication method of the internet of things system based on the simplified internet of things communication protocol according to claim 1, wherein the terminal device is assigned an address according to the device ID.
8. The communication method of the internet of things system based on the compact internet of things communication protocol as claimed in claim 1, wherein the device ID in the downlink command issued by the coordinator is the ID of the target terminal device, and the device ID when the terminal device actively sends or responds to the coordinator command is the source address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710517256.3A CN107147743B (en) | 2017-06-29 | 2017-06-29 | Communication method of Internet of things system based on simplified Internet of things communication protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710517256.3A CN107147743B (en) | 2017-06-29 | 2017-06-29 | Communication method of Internet of things system based on simplified Internet of things communication protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107147743A CN107147743A (en) | 2017-09-08 |
CN107147743B true CN107147743B (en) | 2020-04-03 |
Family
ID=59784628
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710517256.3A Active CN107147743B (en) | 2017-06-29 | 2017-06-29 | Communication method of Internet of things system based on simplified Internet of things communication protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107147743B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108337308B (en) * | 2018-01-31 | 2021-08-10 | 高新兴物联科技有限公司 | Data communication method, device and system for LWM2M client and upper computer |
CN112261679A (en) * | 2020-10-22 | 2021-01-22 | 常熟开关制造有限公司(原常熟开关厂) | ZigBee network rapid networking configuration method and ZigBee network |
CN113055449A (en) * | 2021-03-02 | 2021-06-29 | 福建钰辰微电子有限公司 | Wireless autonomous networking method and system for sensor based on Internet of things, and computer equipment |
CN113127486B (en) * | 2021-04-13 | 2023-03-14 | 山东英信计算机技术有限公司 | Information collection and storage method, device, equipment and storage medium |
CN113207097B (en) * | 2021-04-29 | 2023-05-30 | 深圳市欧瑞博科技股份有限公司 | Intelligent equipment networking method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102736599A (en) * | 2012-06-14 | 2012-10-17 | 华北电力大学(保定) | Real-time interaction intelligent terminal control system based on internet of things technology |
CN103312546A (en) * | 2013-06-14 | 2013-09-18 | 杭州沃云科技有限公司 | Method for automatically configuring and managing ZigBee network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103795785B (en) * | 2014-01-16 | 2019-01-08 | 加一联创电子科技有限公司 | Internet of Things network control method and terminal |
-
2017
- 2017-06-29 CN CN201710517256.3A patent/CN107147743B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102736599A (en) * | 2012-06-14 | 2012-10-17 | 华北电力大学(保定) | Real-time interaction intelligent terminal control system based on internet of things technology |
CN103312546A (en) * | 2013-06-14 | 2013-09-18 | 杭州沃云科技有限公司 | Method for automatically configuring and managing ZigBee network |
Non-Patent Citations (1)
Title |
---|
基于ZigBee技术的智能家居测控***的实现;包春兰;《河北工业大学》;20131201;第5、6章 * |
Also Published As
Publication number | Publication date |
---|---|
CN107147743A (en) | 2017-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107147743B (en) | Communication method of Internet of things system based on simplified Internet of things communication protocol | |
CN109474969B (en) | Hybrid communication method and system based on IEEE802.15.4 and Bluetooth low energy protocol stack | |
Nieminen et al. | Ipv6 over bluetooth (r) low energy | |
US8103784B2 (en) | Communication device and communication control method using efficient echonet address determination scheme | |
US8320286B2 (en) | Infrastructure offload wake on wireless LAN (WOWL) | |
US7376137B2 (en) | Method and system for communication between coordinator-based wireless networks | |
EP3288296B1 (en) | Method and system for building steady piconet based on bluetooth | |
WO2005008994A1 (en) | Method and system for generating ip addresses of access terminals and transmitting messages for generation of ip addresses in an ip system | |
CN111083654B (en) | Method for realizing control of wireless passive switch, wireless passive switch and proxy node | |
CN103713608A (en) | Hierarchical network architecture of wireless Internet-of-Things home system and networking communication method thereof | |
US8340116B2 (en) | Node scheduling and address assignment within an ad-hoc communication system | |
CN112532756B (en) | Interface expansion method, device and system | |
CN113365294A (en) | Node and method for directed acyclic graph network configuration | |
US7349413B2 (en) | Method and apparatus for communicating between coordinator-based wireless networks connected through a backbone network | |
CN110062060B (en) | System and method for IP address allocation | |
CN109361558B (en) | Distributed wireless ad hoc network management method based on grid network equipment proxy node | |
CN114025262A (en) | Data intercommunication method between edge ONTs in FTTR system, optical gateway and edge ONT equipment | |
Nieminen et al. | RFC 7668: IPv6 over BLUETOOTH (R) Low Energy | |
CN107172573B (en) | zigbee terminal communication data processing method | |
JP4549055B2 (en) | Setting method of network address in wireless personal area network | |
KR20080072784A (en) | Method for automatically assigning ipv6 address in sensor network based ipv6 | |
KR20080072780A (en) | Gateway and method for transforming a packet using the same | |
WO2018072544A1 (en) | Information transmission method and station | |
KR20080072778A (en) | Gateway and method of interoperating between internet protocol-ubiquitous sensor network and simple network management protocol network | |
CN117440472A (en) | Networking method, device and system based on Bluetooth broadcast |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |