Content area
[...]the traditional method of meteorological data collection and transmission has a large delay in data acquisition due to the conversion of public network and internal network, which affects the timeliness of emergency decision-making. The traditional methods of meteorological data collection and transmission are difficult to meet the needs of modern gency This paper proposes an efficient real-time meteorological data collection and emergency response system based on the Internet of things platform. Traditional methods of meteorological data collection and transmission usually rely on regular or irregular data exchange between observation equipment at fixed stations and central data processing system. In general, the traditional methods of meteorological data collection and transmission face challenges in real-time, reliability and flexibility, especially in response to emergencies, which is difficult to meet the needs of rapid access to accurate meteorological information. [...]it is of great significance to improve the efficiency of real-time collection and transmission of meteorological data by exploring new technologies and solutions, such as the application of Internet of things technology and MQTT protocol[10-11].
Abstract With the development of Internet of things technology, the real-time collection and transmission of meteorological data has become particularly important. Especially in response to emergencies such as natural disasters, it is very important to improve the efficiency of decision-making by quickly obtaining accurate meteorological observation data. However, the traditional method of meteorological data collection and transmission has a large delay in data acquisition due to the conversion of public network and internal network, which affects the timeliness of emergency decision-making. This paper proposes a solution based on the Internet of things platform combined with MQTT protocol, which aims to realize the efficient and reliable real-time collection and transmission of meteorological data, shorten the data acquisition time, improve the emergency response speed, and meet the needs of temporary observation.
Key words Internet of things; Meteorological data; MQTT
DOI 10. 19547/j.issn2152 - 3940. 2025. 01. 001
With the intensification of the impact of global climate change in recent years, exireme weather events have occurred frequently, causing a huge threat to human society. In order to effectively respond to such disasters, the meteorological department often carries out temporary observation for the disaster site, and timely and accurate meteorological observation data is particularly important[1]. The traditional methods of meteorological data collection and transmission are difficult to meet the needs of modern gency This paper proposes an efficient real-time meteorological data collection and emergency response system based on the Internet of things platform. Through the introduction of advanced Internet of things technology and MQTT protocol[3-3], it realizes the rapid transmission and processing of meteorological data.
Traditional methods of meteorological data collection and transmission usually rely on regular or irregular data exchange between observation equipment at fixed stations and central data processing system. There are many ways to realize these transmission methods, but there are some limitations, especially in the realtime and reliability of transmission[6]. The following are some of the main features of traditional meteorological data collection and transmission methods.
Manual observation; in the early days, the collection of meteorological data mainly depended on manual observation. This method is not only inefficient, but also prone to error. It is because all data needs to be collected and recorded by people, and is vulnerable to personal subjective factors and work experience[7].
Automatic station network; with the development of technology, automatic weather stations (AWS) are gradually popularized. These stations are equipped with various sensors to automatically collect meteorological data, such as temperature, humidity, wind speed, precipitation, etc. However, these automatic stations usually send data to the data center through telephone line, radio or other limited communication means, which may lead to delay and data loss.[8]
Satellite transmission; for remote areas or observation points on the ocean, satellite communication is a common data transmission method. Although it provides a wide range of coverage, it costs a lot and is greatly affected by weather conditions, which may cause data transmission interruption in bad weather.
Internet transmission; in recent years, many weather stations have begun to use the Internet for data transmission. Although this method improves the speed and reliability of data transmission, there are still some delays due to the conversion between the public network and the internal network[9], especially in the emergency situation requiring rapid response, which may affect the timeliness of decision-making.
Private network: some countries and regions have established special networks for meteorological data transmission to improve the security and stability of data transmission. However, the establishment and maintenance of such a private network requires a lot of resources.
In general, the traditional methods of meteorological data collection and transmission face challenges in real-time, reliability and flexibility, especially in response to emergencies, which is difficult to meet the needs of rapid access to accurate meteorological information. Therefore, it is of great significance to improve the efficiency of real-time collection and transmission of meteorological data by exploring new technologies and solutions, such as
the application of Internet of things technology and MQTT protocol[10-11].
1 System design and implementation
1.1 System architecture The system consists of four main components; meteorological data acquisition terminal, IOT gateway, IOT platform and business system. Each component plays an important role in the process of data collection, transmission and processing. The system architecture is shown in Fig. 1.
1.2 Component introduction Meteorological data acquisition terminal (HY1100) ; the terminal integrates a variety of high-precision meteorological sensors such as rainfall sensor, temperature sensor, humidity sensor, air pressure sensor, and wind speed and direction sensor, which is used to comprehensively and accurately collect all kinds of meteorological data.
IOT gateway (HF2411) : the gateway supports TCP/IP protocol and acts as a bridge to establish and maintain a safe and stable communication connection between the meteorological data acquisition terminal and the Internet of things platform.
IOT platform: the platform provides powerful MQTT access services. MQTT message protocol is suitable for data transmission in unstable network environment. It has the characteristics of low bandwidth consumption and high reliability, and can efficiently receive, process and forward data from meteorological data acquisition terminals.
Business system; through API interface or direct use of realtime data flow function, the business system can easily obtain the required meteorological data and apply it to various actual business scenarios.
1.3 Preliminary works of software development Before software development, the following key steps need to be completed:
Register and log in; make sure you have a valid account and log in successfully.
Create an instance of the Internet of things platform; create a new instance on the IOT platform to lay the foundation for subsequent device registration and data management.
Device registration and certificate acquisition; register the weather station equipment in the Internet of things platform and obtain the necessary equipment certificates, including Product Key, Device Name, and Device Secret.
Configure IOT gateway: according to the requirements of the 10T platform, the IOT gateway is configured to ensure that it can connect to the platform smoothly.
Network connection settings: ensure that the microcontroller can be stably connected to the Internet through the networking module, providing the basis for data transmission.
Establish MQTT connection; using the obtained equipment certificate, HY1100 meteorological data acquisition terminal can establish a safe and reliable connection with the Internet of things platform through MQTT protocol.
Data collection and upload; the HY1100 meteorological data acquisition terminal is used to collect rainfall, temperature, humidity, wind direction, wind speed and other meteorological data in real time. The IOT gateway is used to send the collected data to the 1OT platform through MQTT protocol.
Data flow and application; configure data flow rules on the Internet of things platform to transfer data to other products (such as WeChat applet).
The detailed meteorological data model is defined, including the key attributes such as collection time, air temperature, 3-s wind direction, 3-s wind speed, minute rainfall and their data types and unit information.
Fig.2 shows part of the example code, defining the relevant meteorological elements, while Fig. 3 shows the data structure of physical model of the CAWS600 emergency automatic weather station in detail. These preliminary preparations have laid a solid foundation for the smooth operation of the system and the efficient use of data.
1.4 IOT message parsing script In this section, it will describe in detail how to use specific functions to realize data format conversion between HY1100 collector data and IOT platform.
transformPayload function; the main responsibility of this function is to receive the meteorological data from HY1100 meteorological data acquisition terminal, and convert it into JSON format data expected by the IOT platform after a series of processing. During processing, the function will perform basic data verification operations, such as verifying whether the length of the timestamp is 14 bits to ensure the accuracy and consistency of the data.
protocol ToRawData function; contrary to the transformpayload function, the protocoltorawdata function is responsible for converting the JSON format data received from the IOT platform into the original data format that can be recognized by the HY1100 meteorological data acquisition terminal. This function can handle different types of methods and construct corresponding data packets according to the type of methods, to ensure that the received data can be correctly parsed and used on the HY1100 meteorological data acquisition terminal.
Auxiliary functions; in order to build byte buffers and facilitate data transmission, two auxiliary functions, buffer _uint8 and buffer_int16, are introduced. These functions can convert numerical values into byte arrays suitable for transmission, so as to maintain the integrity and accuracy of data during data transmission.
1.5 Implementation method of data processing in WeChat applet In the WeChat applet "little weather sentry" , the design and implementation of the back-end data processing process is very important. The following are the key steps of the applet's back-end data processing process.
Page initialization; in the data object of the page, the initial data including temperature, humidity, air pressure, wind direction, wind speed and rainfall are predefined.
Page loading: in the onload lifecycle function, there is no special operation, because the data will be loaded in subsequent steps.
Page display: when the page is displayed ( onShow lifecycle function) , the loadData method will be called to load the required data.
Initiate request: the loadData method sends a POST request to the IOT platform through the encapsulated SDK ( aliSdk. request) to obtain the attribute status and other data of the device.
Request parameters and callback processing:
The request parameters include Action, Product Key, and DeviceName, which are used to specify the device to query.
Successful callback: if the request succeeds and the returned data has no error code, the setPropertyData method will be called to update the page data; otherwise, an error message is displayed and the data is reset.
Failed callback if the request fails, the prompt message of network connection failure will be displayed and the data will be reset.
Complete callback; whether the request succeeds or fails, the completion callback will be executed.
Data format conversion and page update :
convertPropertyStatusInfo method is used to convert the device attribute information returned from the 1OT platform into JSON objects in the form of key value pairs.
setPropertyData method updates the display content on the page according to the converted data. If there is no data, the default placeholder is displayed.
Button click event handling:
changeDeviceStatus method is used to handle the event that the user clicks a button to change the device state. Before calling the service, we will disable the button to prevent repeated clicks.
The request parameters include Action, ProductKey, DeviceName, Identifier and Args. The Identifier selects different services according to the current device status.
The request callback processing is similar to the callback processing during data loading, including success callback, failure callback and completion callback.
Request parameter construction and signature generation;
In order to initiate a request, it is necessary to build public request parameters and perform operations such as formatting, sorting, timestamp generation, URL encoding, flattening and normalization on the parameters.
Finally, the stringToSign variable is used to construct the signature string, and HMAC-SHAI signature is generated by crypto. HMAC method.
Initiate HTTP request:
Using the wx. request method, different request URLs and data are constructed according to the request methods ( GET or POST), and an HTTP request is initiated to obtain the required data or perform the corresponding operation.
2 Achievement display
WeChat applet "little weather sentry" displays the station ID number, collection time, temperature, humidity, air pressure, wind direction, wind speed, battery voltage, minute rainfall, hourly rainfall, and daily rainfall (Fig. 4).
3 Conclusions
Through the application of the Internet of things platform and MOTT protocol, the time to obtain the data of HY1100 meteorological data acquisition terminal through the network is reduced to only more than ten minutes, and there is no need for personnel to be on duty after the equipment is deployed, which greatly improves the work efficiency and reduces the personnel burden. The whole meteorological data processing is a fine and multi-step process, which covers many key links from page initialization to loading data, setting front-end data, changing device status, and calling the encapsulated SDK request method. In this process, each step is accurately realized through carefully designed life cycle functions and custom methods, which not only ensures the accuracy of data, but also greatly improves the user's operation experience. It is particularly worth mentioning that the encapsulated SDK request method can automatically generate request parameters and signatures that meet the API specification through a series of carefully choreographed auxiliary functions. This mechanism fundamentally ensures the security and reliability of data requests.
References
[1] HUANG JY, TANG H. Design of automatic weather station based on Aliyun Internet of things platform [J]. Hubeir Agricultural Sciences, 2020, 59(17): 166 - 169.
[2] WANG X, XIE D. Design of automatic weather station operation monitoring platform based on PLCNET cloud gateway and IOT edge computing [J]. Meteorological, Hydrological and Marine Instruments, 2024, 41 (1): 126 - 129.
[3] XU JZ, WU ZY, ZHAO CD. Application of ToT devices based on MQTT protocol in remote monitoring of small hydropower station [ J]. Small Hydro Power, 2024 (4): 67 -70.
[4] LIS, LI YC, XIE №, et al. Research on the application of Internet of things technology in meteorological business[ J]. Management & Technology of SME, 2016(1) ; 223.
[5] ZOU C, ZHANG Z, ZHAO QQ, et al. Field calibration technology for distributed automatic weather station based on internet of things[ J]. Meteorological , Hydrological and Marine Instruments, 2018,35(3): 20 - 24.
[6] LIU JL, XING KY. Application of Nb IOT IOT technology in grass roots meteorological services| J]. Guangdong Meteorology, 2020, 42(2) : 62 - 65.
[7] LI CH, WANG ZL. Design of meteorological monitoring system based on Internet of things technology [ J]. Internet of Things Technologies. 2022, 12(5): 44-45, 51.
[8] XIONG MB, GAO Y, ZHOU LL, et al. Agricultural monitoring system of Internet of things based on MQTT protocol[ J]. Technology and Economic Guide,2019,27(29) ; 32.
[9] SHEN ZQ, ZHAO TX. Design of real-time weather condition monitoring device based on Alicloud [ J]. Computer Knowledge and Technology, 2021,17(36): 160 - 161, 164.
[10] PENG YL, WANG XM. Design and implementation of an IOT sensor node based on MQTT protocol [ J]. Practical Electronics, 2024, 32 (15) : 18 -21.
[11] LU GJ, JIN QF, ZHANG HL. Industrial IOT system based on MQTT gateway connecting PLC and Alibaba cloud IOT platform[ J]. Internet of Things Technologies, 2019, 9(12) : 58 - 60, 63.
* Corresponding author.
Copyright Wu Chu (USA-China) Science and Culture Media Corporation 2025