| Water is the source of all things,and pure water is extremely important for the growth of all things.In recent years,the rapid development of my country’s industrial modernization process has made the pollution of rivers and lakes extremely prominent;due to human life and production,the quality of groundwater and surface water has deteriorated sharply,and the water resources available for human use have become increasingly scarce.In response to the above problems,this paper designs an online water quality monitoring system based on LoRa technology based on the cross-section of Nanji Mountain in Poyang Hu,to monitor the water quality of Poyang Lake waters in real time,grasp the information of remote waters in time.First,the characteristics of WAN and the bottleneck in the field of water quality monitoring are analyzed,and it is proposed to apply LoRa technology to water quality monitoring systems.Discuss the requirements and overall architecture of the system,design the software and hardware of terminal nodes and gateway nodes,analyze monitoring indicators and select sensor types,design of the main control module and the wireless communication module(LoRa and GPRS);use Modbus protocol and RS485 to build Bus mode,use LoRa technology and MQTT protocol to build LoRa WAN system architecture,study the frame structure,working mode and network access mode of the architecture,as well as the integration of MQTT proxy server and gateway and server,to complete the construction and deployment of LoRa system.Secondly,analyze the structure of water quality data table,establish My SQL database and table;use Nginx reverse proxy and Redis caching technology to build high-performance web server cluster;use JAVA language,combine mainstream SSM framework and Vue and Element-ui for web development Design,and use Echarts technology to realize the visualization of data charts,as well as the addition,deletion and modification of gateway information;for a large amount of historical water quality data,the big data Hadoop cluster technology is proposed for storage and analysis,which provides a data source for the establishment of algorithm model.And then,solutions are proposed for missing data and abnormal problems.Considering the coupling relationship between the features of the data,this paper uses factor analysis(FA)to reduce the dimensionality of the features,and determines six main features,such as p H,permanganate,ammonia nitrogen,electrical conductivity,dissolved oxygen and total phosphorus,as the input to the algorithm model.In view of the long training time of BP neural network and easy to fall into local optimum,this paper proposes to use Extreme Learning Machine(ELM)to perform regression prediction on total phosphorus.In the prediction results,the RMSE can reach 0.015,which is 12% less than BP’s 0.017,and the training time reaches 0.001,which is 95.5%less than BP’s 0.022.The results show that the ELM model proposed in this paper has short training time and high prediction accuracy.However,the performance of the ELM model depends on the initial weights and thresholds,which are random.In order to obtain the optimal parameters,this paper uses the Grey Wolf Optimizer(GWO)to optimize the parameters.Using the ELM model with optimal parameters to predict total phosphorus,the RMSE in the prediction result reaches 0.009,which is 40% lower than that of ELM and 47% lower than that of BP.The experimental results show that the optimized GWO-ELM model has better prediction accuracy.Finally,the above algorithms are not applicable to big data scenarios,this paper proposes to use the Light GBM(Light Gradient Boosting Machine)integrated algorithm to predict total phosphorus,and the RMSE in the prediction result reaches0.01,compared with The ELM model is reduced by 33%,but it is 10% higher than the GWO-ELM model.Its performance is affected by hyperparameters.Therefore,GWO is used to optimize the hyperparameters,and the Light GBM model with the optimal parameters is used to predict total phosphorus.In the results,the RMSE reaches 0.005,which is 50% lower than the Light GBM model,44% lower than the GWO-ELM model,66.7% lower than the ELM model,and the R2 also reaches 96.5%.The optimized GWO-Light GBM model has better predictions.It can be seen that the anti-interference and fitting ability of the LightGBM model is stronger than that of the ELM model. |