WISE-PaaS/SRP Services
Contents
Overview
- API Management
Adopt Azure API Management/Open-source (WSO2) to integrate various SRP services API.
- Common Service APIs/Lib
Basic Account/Device/Group/Role operation APIs, including Add/Edit/Delete/Search/Advance Search WISE-PaaS administration information (Product Support, version, capability…etc.)
- Custom/SRP Service
RMM/IMM/OTA/SCADA self-service APIs
- Common Data Workers
Including device basic information and sensor data from broker. (Common MQTT Topic) For structure info (device Info) store into PostgreSQL For non-structure (sensor Info) store into MongoDB/DocumentDB/...etc.
- Custom/SRP Data Workers
Process RMM/IMM/OTA/SCADA self-MQTT topic message and store into self-database (RMM/IMM/OTASCADA DB)
- Message Broker (RabbitMQ)
Adopt RabbitMQ as default cluster broker, and plugin MQTT as communication protocol.
- Device Agent
Define common MQTT topic handshake message and custom/SRP topic format.
- Database (SQL/NoSQL)
PostgreSQL as default relation database and including Common/RMM /SCADA/IMM/etc. MongoDB/DoucmentDB for sensor information collect.
Common Database Scheme
Concept & Design Rules
- Device belong to multi-groups or not to any group.
- Each account have non or multi-groups.
- Each group must belong to someone account.
- Group of group (1-3 Levels)
- Each account must belong to someone role.
Common Database Scheme
Common Database Table Details
Table Account
Column | |||
---|---|---|---|
|
aid |
bigserial |
Primary Key, Account Id |
|
rid |
bigint |
Reference Key, Role Id |
|
name |
text |
Unique Key, Account Name |
|
fullName |
text |
Account Full Name |
|
firstName |
text |
Account First Name |
|
lastName |
text |
Account Last Name |
|
|
text |
Unique Key, Account E-mail |
|
password |
text |
Account Password |
|
loginTS |
timestamp |
Account Last Login Timestamp |
|
createTS |
timestamp |
Account Create Timestamp |
Indexes | |||
Pk |
PK_ACCOUNT_AID |
ON aid |
|
U |
UNI_ACCOUNT_MAIL |
ON mail |
|
U |
UNI_ACCOUNT_NAME |
ON name |
|
Foreign Keys | |||
|
FK_ACCOUNT_RID |
( rid ) ref role (rid) |
Table Role
Columns | |||
---|---|---|---|
|
rid |
bigserial |
Primary Key, Role Id |
|
name |
text |
Unique Key, Role Name |
|
createTS |
timestamp |
Role Create Timestamp |
Indexes | |||
Pk |
PK_ROLE_RID |
ON rid |
|
U |
UNI_ROLE_NAME |
ON name |
Table Group
Columns | |||
---|---|---|---|
|
gid |
bigserial |
Primary Key, Group Id |
|
name |
text |
Group Name |
|
desc |
text DEFAULT ::text |
Group Description |
|
did |
bigint |
Reference Key, For Device Id |
|
aid |
bigint |
Reference Key, For Account Id |
|
parentGid |
bigint |
Parent Group Id (Reserved) |
|
createTS |
timestamp |
Group Create Timestamp |
Indexes | |||
Pk |
PK_GROUP_GID |
ON gid |
|
Foreign Keys | |||
|
FK_GROUP_AID |
( aid ) ref account (aid) |
|
|
FK_GROUP_DID |
( did ) ref device (did) |
|
|
FK_GROUP_PARENTGID |
( parentGid ) ref group (gid) |
|
Table Device
Columns | |||
---|---|---|---|
|
did |
bigserial |
Primary Key, Device Id |
|
agentId |
text |
AgentId, UUID Format |
|
name |
text |
Device Name |
|
isConnected |
bool DEFAULT false |
Device Connect State |
|
coordinates |
text DEFAULT '25.069439,121.582485'::text |
GPS Coordinates, latitude andlongitude |
|
loginTS |
timestamp |
Device Last Login Timestamp |
|
createTS |
timestamp |
Devie Create Timestamp |
Indexes | |||
Pk |
PK_DEVICE_DID |
ON did |