Summary of the invention
It is fixed that in view of the above existing problems in the prior art, the present invention provides the water-saving irrigation monitoring networks based on RSSI ranging
Position method, this method fully consider the influence to positioning accuracy such as RSSI range error and anchor node quantity, can obtain good
Locating effect, can satisfy network environment badly and the limited large-scale field irrigation area soil moisture content monitoring system of positioning cost
Location requirement, this method compared with common LS basic fixed position algorithm have higher positioning accuracy and lower calculatings complexity
Degree.
To achieve the goals above, the present invention provides a kind of water-saving irrigation monitoring network positioning side based on RSSI ranging
Method, comprising the following steps:
Step 1: the range information that modeling obtains rapidly monitoring node is propagated using signal;
Using logarithm-normal distribution model, RSSI value is expressed as
PR (d)=P+G-PL(d) (1)
Wherein, P and G is transmission power and antenna gain respectively, and PL (d) is the path loss after distance d, because having
Wherein, PL(d0) it is signal by reference distance d0When power loss, n is path loss index, d0For with reference to away from
From being generally taken as 1m, therefore have
Wherein, PR (d0) it is distance d0The received signal strength at place, XσFor the Gauss that average value is 0, standard deviation is 4~10
Random noise, PR (d) value that monitoring node measures is bigger, illustrates that distance is closer, the error generated by PR (d) deviation is smaller, nothing
Line signal passes through reference distance d0Path loss P afterwardsL(d0) be expressed as
In formula, GtAnd GrRespectively transmitter antenna gain (dBi) and receiving antenna gain, unit dBi;L is system loss coefficient;
λ is RF wireless signal wavelength, unit m, then PR (d0) can be calculated by following formula
PR(d0)=P+G-PL(d0) (4)
The monitoring node to be positioned uniformly random deployment in wireless monitor region is set, the monitoring node possesses phase
Same communication radius, and communication range can be expressed as a regular circle shapes region, by formula (2), if d0=1m, then have
PR (d)=PR (1) -10nlgd+Xσ (5)
If uniformly random in monitoring node communication range deploy enough monitoring nodes, according to PR (d)
The relationship being inversely proportional with distance d, it can be assumed that the smallest received signal strength PRminCorresponding maximum distance is dmax, then have
PRmin=PR (1) -10nlgdmax+Xσ (6)
Therefore have
Wherein, dmaxIt is considered communication radius r herein;
In multiple RSSI values that unknown node obtains, taking the smallest RSSI value is PRmin, corresponding dmax=r can be obtained
Unknown node to anchor node d value;
Step 2: it by comparing the difference for measuring distance and actual range between anchor node, obtains the opposite of each anchor node and misses
Poor coefficient communicates with measurement distance in range between anchor node to be used to correct monitoring node;
If anchor node is Ai(xi, yi), i=1,2 ..., n, wherein n is the anchor node number for participating in correction and calculating;A0(x0,
y0) it is anchor node to be corrected, A0(x0, y0) arrive Ai(xi, yi) actual range be respectively ri, i=1,2 ..., n pass through PR (d)
Measuring obtained distance is respectively di, i=1,2 ..., n;
RSSI ranging relative error is denoted as
Then anchor node Ai(xi, yi) at weighting ranging relative error correction coefficient be
μwThe rssi measurement error of anchor node is reflected, it is considered herein that weight shared by different PR (d), between monitoring node
Distance is bigger, and the range error as caused by the deviation of PR (d) is bigger, then considers the weight to correction coefficient with regard to smaller;
Then anchor node correction distance expression formula is
In formula, duiIt is monitoring node and anchor node RiBetween measurement distance, unit m;It is monitoring node and anchor section
Point RiBetween corrected range, unit m;μwFor anchor node RiWeighting ranging relative error correction coefficient;
Step 3: the coordinate of monitoring node is calculated using ranging weighted mass center location algorithm;
Set the monitoring node B of unknown position1Receive 3 anchor node A in its communication range1, A2And A3RSSI value according to
It is secondary to be denoted as RSSI1, RSSI2And RSSI3, and obtained monitoring node B1The path loss index n under region is monitored, is considered
RSSI value information and ranging weighted factor, then unknown position monitoring node B1Coordinate (x, y) calculation formula can be expressed as are as follows:
Wherein, d1, d2And d3Respectively B1To A1, A2And A3Measurement distance, a1, a2And a3Respectively with corresponding ranging
The weighting coefficient being inversely proportional, has
K is weighting adjustment factor, when practical application, by controlling the degree of the adjustable weighted correction of k value, so that positioning
System can reach optimum state, obtain optimal locating effect;In addition, considering further that angle information when selecting anchor node, formed
Weighting can further save computing resource, reduce position error;ForEach of kind anchor node combination is closed, if it is set
Reliability is CDABC(i), have
Wherein, αA, αBAnd αCThree interior angles of triangle are made of three anchor nodes, and
αmax=max { αA, αB, αC}
αmin=min { αA, αB, αC}
Then weight the coordinate of posterior nodal point MCalculation formula are as follows:
Step 4: the coordinates correction of monitoring node;
If thering is anchor node to be denoted as A in network0(x0, y0), it is assumed that its Location-Unknown, other anchor nodes are denoted as Ai(xi, yi),
Middle i=1,2 ..., n utilize Ai(xi, yi) arrive A0(x0, y0) distance, A can be calculated by the weighting location algorithm of this paper0's
Position Ac0(xc0, yc0), it is compared with its actual coordinate, can be obtained error of coordinate, then anchor node A0(x0, y0) coordinate miss
Difference is
ex0=x0-xc0 (15)
ey0=y0-yc0 (16)
Being write as i-th of anchor node error of coordinate canonical form is
exi=xi-xci (17)
eyi=yi-yci (18)
Therefore, monitoring sub-region right error of coordinate is
In formula: N is the anchor node number for participating in network positions error calculation;For the correction distance of i-th of anchor node;
Monitor sub-region right error of coordinate ewxAnd ewyFor the weighted average of anchor node error of coordinate, system is reflected
Zone location ability, so, the coordinate after unknown node is corrected by zone location error coefficient in positioning system is
X=xc+ewx (21)
Y=yc+ew0 (22)
X in formulac, ycFor the calculated coordinate value of unknown node weighted mass center location algorithm.
PR in the step 1minThe acquisition of value can be obtained by searching method, i.e., in monitoring node institute to be positioned
After all RSSI values that all RSSI values and its neighbor node received are received, puts together, sorts from large to small,
Taking a smallest RSSI value is PRmin。
Compared with prior art, this method fully considers RSSI range error and anchor node quantity etc. to positioning accuracy
It influences, preferable locating effect can be obtained, can satisfy the large-scale farmland irrigated area that network environment is badly limited with positioning cost
The location requirement of soil moisture content monitoring system.The characteristics of algorithm is that calculation amount is small, does not increase additional communication overhead, is reduced
The adverse effect of random noise in RF signal modeling, thus improve the positioning accuracy of monitoring node.By this method and commonly
LS basic fixed position algorithm is compared, and the position error mean value of two kinds of algorithms is respectively 2.1425m and 2.9251m, location algorithm
Average operating time is respectively 0.2372s and 1.2163s, shows that this method has higher positioning accuracy and lower calculating multiple
Miscellaneous degree.Actual demand of this method based on farmland automatic water-saving irrigation monitoring system, and it is fixed for water-saving irrigation monitoring node
The actual demand of position can significantly improve the quality of production convenient for the soil moisture content situation of understanding farmland irrigated area ambient soil at any time.
Specific embodiment
The invention will be further described below.
A kind of water-saving irrigation monitoring network localization method based on RSSI ranging, comprising the following steps:
Step 1: the range information that modeling obtains rapidly monitoring node is propagated using signal;
In soil environment using water-saving irrigation monitoring system, internal various soil soil properties are different and other biological is close
Collection, and exist and be unevenly distributed situation, cause multipath, diffraction and barrier to block, so that RF wireless signal propagation model becomes multiple
It is miscellaneous.Monitoring node itself is capable of providing the measurement of RSSI, without additional addition hardware device.The path loss of radio signal propagation
It is affected to rssi measurement precision, using logarithm-normal distribution model, RSSI value is expressed as
PR (d)=P+G-PL(d) (1)
Wherein, P and G is transmission power and antenna gain respectively, and PL (d) is the path loss after distance d, because having
Wherein, PL(d0) it is signal by reference distance d0When power loss, n is path loss index, d0For with reference to away from
From being generally taken as 1m, therefore have
Wherein, PR (d0) it is distance d0The received signal strength at place, XσFor the Gauss that average value is 0, standard deviation is 4~10
Random noise, PR (d) value that monitoring node measures is bigger, illustrates that distance is closer, the error generated by PR (d) deviation is smaller, nothing
Line signal passes through reference distance d0Path loss P afterwardsL(d0) be expressed as
In formula, GtAnd GrRespectively transmitter antenna gain (dBi) and receiving antenna gain, unit dBi;L is system loss coefficient;
λ is RF wireless signal wavelength, unit m, then PR (d0) can be calculated by following formula
PR(d0)=P+G-PL(d0) (4)
The monitoring node to be positioned uniformly random deployment in wireless monitor region is set, the monitoring node possesses phase
Same communication radius, and communication range can be expressed as a regular circle shapes region, by formula (2), if d0=1m, then have
PR (d)=PR (1) -10nlgd+Xσ (5)
If uniformly random in monitoring node communication range deploy enough monitoring nodes, according to PR (d)
The relationship being inversely proportional with distance d, it can be assumed that the smallest received signal strength PRminCorresponding maximum distance is dmax, then have
PRmin=PR (1) -10nlgdmax+Xσ (6)
Therefore have
Wherein, dmaxIt is considered communication radius r herein;
In multiple RSSI values that unknown node obtains, taking the smallest RSSI value is PRmin, corresponding dmax=r can be obtained
Unknown node to anchor node d value;PRminThe acquisition of value can be obtained by searching method, i.e., in monitoring node to be positioned
After all RSSI values that all RSSI values and its neighbor node received are received, puts together, arrange from big to small
Sequence, taking a smallest RSSI value is PRmin。
Step 2: it by comparing the difference for measuring distance and actual range between anchor node, obtains the opposite of each anchor node and misses
Poor coefficient communicates with measurement distance in range between anchor node to be used to correct monitoring node;
In order to obtain RSSI value measurement error information, anchor node situation known to position is considered, by measurement network
Anchor node PR (d) value known to position goes out to measure distance value, then according to anchor node reality with RF signal decaying Modeling Calculation
Coordinate calculates the actual range between anchor node, measurement distance and actual range is compared, to obtain anchor node PR (d)
The measurement error of measured value, when to unknown monitoring node ranging, it is contemplated that this PR (d) value measurement error can then reduce
Adverse effect of the various enchancement factors to RSSI distance measurement result in monitoring network;
Two-dimensional case is considered, if anchor node is Ai(xi, yi), i=1,2 ..., n, wherein n is the anchor section for participating in correction and calculating
Point number;A0(x0, y0) it is anchor node to be corrected, A0(x0, y0) arrive Ai(xi, yi) actual range be respectively ri, i=1,
2 ..., n are respectively d by the distance that PR (d) measurement obtainsi, i=1,2 ..., n;
RSSI ranging relative error is denoted as
Then anchor node Ai(xi, yi) at weighting ranging relative error correction coefficient be
μwThe rssi measurement error of anchor node is reflected, it is considered herein that weight shared by different PR (d), between monitoring node
Distance is bigger, and the range error as caused by the deviation of PR (d) is bigger, then considers the weight to correction coefficient with regard to smaller;
Then anchor node correction distance expression formula is
In formula, duiIt is monitoring node and anchor node RiBetween measurement distance, unit m;It is monitoring node and anchor section
Point RiBetween corrected range, unit m;μwFor anchor node RiWeighting ranging relative error correction coefficient.
Step 3: the coordinate of monitoring node is calculated using ranging weighted mass center location algorithm;
Modeling is propagated it is found that RSSI value is bigger by the RF signal of front, then the distance between monitoring node is closer, on the contrary then get over
Far;Closer apart from anchor node, range accuracy caused by measured RSSI value is higher, i.e., confidence level is higher, and when distance is greater than
After a certain threshold value, the range error as caused by RSSI value can be increased, and the confidence level of RSSI value at this time just reduces, therefore be proposed
Centroid localization algorithm based on RSSI ranging weighting is that comparison is reasonable;
The algorithm realizes each anchor node by weighting coefficient size to the weight of center-of-mass coordinate, and RSSI value is bigger, then saves
Distance between point is smaller, and the confidence level of RSSI value at this time is higher, also bigger to the weights influence of center-of-mass coordinate, therefore chooses suitable
When weighting coefficient can be carried out RSSI weighted calculation, to improve positioning accuracy;
Set the monitoring node B of unknown position1Receive 3 anchor node A in its communication range1, A2And A3RSSI value according to
It is secondary to be denoted as RSSI1, RSSI2And RSSI3, and obtained monitoring node B1The path loss index n under region is monitored, is considered
RSSI value information and ranging weighted factor, then unknown position monitoring node B1Coordinate (x, y) calculation formula can be expressed as are as follows:
Wherein, d1, d2And d3Respectively B1To A1, A2And A3Measurement distance, a1, a2And a3Respectively with corresponding ranging
The weighting coefficient being inversely proportional, has
K is weighting adjustment factor, when practical application, by controlling the degree of the adjustable weighted correction of k value, so that positioning
System can reach optimum state, obtain optimal locating effect;The characteristics of algorithm is that calculation amount is small, is not increased additional
Communication overhead, reduces the adverse effect of random noise in RF signal modeling, thus improves the positioning accuracy of monitoring node;Separately
Outside, it considers further that angle information when selecting anchor node, forms weighting, computing resource can be further saved, reduce position error;ForEach of kind anchor node combination is closed, if its confidence level is CDABC(i), have
Wherein, αA, αBAnd αCThree interior angles of triangle are made of three anchor nodes, and
αmax=max { αA, αB, αC}
αmin=min { αA, αB, αC}
Then weight the coordinate of posterior nodal point MCalculation formula are as follows:
Step 4: the coordinates correction of monitoring node;
Ranging correction coefficient μwCan be improved the precision of anchor node RSSI ranging, but in monitoring network because of measuring device and
Error of coordinate caused by the various enchancement factors such as emergency situations is helpless, therefore should also make full use of anchor node
Know that location information is corrected node locating coordinate, to further increase positioning accuracy;Positioning coordinates correction to be considered
Be to factor, it is assumed that anchor node Location-Unknown, using this paper mention determine aggregative weighted centroid localization algorithm calculate anchor node seat
Mark, by seeking difference with anchor node actual coordinate, that is, obtains anchor node error of coordinate information;It is being monitored node locating
When, it should also be taken into account that such error of coordinate information, so that various enchancement factors pair in monitoring network can be further reduced
The influence of positioning accuracy;
If thering is anchor node to be denoted as A in network0(x0, y0), it is assumed that its Location-Unknown, other anchor nodes are denoted as Ai(xi, yi),
Middle i=1,2 ..., n utilize Ai(xi, yi) arrive A0(x0, y0) distance, A can be calculated by the weighting location algorithm of this paper0's
Position Ac0(xc0, yc0), it is compared with its actual coordinate, can be obtained error of coordinate, then anchor node A0(x0, y0) coordinate miss
Difference is
ex0=x0-xc0 (15)
ey0=y0-yc0 (16)
Being write as i-th of anchor node error of coordinate canonical form is
exi=xi-xci (17)
eyi=yi-yci (18)
Therefore, monitoring sub-region right error of coordinate is
In formula: N is the anchor node number for participating in network positions error calculation;For the correction distance of i-th of anchor node;
Monitor sub-region right error of coordinate ewxAnd ewyFor the weighted average of anchor node error of coordinate, system is reflected
Zone location ability, so, the coordinate after unknown node is corrected by zone location error coefficient in positioning system is
X=xc+ewx (21)
Y=yc+ewy (22)
X in formulac, ycFor the calculated coordinate value of unknown node weighted mass center location algorithm.
Experiment simulation verifying:
In experimental study and its analytic process, in order to embody sensor node with anchor node quantity and density and communication radius
Influence to position error, in location algorithm implementation procedure, using the average localization error of node as main evaluation criterion.
The position error for defining nodes i is Eai, i.e.,
Wherein, i=1,2 ..., N, N are unknown node number in network, communication radius R.Wherein pi=[xci yci]TFor
The final estimated position of node i, zi=[xi yi]TFor the actual position of node i.
Then the average localization error of nodes is Ea, i.e.,
Average localization error EaSmaller, positioning accuracy is higher.
Simulated environment setting, selects Matlab as simulation test platform.Simulated environment is set as the square of 100m × 100m
Shape region.Select lognormal model as the RF communication distance measuring model between node herein, shown in expression formula such as formula (2).?
In observation model, RSSI value and distance d are outputting and inputting for model respectively.It is various random dry in actual monitoring environment
It disturbs and results in certain range error.In order to simulate random range error, the section that will be calculated by monitoring node actual coordinate
It is σ that distance, which is superimposed with standard deviation, between pointfGaussian noise, in this, as RF propagate traffic model in RSSI input for emulating mould
It is quasi-.Standard deviation sigmafExpression formula such as formula (25) shown in:
Wherein, R indicates the maximum communication radius of monitoring node, RiIndicate the logical communication distance of monitoring node, μiIndicate that ranging misses
Difference then controls μiValue can simulate different range error and carry out emulation experiment.
As a result middle algorithm A represents this paper algorithm, and algorithm B indicates that least square (LS) location algorithm, algorithm C indicate common matter
Heart location algorithm.Simulation comparison analyzes 3 kinds of algorithms in different range errors, different anchor node numbers and different node communications half
Positioning accuracy under diameter.
Influence of the measuring distance measurement error to positioning accuracy: setting anchor node quantity is n=20, and number of nodes is
400.Emulation obtains as shown in the results summarized in table 1.
Table 1:
By above-mentioned data it is found that range error is affected to algorithm C, when the variance of range measurement error is larger,
Positioning accuracy decline is more.Algorithm B is influenced smaller by range error, and in contrast, mentioned algorithm A inhibits well herein
Range error, therefore obtain higher positioning accuracy.
When the variance of range errorWhen, the positioning accuracy of B algorithm be about the positioning accuracy of 0.23, C algorithm about
It is 0.26;When the variance of range errorWhen increase, the positioning accuracy of three kinds of algorithms is begun to decline, but the positioning of algorithm A
Precision is always above other two kinds of algorithms.The reason is that working as the variance of range errorWhen, position error is mainly by ranging
Error draws composition, and after using ranging correction, node locating precision has bigger raising, when the variance of range errorWhen increase, the variance of range errorHave to positioning accuracy and significantly slackens effect.The ranging correction of algorithm A plays suppression
The effect of error processed, so that being significantly improved to positioning accuracy.
Test influence of the anchor node number to positioning accuracy: setting emulation experiment environment: 100 nodes are randomly dispersed in
In the region 100m × 100m, the communication radius of node is 40m.Obtain result as shown in table 2.
Table 2:
By above-mentioned data it is found that the position error of algorithm B and algorithm C when anchor node number is little is larger.Analyze reason
It can be used to calculate distance mainly when anchor node number is smaller, in network and the information of position is reduced, unknown node and anchor
Range error between node becomes larger.Since the correction coefficient that multiple anchor nodes are utilized in A algorithm is corrected measurement distance, institute
Can reduce by the less caused position error of anchor node number.
The relationship of test node communication radius and positioning accuracy: setting emulation experiment environment: 100 nodes are randomly dispersed in
In the region 100m × 100m, anchor node quantity is n=10.Obtain result as shown in table 3.
Table 3:
From the above data, it can be seen that positioning accuracy is also gradually increasing with the increase of node communication radius.Because of section
When point communication distance is bigger, the information content between unknown node and anchor node increases, so the distance of unknown node to anchor node is missed
Difference is reduced, simultaneously as node communication distance increases, the anchor node around unknown node also starts to increase, so unknown node
More anchor node distances be can use to correct the distance that itself arrives anchor node.Therefore, with the increase of node communication distance,
Positioning accuracy can be gradually increased.It follows that the positioning accuracy of A algorithm is higher than other two kinds of algorithms under the conditions of equivalent network.
Experimental result and analysis: in order to use the locating effect of the mentioned algorithm of experimental verification this paper, in the experiment of classroom building
In the region 20m × 20m of room, small wireless sensor Network Experiment System is constructed using CC2530 node.The system is provided with 6
A anchor node, is uniformly deployed in inside test zone, and in addition artificial bit selecting sets 10 unknown nodes of deployment and 1 aggregation node.
Node communication distance is 15m, and nodal distance ground level is about 0.5m, every 20s transmission primaries data, and 50 tests are taken in experiment
Mean value as experimental result.
After the specific location that node to be positioned is arranged in deployment, it is believed that be unknown node, measure, position.According to reality
Data are tested, obtaining ranging localization, the results are shown in Table 4.
Table 4:
Node serial number to be positioned |
Node physical location |
Position location after measurement |
Distance between two positions |
Position error Eai |
01 |
(3.0,3.0) |
(4.5,3.9) |
1.75 |
0.12 |
02 |
(3.0,9.0) |
(3.6,7.7) |
1.43 |
0.10 |
03 |
(3.0,12.0) |
(5.1,11.7) |
2.12 |
0.14 |
04 |
(6.0,6.0) |
(6.6,7.8) |
1.90 |
0.13 |
05 |
(6.0,9.0) |
(7.4,10.2) |
1.84 |
0.12 |
06 |
(9.0,6.0) |
(8.5,7.6) |
1.68 |
0.11 |
07 |
(9.0,9.0) |
(10.4,9.7) |
1.57 |
0.10 |
08 |
(12.0,3.0) |
(11.3,3.9) |
1.14 |
0.08 |
09 |
(12.0,9.0) |
(10.8,9.5) |
1.21 |
0.08 |
10 |
(15.0,9.0) |
(12.2,10.2) |
3.04 |
0.20 |
As shown in Table 4, the position error of algorithm A is 0.20 in actual monitoring environment, and minimum position error is 0.08, mean value
It is 0.118.Through comparing, under equal conditions, the position error mean value that emulation experiment obtains is 0.102, it can be seen that A algorithm
Actual location result be slightly below simulation result.It analyzes the reason is that the RF signal of actual environment is by indoor wall, tables and chairs and electricity
Device equipment etc. blocks influence, and thus caused signal propagation losses and multipath reduce the measurement accuracy of RSSI, thus increase
Position error, and these disturbing factors are not accounted in emulating.In a word in an experiment, algorithm A has basically reached expected fixed
Its feasibility in experiment test is also verified in position required precision.
16 groups of test datas are analyzed using location algorithm proposed in this paper, set Gaussian random variable as Xσ(0,
10), 100 nodes are randomly dispersed in the region 100m × 100m, and the communication radius of node is 40m, anchor joint number mesh n=20.For
Reduction network random distribution bring error, below under the conditions of gained location data is identical parameters, emulate 100 gained
Position error to the average value of data, test data is as shown in table 5.
Table 5:
Analysis: position error E in above-mentioned dataaiMaximum value be 0.35, minimum value 0.19, since 6 anchor nodes are equal
Even to be deployed in laboratory test region, whole locating effect is preferable, and only the position error of edges of regions is slightly bigger than normal.If
More anchor node is disposed in laboratory test edges of regions, locating effect can make moderate progress.
L-G simulation test shows that the algorithm calculation amount and communication overhead are smaller, can effectively inhibit Gaussian noise, positioning accurate
Degree can satisfy most of water-saving irrigation monitoring systematic difference requirements, obtain the more accurate coordinate bit of network monitor node
Confidence breath.This paper algorithm is compared with common LS location algorithm, the position error mean value of two kinds of algorithms be respectively 2.1425m and
2.9251m, and algorithm average operating time is respectively 0.2372s and 1.2163s, and the algorithm can be illustrated in positioning accuracy and meter
Bigger advantage is all had in terms of calculation amount.