德闻数据API文档
德闻数据API url http://api.devindata.com
物性系统 PPE ¶
物性系统相关api接口 /physicalProperties
物质所有物性 ¶
获取物质所有物性GET/physicalProperties/:material
Example URI
- temperature
number(required)温度
- pressure
number(required)压力
/physicalProperties/water?temperature=310&pressure=90200Body
{
status: "ok",
msg:"ok",
data: {
material: "water",
temperature: 310,
pressure:90,
properties: {
Gruneisen: {
cn: "格林奈森参数",
en: "Gruneisen parameter",
unit: "[-]",
value: 0.2790619840501854
},
...
}
}
}400Body
{
error : "temperature and pressure query parameters are required"
}400Body
{
error : "Input value is out of bound"
}400Body
{
error : "Chemical name not recognized"
}500Body
{
error : "Internal Server Error"
}物质单独物性 ¶
获取物质单独物性范围GET/physicalProperties/:material/:property
Example URI
- temperature
object(required)温度范围 格式: {“gte”:[number], “lte”:[number], “offset”:[number]}
- pressure
object(required)压力范围 格式: {“gte”:[number], “lte”:[number], “offset”:[number]}
/physicalProperties/water/rho?temperature={"gte":300,"lte":310,"offset":1}&pressure={"gte":80,"lte":90,"offset":1}200Body
{
status: "ok",
msg:"ok",
data: {
material: "water",
temperature: {
gte:80,
lte:90,
offset:1
},
pressure:{
gte:80,
lte:90,
offset:1
},
property: {
info: {
name: "rho"
en:"Gas density",
cn:"气密度",
unit: "[kg/m³]",
}
value: [
{
"pressure": 80,
"rho": 1029.6709103756798,
"temperature": 300
},
...
]
}
}
}400Body
{
error : "temperature and pressure query parameters are required"
}400Body
{
error : "Input value is out of bound"
}400Body
{
error : "Chemical name not recognized"
}500Body
{
error : "Internal Server Error"
}反应器 Reactor ¶
反应器相关的api接口 /reactor
上传数据 ¶
上传数据POST/reactor/import/:dataType
Example URI
- dataType
string(required)上传数据内容类型 选项 [data | details]
200Headers
Content-Type: application/jsonBody
{
status: "ok",
msg:"ok",
data:{
"msg":"data import done"
}
}500Headers
Content-Type: application/jsonBody
{
error : "Internal Server Error"
}日常检测数据 ¶
获取日常检测数据GET/reactor/daily
Example URI
- date
string(required)单独日期字符串,获取单日记录时输入, 例如 “2020-05-01”
- start
string(required)开始日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- end
string(required)结束日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- fields
string(optional)数据项,可以有多项 例如 “&fileds=catalyst&fileds=decompression”
- page
number(optional)页号
- perPage
number(optional)每页数据个数
- equipments
string(required)单独获取设备的日常检测数据,可输入all
获取日常记录数据 /reactor/daily?start=2020-05-01&end=2020-05-11&fields=catalyst&fields=decompression&page=1&perPage=10200Headers
Content-Type: application/jsonBody
{
status: "ok",
msg:"ok",
page: 1,
perPage: 10,
data: [
{
"_id": "5eddae1bf071e19f0ae9abd9",
"catalyst": {
"A+": 3165.38,
"B+": 2203.85
},
"date": "2020-05-01 00:00:00",
"decompression": {
"desulfurizationTowerA": null,
"desulfurizationTowerB": null,
"turbulentTower": null
}
},
...
]
}500Body
{
error : "Internal Server Error"
}获取单日记录 /reactor/daily?date=2020-05-01&equipments=desulfurizationTowerA200Headers
Content-Type: application/jsonBody
{
status: "ok",
msg:"ok",
"date": "2020-05-01",
"desulfurizationTowerA": {//脱硫塔A
"hydrogenSulfide_intake" : 3666.92,//硫化氢入口量
"hydrogenSulfide_outtake" : 2718.89,//硫化氢出口量
"hydrogenSulfide_disposal":236.89,//硫化氢处理量
"solutionTemperature":34,//溶液温度
"gasIntakePressure":7.2,//进气压力
"gasOuttakePressure":5.7,//出口压力
"decompression":5.7,//压降
"circulation":23.5,//循环量
"before_desulfurization_specificGravity":1.34,//脱硫前比重
"after_desulfurization_specificGravity":1.24,//脱硫后比重
"before_desulfurization_PH":9.8,//脱硫前PH值
"after_desulfurization_PH":8.9,//脱硫后PH值
},
"desulfurizationTowerB": {//脱硫塔B
"hydrogenSulfide_intake" : 3666.92,//硫化氢入口量
"hydrogenSulfide_outtake" : 2718.89,//硫化氢出口量
"hydrogenSulfide_disposal":236.89,//硫化氢处理量
"solutionTemperature":34,//溶液温度
"gasIntakePressure":7.2,//进气压力
"gasOuttakePressure":5.7,//出口压力
"decompression":5.7,//压降
"circulation":23.5,//循环量
"before_desulfurization_specificGravity":1.24,//脱硫前比重
"after_desulfurization_specificGravity":1.14,//脱硫后比重
"before_desulfurization_PH":9.8,//脱硫前PH值
"after_desulfurization_PH":8.9,//脱硫后PH值
},
"turbulentTower":{//湍球塔
"hydrogenSulfide_disposal":236.89,//硫化氢处理量
"solutionTemperature":34,//溶液温度
"gasIntakePressure":7.2,//进气压力
"gasOuttakePressure":5.7,//出口压力
"decompression":5.7,//压降
"circulation":23.5,//循环量
},
"regenerationTowerA":{//再生塔A
"regenerationAir":1890,//再生空气量
},
"regenerationTowerB":{//再生塔B
"regenerationAir":1890,//再生空气量
},
"regenerationTowerC":{//再生塔C
"regenerationAir":1890,//再生空气量
}
}获取一段时间记录 /reactor/daily?start=2020-05-01&end=2020-05-31&fields=decompression&equipments=desulfurizationTowerA200Body
//压降数据 fields=decompression,需要三组数据分别是进口压力,出口压力,压降
{
"equipName":"desulfurizationTowerA",//设备名称
"date":["2020-05-01","2020-05-02",...],//日期列表
"decompression":{
"in":[5.6,4.5,...],//进口压力列表
"out":[5.6,4.5,...],//出口压力列表
"des":[0.4,0.6,...],//压降列表
}
Response 200
//压降数据 fields=decompression,需要三组数据分别是进口压力,出口压力,压降
{
"equipName":"desulfurizationTowerA",//设备名称
"date":["2020-05-01","2020-05-02",...],//日期列表
"decompression":{
"in":[5.6,4.5,...],//进口压力列表
"out":[5.6,4.5,...],//出口压力列表
"des":[0.4,0.6,...],//压降列表
}
}
=================================================================================
//硫化氢数据 fields=hydrogenSulfide,需要三组数据分别是进口硫化氢量,出口硫化氢量,硫化氢处理量
{
"equipName":"desulfurizationTowerA",//设备名称
"date":["2020-05-01","2020-05-02",...],//日期列表
"hydrogenSulfide":{
"in":[5.6,4.5,...],//进口硫化氢量列表
"out":[5.6,4.5,...],//出口硫化氢量列表
"des":[0.4,0.6,...],//硫化氢处理量列表
]
}
=================================================================================
//两组数据的:都是需要脱硫前的数据和脱硫后的数据
//1、溶液PH值 fields=pH,
//2、含铁量 fields=iron,
//3、电位 fields=potential,
//4、比重 fields=specificGravity,
//5、TDS fields=TDS,
{
"equipName":"desulfurizationTowerA",//设备名称
"date":["2020-05-01","2020-05-02",...],//日期列表
"{field}":[
"in":[35.6,43.5,...],//脱硫前数据列表
"out":[35.6,43.5,...],//脱硫后数据列表
]
}
=================================================================================
//只有一组数据的:
//1、溶液温度数据 fields=solutionTemperature,
//2、循环量数据 fields=circulation,
//3、再生空气量数据 fields=regenerationAir,
{
"equipName":"desulfurizationTowerA",//设备名称
"date":["2020-05-01","2020-05-02",...],//日期列表
"{field}":
[35.6,43.5,...],//数据列表
}煤气压降记录 ¶
获取煤气压降记录GET/reactor/depressure
Example URI
- date
string(required)单独日期字符串,获取单日记录时输入, 例如 “2020-05-01”
- start
string(required)开始日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- end
string(required)结束日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- fields
string(optional)数据项,可以有多项 例如 “&fileds=catalyst&fileds=decompression”
- page
number(optional)页号
- perPage
number(optional)每页数据个数
/reactor/depressure?start=2020-05-01&end=2020-05-11&&fields=desulfurizationTowerA0-25KPa&page=1&perPage=10200Body
{
status: "ok",
msg:"ok",
page: 1,
perPage: 10,
data: [
{
"_id": "5eddae1bf071e19f0ae9abd9",
"date": "2020-05-01 00:00:00",
"_id": "5eddae2ef071e19f0ae9abfc",
"date": "2020-05-05 02:00:00",
"desulfurizationTowerA0-25KPa": 6.02235
},
...
]
}500Body
{
error : "Internal Server Error"
}分析数据 ¶
获取分析数据GET/reactor/analysis
Example URI
- date
string(required)单独日期字符串,获取单日记录时输入, 例如 “2020-05-01”
- start
string(required)开始日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- end
string(required)结束日期字符串, 获取多日记录时输入, 例如 “2020-05-01”
- fields
string(optional)数据项,可以有多项 例如 “&fileds=catalyst&fileds=decompression”
- page
number(optional)页号
- perPage
number(optional)每页数据个数
/reactor/depressure?start=2020-05-01&end=2020-05-11&&fields=CO%25&page=1&perPage=10200Body
{
status: "ok",
msg:"ok",
page: 1,
perPage: 10,
data: [
{
"_id": "5eddae1bf071e19f0ae9abd9",
"date": "2020-05-01 00:00:00",
"_id": "5eddae2ef071e19f0ae9abfc",
"date": "2020-05-05 02:00:00",
"CO%": null,
},
...
]
}500Body
{
error : "Internal Server Error"
}设备数据 ¶
获取设备数据GET/reactor/equipments
Example URI
- page
number(optional)页号
- perPage
number(optional)每页数据个数
- id
string(optional)设备id
- name
string(optional)- constructionUnit
string(optional)- total
string(optional)- storageLocation
string(optional)- safekeepingUnit
string(optional)- custodian
string(optional)- purchaseDate
string(optional)- startDate
string(optional)- status
string(optional)- price
string(optional)
添加设备数据POST/reactor/equipments
Example URI
Body
{
"name" : "湍球塔水封槽",//设备名称
"specification" : [ //设备规格的第一种格式,设备规格共有两种存储结构
{
"itemName" : "直径",
"value" : "1000",
"unit" : "mm"
},
{
"itemName" : "容积",
"value" : "6.3",
"unit" : "m³"
},
{
"itemName" : "工作温度",
"value" : "25~40",
"unit" : "℃"
},
...
],
"type" : "",//设备型号
"manufacturing_no" : "1204020000",//制造编号
"manufacturer" : "内蒙古隆升安装公司",//制造厂商
"construction_unit" : "内蒙古隆升安装公司",//施工单位
"unit" : "台",//单位
"total" : 1,//数量
"storage_location" : "脱硫工段",//存放地点
"safekeeping_unit" : "化产车间",//保管单位
"custodian" : "段玉海",//保管负责人
"purchase_date" : "2013-06",//购置日期
"start_date" : "2013-07",//开始使用日期
"status" : "良好",//使用状态
"price" : 0//购置价格
}更新设备数据PUT/reactor/equipments
Example URI
Body
{
"_id" : ObjectId("5eecdcd2a9fd52de8daa4dbe"),
"name" : "湍球塔水封槽",//设备名称
"specification" : [ //设备规格的第一种格式,设备规格共有两种存储结构
{
"itemName" : "直径",
"value" : "1000",
"unit" : "mm"
},
{
"itemName" : "容积",
"value" : "6.3",
"unit" : "m³"
},
{
"itemName" : "工作温度",
"value" : "25~40",
"unit" : "℃"
},
...
],
"type" : "",//设备型号
"manufacturing_no" : "1204020000",//制造编号
"manufacturer" : "内蒙古隆升安装公司",//制造厂商
"construction_unit" : "内蒙古隆升安装公司",//施工单位
"unit" : "台",//单位
"total" : 1,//数量
"storage_location" : "脱硫工段",//存放地点
"safekeeping_unit" : "化产车间",//保管单位
"custodian" : "段玉海",//保管负责人
"purchase_date" : "2013-06",//购置日期
"start_date" : "2013-07",//开始使用日期
"status" : "良好",//使用状态
"price" : 0//购置价格
}删除设备数据DELETE/reactor/equipments
Example URI
- id
string(required)设备id
/equipments?id={id}200Body
{
"status": "ok",
"msg": "ok",
"response": {response},
}生产统计 ¶
获取生产统计数据GET/reactor/products/:product
Example URI
- product
string(required)产品类型,可选类型[coalInput|coalWashing|methanol|coalFormula]
- date
string(required)单独日期字符串,获取单日统计数据时输入, 例如 “2020-12-15”
- year
string(required)年份, 获取多日记录时输入, 例如 “2020”
- month
string(required)月份, 获取多日记录时输入, 例如 “12”
/products/coalInput?date=2019-12-15200Body
{
"data": {
"date": "2019-12-15 00:00:00",
"入洗量": {
"年累计": 1096375.41,
"日累计": 0,
"月累计": 31989.41
},
"进煤量": {
"年累计": 996505.25,
"日累计": 0,
"月累计": 7365.25
}
},
"msg": "ok",
"status": "ok"
}/products/coalInput?year=2019&month=12200Body
{
"data": {
"date": [...],
"入洗量": [...],
"进煤量": [...]
},
"msg": "ok",
"status": "ok"
}销售统计 ¶
获取销售数据GET/reactor/sales
Example URI
- date
string(required)单独日期字符串,获取单日统计数据时输入, 例如 “2020-12-15”
- year
string(required)年份, 获取多日记录时输入, 例如 “2020”
- month
string(required)月份, 获取多日记录时输入, 例如 “12”
/sales?date=2019-12-15200Body
{
"msg": "ok",
"data": {
"date": "2019-12-15 00:00:00",
"焦油": {
"年累计": 35485.5,
"日累计": 58.05,
"月累计": 1228.5
},
"焦炭": {
"地销": {
"10-25mm": {
"年累计": 15149.2,
"日累计": 0,
"月累计": 0
},
"10mm以下": {
"年累计": 46682.69999999998,
"日累计": 118.15,
"月累计": 6665.7
},
"25-40mm": {
"年累计": 0,
"日累计": 0,
"月累计": 0
},
"40-80mm": {
"年累计": 582498.8199999998,
"日累计": 0,
"月累计": 23980.370000000003
}
},
"铁运": {
"40-80mm": {
"年累计": 0,
"日累计": 0,
"月累计": 0
}
}
},
"甲醇": {
"年累计": 112638.99999999997,
"日累计": 653.85,
"月累计": 5383.7
},
"硫铵": {
"年累计": 19038.950000000004,
"日累计": 0,
"月累计": 1013.3500000000001
},
"粗苯": {
"年累计": 9349.45,
"日累计": 0,
"月累计": 209.85
},
"精煤、混煤": {
"地销": {
"中煤": {
"年累计": 157853.39999999997,
"日累计": 241,
"月累计": 3795.4
},
"煤泥": {
"年累计": 70509.79999999999,
"日累计": 508.95,
"月累计": 2180.9
},
"精煤": {
"年累计": 0,
"日累计": 0,
"月累计": 0
}
},
"铁运": {
"口岸精煤": {
"年累计": 0,
"日累计": 0,
"月累计": 0
},
"精煤": {
"年累计": 374051.96,
"日累计": 0,
"月累计": 17080.960000000003
}
}
}
}
"status": "ok"
}/sales?year=2019&month=12200Body
{
"msg": "ok",
"data": {
"date": [...],
"焦油": [...],
"焦炭": {
"地销": {
"10-25mm": [...],
"10mm以下": [...],
"25-40mm": [...],
"40-80mm": [...]
},
"铁运": {
"40-80mm": [...]
}
},
"甲醇": [...],
"硫铵": [...],
"粗苯": [...],
"精煤、混煤": {
"地销": {
"中煤": [...],
"煤泥": [...],
"精煤": [...]
},
"铁运": {
"口岸精煤": [...],
"精煤": [...]
}
}
},
"status": "ok"
}导出数据 ¶
生成报告或繁表POST/reactor/export/:docType
发送导出数据请求,服务器会创建工作流,并返回工作流id, 工作流结束后可以通过id请求工作流结果来获取报告, 请查看工作流
Example URI
- docType
string(required)导出数据格式,[report|xlsx], report 生成报告, xlsx 生成繁表
- date
string(optional)可选, 单独日期字符串,生成单日报告时输入, 例如 “2020-05-01”
- start
string(required)开始日期字符串, 生成多日报告或繁表时输入, 例如 “2020-05-01”
- end
string(required)结束日期字符串, 生成多日报告时或繁表输入, 例如 “2020-05-01”
生成单日报告 /reactor/export/report?date=2019-08-01200Body
{
"msg": "ok",
"response": {
"job": {
"Name": "generator-report-f6qfw",
"Namespace": "argo",
"Parameters": {
"end-date": "",
"file-name": "2019-08-01_脱硫系统报告.pdf",
"single-date": "2019-08-01",
"start-date": ""
},
"ServiceAccount": "default",
"Status": "Pending"
},
"msg": "create job successed"
},
"status": "ok"
}生成多日报告 /reactor/export/report?start=2019-08-01&end=2019-08-30200Body
{
"msg": "ok",
"response": {
"job": {
"Name": "generator-report-6dnrv",
"Namespace": "argo",
"Parameters": {
"end-date": "2019-08-30",
"file-name": "2019-08-01_2019-08-30_脱硫系统报告.pdf",
"single-date": "",
"start-date": "2019-08-01"
},
"ServiceAccount": "default",
"Status": "Pending"
},
"msg": "create job successed"
},
"status": "ok"
}生成繁表 /reactor/export/xlsx?start=2019-12-01&end=2019-12-02200Body
{
"msg": "ok",
"response": {
"job": {
"Name": "generator-xlsx-4rgcd",
"Namespace": "argo",
"Parameters": {
"end-date": "2019-12-02",
"file-name": "2019-12-01_2019-12-02繁表.xls",
"start-date": "2019-12-01"
},
"ServiceAccount": "default",
"Status": "Pending"
},
"msg": "create job successed"
},
"status": "ok"
}工作流 Job ¶
工作流相关的api接口 api接口/jobs/
获取工作流信息 ¶
获取工作流信息GET/jobs/:jobId
Example URI
- jobId
string(required)jobId字符串,例如 “export-xlsx-2j85m”
/jobs/export-xlsx-2j85m200Headers
Content-Type: application/jsonBody
{
"msg": "ok",
"response": {
"conditions": [
{
"status": "True",
"type": "Completed"
}
],
"finishedAt": "2020-07-11T23:50:58Z",
"nodes": {
"export-xlsx-2j85m": {
"children": [
"export-xlsx-2j85m-4264186252"
],
"displayName": "export-xlsx-2j85m",
"finishedAt": "2020-07-11T23:50:58Z",
"id": "export-xlsx-2j85m",
"name": "export-xlsx-2j85m",
"outboundNodes": [
"export-xlsx-2j85m-3336648099"
],
"phase": "Succeeded",
"startedAt": "2020-07-11T23:50:48Z",
"templateName": "generate-xlsx",
"type": "Steps"
},
"export-xlsx-2j85m-3336648099": {
"boundaryID": "export-xlsx-2j85m",
"displayName": "generate-xlsx",
"finishedAt": "2020-07-11T23:50:57Z",
"id": "export-xlsx-2j85m-3336648099",
"name": "export-xlsx-2j85m[0].generate-xlsx",
"outputs": {
"artifacts": [
{
"name": "details-xlsx",
"path": "/data/2019-12-01_2019-12-02繁表.xls",
"s3": {
"accessKeySecret": {
"key": "accesskey",
"name": "minio"
},
"bucket": "jobs",
"endpoint": "minio.argo:9000",
"insecure": true,
"key": "export-xlsx-2j85m/export-xlsx-2j85m-3336648099/details-xlsx.tgz",
"secretKeySecret": {
"key": "secretkey",
"name": "minio"
}
}
}
]
},
"phase": "Succeeded",
"startedAt": "2020-07-11T23:50:48Z",
"templateName": "create-xlsx",
"type": "Pod"
},
"export-xlsx-2j85m-4264186252": {
"boundaryID": "export-xlsx-2j85m",
"children": [
"export-xlsx-2j85m-3336648099"
],
"displayName": "[0]",
"finishedAt": "2020-07-11T23:50:58Z",
"id": "export-xlsx-2j85m-4264186252",
"name": "export-xlsx-2j85m[0]",
"phase": "Succeeded",
"startedAt": "2020-07-11T23:50:48Z",
"templateName": "generate-xlsx",
"type": "StepGroup"
}
},
"phase": "Succeeded",
"startedAt": "2020-07-11T23:50:48Z"
},
"status": "ok"
}获取工作流生成文件 ¶
获取工作流生成文件GET/jobs/:jobId/result?(unzip)
Example URI
- jobId
string(required)jobId字符串,例如 “export-xlsx-2j85m”
- unzip
boolean(optional) Default: true是否直接解压文件,如果不解压则返回文件地址
/jobs/export-xlsx-2j85m/result?unzip=false200Headers
Content-Type: application/jsonBody
{
"file": "http://minio.devindata.com/jobs/export-xlsx-2j85m/export-xlsx-2j85m-3336648099/details-xlsx.tgz",
"msg": "ok",
"status": "ok"
}文件 files ¶
文件相关的api接口 api接口/files/
添加文件 ¶
添加文件POST/files
Example URI
Headers
Content-Type: mulipart/form-data; boundary=boundaryBody
--boundary
Content-Disposition: form-data; file=file-context
--boundary
Content-Disposition: form-data; data=string200Body
{
"msg": "ok",
"result": {
"file": {
"data": null,
"hash": "53cc28d0e2f1acda4500c0bf6c1c79ad",
"id": "2b70f28e-f924-11eb-827c-5e546aa9e7a1",
"name": "index.html",
"url": "http://devindata-oss.oss-cn-beijing.aliyuncs.com/files%2F53cc28d0e2f1acda4500c0bf6c1c79ad.html"
}
},
"status": "ok"
}更新文件 ¶
更新文件PUT/files/:id
只能更新name和data两个字段
Example URI
- id
string(required)id字符串,例如 “2b70f28e-f924-11eb-827c-5e546aa9e7a1”
/files/2b70f28e-f924-11eb-827c-5e546aa9e7a1Body
{
name: "index1.html"//文件名
data: "{x:1,y:1,z:1}" //文件相关数据
}200Headers
Content-Type: application/jsonBody
{
"msg": "ok",
"result": {
"file": {
"data": "{x:1,y:1,z:1}",
"hash": "53cc28d0e2f1acda4500c0bf6c1c79ad",
"id": "2b70f28e-f924-11eb-827c-5e546aa9e7a1",
"name": "index1.html",
"url": "http://devindata-oss.oss-cn-beijing.aliyuncs.com/files%2F53cc28d0e2f1acda4500c0bf6c1c79ad.html"
}
},
"status": "ok"
}获取文件 ¶
添加文件GET/files/:id
Example URI
- id
string(required)id字符串,例如 “2b70f28e-f924-11eb-827c-5e546aa9e7a1”
/files/2b70f28e-f924-11eb-827c-5e546aa9e7a1200Headers
Content-Type: application/jsonBody
{
"msg": "ok",
"result": {
"file": {
"data": null,
"hash": "53cc28d0e2f1acda4500c0bf6c1c79ad",
"id": "2b70f28e-f924-11eb-827c-5e546aa9e7a1",
"name": "index.html",
"url": "http://devindata-oss.oss-cn-beijing.aliyuncs.com/files%2F53cc28d0e2f1acda4500c0bf6c1c79ad.html"
}
},
"status": "ok"
}