Data-Centric UML Profile for Wireless Sensors: Application to Smart Farming

Modelling﻿WSN﻿data﻿behaviour﻿is﻿relevant﻿since﻿it﻿would﻿allow﻿to﻿evaluate﻿the﻿capacity﻿of﻿an﻿application﻿for﻿supplying﻿the﻿user﻿needs,﻿moreover,﻿it﻿could﻿enable﻿a﻿transparent﻿integration﻿with﻿different﻿data-centric﻿information﻿systems.﻿Therefore,﻿this﻿article﻿proposes﻿a﻿data-centric﻿UML﻿profile﻿for﻿the﻿design﻿of﻿wireless﻿sensor﻿nodes﻿from﻿the﻿user﻿point-of-view﻿capable﻿of﻿representing﻿the﻿gathered﻿and﻿delivered﻿data﻿of﻿the﻿node.﻿This﻿profile﻿considers﻿different﻿characteristics﻿and﻿configurations﻿of﻿frequency,﻿aggregation,﻿persistence﻿and﻿quality﻿at﻿the﻿level﻿of﻿the﻿wireless﻿sensor﻿nodes.﻿Furthermore,﻿this﻿article﻿validates﻿the﻿UML﻿profile﻿through﻿a﻿computer-aided﻿software﻿engineering﻿(CASE)﻿tool﻿implementation﻿and﻿one﻿case﻿study,﻿centred﻿on﻿the﻿data﻿collected﻿by﻿a﻿real﻿WSN﻿implementation﻿for﻿precision﻿agriculture﻿and﻿smart﻿farming.


WIRELESS SENSoR NETWoRKS
In this section, we introduce the concepts of sensors, sensing probes, sensor nodes, and sensor networks.Furthermore,westateanddescribesomeofthemostimportantdatacharacteristicsand configurationsforthedefinitionofsensingapplications.
The data collection and management considerations are very important for the definition of WSNapplications,sincetheyallowtoassessthefutureeffectivenessandefficiencyofthenetwork. Thus,inordertomodeltheapplicationsfromtheuserpoint-of-view,wehaveselectedsomerelevant characteristicsandconfigurationsfortheWSdata.

Relevant Data Aggregation Configurations
• Theaggregationfunction

• Thefrequencyforaggregatingthemeasurements • Thegranuleoftheaggregatingfrequency • Thelengthoftheaggregatingwindow • Theamountofmeasurementsaggregatesinawindow
Since aggregation is a data processing operation, it can be configured in the same way than the gathering and delivering operations with the addition of the aggregation function (e.g. average, maximum,mode)configuration.
These data collection and management considerations help to model the data behaviour in agriculturalWSNapplications.However,theyarenotrestrictedtoagriculture-orientedandsmartfarmingapplications;thereby,theseWSdatafeaturescouldbeusedtomodelWSNapplicationsfor variousdomainsoutsidetheAgri-foodcontext.

WSN Data Modelling
Moreover, the WSN data must meet the user and application requirements for a successful implementation. An accurate design in a direct-engineering process supported with conceptual metamodels(e.g.UMLprofiles)ofthedataprocessedbyWSNcouldallowtoseamlesslymeetsuch requirements.

Proposed UML Profile
Inthissubsection,weproposeaData-centricWireless-SensorUMLprofilebasedonthefeatures described in Section 2, which will act as a framework for modelling the data behaviour in WS implementedonAgri-food-orientedICTapplications(e.g.smartfarming)orevenindifferentdomains.

Profile Abstract Class Stereotype
The main root of our metamodel is the abstract Class Measure, it is intended to identify any measurement gathered, stored or delivered by the WS. The Measure must define a Type (e.g. temperature,humidity,radiation)andcouldhaveaProbePosition(thespatialpositionofthemeasuring probe).ThisClassiscomposedbyfiveProperties: • The Value is the main Property for identifying a measurement. It has to be tagged with the measurementUnit. • TheTimeStamprepresentsatimeassociatedtothemeasurement.Itshouldhaveataggedcondition ofConditionTypetoindicateifitisthetimeatGatheringoratDeliveringthemeasurement. • TheLocationindicatesthegeometry(thespatialpositionoftheWS)wherethemeasurementis Gathered/DeliveredusingtheConditionType. • The BatteryLevel is the remaining energy in the WS at the Gathering/Delivering using the ConditionType.ItcanbeusedfortriggeringlowlevelalertstoindicatethattheWSwillstop workingandthemeasurementcouldhavelowerquality.

Example 7
InthisexamplewepresenttheOCLforsomesemanticcoherenceconstraints;inparticularforthe lasttwoexamples:thefrequencydependence (Figure8) This constraint (Figure 9) indicates that designers should define both the LifeTime and LifeTimeGranularity tags in the GatheredMeasure class if they want to have persistence in the gathereddata. ThefirstconstraintinFigure10isthetransmissionStandard,whichimposesthedeliveringofonly higherqualitydata(GoodorInconsistent).Moreover,thesecondconstraintisthequalityStandard, which defines how the battery level affects the data quality in this example application (Good, InconsistentorErroneous).

Figure 12. MagicDraw implementation of our profile with OCL constraints
For every gathered measure, the node delivers the measurement Value, TimeStamp and BatteryLevel. Consequently, all the measured data besides a Link Quality Indicator (LQI) and a ReceivedSignalStrengthIndicator(RSSI)forcharacterizingthelinkstatusaredeliveredtoadatabase tobeaccessibleforthefinalusers.
Since the iLive nodes send the measurements as soon as they are gathered, the frequency configurationforthedeliveroperationofthereadablemeasuresisthesameastheoneofthegather one:onlysevenmeasurementsperhour,deliveringeachmeasurementwithaninesecondstimespan.
TheCASEtoolimplementationofourprofileshowsitscorrectnessandconsistency.Moreover, the validation on a real smart-farming case study evidences that our profile can be used for the descriptionofdatacollectedbyrealWSinrealWSNapplicationswithdifferentenergy-efficient configurations.Besides,theformal(UML)representationofthecasestudyallowedustoconcludethat theiLivenetworkdesignerscouldhaveleveragedtheaggregationandquality-checkingcapabilities ofourprofileinordertoreducethetransmissioncostsanddatabasestorage,andtoincreasetheuserperceivedvalueoftheavailabledata.