Skip to content

Global Scheduler

Nikos Kefalakis edited this page Nov 15, 2013 · 21 revisions

Global Scheduler (see Figure below) formulates the request based on the user inputs (request definition).

[](Documentation/images/ArchitectureHighLevelWithoutSteps191112.jpg)

It parses each service request and accordingly it interacts with the rest of the OpenIoT platform through the Cloud Database (DB). In particular, the Scheduler performs the following functions:

  • Sensor and ICO selection. As part of this function the Scheduler queries the OpenIoT discovery service through the “availableSensors” entity (see Figure 6 below) in order to find the set of sensors (physical or virtual) and ICOs that fulfil the criteria specified in the scope of service request. Note that the service discovery functionality is based on the semantic properties of the sensors. The Service Discovery components will return to the Scheduler a list of sensors (along with their unique identifiers in the OpenIoT system) that could be used for delivering the specified service (i.e., a list of sensors fulfilling the criteria set as part of the service request).
  • Virtual Sensor “indirect” activation. Following the selection/identification of the sensors and ICOs that meet the specified criteria and at the request formulation time, the Scheduler will inform the virtual sensors (GSN nodes) about which of them are used by the service being scheduled. This information is kept in the “sensorServiceRelation” entity (Figure 6 below) and is accessed by the virtual sensors.
  • Request Storing and Activation. The Scheduler is also responsible to provide information to the Service Delivery & Utility Manager (SD&UM) regarding the services to be delivered. This is done through the cloud storage and more specifically the “serviceDeliveryDescription” entity (Figure below) where all the information related to a specific service is stored.
  • Service Status Update. Through a service lifecycle the Scheduler update its status at the “serviceStatus” entity (Figure below). Moreover, it is able to retrieve a service status to inform the User.
  • Access Control. Finally, the Scheduler implements access control mechanisms with the help of the “user” entity (Figure below).

Main OpenIoT Modules and Entities

Supported Functionalities/Services

A brief description of the OpenIoT (Global) Scheduler supported functionalities, are provided below:

Resource Discovery: will discover virtual sensor availability based on the “availableSensors” entity.

Service User Management: This service will enable the management of an OpenIoT service lifecycle based on the following Scheduler commands:

  • Register: which is responsible to:
  • identify all the required resources from the request and update the “sensorServiceRelation” entity at the cloud database,
  • formulate a SPARQL script, based on the user request, and store it to the “ServiceDescription” entity along with a Service ID and the user’s specific execution properties, and
  • the service instance shall get recorded at the “serviceStatus” entity.
  • Unregister: which enables the user to unregister a registered service. When a service gets unregistered the allocated resources shall get released and the new status shall get updated at the “serviceStatus” entity in the cloud.
  • Suspend: which enables the user to suspend a registered service. The service status shall get updated (set “suspended” as true) at the “serviceStatus” entity in the cloud and as a consequence it will not be able to get served from the SD&UM nor will its resources get updated.
  • Enable from Suspension: the service is defined as enabled (“enabled” is true) at the “serviceStatus” entity. The service will be able to get served from the SD&UM and its resources will get updated.
  • Enable: provides to the user the ability to enable an unregistered service.
  • Update: enables changes over a registered service. When a registered service gets updated, the Scheduler identifies all the required resources from the updated request and updates respectively the “SensorServiceRelation” entity. Moreover, an updated SPARQL script is formulated, based on the updated user request, and is stored, along with the updated user’s specific execution properties at the “ServiceDescription” entity. The service status shall also get updated accordingly at the “serviceStatus” entity

Registered Service Status: enables the user to retrieve the status of a specific service by providing the ServiceID. The Registered Service Status shall check the “serviceStatus” entity and send all the available information back to the user.

Service Update Resources: In a predefined (i.e. administrator controlled) time interval this service/functionality shall

  • check the enabled services from the “serviceDescription” entity and as a first step identify the ones that are using mobile sensors.
  • check if the mobile sensors fulfil the user’s request (e.g. in respect of a specific location). Note that:
    • in case the sensor fulfils the user’s request no further action is taken and
    • in case the sensor does not fulfil the user’s request this sensor is unrelated/removed from the specific service at the “sensorServiceRelation” entity
    • new sensors are searched that possibly fulfils the user’s request (e.g. in respect of a specific location),
  • if a new sensor is found it gets recorded at the “SensorServiceRelation” entity
  • if there are no sensors that fulfil the specific request the unsatisfied field shall get updated with “true” at the “serviceStatus” entity.

Get Service: is used to get the description of a registered service by accessing the “serviceDescription” entity.

Get the Available Services: provides the ability to a user to collect a list of registered services related with a specific user from the “serviceDescription” entity by providing the UserID.

Get User: is used by the OpenIoT platform’s access control mechanisms so as to retrieve a user’s information and restrictions for implementing data filtering and access rights mechanisms.

Note that for the user to be able to invoke the “Resource Discovery”, “Service User Management”, “Registered Service Status”, “Service Update Resources”, “Get Service”, “Get User” and “Get the Available Services” services, the user must first get logged-in to the system by authenticating with his/her ID. Moreover, the results provided to the user are prior filtered based on his/her account restrictions and the resources that are accessible based on his/her profile. The “user” and the “accessControl” entities, which are illustrated in following sections, provide the account restrictions data.

The Figure below illustrates the lifecycle of the IoT services within the OpenIoT system. The transitions between the different states occur on the basis of invocations to the Scheduler API.

State diagram of the OpenIoT Services Lifecycle within the Scheduler module

API Specifications

    <<interface>>
    SchedulerInterface
    ---
    discoverSensors (userID:String, longitude:double, latitude:double, radius:float): SensorTypes
    registerApp(osdSpec: OSDSpec): String
    unregisterApp(String applicationID): void
    updateApp(osdSpec: OSDSpec): void
    getApplication(applicationID: String): OAMO
    getService (serviceID: String): OSMO
    getAvailableAppIDs (userID: String): DescriptiveIDs
    getAvailableServiceIDs (applicationID: String): DescriptiveIDs
    getAvailableApps (userID: String): OSDSpec
    getUser (userID: String): OpenIotUser

The Table below Implemented Scheduler API

Service Name Input Output Info
discoverSensors String userID, double longitude, double latitude, float radius SensorTypes Used to help applications build a request by using existing sensor classes. Requires as input UserID in String format, the location longitude/ latitude and radius specifying an area of interest. Returns a SensorTypes object which includes all available sensors in the specified area with their metadata.
registerApp OSDSpec osdSpec String Used to register/submit the constructed service to the cloud. Requires as input the OpenIoT Service Description Specification (OSDS) which includes all the User’s preferences regarding the Service, request lifecycle and visualization preferences. It returns the constructed Application ID.
unregisterApp String applicationID void Used to unregister/delete a registered/running service. Requires as input the Application ID.
updateApp osdSpec: OSDSpec void Used to update a registered service. Requires as input an OSD Specification.
getService String serviceID OSMO Used to retrieve the description (OSMO) of an available service. Requires as input a Service ID.
getApplication String applicationID OAMO Used to retrieve the description (OAMO) of an available Application. Requires as input the Application ID
getAvailableAppIDs String userID DescriptiveIDs Used to retrieve the available applications (a list of applicationID/ServiceName/ServiceDescription triplet) already registered by a specific user. Requires as input a User ID.
getAvailableServiceIDs String serviceID DescriptiveIDs Used to retrieve the available services (a list of serviceID/ServiceName/ServiceDescription triplet) already registered by a specific user. Requires as input the Service ID.
getAvailableApps String userID OSDSpec Used to retrieve the services defined by a user. It returns an OpenIoT Service Description Specification. Requires as input a User ID.
getUser String userID OpenIotUser Used to retrieve user information for implementing access control mechanisms.

Objects

OSDSpec

OpenIoT Service Description Specification

OSDSpec Schema graph

[](Documentation/images/Objects/OSDSpec_Schema_graph.jpg)

OSDSpec Schema

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified" targetNamespace="urn:openiot:osdspec:xsd:1"
  xmlns:osd="urn:openiot:osdspec:xsd:1" xmlns:prt="http://www.w3.org/2007/SPARQL/protocol-types#">

  <xs:import namespace="http://www.w3.org/2007/SPARQL/protocol-types#"
    schemaLocation="sparql/protocol-types.xsd" />

  <xs:element name="OSDSpec">
    <xs:annotation>
      <xs:documentation>OpenIoT Service Description Specification
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="osd:OAMO" />
      </xs:sequence>
      <xs:attribute name="userID" use="required" type="xs:anyURI" />
    </xs:complexType>
  </xs:element>

  <xs:element name="OAMO">
    <xs:annotation>
      <xs:documentation>OpenIoT Application Model Object
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="osd:description" />
        <xs:element minOccurs="0" maxOccurs="1" ref="osd:graphMeta" />
        <xs:element maxOccurs="unbounded" ref="osd:OSMO" />
      </xs:sequence>
      <xs:attribute name="id" use="optional" type="xs:anyURI" />
      <xs:attribute name="name" type="xs:NCName" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="graphMeta" type="xs:string" />
  <xs:element name="description" type="xs:string" />

  <xs:element name="OSMO">
    <xs:annotation>
      <xs:documentation>OpenIoT Sensor Model Object</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="osd:description" />
        <xs:element ref="osd:queryControls" />
        <xs:element ref="osd:requestPresentation" />
        <xs:element ref="prt:query-request" />
        <xs:sequence>
          <xs:element maxOccurs="unbounded" minOccurs="0"
            ref="osd:dynamicAttrMaxValue" />
        </xs:sequence>
      </xs:sequence>
      <xs:attribute name="id" use="optional" type="xs:anyURI" />
      <xs:attribute name="name" type="xs:NCName" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="serviceID">
    <xs:complexType>
      <xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="serviceName">
    <xs:complexType>
      <xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="serviceDescription">
    <xs:complexType>
      <xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="queryControls">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="osd:QuerySchedule" />
        <xs:element name="trigger" type="xs:anyURI"
          minOccurs="0" />
        <xs:element name="initialRecordTime" type="xs:dateTime"
          minOccurs="0" />
        <xs:element name="reportIfEmpty" type="xs:boolean" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="QuerySchedule">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="second" type="xs:string" minOccurs="0" />
        <xs:element name="minute" type="xs:string" minOccurs="0" />
        <xs:element name="hour" type="xs:string" minOccurs="0" />
        <xs:element name="dayOfMonth" type="xs:string"
          minOccurs="0" />
        <xs:element name="month" type="xs:string" minOccurs="0" />
        <xs:element name="dayOfWeek" type="xs:string"
          minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="requestPresentation">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="osd:widget" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="widget">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="osd:presentationAttr" />
      </xs:sequence>
      <xs:attribute name="widgetID" use="required" type="xs:anyURI" />
    </xs:complexType>
  </xs:element>


  <xs:element name="presentationAttr">
    <xs:complexType>
      <xs:attribute name="name" use="required" type="xs:string" />
      <xs:attribute name="value" use="required" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="dynamicAttrMaxValue">
    <xs:annotation>
      <xs:documentation>Maximum/Area of Interest for the defined dynamic
        value
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:attribute name="name" use="required" type="xs:string" />
      <xs:attribute name="value" use="required" type="xs:string" />
    </xs:complexType>
</xs:element>
</xs:schema>
OSMO

OpenIoT Sensor Model Object

OSMO Schema graph

[](Documentation/images/Objects/OSMO_Schema_Graph.jpg)

The schema of OSMO is included in OSDSpec

SensorTypes

SensorTypes Schema graph

[](Documentation/images/Objects/SensorTypes_Schema_graph.jpg)

SensorTypes Schema

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified">

  <xs:element name="SensorTypes">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="SensorType" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="SensorType">
    <xs:complexType>
      <xs:sequence>
        <xs:sequence>
          <xs:element maxOccurs="unbounded" minOccurs="0"
            ref="CoreMetaData" />
        </xs:sequence>
        <xs:sequence>
          <xs:element maxOccurs="unbounded" minOccurs="0"
            ref="MeasurementCapability" />
        </xs:sequence>
      </xs:sequence>
      <xs:attribute name="name" type="xs:Name" />
      <xs:attribute name="id" type="xs:anyURI" />
    </xs:complexType>
  </xs:element>

  <xs:element name="CoreMetaData" nillable="false">
    <xs:complexType>
      <xs:attribute name="name" type="xs:anyURI" />
      <xs:attribute name="value" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="MeasurementCapability" nillable="false">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="1" ref="Unit" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:anyURI" use="optional" />
      <xs:attribute fixed="" name="type" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="Unit">
    <xs:complexType>
      <xs:attribute name="name" type="xs:string" />
      <xs:attribute name="type" type="xs:string" />
    </xs:complexType>
  </xs:element>
</xs:schema>

DescriptiveIDs

DescriptiveIDs Schema graph

[](Documentation/images/Objects/DescriptiveIDs_Schema_graph.jpg)

DescriptiveIDs Schema

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

  <xs:element name="DescreptiveIDs">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DescriptiveID" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
</xs:element>

  <xs:element name="DescriptiveID">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="description"
          type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="name"
          type="xs:NCName" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:anyURI" />
    </xs:complexType>
</xs:element>
</xs:schema>

Clone this wiki locally