字段 |
类型 |
描述 |
id |
uuid |
设备编号 |
created_time |
bigint |
创建时间 |
additional_info |
varchar |
额外信息 |
customer_id |
uuid |
客户id |
type |
varchar(255) |
类型 |
name |
varchar(255) |
名称 |
label |
varchar(255) |
标签 |
search_text |
varchar(255) |
搜素关键字 |
tenant_id |
uuid |
租户编号 |
id |
created_time |
additional_info |
customer_id |
type |
name |
label |
search_text |
tenant_id |
84818cf0-fe46-11ea-8587-91857935e717 |
1600938941247 |
{“gateway”:false,”description”:”测试设备A - 空调”} |
13814000-1dd2-11b2-8080-808080808080 |
test |
测试设备A |
air conditioner |
测试设备a |
e102f1b0-fcb8-11ea-82f8-9b35f0369853 |
bb348a90-fe46-11ea-8587-91857935e717 |
1600939033017 |
{“gateway”:false,”description”:”测试设备B - 空调”} |
13814000-1dd2-11b2-8080-808080808080 |
test |
测试设备B |
air conditioner |
测试设备b |
e102f1b0-fcb8-11ea-82f8-9b35f0369853 |
CREATE TABLE IF NOT EXISTS device (
id uuid NOT NULL CONSTRAINT device_pkey PRIMARY KEY,
created_time bigint NOT NULL,
additional_info varchar,
customer_id uuid,
type varchar(255),
name varchar(255),
label varchar(255),
search_text varchar(255),
tenant_id uuid,
CONSTRAINT device_name_unq_key UNIQUE (tenant_id, name)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
id |
uuid |
编号 |
created_time |
bigint |
创建时间 |
credentials_id |
varchar |
认证令牌编号 |
credentials_type |
varchar(255) |
认证令牌类型 |
credentials_value |
varchar |
认证令牌值 |
device_id |
uuid |
设备编号 |
id |
created_time |
credentials_id |
credentials_type |
credentials_value |
device_id |
8499a8d0-fe46-11ea-8587-91857935e717 |
1600938941405 |
wBUv3DVP15v857dg8De5 |
ACCESS_TOKEN |
|
84818cf0-fe46-11ea-8587-91857935e717 |
bb3b4150-fe46-11ea-8587-91857935e717 |
1600939033061 |
x4aAaXU0dIkE8jR9ANus |
ACCESS_TOKEN |
|
bb348a90-fe46-11ea-8587-91857935e717 |
CREATE TABLE IF NOT EXISTS device_credentials (
id uuid NOT NULL CONSTRAINT device_credentials_pkey PRIMARY KEY,
created_time bigint NOT NULL,
credentials_id varchar,
credentials_type varchar(255),
credentials_value varchar,
device_id uuid,
CONSTRAINT device_credentials_id_unq_key UNIQUE (credentials_id),
CONSTRAINT device_credentials_device_id_unq_key UNIQUE (device_id)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
key |
varchar(255) |
遥测数据键名称 |
key_id |
serial |
遥测数据键编号 |
key |
key_id |
totalMsgs |
1 |
successfulMsgs |
2 |
failedMsgs |
3 |
tmpFailed |
4 |
tmpTimeout |
5 |
timeoutMsgs |
6 |
key1 |
7 |
key2 |
8 |
CREATE TABLE IF NOT EXISTS ts_kv_dictionary
(
key varchar(255) NOT NULL,
key_id serial UNIQUE,
CONSTRAINT ts_key_id_pkey PRIMARY KEY (key)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
entity_id |
uuid |
实体编号 |
key |
int |
遥测数据键编号 |
ts |
bigint |
遥测Unix时间 |
bool_v |
boolean |
布尔值 |
str_v |
varchar(10000000) |
字符串 |
long_v |
bigint |
长整型数值 |
dbl_v |
double |
浮点型数值 |
json_v |
json |
json类型数值 |
entity_id |
key |
ts |
bool_v |
str_v |
long_v |
dbl_v |
json_v |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
7 |
1602208438113 |
|
value1 |
|
|
|
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
8 |
1602208438113 |
|
value2 |
|
|
CREATE TABLE IF NOT EXISTS ts_kv
(
entity_id uuid NOT NULL,
key int NOT NULL,
ts bigint NOT NULL,
bool_v boolean,
str_v varchar(10000000),
long_v bigint,
dbl_v double precision,
json_v json,
CONSTRAINT ts_kv_pkey PRIMARY KEY (entity_id, key, ts)
) PARTITION BY RANGE (ts);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
entity_id |
uuid |
实体编号 |
key |
int |
遥测数据键编号 |
ts |
bigint |
遥测Unix时间 |
bool_v |
boolean |
布尔值 |
str_v |
varchar(10000000) |
字符串 |
long_v |
bigint |
长整型数值 |
dbl_v |
double |
浮点型数值 |
json_v |
json |
json类型数值 |
entity_id |
key |
ts |
bool_v |
str_v |
long_v |
dbl_v |
json_v |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
7 |
1602208438113 |
|
value1 |
|
|
|
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
8 |
1602208438113 |
|
value2 |
|
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
1 |
1602209098199 |
|
|
1 |
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
6 |
1602209098199 |
|
|
0 |
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
5 |
1602209098199 |
|
|
0 |
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
2 |
1602209098199 |
|
|
1 |
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
4 |
1602209098199 |
|
|
0 |
|
|
7a1b0210-09d0-11eb-b4d3-bd0dad4ce224 |
3 |
1602209098199 |
|
|
0 |
|
CREATE TABLE IF NOT EXISTS ts_kv_latest
(
entity_id uuid NOT NULL,
key int NOT NULL,
ts bigint NOT NULL,
bool_v boolean,
str_v varchar(10000000),
long_v bigint,
dbl_v double precision,
json_v json,
CONSTRAINT ts_kv_latest_pkey PRIMARY KEY (entity_id, key)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
entity_type |
varchar(255) |
实体类型 |
entity_id |
uuid |
实体编号 |
attribute_type |
varchar(255) |
属性类型 |
attribute_key |
varchar(255) |
属性键名称 |
bool_v |
boolean |
布尔值 |
str_v |
varchar(10000000) |
字符串 |
long_v |
bigint |
长整型数值 |
dbl_v |
double |
浮点型数值 |
json_v |
json |
json类型数值 |
last_update_ts |
bigint |
最新更新时间戳 |
entity_type |
entity_id |
attribute_type |
attribute_key |
bool_v |
str_v |
long_v |
dbl_v |
json_v |
last_update_ts |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
CLIENT_SCOPE |
attribute1 |
|
value1 |
|
|
|
1602207938654 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
CLIENT_SCOPE |
attribute3 |
|
|
|
42.0 |
|
1602207938654 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
CLIENT_SCOPE |
attribute4 |
|
|
73 |
|
|
1602207938654 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
CLIENT_SCOPE |
attribute5 |
|
|
|
|
{“someNumber”:42,”someArray”:[1,2,3],”someNestedObject”:{“key”:”value”}} |
1602207938654 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
CLIENT_SCOPE |
attribute2 |
true |
|
|
|
|
1602207938654 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
SERVER_SCOPE |
lastActivityTime |
|
|
1602208438125 |
|
|
1602208438158 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
SERVER_SCOPE |
inactivityAlarmTime |
|
|
1602209086297 |
|
|
1602209086305 |
DEVICE |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
SERVER_SCOPE |
active |
false |
|
|
|
|
1602209086307 |
CREATE TABLE IF NOT EXISTS attribute_kv (
entity_type varchar(255),
entity_id uuid,
attribute_type varchar(255),
attribute_key varchar(255),
bool_v boolean,
str_v varchar(10000000),
long_v bigint,
dbl_v double precision,
json_v json,
last_update_ts bigint,
CONSTRAINT attribute_kv_pkey PRIMARY KEY (entity_type, entity_id, attribute_type, attribute_key)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
id |
uuid |
资产编号 |
created_time |
bigint |
创建时间戳 |
additional_info |
varchar |
额外信息 |
customer_id |
uuid |
顾客编号 |
name |
varchar(255) |
名称 |
label |
varchar(255) |
标签 |
search_text |
varchar(255) |
搜索关键字 |
tenant_id |
uuid |
租户编号 |
type |
varchar(255) |
类型 |
id |
created_time |
additional_info |
customer_id |
name |
label |
search_text |
tenant_id |
type |
fbdd3c40-09db-11eb-be0c-ffc759c3351b |
1602212599300 |
{“description”:”智慧大楼-测试”} |
13814000-1dd2-11b2-8080-808080808080 |
智慧大楼 |
building |
智慧大楼 |
e8fdc2c0-008f-11eb-b578-a96e41c6df33 |
building |
CREATE TABLE IF NOT EXISTS asset (
id uuid NOT NULL CONSTRAINT asset_pkey PRIMARY KEY,
created_time bigint NOT NULL,
additional_info varchar,
customer_id uuid,
name varchar(255),
label varchar(255),
search_text varchar(255),
tenant_id uuid,
type varchar(255),
CONSTRAINT asset_name_unq_key UNIQUE (tenant_id, name)
);Copy to clipboardErrorCopied
字段 |
类型 |
描述 |
id |
uuid |
实体视图编号 |
created_time |
bigint |
创建时间戳 |
entity_id |
uuid |
实体编号 |
entity_type |
varchar(255) |
实体类型 |
tenant_id |
uuid |
租户编号 |
customer_id |
uuid |
顾客编号 |
type |
varchar(255) |
类型 |
name |
varchar(255) |
名称 |
keys |
varchar(10000000) |
关联设备属性/遥测关键字等集合 |
start_ts |
bigint |
开始时间时间戳 |
end_ts |
bigint |
结束时间时间戳 |
search_text |
varchar(255) |
搜索关键字 |
additional_info |
varchar |
额外信息 |
id |
created_time |
entity_id |
entity_type |
tenant_id |
customer_id |
type |
name |
keys |
start_ts |
end_ts |
search_text |
additional_info |
a6289f60-09db-11eb-be0c-ffc759c3351b |
1602212455510 |
95a6b470-09d0-11eb-b4d3-bd0dad4ce224 |
DEVICE |
e8fdc2c0-008f-11eb-b578-a96e41c6df33 |
13814000-1dd2-11b2-8080-808080808080 |
test |
测试实体视图 |
{“timeseries”:[“key1”,”key2”],”attributes”:{“cs”:[“attribute1”,”attribute2”],”ss”:[“active”],”sh”:[“attribute3”]}} |
1602212340000 |
1602385140000 |
测试实体视图 |
{“description”:”实体视图测试”} |
CREATE TABLE IF NOT EXISTS entity_view (
id uuid NOT NULL CONSTRAINT entity_view_pkey PRIMARY KEY,
created_time bigint NOT NULL,
entity_id uuid,
entity_type varchar(255),
tenant_id uuid,
customer_id uuid,
type varchar(255),
name varchar(255),
keys varchar(10000000),
start_ts bigint,
end_ts bigint,
search_text varchar(255),
additional_info varchar
);Copy to clipboardErrorCopied