Research on Intelligent Monitoring of Urban Environment under the Environment of the Internet of Things

. With the development of the economy, human society has gradually strengthened the emphasis on environmental protection. Environmental monitoring, early warning, and governance have become important worldwide tasks. Traditional urban environmental monitoring relies on environmental monitoring stations. Manual data collection, processing, and analysis often consume a lot of manpower, and at the same time, efficiency and accuracy are lacking. The Internet of Things and sensors enable people to carry out unmanned collection, transmission, and analysis. This paper discusses the research on intelligent monitoring of the urban environment under the Internet of Things, designs the scheme from the software and hardware perspective, and proposes a time series data prediction method based on the Gaussian process. It is hoped that this article can provide some references for applying the collected massive environmental data.


Introduction
With the in-depth practice of high-quality economic development, environmental protection issues have become the main theme of urban construction and economic development. For environmental protection work, continuous monitoring and analysis are one of its core work contents. Traditional environmental monitoring is done through environmental monitoring stations, and staff needs to read and collect data manually periodically. This method may lead to errors in measurement equipment and manual readings. It will also consume much workforce in data collection and processing, making it difficult to efficiently conduct environmental monitoring. In particular, with the improvement of environmental monitoring methods, the demand for environmental data monitoring with higher real-time performance has been raised, and new requirements have been put forward for the accuracy, real-time performance, and processing capacity of data collection. Especially in environmental governance, staff needs to carry out accurate tracking and real-time monitoring of environmental governance goals to achieve dynamic evaluation [1]. With the development of information technology and the Internet of Things, especially the rapid development of the semiconductor industry, people can use electronic sensors for automatic data collection. With devices such as sensors and the Internet of Things, environmental monitoring activities can change from the traditional manual collection, reporting, and statistics to computer equipment and Internet of Things devices for unmanned collection, transmission, and analysis. Furthermore, using the cloud platform to build an intelligent monitoring system for the urban environment can achieve high-precision data collection and processing through various sensors and improve the efficiency of environmental monitoring.

Requirement analysis of intelligent monitoring system for urban environments
Its core workflow for traditional environmental monitoring work is mainly data reading, data recording, data statistics, and comparative data analysis. Among them, data reading and recording need to be collected manually, and data statistics and data comparison rely on computer systems, which are completed through databases and data calculation modules. The urban environment intelligent monitoring method and system under the Internet of Things environment designed in this paper need to fully cover the existing environmental monitoring business, replace manual work with Internet of Things equipment, and establish a data acquisition, storage, and analysis system for mass monitoring data [2].
Based on the above overall requirements, the environmental intelligent monitoring system based on the Internet of Things should at least provide the following basic functions and modules: (1) Environmental detection module based on the Internet of Things: This module aims at environmental detection and needs to complete fully automatic periodic environmental data monitoring. It should include the access of multiple sensors, including temperature and humidity sensors, carbon monoxide sensors, and fine particle sensors, to achieve real-time collection of corresponding environmental data.
(2) IoT (Internet of Things) communication link and data transmission module of the gateway: Since urban environmental monitoring activities are often spread across various areas of the city, it has wide coverage, intensive terminal deployment, and a high frequency of data communication. Therefore, stable, efficient, and reliable data communication links and communication gateways are the basic guarantees for system operation.
(3) Environmental data storage: The basis of intelligent monitoring of the urban environment is massive environmental data. The system should provide storage and query facilities for massive data to meet the actual needs of business and monitoring activities.
Environmental data storage and processing should reach TB level.
(4) Business management and monitoring: The system should provide a basic business management system, including sensor location management, area management, data management, data analysis, data development trend comparison, etc. At the same time, to improve the effectiveness and timeliness of data monitoring, the system should usually provide data management capabilities.

Overall system architecture design
Based on the above requirements, the whole set of intelligent monitoring systems for IoT environments shall include three parts: the perception layer, the transmission layer, and the application layer. Among them, the perception layer is used for external data monitoring and collection. The transport layer is responsible for completing data forwarding and transmission tasks, and the service and application layer mainly carries the main service and provides data access, business processing, and other services for business personnel [3].

Design of Perception Layer
The perception layer is a sensor network formed by the aggregation of all sensors and terminal nodes and is the data source of the entire IoT environmental monitoring system. The perception layer comprises sensors, terminal nodes, and terminal node coordinators. For the convenience of node deployment, the ZigBee-based networking and communication methods are considered first. The node coordinator is used to establish the network, and the terminal nodes and routing nodes are added to the network during the networking process to form a shortdistance wireless communication network. When a ZigBee node is offline, data packets can be transmitted through other nodes, thereby ensuring the high availability of the network. It is also one of the typical characteristics of ZigBee networking [4].

Design of hardware platform
According to the overall design of the preamble, the basic structure of the system hardware platform can be determined, as shown in Figure 1 for details.

Design of Sensor Node
The sensor nodes are essentially the terminal nodes described in the figure, and here the design is made for each sensor hardware. Sensors are usually highly packaged modules, and the design of sensor hardware is essentially the design of peripheral drive circuits for sensor modules.

Hardware Design of Temperature and Humidity Sensor
The temperature and humidity sensor are DHT22 (AM2302) sensor. The temperature detection range is -40°C~+80°C, the error is within ±2%, and the humidity detection range is between 0%~99.99%RH. Compared with similar sensors horizontally, the overall error of this module is small, and the accuracy is high. At the same time, because the calibration algorithm is integrated into the module, the output result is stable and reliable, and the data accuracy is high. The module has four pins, among which VCC is used for power supply, which can be driven by providing 3.3V~5V DC input. NC does not participate in work; GND is grounded. SDA is connected to the IO port P_07 of the MCU for command sending and data reading [5].

Hardware Design of Carbon Monoxide Sensor
Alpha sense's CO-B4 sensor is currently a cost-effective carbon monoxide sensor module with a measurement range of 0-1000ppb and accepts a 5V DC power supply.
The output form of the module is an analog signal, which needs to be connected to the ADC sampling port of the main control through a stage impedance conversion circuit, and then the analog signal is converted into a digital signal to read specific measurement data.

Hardware Design of Fine Particle Sensor
The fine particle sensor is a particle sensor that uses laser light for dust detection. The internal structure of the module can be seen in Figure 2. It integrates a laser transmitter and a cavity inside, and the ambient air is sucked into the cavity through a fan on one side of the cavity, and the light scattering measurement module detects the particle density in the cavity. Then, the measurement data output is finally completed using the aluminum foil amplifier circuit and the digital-to-analog conversion module [5]. The module has a high degree of encapsulation and inherits the logic controller internally, so it can also receive instructions and feedback data. The module can communicate through the serial port and complete the output through PWM.

Design of Core Hardware
Core hardware mainly refers to ZigBee coordinator nodes, gateways, etc., which are mainly responsible for data processing and transmission of the hardware part.

Hardware Design of Coordinator Node
The coordinator's core is the design of the ZigBee communication module, which is mainly divided into CC2530 hardware and functional modules. CC2530 is a cost-effective wireless control chip launched by TI. It is mainly used in short-distance, lowpower communication scenarios and is suitable for ZigBee. Its operating voltage is 1.8V, and the receiving and processing current is only 29mA during operation, showing low power consumption. At the same time, the chip supports sleep mode, which can reduce the current to 2mA during device sleep.
The serial port circuit uses RS-232, which is used to interact with the gateway, send instructions and exchange data. The serial port is low-speed asymmetric transmission, suitable for one-way data transmission and instruction reception of small data volumes. To further improve its anti-interference ability, MAX232 can be connected to the serial port side to improve its signal strength and stability and significantly increase the transmission distance and transmission quality.

Design of Gateway Hardware
The gateway is mainly responsible for the forwarding of hardware data. Through the gateway, the sensor data transmitted by ZigBee can be used to send monitoring data to the data storage service on the internet side through 4G and 5G channels.
The gateway part is built using the STM32 solution. Since the gateway function in this scenario is relatively simple, the entry-level STM32F103RCT6 in STM32 is selected. The processor supports general-purpose timers and advanced timers and can provide three high-precision ADC sampling and one high-precision DAC conversion interface. Its on-chip FLASH is up to 256Kb, which can meet the routine data, variable temporary storage, and processing interaction.
In terms of Internet communication, LC6365S supporting TD-TLE mode is adopted as the communication module. The current regional coverage in some cities is not ideal, so support for 5G communication is not considered. The module is connected to the minimum system solution of the microprocessor through the serial port, and the interaction is completed through instructions [6].

The Establishment of a Communication Network of Things Based on ZigBee
The following steps complete the establishment of the ZigBee communication network.
3. The key logic is that a PANID is set for the network when the network is constructed, and the ID is set in the MAC layer and is mainly used for inter-network identification. After the setup is completed, a channel scan will be performed, and if there is no collision, the network and channel will be established based on the PANID and further start to accept the join requests from other nodes [7].

The terminal joins the network.
The terminal joining the network mainly includes three core interaction flows, which may be shown in Figure 4. First, the node is initialized, and the hardware of the terminal device is initialized. The ZDO_start function of the network layer realizes this process. A node initiates a network discovery request, and the network layer performs channel retrieval through the mac layer. If a network is found, a network join request is further initiated, and that feedback of the hardware mac layer has waited. If that join is successful, the network route is further distributed to provide route data for subsequent terminal communication.

Software Design of Coordinate Node
In all the software, the coordinator node software is the foundation and key of network establishment and is also the first part to be executed in the whole ZigBee network.
We can think of the coordinator node software as a cyclic state machine. When the coordinator node starts initialization, all node information is written to the coordinator, after which the network will be established, waiting for each node to connect automatically. Simultaneously, if that serial port information exists, the serial port information is forwarded to the gateway; If a serial stream is written from the gateway, it is sent to the node [8]. This process can be represented by the flow described in figure 5.  Figure 5 Key process of coordination node software

Design of Terminal Node Software
The ZigBee terminal node part enters an initialization state after being powered. If no instruction is received after entering that network, entering a dormant state saves system energy consumption and data transmission resources. Suppose that coordinator obtains the serial port stream from the gateway and analyzes the device code and the instruction, the coordinator forwards the instruction to the corresponding node. In that case, the node drives the sensor to collect data after receiving the instruction and transmits the data back to the coordinator. Then the coordinator sends the data back to the center service by the gateway [9].

Establishment of Distributed Data Warehouse
The business end of the system is an information management system based on the WEB framework. The collection of environmental data is completed through the web service to return the data. The number of sensor nodes required for urban environmental monitoring is vast, the coverage is wide, and the amount of real-time stored data is substantial. Therefore, we consider establishing heterogeneous data sources based on HBase and Hadoop. By establishing distributed data storage service, the data of each environmental monitoring node (gateway) deployed in the city can be efficiently collected and further used for data analysis and prediction.

Prediction of Environmental Data
The business system can provide real-time data browsing and development trend visualization for the collected mass data. At the same time, it can also mine historical data, further predict the development trend, and then guide the development of environmental protection work. Conventional development prediction is often based on time series modeling, combined with multi-step forecasts to infer future data. This time, we consider using the Gaussian process to establish a time series data model for environmental data and use multi-step prediction to predict future ecological development [7]. Assuming that there are historical data s , L, s with time series, the training data X x , L, x of length N can be constructed, where x s , L, s are the regression order. At this time, the training result y x is defined, and the training output can form a vector y y , L, y . Then assume that there is an independent and identically distributed Gaussian noise ω that affects the mapping of x and y , the noise ω conforms to the Gaussian distribution, and the variance is σ , that is, ω : N 0, σ .
In the Gaussian process regression method, for ease of processing, a Gaussian process prior probability distribution can be generally assigned to the function to be evaluated, as described in Equation 1. f|x, θ: N 0, K Among them, K represents a covariance matrix with a size of NxN dimensions, and the elements can be represented by the kernel function K x , y . Based on the above conditions, the probability distribution of the training result y can be expressed as Equation 2. y|x, θ: N 0, K σ I (2) At this time, for the given test input x * and the corresponding output y * , f x * can be obtained according to formula 1. At this point as shown in Equation 3, both f x and f x * are multidimensional Gaussian processes with a mean value of 0 [8].
f x f x * x, x * , θ: N 0, K K * K * K * * According to the above, the joint probability distribution of y and y * can be further deduced as described in formula 4. y y * x, x * , θ: N 0, K σ I K * K * K * * σ According to Gauss's law, Equation 5 can be further deduced.
y * |y, x, θ, σ : N m x * , v x * (5) Among them, the predicted value means m x * and standard deviation v x * can be expressed as Equation 6 and Equation 7. m x * K * K σ I y (6) v x * K * * σ K * K σ I K * (7) If the covariance function (kernel function) and hyperparameters are known, the future environmental data can be predicted.

Conclusion
In this paper, the intelligent monitoring of the urban environment is studied. Based on the business requirements of urban environmental monitoring, the intelligent monitoring scheme of automation, high reliability, and high performance are proposed for urban environmental monitoring by using Internet of Things technology, sensor, and data prediction technology [10]. The communication scheme of the IoT adopted in the scheme is ZigBee, and the corresponding software and hardware architecture is constructed based on ZigBee. Then, we design each part's software function, use the Gaussian process to establish a data prediction method for time series, and apply the collected mass environmental data to environmental analysis and prediction. It is expected that the research of this paper can provide help for environmental work under the background of information technology and the Internet of Things.