Practice of migration of GPS locator equipment based on TCP protocol to Alibaba Cloud IoT platform

Background

The GPS locator is a terminal with a built-in GPS module and mobile communication module, which is used to transmit the positioning data obtained by the GPS module to a server on the Internet through the mobile communication module, so that the terminal location can be queried on a computer or mobile phone.

GPS locators can be used to control the whereabouts of children and the elderly, road patrol inspection, tracking of valuable goods, tracking and service dispatch, private detective tools, tracking of personal belongings, tracking of pets, tracking of wild animals, freight industry, car anti-theft, bicycle anti-theft, electric vehicle anti-theft, motorcycle anti-theft, bank cash carrying vehicles, business vehicle management, etc.

Traditional locator scheme

After the locator device is started, it establishes a connection with the cloud based business server based on TCP/IP protocol, synchronizes the clock through timing instructions, and then sends heartbeat packets regularly to maintain a long TCP connection. When the GPS data changes beyond the threshold, it automatically reports the longitude and latitude values of the current coordinates, and the information about the changes in the device's power will also be reported to the cloud regularly to optimize the GPS data collection rules.

The cloud server can also push configuration information and control instructions to the locator device to change the behavior mode of the locator.

Locator business on cloud

With cloud computing manufacturers deploying IoT scenario technology products, the fully hosted IoT cloud service based on MQTT protocol has gradually become the preferred solution for 70% of SMEs to do IoT business. The scheme of migrating from TCP protocol to MQTT protocol is also gradually mature, so as to realize the low-cost and rapid migration of the stock equipment to the cloud, reduce the transformation of the device side and the business system, greatly improve the overall security and stability, greatly reduce the service delay, and carry the massive scale growth with the help of the cloud's dynamic unlimited capacity expansion.

After we migrate the device connection to the Alibaba Cloud IoT platform, we reorganize the business links. We will find that IoT services carry heavy work of interacting with devices, and the pressure on the cloud business servers becomes much less.

Identity authentication

The locator device communicates with the IoT IoT platform based on MQTT protocol, and the TCP message is adjusted to the MQTT CONNECT/CONNACK message. At this time, the business server does not need to do identity verification. The IoT IoT platform will push the online/offline message of the device to the business server in real time through the rule engine.

Clock synchronization

The clock synchronization service built by enterprises based on TCP can also be offline. The IoT Internet of Things platform provides a complete NTP service to solve the problem of limited embedded device resources and no accurate timestamp on the end. Detailed documentation https://help.aliyun.com/document_detail/102509.html

Heartbeat

The MQTT protocol itself stipulates the heartbeat mechanism of PINGREQ/PINGRESP. At this time, the business server does not need to intervene. The IoT Internet of Things platform will respond to the heartbeat behavior of the device.

Two way message communication

MQTT based communication requires agreement on Topic and payload. In order to reduce changes to the business system, we add two topic definitions, and the message structure remains unchanged.

After the equipment reports the business data, through the rule engine configuration, we transfer the payload data in the uplink Topic:/{pk}/{dn}/user/up to the business system in real time, with the data format unchanged; When the business system pushes configuration information or instructions, the IoT IoT platform is encapsulated into the payload in the downlink Topic:/{pk}/{dn}/user/up, and the format of the business data received by the device remains unchanged.

Migration Practice

Create products and define communication topics

Create a server subscription consumption group

Configure Rule Engine

The data reported by the device is transferred to the server subscription consumption group

Select a consumption group and carry the tag information to the business system

The number of data received at the service server after the device is started and the data is reported.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us