An air quality monitoring system based on the Internet of Things
By introducing Internet of Things technology into the air quality monitoring system and using wireless sensor networks and servers to process data, the problem that traditional systems cannot effectively monitor the indoor environment is solved, real-time monitoring of air quality and secure data transmission are achieved, and monitoring accuracy is improved. and convenience.
Patent Information
- Application Number
- CN202210351056.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-04-02
AI Technical Summary
Traditional air quality monitoring systems cannot effectively monitor the indoor environment, and lack the use of IoT technology for data processing and security, resulting in insufficient data accuracy and operational convenience.
An air quality monitoring system based on the Internet of Things is designed, including a gateway, wireless sensor network and server. Parameters such as temperature, humidity, formaldehyde, TVOC, PM2.5, etc. are collected through the wireless sensor network. The coordinator is responsible for network establishment and security verification. The server processes and stores data, the user terminal presents the data through the HTTP process, the map display module and the life index prompt module enhance the user experience, and optimize network performance through mutual trust confirmation and data buffers.
It achieves real-time monitoring of indoor air quality and safe and fast transmission of data, improves the accuracy and operational convenience of environmental monitoring, and ensures the security of private domain information.
Smart Images

Figure CN114689801B
Abstract
Description
Technical Field
[0001] The invention relates to data information processing and an air quality monitoring system based on the Internet of Things. Background Art
[0002] The harm and impact of air pollution on humans and their living environment have gradually been recognized by people. With the rapid advancement of urbanization, population growth, excessive resource consumption, environmental pollution, ecological damage and other problems have become increasingly prominent. However, traditional air quality monitoring systems can only collect data through fixed base stations and send them through the network. However, for air monitoring in indoor home environments, it still remains at the level of simple instrument monitoring and does not make full use of network information processing.
[0003] The Internet of Things is known as the third wave of the world's information industry after computers and the Internet. It is a new technology system formed by the integration of multiple information technologies. With the rapid development of Internet of Things technology, the combination of "Internet of Things + ecological environment" can make it possible to monitor home environments, etc. How to establish an air quality monitoring system based on the Internet of Things, and enable small environmental monitoring systems to run quickly and ensure the security of private domain information, improve the convenience of environmental monitoring operations and the accuracy of data, has become a hot topic of concern. Summary of the invention
[0004] In order to overcome the above-mentioned deficiencies of the prior art, the present invention proposes an air quality monitoring system based on the Internet of Things.
[0005] The system includes a gateway, a wireless sensor network, a server and a user terminal; a plurality of wireless sensors and a coordinator constitute a wireless sensor network;
[0006] The wireless sensor network includes a coordinator and a sink node. The coordinator is used to receive data transmitted by the sink node. The coordinator node is used as the master control node of the sensor network to be responsible for establishing the network, allowing new nodes to request to join the sensor network and perform address allocation. When the coordinator is powered on, the startup code is used to initialize and scan the communication channel, and determine in turn whether the new self-organizing network is successfully established.
[0007] The gateway is used to start the socket process to establish a network connection with the server, and start the serial port transceiver thread to receive data from the coordinator. If there is data, it is transmitted to the server for storage;
[0008] The server is used to process the classified storage of data and the user's request. The server starts two processes. The UDP Socket communication process is started to receive the data uploaded by the intelligent gateway and store the data in the database. When the user terminal executes access, the server starts the HTTP process, and the user terminal presents the atmospheric air quality data to the user.
[0009] The user terminal sends a data request to the server, and after receiving the data sent by the server, it presents it in a preset manner.
[0010] Optionally, the user terminal includes a map display module, and the map display module accesses map services and data by calling an SDK interface to display a map.
[0011] Optionally, the server determines whether the user's request is private information and performs security verification on the information user's information.
[0012] Optionally, when the wireless sensor is used for indoor control quality collection, the sensor includes at least one of the following: a temperature sensor, a humidity sensor, a formaldehyde sensor, a TVOC sensor, a PM2.5 sensor, a carbon monoxide concentration sensor, and a carbon dioxide concentration sensor.
[0013] Optionally, the coordinator determines that the self-organizing network is successfully established, and the coordinator enters the wireless monitoring mode. When a sensor node requests to join the network, the coordinator will automatically assign an address; store and process its new network node address, update and display the data of the associated device, and the coordinator node receives the data transmitted by the aggregation node and transmits it to the gateway.
[0014] Optionally, the coordinator performs security verification on the newly added node, and the security verification is performed by performing mutual trust confirmation through the devices of the system that have joined.
[0015] Optionally, the coordinator mutual trust confirmation is specifically that when a new wireless sensor device joins, the existing connected network devices will perform mutual trust verification, and reach a handshake protocol authentication by sending random verification codes to the terminals already in the system, thereby confirming the reliability of the device information.
[0016] Optionally, a data sending buffer is set in the aggregation node, and the buffer stores the data of all nodes in chronological order. The data will be sent to the coordinator through the serial port in sequence. The following two receiving threads and sending threads are set in the aggregation node. The receiving thread is responsible for receiving the node data and storing the node data in sequence in the data sending buffer; the sending thread is responsible for monitoring whether there is data in the buffer. If there is data, the data will be uploaded to the wireless coordinator.
[0017] Optionally, after receiving the data, the aggregation node stores it in a receiving buffer for sending to the coordinator thread to read and send; the aggregation node uses a heartbeat packet to determine the connection status between the child node and the aggregation node, and the child node sends a heartbeat packet to the coordinator at regular intervals to confirm the connection status.
[0018] Optionally, the aggregation node distinguishes between valid data packets and heartbeat packets by a preset data length.
[0019] In the present invention, the aggregation node is controlled by the classification of threads and main threads, and different message types are quickly determined by setting the format of the data packet. At the same time, by selecting the aggregation node in the wireless sensor node, when the amount of concurrent data is relatively large, the aggregation transmission of the aggregation node can reduce congestion, liberate the processing capacity of the coordinator, and set security control for network node device access and data, thereby ensuring the fast data transmission of the home information network and improving the system security performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a schematic diagram of the communication system of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Example 1
[0024] like Figure 1 As shown, an air quality monitoring system based on the Internet of Things is provided, the system includes a gateway, a wireless sensor network, a server and a user terminal. A plurality of wireless sensors and a coordinator constitute a wireless sensor network. The sensor is not limited to being wireless, but can also be partially wired and partially wireless, depending on the network setting environment.
[0025] The gateway can be an intelligent gateway. The intelligent gateway starts the process, starts the socket process to establish a network connection with the server, starts the serial port transceiver thread to receive data from the coordinator, and if there is data, it is transmitted to the server for storage. The intelligent gateway uploads the data process.
[0026] The server is used to process the classified storage of data and the user's request. The server starts two processes. It starts the UDPSocket communication process to receive the data uploaded by the intelligent gateway and stores the data in the database. Optionally, the user terminal is a mobile phone user terminal. The server starts the HTTP process to process data requests such as Android clients. The user terminal presents the atmospheric air quality data to the user. The user terminal includes four parts: map display module, data presentation module, life index prompt module and data download module. The client sends a data request to the server, and after receiving the data sent by the server, it presents it in a preset way.
[0027] Optionally, the map display module in the client uses a map SDK, and accesses map services and data by calling the map SDK interface to display the map. The data presentation module mainly presents real-time data directly in numerical values, and displays data with sensing nodes as the basic unit. The map information can also be indoor area location display information, and clustered display information of data types in the sensing node wireless sensors. The life index prompt module is used for activity arrangement prompts related to air quality, such as outdoor sports or the need to open windows for ventilation; the data download module is used for users to download and locally back up server data and perform data analysis.
[0028] Optionally, the server determines whether the request from the user terminal is private area information. When it is determined to be private area information, the server obtains password verification information in the private area. The private area information of the corresponding area is divided into specific sectors in the memory unit, and each sector is divided into data area information and password area information. The above-mentioned password area information and data area information are stored in different sectors respectively; the password block and data block are set in each sector, wherein when reading and writing operations are performed on different data blocks of the same sector, a verification operation is performed once.
[0029] Indoor data collection can mainly consist of seven parts: temperature sensor, humidity sensor, formaldehyde sensor, TVOC sensor, PM2.5 sensor, carbon monoxide concentration sensor, and carbon dioxide concentration sensor. If there are other needs, relevant sensors can also be added. The data detected by the sensor is summarized and sent to the coordinator.
[0030] Multiple wireless sensors and coordinators form a wireless sensor network. When the detection is turned on, sensors in various places in the room begin to collect data, and send data to the coordinator through the Bluetooth module at regular intervals. At the same time, the environmental parameters are sent to the server through the network control center and the data is analyzed. Users can view various environmental parameters in the room on the terminal device by sending a request to the server. The mobile terminal can display the ratio of the upper limit of the relevant national standards in the form of a pie chart. After the detection platform has been running for a period of time, the system will compare and analyze all the indoor air quality index detection data during this period. Different detection indicators can be plotted as broken lines and scatter plots by day, week, month or year, and a linear fitting curve can be made. The indoor air is predicted by the fitting curve. The prediction information can optionally be used for information prompts for new occupants.
[0031] Optional, the sensors used for environmental quality detection are composed of GY-MCU680V1 sensor, YW-51GJ sensor, MQ-2 sensor and MQ-7 sensor. GY-MCU680V1 indoor environmental quality sensor is an all-in-one sensor responsible for detecting air index, temperature, humidity and air pressure. It integrates BME680 four-in-one environmental sensor and processes the detected data through its own processor and outputs it through the serial port.
[0032] The YW-51GJ dust sensor is a sensor responsible for detecting PM2.5 parameters. The sensor uses the scattering principle and detects the voltage value of the receiving element as a reference for dust concentration. It integrates an ADC converter and a processor. The processor outputs the internal ADC conversion result through the serial port. The ZE08-CH2O formaldehyde sensor is a sensor responsible for detecting formaldehyde concentration parameters. The sensor is responsible for measuring the formaldehyde concentration in the air and outputs it through the voltage value. The MQ-2 and MQ-7 sensors are hazardous gas sensors. They react with the corresponding sensitive gases in the air to change the resistance of their gas-sensitive resistors, thereby generating voltage changes. When the voltage exceeds the limit, the corresponding high and low level signals are sent through the I / O port to trigger an alarm.
[0033] The wireless sensor network includes a coordinator node. The coordinator node is set according to the network scale. There are one or more nodes. The coordinator node is the master node of the sensor network part under its jurisdiction. It is responsible for establishing the network, allowing nodes to request to join the network and assign short addresses, etc. When the coordinator is powered on, the startup code will initialize the software and hardware modules, and then the coordinator will scan the channel to determine whether the newly established self-organizing network is successful. If successful, it will enter the wireless monitoring mode. When a sensor node requests to join the network, the coordinator will automatically assign an address; finally, its new network node address will be stored and processed, and the data of the associated device will be updated and displayed. The coordinator node will receive the data transmitted from the routing node and the sensor node, and transmit it to the host computer. Optionally, the host computer is a gateway, and then the instruction request interrupt returns, forming a multi-cycle real-time monitoring data mode.
[0034] The optional wireless sensor and the coordinator node communicate through a short-range network, such as ZigBee network communication, to organize and store the real-time environmental data collected by the sensor node, and then transmit the data to the coordinator node. After the wireless sensor is powered on, the device is initialized first to check whether the network is successfully connected, and then request to join the Zig Bee network and send the network address to the coordinator.
[0035] Due to the security settings of the self-organizing network, once a device joins the self-organizing network, it can send data in the network, etc., so there is also the potential for intrusion into the user's home network. Therefore, when a new wireless sensor device joins, the network device in the existing connected system will perform mutual trust verification. When verifying the mutual trust device, the mobile phone terminal in the home network can send a random check code through mutual trust confirmation with the mobile phone terminal to reach a handshake protocol authentication, thereby confirming the reliability of the user's device and avoiding the addition of unreliable security devices.
[0036] Newly added wireless sensors can only successfully enter the network after passing the trust verification of devices already existing in the network. Only after passing the trust verification within the communication range can they join the Zig Bee or WiFi network, and then a unique ID is assigned to the newly added wireless sensor.
[0037] Optionally, for wireless sensors, an aggregation node is selected and set. The aggregation node is the data collection point of the wireless sensor network in the set jurisdiction area. The aggregation node sends the aggregated data to the gateway. Optionally, for home environment, the aggregation node sends the data to the coordinator through the serial port, and the coordinator sends the data to the server through the local area network or Wi Fi.
[0038] There is a data sending buffer in the aggregation node. The buffer stores the data of all nodes in chronological order, and these data will be sent to the coordinator through the serial port in sequence. The following two main threads are set in the aggregation node. The receiving thread is responsible for receiving the node data and storing the node data in sequence in the data sending buffer; the sending thread is responsible for monitoring whether there is data in the buffer. If there is data, the data will be uploaded to the wireless coordinator.
[0039] When multiple threads access the same data buffer, a preemptive locking mechanism is used in the program implementation. In the selected aggregation node, a main thread is set in multiple threads. When the aggregation node is running, the main thread starts to run, and the program initialization, interface generation and other tasks are completed. Three timers are set in the aggregation node; a thread for sending commands to the coordination node is opened; and a thread for connecting to the child node is opened. Among them, the latter two threads are sent to the coordinator thread. After the child node connection is opened on site, it will run in parallel with the main thread. The main thread completes three functions through three timers: reading the coordinator command information (timer3), sending commands (timer1), and updating the child node connection status and displaying it on the interface of the aggregation node (timer2). It can be known that the aggregation node has: the thread sent to the coordinator. The thread is responsible for monitoring the buffer, which is a FIFO queue. When it is found that the queue is not empty, the head node (that is, the frame of data that enters the buffer earliest) is sent to the coordinator.
[0040] The subnode connection thread is responsible for connecting with the subnode, including listening to the substation (i.e., subnode) connection information and reading the substation data. The substation connection thread is also a general thread, which may include a listening connection thread _ListenThread or _BackListenThread and N receiving threads (N is the number of substations that are currently connected).
[0041] The listening thread is always running after it is opened when the aggregation node is running. It listens to the connection request of the child node, and after receiving the request: establishes a new winsock (or DTU) connection, opens a data receiving thread, starts receiving data, and writes the data into the receiving buffer. The establishment of the child node connection adopts a dynamic connection mode, and there is no requirement for the number of connections of the child node station. When a new child node station is opened, the listening thread _ListenThread will automatically establish a new connection. This thread is always running when it is turned on and generates a receiving data thread ReceiveThread_S specifically for the child node station for receiving data processing. The aggregation node will receive two types of packets transmitted by the child node station: valid data packets and heartbeat packets. According to the preset data length, the received data length is used to distinguish valid data packets and heartbeat packets, thereby improving the recognition efficiency of data packets. Valid data packets include: instantaneous data, status data, command return data, etc. These data are transmitted in the format of packet header (10 int data) and packet body (n float data).
[0042] After receiving this type of data, the aggregation node stores it in the receiving buffer for reading and sending to the coordinator thread _SendtoThread. The heartbeat packet is a mechanism for determining the connection status between the child node and the coordinator or / and the aggregation node. The child node station sends heartbeat packets to the coordinator and / or the aggregation node at regular intervals to ensure smooth connection. The child node station adopts a dynamic connection mode. When a connection request is received, it can optionally obtain the other party's IP through the socket mechanism, and then query the link list of the current child node. If this IP already exists, reject the request (because repeated connections are prohibited), otherwise accept the request, add this new IP to the link list, and open a receiving thread for this new IP.
[0043] Optionally, the RSSI value of the node is set based on the distance between other nodes and the aggregation node. When the distance is within the set threshold range, the node transmission power will be adjusted to the set low value threshold range. When the RSSI is within the set range, better communication can be guaranteed, and the transmission power between different nodes is adjusted to avoid unnecessary loss of nodes at fixed transmission power.
[0044] When the RSSI value is within a relatively large threshold range, it indicates that the communication quality between nodes is good, then the transmission power between nodes is appropriately reduced, and the RSSI value gradually decreases, and is adjusted to a threshold value that can ensure the reliability of communication between nodes, and a power correction instruction is sent to the coordination node. When the coordination node receives the returned RSSI value, the terminal node can adjust the transmission power according to its actual situation and broadcast it in the self-organizing network. This avoids, in the same self-organizing network, avoiding the situation that other aggregation nodes fail to receive the information due to the decrease of RSSI value, and mistakenly execute the switching of the self-organizing node on the aggregation node, thereby causing unnecessary data cache backup transmission. The aggregation node triggers the power adjustment of the communication node according to the received RSSI value and the preset communication reliable communication range threshold, and broadcasts the correction information in the network at the same time. The correction information includes the ID information of the node. When the RSSI value decreases, the adjacent aggregation node detects that the RSSI value of its node is within the range, and does not trigger the switching, thereby reducing the exchange and switching of signaling.
[0045] Based on the examples described above, in one embodiment, a computer device / system is also provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the methods in the above embodiments is implemented.
[0046] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. For example, in the embodiment of the present invention, the program can be stored in a storage medium of a computer system and executed by at least one processor in the computer system to implement the processes including the embodiments of the above-mentioned video playback methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0047] Accordingly, a storage medium is also provided, on which a computer program is stored, wherein when the program is executed by a processor, any one of the methods in the above embodiments is implemented.
[0048] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0049] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. An air quality monitoring system based on the Internet of Things, Features: The system includes a gateway, a sensor network, a server and a user terminal; A sensor network is composed of a plurality of sensors and a coordinator; a convergence node is provided in the plurality of sensors, and the coordinator is used to receive data transmitted by the convergence node. The coordinator node is the master control node of the sensor network, responsible for establishing the network, allowing new sensor nodes to request to join the sensor network and performing address allocation; when the coordinator is powered on, the startup code is used to initialize and scan the communication channel, and judge in turn whether the newly established self-organizing network is successful; the coordinator performs security verification on the newly added node, and the security verification is performed by performing mutual trust confirmation through the devices that have joined the system; Specifically, when a new sensor is added, the network device that has been connected will conduct mutual trust verification, and a handshake protocol authentication is reached by sending a random check code to the network device that is already in the system, thereby confirming the reliability of the new sensor; The gateway is used to start the socket process to establish a network connection with the server, and start the serial port transceiver thread to receive data from the coordinator. If there is data, it is transmitted to the server for storage; The server is used for classified storage of data and processing of user data requests. The server starts two processes. The UDPSocket communication process is started to receive data uploaded by the gateway and store the data in the database. When the user terminal performs data access, the server starts the HTTP process, and the user terminal presents the air quality data to the user. The user terminal sends a data request to the server, and when the data is received from the server, it is presented in a preset manner; The user terminal sends a data request to the server, and the server determines that the data request of the user terminal is for access to private area information, and when it is determined to be private area information, performs security authentication on the user information of the user terminal; The aggregation node is provided with a buffer for data transmission, which stores the data of the wireless sensor nodes in chronological order. The data will be sent to the coordinator through the serial port in sequence. A receiving thread and a sending thread are provided in the aggregation node. The receiving thread is responsible for receiving the data of the node and storing the data of the node in sequence in the buffer for data transmission; the sending thread is responsible for monitoring whether there is data in the buffer, and if there is data, the data is uploaded to the coordinator; after receiving the data, the aggregation node stores it in the receiving buffer for the sending thread sent to the coordinator to read and send; the aggregation node uses a heartbeat packet to judge the connection status of the child node and the aggregation node, and the child node station sends a heartbeat packet to it at regular intervals to confirm the connection status; a dynamic connection mode is adopted between the child node and the aggregation node. When the aggregation node receives a connection request, it obtains the IP of the corresponding child node through the socket mechanism, and then queries the link list of the current child node. If this IP already exists, the connection request is rejected, otherwise the request is accepted, the new IP is added to the link list, and a receiving thread is opened for the new IP.
2. The system according to claim 1, Its characteristics are also: The user terminal includes a map display module, which accesses map services and data by calling an SDK interface to achieve overlapping display of data on a map.
3. The system according to claim 2, Its characteristics are also: When the sensor is used for indoor air quality collection, the sensor includes at least one of the following: a temperature sensor, a humidity sensor, a formaldehyde sensor, a TVOC sensor, a PM2.5 sensor, a carbon monoxide concentration sensor, and a carbon dioxide concentration sensor.
4. The system according to claim 1, Its characteristics are also: The coordinator determines that the self-organizing network is successfully established and enters the wireless monitoring mode. When a sensor node requests to join the network, the coordinator will automatically assign an address; store and process its new network node address, update and display the data of the associated device, and the coordinator node receives the data transmitted by the aggregation node and transmits it to the gateway.
5. The system according to claim 4, Its characteristics are also: The aggregation node distinguishes between valid data packets and heartbeat packets through a preset data length.
Citation Information
Patent Citations
Intelligent vegetable home appliance internet of things system
CN108234674A
Smart home security system based on WSN
CN206725985U
Warmhouse booth information monitoring system based on agricultural internet of things
CN208044371U
