3.1 Overall system requirements. The system is required to collect and manage environmental indicators in mining areas and provide early environmental warning and technical support for government decision-making. The system is implemented through a combination of software and hardware and designed using a modular concept that separates each function into independent modules, thus making the system stable and facilitating the future expansion and extension of the system. The hardware design is based on the selection of different sensors for the environmental indicators, the development of online environmental monitoring equipment for mining areas, and the development of hardware equipment that can achieve accurate collection and real-time transmission of monitoring data. The software design makes up for the lack of computing resources and energy capacity of the environmental monitoring terminal equipment by using the system software platform and can realize the functions of data reception monitoring, data storage, data analysis, forecasting, and early warning.
3.2 System architecture. A distributed environmental online monitoring system is a collection of data and information collection, analysis, operation, and output services. The system is mainly composed of the following layers.
(1) Equipment layer. The equipment layer provides the operating environment for the system hardware and software.
(2) Network layer. The network layer provides the network environment in which the system communicates.
(3) Data layer. The data layer includes data centers (e.g., cloud centers, real-time databases, and relational databases) and provides data storage, data dictionaries, unified data interaction, protocol parsing, and other capabilities.
(4) Service layer. The service layer provides a visual display platform and a visual operation platform, and it is interfaced with the data layer for resource access and to provide the application layer with services, such as display environment, communication, and data access.
(5) Application layer. The application layer provides direct access to monitoring system services, such as view data report, view historical data, data analysis, and environmental monitoring alert services.
The system can be divided into three sub-modules, namely, hardware design, software design, and communication design. The system design diagram is shown in Fig. 2. The hardware design mainly consists of a central control box, RS485 devices, and LED screens. The communication design consists of GPRS and RS-485 communication methods to ensure the smooth operation of the system. Meanwhile, the software design is developed in the JavaEE platform by using the Spring + VUE framework, and it consists of data reception, data storage, data analysis, forecasting, and early warning modules.
3.3 Hardware design. The collection and processing of environmental data are prerequisites for environmental monitoring and early warning. The hardware structure of the system consists of a central control box, RS485 equipment, and an LED screen. The central control box consists of the main control module, a sensor module, a relay module, and a power circuit module. The main control module is controlled by the STM32F103ZET6 chip, the sensor module controls each sensor to collect environmental indicator data, the relay module controls the opening and closing status of the whole hardware circuit, and the power circuit module provides power for the operation of the microcontroller. The main structure of the system equipment is shown in Fig. 3, and the system hardware structure is shown in Fig. 4.
(1) Central control box. The central control box contains the main control, sensor, relay, power control, and other modules.
Main control module. As the core of the whole hardware device, the main control module is responsible for the control of the whole hardware device, the storage of data, and the sending of information to the software platform. The main control module adopts an STM32 microcontroller as the core. The STM32 microcontroller has low power consumption, high performance, low price, and good collaborative control capability [32–34]. The microcontroller integrates a clock circuit module, an analog-to-digital conversion module (ADC), an IIC bus module, a serial communication module (GPIO), and a power circuit module around the STM32 chip to form the core data collection components. A schematic of the STM32 chip is shown in Fig. 5. The clock circuit module is used to record the data collection time, and the ADC module is used to convert the collected PM2.5 and PM10 analog signals into digital signals. The diagram of ADC is shown in Fig. 6. The IIC bus module transfers the collected temperature and noise data to the STM32 chip, and its schematic is shown in Fig. 7. The serial communication module is used for communication between serial ports, and its schematic is shown in Fig. 8. Meanwhile, the power supply circuit module is used to provide the power required by the microcontroller, and its schematic is shown in Fig. 9. The microcontroller controls the RS485 device for data acquisition. The data storage module caches environmental indicator data and transmits the collected information to the software platform through the communication channel in accordance with a predetermined program.
Sensor module. The sensor module is one of the core components of the hardware design of the whole system. The selection of environmental indicator sensors should comply with national standard methods, and the sensors should have low power consumption, high reliability, and high measurement accuracy in consideration of the long-term operation and future maintenance of environmental online monitoring equipment [35–37]. The sensor module includes PM2.5, PM10, temperature, noise, and other sensors. The PM2.5 and PM10 sensors monitor PM2.5 and PM10 concentrations in the mine environment, respectively. The temperature sensor monitors the temperature in the mine environment, and the noise sensor monitors the amount of noise (in decibels) in the mine. The different sensors are distinguished and labeled with different pins in the STM32 microcontroller to ensure the collection, transmission, and analysis of data on environmental indicators in the mine area and to facilitate timely overhaul by maintenance personnel.
Relay module. The relay module monitors the status between current and voltage signals in the central control box. It controls the opening and closing of the entire hardware equipment circuit to achieve a small current for controlling a large current [38–44].
Power control module. The power control module of the system hardware equipment is supplied by the battery pack installed inside the system and the charging part of the solar photovoltaic panel. The electrical energy generated by solar energy charges the battery pack, thus ensuring that the voltage output from the system power control module makes the system work normally and is more than enough to provide a stable power supply for the system.
(2) RS485 equipment. Given that the system is designed to monitor several parameters related to the environmental quality of the mine, the main parameters, such as PM2.5, PM10, temperature, and noise, are selected as monitoring objects. The RS485 equipment includes PM2.5, PM10, noise, temperature, humidity, wind speed, wind direction, air pressure, and other monitoring equipment to be used for system expansion.
(3) LED screen. While transmitting data to the software platform, the hardware device displays the current real-time data on the LED screen in the hardware device.
For the collection of environmental indicator data, data collection nodes are formed through the multiple sensors of the sensor module in the STM32 microcontroller, followed by online burning of the program, initialization of the serial port and module to the STM32 microcontroller by means of USB connection from the PC side, and judging whether the environmental indicator data are collected or not. The environmental indicator data collected by the RS485 device can be sorted based on the type of parameters collected. The output signal of the sensor is divided into analog and digital signals. The analog signals collected by the PM2.5 and PM10 sensors are converted to digital signals by the ADC module; then, their values are read. The digital signals collected by the temperature and noise sensors are read directly via the serial or I/O ports, and the collected data are outputted to the IIC bus module.The flow chart of environmental indicator collection and transmission in hardware design is shown in Fig. 10.
3.4 Communication design. The data collected by the system hardware are transmitted to the software platform via a communication module. The communication design of this system combines RS-485 GPRS communication to make the system communication overcome the drawbacks of complex networking and maintenance difficulties. The combination also has the advantages of reliability and real-time performance, thus creating a good remote monitoring and real-time information collection system. The communication design uses the STM32 chip in the hardware device to connect an external RS485 module and form a sub-monitoring system within a certain range and distance by using the RS485 FieldBus card. Information acquisition and control by this sub-system are completed by the microcontroller in the hardware device, which is connected to the GPRS wireless module through the serial port to realize communication with the system software platform and sensor collection in the hardware device. The microcontroller is connected to the GPRS wireless module through the serial port to communicate with the system software platform and transmit the environmental indicator data collected by the sensors in the hardware device. The system communication diagram is shown in Fig. 11.
(1) GPRS communication. GPRS is a wireless packet data exchange and transmission technology with a normal data transmission rate of 61.7 kB/s and a maximum capacity of 178.4 kB/s [45]. It improves the transmission rate and is inexpensive. After the hardware device has collected environmental indicator data, the data can be transmitted remotely and in real time by using GPRS [46–48], which transmits the data directly to the server side, that is, the software platform, where the user can view the real-time data via a PC or an app and store the acquired data information in the database of the system software platform. The GPRS communication method allows fast access to the software and can readily provide clear, real-time data to software platform users. Users can also grasp the environmental quality of the mine area in time in accordance with the real-time environmental index data.
(2) RS-485 communication. RS-485 is a multi-transmitter standard with excellent interference suppression for signal transmission, low impedance, zero grounding problems, transmission distance of up to 1200 m, and transmission rate of up to 1 Mbps [49]. RS-485 communication is an open communication network that can be used as a link for intelligent devices [50–52]. The bus network nodes can be hooked up to RS-485 communication by using the standard Modbus RTU protocol and can be directly connected to a microcontroller. In an RS-485 communication system consisting of a PC and a microcontroller, node identification is achieved by setting different station addresses. Ordinary PCs generally do not carry an RS485 interface, so an RS-232C/RS-485 converter is used; for microcontrollers, TTL/RS-485 level conversion can be applied using the MAX485 chip. The schematic of the RS485 module is shown in Fig. 12.
3.5 Software design. System software design refers to placing the environmental indicator data transmitted through the communication channel in the database of the software platform by using the development framework of Spring Boot + VUE on the JavaEE platform. It involves combining Redis (non-relational data) and MySQL (relational data) databases, adopting the B/S software architecture, using the idea of structured programming, and carrying out a top–down detailed procedure. The module structure is designed to develop applications, including environmental information sub-platform, forecast and early warning sub-platform, and business management sub-platform, whose functions include data reception, data processing, real-time display, comprehensive analysis, forecast, early warning, and visualization operations. The functional structure of the software platform is shown in Fig. 13.
(1) Environmental information sub-platform. The environmental information sub-platform includes the functions of real-time and historical data display.
The real-time data display function means that after receiving the environmental indicator data transmitted to the software platform by each monitoring point through the communication channel, the environmental information sub-platform collects and processes the data then displays the environmental indicator information on the interface of the software platform so that users can enter the real-time monitoring data page to view the latest data on particle concentration, temperature, and noise in each monitoring point and monitoring equipment in the mine area. The data are displayed in a list in the user interface so that users can view the data by simply logging into their browser and mobile terminal. The data in the table can also be filtered by environmental indicator name, indicator range, date, and other relevant conditions and can be sorted by indicator size and date.
The historical data display function means that while the environmental information sub-platform receives data, the collected data are saved to the database so that historical environmental information data can be displayed. This function allows the corresponding data to be queried by options, such as mine number, monitoring point number, equipment number, and date. This function can transform historical data tables into digital images, such as line graphs, to visually reflect the change patterns of PM2.5, PM10, and other indicators in the mine area within a certain period.
(2) Forecasting and early-warning sub-platform. The forecasting and warning sub-platform is used to analyze environmental indicator data to understand the state of environmental quality in the mine area and to grasp the changes in environmental quality so that timely preventive measures can be applied. The forecasting and warning sub-platform further analyzes the data received and stored by the environmental information sub-platform by using multiple linear regression forecasting models. Through continuous monitoring of the mine area at multiple points, the environmental quality of each area of the mine is assessed. When the environmental indicators are predicted to exceed the safe range in the next period, corresponding early warning information is given. The forecast information can be displayed in the form of visual images in the mine diagram, and it includes information on mine monitoring points and alarm information, which can help users observe and understand the environmental status of the mine and facilitate timely prevention and control.
The real-time forecasting and warning function in the software platform employs a multiple linear regression model for forecasting. The model can be expressed as
Y = β0 + β1X1 + β2X2+⋯+βnXn + ε,
where Y is the dependent variable representing the environmental quality of the mine. The larger Y is, the worse the quality of the mine is. The smaller Y is, the better the quality of the mine is. Xi (i = 1,2,...,n) represents the relevant indicators, n is the number of environmental indicators, β0 represents the regression constant, βi refers to the regression coefficient, and ε is a random error term.
The modeling steps are as follows: (i) data acquisition and transferring the environmental indicator data stored in the database to the module by calling the internal program of the software platform; (ii) cleaning and pre-processing the transferred data to deal with the residual and abnormal values in the data; (iii) calculating the corresponding regression coefficients and regression constants of the environmental indicators; (iv) substituting the calculated regression coefficients and regression constants into the prediction model to determine the prediction model function; and (v) prediction estimation and substituting the newly acquired data into the prediction model function to calculate the corresponding function value. If the function value is outside the safe range, an alarm message will be displayed in time on the visualization interface of the software platform.
(3) Business management sub-platform. The business management sub-platform includes the mine area diagram, mine monitoring point management, mine monitoring equipment management, and personnel and authority management. Users can locate the geographical position of each device by viewing the mine’s schematic. The mine environmental monitoring points and monitoring equipment are deployed in accordance with national policies and the actual situation of the mine site and then entered into the software platform for monitoring point and monitoring equipment management. Users can monitor the operational status of the equipment at the mine site in real time through the equipment management function. When monitoring equipment failure is detected, users receive abnormality reports of the relevant equipment so that the cause of the failure can be determined, and maintenance personnel can be dispatched promptly. Personnel and authority management can further assist in the intelligent construction of the mine.