GRC
HR
SCM
CRM
BI
Expand +


Article

 

Exploring the IoT Services Offering within SAP HCP

by James Wood, Founder and Principal Consultant, Bowdark Consulting

December 7, 2015

Learn how the Internet of Things (IoT) Services offering within SAP HANA Cloud Platform (SAP HCP) allows users to rapidly develop IoT scenarios.

 

Though it’s emerged as one of the more trendy buzzwords in the IT space, the Internet of Things (IoT) is, in many ways, nothing really new. For many years, computer scientists have inherently known that it’s technically possible to connect various devices or sensors to a network and use the incoming data to create new business scenarios. Indeed, some organizations even went so far as to implement these kinds of solutions, though these isolated cases were highly specialized and usually proprietary in nature. In recent years, however, this trend has started to change. The two main driving factors behind this are:

  • The cost of these peripheral devices or sensors has dropped considerably.
  • As a byproduct of lower costs, the number of these devices (“things”) has proliferated to a point that a recent Gartner study suggests that there might be as many as 6.4 billion of these things by 2016. 

With both these factors in play, there’s no denying that IoT is a real thing. Recognizing the inevitable, many IT organizations are now trying to figure out their IoT strategies. This is a difficult task for a variety of reasons – many of which extend beyond the normal IT purview.

Within the scope of this article, I focus my attention on developing a foundation for IoT development with SAP HCP and its IoT Services.

Introducing SAP HCP and the HCP Service Model

Before I dive into the particulars of SAP HCP and IoT Services, it’s helpful to put this offering into perspective. As you may know, SAP HCP is a platform-as-a-service (PaaS) offering that sits at the center of SAP’s cloud strategy. Like most PaaS offerings, SAP HCP provides a platform companies can use to develop and deploy various types of web applications. These applications can be built using Java, native SAP HANA, or HTML5-based technologies.

(Note: Since SAP HCP has the term HANA in the name, it’s widely assumed that there’s a hard requirement for SAP HANA when implementing HCP-based solutions. However, as it turns out, this is not really the case. As a PaaS, SAP HCP certainly offers access to SAP HANA-based technology, but it’s not strictly required. Companies have alternatives selecting their persistence strategy when building HCP-based solutions (e.g., SAP MaxDB –a lighter, traditional relational database management system [RDBMS]). Furthermore, there are no requirements to have SAP HANA on premise to use SAP HCP.)

In addition to the core application containers, SAP HCP also provides a number of cloud services that can be consumed from cloud applications. These services make it easier for developers to implement persistence, connect to external or on-premise systems, and so forth. In the past couple of years, the SAP HCP service offering has expanded from core services to include more specialized services. For example, the SAP HCP Mobile Services (HCPms) stack simplifies the development of mobile applications on the platform. Similarly, SAP HCP provides all the tools that companies need to develop enterprise-quality business sites such as customer or supplier portals.

Depending on their application scenarios, companies can mix and match these services to create new and innovative web applications on the platform. For example, a company might use the Connectivity Service to obtain some data from an on-premise SAP Business Suite system, expose this data via an SAPUI5- or Fiori-like application, and then use HCPms to wrap this application up as a mobile application for end-user consumption. The possibilities are endless.

Getting back to the topic at hand, in the next section I focus my attention in particular on the IoT service stack. This service offering provides all the tools that you need to implement IoT scenarios.

What Do IoT Services Bring to the Table?

When you get right down to it, IoT is all about collecting data. Whether this data is coming from machines, sensors, or even the refrigerator downstairs, the point is that you’ve got a lot of useful information that you want to collect and eventually do something productive with. Since the types of devices in play are myriad, it’s basically impossible for software vendors to provide a comprehensive end-to-end IoT solution. Instead, vendors have focused on providing a framework or foundation for building these solutions. Within the SAP ecosystem, this foundation is provided by SAP HCP IoT Services.

In a nutshell, IoT Services help to streamline two important aspects of an IoT scenario: device management and message management. Companies can define and register various types of devices and then define the relevant channels for taking input of incoming sensor data. With this foundation in place, all that’s left is for users to figure out how to connect their devices to the Message Management Service (MMS). The entry barriers are small as all that’s really required is an HTTP connection to transmit the data. At the device level, companies have the freedom to develop their messaging clients using the programming language of their choice: Python, Java, C, or whatever.

Once the data’s uploaded to the MMS, the messages are available for consumption within SAP HCP as a whole. This implies that companies have various options for doing productive things with the incoming sensor data. Just a few possible examples include:

  • Developing analytics apps using SAP HANA-based technology and SAPUI5 Fiori-like screens
  • Developing apps to mine the data and leverage the aforementioned Connectivity Service to trigger actions or events in a downstream on-premise SAP Business Suite system (or even a non-SAP system). For example, if a company collects sensor data from pieces of equipment, a possible action would be to create a maintenance order in the on-premise SAP ERP system
  • Using functionality in the HCPms to create push notifications to alert key stakeholders of certain events on their mobile devices

As you can see, getting sensor data into the fold is the hard part; once the data’s in place, it’s pretty much business as usual from an enterprise IT perspective.

Understanding How to Consume IoT Services

To better demonstrate how the IoT Services work, it helps to take a closer look at the setup procedure so that you can see how the various elements fit together. This process starts within the main SAP HCP Cockpit screen. From the Services tab, you can access Internet of Things Services via the correspondingly named tile as highlighted in Figure 1.


Figure 1
The Services tile

From the IoT Services landing page (not shown), click the Go to Service link to navigate to the IoT Services Cockpit screen (Figure 2). When establishing a new IoT scenario, you first need to configure the sensor device types. This can be achieved by clicking the Device Types tile.


Figure 2
Click the Device Types tile

Within the Device Types console (Figure 3), you can create a new device type by clicking the add icon (the plus sign) and entering a name for the sensor in the Name field. Note that the name you provide is not any kind of official name for the device. Rather, it’s a logical name that is used to register the device and collate incoming messages. After you enter a name, click the Create button.


Figure 3
Defining a new device type

Once a device type is created, the next step is to define the types of messages that will be exchanged between the device and the MMS. This step is performed in the Message Types console in Figure 4. To reach this screen click the Message Types tile shown in Figure 2. As a new message type is created (by clicking the Add Field button with the + icon on it), it’s linked to a device type and assigned a direction.

You have the option of determining if the message will be coming from the device, sent from MMS to the device, or sent back and forth in bidirectional fashion. After these basic parameters are set, the attributes of the message body can be defined in the Fields table in the lower portion of the screen.

For instance, in the example shown in Figure 4, I’m defining attributes to represent environmental conditions such as the ambient temperature and light sensitivity. Since these are both numeric values, I assigned the double type to the attributes. Of course, depending on the type of data you’re reading, you might have additional/different attributes with different data types. In any case, once the attributes are set, you lick the Create button to confirm the creation of the new message type.


Figure 4
Define a custom message type

The last step in the configuration process is to register the actual devices that you want to connect to the MMS. This step takes place in the Devices console (Figure 5). To reach this screen click the Devices tile in Figure 2. As you can see in Figure 5, there’s not much to this process – you simply enter a name for your device in the Name field and associate it with a device type. Click the Create button after you enter your data.


Figure 5
Register the device

After the device is registered, a prompt indicates that the device was registered and that there was a corresponding OAuth token generated for it (Figure 6). This highlights a compelling feature of IoT Services: built-in integration with the SAP HCP’s OAuth provider. I explain this concept in further detail a little bit later on when I touch on IoT security.


Figure 6
A token is generated

With the relevant configuration settings in place, all that’s left is to build the messaging clients down at the device level. As noted earlier, this can be accomplished using any HTTP client since the MMS API is built using simple Representational State Transfer (RESTful) services. Clients bundle up the sensor data and trigger the API call with the relevant device or message IDs and OAuth access token. For more details about this process, read the SAP HANA Cloud Platform Documentation available online at https://help.hana.ondemand.com/iot/frameset.htm.

Understanding the Benefits of Using SAP HCP and IoT Services

Since most sensor devices are tiny and have limited computing power, it’s a natural response to assume that it doesn’t take much to set up some kind of server-side agent to collect incoming messages. Indeed, on some level, you can build IoT scenarios using a web server and a lightweight database. To bring things closer to the SAP world, you can use a spare SAP NetWeaver system you might have lying around. The problem with these kinds of homegrown approaches is that they don’t really scale very well.

To put this into perspective, consider some of the challenges you might face when developing an IoT scenario within your organization.

Security

Since enterprise IoT scenarios typically involve sensitive business data, security is a huge concern when it comes to IoT. As a result, the security requirements can build up in a hurry – so much so that it will likely require much more than what’s available out of the box with a standalone web server. Typical questions that are raised include:

  • How will we authenticate the devices?
  • Against which identity provider (IdP)?
  • What about network-level security? Encryption?
  • How do we defend against attacks such as a man(device)-in-the-middle attack?
Accessibility

The deployed devices or sensors may frequently exist outside the corporate firewall. For example, a utilities provider may want to collect sensor data from sensors installed on equipment out in the field. In these scenarios, it can be a challenge to figure out how to bring the data securely into the fold.

Dealing with High Message Volumes

Certain sensor types may need to send numerous tiny messages frequently to maintain a heartbeat. If many of these sensor types are deployed, the incoming message traffic can be considerable and must be throttled accordingly. When the data is mission critical, you can’t afford to allow messages to fall on the floor.

Integration

Ultimately, the goal with most IoT scenarios is to use the incoming data to accomplish some sort of business objective. In many cases, this implies that you need to collect and combine the incoming data with other business data to make informed decisions or to carry out relevant actions. Therefore, it’s important for the infrastructure you use to be able to integrate with other systems (either in the cloud, on premise, or perhaps both).

Weighing the Requirements

When you look at these requirements and start weighing all the setup, infrastructure, and development required to deliver on them, you can start to see the value proposition with SAP HCP and IoT Services. Indeed, if you go up and down the list of requirements above, you can see how complementary services within the SAP HCP service portfolio make it easy to handle even the most complex of requirements.

For example, when dealing with security, you have at your disposal all the security-related services and libraries built into SAP HCP. As I noted earlier, SAP HCP supplies its own OAuth provider, so support for an OAuth 2.0 Client Credentials Grant is there by default. All incoming communication to SAP HCP is encrypted using Transport Layer Security (TLS) so no special setup is required. Further options are beyond the scope of this article, but just be aware that a wide array of security options are available when you are rolling out IoT scenarios using IoT Services.

In terms of accessibility, since SAP HCP is hosted in the public Internet, devices or sensors can access it from anywhere. Once the data is collected, it can be securely relayed down to the on-premise landscape using the SAP HANA Cloud Connector component highlighted in Figure 7


Figure 7
SAP HANA Cloud Connector with Simple Mail Transfer Protocol (SMTP), Post Office Protocol 3 (POP3), and Internet Message Access Protocol (IMAP)

Rather than having to punch a hole in the corporate firewall, companies can simply deploy the Cloud Connector component to establish a Secure Sockets Layer (SSL) virtual private network (VPN) tunnel from the on-premise landscape to their cloud account tenants. After this tunnel is in place, SAP HCP developers can leverage the Connectivity Service to securely invoke Remote Function Call (RFC) or BAPI functions and RESTful or OData services hosted on an on-premise SAP Business Suite system. For bulk operations, the SAP HANA Cloud Integration (HCI) service can be used to transmit the sensor data en masse.

Finally, it’s worth noting that the MMS offering is more than just a dumb message receiver. Internally, a lot of functionality is in place to help you sort and process messages or batch messages together to improve throughput. When you combine these features with the option of storing the data in SAP HANA, it means that IoT Services can meet the demands of large-scale IoT scenarios.

Outlook

I hope this article helped you to understand the general positioning and value proposition of the SAP HCP and IoT Services stack. SAP has pledged to continue to expand on its SAP HCP service offering, providing companies with even more options for implementing IoT scenarios. Recent examples of this include the release of SAP Cloud for Analytics and SAP HANA Vora. These additions should make it easier to process and make sense of sensor data.

Furthermore, as more business services come on board (such as the Customer Relationship Management [CRM] or sales-related services introduced with SAP hybris-as-a-Service), companies will be able to tap into those services to develop IoT scenarios, too.

An email has been sent to:





 

James Wood

James Wood is the founder and principal consultant of Bowdark Consulting, Inc., an SAP NetWeaver consulting and training organization. With more than 10 years of experience as a software engineer, James specializes in custom development in the areas of ABAP Objects, Java/J2EE, SAP NetWeaver Process Integration, and SAP NetWeaver Portal. Before starting Bowdark Consulting, Inc. in 2006, James was an SAP NetWeaver consultant for SAP America, Inc., and IBM Corporation, where he was involved in multiple SAP implementations. He holds a master’s degree in software engineering from Texas Tech University. He is also the author of Object-Oriented Programming with ABAP Objects (SAP PRESS, 2009), ABAP Cookbook (SAP PRESS, 2010), and SAP NetWeaver Process Integration: A Developer’s Guide (Bowdark Press, 2011). James is also a contributor to Advancing Your ABAP Skills, an anthology that holds a collection of articles published in SAP Professional Journal and BI Expert.



More from SAPinsider



COMMENTS

Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!


SAPinsider
FAQ