Summary of the invention
The object of the invention provides a kind of flexible measurement method that can the economize on hardware resource, realizes the conflux on-line monitoring of the pipe network discharge of sewage of complicacy.
The present invention at first utilizes Analysis on Mechanism and prior imformation, analyzes the major influence factors of the node pumping plant flow that confluxes, and tentatively confirms the influence factor of BP neural network, promptly confirms input/output variable.Utilize Grey Incidence Analysis to confirm different upstream pumping unit drain discharge retardation time then.On pumping plant history data basis, set up Grey Neural Network Model, predict the node pumping plant flow that confluxes.Concrete steps are following:
Step (1) is selected collecting pipe pessimistic concurrency control input/output variable.
Can know that based on Analysis on Mechanism the pumping plant inflow that confluxes is mainly derived from each upstream pumping unit discharge rate and local inbound traffics (side stream, rainfall etc.); The sewage quantity that upstream pumping unit promotes must flow into downstream pump station through pipe network; Have certain hysteresis quality, and this locality becomes a mandarin and has uncertainty.Equal the forebay liquid level change according to the sewage inbound traffics and multiply by the forebay sectional area, though become a mandarin can't be by calculating in this locality, the forebay level value changes can reflect local flow valuve indirectly.Therefore selecting to conflux, pool water level is the output variable of neural network model before the pumping plant, and the pool water level principal element is the neural network model input variable before the pumping plant to select influence to conflux: 1. each pumping drainage amount of the upper reaches; 2. the pumping plant forebay liquid level change amount of confluxing; 3. the pumping drainage amount of confluxing.
Be simplified model, can analyze upper reaches pumping drainage amount and conflux the ratio of pumping plant inflow, cast out ratio less than 10% input quantity.
Step (2) data pre-service.
Possibly there is noise in the raw data that data acquisition and monitoring system (SCADA) gathers, data are imperfect or even inconsistent, before utilizing these data to carry out analysis modeling, need carry out pre-service to data.Mainly comprise:
(a) missing data is handled: what SCADA gathered is time series data, whenever at a distance from sampling in 20 seconds 1 time.To the missing term that possibly exist, at first to roughly select, per minute selects 1 data; Utilize again and ignore tuple or historical data complementing method processing missing data.
(b) noise data is handled: the level gauging error that water level fluctuation causes during for the switch pump, through getting mean value that three measured values obtain to reduce error; Adopt the front and back data smoothing to proofread and correct for indivedual singular points; For tangible data less than normal bigger than normal, adopt the method for directly removing burr to proofread and correct.
Step (3) is confirmed each upstream pumping unit draining delay time
Each upstream pumping unit sewage effluent successively imports main by each arm and flow to the node pumping plant that confluxes again, because length of tube, cross section, the gradient are different with the water yield, conflux time of pumping plant of each tributary arrival is also not necessarily identical.According to the sewage propagation law, the flow of same position phase always is later than the time that occurs at last section in the time that next section occurs, and this mistiming is exactly the delay time of flow.For the node pumping plant that confluxes, need to calculate its partial correlation property.
Adopt the association of grey speed to calculate the pumping drainage delay time, by the notion of grey relational grade in the gray theory, same discharge process should be bigger at the correlation degree of upstream and downstream.Selecting downstream flow time series (daily mean flow sequence) be the reference time sequence, 2 periods forward of 1 period forward of corresponding time of the upper reaches, corresponding time, corresponding time, 3 periods forward of correspondence time ... The flow time series is for comparing time series.The value correspondence that corresponding relatively time series and the reference time preface degree of association are maximum forward the time hop count be exactly the pumping drainage delay time.
The hypothetical reference time series is Y
0=[Y
0(1), Y
0(2) ..., Y
0(n)]; Relatively time series is: X
i=[X
i(1), X
i(2) ..., X
i(n)] i=1,2 ..., N, N represent comparison seasonal effect in time series number.
I expression formula that compares correlation function between time series and the reference time sequence is:
In the formula: Δ X (t)=X
i(t+1)-X
i(t), Δ Y (t)=Y
0(t+1)-Y
0(t), Δ t is for comparing the seasonal effect in time series sampling period;
Be X
iRelative rate of change,
Be Y
0Relative rate of change, Δ t=1.
I grey speed interconnection degree r that compares between time series and the reference time sequence
iFor:
Calculate each reference time sequence and seasonal effect in time series grey speed interconnection degree relatively respectively, the value of these grey relational grades relatively, the value that the degree of association is big corresponding forward the time hop count be exactly the pumping drainage delay time.Obtain each upstream pumping unit draining delay time by above-mentioned grey speed correlating method.
For the time series data of SCADA systematic sampling, select to form training sample with the big list entries of the output sequence degree of association.The utilization grey correlation calculates the concrete steps in delay time:
(a) collect the sewage lifting capacity data of conflux node pumping plant sewage inflow and each upstream pumping unit, time scale as far as possible little (the data here all are sewage quantity sizes values, need not to carry out nondimensionalization).
(b) set up the reference time sequence and compare time series, the node pumping plant inflow time series of selecting to conflux is reference time sequence Y
0, the last period of corresponding time of each upstream pumping unit, corresponding time, two periods of corresponding time ... Sewage lifting capacity time series be time series X relatively
i
(c) calculate grey incidence coefficient, utilization grey incidence coefficient computing formula calculates the reference time sequence respectively and each compares the grey incidence coefficient between the time series, uses ξ
(t), ξ
(t-1), ξ
(t-2)... Expression.
(d) calculate grey speed interconnection degree, utilization grey relational grade computing formula, the grey speed interconnection degree of calculating reference sequences and each comparative sequences is used r
(t), r
(t-1), r
(t-2)... Expression.
(e) confirm each upstream pumping unit draining delay time; Notion according to grey relational grade; Degree of association value maximum shows that corresponding comparison time series and the correlation degree between the reference time sequence are maximum, its corresponding forward the time hop count just tentatively confirm as the upstream pumping unit draining delay time.Therefore relatively the value of these grey relational grades, the maximum value of the degree of association corresponding forward the time hop count just can regard as the upstream pumping unit draining delay time.
Step (4) data normalization is handled
The input data are carried out normalization handle, be converted into the value of [0,1] interval range, conversion formula is:
X wherein
MaxBe the maximal value in the input data, x
MinBe the minimum value in the input data.X is for the input data, and
is for importing the value after data normalization is handled.
Step (5) is built the BP neural network framework.
The newff function that calls in the Matlab7.1 Neural Network Toolbox is set up a BP neural network, Net=newff (PR, [s
1, s
2..., s
i], { TF
1, TF
2..., TF
i, BTF, BLF, PF); Net is the BP neural network framework, and PR is a span that is determined by greatest member and least member in the input matrix, s
iBe the neuronic number of i layer, TF
iBe the transport function of i layer, 1≤i≤N
1, N
1Be the total number of plies of neural network, BTF is the training function of BP neural network, and BLF is the parameter of control weights and threshold value, and PF is the network performance function.
Step (6) training BP neural network.Concrete grammar is:
(a) initialization BP neural network, the value assignment of utilizing random function to produce is given weights and bias, calls the init function then and comes the whole neural network of initialization.
(b) network training number of times and training objective error are set, show the training step number.
(c) training data being set is input matrix P, and it is matrix T that desired value is set, and the train function that calls in the Matlab7.1 Neural Network Toolbox carries out the data training until convergence to BP neural network Net; Net=train (Net, P, T); Wherein P is a trained values, and T is a desired value.
Step (7) test b P neural network.
BP neural network to training is tested, and historical data is formed pumping plant forebay water level forecast network test matrix P_test, directly calls the sim function in the Matlab7.1 Neural Network Toolbox; (Net P_test), carries out emulation to the test input to D=sim; Wherein D is an objective function; Net is the BP neural network that trains, and D is a desired value, and P_test is a test sample book.
The anti-normalization of step (8) data is handled.
To the test gained sewage pumping station forebay waterlevel data according to formula
Carry out anti-normalization and handle, wherein x ' is that the final pumping plant forebay waterlevel data in back is handled in anti-normalization,
Be the pumping plant forebay waterlevel data that emulation testing obtains, x
MaxBe the maximal value in the waterlevel data of pumping plant forebay, x
MinBe the minimum value in the waterlevel data of pumping plant forebay.
Can also carry out verification for the neural network prediction model of having set up.
Use based on the method for root mean square variance (RMSE) and validity index (COE) index the forecast model of setting up based on the BP neural network is tested.
Root mean square calculation formula:
Validity formula of index:
Wherein, n is the checking data number, q
iBe actual value,
Be predicted value,
Average for actual value.
Root-mean-square value is good more near 0 explanation model performance more, and the validity index is good more near 1 more, and the validity index means that less than 0.7 o'clock model is inapplicable.
The present invention utilizes municipal drainage data acquisition and monitoring system (SCADA system) to accumulate a large amount of pumping station operation data; Confirm the upstream pumping unit draining time delay time through grey correlation analysis, utilize neural network strong non-linear mapping ability and self-learning capability that conflux pipe network flow and water level are accurately forecast.Both solve different upstream pumping unit draining delay variation problems, simulated pipe network draining non-linear process again preferably.
The beneficial effect of the inventive method:
1. combine through grey correlation analysis and two kinds of methods of neural network; Both solve different upstream pumping unit draining delay variation problems, better simulated pipe network draining non-linear process again, realized confluxing node sewage pumping station flow soft measurement; The economize on hardware resource, cost is low, precision is high.
2. can be used for the difference pipe network sewage pumping station volume forecasting of confluxing, be applicable to rainfall distribution, sanitary sewage discharging, the pipeline uncertain conditions such as stifled, seepage of becoming silted up.
3. grey neural network has the ability of approaching the Nonlinear Mapping function, therefore utilizes the pumping station operation historical data to predict the preceding pool water level of pumping plant, and the precision of prediction that obtains than traditional steady flow computing method is high.
Embodiment
With Hangzhou drainage pipeline networks martial arts circles door pumping plant pipeline section is example, is described in detail embodiment of the present invention.Martial arts circles's door pumping plant has 3 upstream pumping units, is respectively bus factory's pumping plant, and Gu swings pumping plant (leaf node), Hangzhoupro large pumping station (upstream pumping unit is high-new pumping plant), and the soft measurement calculation procedure of the node flow that confluxes is following:
Step (1) is confirmed collecting pipe pessimistic concurrency control input variable and output variable:
Input variable comprises that bus factory, upper reaches pumping plant, Gu swing pumping plant and Hangzhoupro large pumping station water discharge, martial arts circles's door pumping plant forebay liquid level change amount and martial arts circles's door pumping drainage amount; Output variable is a pool water level before martial arts circles's door pumping plant;
Step (2) data pre-service: the data to SCADA gathers are carried out data omission processing, noise processed.
A. missing data is handled: pumping plant SCADA whenever at a distance from 20 seconds sampling 1 secondary data, at first roughly selects from the time series data of gathering, and per minute selects 1 data, and according to front and back data completion, the associated data complementing method carries out missing data to be handled; For the more data of consecutive miss,, carry out the analogy completion through the manual work contrast data of the previous day.
B. noise data is handled: the level measuring error that water level fluctuation causes during to the switch pump, through the multisensor measured value average with the front and back data smoothing correction handle; For tangible data less than normal bigger than normal, proofread and correct through removing the burr method.
Step (3) the pumping plant volume forecasting model of confirming to conflux.
A. confirm the model input/output variable:
Select based on Analysis on Mechanism that pool water level is the output variable of neural network model before martial arts circles's door pumping plant, the principal element of selecting to influence this water level is the neural network model input variable: 1. each pumping plant of the upper reaches (bus factory's pumping plant, Gu swing pumping plant and Hangzhoupro large pumping station) lifting capacity; 2. martial arts circles's door pumping plant forebay liquid level change amount; 3. martial arts circles's door pumping plant lifting capacity.
Add up three upstream pumping units (bus factory's pumping plant, Gu swing pumping plant and Hangzhoupro large pumping station) lifting capacity and the ratio of node pumping plant (martial arts circles's door pumping plant) inflow that confluxes, ignore the little input quantity of ratio.It is very little that Yin Gu swings the pumping plant proportion, and this example selects bus factory's pumping plant and Hangzhoupro large pumping station lifting capacity as input item.
B. confirm to delay parameter:
For the time series data of SCADA systematic sampling, in the delay time of adopting the association of grey speed to calculate each upstream pumping unit water discharge to the pumping plant that confluxes, select to form training sample with the big list entries of the output sequence degree of association.
Is example with bus factory's pumping plant to martial arts circles's door pumping plant; If reference sequences is martial arts circles's door pumping plant the 90th time series constantly; Comparative sequences is bus factory's pumping plant flow time series in lag behind 1 moment, 2 moment to the 89th moment that lag behind, i.e. the 89th discharge of sewage time series that begins to the 1st moment of bus factory's pumping plant.Result of calculation is as shown in Figure 1, and horizontal ordinate is retardation time, when lagging behind the 60th moment, reaches peak value.Select bus factory's pumping plant [65 ,-55] time period 10 groups of discharge rates before to import as model.Similar, large pumping station grey correlation analysis result is as shown in Figure 2 in Hangzhoupro, when lagging behind the 30th moment, reaches peak value, selects Hangzhoupro large pumping station [35 ,-25] time period 10 groups of discharge rates before to import as model.
The input of confirming model is respectively bus factory's pumping plant discharge rate, hysteresis time delay [65 ,-55], and Hangzhoupro large pumping station discharge rate, hysteresis time delay [35 ,-25], martial arts circles's door pumping plant discharge rate, each 10 dimension data of martial arts circles's door pumping plant liquid level, input matrix P is formed in cross arrangement.Be output as martial arts circles's pit level in front of the door.
Step (4) data normalization is handled.
Comprise four in the input sample, it is bigger that the order of magnitude differs, and for guaranteeing each factor par, accelerates speed of convergence, data carried out normalization handle, and is converted into the value of [0,1] interval range.
X wherein
MaxBe the maximal value in the input data, x
MinBe the minimum value in the input data.X is for the input data, and
is for importing the value after data normalization is handled.
Step (5) makes up the BP neural network.
Build the BP neural network framework, call the newff function in the Matlab7.1 function library, Net=newff (threshold; [20,1], ' tansig '; ' purelin ', trainlm), wherein Threshold is the minimum value and the maximal value of 40 input and output vectors of defined matrix of a 40*1; [20,1] expression ground floor has 20 neurons, and the second layer has 1 neuron; Tansig is the input layer transport function; Purelin is the output layer transport function; Trainlm is the training function based on the l-m algorithm.
Step (6) training BP neural network.
A. initialization network
Net.initFcn is with the initialization function that decides whole network.Parameter net.layer{i}.initFcn is with the initialization function that decides each layer.The initwb function according to the initiation parameter of each layer oneself (initializes weights is made as rands usually for net.inputWeights{i, j}.initFcn) initializes weights matrix and biasing, and concrete grammar is following:
net.layers{1}.initFcn=’initwb’;
net.inputWeights{1,1}.initFcn=’rands’;
net.layerWeights{2,1}.initFcn=’rands’;
net.biases{1,1}.initFcn=’rands’;
net.biases{2,1}.initFcn=’rands’;
net=init(net);
Net.IW{1,1} are the weight matrix of input layer to hidden layer;
Net.LW{2,1} are the weight matrix between hidden layer and output layer;
Net.b{1,1} are the threshold values vector of hidden layer;
Net.b{2,1} are the threshold values of output contact;
B., the step number that network training number of times, training objective error is set and is used for showing
net.trainParam.epochs=2000;
net.trainParam.goal=0.0008;
net.trainParam.show=50;
C., it was 2000 steps that the network training number of times is set, and the training objective error is 0.0008, showed that the training step number was 50 steps.
D., the initial momentum item is set, learning rate
net.trainParam.mc=0.7;
LP.lr=0.3;
E., the momentum term that network training is set is 0.7, and the training study rate is 0.3.
F. utilize input matrix P ' and objective matrix to be made as T ', through calling the train function, net=train (net, P ', T ') carries out sewage pumping station forebay water level forecast network training until convergence.
Step (7) network test.
The historical data that will be used for testing is formed the matrix p_test that is used for the preceding pool water level network test of sewage pumping station according to the input matrix form of step (1), carries out normalization according to step (2) again and handles, and the test matrix after the normalization is p ' _ test.Call the sim () function in the Matlab tool box, the network that trains is carried out emulation.The calling program code is: and D=sim (net, p ' _ test); The D matrix is sewage pumping station forebay water level forecast value.
The anti-normalization of step (8) is handled.
To the test gained pumping plant forebay waterlevel data according to formula
Carry out anti-normalization and handle, wherein x ' is that the final forebay liquid level data in back is handled in anti-normalization,
Be the forebay liquid level data that emulation testing obtains, x
MaxBe the maximal value in the liquid level data of forebay, x
MinBe the minimum value in the liquid level data of forebay.Pool water level is T ' _ test before the sewage pumping station after the anti-normalization, and promptly testing the preceding pool water level of resulting sewage pumping station is T ' _ test.