Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Predix Asset Service depth analysis

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

preface

In the IIOT domain, we are faced with the challenge of preserving massive amounts of data. At the Asset level, we need to preserve physical objects, logical objects, complex relationships, and support the combination, classification, labeling and efficient query of objects. To sum up, it can be summarized as follows:

Flexible modeling style: support business objects in different business domains

Support custom attributes: can be simple strings, can also be objects

Support inter-object relationships: hierarchical or graph relationships

Support object combination: for example, motor consists of coil and rotor

Classification support: macro classification of objects and preservation of common attributes

Support tags: easy for users to query

Support flexible and high-performance queries: support queries for attributes, relationships, hierarchies, etc.

Operational history: operational logs and audits

Business Capability Extension: Script

architecture

The Predix architecture is as follows:

REST API layer

Client applications can obtain asset data through REST API services. These interfaces provide interfaces in JSON form that users can pass in POST form. To use these APIs, applications send HTTPS requests and parse responses. Parsing can be done using any web-side development language.

Representation layer

The Representation Layer converts data from JSON to an internal graph representation and vice versa.

Query engine

Query engine allows developers to use JSON AND Graph _Expression(GEL) to retrieve data for any object or object attribute stored in the Asset Data Store.

Audit History Service

Provides an API to get historical information about REST requests in the Asset Service repository.

Script engine

Enable users to bind custom business logic to Asset Service's REST API.

Cassandra graph database

Assert Service saves data in Apache Cassandra Nosql database

Data model asset

Asset models can be understood as a mapping of physical devices in the virtual world. Assets contain not only the devices themselves, but also information about how the devices are organized and associated.

classification

Classify assets and preserve their public information.

custom modeling object

Custom models for further description, e.g. manufacturer etc.

API CategoryDescriptionAssets Typically, we define an asset in a hierarchical structure, consisting of a parent asset and one or more child assets. We can associate an asset with a classification or any number of custom modeling objects. An Asset can contain any number of custom-defined attributes.

An asset can also exist independently of any other modeling element in the system. Classifications

It is organized in a tree structure and provides a means of grouping assets and tracking common attributes. A classification can refer to multiple assets. Attribute can be specified at any level of classification.

Custom modeling objects

Custom modeling objects are hierarchical and we can use them to provide more information for our asset. For example, we can create separate objects for asset location, manufacturer, etc. A location can be associated with multiple assets, and similarly, an asset can be associated with multiple locations.

model example

Fleets Sample JSON

{

"uri":"/fleets/up-1",

"name":"Union Pacific Fleet 1",

"customer":"/customers/union-pacific"

},

Manufacturers Sample JSON

{

"uri":"/manufacturers/GE",

"name":"General Electric Transportation",

"year_founded":"1892",

"hqLatLng":{

"lat":41.881138,

"lng":-87.640666}

}

Engines Sample Data

{

"uri":"/engines/v12-1",

"type":"7FDL",

"horsepower":"4400",

"stroke":"230",

"bore":"220",

"RPM":"2400",

"manufacturer":"/manufacturers/GE"

}

Locomotives Sample JSON

{

"uri":"/locomotives/1",

"type":"Diesel-electric",

"model":"ES44AC",

"serial_no":"001",

"emission_tier":"0+",

"fleet":"/fleets/up-1",

"manufacturer":"/manufacturers/GE",

"engine":"/engines/v12-1",

"installedOn":"01/12/2005",

"dateIso":"2005-12-01T13:15:31Z",

"hqLatLng":{

"lat":33.914605,

"lng":-117.253374

}

}

The above example shows how the model is organized.

storage analysis

Asset storage has two components to consider, json-schema and json. Json-schema is the validation standard for json, and any changes to the storage system require json-schema validation. Thinking more abstractly, json-schema is similar to object-oriented classes, while json is the implementation of classes: objects. Only this instantiation is triggered by the REST API, and legitimacy is guaranteed by the json-schema.

Because the industrial field needs to face a large number of objects, a large number of relationships and a variety of structured data objects (blob value,picture, log), etc., traditional SQL databases must not meet these requirements, and for JSON, the most suitable application key-value database type, of course, the database needs to provide good performance and scalability.

After recent years of development, Cassandra and hbase applications in different fields have diverged, hbase Ji Yu hadoop, support mapreduce, more suitable for big data computing scenarios; Cassandra in addition to range query performance lags behind hbase, in ease of use, scalability, robustness (no management node), and in most performance application scenarios there are advantages over hbase, so consider using Cassandra as asset storage.

Specifically, the use of Cassandra must meet the following requirements:

Good lateral scalability

good maintainability

high performance

Support for history storage

Ability to extend relational storage and query

scalability of

Predix provides Javascript language support for more custom applications.

JS support is a feature that comes with JDK, and Predix applies this feature to the REST API, enabling JS scripts to be run before and after the REST API is executed to extend functionality. The REST API can be either CRUD API for resources or custom API. The execution logic is: Start--->(JS code)--->REST API--->(JS code)--> System Notification

That is, JS code can be executed before and after REST API execution. If JS code is executed before REST API, it can be used for input data verification, etc. If JS code is executed after REST API execution, it can be used for notification sending, etc. To make JS code more flexible, JS code can reference defined tool methods (provided by Predix) or call other REST API interfaces.

JS code execution is essential for industrial cloud applications, such as SCADA systems and Thingwrox, which provide JS code execution capabilities. But Thingwrox's JS implementation depends on Thing itself (custom methods) and subscriptions, while Predix is based on encapsulation of existing REST APIs (of course, custom REST APIs are also supported). In general, Thingwrox implements functions that predix can also implement.

For example:

1. Call system methods (predix and thingwrox both provide system methods)

2. Call asset properties (either, thingwrox can be referenced in scripts via this.)

3. Call asset method (thingwrox ok, predix unknown)

4. invoke properties of other assets (predix via restapi query)

5. Call methods of other assets (can be implemented as long as they are exposed in REST API form)

6. Execution results returned (predix can return data via message queues)

Key Technology JSON-SCHEMA

http://json-schema.org/,

JSON-SCHEMA is a static JSON description that does not have any binding force and needs to be restricted in implementation: for example, SCHEMA must be verified when performing new operations.

CASSANDRA

CASSANDRA is a key-value database with high performance, high reliability, decentralization and support for GRAPH extensions.

http://www.cnblogs.com/loveis715/p/5299495.html

GEL

If data can only be stored and cannot be queried, it makes no sense. predix defines the GEL language for querying Asset data. The query language is flexible and supports pagination, filtering, regular expressions, and relational queries. Asset service is to store all model data, so it cannot be developed specifically for specific needs.

In Asset Service, there is a Graph Expression Lanauge Query Engine to complete this function, which is also necessary for industrial cloud platform development.

Industry comparison

Here is mainly compared with Thingwrox, Thingworx is an Internet of Things platform, and Predix is an industrial cloud platform, different positioning, determines the two platforms in the design of different trade-offs.

In terms of modeling comparison, Thingworx weakens the concept of multi-tenant and gives a Thing-ThingTemplate-ThingShape model based on class-object abstraction, capable of modeling each physical/logical entity. Such as a pump, or in terms of data source; Predix is more focused on mapping physical entities to deal with the industrial domain, and does not attempt to establish an all-inclusive modeling environment. This trade-off is understandable in the industrial domain.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 212

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report