Top Banner
Creating Industrial Middleware with Java ME and Single-Board Computers September 2016
41

Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Apr 15, 2017

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Creating Industrial Middleware with Java ME and Single-Board ComputersSeptember 2016

Page 2: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

2Copyright © 2016 Accenture All rights reserved.

About Us

Senior Technology Architect

Accenture

Global Java Community Lead

Twitter: @_deors

GitHub: deors

Technology Architect

Accenture

Global Java Community Champion

Twitter: @restalion

GitHub: restalion

Page 3: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 3

Related Sessions in Java One 2016

Monday, Sep 19 Tuesday, Sep 20 Wednesday, Sep 21

Introduction to Java ME 8 [CON3189]

Java ME and Single-Board Computers for Creating Industrial Middleware [CON3187]

All Your Faces Belong to Us: Building an Open Face Recognition Platform [CON6217]

12:30 p.m. - 1:30 p.m 2:30 p.m. - 3:30 p.m 3:00 p.m. - 4:00 p.m

Hilton - Golden Gate 6/7/8

Hilton - Golden Gate 6/7/8

Hilton - Golden Gate 6/7/8

Kevin HookeJulio Palma

Jorge HidalgoJulio Palma

Jorge HidalgoMariano Rodriguez

Page 4: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 4

The Environment• We can find a lot of different machines, sensors, alerts, … into an industrial environment.

• Every single machine has usually a mechanism that allow us to know its state (visual or sound signals, communication ports, …)

• Operator has to decide the action to be executed (call maintenance team, restart the machine, do a little maintenance, …).

• Most of times reason why machine is not productive enough is simply lost, plants has not the information, it is lost or dispersed into some operator’s minds.

Problem description

Page 5: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 5

This is a global challenge

Problem description

Page 6: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 6

The plants• Each plant has different characteristics:

– Equipment

– Processes

– Legal requirements

• Easy to find old factories working together with new ones.

• Information from plants is not structured.

– And we need to show all this information structured to be useful.

Problem description

Page 7: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 7

Problem descriptionDecision centers are also global

Page 8: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 8

Problem descriptionDecision centers are also global

Page 9: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 9

Problem descriptionDecision centers are also global

Page 10: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 10

Management systems• Enterprises have management systems as complex as production line.

– Standard ERPs (such as SAP)

– Custom applications

• Our goal is retrieve all this information and create a model that let us make better decisions.

– Which plants are more productive?

– Which ones work better together?

– Anticipate needs for raw materials

• We need a way to retrieve information:

– Without errors

– Automatically (no human intervention)

– Real-time

Problem description

Page 11: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 11

High-level diagram

Solution description

Page 12: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 12

High-level diagram

Solution description

Machines. We can’t touch!

Page 13: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 13

High-level diagram

Solution description

Machines. We can’t touch!

Board of directors.We can’t touch!

Page 14: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 14

High-level diagram

Solution description

Machines. We can’t touch!

Board of directors.We can’t touch!Covered by ERP

Page 15: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 15

High-level diagram

Solution description

Machines. We can’t touch!

Board of directors.We can’t touch!Covered by ERP

This is our domain

Page 16: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 16

Our approach

• The idea is create customizable translation middleware:

– Reads output signals from machines.

– Send translated information to ERP.

Solution description

Machine 1

Machine 2

Machine 3

Translation Middleware

Translation Middleware

Translation Middleware

ERP

Page 17: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 17

Topology

Solution description

Robot Simulator

Translation Middleware

Robot Simulator

Translation Middleware

Receiver Microservice

ERP Simulation

Receiver Microservice

Receiver Microservice

MongoDBMongoDBMongoDB

Page 18: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 18

Schema• Java ME application.

• Running in a Raspberry Pi.

• Simulate different types of machines without the actual machine.

• Created for testing purposes.

• Communication with Translation Middleware via GPIO.

Robot Simulator

Robot Simulator Midlet

Robot Controller

Translation Middleware

Page 19: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 19

Timeline• For this sample demo we’ll only manage five signals:

– Input signals:

• Start/Stop button

• Error button

– Output signals:

• Machine downtime

• Machine running

• Machine error

Robot Simulator

Machine running

Machine error

Machine down

Robot Simulator

Tim

elin

e

Wor

king

Hou

rs

Page 20: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 20

UML Diagram

• Only four classes are needed to simulate our simplified robot.

• Two helper classes are created to simplify LEDs and buttons management.

Robot Simulator

Page 21: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 21

Schematic• Two input signals:

– One connected to GPIO 17 for ON/OFF events

– One connected to GPIO 22 for ERROR events

• Three output signals:

– ON signal on GPIO 24

– OFF signal on GPIO 23

– ERROR signal on GPIO 25

Robot Simulator

Page 22: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 22

Schema• Java ME application.

• Running in a Raspberry Pi.

• Translates the signals from Machine-specific to Receiver input messages

• Communication with Robot Simulator via GPIO.

• Communication with Receiver Microservice via REST interface.

Translation Middleware

MachineMiddleware Midlet

MachineMiddleware Controller

Robot Simulator

Receiver Microservice

Page 23: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 23

Timeline• For each signal from machine we create a new event.

• We add metadata information to the event:

– Machine ID

– Event timestamp.

• Status is not maintained in middleware. We receive signals, enrich and translate them to message that ERP can receive and understand.

Translation Middleware

Machine running

Machine error

Machine down

Robot Simulator

Translation Middleware

ON event

ERROR event

OFF event

Tim

elin

e

Wor

king

Hou

rs

Page 24: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 24

UML Diagram

• Only four classes are needed to simulate our simplified robot.

• Two helper classes are created to simplify LEDs and buttons management.

Translation Middleware

Page 25: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 25

Configuration

• You can customize your input pins, device name and REST service URL.

Translation Middleware

Page 26: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 26

Schematic• Three input signals:

– ON Signal in port 22

– OFF Signal in port 18

– ERROR Signal in port 24

Translation Middleware

Page 27: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 27

Schema• It’s role is translate from Events to data that ERP can understand.

• Spring Boot application running into a Docker cotainer.

• In our sample project it stores data into a MongoDB database

• Exposes a REST interface to retrieve events and send intervals information to ERP application.

Receiver Microservice

Spring Boot REST Services

Spring Data MongoDB

MongoDB

Page 28: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 28

Timeline• Events sent by middleware are stored into database.

• Microservice returns information translated into intervals.

• Can receive events from different sources (Machines, Apps, …) through its REST interface.

Receiver Microservice

Machine running

Machine error

Machine down

Robot Simulator

Translation Middleware

ON event

ERROR event

OFF event

ReceiverMicroservice

Tim

elin

e

ON interval

ERROR interval

Wor

king

Hou

rs

Page 29: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 29

UML Diagram

• Only four classes are needed to simulate our simplified robot.

• Two helper classes are created to simplify LEDs and buttons management.

Receiver Microservice

Page 30: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 30

Events• Events stores information of each signal from machines.

• They are a direct representation of information itself.

Receiver Microservice

Page 31: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 31

Intervals• Intervals are the same information but in the format expected by ERP.

• Intervals are information processed to be visualized.

Receiver Microservice

Page 32: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 32

Testing

• We can run a little test using JaSON Chrome extension.

– Launch a new event.

Receiver Microservice

Page 33: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 33

Testing

• We can run a little test using JaSon Chrome extension.

– Launch a new event.

Receiver Microservice

Page 34: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 34

Schema• There are a lot of difirent ERPs

– Custom

– SAP, …

• We need some program that let us create friendly reports.

• For our sample we’ve created a very simple application that shows an activity timeline.

ERP Simulator

Receiver

Vaadin App

RESTEasy

Page 35: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 35

Timeline• Receiver Microservice returns information as intervals.

• ERP Simulator shows an activity table.

• Filter options are available.

• Application autorefresh information.

ERP Simulator

Machine running

Machine error

Machine down

Robot Simulator

Translation Middleware

ON event

ERROR event

OFF event

ReceiverMicroservice

Tim

elin

e

ON interval

ERROR interval

ERP Simulator

Wor

king

Hou

rs

Page 36: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 36

UML Diagram

• We can easily view the activity of machines:

– Filtered by source (machine) and date

– In different dates.

ERP Simulator

Page 37: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 37

View

• We can easily view the activity of machines:

– Filtered by source (machine) and date

– In different dates.

ERP Simulator

Page 38: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 38

Demo

Page 39: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 39

• Modern single board computers are powerful enough to run different roles into a full solution.

• Combination of availability, affordability, power compsumtion… make them a best choice for real solutions.

• Java ME provides us a powerful set of tools that allow us to:

– Capture data from phisical devices.

– Send data to other systems.

• Fine-grained architectures let us create powerful and flexible solutions.

• Combination of Java ME and Microservices take our solutions to the next level:

– One single language: Java!

– Comunications via GPIO and REST Services

– Containerized microservices

Conclusions

Page 40: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved. 40

Questions

Page 41: Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers

Copyright © 2016 Accenture All rights reserved.

• https://github.com/restalion/middleware-solution

References

41