|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598 |
- # 实时数据
-
- > 实时数据从`Redis`缓存获取
-
- 请求
-
- ```
- POST http://47.103.61.198:5008/api/breaker/data
-
- Header:
-
- Content-Type:application/json
- DD-Open-Key:d2ca79f1-4666-4ad5-953b-7ba5ee480fe0
-
- Body:
-
- {
- "mac":"187ED53338C4"
- }
- ```
-
- 响应:
-
- ```
- {
- "data": {
- "serverinfo": {
- "port": "12345",
- "hardware": "T25",
- "execleakcheck": "false",
- "protocol_ver": "19",
- "mac": "187ED53338C4",
- "loginid": "187ED53338C4",
- "gate": "",
- "ip": "192.168.8.146",
- "version": "1.3.08",
- "loginpwd": "7a57a5a743894ae4",
- "ssidpwd": "2803f88db851c67a",
- "ssid": "DDINGW",
- "timezoneId": "Asia/Shanghai",
- "ServerProtocol": "2",
- "server": "47.103.61.198:5008/ebx-bishop/data/carry",
- "datetime": "2021-02-25 02:10:23",
- "leakcheckdate": "3,13,33",
- "lastleakcheckdate": "2017-01-01 10:00:00"
- },
- "distributbox": {
- "breakers": {
- "1": {
- "version": "1.03",
- "title": "总路",
- "model": "JZK2L100-BL6523",
- "alarm": 0,
- "enableNetCtrl": true,
- "mxdw": 0,
- "mxgg": 14080,
- "mxgl": 96,
- "mxgw": 90,
- "mxgy": 260,
- "mxld": 30,
- "mxqy": 0,
- "openClose": false,
- "addr": 1,
- "power": 0.029,
- "specification": "64",
- "control": 1,
- "visibility": 1,
- "totalChannelId": -1,
- "lineType": "220",
- "a_A": 0,
- "a_T": 30.5,
- "a_V": 227,
- "a_WP": 0,
- "a_LD": 0,
- "a_PF": 0,
- "g_A": 0,
- "g_T": 0,
- "g_V": 0,
- "g_WP": 0,
- "g_LD": 0,
- "g_PF": 0,
- "b_A": 0,
- "b_T": 0,
- "b_V": 0,
- "b_WP": 0,
- "b_PF": 0,
- "c_A": 0,
- "c_T": 0,
- "c_V": 0,
- "c_WP": 0,
- "c_PF": 0,
- "n_A": 0,
- "n_T": 0
- },
- "2": {
- "version": "1.03",
- "title": "线路1",
- "model": "JZK2L100-BL6523",
- "alarm": 0,
- "enableNetCtrl": true,
- "mxdw": 0,
- "mxgg": 100,
- "mxgl": 30,
- "mxgw": 90,
- "mxgy": 260,
- "mxld": 30,
- "mxqy": 175,
- "openClose": true,
- "addr": 2,
- "power": 0,
- "specification": "20",
- "control": 1,
- "visibility": 1,
- "totalChannelId": 1,
- "lineType": "220",
- "a_A": 0,
- "a_T": 34.1,
- "a_V": 227,
- "a_WP": 0,
- "a_LD": 0,
- "a_PF": 0,
- "g_A": 0,
- "g_T": 0,
- "g_V": 0,
- "g_WP": 0,
- "g_LD": 0,
- "g_PF": 0,
- "b_A": 0,
- "b_T": 0,
- "b_V": 0,
- "b_WP": 0,
- "b_PF": 0,
- "c_A": 0,
- "c_T": 0,
- "c_V": 0,
- "c_WP": 0,
- "c_PF": 0,
- "n_A": 0,
- "n_T": 0
- },
- "3": {
- "version": "1.03",
- "title": "线路2",
- "model": "JZK2L100-BL6523",
- "alarm": 0,
- "enableNetCtrl": true,
- "mxdw": 0,
- "mxgg": 4400,
- "mxgl": 30,
- "mxgw": 90,
- "mxgy": 260,
- "mxld": 30,
- "mxqy": 175,
- "openClose": false,
- "addr": 3,
- "power": 0,
- "specification": "20",
- "control": 1,
- "visibility": 1,
- "totalChannelId": 1,
- "lineType": "220",
- "a_A": 0,
- "a_T": 34.1,
- "a_V": 227,
- "a_WP": 0,
- "a_LD": 0,
- "a_PF": 0,
- "g_A": 0,
- "g_T": 0,
- "g_V": 0,
- "g_WP": 0,
- "g_LD": 0,
- "g_PF": 0,
- "b_A": 0,
- "b_T": 0,
- "b_V": 0,
- "b_WP": 0,
- "b_PF": 0,
- "c_A": 0,
- "c_T": 0,
- "c_V": 0,
- "c_WP": 0,
- "c_PF": 0,
- "n_A": 0,
- "n_T": 0
- }
- },
- "change": null
- }
- },
- "isError": false,
- "message": "success",
- "code": 200
- }
- ```
-
- 代码:
-
- ```
- using DD.Libs.Devices.ManDun;
-
- var cacheRequest = new {mac="187ed5312345"};
-
- var cacheResponse = await cacheUrl
- .WithHeader("Content-Type","application/json")
- .WithHeader("DD-Open-Key", "d2ca79f1-4666-4ad5-953b-7ba5ee480fe0")
- .PostJsonAsync(cacheRequest)
- .ReceiveJson<RealtimeData>();
- ```
-
- ```
- public class RealtimeData
- {
- /// <summary>
- /// 配置信息
- /// port,hardware,execleakcheck,mac,loginid,gate,ip, version, loginpwd,ssidpwd,ssid,timezoneId,server, datetime, leakcheckdate, lastleakcheckdate
- /// </summary>
- public IDictionary<string, string> serverinfo { get; set; }
-
- /// <summary>
- /// 断路器开关数据
- /// </summary>
- public DistributeBox distributbox { get; set; }
- }
-
- /// <summary>
- /// 分布式电箱
- /// </summary>
- public class DistributeBox
- {
- /// <summary>
- /// 一个电箱有多个断路器
- /// </summary>
- public IDictionary<string, Breaker> Breakers { get; set; }
-
- /// <summary>
- /// 模块关键数据是否有变化:1有变化,0没有变化。不用
- /// </summary>
- public string Change { get; set; }
- }
-
-
- public class Breaker
- {
- #region 不带三相时的数据
- /// <summary>
- /// 版本号
- /// </summary>
- public string version { get; set; }
-
- /// <summary>
- /// 线路名称
- /// </summary>
- public string title { get; set; }
-
- /// <summary>
- /// 线路型号(JZK2L100-BL6523表示是总路,JFK2L103-BL6523表示是分路)
- /// </summary>
- public string model { get; set; }
-
- /// <summary>
- /// 当前告警信息:0表示告警取消
- /// </summary>
- public long Alarm { get; set; }
-
- /// <summary>
- /// 是否远程关闭:true是;false否
- /// </summary>
- public bool EnableNetCtrl { get; set; }
-
-
- /// <summary>
- /// 低温门限值
- /// </summary>
- public decimal MXDW { get; set; }
-
- /// <summary>
- /// 过功门限值
- /// </summary>
- public decimal MXGG { get; set; }
-
- /// <summary>
- /// 过流门限值
- /// </summary>
- public decimal MXGL { get; set; }
-
- /// <summary>
- /// 过温门限值
- /// </summary>
- public decimal MXGW { get; set; }
-
- /// <summary>
- /// 过压门限值
- /// </summary>
- public decimal MXGY { get; set; }
-
- /// <summary>
- /// 漏电门限值
- /// </summary>
- public decimal MXLD { get; set; }
-
- /// <summary>
- /// 欠压门限值
- /// </summary>
- public decimal MXQY { get; set; }
-
- /// <summary>
- /// 线路状态:true开;false关
- /// </summary>
- public bool OpenClose { get; set; }
-
-
- /// <summary>
- /// 线路地址
- /// </summary>
- public short addr { get; set; }
-
- /// <summary>
- /// 累计电量KW
- /// </summary>
- public decimal power { get; set; }
-
-
- /// <summary>
- /// 线路规格
- /// </summary>
- public string specification { get; set; }
-
- /// <summary>
- /// 是否能控制(1为能,0为不能)
- /// </summary>
- public short control { get; set; }
-
- /// <summary>
- /// 线路是否显示(1显示;0不显示)
- /// </summary>
- public short visibility { get; set; }
-
- /// <summary>
- /// 接入到汇电线路下(-1为进线直连,非-1表示接入某总路的总路的线路ID)
- /// </summary>
- public int totalChannelId { get; set; }
-
- /// <summary>
- /// 线路类型(参数值有:220,380等)
- /// </summary>
- public string lineType { get; set; }
-
- /// <summary>
- /// A相电流(或单相电流)
- /// </summary>
- public decimal A_A { get; set; }
-
- /// <summary>
- /// A相温度(或单相温度)
- /// </summary>
- public decimal A_T { get; set; }
-
- /// <summary>
- /// A相电压(或单相电压)
- /// </summary>
- public decimal A_V { get; set; }
-
- /// <summary>
- /// A相功率(或单相功率)
- /// </summary>
- public decimal A_WP { get; set; }
-
- /// <summary>
- /// 单相漏电流(三相无值)
- /// </summary>
- public decimal A_LD { get; set; }
-
- /// <summary>
- /// A相功率因素(或单相功率因素)
- /// </summary>
- public decimal A_PF { get; set; }
- #endregion
-
-
-
- /// <summary>
- /// 平均电流(单相无值)
- /// </summary>
- public decimal G_A { get; set; }
-
- /// <summary>
- /// 机壳温度(单相无值)
- /// </summary>
- public decimal G_T { get; set; }
-
- /// <summary>
- /// 平均电压(单相无值)
- /// </summary>
- public decimal G_V { get; set; }
-
- /// <summary>
- /// 功率和值(单相无值)
- /// </summary>
- public decimal G_WP { get; set; }
-
- /// <summary>
- /// 三相漏电流(单相无值)
- /// </summary>
- public decimal G_LD { get; set; }
-
- /// <summary>
- /// 合相功率因数(单相无值)
- /// </summary>
- public decimal G_PF { get; set; }
-
-
-
- /// <summary>
- /// B相电流
- /// </summary>
- public decimal B_A { get; set; }
-
- /// <summary>
- /// B相温度
- /// </summary>
- public decimal B_T { get; set; }
-
- /// <summary>
- /// B相电压
- /// </summary>
- public decimal B_V { get; set; }
-
- /// <summary>
- /// B相功率
- /// </summary>
- public decimal B_WP { get; set; }
-
- /// <summary>
- /// B相功率因素
- /// </summary>
- public decimal B_PF { get; set; }
-
- /// <summary>
- /// C相电流
- /// </summary>
- public decimal C_A { get; set; }
-
- /// <summary>
- /// C相温度
- /// </summary>
- public decimal C_T { get; set; }
-
- /// <summary>
- /// C相电压
- /// </summary>
- public decimal C_V { get; set; }
-
- /// <summary>
- /// C相功率
- /// </summary>
- public decimal C_WP { get; set; }
-
- /// <summary>
- /// C相功率因素
- /// </summary>
- public decimal C_PF { get; set; }
-
- /// <summary>
- /// 零线电流
- /// </summary>
- public decimal N_A { get; set; }
-
- /// <summary>
- /// 零线温度
- /// </summary>
- public decimal N_T { get; set; }
-
-
-
- }
- ```
-
-
-
- > 模拟模块的模拟数据,也存入`Redis`缓存
-
-
-
- > 开放平台接口如何设计?
-
- - 任意多个模块
- - 任意时间段内
- - 任意数据:电流、电压、全部
-
- # 报警报表
-
-
-
- > 从哪里获取?
-
- 如果没有选择时间,从报警历史数据中获取,报警的历史数据保存在时序数据库。
-
-
-
- > 有哪些有关时间的条件?
-
- - 按小时:过去60分钟
- - 按天:前一天的凌晨到现在的小时
- - 按周:过去7天
- - 按月:过去30天
-
-
-
- > 时间以外的条件?
-
- 报警类型。
-
-
-
- > 时序数据库设计
-
- ```
- ts timestamp
- mac
- addr
- start:报警开始时间
- end:报警结束时间
- type:报警类型
- level:报警级别
- val:当前值
- limit:阈值
- ```
-
- > 接口如何设计
-
- ```
- time
- type
- level
- mac
- addr
- ```
-
- > 要做的事
-
- - 创建时序数据库
- - 随时创建按小时、按天、按周、按月的种子数据接口
- - 根据条件查询报警历史数据
-
-
-
- > 开放平台接口如何设计?
-
- - 任意多个模块
- - 任意时间段内
- - 任意报警类型
-
- # 电量报表
-
- > 从哪里获取
-
- 从时序数据库获取,调用开放平台的接口。
-
-
-
- > 有哪些查询条件?
-
- - 按天:前一天的凌晨到现在的小时
- - 按周:过去7天
- - 按月:过去30天
- - 某个开关
-
-
-
- > 开放平台接口如何设计?
-
- - 任意多个模块
- - 任意时间段内
- - 任意计算
-
- # 负荷报表
-
-
-
- > 有哪些查询条件?
-
- - 最近60分钟
- - 按开关
- - 按公司
-
-
-
- > 从哪里获取?
-
- 开放平台提供接口,从关系数据库获取。
-
-
-
- > 开放平台如何设计?
-
- - 最近60分钟内
- - 任意计算
|