# Practice of Air Environment Quality Monitoring Data Visualization Technology Based on Adaptive Wireless Sensor Networks

Authors: Fengmei Yin
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

This paper begins by outlining the evolution and current state of traditional wireless sensor networks, followed by an examination of the principle and architecture of wireless sensor networks, as well as the challenges that traditional wireless sensor networks face in environmental monitoring. This paper designs and develops a data visualization system for wireless sensor networks based on the visualization system and the advantages of other visualization systems, after analyzing and comparing the current visualization systems for monitoring wireless sensor networks. A real-time monitoring system for urban air quality based on wireless sensor network is designed to solve the problem that the traditional method of combining manual sampling with laboratory analysis for air quality monitoring is expensive and cannot carry out real-time online monitoring for multiple points at the same time. The system’s implementation is based primarily on air quality monitoring data collected in the Shenyang area for visual display and analysis. The air quality monitoring system proposed in this paper has a complete structure and independent modules and is simple to use. The dynamic adaptability of the monitoring system is greatly improved by utilizing the self-adaptability and self-organization of wireless sensor networks, which brings great convenience to air quality monitoring.


---

## Body

## 1. Introduction

For thousands of years, the atmospheric environment has been and will always be one of the important components of the natural environment on which all living things in the world depend [1]. Air pollution is still a key link in ecological environment pollution, and air quality directly affects people’s physical and mental health [2]. The goal of research and development of atmospheric quality monitoring system is to collect regional atmospheric environmental quality data in real time, to establish corresponding information database, and to make statistics, processing, analysis, and automatic drawing of atmospheric environmental situation graphics, for the reference of comprehensive atmospheric environmental management [3]. A wireless sensor network is a self-organizing network [4] made up of a large number of wireless sensors. It does not require infrastructure such as cables or base stations, and it is easier to create a network capable of large-scale air quality monitoring. Environmental management units can accurately grasp the dynamic change trend of atmospheric environmental parameters in real time, formulate countermeasures in real time, and control the environment effectively [5]. Air environmental monitoring is the foundation of air environmental control and protection, and we can only implement effective and timely prevention and control measures if we have a thorough, accurate, and specific understanding of air environmental conditions [6]. The use of Internet of Things technology to effectively integrate into the atmospheric environmental monitoring system and realize the networking and intelligence of environmental monitoring information is the research direction of atmospheric environmental quality monitoring.Wireless sensor networks are currently a hot topic in domestic and foreign research, and many universities and research institutes have carried out related research [7]. Wireless sensor networks can collaborate, monitor, perceive, and collect information of various environments or monitored objects in real time through various integrated miniature sensors and process the information through embedded computing elements. Multihop relay mode transmits the sensed information to remote users [8]. It is the current development trend to conduct relevant online monitoring and visual analysis of air quality data. Real-time online monitoring will assist users in better understanding and analyzing the status of air quality data, allowing for faster decision-making and promoting the economy’s and environment’s friendly and sustainable development [9]. This system uses a three-layer system architecture of perception layer, network layer, and application layer to enable rapid networking of air quality inspection equipment. To complete data collection, transmission, storage, processing, and result feedback across network segments, it is made up of wireless sensor network control equipment, data communication server, and data display platform [10]. Functions such as network data storage, online simulation node reality distribution, historical data query and processing result display, and massive data query optimization have been added to this foundation, and the performance of each functional module of the wireless sensor network designed in this paper has been improved [11]. Based on the introduction of related technologies such as sensors, wireless communication, and wireless sensor networks, this paper conducts a more detailed study on the air quality monitoring system and proposes a set of air quality monitoring system schemes based on wireless sensor networks.Wireless sensor networks are widely used in industrial control, home and office automation, medical treatment and nursing, agricultural and biological environment protection, tracking and logistics management, architecture and civil engineering, security, public security, military affairs, etc. [12]. The traditional automatic air quality monitoring station is mainly installed in big cities and their surrounding areas. Although it has the advantages of high accuracy, high resolution, and good real-time performance, its shortcomings can not be ignored, such as generally high equipment price, high operation cost, and harsh working conditions, and it is not suitable to move again after installation [13]. Compared with the traditional wired air quality information acquisition, wireless sensor networks have the advantages of low cost, low power consumption, and reliable performance. The establishment of air quality monitoring system has great social and economic value [14]. Due to the use of wireless sensor network technology, data acquisition points can be widely arranged in different regions, and the monitoring layout can be changed flexibly, so as to obtain accurate detection data in real time [15]. It does not need the support of any fixed network and has the characteristics of rapid deployment and strong survivability [16]. With the increasing development and deepening of wireless sensor network applications, the research on some key technologies such as wireless communication network technology supporting wireless sensor networks and ultra-micro-embedded real-time operating system will become the development trend and hotspot of wireless sensor network applications in the future [17].


## 2. Related Work

The monitoring module in [18] uses a system data link based on a single-chip microcomputer unmanned aerial vehicle to realize the functions of alarming the ground air quality and locating the pollution source. The “Smart Sensor Network Communication” plan was proposed in literature [19], and it was approved as a scientific and technological research plan for the fiscal year. The literature [20] proposes a set of environmental monitoring systems that are specifically designed to monitor the subway’s indoor air quality [21]. For many times, a UAV equipped with a general particle concentration sensor was used to collect and measure PM2.5 and PM10 in specific areas of an industrial park, with linear regression used to improve the results. A distributed environmental monitoring system was developed in the literature [22], which is also used to monitor the indoor air quality of health centers.It has played a vital role in the community’s environmental problems by deploying enough sensors to monitor the air quality of the community and using the decentralized model to optimize the application of pollutant emissions [23]. More effective measures to reduce pollutant emissions in road transportation have been proposed in the literature. Several low-cost monitoring devices are used in addition to high-precision monitoring stations in cities [24]. The research in this class is primarily concerned with system-related technologies, and it proposes a design scheme for an air quality monitoring system that employs compressed sensing technology for data transmission [25]. This monitoring system is primarily used in high-pollution areas, factories, and transportation hubs, where traditional automatic air quality monitoring systems are ineffective [26].


## 3. Methodology

### 3.1. The Architecture of the Air Quality Monitoring System

In short, the air quality monitoring system is an information management system. It needs to collect, forward, store, and analyze air information. Use existing communication technology to build a system that integrates collection, storage, and analysis. Real-time monitoring of environmental information in a specific area and predicting and judging the atmospheric environment through data analysis are urgent task and goal at present [27]. More and more people began to pay attention to atmospheric environmental protection and put forward higher requirements for air quality monitoring. Many enterprises and institutions began to study the technical application and development prospect of atmospheric monitoring [28].The design of the system adopts the Internet of Things information platform based on wireless sensor network, which is composed of perception layer, transmission layer, platform layer, and application layer. The overall framework of the air quality monitoring system is shown in Figure1.Figure 1
Framework of the air quality monitoring system.Rapid and effective analysis of these diverse and large-scale data is one of the difficulties. The traditional single analysis method can not do multifaceted real-time analysis of data. Analysis combined with a variety of real-time visualization technologies is the main solution of this paper [28], to solve the problems of data time variability, attribute diversification, relationship complexity, and so on. Among them, we need to combine different map components and algorithms to apply to the research of spatial visualization. With the continuous upgrading of information technology, visualization technology will have better development prospects and produce more creative display effects. The real-time monitoring system of urban air quality based on wireless sensor network includes front-end monitoring substation, intermediate remote transmission network, and remote management center. The front-end monitoring substation is composed of a large number of sensor nodes deployed in the monitoring area, which is mainly responsible for information collection, transmits the collected information to the coordinator node through multi hop relay, and then remotely transmits the data to the background management center for processing through a GPRS network.The flowchart of the program design of the middleware control module of the atmospheric environment monitoring system based on wireless sensor network is shown in Figure2.Figure 2
Middleware software design flow chart.In this system, the wireless sensor network is the part of the sensing layer in the air quality monitoring system. It is equipped with several sensor nodes composed of sensors that can sense the external environment. Relying on these nodes, the data collection, preprocessing, and transmission of air environment quality information are carried out through wireless communication and finally transmitted to the air monitor. In the air quality monitoring system, a wireless sensor is the tentacle of the system, which is mainly used to obtain atmospheric environment information. Because the monitoring system is huge and complex, the basic component of the system is nodes, and the number of nodes is huge, so this design starts with nodes. Nodes in ZigBee network can be divided into three categories according to their functions: coordination node (establishing and maintaining network), routing node (establishing data transmission route), and terminal node (collecting data). Due to the limitations of the size and energy use of wireless sensor network nodes, wireless sensor network nodes must use high-performance small-size antennas. Therefore, the wireless frequency band used by wireless sensor networks must be located in the higher frequency band. In most wireless sensor networks, RF technology is used to realize the high-frequency communication of wireless sensor networks.The whole system mainly includes ZigBee data collection terminal node, GPRS-ZigBee gateway, and intelligent monitoring software based on B/S mode, and its architecture is shown in Figure3.Figure 3
System structure.On the premise of not affecting the system performance, reducing the data transmission amount of the communication module can naturally reduce the time for the communication module to send and receive data, thus achieving the goal of reducing the energy consumption of the communication module. Due to the limitations of the size and power consumption of sensor nodes, wireless transmission IC chips with low power consumption are generally selected. Most of these chips integrate the transmission modulation module and transmission amplification module into one chip. Using this kind of chip can not only reduce the system power consumption and reduce the size of sensor nodes but also improve the reliability of wireless signal transmission circuit to a great extent. The module implementation of atmospheric environment monitoring and comprehensive treatment of air pollution adopts Python language, Flask open source technical framework, and my SQL database. Take message queue telemetry transmission protocol as the core communication protocol. The hardware platform uses raspberry pie based on Linux to ensure the efficiency and security of the system. The system management module realizes the role-based authority management function, which is responsible for system authority management and allocation, personnel authority and data allocation, and specifying the responsibilities of specific personnel.


### 3.2. Research on Reliability of Wireless Sensor Networks

With the continuous development and advancement of today’s science and technology, R&D personnel have the ability to make a device with various functions of computing, communication, network, and sensors. A wireless sensor network is a special wireless communication network. It is a network composed of sensor nodes, which can coordinate various environmental or monitored object information such as light intensity, temperature, humidity, real-time monitoring, sensing, and measurement of physical information such as noise and harmful gas concentration, processing the information, and then sending the information wirelessly in a self-organized multihop network.The node whose residual energy is insufficient to send the collected data is regarded as a dead node. From the simulation results shown in Figure4, it can be seen that with the extension of the stable working time of the network, the number of dead nodes in the network continues to increase, which is due to the death of some nodes due to excessive energy consumption and unable to maintain the continuous operation of sensor nodes.Figure 4
Relationship between number of dead nodes and time.The working environment of the wireless sensor network is very complicated, and these complicated environments have a great influence on the normal operation of the wireless sensor network. In some important applications, whether the wireless sensor network can work normally is of vital importance. Therefore, reliability is a very important issue for wireless sensor networks. Enough attention should be paid to reliability in every step of wireless sensor network design. According to the demand analysis of the wireless sensor network visualization system, we can divide the visualization system of this article into seven modules, namely, the serial port monitoring module, data distribution module, data storage module, topology monitoring module, real-time display module, analog display distribution module, and data query module. Wireless sensor networks have the following characteristics: large-scale, self-organization, limited resources, dynamics, data-centric, multihop routing, security, reliability, distributed operating systems, and application relevance.Assuming that each measurement point affects each other, the influence will become smaller with the distance. The expression is(1)Z^0=∑i=0nZiQi.Among them,Qi is the weight coefficient corresponding to the predicted point and the real point, and the calculation based on Qi is the key to the inverse distance weighting algorithm, which is given by the following formula:
(2)Qi=fdej∑j=1ndej.Among them,fdej=1/dejb, when the value b is 1 or 2, it is the inverse distance reciprocal interpolation and the inverse distance reciprocal square interpolation.Many factors can influence wireless communication reliability, including the environment, the reliability of receiving and transmitting circuits, signal modulation, and coding. The most serious impact on wireless communication is the changing environment or electromagnetic interference. Sensor, wireless communication, network, embedded system, digital signal processing, and software engineering are all aspects of wire sensor networks. This presents challenging research topics for the development of wireless sensor networks at both the theoretical and experimental levels, with a focus on low energy consumption, real time, low-cost security, anti-interference, and cooperation. Wireless sensor network software reliability technology shares many similarities with general software reliability technology, but it also has its own unique characteristics. It is most evident in the close interaction of software and hardware in wireless sensor networks, where software operation is closely linked to and interacts with hardware state. Multiple air environmental parameters must be collected, processed, sent, received, and stored in the air quality monitoring system based on the wireless sensor network proposed in this paper. Simultaneously, determining the monitoring objects of the system is required in order to facilitate sensor selection in system design. The purpose of the wireless sensor network visualization system is to visually and accurately reflect the wireless sensor network’s operation status to users, as well as to inform the wireless sensor network of some user operations via the transmission network, so that specific tasks can be completed.Ordinary Kriging interpolation is to use the statistical relationship between the measurement points for interpolation; it can use the spatial correlation of the sample points to explain the changes in the surface. The expression is(3)Z0=∑i=0nλiZi.The weight coefficientλ0 can satisfy the set of optimal coefficients with the smallest difference between the estimated value Z^0 and the true value Z0 at this point, which is
(4)EZ^0−Z0=0.At the same time, the unbiased estimation conditions are met:(5)minλiVarZ^0−Z0.Because Kriging interpolation is geostatistical interpolation, the attribute valueZ of the research object has the same attribute in the research area. Expect C and variance 2 for any spatial position (x,y) to satisfy the following formula:
(6)EZx,y=EZ=C,VarZx,y=σ2.It can be further optimized and understood as follows: the research object at any spatial position has the attribute valueZx,y, which is composed of the expected value C of the research area and the random deviation Rx,y of the research object, and the formula can be obtained:
(7)Zx,y=EZx,y+Rx,y=C+Rx,y,VarRx,y=σ2.Sensors are the basic units of wireless sensor networks, and these basic units have different application structures in different application fields. Wire sensor network architecture is a set of abstract rules that must be followed in the process of designing network protocol and network communication mechanism. Referring to OSI (Open System Interconnect) five layer protocol model, researchers proposed several WSN protocol architecture frameworks. The reliability of hardware not only refers to the reliability of circuit but also includes the reliability of system mechanical structure. In particular, sensor node modules are often embedded in production equipment, which bear huge vibration and pressure and high temperature and humidity environment. The reasonable dynamic behavior and correct logical processing of software are also very important for a wireless sensor network. As previously stated, software can realize hardware functions to a certain extent in wireless sensor networks, and software can set and adjust hardware as needed, thanks to advances in microelectronics technology. As a result, in wireless sensor networks, software is playing an increasingly important role. Because the data exchange, data analysis, and data processing between the visualization system and the transmission network differ, there is currently no universal wireless sensor network visualization system that can support a wide range of hardware platforms and sensor networks.After the system has been running for a period of time, in the data management module, open the data charts, respectively, to obtain the historical data change diagrams of the three types of environmental parameters, as shown in Figure5.Figure 5
PM2.5. Display of temperature and humidity historical data.


## 3.1. The Architecture of the Air Quality Monitoring System

In short, the air quality monitoring system is an information management system. It needs to collect, forward, store, and analyze air information. Use existing communication technology to build a system that integrates collection, storage, and analysis. Real-time monitoring of environmental information in a specific area and predicting and judging the atmospheric environment through data analysis are urgent task and goal at present [27]. More and more people began to pay attention to atmospheric environmental protection and put forward higher requirements for air quality monitoring. Many enterprises and institutions began to study the technical application and development prospect of atmospheric monitoring [28].The design of the system adopts the Internet of Things information platform based on wireless sensor network, which is composed of perception layer, transmission layer, platform layer, and application layer. The overall framework of the air quality monitoring system is shown in Figure1.Figure 1
Framework of the air quality monitoring system.Rapid and effective analysis of these diverse and large-scale data is one of the difficulties. The traditional single analysis method can not do multifaceted real-time analysis of data. Analysis combined with a variety of real-time visualization technologies is the main solution of this paper [28], to solve the problems of data time variability, attribute diversification, relationship complexity, and so on. Among them, we need to combine different map components and algorithms to apply to the research of spatial visualization. With the continuous upgrading of information technology, visualization technology will have better development prospects and produce more creative display effects. The real-time monitoring system of urban air quality based on wireless sensor network includes front-end monitoring substation, intermediate remote transmission network, and remote management center. The front-end monitoring substation is composed of a large number of sensor nodes deployed in the monitoring area, which is mainly responsible for information collection, transmits the collected information to the coordinator node through multi hop relay, and then remotely transmits the data to the background management center for processing through a GPRS network.The flowchart of the program design of the middleware control module of the atmospheric environment monitoring system based on wireless sensor network is shown in Figure2.Figure 2
Middleware software design flow chart.In this system, the wireless sensor network is the part of the sensing layer in the air quality monitoring system. It is equipped with several sensor nodes composed of sensors that can sense the external environment. Relying on these nodes, the data collection, preprocessing, and transmission of air environment quality information are carried out through wireless communication and finally transmitted to the air monitor. In the air quality monitoring system, a wireless sensor is the tentacle of the system, which is mainly used to obtain atmospheric environment information. Because the monitoring system is huge and complex, the basic component of the system is nodes, and the number of nodes is huge, so this design starts with nodes. Nodes in ZigBee network can be divided into three categories according to their functions: coordination node (establishing and maintaining network), routing node (establishing data transmission route), and terminal node (collecting data). Due to the limitations of the size and energy use of wireless sensor network nodes, wireless sensor network nodes must use high-performance small-size antennas. Therefore, the wireless frequency band used by wireless sensor networks must be located in the higher frequency band. In most wireless sensor networks, RF technology is used to realize the high-frequency communication of wireless sensor networks.The whole system mainly includes ZigBee data collection terminal node, GPRS-ZigBee gateway, and intelligent monitoring software based on B/S mode, and its architecture is shown in Figure3.Figure 3
System structure.On the premise of not affecting the system performance, reducing the data transmission amount of the communication module can naturally reduce the time for the communication module to send and receive data, thus achieving the goal of reducing the energy consumption of the communication module. Due to the limitations of the size and power consumption of sensor nodes, wireless transmission IC chips with low power consumption are generally selected. Most of these chips integrate the transmission modulation module and transmission amplification module into one chip. Using this kind of chip can not only reduce the system power consumption and reduce the size of sensor nodes but also improve the reliability of wireless signal transmission circuit to a great extent. The module implementation of atmospheric environment monitoring and comprehensive treatment of air pollution adopts Python language, Flask open source technical framework, and my SQL database. Take message queue telemetry transmission protocol as the core communication protocol. The hardware platform uses raspberry pie based on Linux to ensure the efficiency and security of the system. The system management module realizes the role-based authority management function, which is responsible for system authority management and allocation, personnel authority and data allocation, and specifying the responsibilities of specific personnel.


## 3.2. Research on Reliability of Wireless Sensor Networks

With the continuous development and advancement of today’s science and technology, R&D personnel have the ability to make a device with various functions of computing, communication, network, and sensors. A wireless sensor network is a special wireless communication network. It is a network composed of sensor nodes, which can coordinate various environmental or monitored object information such as light intensity, temperature, humidity, real-time monitoring, sensing, and measurement of physical information such as noise and harmful gas concentration, processing the information, and then sending the information wirelessly in a self-organized multihop network.The node whose residual energy is insufficient to send the collected data is regarded as a dead node. From the simulation results shown in Figure4, it can be seen that with the extension of the stable working time of the network, the number of dead nodes in the network continues to increase, which is due to the death of some nodes due to excessive energy consumption and unable to maintain the continuous operation of sensor nodes.Figure 4
Relationship between number of dead nodes and time.The working environment of the wireless sensor network is very complicated, and these complicated environments have a great influence on the normal operation of the wireless sensor network. In some important applications, whether the wireless sensor network can work normally is of vital importance. Therefore, reliability is a very important issue for wireless sensor networks. Enough attention should be paid to reliability in every step of wireless sensor network design. According to the demand analysis of the wireless sensor network visualization system, we can divide the visualization system of this article into seven modules, namely, the serial port monitoring module, data distribution module, data storage module, topology monitoring module, real-time display module, analog display distribution module, and data query module. Wireless sensor networks have the following characteristics: large-scale, self-organization, limited resources, dynamics, data-centric, multihop routing, security, reliability, distributed operating systems, and application relevance.Assuming that each measurement point affects each other, the influence will become smaller with the distance. The expression is(1)Z^0=∑i=0nZiQi.Among them,Qi is the weight coefficient corresponding to the predicted point and the real point, and the calculation based on Qi is the key to the inverse distance weighting algorithm, which is given by the following formula:
(2)Qi=fdej∑j=1ndej.Among them,fdej=1/dejb, when the value b is 1 or 2, it is the inverse distance reciprocal interpolation and the inverse distance reciprocal square interpolation.Many factors can influence wireless communication reliability, including the environment, the reliability of receiving and transmitting circuits, signal modulation, and coding. The most serious impact on wireless communication is the changing environment or electromagnetic interference. Sensor, wireless communication, network, embedded system, digital signal processing, and software engineering are all aspects of wire sensor networks. This presents challenging research topics for the development of wireless sensor networks at both the theoretical and experimental levels, with a focus on low energy consumption, real time, low-cost security, anti-interference, and cooperation. Wireless sensor network software reliability technology shares many similarities with general software reliability technology, but it also has its own unique characteristics. It is most evident in the close interaction of software and hardware in wireless sensor networks, where software operation is closely linked to and interacts with hardware state. Multiple air environmental parameters must be collected, processed, sent, received, and stored in the air quality monitoring system based on the wireless sensor network proposed in this paper. Simultaneously, determining the monitoring objects of the system is required in order to facilitate sensor selection in system design. The purpose of the wireless sensor network visualization system is to visually and accurately reflect the wireless sensor network’s operation status to users, as well as to inform the wireless sensor network of some user operations via the transmission network, so that specific tasks can be completed.Ordinary Kriging interpolation is to use the statistical relationship between the measurement points for interpolation; it can use the spatial correlation of the sample points to explain the changes in the surface. The expression is(3)Z0=∑i=0nλiZi.The weight coefficientλ0 can satisfy the set of optimal coefficients with the smallest difference between the estimated value Z^0 and the true value Z0 at this point, which is
(4)EZ^0−Z0=0.At the same time, the unbiased estimation conditions are met:(5)minλiVarZ^0−Z0.Because Kriging interpolation is geostatistical interpolation, the attribute valueZ of the research object has the same attribute in the research area. Expect C and variance 2 for any spatial position (x,y) to satisfy the following formula:
(6)EZx,y=EZ=C,VarZx,y=σ2.It can be further optimized and understood as follows: the research object at any spatial position has the attribute valueZx,y, which is composed of the expected value C of the research area and the random deviation Rx,y of the research object, and the formula can be obtained:
(7)Zx,y=EZx,y+Rx,y=C+Rx,y,VarRx,y=σ2.Sensors are the basic units of wireless sensor networks, and these basic units have different application structures in different application fields. Wire sensor network architecture is a set of abstract rules that must be followed in the process of designing network protocol and network communication mechanism. Referring to OSI (Open System Interconnect) five layer protocol model, researchers proposed several WSN protocol architecture frameworks. The reliability of hardware not only refers to the reliability of circuit but also includes the reliability of system mechanical structure. In particular, sensor node modules are often embedded in production equipment, which bear huge vibration and pressure and high temperature and humidity environment. The reasonable dynamic behavior and correct logical processing of software are also very important for a wireless sensor network. As previously stated, software can realize hardware functions to a certain extent in wireless sensor networks, and software can set and adjust hardware as needed, thanks to advances in microelectronics technology. As a result, in wireless sensor networks, software is playing an increasingly important role. Because the data exchange, data analysis, and data processing between the visualization system and the transmission network differ, there is currently no universal wireless sensor network visualization system that can support a wide range of hardware platforms and sensor networks.After the system has been running for a period of time, in the data management module, open the data charts, respectively, to obtain the historical data change diagrams of the three types of environmental parameters, as shown in Figure5.Figure 5
PM2.5. Display of temperature and humidity historical data.


## 4. Result Analysis and Discussion

### 4.1. Database Design and Implementation

The data link layer’s main job is to improve the physical layer’s ability to transmit original bits while also processing how to organize the physical layer’s bits into frames, making it appear as an error-free line to the network layer. The sender encapsulates the input data in a data frame and processes the acknowledgement frame that the receiver sends back. Each sensor node in the WSN-based air quality monitoring system will collect a large amount of data, which will be transmitted to the gateway node or a neighboring sensor node due to the large number of nodes, wide distribution, and complex working environment. The demand for data transmission power consumption in such a distributed wireless sensor network is extremely high, and replacing the node’s battery is obviously impractical. How to process such signals in order to reduce data transmission, reduce power consumption, and extend the service life of the node has become a pressing issue that must be addressed.Database design is a very important link in the development of visualization system. The quality of database structure design will directly affect the efficiency and function of visualization system. Therefore, before designing the visual system database in this paper, we should understand the requirements of the database and determine the structure of the database. Traditional data compression is subject to the Nyquist sampling law, that is, subject to the limitation that the sampling rate is at least twice the signal bandwidth. Only by satisfying the Nyquist law can the signal be reconstructed accurately. The main disadvantages of traditional data compression are that it requires high-rate sampling, and most of the data obtained by sampling is discarded after data compression, which causes waste. After the sensor node collects the data, it sends the data to the neighbor node on the gradient. Because it may receive messages from multiple neighbor nodes, the node sends data to multiple neighbors, and the sink node may receive the same data through multiple paths. Figure6 shows the probability graph of signal reconstruction using this algorithm when the signal number j takes different values. The length n of each signal is 60, the sparsity k is 6, and the number j of signals is 1, 6, 18, and 36, respectively.Figure 6
Reconstruction probability of the algorithm to restore the signal.By running the algorithm, the average residual energy of network nodes, the number of active nodes after stable operation for a period of time, and the delay in network communication are simulated and compared with the algorithms in the literature. Among them, the simulation uses10×14 grid topology, using load balancing routing protocol. The simulation results are shown in Figure 7.Figure 7
Relationship between node residual energy and time.For the forwarded data, the data buffer pool keeps a copy and records the forwarding time. In the application process, firstly, according to the personnel structure in the organization, reasonably divide the personnel authority. After the administrator logs in to the system, according to the deployment of sensor devices and gateway devices, configure the relationship between devices and data reporting rules. After the equipment is started, the environmental data will be reported regularly according to the specified data uploading rules. The platform receives the raw data, converts the raw data into real and effective environmental parameters, and finally displays them visually in the form of charts. The Flask framework is used to build the system platform. At the ZigBee data collection terminal node, create the remote update software. To begin, analyze the KW01’s machine code file, link file, and storage space; design the wireless communication driver and related modules; design the RUPNP network protocol suitable for remote node update to create the update network; and design the RUPNP network protocol suitable for remote node update to create the update network. The actual network separation is more versatile; to avoid relocation issues, the monitoring program’s storage space is separated from the user program’s storage space by modifying the link file; a timeout mechanism is designed to effectively solve the problem of data frames entering the monitoring program after the node has been reset abnormally.Figure8 shows the probability obtained by reconstructing a single signal using the OMP algorithm. Set the normalized sparsity SK/N=0.1, and change the length n of the sparse signal to obtain three probability curves.Figure 8
Probability of single signal reconstruction based on OMP algorithm.There are three main traditional data compression techniques: lossless compression, lossy compression, and hybrid compression. Lossy compression allows certain information loss in the compression process. Although the original signal cannot be completely recovered, this loss does not affect human understanding of image and sound. It only makes reasonable use of the special nature of human insensitivity to some frequency components in the information of image and sound. Lossless compression is to compress the statistical redundancy in data. Hybrid compression combines the advantages of lossless compression and lossy compression to find the best balance among compression ratio, compression efficiency, and distortion. After the database table is designed, the database table can be transformed into the actual data model supported by a certain database system. This is the creation of the database table. Assuming the number of signalsJ is 40, the signal length n is 50, and the sparsity K is 5, the reconstruction results under the CS and DCS frameworks are shown in Figure 9.Figure 9
Reconstruction error between this paper and traditional algorithm under different number of measured values.This article’s visualization system includes a user basic information table, data storage information table, and node information table, among other things. Each table keeps track of the information that goes with it. This article’s data storage module uses database development technology. It is a programming interface for accessing databases that are widely used. The visualization system can establish a communication interface between the visualization system and the database system by installing the database system’s driver, allowing the visualization system to quickly access and operate the database. When using a wireless sensor network data visualization system, it is necessary not only to store the received data but also to find the data that users are interested in and display it according to their needs, allowing the user to monitor the entire network more easily.


### 4.2. Visual System Test

System testing is an indispensable link in the design and development of the whole system and an important step to ensure the performance and quality of the system. According to the data flow direction, this system can be divided into three modules: sensor subsystem, middleware management subsystem, and user application subsystem, with relatively independent and unified functions. The main interface of the visualization system in this article includes serial port connection, database connection, topology monitoring, simulated reality distribution, automatic positioning, and query display. The main window includes a menu and a toolbar. The menu includes common commands of the toolbar. The visualization development module is the key module of this system, and other management and monitoring modules serve for the visualization module. This system has realized various types of visualization development, including basic graphics development such as traditional line graph and bar graph, and two-dimensional visualization development based on basic map. Aiming at map visualization, algorithms are also used to improve it, so as to show users better and more satisfying spatial visualization effects for real-time analysis.Now suppose there are multiple signal groups, the number of signals contained in each signal group isJ1,5,10,,40, the length of each signal isN50, and the sparsity is K5, respectively. Use this algorithm and traditional algorithm to simulate it, as shown in Figure 10.Figure 10
Number of measurements m required for successful reconstruction under different number of signalsJ.In the test experiment, this study uses two sensor nodes and one coordinator node to form a remote monitoring network. Each sensor node is equipped with sensor modules of temperature and humidity, ozone concentration, carbon monoxide concentration, nitrogen dioxide concentration, sulfur dioxide concentration, and PM2.5 concentration, and the collected air quality information is wirelessly transmitted to the coordinator node, which is remotely transmitted back to the upper computer management node through GPRS module. When the system is running, the device association relationship and data reporting rules need to be configured in the device management module. In this module, users can view the device list of the current system, manage and configure devices, and obtain data from specified devices. Click the “add” button in the equipment management interface to add sensor control equipment. After the system debugging is successful, connect the corresponding sensor. The sensor reports the sensor data according to the specified rules through the Internet of Things gateway. After receiving the data, the system platform converts the original data into real data according to the configured data rules and saves it in the database.Due to the particularity of the sensor network, each node needs to feed back part or all of the data collected by itself and received from the next-level node to the next-level node. Ultimately, all the information will be gathered in the Sink node. Therefore, as an intermediate node, the real-time routing information it needs to save is only the information of its parent node and several child nodes (one or more), without the need for overall routing storage. Due to the possibility of multiple parent nodes for the same node, the only parent node can be selected and determined based on the parent node’s energy information. A design like this can save a lot of space in the node’s cache for storing the routing table. When the lower-level node wants to transmit information to the sink node, it will look up the id of the parent node of its routing table and upload data to it, so that the data will be able to reach the sink node after such transmission; when the sink node wants to look up, you can issue a query command when you know the data for a specific id, and the command transmission path can be broadcast and implemented using the method of routing establishment. This design is intended for use in the monitoring of the atmospheric environment. It must query the data collected by the sensor node on a regular basis. The sensor node reports the collected data to the query node, and the aggregation node (query node) can issue task query commands. As a result, a query-based routing protocol is appropriate. This design is based on the Directed Diffusion (DD) routing mechanism, and it creates a wireless sensor routing protocol that can be used to monitor the atmosphere.


## 4.1. Database Design and Implementation

The data link layer’s main job is to improve the physical layer’s ability to transmit original bits while also processing how to organize the physical layer’s bits into frames, making it appear as an error-free line to the network layer. The sender encapsulates the input data in a data frame and processes the acknowledgement frame that the receiver sends back. Each sensor node in the WSN-based air quality monitoring system will collect a large amount of data, which will be transmitted to the gateway node or a neighboring sensor node due to the large number of nodes, wide distribution, and complex working environment. The demand for data transmission power consumption in such a distributed wireless sensor network is extremely high, and replacing the node’s battery is obviously impractical. How to process such signals in order to reduce data transmission, reduce power consumption, and extend the service life of the node has become a pressing issue that must be addressed.Database design is a very important link in the development of visualization system. The quality of database structure design will directly affect the efficiency and function of visualization system. Therefore, before designing the visual system database in this paper, we should understand the requirements of the database and determine the structure of the database. Traditional data compression is subject to the Nyquist sampling law, that is, subject to the limitation that the sampling rate is at least twice the signal bandwidth. Only by satisfying the Nyquist law can the signal be reconstructed accurately. The main disadvantages of traditional data compression are that it requires high-rate sampling, and most of the data obtained by sampling is discarded after data compression, which causes waste. After the sensor node collects the data, it sends the data to the neighbor node on the gradient. Because it may receive messages from multiple neighbor nodes, the node sends data to multiple neighbors, and the sink node may receive the same data through multiple paths. Figure6 shows the probability graph of signal reconstruction using this algorithm when the signal number j takes different values. The length n of each signal is 60, the sparsity k is 6, and the number j of signals is 1, 6, 18, and 36, respectively.Figure 6
Reconstruction probability of the algorithm to restore the signal.By running the algorithm, the average residual energy of network nodes, the number of active nodes after stable operation for a period of time, and the delay in network communication are simulated and compared with the algorithms in the literature. Among them, the simulation uses10×14 grid topology, using load balancing routing protocol. The simulation results are shown in Figure 7.Figure 7
Relationship between node residual energy and time.For the forwarded data, the data buffer pool keeps a copy and records the forwarding time. In the application process, firstly, according to the personnel structure in the organization, reasonably divide the personnel authority. After the administrator logs in to the system, according to the deployment of sensor devices and gateway devices, configure the relationship between devices and data reporting rules. After the equipment is started, the environmental data will be reported regularly according to the specified data uploading rules. The platform receives the raw data, converts the raw data into real and effective environmental parameters, and finally displays them visually in the form of charts. The Flask framework is used to build the system platform. At the ZigBee data collection terminal node, create the remote update software. To begin, analyze the KW01’s machine code file, link file, and storage space; design the wireless communication driver and related modules; design the RUPNP network protocol suitable for remote node update to create the update network; and design the RUPNP network protocol suitable for remote node update to create the update network. The actual network separation is more versatile; to avoid relocation issues, the monitoring program’s storage space is separated from the user program’s storage space by modifying the link file; a timeout mechanism is designed to effectively solve the problem of data frames entering the monitoring program after the node has been reset abnormally.Figure8 shows the probability obtained by reconstructing a single signal using the OMP algorithm. Set the normalized sparsity SK/N=0.1, and change the length n of the sparse signal to obtain three probability curves.Figure 8
Probability of single signal reconstruction based on OMP algorithm.There are three main traditional data compression techniques: lossless compression, lossy compression, and hybrid compression. Lossy compression allows certain information loss in the compression process. Although the original signal cannot be completely recovered, this loss does not affect human understanding of image and sound. It only makes reasonable use of the special nature of human insensitivity to some frequency components in the information of image and sound. Lossless compression is to compress the statistical redundancy in data. Hybrid compression combines the advantages of lossless compression and lossy compression to find the best balance among compression ratio, compression efficiency, and distortion. After the database table is designed, the database table can be transformed into the actual data model supported by a certain database system. This is the creation of the database table. Assuming the number of signalsJ is 40, the signal length n is 50, and the sparsity K is 5, the reconstruction results under the CS and DCS frameworks are shown in Figure 9.Figure 9
Reconstruction error between this paper and traditional algorithm under different number of measured values.This article’s visualization system includes a user basic information table, data storage information table, and node information table, among other things. Each table keeps track of the information that goes with it. This article’s data storage module uses database development technology. It is a programming interface for accessing databases that are widely used. The visualization system can establish a communication interface between the visualization system and the database system by installing the database system’s driver, allowing the visualization system to quickly access and operate the database. When using a wireless sensor network data visualization system, it is necessary not only to store the received data but also to find the data that users are interested in and display it according to their needs, allowing the user to monitor the entire network more easily.


## 4.2. Visual System Test

System testing is an indispensable link in the design and development of the whole system and an important step to ensure the performance and quality of the system. According to the data flow direction, this system can be divided into three modules: sensor subsystem, middleware management subsystem, and user application subsystem, with relatively independent and unified functions. The main interface of the visualization system in this article includes serial port connection, database connection, topology monitoring, simulated reality distribution, automatic positioning, and query display. The main window includes a menu and a toolbar. The menu includes common commands of the toolbar. The visualization development module is the key module of this system, and other management and monitoring modules serve for the visualization module. This system has realized various types of visualization development, including basic graphics development such as traditional line graph and bar graph, and two-dimensional visualization development based on basic map. Aiming at map visualization, algorithms are also used to improve it, so as to show users better and more satisfying spatial visualization effects for real-time analysis.Now suppose there are multiple signal groups, the number of signals contained in each signal group isJ1,5,10,,40, the length of each signal isN50, and the sparsity is K5, respectively. Use this algorithm and traditional algorithm to simulate it, as shown in Figure 10.Figure 10
Number of measurements m required for successful reconstruction under different number of signalsJ.In the test experiment, this study uses two sensor nodes and one coordinator node to form a remote monitoring network. Each sensor node is equipped with sensor modules of temperature and humidity, ozone concentration, carbon monoxide concentration, nitrogen dioxide concentration, sulfur dioxide concentration, and PM2.5 concentration, and the collected air quality information is wirelessly transmitted to the coordinator node, which is remotely transmitted back to the upper computer management node through GPRS module. When the system is running, the device association relationship and data reporting rules need to be configured in the device management module. In this module, users can view the device list of the current system, manage and configure devices, and obtain data from specified devices. Click the “add” button in the equipment management interface to add sensor control equipment. After the system debugging is successful, connect the corresponding sensor. The sensor reports the sensor data according to the specified rules through the Internet of Things gateway. After receiving the data, the system platform converts the original data into real data according to the configured data rules and saves it in the database.Due to the particularity of the sensor network, each node needs to feed back part or all of the data collected by itself and received from the next-level node to the next-level node. Ultimately, all the information will be gathered in the Sink node. Therefore, as an intermediate node, the real-time routing information it needs to save is only the information of its parent node and several child nodes (one or more), without the need for overall routing storage. Due to the possibility of multiple parent nodes for the same node, the only parent node can be selected and determined based on the parent node’s energy information. A design like this can save a lot of space in the node’s cache for storing the routing table. When the lower-level node wants to transmit information to the sink node, it will look up the id of the parent node of its routing table and upload data to it, so that the data will be able to reach the sink node after such transmission; when the sink node wants to look up, you can issue a query command when you know the data for a specific id, and the command transmission path can be broadcast and implemented using the method of routing establishment. This design is intended for use in the monitoring of the atmospheric environment. It must query the data collected by the sensor node on a regular basis. The sensor node reports the collected data to the query node, and the aggregation node (query node) can issue task query commands. As a result, a query-based routing protocol is appropriate. This design is based on the Directed Diffusion (DD) routing mechanism, and it creates a wireless sensor routing protocol that can be used to monitor the atmosphere.


## 5. Conclusions

The research of this paper makes me have a deeper understanding of air quality and visualization technology than ever before. Through the development of data real-time visualization system, the real-time visualization technology is realized, and the results are analyzed. The purpose of visualization technology research has been achieved. Moreover, not only the system development but also the theoretical learning of the algorithm is carried out. The visualization system can easily connect the computer through the serial port, receive and store the data in the sensor network, support data query and simulate the real distribution, and basically achieve the design goal of this paper. In this paper, a variety of real-time visualization methods are introduced and compared. This paper develops ZigBee data collection terminal nodes, GPRS-ZigBee gateways, and intelligent monitoring software based on the B/S mode to realize real-time collection and analysis of pollution data in the air environment, so that the public can better understand the air pollution situation and the law of change and thus take targeted effective measures to reduce pollutant emissions, provide a reference for people’s healthy travel, and provide a data basis for relabeling.



---

*Source: 4160186-2022-02-27.xml*