34520115CHINESEJOURNALOFCOMPUTERSVol.34No.5May2011:20110110;:20110401.(60673127)(2007AA01Z404)(BE2008135)(20103218110017)(20100481133)(1001005B).,,1985,,.Email:liangliu@nuaa.edu.cn.,,1953,,,.,,1988,,.,,1979,,.刘亮秦小麟郑桂能李博涵(210016),.ESA(EnergyefficientSpatialwindowqueryprocessingAlgorithm).,,,,,.ESA,.ESA,.,ESA.,.,ESAIWQE(ItinerarybasedWindowQueryExecution).:,ESAIWQE.;;;;;TP393DOI:10.3724/SP.J.1016.2011.00763AnEnergyEfficientSpatialWindowQueryProcessingAlgorithminWirelessSensorNetworksLIULiangQINXiaoLinZHENGGuiNengLIBoHan(CollegeofInformationScience&Technology,NanjingUniversityofAeronauticsandAstronautics,Nanjing210016)AbstractTheenergyconsumptionofexistingspatialwindowqueryprocessingalgorithmsinwirelesssensornetworksisfairyhigh.Whensomesensornodesfail,thequeryprocessofthesealgorithmsisverylikelytobeinterruptedandunabletoreturnqueryresult.AnenergyefficientspatialwindowqueryprocessingalgorithmcalledESAisproposedinthispaper.Itdividesthequeryregionintoseveralgrids.Eachgridhasaclusternodewhichcollectsthesensorydatainit,aggregatesthedatatoderivepartialqueryresultandsendsittotheclusternodeinthenextgrid.Theaboveprocessisrepeateduntilallnodeswithinthequeryregionaretraversedinordertogeneratethefinalqueryresult.ESAonlyrequireseachnodewithinthequeryregionsenddatamessageonce,whichreducesthedatamessages.TheauthorsproposetwogriddividingandclusternodeselectionalgorithmsaccordingtotheESAsenergyconsumptionformulatoreducetheenergyconsumptionofdistributingthequerymessages.Then,theauthorsdesignaqueryprocessingrecoveryalgorithmusingnoderedundancy,whichavoidstheinterruptionofESAduetonodefailures,andtwodatacollectionalgorithmstoreducetheenergyconsumptionduringtheprocesswheretheclusternodescollectthesensorydataofitsneighbors.Finally,theperformanceofESAandIWQE(itinerarybasedwindowqueryexecution)isanalyzedsystematically.AnalyticalandexperimentalresultsshowthatinmostcasesESAoutperformsIWQEintermsofenergyconsumption,querysuccessrateandqueryresultquality.KeywordsInternetofThings;wirelesssensornetworks;queryprocessing;spatialwindowquery;energyefficiency;nodefailuretolerance1,,.,[1],.,,.,.,[212].,,.IWQE[1](ItinerarybasedWindowQueryExecution),,:(1);(2);(3),.,ESA(EnergyefficientSpatialwindowqueryprocessingAlgorithm).,ESA,,(),,,,,.,;,.,.:,ESAIWQE.,ESA:,.,ESA,.,ESA,.ESA,,.2,;3ESA,ESA,ESA,ESAIWQE;4ESAIWQE;5.2.(1).[2]TAG(TinyAggregationserviceforadhocsensornetworks).,.,7642011,,,,.[35]R[13]TAG,.,,.[6]TAGSTWinFlood(SpatioTemporalWindowFloodalgorithm).3:[14],;,,;.TAG,STWinFlood,.[712],.[1516],.[17],,.(2).,,,.,[1](ItinerarybaseddataCollectionalgorithm,IC)..()()().,,,,,.1,.S1,ICABCD2.S1,S1{a,b,c,d,S2},S1.S1,{a,b,c,d,S1,S2}max{a,b,c,d,S1,S2}.S1S2,max{a,b,c,d,S1,S2}S2.,S1,S1.S2,,S2{a,b,c,d,e,f,S1,S3}{e,f,S3}S2,S2S1max{a,b,c,d,S1,S2}max{a,b,c,d,e,f,S1,S2,S3},.,S4,S4ABCD.12,[1]ICIWQE(3).[14],IC3,,.,[1]3/2.,[1820]ICK,K.7655:3IWQE,,.:(1).,.,,(),;(2).2,,(S2S3),,;(3).2,efS3,S2,,ghijS4.33.1[1,1820]..R.nn.1EtEr,1,E.E=Et+nnEr.,1E.abfd(a,b).SWQ(sw),sw,whA.swM.Sq.Sa.Etotal=Ef+Ec+Eb,,Ef;Ec;Eb..3.2,ESA,4,ESA3:(1).,4a.(2),.cgg,gncgn,cgn.:ESA:gncg,gncgncgn.,cgncg,gn.gncg,cgn.cgngn,cggncgn,,.,,.(3).76620114ESA1,S1,ESAABCD()5.{a,b,c,d,S2}S1,S2{a,b,c,d}.S1S2ABEF.S2,,abcd.{a,b,c,d}S2.S2{a,b,c,d}S1,ABEF,{a,b,c,d,S1,S2}max{a,b,c,d,S1,S2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A:NcCD,SNc.SNcSNc[i](1i|SNc|),:{SNc[1],,SNc[i-1]}SNc[i].cix.cxCD.GBA1.12,Nc,0.,CDPQ,ESA.7,,CDGHCDIJCDKLCDMNc.,ge,GBACDKLc,f.GAAGAA:Ncs,s,ESAgs;Ncx,cxESAgx.Ncgn,CDgn.GAAGBA,.7,Nc={d,e,f,g}.ec,ESACDKL,dfCDMN,gCDGH.{d,e,f,g}gndfdist(d,CD)dist(f,CD).GAACDMNc,f.(2)8,cABCD,CDMNf.fCDMN,i,.,CDMN(d),,;f,.,:CDMNrg,rg,.8deg,CDGHCDIJCDKL..8CDKL.CDMN,,,.,8degCDKLmax{a,b,c,d,e,g},ABKL.,.,8f,eKLEF.787695:(3)cgg,gncgn.gn.cgn,,.,,,.,9,cABCD,CDMNf,CDMN{d,e,f,g,h,i}.,f..1.fCDMN,gn.DC(DistancebasedDataCollectionAlgorithm),,IDC(ImprovedDistancebasedDataCollectionAlgorithm).DC,CDMNCD,,:1.CDMNs,c,CDMNns(CDMN);2.sns(CDMN)fCD,sns,ssnsi,1i||sns|,|sns|;3.i1,sf;i1,s