AMTech – Observers and Reasoners

A description of Observers and Reasoners in the AMTech Platform.

Also see The Elevator Pitch, The 2 minute Overview, and Overview.  Additional notes are available here.

Rules, Observers and Reasoners

AMTech is a multi-tenant IOT platform targeting mostly Digital Asset Management applications including a gateway, a sensor network and a reasoning system.  The core action of the reasoning system is triggering and executing a rule.

Rules in AMTech are called Reasoners.  A Reasoner is defined through an Observer that operates on one or more Topics (think MQTT Topics) supplying events (called Observations) to generate a collection of entities (Thing and / or Observations) on which a sequence of Actions will operate.  Entities are connected through a standards-based Domain Application Protocol.

This note expands on some of the details of the rule system.

Assessing a Thing x Observation

Observers examine Things and Observations instances and assess whether they are suitable for consideration for the rule.

Picture1

There are several types of Observers depending on whether they consider a collection of Things, a collection of Things in the context of a given Observation, or an Observation.  In all cases, the Observer validates if the specific instances satisfy some given constraints, like whether a property has a given value, is set or unset, has a range, or how it compares to the value of the other entity (e.g. whether the Observation’s property has the same value as that of the Thing).

Types of Observers

Type 1 – Standard Observer

This observer operates on a collection of Things of a given Type, and on one or more Observation Topics of a given Type.  The observer examines an Observation and looks at the possible things, applies the conditions specified in the properties and generates a, possibly empty, sequence of [Observation x Thing] pair for that Observation.

Picture2

The set of Things to consider is all the Things visible based on the Access Information (User/Tenant), which at Reasoner definition time, is set to be either that of the Observation or the plain “anonymous” of the Service.

Reasoners can act on this sequence in one of 3 different ways: For Each, Once if Present, Once if Absent.  See further below.

Type 2 – Observer w/ TargetThings

This is a variation of Type 1, except that instead of considering any Thing (of the given Type), AMT only considers the Things that are mentioned in the Observation via the TargetThings machinery.  As in Type 1, the result is a, possibly empty, sequence of [Observation x Thing] pairs.

Picture3

Type 3 – Observation Filter

This observer only examines Observations; there are no Things involved.  The result is the same Observation, if it passes the conditions in the Observer, or nothing, if not.

Picture4

Type 4 – Thing Filter

This Observer is only used in the UI to help navigate through the set of Things available.  Typical use is to filter by tenant, by type, by location, or by user.  Its result is a set of Things.

Picture5

Reasoners on Things x Observations

The basic operation of a Reasoner is as below: it uses an Observer to get the possibly empty sequence of [Things x Observation] pairs (or Observations or Things), and then it checks on a condition (empty, non-empty) and invokes a sequence of Actions.

AMT needs some Access Information while performing all these operations, and, depending on the type of Reasoner, the Access Information may be that of the Service indicated in the GuestTenant property of the Activity / Service, or that of the Observation being considered.  There are 4 types of Observers:

  • For Each Thing returned by the Observer
  • Once Analyzing only Observations
  • Once in the presence of Things
  • Once in the Absence of Things

The first type can use either the Access Information of the Service or the Observation Information.  The other 3 can only use the Access Information of the Observation.

For Each Thing returned by the Observer

This Reasoner takes the sequence of [Observation x Thing] pairs delivered by the Observer (Type 1 or Type 2), and applies the Actions.  The Access Information can be configured to be either Service or Observation.  The Actions are CRUD on the Thing (not Replace), or Send Observation or Notification, Schedule Observation or Schedule Command (on the Thing).

Picture6

Once Analyzing only Observations

This Reasoner takes the Observation validated the Observer (Type 3), and applies the Actions.  The Access Information can only be configured to be Service.  The Actions are CRUD on a Thing (Only Create a new), or Send Observation or Notification, Schedule Observation.

Picture7

Once in the Absence of Things

This Reasoner takes the Observation validated the Observer (Type 1 or 2), and applies the Actions.  The Access Information can only be configured to be Service.  The Actions are CRUD on a Thing (Only Create a new), or Send Observation or Notification, Schedule Observation.

Picture8

Once in the Presence of Things

Very similar to the previous reasoner, this Reasoner takes the Observation validated the Observer (Type 3), and applies the Actions.  The Access Information can only be configured to be Service.  The Actions are CRUD on a Thing (Only Create a new), or Send Observation or Notification, Schedule Observation or Send a Command (to the Thing).

Picture9

Caveats

Some of the details of the platform can change as newer releases incorporate feedback from more deployements.

Advertisements

One thought on “AMTech – Observers and Reasoners

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s