[go: up one dir, main page]

CN113155767A - Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method - Google Patents

Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method Download PDF

Info

Publication number
CN113155767A
CN113155767A CN202011636239.XA CN202011636239A CN113155767A CN 113155767 A CN113155767 A CN 113155767A CN 202011636239 A CN202011636239 A CN 202011636239A CN 113155767 A CN113155767 A CN 113155767A
Authority
CN
China
Prior art keywords
water quality
ultraviolet
neural network
quality evaluation
detection system
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.)
Pending
Application number
CN202011636239.XA
Other languages
Chinese (zh)
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.)
Changchun University of Science and Technology
Original Assignee
Changchun University of Science and Technology
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 Changchun University of Science and Technology filed Critical Changchun University of Science and Technology
Priority to CN202011636239.XA priority Critical patent/CN113155767A/en
Publication of CN113155767A publication Critical patent/CN113155767A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/33Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using ultraviolet light
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2431Multiple classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Medical Informatics (AREA)
  • Geometry (AREA)
  • Computer Hardware Design (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

本发明公开了一种基于紫外光谱法的分布式水质检测系统及水质评价方法,该系统包括:基于紫外光谱的水质传感器、光谱采集模块、无线传感网络、以及检测终端水质评价模型,水质传感器通过紫外光谱照射待测水样对不同光谱进行分光,光谱采集模块对CCD探测器的光谱数据进行采集,光谱数据通过无线传感网络到终端;再分别使用粒子群算法(PSO)和AdaBoost算法对BP神经网络进行优化,建立了水质评价模型。粒子群算法和AdaBoost算法都能有效地解决因BP神经网络随机初始化参数导致的评价结果不稳定的问题。但在相同条件下,AdaBoost算法比PSO算法具有更高的预测精度和更短的训练时间,在水质评价中具有更好的应用价值。

Figure 202011636239

The invention discloses a distributed water quality detection system and a water quality evaluation method based on ultraviolet spectroscopy. The system includes: a water quality sensor based on ultraviolet spectroscopy, a spectrum acquisition module, a wireless sensor network, a detection terminal water quality evaluation model, and a water quality sensor. The water samples to be tested are irradiated with ultraviolet spectrum to separate different spectra. The spectrum acquisition module collects the spectral data of the CCD detector, and the spectral data is sent to the terminal through the wireless sensor network. BP neural network was used for optimization, and a water quality evaluation model was established. Both particle swarm optimization and AdaBoost algorithm can effectively solve the problem of unstable evaluation results caused by random initialization parameters of BP neural network. But under the same conditions, AdaBoost algorithm has higher prediction accuracy and shorter training time than PSO algorithm, and has better application value in water quality evaluation.

Figure 202011636239

Description

基于紫外光谱法的分布式水质检测系统及水质评价方法Distributed water quality detection system and water quality evaluation method based on ultraviolet spectroscopy

技术领域technical field

本发明涉及水质检测技术领域,特别是一种基于紫外光谱法的分布式水质检测系统及水质评价方法。The invention relates to the technical field of water quality detection, in particular to a distributed water quality detection system and a water quality evaluation method based on ultraviolet spectroscopy.

背景技术Background technique

随着社会经济的快速发展,环境污染日益威胁着人们的生命和健康,水污染已成为当今世界各国面临的一些非常严重的问题之一。针对严重的水污染问题建立一个实时在线的水质监测系统具有重要的意义。基于紫外可见光谱水质监测技术,可以快速实现水质的多参数测量。它具有操作简单、成本低、二次污染、在线和现场测量等优点,已成为水质监测仪器的一个重要发展方向。特别是当现代水质监测技术对仪器设备提出了微便携、低成本、实时在线、现场多参数测量的要求时,此类检测系统的设计与制造已成为光谱法水质测量的关键技术。With the rapid development of social economy, environmental pollution is increasingly threatening people's life and health. Water pollution has become one of the very serious problems faced by all countries in the world today. It is of great significance to establish a real-time online water quality monitoring system for serious water pollution problems. Based on the UV-Vis spectrum water quality monitoring technology, multi-parameter measurement of water quality can be quickly realized. It has the advantages of simple operation, low cost, secondary pollution, online and on-site measurement, etc., and has become an important development direction of water quality monitoring instruments. Especially when modern water quality monitoring technology puts forward the requirements of micro-portable, low-cost, real-time online, on-site multi-parameter measurement for instruments and equipment, the design and manufacture of such detection systems have become the key technology for spectroscopic water quality measurement.

发明内容SUMMARY OF THE INVENTION

本发明的目的是要提供一种基于紫外光谱法的分布式水质检测系统及水质评价方法。The purpose of the present invention is to provide a distributed water quality detection system and water quality evaluation method based on ultraviolet spectroscopy.

为达到上述目的,本发明是按照以下技术方案实施的:To achieve the above object, the present invention is implemented according to the following technical solutions:

一种基于紫外光谱法的分布式水质检测系统,紫外光源发出紫外光谱通过待测水源透射,成为信号光,然后进入光谱分析仪,得到按不同波长顺序排列的光谱,阵列CCD探测器将光谱数据的光信号转换为电信号,信号采集处理模块对阵列CCD探测器的输出光谱数据进行采集,光谱数据通过无线传感网络上传水质监测终端进行水质评价,得到被测水质的成分和含量信息。A distributed water quality detection system based on ultraviolet spectroscopy. The ultraviolet light source emits an ultraviolet spectrum that is transmitted through the water source to be tested to become signal light, and then enters the spectrum analyzer to obtain the spectrum arranged in different wavelengths. The array CCD detector converts the spectrum data. The optical signal is converted into an electrical signal, and the signal acquisition and processing module collects the output spectral data of the array CCD detector. The spectral data is uploaded to the water quality monitoring terminal through the wireless sensor network for water quality evaluation, and the composition and content information of the measured water quality are obtained.

进一步地,所述水质监测终端为手机或平板电脑或PC终端。Further, the water quality monitoring terminal is a mobile phone or a tablet computer or a PC terminal.

进一步地,所述电源为12V的蓄电池,所述蓄电池连接有光伏充电装置,所述光伏充电装置包括太阳能电池板,太阳能电池板和蓄电池的DC-DC之间有第一个ADC转换电路,在DC-DC和蓄电池之间也有第二个ADC转换电路,当第一个ADC转换电路测量的电压太低的时候,则断开太阳能电池板与DC-DC 之间的电源连线;当第二个ADC转换电路测量的电压值与预定的24V之间有差距的时候,就要控制MOSFET的开关PWM占空比。Further, the power supply is a 12V battery, the battery is connected with a photovoltaic charging device, the photovoltaic charging device includes a solar panel, and there is a first ADC conversion circuit between the solar panel and the DC-DC of the battery, which is There is also a second ADC conversion circuit between the DC-DC and the battery. When the voltage measured by the first ADC conversion circuit is too low, disconnect the power connection between the solar panel and the DC-DC; When there is a gap between the voltage value measured by the ADC conversion circuit and the predetermined 24V, the switching PWM duty cycle of the MOSFET should be controlled.

另外,本发明还提供了一种水质评价方法,具体步骤如下:In addition, the present invention also provides a water quality evaluation method, the specific steps are as follows:

S1、在水质监测终端内建立AdaBoost-BP水质评价模型,S1. Establish the AdaBoost-BP water quality evaluation model in the water quality monitoring terminal,

S2、导入数据样本,确定训练样本和测试样本,初始化训练样本数据的权重,其计算公式为:S2. Import data samples, determine training samples and test samples, and initialize the weights of training sample data. The calculation formula is:

Figure BDA0002878519680000021
Figure BDA0002878519680000021

其中:Di是初始化权重,i=1,2,…,m;m是训练样本数;Among them: D i is the initialization weight, i=1,2,...,m; m is the number of training samples;

S3、设定BP弱分类的个数和网络结构,并用BP弱预测器对训练样本进行训练和预测,然后得到弱分类器Ct(x);S3. Set the number and network structure of the BP weak classification, and use the BP weak predictor to train and predict the training samples, and then obtain the weak classifier C t (x);

S4、计算Ct(x)的分类误差:S4. Calculate the classification error of C t (x):

Figure BDA0002878519680000022
Figure BDA0002878519680000022

S5、计算Ct(x)分类器的权值:S5. Calculate the weight of the C t (x) classifier:

Figure BDA0002878519680000023
Figure BDA0002878519680000023

S6、更新训练数据的权重:S6. Update the weights of the training data:

Figure BDA0002878519680000024
Figure BDA0002878519680000024

其中:gt是归一化因子,并且yi是数据标签;where: g t is the normalization factor, and yi is the data label;

S7、最终的强分类器:S7, the final strong classifier:

Figure BDA0002878519680000025
Figure BDA0002878519680000025

水质评价等级涉及5个标准,利用5个BP神经网络组成一个弱分类器群,在BP神经网络的基础上,AdaBoost设计的强分类器能有效地改善单个BP神经网络的不稳定性,提高评价模型的准确性和泛化能力;The water quality evaluation level involves 5 standards, and 5 BP neural networks are used to form a weak classifier group. On the basis of the BP neural network, the strong classifier designed by AdaBoost can effectively improve the instability of a single BP neural network and improve the evaluation. The accuracy and generalization ability of the model;

S8、将信号采集处理模块的光谱数据作为AdaBoost-BP水质评价模型的输入,获取水质评价结果。S8. Use the spectral data of the signal acquisition and processing module as the input of the AdaBoost-BP water quality evaluation model to obtain the water quality evaluation results.

与现有技术相比,本发明主要通过紫外光谱法将水中COD(化学需氧量)、 ZD(浊度)、TOC(总有机碳)、硝酸盐氮(NO3-N)等水质指标检测出来,通过水质传感器对紫外光谱照射待测水样对不同光谱进行分光,光谱采集模块对CCD 探测器的光谱数据进行采集,光谱数据通过无线传感网络到终端;再利用粒子群算法(PSO)和AdaBoost算法对BP神经网络进行优化,建立水质评价模型。粒子群算法和AdaBoost算法均能有效解决BP神经网络随机初始化参数导致评价结果不稳定的问题。在相同条件下,AdaBoost算法比PSO算法具有更高的预测精度和更短的训练时间,在水质评价中具有良好的应用价值。Compared with the prior art, the present invention mainly detects water quality indicators such as COD (chemical oxygen demand), ZD (turbidity), TOC (total organic carbon), nitrate nitrogen (NO3-N) in water by ultraviolet spectroscopy. , the water samples to be tested are irradiated with the ultraviolet spectrum by the water quality sensor to split different spectra, the spectrum acquisition module collects the spectral data of the CCD detector, and the spectral data is sent to the terminal through the wireless sensor network; and then uses the particle swarm algorithm (PSO) and The AdaBoost algorithm optimizes the BP neural network and establishes a water quality evaluation model. Both particle swarm optimization and AdaBoost algorithm can effectively solve the problem of unstable evaluation results caused by random initialization parameters of BP neural network. Under the same conditions, the AdaBoost algorithm has higher prediction accuracy and shorter training time than the PSO algorithm, and has good application value in water quality evaluation.

附图说明Description of drawings

图1是基于紫外光谱的水质检测系统整体图;Fig. 1 is the overall picture of the water quality detection system based on ultraviolet spectrum;

图2基于紫外光谱的水质传感器结构图;Figure 2 is a structural diagram of a water quality sensor based on ultraviolet spectrum;

图3是信号采集系统结构;Fig. 3 is the structure of the signal acquisition system;

图4为基于紫外光谱的水质监测系统的实施结构;Fig. 4 is the implementation structure of the water quality monitoring system based on ultraviolet spectrum;

图5基于AdaBoost-BP神经网络的水质评价模型;Fig. 5 Water quality evaluation model based on AdaBoost-BP neural network;

图6为AdaBoost-BP水质评价模型结果图;Figure 6 shows the results of the AdaBoost-BP water quality evaluation model;

图7为BP、PSO-BP和AdaBoost-BP评价模型的结果对比图;Figure 7 is a comparison chart of the results of the BP, PSO-BP and AdaBoost-BP evaluation models;

图8为BP、PSO-BP和AdaBoost-BP评价模型的误差率对比图;Figure 8 is a comparison chart of the error rate of the BP, PSO-BP and AdaBoost-BP evaluation models;

图9水质传感器的尺寸图;Figure 9 Dimensional drawing of the water quality sensor;

图10为太阳能供电系统的结构图。FIG. 10 is a structural diagram of a solar power supply system.

具体实施方式Detailed ways

为使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步的详细说明。此处所描述的具体实施例仅用于解释本发明,并不用于限定发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments. The specific embodiments described herein are only used to explain the present invention, but not to limit the invention.

如图1所示,水质传感器通过紫外光谱照射待测水样对不同光谱进行分光,光谱采集模块对CCD探测器的光谱数据进行采集,光谱数据通过无线传感网络到终端;再分别使用粒子群算法(PSO)和AdaBoost算法对BP神经网络进行优化,建立了水质评价模型。As shown in Figure 1, the water quality sensor irradiates the water sample to be tested by ultraviolet spectrum to split different spectra, the spectrum acquisition module collects the spectral data of the CCD detector, and the spectral data is sent to the terminal through the wireless sensor network; Algorithm (PSO) and AdaBoost algorithm are used to optimize the BP neural network and establish a water quality evaluation model.

如图2所示,为基于紫外光谱的水质传感器结构图,分辨率在0.5nm内且稳定工作,光线从狭缝入射向球面准直镜M1,经过球面镜准直后的平行光入射到光栅G上,不同波长的光经由光栅衍射后按角度入射到球面聚焦镜M2,经过聚焦后的光线最终成像在CCD表面。As shown in Figure 2, it is the structure diagram of the water quality sensor based on ultraviolet spectrum, the resolution is within 0.5nm and it works stably. The light is incident from the slit to the spherical collimating mirror M 1 , and the parallel light collimated by the spherical mirror is incident on the grating. On G, light with different wavelengths is diffracted by the grating and then incident on the spherical focusing mirror M 2 according to an angle, and the focused light is finally imaged on the surface of the CCD.

在光谱分析仪系统中,各光学元件的参数由元件空间位置和像差相互制约,所以需要依据各元件的空间关系来确定各参数。衍射光栅是光谱分析仪中的核心器件,光栅的参量直接影响了光学系统光谱分析仪的响应波长和分辨率,本专利设计的紫外光谱分析仪的测量范围为200-500nm,已知:In the spectrum analyzer system, the parameters of each optical element are mutually restricted by the spatial position of the element and the aberration, so each parameter needs to be determined according to the spatial relationship of each element. Diffraction grating is the core device in the spectrum analyzer. The parameters of the grating directly affect the response wavelength and resolution of the optical system spectrum analyzer. The measuring range of the ultraviolet spectrum analyzer designed in this patent is 200-500nm. It is known that:

i+θ=Φ (1)i+θ=Φ(1)

系统中入射光线与衍射光线位于法线两侧,光栅方程为:In the system, the incident ray and the diffracted ray are located on both sides of the normal, and the grating equation is:

d(sini-sinθ)=mλ (2)d(sini-sinθ)=mλ (2)

式中d=1/n为光栅常量,n为光栅刻线密度,m为衍射级次,取光栅衍射一级光谱,即m=1,λ为波长,联立上述式子可得:In the formula, d=1/n is the grating constant, n is the grating line density, m is the diffraction order, and the first-order diffraction spectrum of the grating is taken, that is, m=1, λ is the wavelength, and the above formulas are combined to obtain:

Figure BDA0002878519680000051
Figure BDA0002878519680000051

光栅的线色散表征了不同波长的光线成像后在像平面上分开的距离,在光谱分析仪系统中是判断系统分辨力的重要指标,其中线色散率公式为:The linear dispersion of the grating characterizes the distances separated by different wavelengths of light on the image plane after imaging, and is an important indicator for judging the resolution of the system in a spectrum analyzer system. The linear dispersion rate formula is:

Figure BDA0002878519680000052
Figure BDA0002878519680000052

式中f2为聚焦镜M1的焦距,

Figure BDA0002878519680000053
为像面倾角。对上式在波长范围λ12积分,得到:where f 2 is the focal length of the focusing mirror M 1 ,
Figure BDA0002878519680000053
is the inclination angle of the image plane. Integrating the above formula over the wavelength range λ 12 , we get:

Figure BDA0002878519680000054
Figure BDA0002878519680000054

式l中为像面CCD的有效长度,该系统选用的CCD有效长度为28.6mm。In the formula l, it is the effective length of the image plane CCD, and the effective length of the CCD selected by this system is 28.6mm.

分辨率亦为判断系统分辨力的重要指标,若使分辨率

Figure BDA0002878519680000055
Resolution is also an important indicator for judging system resolution.
Figure BDA0002878519680000055

由于准直镜和聚焦镜均离轴使用因此会产生一定的彗差,降低系统的分辨率,影响成像质量,所以必须尽量消差,系统应满足:Since both the collimating mirror and the focusing mirror are used off-axis, a certain coma aberration will be generated, which will reduce the resolution of the system and affect the imaging quality. Therefore, the aberration must be eliminated as much as possible. The system should meet the following requirements:

Figure BDA0002878519680000056
Figure BDA0002878519680000056

在整个系统的设计中,除了要考虑慧差的影响,球差也会降低系统分辨率,系统使用凹球面反射镜作为准直镜,为了使球差控制在像差容许的范围之内,准直镜的焦距应满足:In the design of the whole system, in addition to the influence of coma aberration, spherical aberration will also reduce the resolution of the system. The system uses a concave spherical mirror as the collimating mirror. The focal length of the straight mirror should satisfy:

f1≤256λ(F#)4 (7)f 1 ≤256λ(F#) 4 (7)

式中F#=f1/D1为光谱分析仪的物方空间F数,D1为准直镜的口径,聚焦镜的口径应满足:In the formula, F#=f 1 /D 1 is the object space F number of the spectrum analyzer, D 1 is the aperture of the collimating mirror, and the aperture of the focusing mirror should satisfy:

Figure BDA0002878519680000057
Figure BDA0002878519680000057

上式中θ2为终止波长的衍射角,由光栅方程(2)可得求θ2In the above formula, θ 2 is the diffraction angle of the stop wavelength, and θ 2 can be obtained from the grating equation (2).

该系统光栅的长度、入射角和准直镜口径需要满足:The length, incident angle and collimator aperture of the system grating need to meet:

Figure BDA0002878519680000061
Figure BDA0002878519680000061

为了使成像质量良好,将狭缝放置于准直镜的子午焦点上,由几何位置可得:In order to make the image quality good, the slit is placed at the meridional focus of the collimating mirror, which can be obtained from the geometric position:

Figure BDA0002878519680000062
Figure BDA0002878519680000062

如图3所示,信号采集部分设计了基于STM32的光谱数据采集系统,由 STM32F103产生CCD时序,驱动CCD工作,CCD输出经信号调理电路反向、放大后,将CCD输出的电压信号变换到0~VREF间的电压信号,通过A/D对每一个像素进行AD转换后存储到内存中。当一帧3648个数据全部采集完毕后,通过串口传给上位机进行数据处理,绘制出相对光谱强度分布曲线。As shown in Figure 3, a spectral data acquisition system based on STM32 is designed in the signal acquisition part. STM32F103 generates the CCD timing sequence to drive the CCD to work. After the CCD output is reversed and amplified by the signal conditioning circuit, the voltage signal output by the CCD is converted to 0 The voltage signal between ~ V REF is stored in the memory after AD conversion of each pixel through A/D. When all the 3648 data in one frame are collected, it is transmitted to the host computer through the serial port for data processing, and the relative spectral intensity distribution curve is drawn.

为了实现对水质参数的长时间在线监测,本发明提出基于LEACH改进的路由协议算法。主要针簇头选择阶段提出了改进:考虑簇头(CH)到所有相邻节点的平均距离、基站和CH之间的距离以及延长传输周期参数,通过选择剩余能量较大、距离相对较短的传感器节点作为CH节点。In order to realize long-term online monitoring of water quality parameters, the present invention proposes an improved routing protocol algorithm based on LEACH. Improvements are proposed mainly in the cluster head selection stage: considering the average distance of the cluster head (CH) to all adjacent nodes, the distance between the base station and the CH, and the parameters of prolonging the transmission period, by selecting the one with larger residual energy and relatively shorter distance. The sensor nodes act as CH nodes.

针对传统LEACH协议的不足,把各传感器节点的能量、节点与所有相邻节点的平均距离以及节点与基站的相对距离因素考虑进来,并减少广播和调度阶段的控制消息消耗。对公式Topt(n)进行改进,在此阶段,对于每个传感器点,使其产生一个0-1之间的随机数,对于这个随机数值小于阈值Topt(n),此节点就成为候选簇头。In view of the shortcomings of the traditional LEACH protocol, the energy of each sensor node, the average distance between the node and all adjacent nodes, and the relative distance between the node and the base station are taken into account, and the consumption of control messages in the broadcast and scheduling stages is reduced. The formula Topt (n) is improved. At this stage, for each sensor point, it generates a random number between 0 and 1. For this random number is less than the threshold Topt (n), this node becomes a candidate cluster head.

Figure BDA0002878519680000063
Figure BDA0002878519680000063

其中,

Figure BDA0002878519680000064
r是已完成轮数;α是轮数延长参数,通过延长传输轮,我们通过减少广播和TDMA调度的消息次数来节省大量能量; G是最近1/p轮没有被选为簇头的集合;Ecur是当前传感器节点功率;Eavg是当前一轮网络的平均能量;dtoCH是簇头与簇内所有节点的平均距离;davg是特定节点与所有相邻节点的平均距离;dtoBS是传感器节点到BS的平均距离;d(n,BS)是给定节点n到BS之间的距离;dmax是最大距离。in,
Figure BDA0002878519680000064
r is the number of completed rounds; α is the round number extension parameter, by extending the transmission round, we save a lot of energy by reducing the number of messages for broadcast and TDMA scheduling; G is the set of recent 1/p rounds that have not been selected as cluster heads; E cur is the current sensor node power; E avg is the average energy of the current round of the network; d toCH is the average distance between the cluster head and all nodes in the cluster; d avg is the average distance between a specific node and all adjacent nodes; d toBS is Average distance from sensor node to BS; d(n, BS) is the distance from a given node n to BS; dmax is the maximum distance.

p表示簇头所占比例,由以下公式给出:p represents the proportion of cluster heads, which is given by the following formula:

Figure BDA0002878519680000071
Figure BDA0002878519680000071

其中,kopt是集群的最佳数量,N是网络中传感器节点数量;其中kopt由以下公式给出:where k opt is the optimal number of clusters and N is the number of sensor nodes in the network; where k opt is given by:

Figure BDA0002878519680000072
Figure BDA0002878519680000072

其中改进后的算法对dtoCH,dtoBS和dmax重新定义如下[7]:The improved algorithm redefines d toCH , d toBS and d max as follows [7]:

Figure BDA0002878519680000073
Figure BDA0002878519680000073

Figure BDA0002878519680000074
Figure BDA0002878519680000074

Figure BDA0002878519680000075
Figure BDA0002878519680000075

davg是通过考虑传感器节点的邻域的半径来计算的,在这个半径内的节点被认为是节点的邻域,然后计算出它们与节点的距离,davg是所有这些邻域节点的平均距离:d avg is calculated by considering the radius of the sensor node's neighborhood, nodes within this radius are considered to be the node's neighborhood, and then their distance from the node is calculated, d avg is the average distance of all these neighborhood nodes :

Figure BDA0002878519680000076
Figure BDA0002878519680000076

其中,N′由给定传感器节点的邻域传感器节点集合给出,邻域半径(Rch)定义如下:where N′ is given by the set of neighboring sensor nodes for a given sensor node, and the neighborhood radius (R ch ) is defined as:

Figure BDA0002878519680000081
Figure BDA0002878519680000081

其中,M×M是传感器节点部署区域。此外,该算法将传感器节点的当前能量作为CH节点进行选择,这意味着当前节点能量越大,就越有可能成为这一轮的CH节点。Among them, M×M is the deployment area of sensor nodes. In addition, the algorithm selects the current energy of the sensor node as the CH node, which means that the greater the current node energy, the more likely it is to become the CH node in this round.

本发明提供的一种基于紫外光谱的分布式水质监测系统的实施如图4所示,该系统包括如上任一种基于紫外光谱的水质监测仪器,就是图4中的节点1、节点2一直到节点n,与水质监测仪器处于无线通信范围内的无线通信部件,也就是图4中的“无线网络”,以及水质监测终端(如图4中右侧的个人电脑和手机), 其中,该无线通信部件用于接收水质监测仪器发射的水质数据并发送到水质监测终端。这种基于多波长吸光度的水质监测仪器的数量不限,一般是多个,可以在不同地方的水体中分别设置这种仪器,作为不同位置的监测节点,这就能够获得不同地方的实时水质数据,水质监测仪器可以利用4G通信模块来传递其获得的水质信息,然后由无线网络将水质信息传递到水质监测终端,利用本发明提出的节能无线传感器网络路由算法,可以实现对水质参数的长时间在线监测,位于水质监测终端处的监测人员就能够实时掌控多个地点的水质信息,从而能够快速分析不同地点的水质变化并且做出相关的决策,该水质监测终端可以是移动终端,如手机或平板电脑等等,也可以是PC终端等等,此处并不限制。将多个上述水质监测仪器作为监测节点,就能够建立可实时在线反映水体污染状况的节点式分布监测体系,可实时在线反馈水体的COD信息,并且可以将这种水质信息与地理位置数据相结合,结构简单,降低了硬件成本。The implementation of a distributed water quality monitoring system based on ultraviolet spectrum provided by the present invention is shown in FIG. 4 . The system includes any of the above-mentioned water quality monitoring instruments based on ultraviolet spectrum, namely node 1 and node 2 in FIG. 4 until Node n, the wireless communication component within the wireless communication range with the water quality monitoring instrument, that is, the "wireless network" in Figure 4, and the water quality monitoring terminal (the personal computer and mobile phone on the right in Figure 4), where the wireless The communication part is used to receive the water quality data transmitted by the water quality monitoring instrument and send it to the water quality monitoring terminal. There is no limit to the number of such water quality monitoring instruments based on multi-wavelength absorbance, generally there are more than one. Such instruments can be set up in water bodies in different places as monitoring nodes in different locations, which can obtain real-time water quality data in different places. , The water quality monitoring instrument can use the 4G communication module to transmit the obtained water quality information, and then the water quality information is transmitted to the water quality monitoring terminal by the wireless network, and the energy-saving wireless sensor network routing algorithm proposed by the present invention can be used. Online monitoring, the monitoring personnel at the water quality monitoring terminal can control the water quality information of multiple locations in real time, so as to quickly analyze the water quality changes in different locations and make relevant decisions. The water quality monitoring terminal can be a mobile terminal, such as a mobile phone or A tablet computer, etc., can also be a PC terminal, etc., which is not limited here. Using a plurality of the above water quality monitoring instruments as monitoring nodes, it is possible to establish a node-based distributed monitoring system that can reflect the water pollution status online in real time, and can feedback the COD information of the water body online in real time, and can combine this water quality information with geographic location data. , The structure is simple and the hardware cost is reduced.

为方便对水质进行评级,本发明在BP神经网络的基础上,将BP神经网络视为弱分类器,利用AdaBoost建立强分类器建立水质评价模型。有效解决了BP神经网络因随机初始化参数导致的评价系统不稳定的问题。In order to facilitate the rating of water quality, the present invention regards the BP neural network as a weak classifier on the basis of the BP neural network, and uses AdaBoost to establish a strong classifier to establish a water quality evaluation model. It effectively solves the problem of unstable evaluation system caused by random initialization parameters of BP neural network.

根据AdaBoost算法的基本原理,首先利用BP神经网络对训练样本进行训练和预测。当输出预测误差大于预定误差范围时,将此样本视为需要加强学习的样本,调整训练样本的权重,计算第t个BP弱预测器的权重。经过多次训练,得到T个BP弱预测器的权重,根据每个BP弱预测器的权重分布组合,形成一个强预测器,用强预测器进行预测,输出最终的预测结果。According to the basic principle of AdaBoost algorithm, firstly, BP neural network is used to train and predict the training samples. When the output prediction error is greater than the predetermined error range, this sample is regarded as a sample that needs to be strengthened, and the weight of the training sample is adjusted to calculate the weight of the t-th BP weak predictor. After multiple trainings, the weights of T weak BP predictors are obtained. According to the weight distribution combination of each BP weak predictor, a strong predictor is formed, and the strong predictor is used for prediction, and the final prediction result is output.

如图5所示,AdaBoost-BP水质评价模型具体施工工艺如下:As shown in Figure 5, the specific construction process of the AdaBoost-BP water quality evaluation model is as follows:

(1)导入数据样本,确定训练样本和测试样本,初始化训练样本数据的权重。计算公式为:(1) Import data samples, determine training samples and test samples, and initialize the weights of training sample data. The calculation formula is:

Figure BDA0002878519680000091
Figure BDA0002878519680000091

式中Di是初始化权重,i=1,2,…,m;m是训练样本数。where D i is the initialization weight, i=1,2,...,m; m is the number of training samples.

(2)设定BP弱分类的个数和网络结构,并用BP弱预测器对训练样本进行训练和预测。然后得到弱分类器Ct(x).(2) Set the number and network structure of BP weak classification, and use BP weak predictor to train and predict the training samples. Then get the weak classifier C t (x).

(3)计算Ct(x)的分类误差:(3) Calculate the classification error of C t (x):

Figure BDA0002878519680000092
Figure BDA0002878519680000092

(4)计算Ct(x)弱分类器的权值:(4) Calculate the weights of C t (x) weak classifiers:

Figure BDA0002878519680000093
Figure BDA0002878519680000093

(5)更新训练数据权重:(5) Update the training data weights:

Figure BDA0002878519680000094
Figure BDA0002878519680000094

式中gt是归一化因子,并且yi是数据标签。where gt is the normalization factor and yi is the data label.

(6)最终的强分类器:(6) The final strong classifier:

Figure BDA0002878519680000095
Figure BDA0002878519680000095

水质评价涉及5个标准,用5个BP神经网络组成一个弱分类群。在BP神经网络的基础上,AdaBoost设计的强分类器能有效提高单个BP神经网络评价系统的稳定性,并提高其分类的准确性和泛化能力。图5为AdaBoost评价模型的示意图。Water quality evaluation involves 5 criteria, and 5 BP neural networks are used to form a weak classification group. On the basis of BP neural network, the strong classifier designed by AdaBoost can effectively improve the stability of a single BP neural network evaluation system, and improve its classification accuracy and generalization ability. Figure 5 is a schematic diagram of the AdaBoost evaluation model.

将BP神经网络的结果与AdaBoost-BP水质评价模型的结果进行比较,从图 6可以看出,总体上,BP神经网络的识别率明显低于AdaBoost-BP神经网络。 BP神经网络受随机初始化参数的影响,从图7可以看出,AdaBoost-BP神经网络的识别误差明显小于传统BP神经网络,AdaBoost-BP系统更稳定。因此,利用AdaBoost优化的BP神经网络水质评价模型能够满足实际应用的要求。再对 BP神经网络水质评价模型和PSO-BP神经网络水质评价模型的实验结果进行了比较。从图6和图7可以看出,PSO-BP神经网络的实验结果比BP神经网络的实验结果更优秀。Comparing the results of the BP neural network with the results of the AdaBoost-BP water quality evaluation model, it can be seen from Figure 6 that on the whole, the recognition rate of the BP neural network is significantly lower than that of the AdaBoost-BP neural network. The BP neural network is affected by random initialization parameters. It can be seen from Figure 7 that the recognition error of the AdaBoost-BP neural network is significantly smaller than that of the traditional BP neural network, and the AdaBoost-BP system is more stable. Therefore, the BP neural network water quality evaluation model optimized by AdaBoost can meet the requirements of practical applications. Then the experimental results of the BP neural network water quality evaluation model and the PSO-BP neural network water quality evaluation model are compared. It can be seen from Figure 6 and Figure 7 that the experimental results of the PSO-BP neural network are better than the experimental results of the BP neural network.

通过计算AdaBoost-BP评价模型和PSO-BP评价模型的误差均值和方差,发现AdaBoost-BP模型误差的均值和方差分别为1.62%和0.0081,而PSO-BP模型误差的均值和方差分别为3.44%、0.0112。与PSO-BP水质评价模型相比, AdaBoost-BP水质评价模型具有更高的精度和更稳定的系统,能更好地满足实际应用的要求。By calculating the error mean and variance of the AdaBoost-BP evaluation model and the PSO-BP evaluation model, it is found that the mean and variance of the errors of the AdaBoost-BP model are 1.62% and 0.0081, respectively, while the mean and variance of the errors of the PSO-BP model are 3.44%, respectively. , 0.0112. Compared with the PSO-BP water quality evaluation model, the AdaBoost-BP water quality evaluation model has higher accuracy and a more stable system, which can better meet the requirements of practical applications.

水质评价装置由结合单元和获取单元组成。结合单元用于使用主成分分析法将获取的各类水质指标值结合成综合指标值;所述获取单元2用于根据所述评价方法AdaBoost-BP水质评价模型获取水质评价结果。The water quality evaluation device consists of a combination unit and an acquisition unit. The combining unit is used for combining the obtained various water quality index values into comprehensive index values using the principal component analysis method; the obtaining unit 2 is used for obtaining water quality evaluation results according to the evaluation method AdaBoost-BP water quality evaluation model.

具体地,水质指标包括水质的物理属性和化学属性,所述水质指标值可以为在预设时间段内以预设时长为周期采集的水质指标的值,如采集4年内以每个月为周期的23个水质指标值。考虑到各水质指标之间的相互关系,先使用所述主成分分析法将各类水质指标结合成综合指标,将获取的各类水质指标的值结合成综合指标的值。主成分分析法是一种主要用于降维的多元数学统计方法,把多个水质指标转化为少数几个综合指标。所述水质指标之间存在相关性,通过所述主成分分析法将一组相关的水质指标通过线性变化转换成另一组不相关的指标, 在转换过程中保存所述水质指标的总方差不变。将变换后的水质指标按照方差依次递减的顺序排列,其中,第一个变换后的所述水质指标具有最大方差,称为第一主成分﹐第二主成分的方差次大,且与第一主成分不相关,依次类推。Specifically, the water quality index includes physical properties and chemical properties of water quality, and the water quality index value may be the value of the water quality index collected in a preset period of time with a preset period of time, for example, a period of every month within four years of collection 23 water quality index values. Considering the relationship between various water quality indicators, the principal component analysis method is used to combine various water quality indicators into comprehensive indicators, and the obtained values of various water quality indicators are combined into comprehensive indicators. Principal component analysis is a multivariate mathematical statistical method mainly used for dimensionality reduction, which converts multiple water quality indicators into a few comprehensive indicators. There is a correlation between the water quality indicators, and the principal component analysis method is used to convert a group of related water quality indicators into another group of irrelevant indicators through linear change, and the total variance of the water quality indicators is preserved during the conversion process. Change. Arrange the transformed water quality indexes in the order of decreasing variance, wherein the first transformed water quality index has the largest variance, which is called the first principal component, the second principal component has the second largest variance, and is the same as the first principal component. The principal components are irrelevant, and so on.

信号采集处理模块的光谱数据作为AdaBoost-BP水质评价模型的输入,获取水质评价结果。AdaBoost-BP算法结合BP神经网络和AdaBoost算法的优点,在提高准确率的同时加快训练速度。本发明利用AdaBoost算法通过BP神经网络构造一个强分类器,避免了BP神经网络收敛速度慢、早熟的问题,有效地改善了BP神经网络的缺陷,提高了全局搜索能力。通过比较PSO-BP神经网络和 AdaBoost-BP神经网络的预测结果,发现AdaBoost-BP神经网络评价模型具有较高的精度、稳定性和较好的应用价值。The spectral data of the signal acquisition and processing module is used as the input of the AdaBoost-BP water quality evaluation model to obtain the water quality evaluation results. The AdaBoost-BP algorithm combines the advantages of the BP neural network and the AdaBoost algorithm to improve the accuracy and speed up the training. The present invention utilizes the AdaBoost algorithm to construct a strong classifier through the BP neural network, avoids the problems of slow convergence speed and premature maturity of the BP neural network, effectively improves the defects of the BP neural network, and improves the global search ability. By comparing the prediction results of PSO-BP neural network and AdaBoost-BP neural network, it is found that the AdaBoost-BP neural network evaluation model has higher accuracy, stability and better application value.

图9为水质传感器的尺寸图。水质传感器内部结构主要为微型紫外光谱分析仪,并且是具有高的光谱分辨能力及光强绝对值测量功能的光谱分析仪。其关键技术如下:Fig. 9 is a dimension drawing of the water quality sensor. The internal structure of the water quality sensor is mainly a miniature ultraviolet spectrum analyzer, and it is a spectrum analyzer with high spectral resolution and absolute value measurement function of light intensity. Its key technologies are as follows:

(1)光机结构设计。光谱分析仪采用光纤、CCD等新器件,提高光谱分析仪应用的灵活性,并且可以实现实时多通道阵列光电接收。其结构采用对称式 Czemy-Tumer光学结构设计,入射光由光纤耦合到一个标准的SMA905接口进入光学系统,经一个球面镜准直,然后由一平面光栅分光,经由第二块球面镜聚焦到一维线性探测器阵列上。(1) Optical-mechanical structure design. The spectrum analyzer adopts new devices such as optical fiber and CCD, which improves the flexibility of spectrum analyzer application, and can realize real-time multi-channel array photoelectric reception. Its structure is designed with a symmetrical Czemy-Tumer optical structure. The incident light is coupled to a standard SMA905 interface by an optical fiber and enters the optical system. It is collimated by a spherical mirror, and then split by a plane grating. on the detector array.

(2)光栅的选择。光栅不仅决定了光谱分析仪工作波长段。而且直接影响系统的光谱分辨力。光栅的选择要根据光谱分析仪的工作波段确定,在设计要求的光谱分辨率下,选择合适的光栅常数,由总体设计要求可知,微型光谱分析仪可能的工作波段为230—400nm,覆盖了紫外可见以及近红外光谱区域。(2) Selection of grating. The grating not only determines the working wavelength band of the spectrum analyzer. And it directly affects the spectral resolution of the system. The selection of the grating should be determined according to the working band of the spectrum analyzer. Under the spectral resolution required by the design, select the appropriate grating constant. According to the overall design requirements, the possible working band of the miniature spectrum analyzer is 230-400nm, covering the ultraviolet visible and near-infrared spectral regions.

(3)准直镜参数的确定。用凹球面反射镜作为物镜时,必须将球差控制在像差容限以内,从而保证系统的光谱分辨率。初始设计时,可以使用球差所产生的波像差小于的瑞利准则,来确定其焦距和许可的系统F数。准直镜球差所产生的波像差根据瑞利准则在确定系统相对孔径和准直镜参数时要综合考虑系统相差容限,入射光能、探测系统及系统体积,并在设计时根据实际系统进行调节。(3) Determination of collimating lens parameters. When using a concave spherical mirror as an objective lens, the spherical aberration must be controlled within the aberration tolerance to ensure the spectral resolution of the system. In the initial design, the Rayleigh criterion, in which the wave aberration generated by spherical aberration is smaller than that, can be used to determine its focal length and allowable system F-number. The wave aberration generated by the spherical aberration of the collimating mirror should be comprehensively considered when determining the relative aperture of the system and the parameters of the collimating mirror according to the Rayleigh criterion. system to adjust.

(4)入射光纤与狭缝的确定。在选择入射光纤时需要考虑以下一些参数和因素:入射光纤的接口类型、光纤材料以及光纤芯径的大小,常用的光纤接口有很多种,如FC、SC、ST及SMA等。光纤芯径大小决定了系统入射光强。在含有狭缝的系统中,系统的光谱分辨率由入射狭缝的宽度决定,此时如果在像差容限内增加光纤芯径的大小,不仅不会影响系统的分辨率,而且可以增加等效狭缝的高度,增大系统入射光强,该传感器选用光纤的数值孔径为0.22。(4) Determination of incident fiber and slit. When selecting the incident fiber, the following parameters and factors need to be considered: the interface type of the incident fiber, the fiber material, and the size of the fiber core diameter. There are many commonly used fiber interfaces, such as FC, SC, ST, and SMA. The size of the fiber core determines the incident light intensity of the system. In a system with a slit, the spectral resolution of the system is determined by the width of the incident slit. At this time, if the size of the fiber core diameter is increased within the aberration tolerance, it will not only not affect the resolution of the system, but also increase the size of the optical fiber. The height of the effective slit increases the incident light intensity of the system. The numerical aperture of the optical fiber selected for this sensor is 0.22.

图10为太阳能供电系统的结构图。本发明为水质传感器设计了太阳能供电系统,可以保证水质检测系统的每个用电部件能够持久有效的运行。FIG. 10 is a structural diagram of a solar power supply system. The invention designs a solar power supply system for the water quality sensor, which can ensure that each electric component of the water quality detection system can operate lastingly and effectively.

(1)供电系统。水质检测系统的各项设备的电源均为直流电源,又有光伏电池储存到蓄电池中的电能也是直流电,所以,在本系统中蓄电池可以直接与负载连接进行供电,如果直接与设备供电会造成设备损坏,设备在正常使用时需要在额定电压下运行,所以需要在太阳能电池与设备之间配备蓄电池。这里我们选择阀式铅酸蓄电池。阀控式铅酸蓄电池的性价比比较高节省了系统的运算经费,在功能上不需要人为操控,非常便于智能运行。但由于阀式铅酸蓄电池的内部环境的要求使得对它的充电要求很高,否则会严重降低它的使用寿命。所以,要设计一套完善的智能充放电系统,确保蓄电池能够在允许的电压与电流等级下进行快速充电。由于电磁阀与信号灯的额定电压在12-24V,所以本系统使用的蓄电池的电压等级为12V,容量为65AH,蓄电池可直接对其进行供电。而水质传感器的额定电压位24V,所以要在蓄电池与传感器之间添加升压模块进行升压处理。(1) Power supply system. The power supply of each equipment of the water quality detection system is DC power supply, and the electric energy stored in the battery by photovoltaic cells is also DC power. Therefore, in this system, the battery can be directly connected to the load for power supply. If the equipment is damaged, the equipment needs to operate at the rated voltage during normal use, so a battery needs to be equipped between the solar cell and the equipment. Here we choose valve lead-acid batteries. The valve-regulated lead-acid battery is relatively cost-effective, saving the computing cost of the system, and does not require human control in function, which is very convenient for intelligent operation. However, due to the requirements of the internal environment of the valve lead-acid battery, its charging requirements are very high, otherwise its service life will be seriously reduced. Therefore, it is necessary to design a complete intelligent charging and discharging system to ensure that the battery can be quickly charged under the allowable voltage and current level. Since the rated voltage of the solenoid valve and the signal lamp is 12-24V, the voltage level of the battery used in this system is 12V and the capacity is 65AH, and the battery can directly supply power to it. The rated voltage of the water quality sensor is 24V, so a booster module should be added between the battery and the sensor for boosting.

(2)能量转换。能量转换电路是该系统主要的功能模块。在该能量转换电路中,需要将太阳能电池板的电压通过降压或者升压稳定在一定的范围内,该系统中,将电压稳定在24V。能量转换的主体是一个BUCK-BOOST升降压斩波电路。电路的输入端是来自太阳能电池板,电路的输出端连接在蓄电池上,蓄电池相当于一个负载。(2) Energy conversion. The energy conversion circuit is the main functional module of the system. In this energy conversion circuit, the voltage of the solar panel needs to be stabilized within a certain range by bucking or boosting, and in this system, the voltage is stabilized at 24V. The main body of energy conversion is a buck-boost buck-boost chopper circuit. The input end of the circuit is from the solar panel, and the output end of the circuit is connected to the battery, which is equivalent to a load.

在太阳能电池板和DC-DC之间有一个ADC的采集信号,在DC-DC和蓄电池之间也有一个ADC采集点。当第一个ADC测量的电压太低的时候,则断开太阳能电池板与DC-DC之间的电源连线。当第二个ADC测量的电压值与预定的24V 之间有差距的时候,就要控制MOSFET的开关PWM占空比。There is an ADC acquisition signal between the solar panel and the DC-DC, and there is also an ADC acquisition point between the DC-DC and the battery. When the voltage measured by the first ADC is too low, disconnect the power connection between the solar panel and the DC-DC. When there is a gap between the voltage value measured by the second ADC and the predetermined 24V, the on-off PWM duty cycle of the MOSFET is controlled.

综上所述,本发明提供的上述方案,无需添加化学试剂,无二次污染,检测速度快,功耗低,可实现投放式在线测量功能,而且该监测节点结构简单,可扩展性强,后续可扩展动力、避障﹑数据检验等功能,该仪器能够实时反馈水体的污染程度以及地理位置信息,可形成节点式水质实时监测系统,达到水污染预警效果;采用的COD测量污染光学窗口补偿方法简便容易操作,补偿后测量结果精度高;上述光学窗口污染补偿方式在浊度条件下有很好的适用性,适用于多种类型的水体环境,而且这种COD测量的光学窗口污染补偿方法在后续测量过程中无需人力和物力的再投入,可以有效降低仪器维护成本,因此可实现对COD的长时间的实时测量。To sum up, the above solution provided by the present invention does not need to add chemical reagents, has no secondary pollution, has fast detection speed, low power consumption, and can realize the drop-in online measurement function, and the monitoring node has a simple structure and strong scalability. Follow-up functions such as power, obstacle avoidance, and data inspection can be expanded. The instrument can feed back the pollution degree and geographic location information of the water body in real time, and can form a node-type real-time water quality monitoring system to achieve the effect of water pollution early warning; the COD measurement pollution optical window compensation is adopted. The method is simple and easy to operate, and the measurement results after compensation are highly accurate; the above-mentioned optical window pollution compensation method has good applicability under turbidity conditions and is suitable for various types of water environments, and this optical window pollution compensation method for COD measurement In the subsequent measurement process, there is no need to re-invest in manpower and material resources, which can effectively reduce the maintenance cost of the instrument, so long-term real-time measurement of COD can be realized.

本发明的技术方案不限于上述具体实施例的限制,凡是根据本发明的技术方案做出的技术变形,均落入本发明的保护范围之内。The technical solutions of the present invention are not limited to the limitations of the above-mentioned specific embodiments, and all technical modifications made according to the technical solutions of the present invention fall within the protection scope of the present invention.

Claims (5)

1.一种基于紫外光谱法的分布式水质检测系统,其特征在于,包括若干基于紫外光谱的水质传感器,所述基于紫外光谱的水质传感器通过无线传感网络与水质监测终端连接;所述基于紫外光谱的水质传感器包括发出紫外光谱的光源、光谱分析仪、阵列CCD探测器、信号采集处理模块、电源;所述光源发出紫外光谱通过待测水源透射,成为信号光,进入光谱分析仪,得到按不同波长顺序排列的光谱,所述阵列CCD探测器将照射在探测器的光信号转换为电信号,所述信号采集处理模块对阵列CCD探测器的信号进行采集,光谱数据通过无线传感网络上传水质监测终端进行水质评价,得到被测水质的成分和含量信息。1. a distributed water quality detection system based on ultraviolet spectroscopy, is characterized in that, comprises several water quality sensors based on ultraviolet spectrum, the described water quality sensor based on ultraviolet spectrum is connected with water quality monitoring terminal by wireless sensor network; The water quality sensor of ultraviolet spectrum includes a light source that emits ultraviolet spectrum, a spectrum analyzer, an array CCD detector, a signal acquisition and processing module, and a power supply; the ultraviolet spectrum emitted by the light source is transmitted through the water source to be tested to become signal light, and enters the spectrum analyzer to obtain Spectra arranged in order of different wavelengths, the array CCD detector converts the optical signal irradiated on the detector into an electrical signal, the signal acquisition and processing module collects the signal of the array CCD detector, and the spectral data passes through the wireless sensor network. Upload the water quality monitoring terminal for water quality evaluation, and obtain the composition and content information of the measured water quality. 2.根据权利要求1所述的基于紫外光谱法的分布式水质检测系统,其特征在于:所述信号采集处理模块由STM32F103单片机产生CCD时序,驱动阵列CCD探测器工作,阵列CCD探测器输出经信号调理电路反向、放大后,将阵列CCD探测器输出的电压信号变换到0~VREF间的电压信号,通过ADC转换电路对每一个像素进行AD转换后存储到内存中,当一帧的数据全部采集完毕后,通过无线网络传给水质监测终端。2. The distributed water quality detection system based on ultraviolet spectroscopy according to claim 1, characterized in that: the signal acquisition and processing module generates CCD timing sequence by STM32F103 single-chip microcomputer, drives the array CCD detector to work, and the array CCD detector outputs the After the signal conditioning circuit is reversed and amplified, the voltage signal output by the array CCD detector is converted into a voltage signal between 0 and V REF , and each pixel is AD converted by the ADC conversion circuit and stored in the memory. After all the data is collected, it is transmitted to the water quality monitoring terminal through the wireless network. 3.根据权利要求1或2所述的基于紫外光谱法的分布式水质检测系统,其特征在于:所述水质监测终端为手机或平板电脑或PC终端。3. The distributed water quality detection system based on ultraviolet spectroscopy according to claim 1 or 2, wherein the water quality monitoring terminal is a mobile phone or a tablet computer or a PC terminal. 4.根据权利要求1所述的基于紫外光谱法的分布式水质检测系统,其特征在于:所述电源为12V的蓄电池,所述蓄电池连接有光伏充电装置,所述光伏充电装置包括太阳能电池板,太阳能电池板和蓄电池的DC-DC之间有第一个ADC转换电路,在DC-DC和蓄电池之间也有第二个ADC转换电路,当第一个ADC转换电路测量的电压太低的时候,则断开太阳能电池板与DC-DC之间的电源连线;当第二个ADC转换电路测量的电压值与预定的24V之间有差距的时候,就要控制MOSFET的开关PWM占空比。4 . The distributed water quality detection system based on ultraviolet spectroscopy according to claim 1 , wherein the power source is a 12V battery, the battery is connected with a photovoltaic charging device, and the photovoltaic charging device comprises a solar panel. 5 . , There is a first ADC conversion circuit between the DC-DC of the solar panel and the battery, and a second ADC conversion circuit between the DC-DC and the battery, when the voltage measured by the first ADC conversion circuit is too low , then disconnect the power connection between the solar panel and the DC-DC; when there is a gap between the voltage value measured by the second ADC conversion circuit and the predetermined 24V, it is necessary to control the switching PWM duty cycle of the MOSFET . 5.一种水质评价分类方法,其特征在于,使用如权利要求1所述的基于紫外光谱法的分布式水质检测系统,具体步骤如下:5. a water quality assessment classification method, is characterized in that, using the distributed water quality detection system based on ultraviolet spectroscopy as claimed in claim 1, concrete steps are as follows: S1、在水质监测终端内建立AdaBoost-BP水质评价模型,S1. Establish the AdaBoost-BP water quality evaluation model in the water quality monitoring terminal, S2、导入数据样本,确定训练样本和测试样本,初始化训练样本数据的权重,初始重量公式为:S2. Import data samples, determine training samples and test samples, and initialize the weight of training sample data. The initial weight formula is:
Figure FDA0002878519670000021
Figure FDA0002878519670000021
其中:Di是初始化权重,i=1,2,…,m;m是训练样本数;Among them: D i is the initialization weight, i=1,2,...,m; m is the number of training samples; S3、设定BP弱分类的个数和网络结构,并用BP弱预测器对训练样本进行训练和预测,然后得到弱分类器Ct(x);S3. Set the number and network structure of the BP weak classification, and use the BP weak predictor to train and predict the training samples, and then obtain the weak classifier C t (x); S4、计算分类误差Ct(x):S4. Calculate the classification error C t (x):
Figure FDA0002878519670000022
Figure FDA0002878519670000022
S5、计算Ct(x)弱分类器的权值:S5. Calculate the weight of the C t (x) weak classifier:
Figure FDA0002878519670000023
Figure FDA0002878519670000023
S6、更新训练数据集权重:S6. Update the training data set weights:
Figure FDA0002878519670000024
Figure FDA0002878519670000024
其中:gt是归一化因子,并且yi是数据标签;where: g t is the normalization factor, and yi is the data label; S7、最终的强分类器:S7, the final strong classifier:
Figure FDA0002878519670000025
Figure FDA0002878519670000025
水质评价涉及5个标准,用5个BP神经网络组成一个弱分类群,在BP神经网络的基础上,AdaBoost设计的强分类器能有效增强单个BP神经网络的稳定性,提高BP神经网络评价模型的准确性和泛化能力;Water quality evaluation involves 5 criteria, and 5 BP neural networks are used to form a weak classification group. On the basis of BP neural network, the strong classifier designed by AdaBoost can effectively enhance the stability of a single BP neural network and improve the BP neural network evaluation model. accuracy and generalization ability; S8、将信号采集处理模块输出的光谱数据作为AdaBoost-BP水质评价模型的输入,预测水质等级评价结果。S8. Use the spectral data output by the signal acquisition and processing module as the input of the AdaBoost-BP water quality evaluation model to predict the water quality grade evaluation results.
CN202011636239.XA 2020-12-31 2020-12-31 Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method Pending CN113155767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011636239.XA CN113155767A (en) 2020-12-31 2020-12-31 Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011636239.XA CN113155767A (en) 2020-12-31 2020-12-31 Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method

Publications (1)

Publication Number Publication Date
CN113155767A true CN113155767A (en) 2021-07-23

Family

ID=76878626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011636239.XA Pending CN113155767A (en) 2020-12-31 2020-12-31 Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method

Country Status (1)

Country Link
CN (1) CN113155767A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119510325A (en) * 2025-01-16 2025-02-25 北京北控悦慧环境科技有限公司 A water environment quality detection method and system based on spectral data analysis

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1967215A (en) * 2006-11-08 2007-05-23 浙江大学 UV scanning type multispectral water-quality COD rapid detection method and device therefor
CN102042963A (en) * 2010-10-14 2011-05-04 长春理工大学 Online detector for detecting total organic carbon (TOC) in sewage with ultraviolet spectrometry method
CN102661923A (en) * 2012-05-03 2012-09-12 四川碧朗科技有限公司 Complex monitor for automatically monitoring multiple parameters of water on line
CN103267832A (en) * 2013-05-13 2013-08-28 安徽工程大学 Surface water online water quality monitoring system
CN106529729A (en) * 2016-11-18 2017-03-22 同济大学 Method and system for forecasting default of credit card user based on BP_Adaboost model
CN210839049U (en) * 2019-11-20 2020-06-23 四川师范大学 Intelligent photovoltaic power supply system adaptive to extreme illumination conditions

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1967215A (en) * 2006-11-08 2007-05-23 浙江大学 UV scanning type multispectral water-quality COD rapid detection method and device therefor
CN102042963A (en) * 2010-10-14 2011-05-04 长春理工大学 Online detector for detecting total organic carbon (TOC) in sewage with ultraviolet spectrometry method
CN102661923A (en) * 2012-05-03 2012-09-12 四川碧朗科技有限公司 Complex monitor for automatically monitoring multiple parameters of water on line
CN103267832A (en) * 2013-05-13 2013-08-28 安徽工程大学 Surface water online water quality monitoring system
CN106529729A (en) * 2016-11-18 2017-03-22 同济大学 Method and system for forecasting default of credit card user based on BP_Adaboost model
CN210839049U (en) * 2019-11-20 2020-06-23 四川师范大学 Intelligent photovoltaic power supply system adaptive to extreme illumination conditions

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
余志剑: "基于B_S架构的远程水质监测系统的设计与实现", 《中国优秀硕士论文全文数据库工程科技I辑》 *
毕继耀等: "线阵CCD光谱分辨率检测系统设计", 《电子测量与仪器学报》 *
王斌波等: "基于STM32的线阵CCD图像采集系统", 《电子世界》 *
许林林等: "基于虚拟仪器和蓝牙技术的线阵CCD图像采集系统", 《微型机与应用》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119510325A (en) * 2025-01-16 2025-02-25 北京北控悦慧环境科技有限公司 A water environment quality detection method and system based on spectral data analysis

Similar Documents

Publication Publication Date Title
Chen et al. A vision transformer-based deep neural network for state of health estimation of lithium-ion batteries
Liu et al. State of charge monitoring for vanadium redox flow batteries by the transmission spectra of V (IV)/V (V) electrolytes
CN115714420A (en) Combined power station operation optimization method and system based on high-precision wind and light output prediction
CN103954913A (en) Predication method of electric vehicle power battery service life
CN102507472B (en) Electrolyte measurement method and electrolyte measurement device for vanadium redox flow battery
CN119231519B (en) Power grid dispatching method and system
CN112215478B (en) Power coordination control method and device for optical storage station and storage medium
CN113155767A (en) Distributed water quality detection system based on ultraviolet spectroscopy and water quality evaluation method
CN109767353B (en) A photovoltaic power generation power prediction method based on probability distribution function
CN117833319A (en) Electric power peak regulation system based on Internet of things
Lu et al. Hybrid machine learning models for predicting short-term wave energy flux
CN102621078B (en) Method and device for detecting charging state of vanadium redox battery
CN111507565A (en) Performance evaluation method and system of energy storage power station in frequency modulation application scene
CN108627500A (en) A kind of solid fuel measurement of caloric value method
CN118970891A (en) A method and device for accurately predicting photovoltaic output at the substation level based on subdivided grids
CN113917287A (en) Substation bus joint discharge heating fault monitoring system
Gupta et al. Energy resource allocation for green FiWi network using ensemble learning
Damrongsak et al. Forecasting of electricity consumption using neural networks in public hospital buildings with installed smart meters in Thailand
CN117669980A (en) Novel photovoltaic addressing and sizing method for power distribution network with multidimensional performance evaluation
CN112600248B (en) Light-diesel-storage composite power supply control method
CN116050912A (en) Health status evaluation method of energy station considering distance coupling and prospect theory
CN111552911B (en) A Quantitative Analysis Method of Technical Line Loss Influencing Factors Based on Multi-scene Generation
CN116307807A (en) A cloud model-based evaluation method and device for key technologies of electric power Internet of things
CN213874657U (en) Optical fiber spectrometer for testing water quality
CN118970926B (en) Photovoltaic power intelligent prediction method and system integrating mechanism model and field measurement

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210723