Saturday, June 11, 2016

IoT Use case WSO2

In this blog, I thought of discussing kind of an interesting use case which involves communicating and managing alerts though the concept IoT (Internet Of Things)

The use case which I'm describing involve WSO2 middleware stack, before that lets try to understand use case first.

Story
 A organization called 'Amber Shopping complex' who is well reputed organization doing clothing business. Then recently their management decided to enhance the client experience and planning to bring more user friendly environment when a buyer enters in to the shop complex. So the concept is 'Amber' publish advertisement on TV, News Papers asking to download newly developed mobile application. Since 'Amber' is so  popular, all most all its buyer have download the mobile application.
     Then, once users movies different parts of the shopping complex, the mobile device sending the notification to the 'Amber Shopping IT genius', so what will be happening after that you will be amazed.
  • Client going to buy shirts (which he has already search through mobile device), he received alters from to the mobile application asking his choices, and new arrivals to the store.
  • Client walking pass TV display guess what, the  TV display suddenly personalizing and start to show what he has preferred in the past and choices available and locations (Digital Signage)
  • Client go to different section "let say" kid toys section, client received alerts to his mobile devices, the new toys arrived and prices
 ... and many more other cool stuff...
 Let assume how we can achieve above use case, to accomplish this use case we are using
WSO2 Iot Server , WSO2 CEP, WSO2 MB, WSO2 ESB,WSO2 APIM,WSO2 DAS

I know most of you may already aware others products other than WSO2 Iot server (which of cause yet to be released officially by WSO2), so let me give you a small introduction what WSO2 Iot Server (which is still at Alpha state), if anyone interest they could join to the beta program.

What is IoT server ?

"WSO2 IoT Server (IoTS) is the core of WSO2's Open IoT Platform. It provides the capabilities required by device manufacturers and enterprises to build a complete IoT architecture around their connected device offering. Device manufactures are able to manage the device architecture from the server-side using WSO2 IoTS, extend the IoTS to any device type, and support other protocols and data formats as it runs on top of WSO2 Connected Device Management Framework (WSO2 CDMF).
WSO2 IoTS offers customizable and advanced IoT device analytics via WSO2 Data Analytics Server that include predictive analytics using machine learning capabilities. It also supports edge computing devices, policy-based edge analytics, and pre-built instant visualization for sensor readings using live data streams gathered from devices.
Take a look at the WSO2 IoT Server presentation on Your foundation for the Internet of things to expand your knowledge on IoTS. This is a great place for you to start if you are new to WSO2 IoTS."




If you need more information please visit [1]

Now lets try to see how we could overcome the given use case, please see the below diagram which show complete interaction or solution architecture, that can be implemented to overcome the given use case.

Solution Architectural View




Following diagram illustrating the complete interaction from device registration and alerting model would work

Flow



What we need to understand here is the role which WSO2 Iot server plays, i.e how it interacts with different modules to complete the user interaction, specially we have to isolate use experience for that, it is must that have to maintain a device in which client use along side with some other information.

On the other hand, the for intercommunication,such as mobile devices to message broker we thought of using mqtt protocal (pub/sub)

Why we need MQTT? ref [2]
MQTT was developed by Andy Stanford-Clark (IBM) and Arlen Nipper (Eurotech; now Cirrus Link) in 1999 for the monitoring of an oil pipeline through the desert. The goals were to have a protocol, which is bandwidth-efficient and uses little battery power, because the devices were connected via satellite link and this was extremely expensive at that time.
The protocol uses a publish/subscribe architecture in contrast to HTTP with its request/response paradigm.Publish/Subscribe is event-driven and enables messages to be pushed to clients. The central communication point is the MQTT broker, it is in charge of dispatching all messages between the senders and the rightful receivers. Each client that publishes a message to the broker, includes a topic into the message. The topic is the routing information for the broker. Each client that wants to receive messages subscribes to a certain topic and the broker delivers all messages with the matching topic to the client. Therefore the clients don’t have to know each other, they only communicate over the topic. This architecture enables highly scalable solutions without dependencies between the data producers and the data consumers.
CEP role
CEP (Complex event processor) plays equally important role in this design with its real time analysis capability while alerting other sub modules such as if client move one place to another, mobile device publishes GPS detail and CEP engine keep analyzing them and sends alerts to ESB, where it interact with other sub-modules. (please read [3] for more information)

Finally
If you need to write such requirement from the sketch, it would require a thousand lines of codes may be much more complicated interaction between system. But with above of cause with minimal effort you can simply build the integration layer.




[1]https://docs.wso2.com/display/IoTS100/WSO2+IoT+Server
[2] http://www.hivemq.com/blog/how-to-get-started-with-mqtt 
[3] http://wso2.com/library/blog-post/2013/11/understanding-complex-event-processing-(cep)-operators-with-wso2-cep-(siddhi)/

1 comment:

  1. A very useful blog post and I'm extremely interested in the above use case which has lots of potentials in retail sector. I would appreciate if you can give more in-depth walkthrough on this use case in IoT prospective.

    ReplyDelete