Focus of Status Report 02

This article shows how we prepared the machine data, how we decided to attach the data package to the tangle and which technology stack we chose. Check Status Report 01 to see the PoC’s architecture.

Data package specification

For this PoC we have only selected a set of data which we can quickly measure. This has enabled us to work through all task packages relatively efficiently. For a productive scenario, it is certainly necessary to question which data is needed and which data is to be used. With the completion of this PoC, however, this is only a development decision and no longer a technological hurdle.

Data set

Nevertheless, we have tried to choose practical data. Our data package thus contains measured process data as well as metadata. The metadata includes a unique ID (type: integer) which is determined by digital image processing from the component surface and a generated hash (work in progress, not yet stable) and the material name (type: string) according to the international standard of the material used. Other metadata such as the name of the product, the name of the machine operator, the name of the manufacturer or the customer, etc. are conceivable at this point. In addition, real machine data has been measured. This includes the maximum punch force (type: float, unit: kN) of the ram, which is the reaction force resulting from the cutting contour and the material, and the punch stroke (type: float, unit: mm). Since the material properties and sheet thickness are not constant from part to part due to material fluctuations, the punch force and punch stroke differ each time. The die roll (type: float, unit: mm) is currently estimated on the basis of existing analytical models, as we still have to work on the measurement technology. The timestamp (type: unsigned integer) is calculated using the UNIX timestamp and describes the time of production, not the time of upload.

Exemplary raw data set file

The final data package looks like the following lines. It is divided into three parts: Firstly, public key and signature hash of the data package, secondly the MAM channel to the Tangle, thirdly the data itself. The file format chosen is JSON.

# Data set

[

{

"pubKey": "-----PUBLIC KEY-----",

"sign": "3fe...930"

},

{

"mamAddr": "9QJ...TMX",

"sidekey": "BTE...FEP",

"root": "ABC...9QW" },

{

"id": "1c06b4ab6c7d3cdff34a2960",

"material": "X210CrW12",

"punch_force": 2492.5676,

"punch_stroke": 15.2656,

"die_roll": 2.5865,

"timestamp": 1407390451216

} ]

The machine to MAM channel mapping takes place in our backend. This decouples the machine from IOTA as carrier medium. As such the backend contains a mapping of machine identification to the corresponding MAM channel address. For each machine identification only one MAM channel exists.

Data preparation

Data preparation is mainly about data signing. We do not want to store the data itself on the Tangle, neither should it be freely accessible for anyone. Thus, it needs to be signed. As hashing algorithm we chose SHA-2-256, because we want to hash huge amounts of data in an efficent way and SHA-1 has proven weaknesses. Additionally, we decided to go with RSA and PKCS 1.5 respectively as public-key encryption technology because of the huge support and easy-to-use online validators of this signature.

# Sign Data

def sign_data (self,

PrivPublKeys = "YourKeys.json",

DataToBeHashed = "YourData.json",

DataPackageHashed = "YourHashedData.json"

)

The signed data provides a signature string that can be later verified with the real data and the on-Tangle stored signature. Hence we are able to identify corrupted or tempered data.

How to store our data packages

We decided to use AWS due to the fact that there are already existing, open source implementations of PoW for AWS Lambda which in turn simplifies the realization of this PoC. Our data is stored in a DynamoDB to deal with the huge amount of data for every workpiece in upcoming modifications of our PoC. In the future, every workpiece should generate only one MAM transaction on-Tangle and the data itself will be stored off-Tangle.