CN116343946A - Water Pollution Decision-Making Method and System Based on Neural Network - Google Patents

Water Pollution Decision-Making Method and System Based on Neural Network Download PDF

Info

Publication number
CN116343946A
CN116343946A CN202310337122.9A CN202310337122A CN116343946A CN 116343946 A CN116343946 A CN 116343946A CN 202310337122 A CN202310337122 A CN 202310337122A CN 116343946 A CN116343946 A CN 116343946A
Authority
CN
China
Prior art keywords
water quality
water
data
neural network
quality prediction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310337122.9A
Other languages
Chinese (zh)
Other versions
CN116343946B (en
Inventor
余游
王化斌
封雷
刘晓
米雪晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Chongqing Institute of Green and Intelligent Technology of CAS
Original Assignee
Chongqing University
Chongqing Institute of Green and Intelligent Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University, Chongqing Institute of Green and Intelligent Technology of CAS filed Critical Chongqing University
Priority to CN202310337122.9A priority Critical patent/CN116343946B/en
Publication of CN116343946A publication Critical patent/CN116343946A/en
Application granted granted Critical
Publication of CN116343946B publication Critical patent/CN116343946B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/30Prediction of properties of chemical compounds, compositions or mixtures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/70Machine learning, data mining or chemometrics
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A20/00Water conservation; Efficient water supply; Efficient water use
    • Y02A20/152Water filtration

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Chemical & Material Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Molecular Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Biophysics (AREA)
  • Algebra (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明涉及水污染防治技术领域,具体为一种基于神经网络的水污染决策方法及系统,该方法,包括以下内容:获取当前水质数据;调用预设的水质预测模型,水质预测模型基于LSTM和马尔可夫链构建;水质预测模型根据当前水质数据进行预测生成LSTM预测结果,并根据马尔可夫链对LSTM预测结果进行修正输出水质预测趋势。采用本方案,能够解决现有技术中使用神经网络算法进行水质预测所存在的准确性较低的技术问题。

Figure 202310337122

The invention relates to the technical field of water pollution prevention and control, specifically a neural network-based water pollution decision-making method and system. The method includes the following contents: obtaining current water quality data; calling a preset water quality prediction model, which is based on LSTM and Markov chain construction; the water quality prediction model predicts and generates LSTM prediction results based on the current water quality data, and corrects the LSTM prediction results according to the Markov chain to output water quality prediction trends. Adopting this solution can solve the technical problem of low accuracy existing in water quality prediction using a neural network algorithm in the prior art.

Figure 202310337122

Description

基于神经网络的水污染决策方法及系统Water Pollution Decision-Making Method and System Based on Neural Network

技术领域technical field

本发明涉及水污染防治技术领域,具体为一种基于神经网络的水污染决策方法及系统。The invention relates to the technical field of water pollution prevention and control, in particular to a neural network-based water pollution decision-making method and system.

背景技术Background technique

水污染的防治是环境保护的重大关键问题之一,我国虽然水资源总量丰富,但水源污染严重,旱涝灾害频繁,加上地区经济发展有所差异,使得我国水资源管理和水环境保护问题日益突出。The prevention and control of water pollution is one of the major key issues in environmental protection. Although my country has abundant water resources, water pollution is serious, droughts and floods are frequent, and regional economic development is different, which makes my country's water resources management and water environment protection difficult. The problem is becoming more and more prominent.

随着全球云计算、物联网、移动互联网等新一轮信息技术迅速发展和深入应用,城市信息化发展正酝酿着重大变革和新的突破,由对象、过程数字化为主要特征的数字化城市向智慧化发展已成为必然趋势。而水环境管理是城市管理的重要组成部分,信息化必然成为水污染防治发展的有力工具,水污染防治信息化建设势在必行。With the rapid development and in-depth application of a new round of information technology such as global cloud computing, the Internet of Things, and the mobile Internet, major changes and new breakthroughs are brewing in the development of urban informatization. Globalization has become an inevitable trend. Water environment management is an important part of urban management, informatization will inevitably become a powerful tool for the development of water pollution prevention and control, and the construction of informatization in water pollution prevention and control is imperative.

水污染防治大数据主要通过数采仪、无线网络、水质水压表等在线监测设备实时感知各系统的运行状态,将海量水环境信息进行及时分析与处理,并做出相应的处理结果辅助决策建议,以更加精细和动态的方式管理水污染防治。为更智能化的进行水环境管理,对水环境进行水质预测,水质预测是按照水质实际监测因子的指标数据资料,利用水质数学模型对水体未来几个小时或者几天内的变化做出预测,通过水质预测对水质污染事件进行预防。Big data for water pollution prevention and control mainly senses the operating status of each system in real time through online monitoring equipment such as data acquisition instruments, wireless networks, and water quality and pressure gauges, analyzes and processes massive water environment information in a timely manner, and makes corresponding processing results to assist decision-making It is recommended that water pollution prevention and control be managed in a more granular and dynamic manner. In order to manage the water environment more intelligently, the water quality prediction of the water environment is carried out. The water quality prediction is based on the index data of the actual monitoring factors of the water quality, and the water quality mathematical model is used to predict the changes of the water body in the next few hours or days. Prevent water pollution incidents through water quality forecasting.

现有技术中,利用神经网络算法建立数学模型,通过数学模型对水质未来变化的大致趋势进行预测。为保证数学模型预测的准确性,将历史监测数据作为样本对数学模型进行训练,训练过程中所使用的样本容易受外在因素影响,有时会存在一定误差,导致预测结果在一定范围内随机波动,使得预测的准确性降低。In the prior art, a neural network algorithm is used to establish a mathematical model, and the general trend of future changes in water quality is predicted through the mathematical model. In order to ensure the accuracy of the prediction of the mathematical model, the historical monitoring data are used as samples to train the mathematical model. The samples used in the training process are easily affected by external factors, and sometimes there are certain errors, resulting in random fluctuations in the prediction results within a certain range. , which reduces the prediction accuracy.

发明内容Contents of the invention

本发明的目的之一在于提供一种基于神经网络的水污染决策方法,以解决现有技术中使用神经网络算法进行水质预测所存在的准确性较低的技术问题。One of the objectives of the present invention is to provide a neural network-based water pollution decision-making method to solve the technical problem of low accuracy in water quality prediction using neural network algorithms in the prior art.

本发明提供的基础方案一:基于神经网络的水污染决策方法,包括以下内容:Basic scheme one that the present invention provides: the water pollution decision-making method based on neural network, comprises the following content:

获取当前水质数据;Obtain current water quality data;

调用预设的水质预测模型,水质预测模型基于LSTM和马尔可夫链构建;Call the preset water quality prediction model, which is constructed based on LSTM and Markov chain;

水质预测模型根据当前水质数据进行预测生成LSTM预测结果,并根据马尔可夫链对LSTM预测结果进行修正输出水质预测趋势。The water quality prediction model predicts and generates LSTM prediction results based on the current water quality data, and corrects the LSTM prediction results according to the Markov chain to output the water quality prediction trend.

进一步,还包括以下内容:获取历史水质数据,根据历史水质数据对水质预测模型进行训练,对训练后的水质预测模型进行存储。Further, the following content is also included: obtaining historical water quality data, training the water quality prediction model according to the historical water quality data, and storing the trained water quality prediction model.

进一步,还包括以下内容:根据水质预测趋势和预设的水质等级规则对当前水质进行分析和判定生成水质预测等级。Further, the following content is also included: analyzing and determining the current water quality according to the water quality prediction trend and preset water quality grade rules to generate a water quality prediction grade.

进一步,当前水质数据和水质预测趋势均包括多种监测因子的指标数据。Furthermore, both the current water quality data and the water quality forecast trend include indicator data of various monitoring factors.

进一步,还包括以下内容:Further, it also includes the following:

获取水污染防治大数据,根据水污染防治大数据建立基于随机森林算法的水污染防治模型;水污染防治模型根据水质预测趋势输出的水质治理措施。Obtain big data on water pollution prevention and control, and establish a water pollution prevention and control model based on the random forest algorithm based on the big data on water pollution prevention and control; the water pollution prevention and control model outputs water quality control measures based on water quality prediction trends.

进一步,水质治理措施包括措施对应的污染类型、治理措施大类、治理措施小类、技术工艺、建设难易程度、建设成本、运营难易程度、运营成本、预期成效中的一种或多种。Further, water quality control measures include one or more of the corresponding pollution types, major categories of control measures, subcategories of control measures, technical processes, construction difficulty, construction cost, operation difficulty, operation cost, and expected results .

基础方案一的有益效果:Beneficial effects of basic plan one:

1、本方案中,采用基于LSTM和马尔可夫链构建的水质预测模型,通过马尔可夫链分析LSTM预测结果误差的波动范围,并且预测波动的发展趋势,通过马尔可夫链对LSTM预测结果进行修正,以此对水质预测趋势的精细优化,从而更好地消除由外在因素而产生的预测误差,因此建立LSTM和马尔可夫链组合的水质预测模型,能够在一定程度上减少因具体数值造成的误差,提高预测结果的准确度。1. In this program, the water quality prediction model based on LSTM and Markov chain is used to analyze the fluctuation range of the LSTM prediction result error through the Markov chain, and the development trend of fluctuation is predicted, and the LSTM prediction result is analyzed through the Markov chain Corrections are made to finely optimize the trend of water quality prediction, so as to better eliminate the prediction error caused by external factors. Therefore, the establishment of a water quality prediction model combined with LSTM and Markov chain can reduce to a certain extent The error caused by the value can improve the accuracy of the prediction result.

2、采用本方案通过水质预测趋势,得知水质演变趋势,从而提前对造成水质变化的因素进行分析,及时对污染的河流水域作出提前决策。通过水质预测等级,了解水质级别变化,从而及时发现问题,解决问题。2. Use this program to predict the trend of water quality and know the evolution trend of water quality, so as to analyze the factors causing water quality changes in advance and make early decisions on polluted river waters in time. Through the water quality forecast level, understand the change of water quality level, so as to find and solve problems in time.

3、本方案中,当前水质数据和水质预测趋势均包括多种监测因子,考虑到河流水污染物的关联性采用多因子预测,利用多个因子的相互作用来共同预测下一时刻的某一因子的指标数据,从而提高预测结果的准确性。3. In this scheme, the current water quality data and water quality prediction trends include multiple monitoring factors. Considering the correlation of river water pollutants, multi-factor prediction is adopted, and the interaction of multiple factors is used to jointly predict a certain level in the next moment. The index data of factors can improve the accuracy of prediction results.

4、同时,本方案中还采用基于随机森林算法的水污染防治模型,通过水质预测趋势匹配水质治理措施。随机森林算法具备准确率高、能够有效地在大数据集上运行以及不容易过拟合等优点,在匹配水质治理措施时,能够自动实现对不同流域污染水质的治理措施推荐,为后续防治措施决策提供有效参考,实现不同场景下的水污染治理措施推荐。同时也可根据水质治理措施形成水环境治理任务和目标,并对任务的实施完成情况及效果进行跟踪考核。4. At the same time, this program also uses a water pollution prevention and control model based on the random forest algorithm to match water quality control measures through water quality prediction trends. The random forest algorithm has the advantages of high accuracy, can effectively run on large data sets, and is not easy to overfit. When matching water quality control measures, it can automatically implement the recommendation of control measures for polluted water quality in different river basins, and provide a basis for subsequent prevention and control measures. Provide effective reference for decision-making, and realize the recommendation of water pollution control measures in different scenarios. At the same time, the water environment management tasks and goals can also be formed according to the water quality control measures, and the implementation and completion of the tasks and the effect can be tracked and assessed.

本发明的目的之二在于提供一种基于神经网络的水污染决策系统。The second object of the present invention is to provide a water pollution decision system based on neural network.

本发明提供基础方案二:基于神经网络的水污染决策系统,使用上述基于神经网络的水污染决策方法。The present invention provides the second basic solution: a neural network-based water pollution decision-making system, using the above-mentioned neural network-based water pollution decision-making method.

进一步,包括:Further, including:

数据获取模块,用于获取当前水质数据;Data acquisition module, used to acquire current water quality data;

水质预测模块预设有水质预测模型;水质预测模型用于根据当前水质数据生成LSTM预测结果,并根据马尔可夫链修正LSTM预测结果生成水质预测趋势;The water quality prediction module is preset with a water quality prediction model; the water quality prediction model is used to generate LSTM prediction results based on current water quality data, and to generate water quality prediction trends based on Markov chain correction of LSTM prediction results;

水质预测模块用于获取水质预测模型根据当前水质数据输出的水质预测趋势。The water quality prediction module is used to obtain the water quality prediction trend output by the water quality prediction model based on the current water quality data.

进一步,数据获取模块还用于获取历史水质数据,还包括:Further, the data acquisition module is also used to acquire historical water quality data, including:

模型生成及训练模块,用于基于LSTM和马尔可夫链建立水质预测模型,根据历史水质数据训练水质预测模型,并将训练后的水质预测模型存储在水质预测模块中。The model generation and training module is used to establish a water quality prediction model based on LSTM and Markov chain, train the water quality prediction model according to historical water quality data, and store the trained water quality prediction model in the water quality prediction module.

进一步,还包括:Further, it also includes:

水污染防治模块预设有水污染防治模型;The water pollution prevention and control module is preset with a water pollution prevention and control model;

水污染防治模块用于获取水污染防治模型根据水质预测趋势输出的水质治理措施。The water pollution prevention and control module is used to obtain the water quality control measures output by the water pollution prevention and control model according to the water quality prediction trend.

基础方案二的有益效果:Beneficial effects of the second basic plan:

1、本方案中,水质预测模块的设置,通过马尔可夫链分析LSTM预测结果误差的波动范围,并且预测波动的发展趋势,通过马尔可夫链对LSTM预测结果进行修正,以此对水质预测趋势的精细优化,从而更好地消除由外在因素而产生的预测误差,进而在一定程度上减少因具体数值造成的误差,提高预测结果的准确度。同时,本方案通过水质预测模块进行预测获得水质预测趋势,得知水质演变趋势,提前对造成水质变化的因素进行分析,及时对污染的河流水域作出提前决策。1. In this program, the setting of the water quality prediction module analyzes the fluctuation range of the LSTM prediction result error through the Markov chain, and predicts the development trend of the fluctuation, and corrects the LSTM prediction result through the Markov chain to predict the water quality. The fine optimization of the trend can better eliminate the forecast error caused by external factors, and then reduce the error caused by the specific value to a certain extent, and improve the accuracy of the forecast result. At the same time, this program uses the water quality prediction module to predict the water quality prediction trend, know the water quality evolution trend, analyze the factors that cause water quality changes in advance, and make early decisions on polluted river waters in a timely manner.

2、本方案中,水污染防治模块的设置,通过基于随机森林算法的水污染防治模型,为水质预测趋势匹配水质治理措施。随机森林算法具备准确率高、能够有效地在大数据集上运行以及不容易过拟合等优点,在匹配水质治理措施时,能够自动实现对不同流域污染水质的治理措施推荐,以此确定适合不同水环境治理的决策措施,从而形成水环境治理任务和目标,并对任务的实施完成情况及效果进行跟踪考核。2. In this plan, the setting of the water pollution prevention and control module matches the water quality control measures for the water quality prediction trend through the water pollution prevention and control model based on the random forest algorithm. The random forest algorithm has the advantages of high accuracy, can effectively run on large data sets, and is not easy to overfit. Different decision-making measures for water environment governance, thus forming water environment governance tasks and goals, and tracking and evaluating the implementation and completion of tasks and their effects.

附图说明Description of drawings

图1为本发明基于神经网络的水污染决策系统的流程图;Fig. 1 is the flow chart of the water pollution decision-making system based on neural network of the present invention;

图2为本发明LSTM记忆单元的结构示意图;Fig. 2 is the structural representation of LSTM memory unit of the present invention;

图3为本发明PH值预测数据与真实数据对比图;Fig. 3 is the comparison chart of pH value prediction data and real data of the present invention;

图4为本发明水质氨氮含量预测数据与真实数据对比图;Fig. 4 is the comparison chart of the prediction data and real data of water quality ammonia nitrogen content of the present invention;

图5为本发明水质总磷含量预测数据与真实数据对比图;Fig. 5 is the comparison chart of the prediction data and real data of water quality total phosphorus content of the present invention;

图6为本发明实施例二的集成架构图。FIG. 6 is an integrated architecture diagram of Embodiment 2 of the present invention.

具体实施方式Detailed ways

下面通过具体实施方式进一步详细说明:The following is further described in detail through specific implementation methods:

实施例一Embodiment one

基于神经网络的水污染决策方法,如附图1所示,包括以下内容:The water pollution decision-making method based on neural network, as shown in Figure 1, includes the following contents:

S1:获取历史水质数据,根据历史水质数据对水质预测模型进行训练,对训练后的水质预测模型进行存储。S1: Obtain historical water quality data, train the water quality prediction model according to the historical water quality data, and store the trained water quality prediction model.

S2:获取当前水质数据;调用预设的水质预测模型,水质预测模型基于LSTM(神经网络)和马尔可夫链构建;水质预测模型根据当前水质数据进行预测生成LSTM预测结果,并根据马尔可夫链对LSTM预测结果进行修正输出水质预测趋势。S2: Get the current water quality data; call the preset water quality prediction model, the water quality prediction model is constructed based on LSTM (neural network) and Markov chain; the water quality prediction model generates LSTM prediction results according to the current water quality data, and according to Markov The chain corrects the LSTM prediction results to output the water quality prediction trend.

S1步骤具体包括以下内容:Step S1 specifically includes the following:

S101:获取历史水质数据,历史水质数据包括历史各断面所采集的多种监测因子的指标数据,监测因子包括水质数据包括采样时间、断面(数据采样的地点)、位置(以河流的上下游进行表示)、流量、降雨量、断面汇水区人口、TP(水质总磷含量)、NH4-N(水质氨氮含量)和COD(水质溶解氧)、pH值中的一种或多种。S101: Obtain historical water quality data. Historical water quality data includes index data of various monitoring factors collected at each section in history. Monitoring factors include water quality data including sampling time, section (location of data sampling), location (upstream and downstream of the river) One or more of water flow, rainfall, cross-section catchment area population, TP (total phosphorus content of water quality), NH4-N (ammonia nitrogen content of water quality), COD (dissolved oxygen of water quality), and pH value.

S102:基于LSTM(神经网络)和马尔可夫链建立水质预测模型。如附图2所示,图中每个圆圈为逐点运算,即对向量做出相应操作;每个矩形代表一个神经网络层,其内部字符代表相应神经网络所使用的激活函数。S102: Establish a water quality prediction model based on LSTM (neural network) and Markov chain. As shown in Figure 2, each circle in the figure is a point-by-point operation, that is, a corresponding operation is performed on the vector; each rectangle represents a neural network layer, and its internal characters represent the activation function used by the corresponding neural network.

LSTM神经网络的每个细胞有三个门控,输入门(Input gate)、遗忘门(Forgetgate)和输出门(Output gate)。Each cell of the LSTM neural network has three gates, the input gate, the forget gate and the output gate.

遗忘门将上一单元的输出数据以及本单元的输入数据作为输入的sigmoid函数,它可以为上一时刻的记忆单元中的任一项产生一个范围在[0,1]内的值,通过这个值来控制上一单元被遗忘的程度。The forget gate takes the output data of the previous unit and the input data of this unit as the input sigmoid function, which can generate a value in the range [0, 1] for any item in the memory unit at the previous moment, through this value To control the degree to which the previous unit is forgotten.

输入门与一个tanh函数进行配合,以控制有多少新的信息被加入。tanh函数会产生当前的候选记忆单元值,而输入门会为当前候选单元中的任一项产生一个范围在[0,1]内的值,从而控制新信息被加入的程度。The input gate is coupled with a tanh function to control how much new information is added. The tanh function will generate the current candidate memory cell value, and the input gate will generate a value in the range [0,1] for any of the current candidate cells, thereby controlling the degree to which new information is added.

输出门是控制当前单元状态有多少被遗忘,在单元状态激活之后,输出门就会为其中任一项产生一个范围在[0,1]内的值,通过这个值来控制单元状态被过滤的程度。The output gate is to control how much the current unit state is forgotten. After the unit state is activated, the output gate will generate a value in the range [0,1] for any of them, and use this value to control the unit state to be filtered. degree.

根据以下公式构建基于LSTM的数学模型:Construct an LSTM-based mathematical model according to the following formula:

ft=σ(Wfxxt+Wfhht-1+bf) (1)f t =σ(W fx x t +W fh h t-1 +b f ) (1)

it=σ(Wixxt+Wihht-1+bi) (2)i t =σ(W ix x t +W ih h t-1 +b i ) (2)

ot=σ(Woxxt+Wohht-1+bo) (3)o t =σ(W ox x t +W oh h t-1 +b o ) (3)

Figure BDA0004156832610000051
Figure BDA0004156832610000051

其中,xt表示时刻输入数据,ht-1表示上一时刻LSTM单元输出值,Ct-1表示上一时刻记忆单元值,Ct表示t时刻记忆单元值;W*为权重系数(例如Wxi表示对应输入数据和输入门之间的权值);b*为偏置向量(例如bi为输入门的偏置向量)。σ为sigmoid函数,取值为[0,1],当取0值时表示门控关闭,取1值时表示门控打开,其公式如式(4)。Among them, x t represents the input data at the time, h t-1 represents the output value of the LSTM unit at the previous time, C t-1 represents the value of the memory unit at the previous time, C t represents the value of the memory unit at time t; W * is the weight coefficient (for example W xi represents the weight between the corresponding input data and the input gate); b * is the bias vector (for example, bi is the bias vector of the input gate). σ is a sigmoid function, and its value is [0,1]. When it takes a value of 0, it means that the gate control is closed, and when it takes a value of 1, it means that the gate control is open. The formula is as in formula (4).

C′t=tanh(Wxcxt+Whcht-1+bc) (5)C′ t =tanh(W xc x t +W hc h t -1+b c ) (5)

Ct=ftCt-1+itC′t (6)C t =f t C t -1+i t C′ t (6)

Figure BDA0004156832610000052
Figure BDA0004156832610000052

其中,C′t表示当前候选记忆单元值,计算当前时刻记忆单元状态值Ct的迭代公式如式(6)所示,tanh为双曲正切激活函数;Wxc为对应输入数据和记忆单元之间的权值,Whc为隐藏层和记忆单元之间的权值。Among them, C′ t represents the value of the current candidate memory unit, and the iterative formula for calculating the state value C t of the memory unit at the current moment is shown in formula (6), tanh is the hyperbolic tangent activation function; W xc is the relationship between the corresponding input data and the memory unit The weight between, W hc is the weight between the hidden layer and the memory unit.

设有n(n>0)维输入x1,x2,...,xn,m(m>0)维网络的隐层状态序列h1,h2,...,hm,k(k>0)维输出序列y1,y2,...,yk,yk是t时刻LSTM单元的输出,计算公式如式(8)所示。Suppose n(n>0) dimensional input x 1 ,x 2 ,...,x n ,m(m>0) hidden layer state sequence h 1 ,h 2 ,...,h m ,k (k>0)-dimensional output sequence y 1 , y 2 ,...,y k , y k is the output of the LSTM unit at time t, and the calculation formula is shown in formula (8).

yt=ottanh(Ct) (8)yt=o t tanh(C t ) (8)

虽然LSTM循环神经网络模型在模拟时,为保证准确性,会应用许多样本训练和测试数据,但是这些数据受外在因素影响,有时会存在一定误差,这样会导致预测结果在一定范围内随机波动,降低了预测的准确性。而马尔可夫链(Markov chain)的使用可以更好地消除由外在因素而产生的预测误差,因此,建立神经网络与马尔可夫链的组合预测模型,能够得到更准确的预测结果。Although the LSTM cycle neural network model will use many sample training and test data to ensure accuracy during simulation, but these data are affected by external factors, sometimes there will be certain errors, which will lead to random fluctuations in the prediction results within a certain range , reducing the prediction accuracy. The use of Markov chain can better eliminate the prediction error caused by external factors. Therefore, the establishment of a combined prediction model of neural network and Markov chain can obtain more accurate prediction results.

马尔可夫链是具有马尔可夫性质的随机变量的一个数列,而马尔可夫链预测法是一种适用于随机过程的科学、有效的动态预测方法。该方法主要分两个过程:一是确定马尔可夫链的状态空间,二是要通过计算确定状态转移概率与状态转移矩阵。Markov chain is a sequence of random variables with Markov properties, and Markov chain prediction method is a scientific and effective dynamic prediction method suitable for random processes. This method is mainly divided into two processes: one is to determine the state space of the Markov chain, and the other is to determine the state transition probability and state transition matrix through calculation.

根据以下公式构建基于LSTM和马尔可夫链建立水质预测模型:Build a water quality prediction model based on LSTM and Markov chain according to the following formula:

在事件发展变化过程中,在状态i的过程下一步转移到状态j的概率,简称状态转移概率,如式(9)所示:In the process of event development and change, the probability of transitioning to state j in the next step in the process of state i, referred to as the state transition probability, is shown in formula (9):

Pij=P{Xn+1=j|Xn=i} (9)P ij =P{X n+1 =j|X n =i} (9)

其中,Pij为状态转移概率;Xn=i表示过程在n时刻处于状态i,称{0,1,2,…)为该过程的状态空间,记为S,S为状态空间的总称。对马尔科夫链,给定过去的状态X1,X2,..,Xn-1,以及现在的状态XnAmong them, P ij is the state transition probability; X n =i means that the process is in state i at time n, called {0, 1, 2, ...) is the state space of the process, denoted as S, and S is the general name of the state space. For a Markov chain, given the past states X 1 , X 2 ,...,X n-1 , and the current state X n .

通过马尔可夫链模型可以分析LSTM循环神经网络模拟预测结果误差的波动范围,并且预测波动的发展趋势,通过误差的状态转移概率矩阵对LSTM循环神经网络预测的结果进行进一步的精细优化。Through the Markov chain model, it is possible to analyze the fluctuation range of the LSTM cyclic neural network simulation prediction result error, and predict the development trend of the fluctuation, and further refine the results predicted by the LSTM cyclic neural network through the state transition probability matrix of the error.

马尔可夫链具备所谓的“无后效性”,即要确定该过程时刻的状态,只需知道时刻的情况即可,并不需要对时刻的状况完整了解。此外,最终构建的模型的最终预测结果不是一个具体数值,而是生成一组不同概率的预测区间值,从而在一定程度上减少因具体数值造成的误差,提高预测准确度。The Markov chain has the so-called "no aftereffect", that is, to determine the state of the process moment, it is only necessary to know the situation at the moment, and it is not necessary to have a complete understanding of the situation at the moment. In addition, the final prediction result of the final constructed model is not a specific value, but a set of prediction interval values with different probabilities is generated, so as to reduce the error caused by the specific value to a certain extent and improve the prediction accuracy.

S103:根据历史水质数据对水质预测模型进行训练。S103: Train the water quality prediction model according to the historical water quality data.

在本实施例中,采用多因子预测,因此监测因子包括pH值、TP和NH3-N,将历史水质数据中监测因子的指标数据作为样本,根据样本对基于LSTM和马尔可夫链建立的水质预测模型进行训练。In this embodiment, multi-factor prediction is adopted, so the monitoring factors include pH value, TP and NH3-N, and the indicator data of the monitoring factors in the historical water quality data are used as samples, and the water quality based on LSTM and Markov chain is established according to the samples The predictive model is trained.

多因子预测,是指在同一时刻的水质中含有的多种监测因子的指标数据是受其他因子相互作用和影响的。考虑到河流水污染物的关联性采用多因子预测,利用多个因子的相互作用来共同预测下一时刻的某一因子的指标数据,从而提高预测结果的准确性。Multi-factor prediction means that the index data of multiple monitoring factors contained in the water quality at the same time are interacted and affected by other factors. Considering the correlation of river water pollutants, multi-factor prediction is adopted, and the interaction of multiple factors is used to jointly predict the index data of a certain factor at the next moment, so as to improve the accuracy of the prediction results.

S104:存储训练后的水质预测模型,以供后续水质预测使用。S104: Store the trained water quality prediction model for use in subsequent water quality predictions.

S2步骤具体包括以下内容:Step S2 specifically includes the following:

S201:获取当前水质数据,当前水质数据包括多种监测因子的指标数据,在本实施例中,监测因子包括pH值、TP和NH3-N。S201: Obtain current water quality data. The current water quality data includes index data of various monitoring factors. In this embodiment, the monitoring factors include pH value, TP and NH3-N.

S202:调用预设的水质预测模型,调用步骤S104存储的水质预测模型。S202: calling a preset water quality prediction model, and calling the water quality prediction model stored in step S104.

S203:将当前水质数据作为输入,输入水质预测模型,获取水质预测模型输出的水质预测趋势。即水质预测模型根据当前水质数据进行预测生成LSTM预测结果,并根据马尔可夫链对LSTM预测结果进行修正输出水质预测趋势。S203: Inputting the current water quality data into the water quality prediction model to obtain the water quality prediction trend output by the water quality prediction model. That is, the water quality prediction model predicts and generates LSTM prediction results according to the current water quality data, and corrects the LSTM prediction results according to the Markov chain to output the water quality prediction trend.

水质预测趋势包括多种监测因子的指标数据,在本实施例中,监测因子包括pH值、TP和NH3-N。显示水质预测趋势供管理人员查看,并以此为依据设定水质防治措施,也可将水质预测趋势输入第三方模型进一步进行分析判断。The water quality prediction trend includes indicator data of various monitoring factors. In this embodiment, the monitoring factors include pH value, TP and NH3-N. The water quality prediction trend is displayed for management personnel to view, and based on this, water quality control measures can be set, and the water quality prediction trend can also be input into a third-party model for further analysis and judgment.

在其他实施例中,S2还包括:根据水质预测趋势和预设的水质等级规则对当前水质进行分析和判定生成水质预测等级。具体的:水质等级规则采用现有的水质级别标准,根据水质等级规则分析判定水质预测趋势所属水质级别,从而生成水质预测等级。例如某断面2019年2月份是2类水,结合历年3月到12月份的监测因子,预测2019年年底的水质等级。In other embodiments, S2 further includes: analyzing and determining the current water quality according to the water quality forecast trend and preset water quality level rules to generate a water quality forecast level. Specifically: the water quality grade rule adopts the existing water quality grade standard, analyzes and determines the water quality grade of the water quality prediction trend according to the water quality grade rule, thereby generating the water quality prediction grade. For example, in February 2019, a certain section had Class 2 water. Combined with the monitoring factors from March to December in previous years, the water quality level at the end of 2019 is predicted.

在其他实施例中,S1还包括:获取水污染防治大数据,根据水污染防治大数据建立基于随机森林算法的水污染防治模型。具体的:采用现有随机森林算法建立水污染防治模型,根据水污染防治大数据对水污染防治模型进行训练,并存储训练后的水污染防治模型。水污染防治模型的输入为水质数据,输出为水质数据对应的水质治理措施。水质治理措施包括措施对应的污染类型、治理措施大类、治理措施小类、技术工艺、建设难易程度、建设成本、运营难易程度、运营成本、预期成效中的一种或多种。In other embodiments, S1 also includes: acquiring big data on water pollution prevention and control, and establishing a water pollution prevention and control model based on a random forest algorithm according to the big data on water pollution prevention and control. Specifically: the existing random forest algorithm is used to establish a water pollution prevention and control model, the water pollution prevention and control model is trained according to the big data of water pollution prevention and control, and the trained water pollution prevention and control model is stored. The input of the water pollution prevention and control model is water quality data, and the output is the water quality control measures corresponding to the water quality data. Water quality control measures include one or more of the pollution type corresponding to the measure, major category of control measures, subcategory of control measures, technical process, construction difficulty, construction cost, operation difficulty, operation cost, and expected results.

S2还包括:水污染防治模型根据水质预测趋势输出的水质治理措施。具体的:水质预测趋势本质为水质数据,将水质预测趋势作为输入,输入水污染防治模型,获取水污染防治模型匹配输出的水质治理措施。通过水污染防治模型,自动为水质数据匹配推荐相应的水质治理措施,包含措施对应的污染类型、治理措施大类、治理措施小类、技术工艺、建设难易程度、建设成本、运营难易程度、运营成本、预期成效等。根据治理措施及特征指标可手工修改和新增,最终确定该流域该时段适合的水环境治理决策措施,形成年度目标任务,并对任务的实施完成情况及效果进行跟踪考核。S2 also includes: water quality control measures output by the water pollution prevention and control model based on the water quality prediction trend. Specifically: the water quality prediction trend is essentially water quality data, and the water quality prediction trend is used as input to the water pollution prevention and control model, and the water quality control measures that are matched and output by the water pollution prevention and control model are obtained. Through the water pollution prevention and control model, the corresponding water quality control measures are automatically recommended for water quality data matching, including the pollution type corresponding to the measures, the major categories of control measures, the subcategories of control measures, technical processes, construction difficulty, construction cost, and operation difficulty , operating costs, expected results, etc. According to the control measures and characteristic indicators, it can be manually modified and added, and finally determine the appropriate water environment control decision-making measures for the basin at this time, form the annual target task, and track and evaluate the implementation and effect of the task.

基于神经网络的水污染决策系统,使用上述基于神经网络的水污染决策方法。其包括数据获取模块、模型生成及训练模块和水质预测模块。The water pollution decision-making system based on the neural network uses the above-mentioned water pollution decision-making method based on the neural network. It includes a data acquisition module, a model generation and training module and a water quality prediction module.

数据获取模块用于获取历史水质数据,历史水质数据包括历史各断面所采集的多种监测因子的指标数据,监测因子包括水质数据包括采样时间、断面(数据采样的地点)、位置(以河流的上下游进行表示)、流量、降雨量、断面汇水区人口、TP(水质总磷含量)、NH4-N(水质氨氮含量)和COD(水质溶解氧)、pH值中的一种或多种。The data acquisition module is used to obtain historical water quality data. Historical water quality data includes index data of various monitoring factors collected by each section in history. Monitoring factors include water quality data including sampling time, section (location of data sampling), location (in the form of river Upstream and downstream), flow, rainfall, population of cross-section catchment area, TP (total phosphorus content of water quality), NH4-N (ammonia nitrogen content of water quality), COD (dissolved oxygen of water quality), and pH value .

模型生成及训练模块用于基于LSTM和马尔可夫链建立水质预测模型,根据历史水质数据训练水质预测模型,并将训练后的水质预测模型存储在水质预测模块中。具体的:The model generation and training module is used to establish a water quality prediction model based on LSTM and Markov chain, train the water quality prediction model according to historical water quality data, and store the trained water quality prediction model in the water quality prediction module. specific:

模型生成及训练模块用于根据公式(1)-(4)构建基于LSTM的数学模型。The model generation and training module is used to construct an LSTM-based mathematical model according to formulas (1)-(4).

计算当前时刻记忆单元状态值Ct的迭代公式如式(6)、(7)所示。The iterative formula for calculating the state value C t of the memory unit at the current moment is shown in formulas (6) and (7).

设有n(n>0)维输入x1,x2,...,xn,m(m>0)维网络的隐层状态序列h1,h2,...,hm,k(k>0)维输出序列y1,y2,...,yk,yk是t时刻LSTM单元的输出,计算公式如式(8)所示。Suppose n(n>0) dimensional input x 1 ,x 2 ,...,x n ,m(m>0) hidden layer state sequence h 1 ,h 2 ,...,h m ,k (k>0)-dimensional output sequence y 1 , y 2 ,...,y k , y k is the output of the LSTM unit at time t, and the calculation formula is shown in formula (8).

虽然LSTM循环神经网络模型在模拟时,为保证准确性,会应用许多样本训练和测试数据,但是这些数据受外在因素影响,有时会存在一定误差,这样会导致预测结果在一定范围内随机波动,降低了预测的准确性。而马尔可夫链(Markov chain)的使用可以更好地消除由外在因素而产生的预测误差,因此,建立神经网络与马尔可夫链的组合预测模型,能够得到更准确的预测结果。Although the LSTM cycle neural network model will use many sample training and test data to ensure accuracy during simulation, but these data are affected by external factors, sometimes there will be certain errors, which will lead to random fluctuations in the prediction results within a certain range , reducing the prediction accuracy. The use of Markov chain can better eliminate the prediction error caused by external factors. Therefore, the establishment of a combined prediction model of neural network and Markov chain can obtain more accurate prediction results.

马尔可夫链是具有马尔可夫性质的随机变量的一个数列,而马尔可夫链预测法是一种适用于随机过程的科学、有效的动态预测方法。该方法主要分两个过程:一是确定马尔可夫链的状态空间,二是要通过计算确定状态转移概率与状态转移矩阵。Markov chain is a sequence of random variables with Markov properties, and Markov chain prediction method is a scientific and effective dynamic prediction method suitable for random processes. This method is mainly divided into two processes: one is to determine the state space of the Markov chain, and the other is to determine the state transition probability and state transition matrix through calculation.

模型生成及训练模块还用于根据以下公式构建基于LSTM和马尔可夫链建立水质预测模型:The model generation and training module is also used to construct a water quality prediction model based on LSTM and Markov chain according to the following formula:

在事件发展变化过程中,在状态i的过程下一步转移到状态j的概率,简称状态转移概率,如式(9)所示。In the process of event development and change, the probability of transitioning to state j in the next step in the process of state i, referred to as the state transition probability, is shown in formula (9).

在本实施例中,采用多因子预测,因此监测因子包括pH值、TP和NH3-N,模型生成及训练模块还用于将历史水质数据中监测因子的指标数据作为样本,根据样本训练基于LSTM和马尔可夫链的水质预测模型,并将训练后的水质预测模型存储在水质预测模块中。In this embodiment, multi-factor prediction is adopted, so the monitoring factors include pH value, TP and NH3-N, and the model generation and training module is also used to use the indicator data of the monitoring factors in the historical water quality data as samples, and according to the sample training based on LSTM and the water quality prediction model of the Markov chain, and store the trained water quality prediction model in the water quality prediction module.

数据获取模块还用于获取当前水质数据,当前水质数据包括多种监测因子的指标数据,在本实施例中,监测因子包括pH值、TP和NH3-N。The data acquisition module is also used to acquire current water quality data, which includes index data of various monitoring factors. In this embodiment, the monitoring factors include pH value, TP and NH3-N.

水质预测模块预设有水质预测模型,水质预测模型用于根据当前水质数据生成LSTM预测结果,并根据马尔可夫链修正LSTM预测结果生成水质预测趋势。具体的:水质预测模块用于获取水质预测模型根据当前水质数据输出的水质预测趋势。水质预测趋势包括多种监测因子的指标数据,在本实施例中,监测因子包括pH值、TP和NH3-N。The water quality prediction module is preset with a water quality prediction model. The water quality prediction model is used to generate LSTM prediction results based on current water quality data, and to generate water quality prediction trends based on Markov chain correction of LSTM prediction results. Specifically: the water quality prediction module is used to obtain the water quality prediction trend output by the water quality prediction model based on the current water quality data. The water quality prediction trend includes indicator data of various monitoring factors. In this embodiment, the monitoring factors include pH value, TP and NH3-N.

在其他实施例中,基于神经网络的水污染决策系统,还包括水污染防治模块。In other embodiments, the neural network-based water pollution decision-making system further includes a water pollution prevention and control module.

数据获取模块还用于获取水污染防治大数据,水污染防治大数据包括水质数据与对应的水质治理措施。水质治理措施包括措施对应的污染类型、治理措施大类、治理措施小类、技术工艺、建设难易程度、建设成本、运营难易程度、运营成本、预期成效中的一种或多种。The data acquisition module is also used to acquire big data on water pollution prevention and control, which includes water quality data and corresponding water quality control measures. Water quality control measures include one or more of the pollution type corresponding to the measure, major category of control measures, subcategory of control measures, technical process, construction difficulty, construction cost, operation difficulty, operation cost, and expected results.

模型生成及训练模块还用于基于随机森林算法建立水污染防治模型,具体采用现有的随机森林算法。模型生成及训练模块还用于将水污染防治大数据作为样本,根据样本训练水污染防治模型,并将训练后的水污染防治模型存储在水污染防治模块中。The model generation and training module is also used to establish a water pollution prevention and control model based on the random forest algorithm, specifically using the existing random forest algorithm. The model generation and training module is also used to use the water pollution prevention and control big data as samples, train the water pollution prevention and control model according to the samples, and store the trained water pollution prevention and control model in the water pollution prevention and control module.

水污染防治模块预设有水污染防治模型,水污染防治模块用于调用水污染防治模型,获取水污染防治模型根据水质预测趋势输出的水质治理措施。The water pollution prevention and control module is preset with a water pollution prevention and control model, and the water pollution prevention and control module is used to call the water pollution prevention and control model to obtain the water quality control measures output by the water pollution prevention and control model according to the water quality prediction trend.

对水质进行预测获得水质预测趋势,并实时采集水质真实数据,经过实验证明,本方案预测的结果和真实值比较吻合,预测结果较为准确,对河流水质预测准确率可达到80%,可以应用到河流水水质因子预测中,为河流可能发生的水体污染做出预测,实验结果如图3、4、5所示。Predict the water quality to obtain the trend of water quality prediction, and collect real water quality data in real time. Experiments have proved that the predicted results of this program are consistent with the real values, and the prediction results are relatively accurate. The accuracy of river water quality prediction can reach 80%, which can be applied to In the prediction of river water quality factors, predictions are made for possible water pollution in rivers. The experimental results are shown in Figures 3, 4, and 5.

实施例二Embodiment two

本实施例与实施例一的不同之处在于:The differences between this embodiment and Embodiment 1 are:

如附图6所示,基于神经网络的水污染决策系统,包括水污染防治大数据智能分析及决策平台,以及智能算法平台。水污染防治大数据智能分析包括配置模块、若干应用模块、可视化组件以及应用接口层。智能算法平台包括算法封装和统一算法接口服务层。As shown in Figure 6, the neural network-based water pollution decision-making system includes a big data intelligent analysis and decision-making platform for water pollution prevention and control, and an intelligent algorithm platform. The intelligent analysis of big data for water pollution prevention and control includes a configuration module, several application modules, visualization components and an application interface layer. The intelligent algorithm platform includes algorithm encapsulation and unified algorithm interface service layer.

在本申请中,所使用的算法包括不同压力源与水质相关关系大数据算法、多源异构数据知识特征提取与融合算法、小流域水污染决策自学习算法,在本实施例中,使用python实现算法构建,具体的算法封装策略是:使用python进程运行深度学习中训练的模型,在Java应用程序中调用python进程提供的服务,python应用和Java应用可以运行在不同的服务器上,通过进程的远程访问调用。该算法封装完成后,系统平台以事先规定好的数据格式,例如Word、PDF等,通过HTTP协议进行传输。In this application, the algorithms used include big data algorithms related to different pressure sources and water quality, multi-source heterogeneous data knowledge feature extraction and fusion algorithms, and small watershed water pollution decision-making self-learning algorithms. In this embodiment, python is used To achieve algorithm construction, the specific algorithm encapsulation strategy is: use the python process to run the model trained in deep learning, and call the service provided by the python process in the Java application. The python application and the Java application can run on different servers. Remote access calls. After the algorithm is encapsulated, the system platform transmits data in a predetermined data format, such as Word, PDF, etc., through the HTTP protocol.

在本申请中,通过应用接口层和统和统一算法接口服务层实现算法与应用的对接。In this application, the interface between the algorithm and the application is realized through the application interface layer and the unified and unified algorithm interface service layer.

统一算法接口服务层包括算法参数配置接口、情况配置接口、算法驱动接口和算法结果消息接口等。其中,算法驱动接口是核心接口,其包括算法封装中各算法的驱动接口。The unified algorithm interface service layer includes algorithm parameter configuration interface, situation configuration interface, algorithm driver interface and algorithm result message interface, etc. Wherein, the algorithm driving interface is a core interface, which includes the driving interfaces of each algorithm in the algorithm package.

算法参数配置接口:1.实现基础算法、三个应用算法的基本技术参数配置功能。2.通过基于http/https协议的web服务发布接口;3.为水污染防治大数据智能分析及决策平台的配置模块所调用。Algorithm parameter configuration interface: 1. Realize the basic technical parameter configuration function of the basic algorithm and three application algorithms. 2. Through the web service publishing interface based on the http/https protocol; 3. It is called by the configuration module of the big data intelligent analysis and decision-making platform for water pollution prevention and control.

情况配置接口:1.实现基于深度神经网络的小流域水污染决策自学习算法、压力源与水质关系模型算法、压力源与水质多源异构数据知识特征提取与融合算法的情况配置参数基本配置功能。2.通过基于http/https协议的web服务发布接口;3.为水污染防治大数据智能分析及决策平台的配置模块所调用。Situation configuration interface: 1. Realize the self-learning algorithm of small watershed water pollution decision-making based on deep neural network, the relationship model algorithm of pressure source and water quality, the knowledge feature extraction and fusion algorithm of multi-source heterogeneous data of pressure source and water quality, and the basic configuration of situation configuration parameters Function. 2. Through the web service publishing interface based on the http/https protocol; 3. It is called by the configuration module of the big data intelligent analysis and decision-making platform for water pollution prevention and control.

算法驱动接口是接口层的核心接口,实现与算法之间的特性数据与参数的对接,包含:基于深度神经网络的小流域水污染自学习算法驱动接口、水质与压力源的关系模型算法驱动接口、水质与压力源的关系模型算法驱动接口,接口功能要求如下:1.实现三个应用算法的任务驱动发起调用,是应用系统调用算法执行的入口。2.通过基于http/https协议的web服务发布接口;3.为水污染防治大数据智能分析及决策平台的算法调用接口所调用。The algorithm-driven interface is the core interface of the interface layer, which realizes the connection of characteristic data and parameters with the algorithm, including: small water pollution self-learning algorithm-driven interface based on deep neural network, and algorithm-driven interface of the relationship model between water quality and pressure source . The relationship model between water quality and pressure source. Algorithm-driven interface. The interface function requirements are as follows: 1. To realize the task-driven invocation of the three application algorithms, which is the entry point for the application system to call the algorithm. 2. Through the web service publishing interface based on the http/https protocol; 3. It is called by the algorithm calling interface of the big data intelligent analysis and decision-making platform for water pollution prevention and control.

算法结果消息接口:1.算法计算完成后,将计算结果消息返回给所调用的应用模块。2.该接口为调用口。3.该接口回调水污染防治大数据智能分析及决策平台的决策分析业务模块通过结果响应接口完成任务消息的传递。Algorithm result message interface: 1. After the algorithm calculation is completed, the calculation result message is returned to the called application module. 2. This interface is the calling port. 3. The interface calls back the decision analysis business module of the big data intelligent analysis and decision-making platform for water pollution prevention and control to complete the transfer of task messages through the result response interface.

应用接口层包括通用web调用接口、算法调用接口和结果响应接口等。The application interface layer includes general web call interface, algorithm call interface and result response interface, etc.

通用web调用接口:1.采用通用的http/https协议实现通过web服务的调用;2.该接口为调用接口。如调用算法参数配置接口和情景配置接口。General web call interface: 1. Use the general http/https protocol to realize the call through the web service; 2. This interface is the call interface. Such as calling the algorithm parameter configuration interface and the scenario configuration interface.

算法调用接口:1.该接口调用算法平台的算法驱动接口,是应用系统调用算法执行的入口;2.该接口为调用接口。Algorithm call interface: 1. This interface calls the algorithm-driven interface of the algorithm platform, which is the entry point for the application system to call algorithm execution; 2. This interface is the call interface.

结果响应接口:1.算法运算任务完成后,接收算法平台返回的消息,并将状态标识写入数据库;2.通过基于http/https协议的web服务发布接口;3.为算法平台的算法结果消息接口所调用。Result response interface: 1. After the algorithm operation task is completed, receive the message returned by the algorithm platform, and write the status identifier into the database; 2. Publish the interface through the web service based on the http/https protocol; 3. It is the algorithm result message of the algorithm platform called by the interface.

应用接口层和统和统一算法接口服务层采用统一的规范进行建设,接口协议、接口数据格式、数据编码、封装方法规范要求如下:接口模式:通过基于http的web服务进行接口发布,调用端通过http/https进行调用与响应。接口数据格式:采用JSON格式进行数据交互响应。接口编码:UTF-8编码。The application interface layer and the unified algorithm interface service layer are constructed using unified specifications. The interface protocol, interface data format, data encoding, and encapsulation method specification requirements are as follows: http/https to call and respond. Interface data format: JSON format is used for data interaction response. Interface encoding: UTF-8 encoding.

算法与平台的对接采用算法与平台分离的方式。在算法服务器上建立监听进程,平台通过进程的远程访问调用算法。平台与算法服务器之间采用http超文本传输协议,利用HTTP中的GET与POST请求方法完成系统平台和算法服务器的信息交流。The connection between the algorithm and the platform adopts the method of separating the algorithm and the platform. A monitoring process is established on the algorithm server, and the platform invokes the algorithm through remote access of the process. The http hypertext transfer protocol is used between the platform and the algorithm server, and the information exchange between the system platform and the algorithm server is completed by using the GET and POST request methods in HTTP.

本申请中,统一数据读写接口,采用统一的非关系性数据、关系性数据的读写接口,作为算法与数据资源之间、应用与数据资源读写调用的统一接口。关系性数据通过关系数据库驱动(JDBC、ODBC等驱动)为应用平台和算法平台读取或存储。非关系性数据(方案、文件等)通过文件接口为应用平台和算法平台读取或存储。In this application, the unified data read-write interface adopts a unified non-relational data and relational data read-write interface as a unified interface between algorithms and data resources, applications and data resource read-write calls. Relational data is read or stored for application platforms and algorithm platforms through relational database drivers (JDBC, ODBC, etc. drivers). Non-relational data (plans, files, etc.) are read or stored for the application platform and algorithm platform through the file interface.

本申请中,以配置定义实现数据驱动,1.参数配置(模型基础数据整合):系统设计时需实现对模型参数进行整体配置,达到应用与算法之间的调度融合,包括模型各种初始化条件(网格等),模型输入数据文件等。参数配置通过接口层实现,应用系统通过“通用web调用接口”与统一算法接口服务层的“算法参数配置接口”进行对接。2.情景配置(应用场景的定制融合):系统设计时需实现对情况参数的配置,实现系统开始进行预测。参数配置通过接口层实现,应用系统通过“通用web调用接口”与统一算法接口服务层的“情况配置接口”进行对接。In this application, the configuration definition is used to realize data-driven, 1. Parameter configuration (integration of model basic data): when designing the system, it is necessary to realize the overall configuration of the model parameters to achieve the scheduling integration between the application and the algorithm, including various initialization conditions of the model (meshes, etc.), model input data files, etc. The parameter configuration is realized through the interface layer, and the application system connects with the "algorithm parameter configuration interface" of the unified algorithm interface service layer through the "universal web call interface". 2. Scenario configuration (customization and integration of application scenarios): When designing the system, it is necessary to realize the configuration of the situation parameters, so that the system can start to predict. The parameter configuration is realized through the interface layer, and the application system is connected with the "situation configuration interface" of the unified algorithm interface service layer through the "general web call interface".

本申请中,以数据模型设计实现数据规范化融合,数据规范化是数据融合的基础,通过有效数据规划(即数据模型设计)是数据与应用/算法的融合的重要方法。目标结果数据库(即决策分析数据)以分析决策为导向,通过目标数据建模实现目标结果数据(即决策分析数据)库规划与设计;源数据建模是算法源数据的基础,实现算法数据接入、清理与整合的融合基础。In this application, data model design is used to realize data normalization and fusion. Data standardization is the basis of data fusion, and effective data planning (that is, data model design) is an important method for the fusion of data and applications/algorithms. The target result database (that is, decision analysis data) is oriented by analysis and decision-making, and realizes the planning and design of the target result data (that is, decision analysis data) database through target data modeling; source data modeling is the basis of algorithm source data, and realizes algorithm data integration. A fusion foundation for entry, cleansing and integration.

应用时,配置模块用于通过通用web调用接口进行参数配置和情景配置,应用模块用于通过算法调用接口调用所需算法进行分析,并通过结果响应接口传输分析结果,通过可视化组件对分析结果进行显示。During application, the configuration module is used to perform parameter configuration and scenario configuration through the general web call interface, the application module is used to call the required algorithm through the algorithm call interface for analysis, and transmit the analysis results through the result response interface, and analyze the analysis results through the visualization component show.

基于神经网络的水污染决策方法,使用上述基于神经网络的水污染决策系统。The neural network-based water pollution decision-making method uses the above-mentioned neural network-based water pollution decision-making system.

采用本方案,通过接口实现算法与应用的集成,基于应用接口层和统一算法接口服务层有效实现算法与应用的对接。通过源数据建模与目标数据建模设计完成算法与应用的数据融合,实现应用调用、算法运算、数据展现的各个环节的整合,并通过参数配置、情景配置等提高集成整合能力。With this solution, the integration of algorithms and applications is realized through interfaces, and the connection between algorithms and applications is effectively realized based on the application interface layer and the unified algorithm interface service layer. Through source data modeling and target data modeling design to complete the data fusion of algorithms and applications, realize the integration of application calls, algorithm operations, and data presentation, and improve integration capabilities through parameter configuration and scenario configuration.

以上所述的仅是本发明的实施例,方案中公知的具体结构及特性等常识在此未作过多描述,所属领域普通技术人员知晓申请日或者优先权日之前发明所属技术领域所有的普通技术知识,能够获知该领域中所有的现有技术,并且具有应用该日期之前常规实验手段的能力,所属领域普通技术人员可以在本申请给出的启示下,结合自身能力完善并实施本方案,一些典型的公知结构或者公知方法不应当成为所属领域普通技术人员实施本申请的障碍。应当指出,对于本领域的技术人员来说,在不脱离本发明结构的前提下,还可以作出若干变形和改进,这些也应该视为本发明的保护范围,这些都不会影响本发明实施的效果和专利的实用性。本申请要求的保护范围应当以其权利要求的内容为准,说明书中的具体实施方式等记载可以用于解释权利要求的内容。What is described above is only an embodiment of the present invention, and the common knowledge such as the specific structure and characteristics known in the scheme is not described too much here, and those of ordinary skill in the art know all the common knowledge in the technical field to which the invention belongs before the filing date or the priority date Technical knowledge, being able to know all the existing technologies in this field, and having the ability to apply conventional experimental methods before this date, those of ordinary skill in the art can improve and implement this plan based on their own abilities under the inspiration given by this application, Some typical known structures or known methods should not be obstacles for those of ordinary skill in the art to implement the present application. It should be pointed out that for those skilled in the art, under the premise of not departing from the structure of the present invention, some modifications and improvements can also be made, which should also be regarded as the protection scope of the present invention, and these will not affect the implementation of the present invention. Effects and utility of patents. The scope of protection required by this application shall be based on the content of the claims, and the specific implementation methods and other records in the specification may be used to interpret the content of the claims.

Claims (10)

1.基于神经网络的水污染决策方法,其特征在于,包括以下内容:1. The water pollution decision-making method based on neural network, is characterized in that, comprises the following content: 获取当前水质数据;Obtain current water quality data; 调用预设的水质预测模型,水质预测模型基于LSTM和马尔可夫链构建;Call the preset water quality prediction model, which is constructed based on LSTM and Markov chain; 水质预测模型根据当前水质数据进行预测生成LSTM预测结果,并根据马尔可夫链对LSTM预测结果进行修正输出水质预测趋势。The water quality prediction model predicts and generates LSTM prediction results based on the current water quality data, and corrects the LSTM prediction results according to the Markov chain to output the water quality prediction trend. 2.根据权利要求1所述的基于神经网络的水污染决策方法,其特征在于,还包括以下内容:2. the water pollution decision-making method based on neural network according to claim 1, is characterized in that, also comprises the following content: 获取历史水质数据,根据历史水质数据对水质预测模型进行训练,对训练后的水质预测模型进行存储。Obtain historical water quality data, train the water quality prediction model according to the historical water quality data, and store the trained water quality prediction model. 3.根据权利要求1或2所述的基于神经网络的水污染决策方法,其特征在于,还包括以下内容:3. the water pollution decision-making method based on neural network according to claim 1 and 2, is characterized in that, also comprises the following content: 根据水质预测趋势和预设的水质等级规则对当前水质进行分析和判定生成水质预测等级。According to the water quality prediction trend and the preset water quality grade rules, the current water quality is analyzed and judged to generate the water quality prediction grade. 4.根据权利要求1所述的基于神经网络的水污染决策方法,其特征在于:当前水质数据和水质预测趋势均包括多种监测因子的指标数据。4. The neural network-based water pollution decision-making method according to claim 1, characterized in that: the current water quality data and the water quality prediction trend both include index data of multiple monitoring factors. 5.根据权利要求1所述的基于神经网络的水污染决策方法,其特征在于,还包括以下内容:5. the water pollution decision-making method based on neural network according to claim 1, is characterized in that, also comprises the following content: 获取水污染防治大数据,根据水污染防治大数据建立基于随机森林算法的水污染防治模型;Obtain big data on water pollution prevention and control, and establish a water pollution prevention and control model based on the random forest algorithm based on the big data on water pollution prevention and control; 水污染防治模型根据水质预测趋势输出的水质治理措施。The water quality control measures output by the water pollution prevention and control model according to the water quality prediction trend. 6.根据权利要求5所述的基于神经网络的水污染决策方法,其特征在于:水质治理措施包括措施对应的污染类型、治理措施大类、治理措施小类、技术工艺、建设难易程度、建设成本、运营难易程度、运营成本、预期成效中的一种或多种。6. The neural network-based water pollution decision-making method according to claim 5, characterized in that: water quality control measures include pollution types corresponding to measures, major categories of control measures, small categories of control measures, technical processes, construction difficulty, One or more of construction cost, operational difficulty, operating cost, and expected results. 7.基于神经网络的水污染决策系统,其特征在于:使用权利要求1-6任一项所述的基于神经网络的水污染决策方法。7. A water pollution decision-making system based on a neural network, characterized in that: the water pollution decision-making method based on a neural network according to any one of claims 1-6 is used. 8.根据权利要求7所述的基于神经网络的水污染决策系统,其特征在于,包括:8. the neural network-based water pollution decision-making system according to claim 7, is characterized in that, comprising: 数据获取模块,用于获取当前水质数据;Data acquisition module, used to acquire current water quality data; 水质预测模块预设有水质预测模型;水质预测模型用于根据当前水质数据生成LSTM预测结果,并根据马尔可夫链修正LSTM预测结果生成水质预测趋势;The water quality prediction module is preset with a water quality prediction model; the water quality prediction model is used to generate LSTM prediction results based on current water quality data, and to generate water quality prediction trends based on Markov chain correction of LSTM prediction results; 水质预测模块用于获取水质预测模型根据当前水质数据输出的水质预测趋势。The water quality prediction module is used to obtain the water quality prediction trend output by the water quality prediction model based on the current water quality data. 9.根据权利要求8所述的基于神经网络的水污染决策系统,其特征在于:数据获取模块还用于获取历史水质数据,还包括:9. The neural network-based water pollution decision-making system according to claim 8, wherein: the data acquisition module is also used to obtain historical water quality data, and also includes: 模型生成及训练模块,用于基于LSTM和马尔可夫链建立水质预测模型,根据历史水质数据训练水质预测模型,并将训练后的水质预测模型存储在水质预测模块中。The model generation and training module is used to establish a water quality prediction model based on LSTM and Markov chain, train the water quality prediction model according to historical water quality data, and store the trained water quality prediction model in the water quality prediction module. 10.根据权利要求8所述的基于神经网络的水污染决策系统,其特征在于,还包括:10. the neural network-based water pollution decision-making system according to claim 8, is characterized in that, also comprises: 水污染防治模块预设有水污染防治模型;The water pollution prevention and control module is preset with a water pollution prevention and control model; 水污染防治模块用于获取水污染防治模型根据水质预测趋势输出的水质治理措施。The water pollution prevention and control module is used to obtain the water quality control measures output by the water pollution prevention and control model according to the water quality prediction trend.
CN202310337122.9A 2023-03-30 2023-03-30 Water pollution decision-making method and system based on neural network Active CN116343946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310337122.9A CN116343946B (en) 2023-03-30 2023-03-30 Water pollution decision-making method and system based on neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310337122.9A CN116343946B (en) 2023-03-30 2023-03-30 Water pollution decision-making method and system based on neural network

Publications (2)

Publication Number Publication Date
CN116343946A true CN116343946A (en) 2023-06-27
CN116343946B CN116343946B (en) 2024-09-24

Family

ID=86880396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310337122.9A Active CN116343946B (en) 2023-03-30 2023-03-30 Water pollution decision-making method and system based on neural network

Country Status (1)

Country Link
CN (1) CN116343946B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991437A (en) * 2017-03-20 2017-07-28 浙江工商大学 The method and system of sewage quality data are predicted based on random forest
CN106991493A (en) * 2017-03-17 2017-07-28 浙江工商大学 Sewage disposal water outlet parameter prediction method based on Grey production fuction
CN109159785A (en) * 2018-07-19 2019-01-08 重庆科技学院 A kind of automobile running working condition prediction technique based on Markov chain and neural network
CN109242203A (en) * 2018-09-30 2019-01-18 中冶华天南京工程技术有限公司 A kind of water quality prediction of river and water quality impact factors assessment method
CN110874616A (en) * 2019-11-18 2020-03-10 苏文电能科技股份有限公司 Transformer operation prediction method based on LSTM network and Markov chain correction error
US20200231466A1 (en) * 2017-10-09 2020-07-23 Zijun Xia Intelligent systems and methods for process and asset health diagnosis, anomoly detection and control in wastewater treatment plants or drinking water plants
CN115456243A (en) * 2022-08-10 2022-12-09 深圳大学 Water quality prediction method, device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991493A (en) * 2017-03-17 2017-07-28 浙江工商大学 Sewage disposal water outlet parameter prediction method based on Grey production fuction
CN106991437A (en) * 2017-03-20 2017-07-28 浙江工商大学 The method and system of sewage quality data are predicted based on random forest
US20200231466A1 (en) * 2017-10-09 2020-07-23 Zijun Xia Intelligent systems and methods for process and asset health diagnosis, anomoly detection and control in wastewater treatment plants or drinking water plants
CN109159785A (en) * 2018-07-19 2019-01-08 重庆科技学院 A kind of automobile running working condition prediction technique based on Markov chain and neural network
CN109242203A (en) * 2018-09-30 2019-01-18 中冶华天南京工程技术有限公司 A kind of water quality prediction of river and water quality impact factors assessment method
CN110874616A (en) * 2019-11-18 2020-03-10 苏文电能科技股份有限公司 Transformer operation prediction method based on LSTM network and Markov chain correction error
CN115456243A (en) * 2022-08-10 2022-12-09 深圳大学 Water quality prediction method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘晶晶等: ""K-Similarity 降噪的LSTM 神经网络水质多因子预测模型"", 《计算机系统应用》, vol. 28, no. 2, 15 February 2019 (2019-02-15), pages 227 - 230 *
李金泽等: ""基于神经网络与马尔可夫链预测地表水净化装置总氮降解的效果"", 《净水技术》, vol. 37, no. 12, 14 December 2018 (2018-12-14), pages 108 *

Also Published As

Publication number Publication date
CN116343946B (en) 2024-09-24

Similar Documents

Publication Publication Date Title
CN112838946B (en) Method for constructing intelligent sensing and early warning model based on communication network faults
Bai et al. Compound autoregressive network for prediction of multivariate time series
CN118643997B (en) Efficient flood resilience assessment method and system based on natural language processing and data-driven model
CN111079860B (en) Method for constructing multi-granularity response model of emergency based on scene similarity
Guo et al. Towards explainable traffic flow prediction with large language models
CN117993624B (en) A system and method for evaluating the carrying capacity of water ecological environment in a river basin
Huang et al. Origin-destination flow prediction with vehicle trajectory data and semi-supervised recurrent neural network
Kang et al. A method of online anomaly perception and failure prediction for high-speed automatic train protection system
Liao et al. MFGCN: a multimodal fusion graph convolutional network for online car-hailing demand prediction
CN119831575A (en) Pipeline weld joint management system and management method thereof
CN118013825A (en) Multi-level and multi-type urban space-time collaborative design methods, systems, terminals and media
Hu et al. A multi-layer model based on transformer and deep learning for traffic flow prediction
Ren et al. Fault detection and classification with feature representation based on deep residual convolutional neural network
CN117975178B (en) Taxi track data analysis method based on big data analysis
CN116343946A (en) Water Pollution Decision-Making Method and System Based on Neural Network
CN116451034A (en) Analysis method and system for pressure source and water quality relation based on xgboost algorithm
Xu et al. Early warning of chinese yuan’s exchange rate fluctuation and value at risk measure using neural network joint optimization algorithm
Rotondi et al. Semantics for wastewater reuse in agriculture
CN117275238A (en) Short-time traffic flow prediction method for dynamic graph structure attention mechanism
CN112784480B (en) Self-learning quantitative representation method, storage medium and equipment of oil state
Li et al. Optimal Maintenance Decision Method for a Sensor Network Based on Belief Rule Base considering Attribute Correlation
Shen et al. Research on the Difficulty Mining Algorithm for the Integration of Multiple Sets of Data Platforms Based on Big Data Analysis in Smart Factories
Dkhar et al. NeuroSync: A Novel Neural Network Architecture for Time Series Forecasting of Vehicle Traffic Data Over 5G and Beyond
Wen et al. A Study on Highway Traffic Volume Forecasting Based on the SARIMA-GCN-LSTM Model
Soundarraj et al. Deep Learning Approaches for Environmental Monitoring in Smart Cities

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant