Internet of Things, A Reference Architecture
December 7, 2014
We at BlueMetal have a great deal of experience in creating solutions that leveraged connected devices streaming millions of records to cloud hosted repositories, leveraging historical and predictive analytics engines to provide insight and creating immersive experiences that give our clients agility and speed in their daily business activities. Case in point…EnerNOC.
Using Lean Engineering a small team from BlueMetal was able to provide EnerNOC with an amazing user experience in 10 weeks. The application spans twenty four 55” high definition displays combining data streaming from over 35,000 devices around the globe connected to the energy grid with geo-political, social media, environmental and financial data creating a visually stunning global view of EnerNOC’s business domain that is visible to all employees and every visitor to their downtown Boston office.
While this solution was clearly focused on the energy sector, the effort produced a reference architecture for Internet of Things solutions that spans verticals. To prove out the viability of this reference architecture in other verticals, BlueMetal created a Pharmaceutical Trial Scenario and implemented a live reference implementation.
The Pharmaceutical Trial Scenario
The Pharmaceutical Trial Scenario involves patients in a home health care setting in New York, Boston and Chicago who are participating in a drug trial. The patients are connected to medical devices that measure glucose, heart rate, temperature and oxygen saturation as well as patient longitude and latitude for location. The devices use a wireless connection to send their data every 5 seconds to a cloud service that exposes REST API’s.
The data is collected in a repository that provides access via ODATA Atom Feeds. In order to provide a physician’s view onto this data, a custom microservice is provided that performs data transformation on the real time device data stream. The resulting information is delivered using Web Sockets to a physician’s dashboard providing real time updates in the UI without the physician having to interact directly with the display.
A BlueMetal we are practitioners of Lean Engineering, a product development process and methodology focused on delivering high quality software in an efficient, fast and reliable manner through automation and increasing release cycles.
The process starts with the definition of a minimal-viable-product, a.k.a. an MVP. An MVP is that version of a product that will allow a team to validate their ideas. They are purposefully minimally scoped in order that the product can be built quickly, placed into production and given to customers so that they can provide feedback. That cycle is referred to as the BUILD-MEASURE-LEARN cycle.
In the BUILD phase, the team develops the MVP using automation throughout the dev-build-test-staging-production pipeline. At BlueMetal we leverage cloud platforms as an enabler of this automation pipeline at high velocity. For the Pharma Trial we leveraged Azure as our cloud platform of choice.
The MEASURE phase is all about gathering usage and health statistics on the running application in production. In addition to instrumenting the code we place the application to an environment that will provide these insights. Our choice of Azure provides us the necessary usage and health analytics of our hosted Web Sites, Services and API’s.
The LEARNING phase is all about engaging customers and getting their feedback. We can leverage questionnaires, surveys and split testing as techniques to gather this information.
The Reference Architecture
Internet of Things at a very high level is not complicated. It all comes down to data…lots of data. By 2020 there will be hundreds of billions of devices connected to the internet and feeding exabytes of data to the cloud on a daily basis. It is the software that we create that will take that data and turn it into business insight.
The IoT reference architecture therefore is focused on options for dealing with the massive amount of data that comes streaming in from connected devices.
- Devices are connected to the network; either they are IP addressable or are communicating with a local IP addressable hub via Bluetooth.
- The device itself or the device hub is able to send messages over HTTP to an IoT service, a service that provides device registration, data collection and in some cases the ability to communicate back to the device. That may be appropriate if the device has a display visible to an end user or if the device needs to reset or updated.
- Once the data is collected in the IoT service data repository, you can leverage BI and map reduce services to provide historical analysis or machine learning services to provide predictive analytics.
- You can build custom consumption services that provide data transformation and aggregation capabilities.
- Finally you can present the information in custom applications or leverage visualization tools.
The Pharma Trial Connected Devices Architecture
The Pharma Trial Connected Devices architecture follows this reference architecture pattern. Several microprocessor boards located in Boston, Chicago and New York send 2.5M simulated patient vitals readings every 24 hours to Azure Intelligent System Service.
That stream of data is accessible through the patient vitals microservice which retrieves the most recent readings from the stream and transforms that data into ‘patient by geo’ or ‘vital by geo’ JSON arrays.
The SignalR Polling service calls the Patient Vitals REST API every few seconds and pushes those real time readings down to the Physician Dashboard which uses that data to animate maps and gauges.
Pharma Trial Connected Devices BluePrint
|Multiple BeagleBone Microprocessor boards running Linux OS providing patient readings. The C code leverages the Azure ISS C SDK and communicates to ISS over HTTP via the locally running ISS Agent.|
Azure Intelligent System Service
|The Microsoft Azure Intelligent Systems Service (ISS) allows you to securely connect, managing and capturing machine-generated data from a variety of sensors and devices. Devices register themselves and their message format. ISS provides the ability to both gather device messages (state and alarms) as well as send messages to device (events). ISS exposes device data as a set of OData feeds.|
Patient Vitals Microservice
|A custom Azure hosted ASP.NET WebAPI REST microservice that provides data transformation on the real time device message stream coming from Azure ISS. The service reads the Atom feed and provides access through two REST endpoints, a transformation to patient records organized by geo location or vitals organized by geo location.|
Azure API Management
|Azure API Management provides API Proxy services, security, developer registration and subscription, documentation, policy injection and analytics. The Patient Vitals Microservice is placed under API Management in order to provide developer registration & subscription and API usage and health analytics.|
ASP.NET SignalR Polling Service
|The ASP.NET SignalR Polling Process is a custom Azure hosted ASP.NET service that invokes the Patient Vitals Microservice on a timer to bring back the latest set of vitals information. It also sets up a WebSockets connection to the browser based Dashboard and is able to push these updates to the client without user interaction.|
|The Physicians Dashboard is an Azure hosted ASP.NET Angular/D3 web site that provides interactive maps of Boston, New York and Chicago showing patients and vitals information. The patient and vital information is updated in real time and as a result the UI animates as the data arrives.|
Patient Vitals Microservice and Azure API Management
It is important that we gain insight into the individual API calls, system health, bandwidth usage and ratio of successful to unsuccessful calls in our distributed system. Azure API Management provides us a view into the runtime environment for our patient vital microservice.
Azure API Management provides an Administrator Dashboard and a Developer Portal. The Administrator Dashboard provides a summary view of API analytics by default.
API Management Administrators Dashboard
Drilling into the Vitals by City API definition we see a summary view of the number of calls, bandwidth and response times. The operations tab is where we can enter the details of API signature and define the parameters. Filling out these forms provides detailed documentation of the API as well.
|Vitals by City Summary Admin Page||Vitals by City Operations Admin Page|
Azure API Management also provides a Developer Portal. Developers can register and if provided access can ask to subscribe to API’s, get access to auto generated source code samples and use the IO Docs console to execute the API and see the results.
|API Developer Portal||Vitals by City Documentation and Code Samples|
|Vitals by City IO Docs Console||JSON results from API invocation|
The Physician’s Dashboard
The last component of our IoT Reference Implementation is the Physicians Dashboard. The UI presented here is the result of our first iteration through the Lean Engineering process, a minimal-viable-product that demonstrates how the stream of real time patient data coming from the remote devices can be interpreted visually in order to gain insight.
Three maps, Boston, New York and Chicago, are displayed and patients are over laid using the geo location information. They are color coded depending on how much data is coming from that patient. The glucose, hear rate, temperature and oxygen saturation data is aggregated and averaged for all patients and for each city location and the changing values drive the animation for the slides and the donut chart.
Today there are over 2 billion PCs and 7 billion mobile devices deployed around the globe. By 2020 there will be over 250 Billion connected devices. Every industry will have a need to create software solutions to deal with the exabytes of data that will come streaming in from these devices.
If you are interested in learning more about Lean Engineering and Internet of Things, please contact me. You can also download our IoT Offering and contact BlueMetal:
Managing Director of Sales
|In New York