diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/SysCityAreaController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/SysCityAreaController.java index 0ba68b1..76828f3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/SysCityAreaController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/SysCityAreaController.java @@ -1,7 +1,6 @@ package org.dromara.property.controller; import cn.dev33.satoken.annotation.SaCheckPermission; -import com.alibaba.fastjson2.JSONObject; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; @@ -20,8 +19,6 @@ import org.dromara.property.domain.bo.SysCityAreaBo; import org.dromara.property.domain.vo.CityAreaTreeVo; import org.dromara.property.domain.vo.SysCityAreaVo; import org.dromara.property.service.ISysCityAreaService; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -39,7 +36,7 @@ import java.util.List; @RequiredArgsConstructor @RestController @RequestMapping("/cityArea") -public class SysCityAreaController extends BaseController implements ApplicationRunner { +public class SysCityAreaController extends BaseController { private final ISysCityAreaService SysCityAreaService; @@ -126,10 +123,4 @@ public class SysCityAreaController extends BaseController implements Application return R.ok(list); } - - @Override - public void run(ApplicationArguments args) throws Exception { - R> listR = queryTreeList(); - System.out.println(JSONObject.toJSONString(listR)); - } } diff --git a/ruoyi-modules/Iot/Dockerfile b/ruoyi-modules/Sis/Dockerfile similarity index 79% rename from ruoyi-modules/Iot/Dockerfile rename to ruoyi-modules/Sis/Dockerfile index f449eff..61d332c 100644 --- a/ruoyi-modules/Iot/Dockerfile +++ b/ruoyi-modules/Sis/Dockerfile @@ -3,11 +3,11 @@ FROM bellsoft/liberica-openjdk-debian:17.0.11-cds #FROM bellsoft/liberica-openjdk-debian:21.0.5-cds #FROM findepi/graalvm:java17-native -LABEL maintainer="Lion Li" +LABEL maintainer="Lxj" -RUN mkdir -p /smartparks/iot/logs \ - /smartparks/iot/temp \ - /smartparks/iot/agent +RUN mkdir -p /smartparks/Sis/logs \ + /smartparks/Sis/temp \ + /smartparks/Sis/agent WORKDIR /ruoyi/system @@ -15,7 +15,7 @@ ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" EXPOSE ${SERVER_PORT} -ADD ./target/iot.jar ./iot.jar +ADD ./target/Sis.jar ./app.jar SHELL ["/bin/bash", "-c"] @@ -23,5 +23,5 @@ ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_P #-Dskywalking.agent.service_name=ruoyi-system \ #-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \ -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \ - -jar iot.jar + -jar app.jar diff --git a/ruoyi-modules/Sis/doc/宇视AIBOX对外标准接口20240626.pdf b/ruoyi-modules/Sis/doc/宇视AIBOX对外标准接口20240626.pdf new file mode 100644 index 0000000..4fe4b14 --- /dev/null +++ b/ruoyi-modules/Sis/doc/宇视AIBOX对外标准接口20240626.pdf @@ -0,0 +1,5957 @@ +文档名:边缘产品对外标准接口 密级:公开 + +边缘产品对外标准接口 + + 资料版本:V2.00 + + 第 1 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +声明 + +版权声明 + +©2019 浙江宇视科技有限公司。保留一切权利。 +未经浙江宇视科技有限公司(下称“本公司”)的书面许可,任何单位和个人不得擅自摘抄、复制本手 +册内容的部分或全部,并不得以任何形式传播。 +本手册描述的产品中,可能包含本公司及其可能存在的许可人享有版权的软件。未经相关权利人的许 +可,任何人不能以任何形式对前述软件进行复制、分发、修改、摘录、反编译、反汇编、解密、反向工 +程、出租、转让、分许可等侵犯软件版权的行为。 + +商标声明 + + 是浙江宇视科技有限公司的商标或注册商标。 +在本手册以及本手册描述的产品中,出现的其他商标、产品名称、服务名称以及公司名称,由其各自的 +所有人拥有。 + +出口管制合规声明 + +本公司遵守包括中国、美国等全球范围内适用的出口管制法律法规,并且贯彻执行与硬件、软件、技术 +的出口、再出口及转让相关的要求。就本手册所描述的产品,请您全面理解并严格遵守国内外适用的 +出口管制法律法规。 + +责任声明 + + 第 2 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 本公司对使用本手册或使用本公司产品导致的任何特殊、附带、偶然或间接的损害不承担责任、 + 不进行赔偿,包括但不限于商业利润损失、数据或文档丢失产生的损失。 + + 本文档中描述的产品均“按照现状”提供,除非适用法律要求,本手册仅作为使用指导,所有陈 + 述、信息和建议不构成任何明示或暗示的担保,包括但不限于适销性、质量满意度、适合特定目 + 的、不侵犯第三方权利等保证。 + + 若您将产品接入互联网需自担风险,包括但不限于可能遭受网络攻击、黑客攻击、病毒感染等, + 请您加强网络、设备数据和个人信息等的保护,采取保障设备网络安全的必要措施。本公司对因 + 此造成的产品工作异常、信息泄露等问题不承担任何责任,但本公司会及时提供产品相关安全维 + 护支持。 + + 在适用法律未明令禁止的情况下,对于因使用或无法使用本产品或服务而引起的任何直接或间接 + 损失,包括但不限于利润或销售损失、数据丢失或采购替代商品或服务的成本、业务中断等,本 + 公司及其员工、许可方或附属公司都不承担赔偿责任,即使其已被告知存在此种损害的可能性也 + 是如此。某些司法管辖区不允许对人身伤害、附带或从属损害等进行责任限制,则此限制可能不 + 适用于您。 + + 本公司对您的所有损害承担的总责任限额不超过您购买本公司产品所支付的价款。 + +隐私保护提醒 + +本公司遵循适用的隐私保护法律法规。您可以访问宇视科技官网查询我们的隐私政策。 +本手册描述的产品,可能会采集人脸、指纹、车牌、邮箱、电话、GPS 等个人信息,在使用产品过程中, +请遵守所在地区或国家的隐私保护法律法规要求,保障您和他人的合法权益。 + +关于本手册 + + 本手册供多个型号产品使用,产品外观和功能请以实物为准。 + 本手册配套多个软件版本,产品界面和功能请以实际软件为准。 + 本手册内容可能包含技术性误差或印刷性错误,以本公司最终解释为准。 + 因未按本手册中的指导进行操作而造成的任何损失,由使用方自己承担责任。 + 本公司保留在没有通知或提示的情况下修改本手册中任何信息的权利。由于产品版本升级或相关 + + 地区的法律法规要求等原因,本手册内容会不定期进行更新,更新的内容将体现在新版本中。 + + 第 3 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +目录 + +声明............................................................................................................................................................................................... 2 +1 鉴权........................................................................................................................................................................................11 + + 1.1 鉴权流程 ........................................................................................................................................................ 11 + 1.2 鉴权信息说明 ............................................................................................................................................... 11 + 1.3 摘要计算过程 ............................................................................................................................................... 12 + 1.4 样例..................................................................................................................................................................12 +2 人员库管理 .......................................................................................................................................................................... 14 + 2.1 新增人员库 ............................................................................................................................................................. 14 + 基本信息 ................................................................................................................................................................. 14 + 请求参数 ................................................................................................................................................................. 14 + 返回数据 ................................................................................................................................................................. 14 + 样例 .......................................................................................................................................................................... 15 + 2.2 删除人员库 ............................................................................................................................................................. 15 + 基本信息 ................................................................................................................................................................. 15 + 请求参数 ................................................................................................................................................................. 15 + 返回数据 ................................................................................................................................................................. 16 + 样例 .......................................................................................................................................................................... 16 + 2.3 修改人员库信息....................................................................................................................................................16 + 基本信息 ................................................................................................................................................................. 16 + 请求参数 ................................................................................................................................................................. 17 + 返回数据 ................................................................................................................................................................. 17 + 样例 .......................................................................................................................................................................... 17 + 2.4 获取人员库列表....................................................................................................................................................18 + 基本信息 ................................................................................................................................................................. 18 + 请求参数 ................................................................................................................................................................. 18 + 返回数据 ................................................................................................................................................................. 18 + 样例 .......................................................................................................................................................................... 19 +3 人员管理...............................................................................................................................................................................21 + 3.1 新增人员.................................................................................................................................................................. 21 + 基本信息 ................................................................................................................................................................. 21 + 请求参数 ................................................................................................................................................................. 21 + 返回数据 ................................................................................................................................................................. 22 + 样例 .......................................................................................................................................................................... 22 + 3.2 批量新增人员 ........................................................................................................................................................ 23 + 基本信息 ................................................................................................................................................................. 23 + 请求参数 ................................................................................................................................................................. 23 + 返回数据 ................................................................................................................................................................. 24 + 样例 .......................................................................................................................................................................... 24 + 3.3 批量删除人员 ........................................................................................................................................................ 25 + 基本信息 ................................................................................................................................................................. 25 + + 第 4 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 请求参数 ................................................................................................................................................................. 25 + 返回数据 ................................................................................................................................................................. 26 + 样例 .......................................................................................................................................................................... 26 + 3.4 修改人员信息 ........................................................................................................................................................ 27 + 基本信息 ................................................................................................................................................................. 27 + 请求参数 ................................................................................................................................................................. 27 + 返回数据 ................................................................................................................................................................. 28 + 样例 .......................................................................................................................................................................... 28 + 3.5 获取人员列表 ........................................................................................................................................................ 28 + 基本信息 ................................................................................................................................................................. 28 + 请求参数 ................................................................................................................................................................. 29 + 返回数据 ................................................................................................................................................................. 29 + 样例 .......................................................................................................................................................................... 30 +4 点位管理...............................................................................................................................................................................33 + 4.1 获取 rsa 公钥 ........................................................................................................................................................33 + 基本信息 ................................................................................................................................................................. 33 + 请求参数 ................................................................................................................................................................. 33 + 返回数据 ................................................................................................................................................................. 33 + 样例 .......................................................................................................................................................................... 33 + 4.2 通过 onvif 获取设备码流信息 ........................................................................................................................34 + 基本信息 ................................................................................................................................................................. 34 + 请求参数 ................................................................................................................................................................. 34 + 返回数据 ................................................................................................................................................................. 34 + 样例 .......................................................................................................................................................................... 35 + 4.3 新增点位.................................................................................................................................................................. 37 + 基本信息 ................................................................................................................................................................. 37 + 请求参数 ................................................................................................................................................................. 37 + 返回数据 ................................................................................................................................................................. 38 + 样例 .......................................................................................................................................................................... 38 + 4.4 删除点位.................................................................................................................................................................. 39 + 基本信息 ................................................................................................................................................................. 39 + 请求参数 ................................................................................................................................................................. 39 + 返回数据 ................................................................................................................................................................. 40 + 样例 .......................................................................................................................................................................... 40 + 4.5 修改点位信息 ........................................................................................................................................................ 41 + 基本信息 ................................................................................................................................................................. 41 + 请求参数 ................................................................................................................................................................. 41 + 返回数据 ................................................................................................................................................................. 42 + 样例 .......................................................................................................................................................................... 42 + 4.6 获取点位列表 ........................................................................................................................................................ 43 + 基本信息 ................................................................................................................................................................. 43 + 请求参数 ................................................................................................................................................................. 43 + 返回数据 ................................................................................................................................................................. 44 + 样例 .......................................................................................................................................................................... 45 + + 第 5 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 4.7 批量新增点位 ........................................................................................................................................................ 46 + 基本信息 ................................................................................................................................................................. 46 + 请求参数 ................................................................................................................................................................. 46 + 返回数据 ................................................................................................................................................................. 47 + 样例 .......................................................................................................................................................................... 47 + +5 点位布防时间 ..................................................................................................................................................................... 49 + 5.1 添加/修改布防时间..............................................................................................................................................49 + 基本信息 ................................................................................................................................................................. 49 + 请求参数 ................................................................................................................................................................. 49 + 返回数据 ................................................................................................................................................................. 50 + 样例 .......................................................................................................................................................................... 50 + 5.2 获取布防时间 ........................................................................................................................................................ 53 + 基本信息 ................................................................................................................................................................. 53 + 请求参数 ................................................................................................................................................................. 53 + 返回数据 ................................................................................................................................................................. 53 + 样例 .......................................................................................................................................................................... 54 + +6 智能配置...............................................................................................................................................................................58 + 6.1 新增(修改)智能分析任务............................................................................................................................. 58 + 基本信息 ................................................................................................................................................................. 58 + 请求参数 ................................................................................................................................................................. 58 + 返回数据 ................................................................................................................................................................. 61 + 样例 .......................................................................................................................................................................... 61 + 6.2 获取智能分析任务列表......................................................................................................................................62 + 基本信息 ................................................................................................................................................................. 62 + 请求参数 ................................................................................................................................................................. 62 + 返回数据 ................................................................................................................................................................. 63 + 样例 .......................................................................................................................................................................... 65 + 6.3 获取算法类型列表 ............................................................................................................................................... 66 + 基本信息 ................................................................................................................................................................. 66 + 请求参数 ................................................................................................................................................................. 67 + 返回数据 ................................................................................................................................................................. 67 + 样例 .......................................................................................................................................................................... 67 + 6.4 获取扩展配置 ........................................................................................................................................................ 68 + 基本信息 ................................................................................................................................................................. 68 + 请求参数 ................................................................................................................................................................. 68 + 返回数据 ................................................................................................................................................................. 69 + 样例 .......................................................................................................................................................................... 69 + 6.5 修改扩展配置 ........................................................................................................................................................ 73 + 基本信息 ................................................................................................................................................................. 73 + 请求参数 ................................................................................................................................................................. 73 + 返回数据 ................................................................................................................................................................. 74 + 样例 .......................................................................................................................................................................... 74 + 6.6 获取点位参数配置 ............................................................................................................................................... 77 + 基本信息 ................................................................................................................................................................. 77 + + 第 6 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 请求参数 ................................................................................................................................................................. 77 + 返回数据 ................................................................................................................................................................. 78 + 样例 .......................................................................................................................................................................... 79 + 6.7 修改点位参数配置 ............................................................................................................................................... 79 + 基本信息 ................................................................................................................................................................. 79 + 请求参数 ................................................................................................................................................................. 80 + 返回数据 ................................................................................................................................................................. 80 + 样例 .......................................................................................................................................................................... 81 + 6.8 任务启停接口 ........................................................................................................................................................ 81 + 基本信息 ................................................................................................................................................................. 81 + 请求参数 ................................................................................................................................................................. 82 + 返回数据 ................................................................................................................................................................. 82 + 样例 .......................................................................................................................................................................... 82 + 6.9 实时轮巡设置 ........................................................................................................................................................ 83 + 基本信息 ................................................................................................................................................................. 83 + 请求参数 ................................................................................................................................................................. 83 + 返回数据 ................................................................................................................................................................. 83 + 样例 .......................................................................................................................................................................... 84 +7 工服库管理 .......................................................................................................................................................................... 85 + 7.1 新增工服库 ............................................................................................................................................................. 85 + 基本信息 ................................................................................................................................................................. 85 + 请求参数 ................................................................................................................................................................. 85 + 返回数据 ................................................................................................................................................................. 85 + 样例 .......................................................................................................................................................................... 86 + 7.2 修改工服库 ............................................................................................................................................................. 86 + 基本信息 ................................................................................................................................................................. 86 + 请求参数 ................................................................................................................................................................. 86 + 返回数据 ................................................................................................................................................................. 87 + 样例 .......................................................................................................................................................................... 87 + 7.3 删除工服库 ............................................................................................................................................................. 87 + 基本信息 ................................................................................................................................................................. 87 + 请求参数 ................................................................................................................................................................. 88 + 返回数据 ................................................................................................................................................................. 88 + 样例 .......................................................................................................................................................................... 88 + 7.4 查询工服库信息....................................................................................................................................................89 + 基本信息 ................................................................................................................................................................. 89 + 请求参数 ................................................................................................................................................................. 89 + 返回数据 ................................................................................................................................................................. 89 + 样例 .......................................................................................................................................................................... 90 +8 工服管理...............................................................................................................................................................................92 + 8.1 新增工服-单个.......................................................................................................................................................92 + 基本信息 ................................................................................................................................................................. 92 + 请求参数 ................................................................................................................................................................. 92 + 返回数据 ................................................................................................................................................................. 92 + + 第 7 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 样例 .......................................................................................................................................................................... 93 + 8.2 新增工服-批量.......................................................................................................................................................93 + + 基本信息 ................................................................................................................................................................. 93 + 请求参数 ................................................................................................................................................................. 93 + 返回数据 ................................................................................................................................................................. 94 + 样例 .......................................................................................................................................................................... 94 + 8.3 删除工服.................................................................................................................................................................. 95 + 基本信息 ................................................................................................................................................................. 95 + 请求参数 ................................................................................................................................................................. 95 + 返回数据 ................................................................................................................................................................. 96 + 样例 .......................................................................................................................................................................... 96 + 8.4 查找工服列表 ........................................................................................................................................................ 96 + 基本信息 ................................................................................................................................................................. 96 + 请求参数 ................................................................................................................................................................. 97 + 返回数据 ................................................................................................................................................................. 97 + 样例 .......................................................................................................................................................................... 98 +9 设备信息...............................................................................................................................................................................99 + 9.1 修改设备信息 ........................................................................................................................................................ 99 + 基本信息 ................................................................................................................................................................. 99 + 请求参数 ................................................................................................................................................................. 99 + 返回数据 ................................................................................................................................................................. 99 + 样例 ........................................................................................................................................................................100 + 9.2 查询设备信息 ......................................................................................................................................................100 + 基本信息 ...............................................................................................................................................................100 + 请求参数 ...............................................................................................................................................................100 + 返回数据 ...............................................................................................................................................................101 + 样例 ........................................................................................................................................................................101 +10 升级 ...................................................................................................................................................................................103 + 10.1 上传升级包 ........................................................................................................................................................103 + 基本信息 ...............................................................................................................................................................103 + 请求参数 ...............................................................................................................................................................103 + 返回数据 ...............................................................................................................................................................103 + 样例 ........................................................................................................................................................................103 + 10.2 获取升级状态....................................................................................................................................................104 + 基本信息 ...............................................................................................................................................................104 + 请求参数 ...............................................................................................................................................................104 + 返回数据 ...............................................................................................................................................................104 + 样例 ........................................................................................................................................................................105 +11 数据检索 ..........................................................................................................................................................................106 + 11.1 行为分析检索....................................................................................................................................................106 + 基本信息 ...............................................................................................................................................................106 + 请求参数 ...............................................................................................................................................................106 + 返回数据 ...............................................................................................................................................................107 + 样例 ........................................................................................................................................................................108 + + 第 8 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 11.2 人脸抓拍检索....................................................................................................................................................110 + 基本信息 ...............................................................................................................................................................110 + 请求参数 ...............................................................................................................................................................110 + 返回数据 ...............................................................................................................................................................111 + 样例 ........................................................................................................................................................................113 + + 11.3 行为比对检索....................................................................................................................................................115 + 基本信息 ...............................................................................................................................................................115 + 请求参数 ...............................................................................................................................................................115 + 返回数据 ...............................................................................................................................................................116 + 样例 ........................................................................................................................................................................117 + + 11.4 人脸比对检索....................................................................................................................................................119 + 基本信息 ...............................................................................................................................................................119 + 请求参数 ...............................................................................................................................................................119 + 返回数据 ...............................................................................................................................................................121 + 样例 ........................................................................................................................................................................122 + +12 平台对接 ..........................................................................................................................................................................125 + 12.1 新增/修改平台对接信息 ................................................................................................................................125 + 基本信息 ...............................................................................................................................................................125 + 请求参数 ...............................................................................................................................................................125 + 返回数据 ...............................................................................................................................................................126 + 样例 ........................................................................................................................................................................126 + 12.2 查询平台对接信息 ..........................................................................................................................................128 + 基本信息 ...............................................................................................................................................................128 + 请求参数 ...............................................................................................................................................................129 + 返回数据 ...............................................................................................................................................................129 + 样例 ........................................................................................................................................................................130 + 12.3 查询平台对接能力 ..........................................................................................................................................133 + 基本信息 ...............................................................................................................................................................133 + 请求参数 ...............................................................................................................................................................133 + 返回数据 ...............................................................................................................................................................133 + 样例 ........................................................................................................................................................................133 + +13 数据上报 ..........................................................................................................................................................................135 + 13.1 告警数据上报....................................................................................................................................................135 + 基本信息 ...............................................................................................................................................................135 + 请求参数 ...............................................................................................................................................................135 + 返回数据 ...............................................................................................................................................................138 + 样例 ........................................................................................................................................................................138 + 13.2 告警视频上报....................................................................................................................................................139 + 基本信息 ...............................................................................................................................................................139 + 请求参数 ...............................................................................................................................................................140 + 返回数据 ...............................................................................................................................................................140 + 样例 ........................................................................................................................................................................140 + +14 附录 ...................................................................................................................................................................................142 + 14.1 错误码..................................................................................................................................................................142 + + 第 9 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +14.2 适配产品 .............................................................................................................................................................143 +14.3 告警类型 .............................................................................................................................................................143 + + 第 10 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +1 鉴权 + +为保证调用双方身份认证及数据安全,第三方调用本接口时,必需进行摘要鉴权。 + +1.1 鉴权流程 + + 图 1.1 摘要鉴权流程 + +1. 调用任意接口,请求头中不携带 Authorization,设备返回 401。 + 响应的头信息字段 WWW-Authenticate 中携带鉴权所需要的信息:qop、algorithm、 + realm、nonce、stale。 + +2. 根据返回的数据字段生成摘要信息,并放在请求头的 Authorization 字段中,再次请 + 求设备接口,请求成功。 + +1.2 鉴权信息说明 + + 第 11 页 共 148 页 + 字段 文档名:边缘产品对外标准接口 密级:公开 +username +password 说明 示例 +realm 鉴权用户名,由设备分配 admin + 鉴权用户密码,由设备分配 123456 +nonce 摘要加密字段,首次请求时由设备返回 NVRDVR + 随机字符串,每当返回 401 时就会生成一个新的值, +uri 原值失效,客户端需使用此值生成新的摘要信息 1983339259 +method 当前请求的 URI +algorithm 当前请求的方法 /api/v2/algo/list +qop 摘要加密算法,首次请求时由设备返回 POST +nc 保护质量,首次请求时由设备返回 MD5 +cnonce nonce 计数器,防止重放攻击,由请求方生成 auth +response 唯一字符串,用于提供额外防护,由请求方生成 00000002 +stale 摘要信息,用于验证身份,由请求方生成 1a42d15d190f2f7 + 指示上个请求中的 nonce 是否过期,由设备返回 8413c8efa3a4 + FALSE + +1.3 摘要计算过程 + +1. 将 username、realm、password 依次使用:拼接,并用 md5 加密后进行十六进制编码, + 将结果记作 r1。 + +2. 将 method、uri 依次使用:拼接,并用 md5 加密后进行十六进制编码,结果记作 r2。 +3. 将 r1、nonce、nc、cnonce、qop、r2 依次使用:拼接,并用 md5 加密后进行十六进制 + + 编码,结果即为 response。 + +1.4 样例 + +首次请求: + +设备提供的用户名:admin,密码:admin123.,请求 URI:/api/v2/algo/list,请求方 +法:POST +响应头部信息: + + 第 12 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +WWW-Authenticate: Digest +qop="auth",algorithm="MD5",realm="NVRDVR",nonce="1923473498",stale="FALSE" + +响应体数据: + +{ + "code": 3, + "msg": "Not Authorized", + "status_code": 401 + +} + +再次请求: + +请求头信息: + +Authorization: Digest username="admin", realm="NVRDVR", nonce="1923473498", +uri="/api/v2/algo/list", algorithm="MD5", qop=auth, nc=00000002, +cnonce="1a42d15d190f2f7c93cfe0f749aa4674", response="ebaadf53a48e3156cd5a1485b63658b0" + +计算过程: + +r1 = hex(md5(username:realm:password)) + + = hex(md5(admin:NVRDVR:admin123.)) + + = 98ca67a03cba1d7167bf0096cb957f7d + +r2 = hex(md5(method:uri)) + + = hex(md6(POST:/api/v2/algo/list)) + + = 305c43426cbcddb71ce670bae226bbc1 + +response = hex(md5(r1:nonce:nc:cnonce:qop:r2)) + + =hex(md5(98ca67a03cba1d7167bf0096cb957f7d:1923473498:00000002:1 + a42d15d190f2f7c93cfe0f749aa4674:auth:305c43426cbcddb71ce670bae226bb + c1)) + + = ebaadf53a48e3156cd5a1485b63658b0 +响应体数据: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": {} + +} + + 第 13 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +2 人员库管理 + +2.1 新增人员库 + +基本信息 + +Path: /api/v2/personlib/add +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +lib_name string 是 人员库名称 最大长度: 64 + +返回数据 + + 名称 类型 必填 默认值 备注 +code +data integer 是 0:success +└ lib_id +msg object 否 人员库 id + integer 否 + string 是 + + 第 14 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +样例 + +请求: + +{ + "lib_name": "test2" + +} + +响应: +{ + + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + + "lib_id": 5 + } +} + +2.2 删除人员库 + +基本信息 + +Path: /api/v2/personlib/delete +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type + + 第 15 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Body 类型 必填 默认值 备注 + integer [] 是 + 名称 人员库 id + lib_id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + +样例 + +请求: + +{ + "lib_id": [ + 4 + ] + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +2.3 修改人员库信息 + +基本信息 + + 第 16 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Path: /api/v2/personlib/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +lib_name string 是 人员库名称 最大长度: 64 +lib_id integer 是 人员库 id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + +样例 + +请求: + +{ + "lib_name": "test4", + "lib_id": 5 + +} + + 第 17 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +2.4 获取人员库列表 + +基本信息 + +Path: /api/v2/personlib/list +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +lib_name string 否 人员库名称(模糊查询) +page integer 是 当前页 +pagesize integer 是 每页条数 + +返回数据 + + 第 18 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +code integer 是 0:success +data object 是 最大长度: 64 +├ list object [] 是 人员库 id +├─ lib_id integer 否 人员库名称 +└─ lib_name string 否 总条数 +└ total integer 是 +msg string 是 + +样例 + +请求: + +{ + "lib_name": "", + "pagesize": 16, + "page": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 4, + "list": [ + { + "lib_id": 1, + "lib_name": "placeat" + }, + { + "lib_id": 2, + "lib_name": "test" + + 第 19 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + }, + { + + "lib_id": 3, + "lib_name": "test-2" + }, + { + "lib_id": 5, + "lib_name": "test4" + } + ] + } +} + + 第 20 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +3 人员管理 + +3.1 新增人员 + +基本信息 + +Path: /api/v2/person/add +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +person_name string 是 最大长度: 64 +image_base64 string 是 姓名 + 最大长度: 64 +sex integer 否 人脸照片 base64 最大长度: 32 + +email string 否 性别 1:男 最大长度: 64 +tel string 否 2:女 99:未说明 + +certificate_type integer 否 邮箱 + +certificate_no string 否 联系方式 + + 证件类型 + 1:身份证 2:护照 + 3:行驶证 99:其它 + + 证件号码 + + 第 21 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +birth_date string 否 出生日期 +lib_id integer 是 人员库 id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 否 0:success +└ person_id integer 否 +msg string 是 人员 id + +样例 + +请求: + +{ + "person_name": "bar", + "image_base64": "{image_base64}", + "sex": 1, + "email": "bar@gmail.com", + "tel": "", + "certificate_type": 1, + "certificate_no": "370109200001010055", + "birth_date": "2000-01-01", + "lib_id": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + + 第 22 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "status_code": 0, + "data": { + + "person_id": 2007 + } +} + +3.2 批量新增人员 + +基本信息 + +Path: /api/v2/person/import +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +person_list object [] 是 最大长度: 64 +├ lib_id integer 是 人员库 id +├ person_name string 是 最大长度: 64 +├ image_base64 string 是 姓名 + +├ sex integer 否 人脸照片 + base64 +├ email string 否 + 性别 1:男 + 2:女 99:未说 + 明 + + 邮箱 + + 第 23 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +├ tel string 否 最大长度: 32 + 联系方式 +├ certificate_type integer 否 最大长度: 64 + 证件类型 1:身 +├ certificate_no string 否 份证 2:护照 +└ birth_date string 否 3:行驶证 99: + 其它 + + 证件号码 + + 出生日期 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 否 0:success +└ fail_list string [] 否 +msg string 是 导入失败的人员(姓名) + +样例 + +请求: + +{ + "person_list": [ + { + "person_name": "bar", + "image_base64": "{image_base64}", + "sex": 1, + "email": "bar@gmail.com", + "tel": "", + "certificate_type": 1, + "certificate_no": "370109200001010055", + "birth_date": "2000-01-01", + "lib_id": 1 + + 第 24 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + }, + { + + "person_name": "buzz", + "image_base64": "{image_base64}", + "sex": 1, + "email": "buzz@gmail.com", + "tel": "", + "certificate_type": 1, + "certificate_no": "", + "birth_date": "2000-01-02", + "lib_id": 1 + } + ] +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "fail_list": [] + } + +} + +3.3 批量删除人员 + +基本信息 + +Path: /api/v2/person/delete +Method: POST +接口描述: + +请求参数 + + 第 25 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type 类型 必填 默认值 备注 +Body integer [] 是 人脸 id + + 名称 + person_id_list + +返回数据 + +名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + +样例 + +请求: + +{ + "person_id_list": [ + 2008, + 2006 + ] + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + + 第 26 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +3.4 修改人员信息 + +基本信息 + +Path: /api/v2/person/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +person_id integer 是 人员 id 最大长度: 64 +person_name string 否 名称 最大长度: 64 + 性别 1:男 2:女 最大长度: 32 +sex integer 否 99:未说明 + 邮箱 最大长度: 64 +email string 否 联系方式 +tel string 否 证件类型 1:身份证 + 2:护照 3:行驶证 +certificate_type integer 否 99:其它 + 证件号码 +certificate_no string 否 人脸照片 base64 +image_base64 string 否 出生日期 +birth_date string 否 + + 第 27 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +返回数据 + +名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + +样例 + +请求: + +{ + "person_id": 2007, + "person_name": "bar", + "image_base64": "{image_base64}", + "sex": 2, + "email": "sample@gmail.com", + "tel": "", + "certificate_type": 1, + "certificate_no": "370109200001010055", + "birth_date": "2000-01-01", + "lib_id": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +3.5 获取人员列表 + +基本信息 + + 第 28 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Path: /api/v2/person/list +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +lib_id integer 是 最大长度: 64 +page integer 是 人员库 id 最大长度: 64 +pagesize integer 是 +person_name string 否 当前页码 + +sex integer 否 每页条数 + +certificate_no string 否 姓名(支持模糊查询) + +model_status integer 否 性别 999:全部 + 1:男 2:女 99:未说 + 明 + + 证件号 + + 建模状态 999:全部; + 1:未建模 2:建模中; + 3:建模成功;4:建模 + 失败 + +返回数据 + + 第 29 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +code string 是 0:success +data +├ list object 否 +├─ person_id +├─ person_name object [] 否 +├─ sex +├─ email integer 是 人员 id +├─ tel + string 是 姓名 最大长度: 64 +├─ modeling_type + integer 否 性别 1:男 2:女 +├─ certificate_type 99:未说明 + +├─ certificate_no string 否 邮箱 最大长度: 64 +├─ image_path +├─ lib_id string 否 联系方式 最大长度: 32 +├─ birth_date +└─ create_time integer 是 建模状态 1:未建 +└ total 模 2:建模中;3: +msg 建模成功;4:建模 + 失败 + + integer 否 证件类型 1:身份 + 证 2:护照 3:行 + 驶证 99:其它 + + string 否 证件号码 最大长度: 64 + + string 是 图片路径 最大长度: 256 + + integer 是 人员库 id + + string 否 出生日期 + + integer 否 创建时间 + + integer 是 总条数 + + string 是 + +样例 + +请求: +{ + + 第 30 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "lib_id": 1, + "page": 1, + "pagesize": 12, + "sex": 999, + "person_name": "", + "certificate_no": "", + "model_status": 999 +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 2, + "list": [ + { + "person_id": 2001, + "person_name": "1", + "sex": 1, + "email": "", + "tel": "", + "modeling_type": 3, + "certificate_type": 1, + "certificate_no": "", + "image_path": "/api/v2/smart/picture?Type=3&Inde + +x=ubs_0_0_0_0_2_1716429305/", + "lib_id": 1, + "birth_date": "", + "create_time": 2737353968 + + }, + { + + "person_id": 2002, + "person_name": "2", + "sex": 1, + "email": "", + + 第 31 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "tel": "", + "modeling_type": 3, + "certificate_type": 1, + "certificate_no": "", + "image_path": "/api/v2/smart/picture?Type=3&Inde +x=ubs_0_0_0_1_2_1716429313/", + "lib_id": 1, + "birth_date": "", + "create_time": 2737362084 + } + ] + } +} + + 第 32 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +4 点位管理 + +4.1 获取 rsa 公钥 + +基本信息 + +Path: /api/v2/rsa/publickey +Method: POST +接口描述: + +请求参数 + +返回数据 + + 名称 类型 必填 默认值 备注 其他信息 + code integer 是 + msg string 是 公钥 + data object 是 + └ public_key string 是 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "data": { + "public_key": "123456789" + + 第 33 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + } +} + +4.2 通过 onvif 获取设备码流信息 + +基本信息 + +Path: /api/v2/channel/device/info +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +ip string 是 相机 ip +port integer 是 相机端口 最大长度: 64 +username string 是 相机用户名 最大长度: 512 +pwd string 是 相机密码(RSA 加密) + +返回数据 + + 第 34 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 + 名称 类型 认 备注 最大长度: 32 + 最大长度: 32 +code 值 最大长度: 128 +data 最大长度: 64 +├ manufacturer integer 是 最大长度: 32 +├ model +├ firmware_version object 否 最大长度: 256 +├ serial_number 最大长度: 32 +├ hardware_id string 否 厂商 最大长度: 32 +├ video 型号 最大长度: 32 +├─ id string 否 固件版本 最大长度: 32 +├─ rtsp 序列号 最大长度: 32 +├─ bitrate string 否 硬件 id 最大长度: 32 +├─ encoding 码流列表 +├─ fps string 否 码流 id +├─ gop rtsp 地址 +├─ quality string 否 码率 +└─ ratio 编码格式 + object [] 是 帧率 +msg 画面组 + integer 是 质量 + 分辨率 + string 是 + + string 否 + + string 否 + + string 否 + + string 否 + + string 否 + + string 否 + + string 必 + 须 + +样例 + +请求: + +{ + "ip": "217.1.0.143", + "port": 80, + "username": "admin", + "pwd": "gMsL3NeLw===" + +} + + 第 35 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "manufacturer": "HD", + "model": "A27", + "firmware_version": "IPC_C6101-B0001P80L01D1809NB", + "serial_number": "18980000000000V00001", + "hardware_id": "A27", + "video": [ + { + "id": 1, + "rtsp": "rtsp://217.1.0.143/media/video1", + "bitrate": "1024", + "fps": "25", + "encoding": "H265", + "gop": "25", + "quality": "5", + "ratio": "1920*1080" + }, + { + "id": 2, + "rtsp": "rtsp://217.1.0.143/media/video2", + "bitrate": "1024", + "fps": "25", + "encoding": "H264", + "gop": "50", + "quality": "5", + "ratio": "720*576" + }, + { + "id": 3, + "rtsp": "rtsp://217.1.0.143/media/video3", + "bitrate": "128", + + 第 36 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "fps": "25", + "encoding": "H264", + "gop": "50", + "quality": "5", + "ratio": "352*288" + } + ] + } +} + +4.3 新增点位 + +基本信息 + +Path: /api/v2/channel/add +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +type integer 是 + 视频协议 1:onvif 2: + rtsp + +transport_type integer 否 传输协议(AIBOX 需要,一 + 体机不需要) 1: tcp 2: + udp + +channel_name string 是 点位名称 最大长度: 64 + + 第 37 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 + +rtsp string 否 最小长度: 1 +ip string 否 +port integer 否 rtsp 地址(当视频协议为 最大长度: 256 +username string 否 rtsp 时,该字段必填) +pwd string 否 +video_type integer 否 相机 ip(onvif 添加流时 + 必填) +video_id integer 否 +custom_code string 否 相机端口(onvif 添加流 + 时必填) + + 相机用户名 最大长度: 64 + + 相机密码(RSA 加密) 最大长度: 512 + + onvif 设备码流添加方 + 式:1:主码流 2:自定 + 义码流 + + 码流 id:当选择自定义码 + 流时,该字段必填,值为 + 获取设备码流信息接口返 + 回的码流 id + + 自定义编码 最大长度: 64 + +返回数据 + + 名称 类型 必填 默认值 备注 其他信息 +code integer 是 +data object 否 点位 id +└ channel_id integer 是 +msg string 是 + +样例 + +请求: + + 第 38 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + 第 39 页 共 148 页 +{ + "ip": "217.1.0.143", + "type": 1, + "port": 80, + "username": "admin", + "pwd": "pwdw===", + "rtsp": "rtsp://217.1.0.143/media/video1", + "transport_type": 1, + "channel_name": "Camera", + "serialnumber": "189802C04B7201V00081", + "manufacturer": "HD", + "model": "A27" + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "channel_id": 1 + } + +} + +4.4 删除点位 + +基本信息 + +Path: /api/v2/channel/delete +Method: POST +接口描述: + +请求参数 + +Headers + 文档名:边缘产品对外标准接口 密级:公开 + + 参数名称 参数值 必填 示例 备注 + Content-Type application/json 是 +Body + 类型 必填 默认值 备注 + 名称 integer [] 是 + channel_id_list + +返回数据 + +名称 类型 必填 默认值 备注 +code integer 必须 +msg string 必须 0:success + +样例 + +请求: + +{ + "channel_id_list": [ + 1 + ] + +} + +响应: + +{ + "code": 0, + "msg": "Succeed" + +} + + 第 40 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +4.5 修改点位信息 + +基本信息 + +Path: /api/v2/channel/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +channel_id integer 是 + 点位 id + +transport_type integer 否 传输协议(AIBOX 需要,一 + 体机不需要) 1: tcp 2: + udp + +channel_name string 是 点位名称 最大长度: 64 +rtsp string 否 + rtsp 地址(当视频协议为 最大长度: 256 + rtsp 时,该字段必填) + +ip string 否 相机 ip(onvif 添加流时 + 必填) + +port integer 否 相机端口(onvif 添加流 +username string 否 时必填) +pwd string 否 + 相机用户名 最大长度: 64 + + 相机密码(RSA 加密) 最大长度: 512 + + 第 41 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +video_type integer 否 + onvif 设备码流添加方 +video_id integer 否 式:1:主码流 2:自定 +custom_code string 否 义码流 + + 码流 id:当选择自定义码 + 流时,该字段必填,值为 + 获取设备码流信息接口返 + 回的码流 id + + 自定义编码,长度 64 最大长度: 64 + +返回数据 + +名称 类型 必填 默认值 备注 +code integer 必须 +msg string 必须 0:success + +样例 + +请求: + +{ + "channel_id": 1, + "channel_name": "Camera1", + "status": 1, + "ip": "217.1.0.143", + "port": 80, + "type": 1, + "username": "admin", + "off_reason": 1, + "manufacturer": "HD", + "model": "A27", + "serial_number": "189802C04B7201V00081", + "algo_model": "", + "Nums": 1, + + 第 42 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "pwd": "pwdQ===", + "serialnumber": "189802C04B7201V00081", + "rtsp": "rtsp://217.1.0.143/media/video1" +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +4.6 获取点位列表 + +基本信息 + +Path: /api/v2/channel/list +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + +名称 类型 必填 默认值 备注 其他信息 + 否 最大长度: 64 +channel_name string 是 点位名称(支持模糊查 + 询) +page integer + 当前页 + + 第 43 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +pagesize integer 是 每页条数 + +返回数据 + + 必 默 其他信息 + 填 认 +名称 类型 值 备注 + 0:success +code string 是 +data object +├ total integer 是 +├ channel_list object [] +├─ channel_id integer 是 总条数 +├─ custom_code string +├─ channel_name string 否 点位列表 + +├─ type integer 是 点位 id + + 否 自定义编码 最大长度: 64 + + 是 点位名称 最大长度: 64 + + 是 视频流协议 1:onvif + 2:rtsp + +├─ transport_type integer 否 传输协议(AIBOX 需 + 要,一体机不需要) 1: + 否 tcp 2: udp + 否 +├─ ip string 否 点位 ip +├─ port number 否 +├─ serial_number string 否 点位端口 +├─ model string 是 +├─ manufacturer string 否 相机序列号 最大长度: 64 +├─ status integer +├─ rtsp string 否 型号 最大长度: 32 + +└─ flv string 厂商 最大长度: 32 + + 1:在线;2:离线 + + rtsp 地址 + + flv 地址(一体机返 + 回) + + 第 44 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 +msg string + 是 + +样例 + +请求: + +{ + "page": 1, + "pagesize": 10, + "channel_name": "" + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 10, + "channel_list": [ + { + "channel_id": 1, + "channel_name": "Camera1", + "status": 1, + "ip": "217.1.0.143", + "port": 80, + "type": 1, + "username": "admin", + "off_reason": 1, + "manufacturer": "HD", + "model": "A27", + "serial_number": "189802C0000000V00001" + } + ] + + 第 45 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + } +} + +4.7 批量新增点位 + +基本信息 + +Path: /api/v2/channel/import +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +channel_list object [] 是 点位列表 + +├ type integer 是 视频流协议 1:onvif + 2:rtsp + +├ transport_type integer 否 传输协议(AIBOX 需 + 要,一体机不需要) 1: + tcp 2: udp + +├ channel_name string 是 点位名称 最大长度: 64 + +├ rtsp string 否 视频流 rtsp 地址 最大长度: 256 + +├ ip string 否 相机 ip(onvif 添加流 + 时必填) + + 第 46 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 +├ port string +├ username string 否 相机端口(onvif 添加 +├ pwd string 流时必填) +├ video_type integer + 否 相机用户名 最大长度: 64 +├ video_id integer + 否 相机密码(RSA 加密) 最大长度: 512 +└ custom_code string + onvif 设备码流添加方 + + 否 式:1:主码流 2:自 + + 定义码流 + + 码流 id:当选择自定 + + 义码流时,该字段必 + + 否 填,值为获取设备码流 + + 信息接口返回的码流 + + id + + 是 自定义编码 最大长度: 64 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 否 0:success +└ fail_list string [] 否 +msg string 是 导入失败的点位(名称) + +样例 + +请求: + +{ + "channel_list": [ + { + "ip": "217.1.0.143", + + 第 47 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "type": 1, + "port": 80, + "username": "admin", + "pwd": "pwdw===", + "rtsp": "rtsp://217.1.0.143/media/video1", + "transport_type": 1, + "channel_name": "Camera", + "serialnumber": "189802C04B7201V00081", + "manufacturer": "HD", + "model": "A27" + }, + { + "ip": "217.1.0.144", + "type": 1, + "port": 80, + "username": "admin", + "pwd": "pwdw===", + "rtsp": "rtsp://217.1.0.144/media/video1", + "transport_type": 1, + "channel_name": "Camera", + "serialnumber": "189802C04B7201V00082", + "manufacturer": "HD", + "model": "A27" + } + ] +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "data": { + "fail_list": [] + } + +} + + 第 48 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +5 点位布防时间 + +5.1 添加/修改布防时间 + +基本信息 + +Path: /api/v2/control/time/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 是 +algo_model string 是 点位 id +control_time object 是 算法类型 +├ monday object [] 是 布防时间 +├─ start string 否 +└─ end string 否 例:00:00 +├ tuesday object [] 是 例:24:00 +├─ start string 否 +└─ end string 否 +├ wednesday object [] 是 + + 第 49 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +├─ start string 否 +└─ end string 否 +├ thursday object [] 是 +├─ start string 否 +└─ end string 否 +├ friday object [] 是 +├─ start string 否 +└─ end string 否 +├ saturday object [] 是 +├─ start string 否 +└─ end string 否 +├ sunday object [] 是 +├─ start string 否 +└─ end string 否 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "channel_id": 1, + "algo_model": "FallOverAlarm", + + 第 50 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +"control_time": { + "monday": [ + { + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + "end": "24:00" + } + ], + "tuesday": [ + { + "start": "00:00", + "end": "05:00" + }, + { + "start": "15:00", + "end": "24:00" + } + ], + "wednesday": [ + { + "start": "00:00", + "end": "05:00" + }, + { + "start": "15:30", + "end": "24:00" + } + ], + "thursday": [ + { + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + + 第 51 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "end": "24:00" + } + ], + "friday": [ + { + + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + "end": "24:00" + } + ], + "saturday": [ + { + "start": "00:00", + "end": "10:00" + }, + { + "start": "14:30", + "end": "24:00" + } + ], + "sunday": [ + { + "start": "00:00", + "end": "10:00" + }, + { + "start": "14:30", + "end": "24:00" + } + ] + } +} + +响应: + + 第 52 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +5.2 获取布防时间 + +基本信息 + +Path: /api/v2/control/time/get +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 是 通道 id +algo_model string 是 算法类型 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 + + 第 53 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 + data object 否 + ├ monday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ tuesday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ wednesday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ thursday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ friday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ saturday object [] 是 + ├─ start string 否 + └─ end string 否 + ├ sunday object [] 是 + ├─ start string 否 + └─ end string 否 + msg string 是 + +样例 + +请求: + + 第 54 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +{ + "channel_id": 1, + "algo_model": "FallOverAlarm" + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "monday": [ + { + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + "end": "24:00" + } + ], + "tuesday": [ + { + "start": "00:00", + "end": "05:00" + }, + { + "start": "15:00", + "end": "24:00" + } + ], + "wednesday": [ + { + "start": "00:00", + "end": "05:00" + }, + { + + 第 55 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "start": "15:30", + "end": "24:00" + } +], +"thursday": [ + { + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + "end": "24:00" + } +], +"friday": [ + { + "start": "00:00", + "end": "04:00" + }, + { + "start": "12:30", + "end": "24:00" + } +], +"saturday": [ + { + "start": "00:00", + "end": "10:00" + }, + { + "start": "14:30", + "end": "24:00" + } +], +"sunday": [ + { + "start": "00:00", + "end": "10:00" + + 第 56 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + }, + { + + "start": "14:30", + "end": "24:00" + } + ] + } +} + + 第 57 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +6 智能配置 + +6.1 新增(修改)智能分析任务 + +基本信息 + +Path: /api/v2/smart/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必 默 备注 + 填 认 +smart_list object [] 值 +├ algo_model string +├ time_threshold integer 是 智能任务列表 +├ person_num_limit integer +├ person_float_limit integer 否 算法类型 最大长度: 64 +├ back_time_threshold integer + 否 触发时间(秒) +├ line_dpc_enable integer + 否 人数限制 + + 否 浮动人数 + + 否 背景刷新时间(秒) + + 绊线人数定时清零开关 + + 否 (一体机不支持此参 + + 数)1:开启 0:关闭 + + 第 58 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 +├ line_dpc_time integer 填 认 +├ detour_area integer 值 +├ object_type integer [] +├ max_person_object_height integer 绊线人数清零时间:整 +├ max_person_object_width integer +├ min_person_object_height integer 否 数 0-23(一体机不支 +├ min_person_object_width integer +├ max_vehicle_object_height integer 持) +├ max_vehicle_object_width integer +├ min_vehicle_object_height integer 否 是否为绕行区域 0 否 1 +├ min_vehicle_object_width integer 是 +├ max_nonVehicle_object_height integer + 区域入侵检测类型 1 行 + + 否 人 2 非机动车 3 机动车 + + 可多选 + + 否 行人最大目标高,最小 + 可为 0,最大小于 1080 + + 否 行人最大目标宽,最小 + 可为 0,最大小于 1920 + + 否 行人最小目标高,最小 + 可为 0,最大小于 1080 + + 否 行人最小目标宽,最小 + 可为 0,最大小于 1920 + + 机动车最大目标高,最 + + 否 小可为 0,最大小于 + + 1080 + + 机动车最大目标宽,最 + + 否 小可为 0,最大小于 + + 1920 + + 机动车最小目标高,最 + + 否 小可为 0,最大小于 + + 1080 + + 机动车最小目标宽,最 + + 否 小可为 0,最大小于 + + 1920 + + 非机动车最大目标高, + + 否 最小可为 0,最大小于 + + 1080 + + 第 59 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 +├ max_nonVehicle_object_width integer 填 认 +├ min_nonVehicle_object_height integer 值 +├ min_nonVehicle_object_width integer +├ workclothes_lib_list integer [] 非机动车最大目标宽, +├ graphs object [] +├─ graph_type string 否 最小可为 0,最大小于 +├─ polygon object +├─ detour_area integer 1920 +├── point_x string + 非机动车最小目标高, +└── point_y string +├─ line object 否 最小可为 0,最大小于 + + 1080 + + 非机动车最小目标宽, + + 否 最小可为 0,最大小于 + + 1920 + + 否 工服库 id + + 否 区域信息(注:各坐标 + 值范围均为 0~10000) + + 区域类型 区域: + + 否 polygon 绊线:line 混 + + 合:blend + + 区域坐标 当区域类型为 + + 否 polygon 或 blend 时,该 + 字段代表所绘制区域的 + + 坐标 + + 否 是否为绕行区域 0 否 1 + 是 + + 横坐标 区域类型为 + + 否 polygon 或 blend 时,需 + 绘制 3-6 个点,格式为 + + x1,x2,x3,x4,x5,x6 + + 纵坐标 区域类型为 + + 否 polygon 或 blend 时,需 + 绘制 3-6 个点,格式为 + + y1,y2,y3,y4,y5,y6 + + 绊线坐标 当区域类型为 + + 否 line 或 blend 时,该字 + + 段为绊线坐标 + + 第 60 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 + 填 认 + ├── point_x string 值 + + └── point_y string 横坐标 区域类型为 line + ├─ direction_line + ├── point_x object 否 或 blend 时,需绘制 2 + └── point_y string + person_control_info string 个点,格式为 x1,x2 + ├ alarm_threshold object + └ person_lib_id integer 纵坐标 区域类型为 line + channel_id integer [] + integer 否 或 blend 时,需绘制 2 +返回数据 + 个点,格式为 y1,y2 + + 否 方向线 + + 否 x1,x2 + + 否 y1,y2 + + 否 人员布控信息 + + 否 告警阈值(0-100) + + 否 人员库 id + + 是 点位 id + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + +样例 + +请求: + +{ + "smart_list": [ + { + "algo_model": "WorkClothesAlarm", + "workclothes_lib_list": [ + + 第 61 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 1 + ], + "graphs": [ + + { + "graph_type": "polygon", + "polygon": { + "point_x": "50,9950,9950,50", + "point_y": "50,50,9950,9950" + } + + } + ], + "title": "No Work Clothes Detection", + "id": 5, + "paintType": "polygon" + } + ], + "channel_id": 1 +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +6.2 获取智能分析任务列表 + +基本信息 + +Path: /api/v2/smart/list +Method: POST +接口描述: + +请求参数 + + 第 62 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type 类型 必填 默认值 备注 +Body integer 必须 点位 id + + 名称 + channel_id + +返回数据 + + 名称 类型 必 默 备注 + 填 认 +code number 值 +data object +├ smart_list object [] 是 0:success +├─ algo_model string +├─ time_threshold integer 否 +├─ person_num_limit integer +├─ back_time_threshold integer 否 智能任务列表 +├─ person_float_limit integer + 是 算法类型 最大长度: 64 +├─ line_dpc_enable integer + 否 触发时间(秒) +├─ line_dpc_time integer + 否 人数限制 +├─ object_type integer [] + 否 背景刷新时间(秒) + + 否 浮动人数 + + 绊线人数定时清零开关 + + 否 (一体机不支持此参数) + + 1:开启 0:关闭 + + 否 绊线人数清零时间:整数 + 0-23(一体机不支持) + + 区域入侵检测类型 1 行人 + + 否 2 非机动车 3 机动车 可多 + + 选 + + 第 63 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 + 填 认 +├─ max_person_object_height integer 值 + integer +├─ max_person_object_width integer 否 行人最大目标高,最小可为 + integer 0,最大小于 1080 +├─ min_person_object_height integer + integer 否 行人最大目标宽,最小可为 +├─ min_person_object_width integer 0,最大小于 1920 + integer +├─ integer 否 行人最小目标高,最小可为 +max_vehicle_object_height integer 0,最大小于 1080 + integer +├─ max_vehicle_object_width integer 否 行人最小目标宽,最小可为 + integer [] 0,最大小于 1920 +├─ object [] +min_vehicle_object_height string 否 机动车最大目标高,最小可 + 为 0,最大小于 1080 +├─ min_vehicle_object_width + 否 机动车最大目标宽,最小可 +├─ 为 0,最大小于 1920 +max_nonVehicle_object_height +├─ 否 机动车最小目标高,最小可 +max_nonVehicle_object_width 为 0,最大小于 1080 +├─ +min_nonVehicle_object_height 否 机动车最小目标宽,最小可 +├─ 为 0,最大小于 1920 +min_nonVehicle_object_width +├─ workclothes_lib_list 否 非机动车最大目标高,最小 + 可为 0,最大小于 1080 +├─ graphs + 否 非机动车最大目标宽,最小 +├── graph_type 可为 0,最大小于 1920 + + 否 非机动车最小目标高,最小 + 可为 0,最大小于 1080 + + 否 非机动车最小目标宽,最小 + 可为 0,最大小于 1920 + + 否 工服库 id + + 是 区域信息(注:各坐标值范 + 围均为 0~10000) + + 是 区域类型 区域:polygon + 绊线:line 混合:blend + + 第 64 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 + 填 认 + ├── polygon object 值 + + ├─── point_x string 区域坐标 当区域类型为 + + └─── point_y string 否 polygon 或 blend 时,该字 + + ├── line object 段代表所绘制区域的坐标 + + ├─── point_x string 横坐标 区域类型为 + + └─── point_y string 是 polygon 或 blend 时,需绘 + ├── direction_line object 制 3-6 个点,格式为 + ├─── point_x string + └─── point_y string x1,x2,x3,x4,x5,x6 + ├ person_control_info object + ├─ alarm_threshold string 纵坐标 区域类型为 + └─ person_lib_id integer [] + msg string 是 polygon 或 blend 时,需绘 + 制 3-6 个点,格式为 +样例 + y1,y2,y3,y4,y5,y6 +请求: + 绊线坐标 当区域类型为 + + 否 line 或 blend 时,该字段 + + 为绊线坐标 + + 横坐标 区域类型为 line 或 + + 是 blend 时,需绘制 2 个点, + + 格式为 x1,x2 + + 纵坐标 区域类型为 line 或 + + 是 blend 时,需绘制 2 个点, + + 格式为 y1,y2 + + 否 方向线 + + 是 x1,x2 + + 是 y1,y2 + + 否 人员布控信息 + + 否 告警阈值(0-100) + + 否 人员库 id + + 是 + + 第 65 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +{ + "channel_id": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "smart_list": [ + { + "algo_model": "FallOverAlarm", + "time_threshold": 5, + "graphs": [ + { + "polygon": { + "point_x": "50,9950,9950,50", + "point_y": "50,50,9950,9950" + }, + "graph_type": "polygon" + } + ] + } + ] + } + +} + +6.3 获取算法类型列表 + +基本信息 + +Path: /api/v2/algo/list +Method: POST +接口描述: + + 第 66 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +请求参数 参数值 必填 示例 备注 + application/json 是 +Headers + 参数名称 + + Content-Type +Body + +名称 类型 必填 默认值 备注 其他信息 + +返回数据 + + 名称 类型 必填 默认值 备注 +code number 否 +data object 否 0:success +└ algo_model string [] 是 +msg string 否 算法类型 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "algo_model": [ + "ObjectIsRecognized", + "FieldDetectorObjectsInside", + + 第 67 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "LineRuleData", + "AreaRuleData", + "AccessElevatorAlarm", + "ObjectRemoved", + "SafetyHelmetAlarm", + "WorkClothesAlarm", + "TelephoningAlarm", + "NoMaskAlarm", + "FallOverAlarm", + "OffDutyDetectionAlarm", + "SleepingDetectionAlarm", + "ReflectiveClothesDetectionAlarm", + "SmokingAlarm", + "PlayMobilePhoneDetection", + "FireDetection", + "FumesAlarmBegin", + "CrowdDensityCriticalAlarm", + "AbnormalParkingDetection", + "ChannelBlockageDetection" + ] + } +} + +6.4 获取扩展配置 + +基本信息 + +Path: /api/v2/extend/get +Method: POST +接口描述: + +请求参数 + +Headers + + 第 68 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 参数名称 参数值 必填 示例 备注 + Content-Type application/json 是 +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 否 + 点位 id,不传则返回全部点 + 位的扩展配置信息 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object [] 是 点位 id +├ channel_id integer 是 使能开关 1:开启 0:关闭 + 当使能开关关闭时,点位使用 +├ status integer 是 默认的灵敏度、告警间隔进行 + 下发 +├ smart_list object [] 是 +├─ algo_model 算法类型 最大长度: 64 +├─ sensitive string 是 灵敏度(1-100) +└─ report_rate 告警间隔(单位:秒;设置为 +msg integer 否 0 时,一次告警只上报一次) + + integer 否 + + string 是 + +样例 + +请求: +{ + + "channel_id": 1 + + 第 69 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": [ + { + "status": 0, + "channel_id": 1, + "smart_list": [ + { + "algo_model": "FieldDetectorObjectsInside", + "sensitive": 80 + }, + { + "algo_model": "LineDetectorCrossed", + "sensitive": 80 + }, + { + "algo_model": "EnterArea", + "sensitive": 80 + }, + { + "algo_model": "LeaveArea", + "sensitive": 80 + }, + { + "algo_model": "ObjectRemoved", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "LineRuleData", + "sensitive": 80 + }, + + 第 70 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +{ + "algo_model": "AreaRuleData", + "sensitive": 80 + +}, +{ + + "algo_model": "AccessElevatorAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "SmokingAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "SafetyHelmetAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "WorkClothesAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "TelephoningAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "NoMaskAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "FallOverAlarm", + "sensitive": 80, + "report_rate": 0 + + 第 71 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + }, + { + + "algo_model": "LongStayDetection", + "report_rate": 0 + }, + { + "algo_model": "FightDetectionAlarm", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "OffDutyDetectionAlarm", + "report_rate": 0 + }, + { + "algo_model": "SleepingDetectionAlarm", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "ReflectiveClothesDetectionAla + +rm", + + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "PlayMobilePhoneDetection", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "FireDetection", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "FumesAlarmBegin", + "sensitive": 80, + + 第 72 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "report_rate": 0 + }, + { + + "algo_model": "CrowdDensityCriticalAlarm", + "report_rate": 0 + }, + { + "algo_model": "AbnormalParkingDetection", + "report_rate": 0 + }, + { + "algo_model": "ChannelBlockageDetection", + "report_rate": 0 + } + ] + } + ] +} + +6.5 修改扩展配置 + +基本信息 + +Path: /api/v2/extend/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 第 73 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +list object [] 是 +├ channel_id integer 是 点位 id + +├ status integer 是 使能开关 1:开启 0:关闭 当 + 使能开关关闭时,点位使用默认 +├ smart_list object [] 是 的灵敏度、告警间隔进行下发 +├─ algo_model string 是 +├─ sensitive integer 否 算法类型 最大长度: 64 +└─ report_rate integer 否 + 灵敏度(1-100) + + 告警间隔(单位:秒;设置为 0 + 时,一次告警只上报一次) + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "list": [ + { + "channel_id": 1, + "smart_list": [ + { + "algo_model": "FieldDetectorObjectsInside", + "sensitive": 80 + }, + { + + 第 74 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "algo_model": "ObjectRemoved", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "LineRuleData", + "sensitive": 80 +}, +{ + "algo_model": "AreaRuleData", + "sensitive": 80 +}, +{ + "algo_model": "AccessElevatorAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "SmokingAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "SafetyHelmetAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "WorkClothesAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + "algo_model": "TelephoningAlarm", + "sensitive": 80, + "report_rate": 0 +}, +{ + + 第 75 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "algo_model": "NoMaskAlarm", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "FallOverAlarm", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "OffDutyDetectionAlarm", + "report_rate": 0 + }, + { + "algo_model": "SleepingDetectionAlarm", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "ReflectiveClothesDetectionAla + +rm", + + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "PlayMobilePhoneDetection", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "FireDetection", + "sensitive": 80, + "report_rate": 0 + }, + { + "algo_model": "FumesAlarmBegin", + "sensitive": 80, + "report_rate": 0 + + 第 76 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + }, + { + + "algo_model": "CrowdDensityCriticalAlarm", + "report_rate": 0 + }, + { + "algo_model": "AbnormalParkingDetection", + "report_rate": 0 + }, + { + "algo_model": "ChannelBlockageDetection", + "report_rate": 0 + } + ], + "status": 1 + } + ] +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +6.6 获取点位参数配置 + +基本信息 + +Path: /api/v2/smart/params/get +Method: POST +接口描述: + +请求参数 + + 第 77 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type 类型 必填 默认值 备注 +Body integer 是 点位 id + + 名称 + channel_id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 是 告警视频参数 +├ alarm_video_param object 是 +├─ status integer 是 是否开启告警视频(默认 + 关闭) 1:开启 0:关闭 +├─ befor_alarmed_time integer 是 + 告警前时间(单位:秒; +├─ after_alarmed_time integer 是 范围 5-30) +├ status_recovery_param object 是 +├─ status integer 是 告警后时间(单位:秒; +├ face_param object 是 范围 5-30) +├─ min_width string 是 + 告警恢复参数 +└─ min_height string 是 +msg string 是 是否开启告警恢复(默认 + 关闭) 1:开启 0:关闭 + + 人脸参数 + + 人脸最小过滤尺寸宽度, + 建议默认 10 + + 人脸最小过滤尺寸高度, + 建议默认 10 + + 第 78 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +样例 + +请求: + +{ + "channel_id": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "alarm_video_param": { + "status": 0, + "befor_alarmed_time": 5, + "after_alarmed_time": 5 + }, + "face_param": { + "min_width": 30, + "min_height": 30 + }, + "status_recovery_param": { + "status": 0 + } + } + +} + +6.7 修改点位参数配置 + +基本信息 + +Path: /api/v2/smart/params/update +Method: POST + + 第 79 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +接口描述: 参数值 必填 示例 备注 + application/json 是 +请求参数 + +Headers + 参数名称 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 是 +alarm_video_param object 否 点位 id +├ status + integer 是 告警视频参数 +├ befor_alarmed_time + integer 是 是否开启告警视频(默认关 +└ after_alarmed_time 闭) 1:开启 0:关闭 +status_recovery_param integer 是 +└ status object 否 告警前时间(单位:秒;范围 +face_param integer 是 5-30) +├ min_width object 否 + integer 是 告警后时间(单位:秒;范围 +└ min_height 5-30) + integer 是 + 告警恢复参数 + + 是否开启告警恢复(默认关 + 闭) 1:开启 0:关闭 + + 人脸参数 + + 人脸最小过滤尺寸宽度,建议 + 默认 10 + + 人脸最小过滤尺寸高度,建议 + 默认 10 + +返回数据 + + 第 80 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +code integer 必须 +msg string 必须 + +样例 + +请求: + +{ + "channel_id": 1, + "alarm_video_param": { + "status": 0, + "befor_alarmed_time": 5, + "after_alarmed_time": 5 + }, + "status_recovery_param": { + "status": 0 + }, + "face_param": { + "min_width": 30, + "min_height": 30 + } + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +6.8 任务启停接口 + +基本信息 + + 第 81 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Path: /api/v2/smart/task +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 是 点位 id +status integer 是 1:开启 0:关闭 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "channel_id": 1, + "status": 1 + +} + +响应: + + 第 82 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +6.9 实时轮巡设置 + +基本信息 + +Path: /api/v2/smart/cycle +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +channel_id integer 是 点位 id +status integer 是 1:实时 2:轮巡 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 + + 第 83 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +msg string 是 + +样例 + +请求: + +{ + "channel_id": 1, + "status": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + + 第 84 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +7 工服库管理 + +7.1 新增工服库 + +基本信息 + +Path: /api/v2/workclotheslib/add +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +lib_name string 是 工服库名称 + 最大长度: 64 + 最小长度: 1 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 是 工服库 id +└ lib_id integer 是 +msg string 是 + + 第 85 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +样例 + +请求: + +{ + "lib_name": "lib1" + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "lib_id": 2 + } + +} + +7.2 修改工服库 + +基本信息 + +Path: /api/v2/workclotheslib/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 第 86 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +lib_id integer 是 工服库 id +lib_name string 最大长度: 64 + 是 工服库名称 最小长度: 1 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 0:success +msg string 是 + +样例 + +请求: + +{ + "lib_name": "lib2", + "lib_id": 2 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +7.3 删除工服库 + +基本信息 + +Path: /api/v2/workclotheslib/delete + + 第 87 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Method: POST 参数值 必填 示例 备注 +接口描述: application/json 是 + +请求参数 + +Headers + 参数名称 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +lib_id integer 是 工服库 id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "lib_id": 2 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + + 第 88 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "status_code": 0 +} + +7.4 查询工服库信息 + +基本信息 + +Path: /api/v2/workclotheslib/list +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +lib_name string 否 工服库名称(支持模糊查询) +page integer 是 当前页 +pagesize integer 是 每页条数 + +返回数据 + + 名称 类型 必填 默认值 备注 + integer 是 +code object 否 +data + + 第 89 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +├ workcloth_lib_list object [] 是 +├─ lib_id integer 是 工服库 id +├─ lib_name string 是 + 工服库名称 最大长度: +├─ create_time integer 是 64 +└ total integer 是 +msg string 是 创建时间,10 位秒级时间 + 戳 + + 总条数 + +样例 + +请求: + +{ + "lib_name": "", + "page": 1, + "pagesize": 12 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 1, + "workcloth_lib_list": [ + { + "lib_id": 1, + "lib_name": "默认工服库", + + "create_time": 1550108725 + } + ] + + 第 90 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + } +} + + 第 91 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +8 工服管理 + +8.1 新增工服-单个 + +基本信息 + +Path: /api/v2/workclothes/add +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +lib_id number 是 工服库 id +image_base64 string 是 工服图片 base64 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 否 工服 id +└ workclothes_id integer 否 + + 第 92 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +msg string 是 + +样例 + +请求: + +{ + "lib_id": 1, + "image_base64": "/9j/4AAQSkZJRgABAQEAYABg" + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "workclothes_id": 2001 + } + +} + +8.2 新增工服-批量 + +基本信息 + +Path: /api/v2/workclothes/batchadd +Method: POST +接口描述: + +一次最多添加 50 条 + +请求参数 + + 第 93 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type 类型 必填 默认值 备注 +Body integer 是 工服库 id + string [] 是 工服图片 base64 + 名称 + lib_id + image_base64 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 否 成功工服 id +├ workclothes_id integer [] 否 失败图片列表 +├ fail_list object [] 否 失败图片序号 从 0 开始 +├─ index integer 是 失败原因 最大长度: 64 +└─ reason string 是 +msg string 是 + +样例 + +请求: + +{ + "lib_id": 1, + "image_base64": [ + "/9j/4AAQSkZJRgABAQEAYABg" + ] + +} + + 第 94 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "workclothes_id": [ + 2001 + ], + "fail_list": [] + } + +} + +8.3 删除工服 + +基本信息 + +Path: /api/v2/workclothes/delete +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 + integer 是 工服库 id +lib_id + + 第 95 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +workclothes_id_list integer [] 是 工服 id + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "lib_id": 1, + "workclothes_id_list": [ + 2001 + ] + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +8.4 查找工服列表 + +基本信息 + +Path: /api/v2/workclothes/list + + 第 96 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Method: POST 参数值 必填 示例 备注 +接口描述: application/json 是 + +请求参数 + +Headers + 参数名称 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 +lib_id integer 是 工服库 id +page integer 是 当前页 +pagesize integer 是 每页条数 + 建模状态 999:全部;1:未建模 2:建 +model_status integer 否 模中;3:建模成功;4:建模失败 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 是 总条数 +├ total integer 是 +├ workclothes_list object 是 工服库 id +├─ lib_id number 是 工服 id +├─ workclothes_id number 是 图片相对路径 最大长度: 256 +├─ image_path string 是 创建时间,10 位时间戳,秒级 +├─ create_time integer 是 + + 第 97 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 +└─ model_status number 否 +msg string 是 建模状态 1:未建模 2:建模 + 中;3:建模成功;4:建模失 + 败 + +样例 + +请求: + +{ + "lib_id": 1, + "model_status": 999, + "page": 1, + "pagesize": 12 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "workclothes_list": [], + "total": 0 + } + +} + + 第 98 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +9 设备信息 + +9.1 修改设备信息 + +基本信息 + +Path: /api/v2/device/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 其他信息 +device_name string 是 设备名称 最大长度: 64 +device_code integer 是 设备编号,1-255 最大值: 255 +custom_code string 否 自定义编码 最大长度: 64 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 0:success + + 第 99 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +样例 + +请求: + +{ + "device_name": "ECS-B501@8HA-SF", + "device_code": 1 + +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +9.2 查询设备信息 + +基本信息 + +Path: /api/v2/device/get +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + +名称 类型 必填 默认值 备注 其他信息 + + 第 100 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +返回数据 + + 名称 类型 必填 默认 备注 其他信息 +code integer 是 值 0:success +msg string 是 最大长度: 64 +data object 是 设备名称 最大长度: 32 +├ device_name string 是 设备型号 最大长度: 64 +├ device_model string 是 设备序列号 最大长度: 128 +├ serial_number string 是 软件版本号 +├ firmware_version string 是 版本发布时间,时间 最大长度: 64 +├ release_time integer 是 戳 + 设备编码, 1-255。 +├ device_code integer 是 默认是 1。 +└ custom_code string 否 自定义编码 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "device_name": "ECS-B501@8HA-SF", + "device_model": "ECS-B501@8HA-SF", + "serial_number": "210235C8TS5804696123", + + 第 101 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "firmware_version": "ECS_B501_SF-B1105.2.05.240516", + "release_time": 1715796720, + "device_code": 1 + } +} + + 第 102 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +10 升级 + +10.1 上传升级包 + +基本信息 + +Path: /api/v2/upgrade +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 multipart/form-data 是 + + Content-Type 参数类型 必填 示例 备注 + file 是 升级包 +Body + 参数名称 + + file + +返回数据 + + 名称 类型 必填 默认值 备注 + code integer 是 + msg string 是 + +样例 + +请求: + + 第 103 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +10.2 获取升级状态 + +基本信息 + +Path: /api/v2/upgrade/status +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/x-www-form-urlencoded 是 + + Content-Type + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +data object 是 + +└ status integer 是 1:传输中 2:升级中 3:升级成功 4: + 升级失败注:升级完成后设备会进行重 + 启,此时接口无法调通,请耐心等待直 + 到返回升级成功或升级失败 + +msg string 是 + + 第 104 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "data": { + "status": 2 + }, + "status_code": 0 + +} + + 第 105 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +11 数据检索 + +11.1 行为分析检索 + +基本信息 + +Path: /api/v2/search/behavior +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + +名称 类型 必 默 备注 + 填 认 + 值 +page integer 是 + 页码数 +pagesize integer 是 + 每页数据量 + +channel_id integer 是 通道 id + [] + +algo_model string [] 否 算法类型,送空查全部 + 开始时间,10 位时间戳(秒级) +start_time integer 是 结束时间,10 位时间戳(秒级) + 是否有比对:1 全部,2 有比对 不传查全部 +end_time integer 是 + +compare_flag integer 否 + + 第 106 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 + 填 认 +object_type integer[] 值 +plate_no string + 否 目标类型 区域入侵告警查询条件 1 行人 2 + 机动车 3 非机动车 + + 否 车牌号 + +返回数据 + + 名称 类型 必 默 备注 其他信息 + 填 认 +code integer 值 最大长度: 256 +msg string 最大长度: 128 +data object 是 0:success 最大长度: 64 +├ total integer 最大长度: 256 +├ list object [] 是 最大长度: 16 +├─ alarm_id integer +├─ big_picture_url string 是 +├─ algo_model string + 是 总条数 +├─ capture_time integer + 否 +├─ channel_id integer +├─ channel_name string 是 告警 id +├─ video_url string +├─ object_list object [] 是 告警大图地址 + +└── plate_no string 是 算法类型 + +├─ compare_list object [] 是 告警发生的时间戳, + 秒级 + + 是 告警所在通道 + + 是 通道名称 + + 否 告警视频地址 + + 是 + + 是 车牌号(仅车辆违停 + 占用上报) + + 否 人脸比对结果 + + 第 107 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +├── base_image_id integer 否 人脸底图 id +├── base_image_url string +├── name string 否 人脸底图 url 最大长度: 256 +├── certificate_no string +├── similarity integer 否 姓名 最大长度: 64 +└── match_type number + 否 证件号 最大长度: 64 + + 否 相似度 1-100 + + 是 1:比对成功,2 比对 + 失败 + +样例 + +请求: + +{ + "page": 1, + "pagesize": 10, + "channel_id": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "algo_model": [ + "FieldDetectorObjectsInside", + "SafetyHelmetAlarm", + "WorkClothesAlarm", + "TelephoningAlarm", + "NoMaskAlarm", + "FallOverAlarm", + "OffDutyDetectionAlarm", + + 第 108 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "SmokingAlarm", + "SleepingDetectionAlarm", + "ReflectiveClothesDetectionAlarm", + "PlayMobilePhoneDetection", + "FireDetection", + "FumesAlarmBegin", + "CrowdDensityCriticalAlarm", + "AbnormalParkingDetection", + "ChannelBlockageDetection", + "AccessElevatorAlarm", + "ObjectRemoved" + ], + "start_time": 1716480000, + "end_time": 1716566399, + "compare_flag": 1 +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 1210, + "list": [ + { + "alarm_id": 6318, + "capture_time": 1716521787, + "channel_id": 1, + "channel_name": "Camera1", + "algo_model": "SafetyHelmetAlarm", + "big_picture_url": "/api/v2/smart/picture?Type=1 + +&Index=ubs_5_0_0_0_0_0_752_55_64647_1716521787&Size=222974", + "object_list": [ + { + "plate_no": "" + } + + 第 109 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + ], + "compare_list": [ + + { + "match_type": 1, + "base_image_id": 2005, + "name": "5", + "similarity": 95, + "certificate_no": "", + "base_image_url": "/api/v2/smart/picture + +?Type=3&Index=ubs_0_0_0_4_2_1716429337/Pic_1716429337015.jpg&Siz +e=9999" + + } + ] + } + ] + } +} + +11.2 人脸抓拍检索 + +基本信息 + +Path: /api/v2/search/facecap +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 第 110 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +page integer 是 页码数 +pagesize +channel_id integer 是 每页数据量 +start_time + integer [] 是 通道 id +end_time +faceattr integer 是 开始时间,10 位时间戳(秒 +├ gender 级) + +├ age integer 是 结束时间,10 位时间戳(秒 + 级) +├ glass + object 否 +└ mask + integer 否 性别:999:全部 1:男 +compare_flag 2:女 99:未知 + +name integer 否 年龄:999:全部 5:儿童 +certificate_no 20:少年 40:青年 60:中年 +similarity 99:老年 +├ min +└ max integer 否 眼镜:999:全部 1:未佩戴 + 眼睛 2:佩戴眼镜 + + integer 否 口罩:999:全部 1:无口罩 + 2:有口罩 + + integer 是 是否有比对:1 全部,2 有比 + 对 不传查全部 + + string 否 人员姓名,模糊查询 最大长度: 64 + + 最大长度: 50 最小长度: 10 + + string 否 证件号,模糊查询 最大长度: 64 + + object 否 相似度,0-100 + + integer 是 最小值 + + integer 是 最大值 + +返回数据 + + 第 111 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +code integer 是 0:success +msg string +data object 是 +├ total integer +├ list object [] 否 +├─ alarm_id integer +├─ big_picture_url string 是 总条数 +├─ small_picture_url string +├─ capture_time integer 是 +├─ channel_id integer +├─ channel_name string 是 告警 id +├─ gender integer + 是 告警大图地址 最大长度: 256 +├─ glass integer + 是 告警小图地址 最大长度: 256 +├─ age integer + 是 告警发生的时间戳,秒 +└─ mask integer 级 +├─ compare_list object [] +├── base_image_id integer 是 告警所在通道 +├── base_image_url string +├── name string 是 通道名称 最大长度: 64 +├── similarity integer +├── certificate_no string 是 性别: 1:男 2:女 + 99:未知 + + 是 眼镜: 1:未佩戴眼睛 + 2:佩戴眼镜 + + 年龄 5:儿童 20:少 + + 是 年 40:青年 60:中年 + + 99:老年 + + 是 口罩: 1:无口罩 2: + 有口罩 + + 否 + + 否 人脸底图 id + + 否 人脸底图 url 最大长度: 256 + + 否 姓名 最大长度: 64 + + 否 相似度 1-100 + + 否 证件号 最大长度: 64 + + 第 112 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 +└── match_type number + 是 1:比对成功,2:比对 + 失败 + +样例 + +请求: + +{ + "page": 1, + "pagesize": 10, + "channel_id": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "start_time": 1715702400, + "end_time": 1716566399, + "faceattr": { + "gender": 999, + "age": 999, + "glass": 999, + "mask": 999 + }, + "compare_flag": 1, + "name": "", + "match_type": 999, + "certificate_no": "", + "similarity": { + "min": 1, + "max": 100 + + 第 113 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + } +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 2028, + "list": [ + { + "alarm_id": 5109, + "capture_time": 1716464847, + "channel_id": 1, + "channel_name": "Camera1", + "algo_model": "ObjectIsRecognized", + "big_picture_url": "/api/v2/smart/picture?Type=1 + +&Index=ubs_5_0_0_0_0_0_751_75_40042_1716464847&Size=304742", + "small_picture_url": "/api/v2/smart/picture?Type + +=2&Index=ubs_5_0_0_0_0_0_751_1_40041_1716464847&Size=3841", + "gender": 2, + "age": 40, + "glass": 1, + "mask": 1, + "compare_list": [ + { + "match_type": 1, + "base_image_id": 2005, + "name": "5", + "similarity": 95, + "certificate_no": "", + "base_image_url": "/api/v2/smart/picture + +?Type=3&Index=ubs_0_0_0_4_2_1716429337/Pic_1716429337015.jpg&Siz +e=9999" + + } + ] + + 第 114 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + } + ] + } +} + +11.3 行为比对检索 + +基本信息 + +Path: /api/v2/search/behaviormatch +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 默 备注 其他信息 + 必填 认 最大长度: 64 +page integer +pagesize integer 值 +channel_id integer [] +start_time integer 是 页码数 + +end_time integer 是 每页数据量 +name string + 是 通道 id + + 是 开始时间,10 位时间戳 + (秒级) + + 是 结束时间,10 位时间戳 + (秒级) + + 否 人员姓名 + + 第 115 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +名称 类型 默 备注 其他信息 + 必填 认 最大长度: 64 + + 值 + +certificate_no string 否 证件号,模糊匹配 +algo_model string [] +similarity object 否 算法类型,送空查全部 +├ min integer +└ max integer 否 相似度,0-100 + + 是 最小值 + + 是 最大值 + +返回数据 + + 名称 类型 必填 默认值 备注 其他信息 +code integer 是 0:success +msg string 是 +data object 否 总条数 +├ total integer 是 +├ list object [] 是 告警 id +├─ alarm_id integer 是 告警大图地 最大长度: 256 +├─ big_picture_url string 是 址 + 告警算法类 最大长度: 128 +├─ algo_model string 是 型 + 告警发生的 +├─ capture_time integer 是 时间戳,秒 + 级 +├─ channel_id integer 是 告警所在通 +├─ channel_name string 是 道 +├─ object_list object [] 否 通道名称 最大长度: 64 + + 第 116 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必填 默认值 备注 其他信息 +├── base_image_id +├── base_image_url integer 否 人脸底图 +├── name id +├── certificate_no +├── similarity string 否 人脸底图 最大长度: 256 + url +└── match_type + string 否 姓名 最大长度: 64 + + string 否 证件号 最大长度: 64 + + integer 否 相似度 1- + 100 + + number 是 1:比对成 + 功,2 比对 + 失败 + +样例 + +请求: + +{ + "page": 1, + "pagesize": 10, + "channel_id": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "start_time": 1714579199, + "end_time": 1716480000, + "name": "", + "match_type": 999, + "certificate_no": "", + "algo_model": [ + + 第 117 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "FieldDetectorObjectsInside", + "SafetyHelmetAlarm", + "WorkClothesAlarm", + "TelephoningAlarm", + "NoMaskAlarm", + "FallOverAlarm", + "OffDutyDetectionAlarm", + "SmokingAlarm", + "SleepingDetectionAlarm", + "ReflectiveClothesDetectionAlarm", + "PlayMobilePhoneDetection", + "FireDetection", + "FumesAlarmBegin", + "CrowdDensityCriticalAlarm", + "AbnormalParkingDetection", + "ChannelBlockageDetection", + "AccessElevatorAlarm", + "ObjectRemoved" + ], + "similarity": { + "min": 1, + "max": 100 + } +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "total": 131, + "list": [ + { + "alarm_id": 3741, + "capture_time": 1716429656, + "channel_id": 1, + + 第 118 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "channel_name": "Camera1", + "algo_model": " NoMaskAlarm", + "big_picture_url": "/api/v2/smart/picture?Type=1 +&Index=ubs_5_0_0_0_0_0_751_48_40622_1716429656&Size=192509", + "gender": 2, + "age": 40, + "glass": 1, + "mask": 1, + "object_list": [ + + { + "match_type": 1, + "base_image_id": 2005, + "name": "5", + "similarity": 95, + "certificate_no": "", + "base_image_url": "/api/v2/smart/picture + +?Type=3&Index=ubs_0_0_0_4_2_1716429337/Pic_1716429337015.jpg&Siz +e=9999" + + } + ] + } + ] + } +} + +11.4 人脸比对检索 + +基本信息 + +Path: /api/v2/search/facematch +Method: POST +接口描述: + +请求参数 + +Headers + + 第 119 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 参数名称 参数值 必填 示例 备注 + Content-Type application/json 是 +Body + + 名称 类型 必 默认 备注 其他信息 +page +pagesize integer 填 值 +channel_id integer + integer 是 页码数 +match_type [] + 是 每页数据量 + integer + 是 通道 id + + 否 比对结果 1 成功 2 失败 99 全 + 部 + +start_time integer 是 开始时间,10 位时间戳(秒 + 级) + +end_time integer 是 结束时间,10 位时间戳(秒 + 级) + +name string 否 人员姓名,模糊查询 最大长度: 64 + + 最大长度: 50 最小长度: 10 + +certificate_no string 否 证件号,模糊查询 最大长度: 64 +similarity object +├ min integer 否 相似度,0-100 +└ max integer +faceattr object 是 最小值 + + 是 最大值 + + 否 + +├ gender integer 否 性别:999:全部 1:男 2: + 女 3:未知 + + 年龄:999:全部 5:儿童 + +├ age integer 否 20:少年 40:青年 60:中 + + 年 99:老年 + +├ glass string 否 眼睛:999:全部 1:未佩戴 + 眼睛 2:佩戴眼镜 + + 第 120 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默认 备注 其他信息 +└ mask string + 填 值 + + 否 口罩:999:全部 1:无口罩 + 2:有口罩 + +返回数据 + + 名称 类型 必 默 备注 其他信息 + 填 认 +code 值 最大长度: 256 +msg 最大长度: 128 +data integer 是 0:success 最大长度: 64 +├ total 最大长度: 256 +├ list string 是 最大长度: 64 +├─ alarm_id 最大长度: 64 +├─ big_picture_url object 否 +├─ algo_model + integer 是 总条数 +├─ capture_time + object [] 是 +├─ channel_id +├─ channel_name integer 是 告警 id +├─ object_list +├── base_image_id string 是 告警大图地址 +├── base_image_url +├── name string 是 报警算法类型 +├── similarity +├── certificate_no integer 是 告警发生的时间 + 戳,秒级 + + integer 是 告警所在通道 + + string 是 通道名称 + + object [] 否 + + integer 否 人脸底图 id + + string 否 人脸底图 url + + string 否 姓名 + + integer 否 相似度 1-100 + + string 否 证件号 + + 第 121 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 +├── small_picture_url string +└── match_type number 是 告警小图地址 最大长度: 256 + + 是 1:比对成功,2: + 比对失败 + +样例 + +请求: + +{ + "page": 1, + "pagesize": 10, + "channel_id": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "start_time": 1714579199, + "end_time": 1716480000, + "name": "", + "match_type": 999, + "certificate_no": "", + "similarity": { + "min": 1, + "max": 100 + } + +} + +响应: +{ + + 第 122 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + + "total": 131, + "list": [ + + { + "alarm_id": 3741, + "capture_time": 1716429656, + "channel_id": 1, + "channel_name": "Camera1", + "algo_model": "ObjectIsRecognized", + "big_picture_url": "/api/v2/smart/picture?Type=1 + +&Index=ubs_5_0_0_0_0_0_751_48_40622_1716429656&Size=192509", + "gender": 2, + "age": 40, + "glass": 1, + "mask": 1, + "object_list": [ + { + "small_picture_url": "/api/v2/smart/pict + +ure?Type=2&Index=ubs_5_0_0_0_0_0_751_2_40620_1716429656&Size=478 +3", + + "match_type": 1, + "base_image_id": 2005, + "name": "5", + "similarity": 95, + "certificate_no": "", + "base_image_url": "/api/v2/smart/picture +?Type=3&Index=ubs_0_0_0_4_2_1716429337/Pic_1716429337015.jpg&Siz +e=9999" + } + ] + } + ] + } +} + + 第 123 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 第 124 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +12 平台对接 + +12.1 新增/修改平台对接信息 + +基本信息 + +Path: /api/v2/docking/config/update +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 必 默 其他信息 + 填 + 名称 类型 认 备注 + +platform 值 +├ id +├ version_code object [] 是 平台配置 +├ enabled +├ url integer 是 对接平台 id。最多支 +├ picture_enable 持 2 个平台,0 + + string 是 接口版本,"V2.0". 最大长度: 128 + + integer 是 接口版本。1:开启 + 0:关闭 + + string 是 告警上报地址 最大长度: 256 + + integer 是 上传图片使能开关, + 1:开启 0:关闭 + + 第 125 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 + 名称 类型 认 备注 + +├ video_enable 值 +├ http_alive +├ alive_interval integer 是 上传短视频使能开关, +└ channel_enable 1:开启 0:关闭 +time_conf +├ channel_id integer 是 http 保活使能开关, +├ interval 1:开启 0:关闭 +└ enable + integer 是 保活上报间隔,单位是 + 秒,范围:30-600 + + integer 是 通道状态上报使能开 + 关,1:开启 0:关闭 + + object [] 是 上传时间间隔配置 + + integer 是 通道 id + + integer 是 时间间隔,单位是分 + 钟,范围:0-10080 + + integer 是 间隔使能开关,1:开 + 启 2:关闭 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 必须 错误码 +msg string 必须 错误信息 + +样例 + +请求: + +{ + "platform": [ + { + "id": 1, + "url": "http://217.1.1.188:8000", + + 第 126 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "enabled": 1, + "picture_enable": 0, + "video_enable": 0, + "http_alive": 0, + "alive_interval": 30, + "channel_enable": 0, + "version_code": "V2.0" + }, + { + "id": 2, + "version_code": "20240423AIBOX", + "enabled": 1, + "url": "http://217.1.1.188:8002", + "picture_enable": 0, + "video_enable": 0, + "http_alive": 0, + "alive_interval": 30, + "channel_enable": 0 + } +], +"time_conf": [ + { + "channel_id": 1, + "enable": 0, + "interval": 100 + }, + { + "channel_id": 2, + "enable": 0, + "interval": 200 + }, + { + "channel_id": 3, + "enable": 0, + "interval": 300 + }, + { + "channel_id": 4, + + 第 127 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + 第 128 页 共 148 页 + "enable": 0, + "interval": 400 + }, + { + "channel_id": 5, + "enable": 1, + "interval": 500 + }, + { + "channel_id": 6, + "enable": 0, + "interval": 600 + }, + { + "channel_id": 7, + "enable": 1, + "interval": 700 + }, + { + "channel_id": 8, + "enable": 1, + "interval": 800 + } + ] +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +12.2 查询平台对接信息 + +基本信息 + 文档名:边缘产品对外标准接口 密级:公开 + +Path: /api/v2/docking/config/get +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + +名称 类型 必填 默认值 备注 + +返回数据 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +code integer 是 +data object +├ time_conf object [] 是 +├─ channel_id integer +├─ interval integer 是 上传时间配置 + +├─ enable integer 是 通道 id + +└─ channel_name string 是 时间间隔,单位秒 +├ platform object [] +├─ id integer 是 间隔使能开关,1:开启 + 0:关闭 + + 是 通道名称 最大长度: 64 + + 是 + + 是 平台 id + + 第 129 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + + 接口版本。例如 最大长度: 128 + +├─ version_code string 是 V1.0:AapiV1.0 + + V2.0:V2.0 + +├─ enabled integer 是 使能开关,1:开启 0: + 关闭 + +├─ url string 否 告警上报地址 最大长度: 256 + +├─ picture_enable integer 是 上传图片使能开关,1: + 开启 0:关闭 + +├─ video_enable integer 是 上传短视频使能开关, + 1:开启 0:关闭 + +├─ http_alive integer 是 http 保活使能开关,1: + 开启 0:关闭 + +├─ alive_interval integer 否 保活上报间隔,单位是 + 分钟 + +└─ channel_enable integer 是 通道状态上报使能开 + 关,1:开启 0:关闭 + +msg string 是 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "time_conf": [ + { + "channel_id": 1, + + 第 130 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "enable": 0, + "channel_name": "", + "interval": 100 +}, +{ + "channel_id": 2, + "enable": 0, + "channel_name": "", + "interval": 200 +}, +{ + "channel_id": 3, + "enable": 0, + "channel_name": "", + "interval": 300 +}, +{ + "channel_id": 4, + "enable": 0, + "channel_name": "", + "interval": 400 +}, +{ + "channel_id": 5, + "enable": 1, + "channel_name": "", + "interval": 500 +}, +{ + "channel_id": 6, + "enable": 0, + "channel_name": "", + "interval": 600 +}, +{ + "channel_id": 7, + "enable": 1, + "channel_name": "", + + 第 131 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "interval": 700 + }, + { + + "channel_id": 8, + "enable": 1, + "channel_name": "", + "interval": 800 + } + ], + "platform": [ + { + "id": 1, + "url": "http://217.1.1.188:8000", + "enabled": 1, + "picture_enable": 0, + "video_enable": 0, + "http_alive": 0, + "alive_interval": 30, + "channel_enable": 0, + "version_code": "V2.0" + } + ] + } +} + + 第 132 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +12.3 查询平台对接能力 + +基本信息 + +Path: /api/v2/docking/ability/get +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 名称 类型 必填 默认值 备注 + +返回数据 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +code integer 是 +data object +├ list object [] 是 +├─ version_code string +└─ version_name string 是 + + 是 版本编码 + + 是 版本名称 + +样例 + + 第 133 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0, + "data": { + "list": [ + { + "version_code": "V1.0", + "version_name": "1.0 接口" + + }, + { + + "version_code": "V2.0", + "version_name": "2.0 接口" + + } + ] + } +} + + 第 134 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +13 数据上报 + +13.1 告警数据上报 + +基本信息 + +Path: /custom/router1 +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 application/json 是 + + Content-Type +Body + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +type integer 上报内容 + +event_id string 1:行为分析告警数据 +has_result integer +device_info object 2:告警恢复数据 + + 是 3:人脸抓拍数据 + 4:人脸比对数据 + + 5:行为比对数据 + + 6:保活数据 + + 7:点位变更数据 + + 是 告警 id + + 是 有无比对结果 1 有 0 无 + + 是 设备信息 + + 第 135 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +├ device_code integer 是 设备编码(1-255) +├ device_name string +├ device_sn string 是 设备名称 最大长度: 64 +└ custom_code string +channel_info object 是 设备序列号 最大长度: 64 + +├ mode integer 否 自定义编码 最大长度: 64 + +├ ipc_sn string 否 点位信息 +├ ipc_addr string +├ channel_id integer 上报模式: +├ channel_name string +├ status integer 0:点位信息 +└ custom_code string +behaviour object 是 1:添加点位 +├ algo_model string 2:修改点位 +├ image_base64 string +├ image_path 3:删除点位 +├ capture_time +├ in_num 4:点位状态变化 +├ out_num +├ area_num 否 相机序列号 最大长度: 64 + + 否 相机 ip 地址 + + 是 点位 id + + 是 点位名称 最大长度: 64 + + 否 点位状态 1:在线 2: + 离线 + + 否 自定义编码 最大长度: 64 + + 否 行为分析(告警恢复)数 + 据 + + 是 算法类型 最大长度: 128 + + 否 图片 base64 + + string 否 图片相对路径 最大长度: 256 + + integer 是 抓拍时间 + + integer 否 绊线进入人数(瞬时) + + integer 否 绊线离开人数(瞬时) + + integer 否 区域统计人数 + + 第 136 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 必 默 其他信息 + 填 认 + 名称 类型 值 备注 + +├ video_uuid string 否 告警视频 uuid 最大长度: 256 +├ video_url string +├ capture_info object [] 否 告警视频相对路径 最大长度: 256 +├─ target_id integer +├─ point_x string 否 目标信息 + +├─ point_y string 否 目标 id + +├─ object_type integer 否 目标横坐标信息-- +└─ plate_no string "x0,x1" +face object +├ capture_time integer 否 目标纵坐标信息-- +├ point_x string "y0,y1" + +├ point_y string 否 区域入侵目标类型 1 人 +├ orig_image_path string 2 机动车 3 非机动车 +├ crop_image_path string +├ orig_image_base64 string 否 车牌号 +└ crop_image_base64 string +compare_results object [] 否 人脸抓拍数据 +├ target_id integer +├ lib_id integer 是 抓拍时间 +├ lib_name string +├ person_id integer 否 目标横坐标信息-- + "x0,x1" + + 否 目标纵坐标信息-- + "y0,y1" + + 是 抓拍人脸大图相对路径 最大长度: 256 + + 是 抓拍人脸小图相对路径 最大长度: 256 + + 否 抓拍人脸大图 base64 + + 否 抓拍人脸小图 base64 + + 否 人脸比对结果(为空代 + 表比对失败) + + 是 目标 id + + 是 人员库 id + + 是 人员库名称 最大长度: 64 + + 是 人员 id + + 第 137 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 名称 类型 必 默 备注 其他信息 + 填 认 最大长度: 64 +├ person_name string 值 +├ sex integer 最大长度: 64 +├ email string 是 人员姓名 最大长度: 32 +├ tel string + 否 性别 1:男 2:女 最大长度: 64 +├ certificate_type integer 99:未说明 最大长度: 256 + +├ certificate_no string 否 邮箱 +├ image_path string +├ image_base64 string 否 手机号 +└ similarity number + 证件类型 1:身份证 + + 否 2:护照 3:行驶证 + + 99:其它 + + 否 证件号码 + + 是 库内人脸图相对路径 + + 否 库内人脸图 base64 + + 是 相似度 + +返回数据 + + 名称 类型 必填 默认值 备注 +code integer 是 +msg string 是 + +样例 + +请求: + +{ + "type": 1, + "event_id": "123456789", + "has_result": 1, + "device_info": { + "device_code": 1, + + 第 138 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + "device_name": "ECS-B501@8HA-SF", + "device_sn": "210235C8TS5804696123" + }, + "channel_info": { + "mode": 0, + "ipc_sn": "189802C04B7201V00081", + "ipc_addr": "217.1.0.143", + "channel_id": 1, + "channel_name": "Camera1" + }, + "behaviour": { + "algo_model": "SafetyHelmetAlarm", + "image_base64": "/9j/D/2Q==", + "image_path": "/api/v2/smart/picture?Type=1&Index=ubs_5_ +0_0_0_0_0_752_54_63652_1716533613&Size=219148", + "capture_time": 1716533613, + "capture_info": [ + + { + "point_x": "4296,4796", + "point_y": "398,1287", + "PlateNo": "" + + } + ] + } +} + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + +13.2 告警视频上报 + +基本信息 + + 第 139 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +Path: /custom/router2 +Method: POST +接口描述: + +请求参数 + +Headers 参数值 必填 示例 备注 + 参数名称 multipart/form-data 是 + + Content-Type + +Body 参数类型 必填 示例 备注 + 参数名称 text 是 唯一标识,用于与告警上报的数据关联 + file 是 告警视频流 + video_uuid + file + +返回数据 + + 名称 类型 必填 默认值 备注 + code integer 是 错误码 + msg string 是 错误信息 + +样例 + +请求: + +响应: + +{ + "code": 0, + "msg": "Succeed", + "status_code": 0 + +} + + 第 140 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 第 141 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +14 附录 + +14.1 错误码 + + IA57XX@XX + +0: 成功 Succeed +1: 通用错误 Common Error +2: 参数非法 Invalid Arguments +3: 用户无权限 Not Authorized +4: 设备不支持 Not Supported +5: 用户状态异常 Abnormal User Status +6: 系统繁忙 System Busy + +1000 鉴权模块 +1000: 用户名或密码错误 Incorrect username or passwd +1001: 用户无权限 User does not have permission +1002: 用户登录数已达上限 The maxinum number of user logins has been reaches +1003: 用户安全登录 IP 已达上限 The user login ip has reaches the upper limit. +1004: 用户登录 IP 已锁定 User login ip locked. + +1100 人员库管理 +1100 人员库数量已达上限 Face lib num has reached the upper limit +1101 存在同名人员库 The face lib name already exists + +1200 人员管理 +1200: 人员数量已达上限 The number of faces has reached the max limit +1201: 人员导入库成员证件号类型非法 Wrong ID number type +1202: 人员导入库成员图片格式错误 Image format error +1203: 人员导入库成员图片过大 Image size is too large + +1300 点位管理 + +1400 点位布防时间 + +1500 智能配置 +1500: 算法任务不支持同时配置 Algo type does not support simultaneous config + +1600 工服库管理 +1600: 存在同名工作服样式库 The workclothes lib name already exists +1601: 工作服样式库数量已达到上限 Workclothes lib num has reached the upper +limit + + 第 142 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +1700 工服管理 +1700: 工作服样式库成员数量已达到上限 The number of workclothes has reached +the max limit +1701: 工作服导入库成员图片过大 Image size is too large +1702: 图片导入失败 Importing picture failed + +1800 设备管理 +1800: 获取设备信息出错 Error in obtaining device information +1801: 设置设备信息出错 Error setting device information + +1900 升级 +1900: 升级失败 Upgrade failure +1901: 文件校验出错 File verification failure +1902: 设备升级,版本号不匹配 The version number does not match +1903: 设备升级,设备类型不匹配 The device type does not match +1904: 设备升级,可能申请内存或者其他原因失败 Failed to apply for memory or +other reasons +1905: 设备升级,数字签名校验失败 Digital signature verification fails +1906: 升级进度获取失败 Failed to obtain upgrade progress + +2000 数据检索 + +2100 平台对接 + +2200 数据上报 + +14.2 适配产品 + + IA57XX@XX + ECS-X5X1 + ECS-50XX + +14.3 告警类型 + +参数说明 +时间单位 s + + 第 143 页 共 148 页 + 参数 文档名:边缘产品对外标准接口 密级:公开 +sensitive +report_rate 解释 范围 +direction_line 灵敏度 1-100 +time_threshold 告警间隔 ≥0 +person_num_limit 方向线 / +person_float_limit 触发时间 ≥0 +back_time_threshold 人数限制 ≥0 + 浮动人数 ≥0 + 背景刷新时间 ≥0 + +ECS-X5X1-SF, ECS-50XX-SF: + + 算法类型 算法名称 区域类型 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 目标类 + + 度隔线间 制 数 时间 型 + +SafetyHelmetAlarm 未戴安全帽检测 polygon √ √ + +WorkClothesAlarm 未穿工服检测 polygon √ √ + +TelephoningAlarm 打电话检测 polygon √ √ + +SmokingAlarm 吸烟检测 polygon √ √ + +SleepingDetectionAlarm 睡岗检测 polygon √ √ √ + √√ +OffDutyDetectionAlarm 离岗检测 polygon √ √ + √ +ChannelBlockageDetection 逃生通道堵塞 polygon √ + √ +ObjectRemoved 物品遗失 polygon √ √ √√ √ + √ √ +FieldDetectorObjectsInside 区域入侵 polygon √ √ + √ +AccessElevatorAlarm 电动车禁入 polygon √ √ + +NoMaskAlarm 未戴口罩检测 polygon √ √ + +FallOverAlarm 跌倒检测 polygon √ √ + +CrowdDensityCriticalAlarm 人员数量超限 polygon √ + +ReflectiveClothesDetectionAlarm 未穿反光服检测 polygon √ √ + +AbnormalParkingDetection 车辆违停占用 polygon √ + +FumesAlarmBegin 烟雾检测 polygon √ √ + +PlayMobilePhoneDetection 玩手机检测 polygon √ √ + +FireDetection 明火检测 polygon √ √ + +LongStayDetection 逗留检测 polygon √ + +FightDetectionAlarm 打架检测 polygon √ √ + + 第 144 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 算法类型 算法名称 区域类型 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 目标类 + + 度隔线间 制 数 时间 型 + +LineDetectorCrossed 越界检测 polygon √ + +EnterArea 区域进入 polygon √ + +LeaveArea 区域离开 polygon √ + +AreaPeopleCounting 区域人数统计 polygon √ + +LinePeopleCounting 绊线人数统计 line √ √ + √ +ObjectIsRecognized 人脸检测 polygon + +NonMotorAbnormalParkingDetection 非机动车违停 polygon √ + +ECS-X5X1-SY: 算法名称 区域类型 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 目标类 + + 算法类型 度隔线间 制 数 时间 型 + +KnifeStickDetection 手持刀棍检测 polygon √ √ +SmokingAlarm +SleepingDetectionAlarm 吸烟检测 polygon √ √ +OffDutyDetectionAlarm +ClimbingDetectionAlarm 睡岗检测 polygon √ √ √ +FieldDetectorObjectsInside +PeopleGathering 离岗检测 polygon √ √√ +FastMoving +FallOverAlarm 攀高检测 blend +FumesAlarmBegin +FireDetection 区域入侵 polygon √ √ +LongStayDetection +FightDetectionAlarm 人员聚集 polygon √√√ +LinePeopleCounting +ObjectIsRecognized 快速移动 polygon √ √ + + 跌倒检测 polygon √ √ √ + + 烟雾检测 polygon √ √ + + 明火检测 polygon √ √ + + 逗留检测 polygon √ √ + + 打架检测 polygon √ √ + + 绊线人数统计 line √ √ + + 人脸检测 polygon + +ECS-X5X1-VK: 算法名称 区域类型 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 目标类 + + 算法类型 度隔线间 制 数 时间 型 +ChefHatAlarm + 未戴厨师帽检测 polygon √ √ + + 第 145 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 算法类型 算法名称 区域类型 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 目标类 + +SmokingAlarm 度隔线间 制 数 时间 型 +TelephoningAlarm +NoMaskAlarm 吸烟检测 polygon √ √ +ChefClothesDetection +UncoveredTrashCanDetection 打电话检测 polygon √ √ +ShirtlessDetection +MouseDetect 未戴口罩检测 polygon √ √ +AreaPeopleCounting +LinePeopleCounting 未穿厨师服检测 polygon √ √ +ObjectIsRecognized + 未盖垃圾桶检测 polygon √ √ √ + √ + 赤膊检测 polygon √ √ + + 鼠患检测 polygon √ √ + + 区域人数统计 polygon √ + + 绊线人数统计 line √ + + 人脸检测 polygon + +ECS-X5X1-CS: + + 算法类型 算法名称 灵敏 告警间 方向 触发时 人数限 浮动 绕行 背景 + 区域类型 目标类 + + 度 隔 线 间 制 人数 区域 刷新 + 型 + + 时间 + +SafetyHelmetAlarm 未戴安全帽检测 polygon √ √ + +WorkClothesAlarm 未穿工服检测 polygon √ √ + +TelephoningAlarm 打电话检测 polygon √ √ + +SmokingAlarm 吸烟检测 polygon √ √ + +OffDutyDetectionAlarm 离岗检测 polygon √ √√ + +FieldDetectorObjectsInside 区域入侵 polygon √ √ + +FallOverAlarm 跌倒检测 polygon √ √ √ + +CrowdDensityCriticalAlarm 人员数量超限 polygon √ √√ + +ReflectiveClothesDetectionAlarm 未穿反光服检测 polygon √ √ + +AbnormalParkingDetection 车辆违停占用 polygon √ √ + +ObjectIsRecognized 人脸检测 polygon + +FumesAlarmBegin 烟雾检测 polygon √ √ + +FireDetection 明火检测 polygon √ √ + +NoMaskAlarm 未戴口罩检测 polygon √ √ + +DisorderStackingDetection 物料乱堆放 polygon √ √ √ + +BareSoilCoverDetection 裸土未覆盖 polygon √ √ + +UnwashedVehicleDetection 车辆未清洗 polygon √ + +SafetyHarnessDetection 未穿安全背带 polygon √ √ + + 第 146 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + +IA57XX@PI: + +算法类型 算法名称 区域类 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新时 告警恢 + + 型 度 隔 线 间 制 数 间 复 + +LinePeopleCounting 绊线人数统计 line √ √ + +AbnormalParkingDetection 车辆违停占用 polygon √ √ √ + +TelephoningAlarm 打电话检测 polygon √ √ √ + +FightDetectionAlarm 打架检测 polygon √ √ √ + +AccessElevatorAlarm 电瓶车禁入 polygon √ √ √ + +FallOverAlarm 跌倒检测 polygon √ √ √ √ + +LongStayDetection 逗留检测 polygon √ √ √ + +StayAloneDetection 多人作业 polygon √ √ √ √ + +FastMoving 快速移动 polygon √ √ √ + +OffDutyDetectionAlarm 离岗检测 polygon √ √ √ √ + +FireDetection 明火告警 polygon √ √ √ + +ClimbingDetectionAlarm 攀高检测 blend √ + +AreaPeopleCounting 区域人数统计 polygon √ + +FieldDetectorObjectsInside 区域入侵 polygon √ √ + +PeopleGathering 人员聚集 polygon √ + +CrowdDensityCriticalAlarm 人员数量超限 polygon √ √ √ √ + +SleepingDetectionAlarm 睡岗检测 polygon √ √ √ √ + +ChannelBlockageDetection 逃生通道堵塞 polygon √ √ √ + +PlayMobilePhoneDetection 玩手机检测 polygon √ √ √ √ + +WorkClothesAlarm 未穿工服检测 polygon √ √ √ + +SafetyHelmetAlarm 未戴安全帽检 polygon √ √ √ + + 测 + +NoMaskAlarm 未戴口罩检测 polygon √ √ √ + +SmokingAlarm 吸烟检测 polygon √ √ √ + +FumesAlarmBegin 烟雾告警 polygon √ √ √ + +LineDetectorCrossed 越界检测 line √ √ + +IA57XX@UM: + + 算法类型 算法名称 区域类 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 告警恢 + +ExposedGarbageDetection 型 度隔线间 制 数 时间 复 +OutsideTheStoreBusinessDetection + 暴露垃圾 polygon √ √ √ + + 出店经营 polygon √ √ √ + + 第 147 页 共 148 页 + 文档名:边缘产品对外标准接口 密级:公开 + + 算法类型 算法名称 区域类 灵敏 告警间 方向 触发时 人数限 浮动人 背景刷新 告警恢 + + 型 度隔线间 制 数 时间 复 + +PackedGarbageDetection 打包垃圾 polygon √ √ √ + +NonMotorAbnormalParkingDetection 非机动车违停 polygon √ √ √ √ + +SharedBicylesRandomParkingDetection 共享单车无序 polygon √ √ √ + + 停放 + +FloatingObjOnRiverDetection 河道漂浮物 polygon √ √ + +AbnormalParkingDetection 机动车违停 polygon √ √ √ √ + +WasteTruckDetection 禁止渣土车 polygon √ √ √ + +TrashOverflowingDetection 垃圾桶满溢 polygon √ √ √ + +UncoveredTrashCanDetection 垃圾桶未盖 polygon √ √ √ + +SetFileOnTheRoadDetection 路口焚烧 polygon √ √ √ + +DirtyRoadDetection 路面不洁 polygon √ √ √ + +SurfaceWaterDetection 路面积水 polygon √ √ √ + +DogDetection 犬类识别 polygon √ √ + +PeopleGathering 人群聚集 polygon √ + +IllegalUseOfAnUmbrellaDetection 违规撑伞 polygon √ √ √ + +IllegalBillboardsDetection 违规广告牌 polygon √ √ + +DisorderStackingDetection 物料堆积 polygon √ √ √ + +DryingOnTheStreetDetection 沿街晾晒 polygon √ √ + +StreetVendorDetection 游商 polygon √ √ √ + +RoadsideStallBusinessDetection 占道经营 polygon √ √ √ + + 第 148 页 共 148 页 + diff --git a/ruoyi-modules/Iot/pom.xml b/ruoyi-modules/Sis/pom.xml similarity index 97% rename from ruoyi-modules/Iot/pom.xml rename to ruoyi-modules/Sis/pom.xml index 952197a..f8f3f87 100644 --- a/ruoyi-modules/Iot/pom.xml +++ b/ruoyi-modules/Sis/pom.xml @@ -9,11 +9,8 @@ 4.0.0 - Iot - - - 物业管理模块 - + Sis + Smart Intelligent Security 智能安防管理系统 diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/IotyApplication.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/IotyApplication.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/IotyApplication.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/IotyApplication.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TbAccessControlController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TbAccessControlController.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TbAccessControlController.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TbAccessControlController.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdFactoryController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdFactoryController.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdFactoryController.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdFactoryController.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterConfigController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterConfigController.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterConfigController.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterConfigController.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterController.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterController.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterController.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterRoomController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterRoomController.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/controller/TdMeterRoomController.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/controller/TdMeterRoomController.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TbAccessControl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TbAccessControl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TbAccessControl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TbAccessControl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdFactory.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdFactory.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdFactory.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdFactory.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeter.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeter.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeter.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeter.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeterConfig.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeterConfig.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeterConfig.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeterConfig.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeterRoom.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeterRoom.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/TdMeterRoom.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/TdMeterRoom.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TbAccessControlBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TbAccessControlBo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TbAccessControlBo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TbAccessControlBo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdFactoryBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdFactoryBo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdFactoryBo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdFactoryBo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterBo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterBo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterBo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterConfigBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterConfigBo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterConfigBo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterConfigBo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterRoomBo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterRoomBo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/bo/TdMeterRoomBo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/bo/TdMeterRoomBo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TbAccessControlVo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TbAccessControlVo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TbAccessControlVo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TbAccessControlVo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdFactoryVo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdFactoryVo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdFactoryVo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdFactoryVo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterConfigVo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterConfigVo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterConfigVo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterConfigVo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterRoomVo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterRoomVo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterRoomVo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterRoomVo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterVo.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterVo.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/domain/vo/TdMeterVo.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/domain/vo/TdMeterVo.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TbAccessControlMapper.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TbAccessControlMapper.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TbAccessControlMapper.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TbAccessControlMapper.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdFactoryMapper.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdFactoryMapper.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdFactoryMapper.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdFactoryMapper.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterConfigMapper.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterConfigMapper.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterConfigMapper.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterConfigMapper.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterMapper.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterMapper.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterMapper.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterMapper.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterRoomMapper.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterRoomMapper.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/mapper/TdMeterRoomMapper.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/mapper/TdMeterRoomMapper.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITbAccessControlService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITbAccessControlService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITbAccessControlService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITbAccessControlService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdFactoryService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdFactoryService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdFactoryService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdFactoryService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterConfigService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterConfigService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterConfigService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterConfigService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterRoomService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterRoomService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterRoomService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterRoomService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/ITdMeterService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/ITdMeterService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/api/base/DoorDeviceService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/api/base/DoorDeviceService.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/api/base/DoorDeviceService.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/api/base/DoorDeviceService.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/api/base/impl/DoorDeviceServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/api/base/impl/DoorDeviceServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/api/base/impl/DoorDeviceServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/api/base/impl/DoorDeviceServiceImpl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/ApiResp.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/ApiResp.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/ApiResp.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/ApiResp.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceAddReq.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceAddReq.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceAddReq.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceAddReq.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceFindReq.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceFindReq.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceFindReq.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceFindReq.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceUpdateReq.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceUpdateReq.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceUpdateReq.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/req/DoorDeviceUpdateReq.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceAddRes.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceAddRes.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceAddRes.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceAddRes.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceFindRes.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceFindRes.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceFindRes.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/DoorDevice/res/DoorDeviceFindRes.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/QueryDto.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/QueryDto.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/model/QueryDto.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/model/QueryDto.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/utils/E8ApiUtil.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/utils/E8ApiUtil.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/e8/utils/E8ApiUtil.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/e8/utils/E8ApiUtil.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TbAccessControlServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TbAccessControlServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TbAccessControlServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TbAccessControlServiceImpl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdFactoryServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdFactoryServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdFactoryServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdFactoryServiceImpl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterConfigServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterConfigServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterConfigServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterConfigServiceImpl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterRoomServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterRoomServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterRoomServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterRoomServiceImpl.java diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterServiceImpl.java similarity index 100% rename from ruoyi-modules/Iot/src/main/java/org/dromara/iot/service/impl/TdMeterServiceImpl.java rename to ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/impl/TdMeterServiceImpl.java diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UnViewAiBoxApi.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UnViewAiBoxApi.java new file mode 100644 index 0000000..1c59031 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UnViewAiBoxApi.java @@ -0,0 +1,258 @@ +package org.dromara.iot.service.unview; + +import java.awt.*; +import java.util.List; +import static org.dromara.iot.service.unview.model.UvModel.*; + +public interface UnViewAiBoxApi { + + /** + * 行为分析检索 + * + * @param params 检索参数 + * @param uvSystemInfo 设备信息 + * @return 发你检索数据 + */ + SearchBehaviorResult searchBehavior(UvSystemInfo uvSystemInfo, SearchBehaviorParams params); + + /** + * 添加人脸库 + * + * @param libName 人脸库名称 + * @param uvSystemInfo 设备信息 + * @return 返回人像库id + */ + AddLibResult addPersonLib(UvSystemInfo uvSystemInfo, String libName); + + /** + * 删除人像库 + * + * @param libIds 人像库id列表 + * @param uvSystemInfo 设备信息 + * @return 是否删除成功 + */ + boolean deletePersonLib(UvSystemInfo uvSystemInfo, Integer... libIds); + + /** + * 更新人像库信息 + * + * @param uvSystemInfo 设备信息 + * @param libId 人像库id + * @param LibName 人像库名称 + * @return + */ + boolean updatePersonLib(UvSystemInfo uvSystemInfo, Integer libId, String LibName); + + /** + * 分页查询人像库信息 + * + * @param uvSystemInfo 设备信息 + * @param libName 人像库名称 + * @param current 页面 + * @param size 查询数量 + * @return 返回人像库数据 + */ + QueryLibResult findPagePersonLib(UvSystemInfo uvSystemInfo, String libName, Integer current, Integer size); + + /** + * 添加人像 + * + * @param uvSystemInfo 设备信息 + * @param personAddReq 人像信息 + * @return 返回人像信息 + */ + AddPersonResult addPerson(UvSystemInfo uvSystemInfo, AddPersonParams personAddReq); + + /** + * 批量添加人像 + * + * @param uvSystemInfo 设备信息 + * @param personParams 批量人像信息 + * @return 返回批量的人像信息 + */ + BatchAddPersonResult batchAddPerson(UvSystemInfo uvSystemInfo, BatchAddPersonParams personParams); + + /** + * 批量删除人像信息 + * + * @param uvSystemInfo 设备信息 + * @param personIds 人像id + * @return 返回是否删除成功 + */ + Boolean batchDeletePerson(UvSystemInfo uvSystemInfo, Integer[] personIds); + + /** + * 更新人像信息 + * + * @param uvSystemInfo 设备信息 + * @param params 更新参数 + * @return 返回是否更新成功 + */ + Boolean updatePerson(UvSystemInfo uvSystemInfo, UpdatePersonParams params); + + /** + * 分页查询人像信息 + * + * @param uvSystemInfo 设备信息 + * @param params 查询参数 + * @return 返回是否查询成功 + */ + queryPersonPageResult findPersonPage(UvSystemInfo uvSystemInfo, queryPersonPageParams params); + + /** + * 获取 rsa 公钥 + * + * @param uvSystemInfo 设备信息 + * @return GetPublickeyResp 获取公钥响应 + */ + GetPublickeyResult getPublickey(UvSystemInfo uvSystemInfo); + + /** + * 获取码流信息 + * + * @param uvSystemInfo 设备信息 + * @param uvSystemInfo req 查询参数 + * @return 返回码流信息 + */ + QueryOnvifResult getOnvif(UvSystemInfo uvSystemInfo); + + /** + * 新增点位 + * + * @param uvSystemInfo 设备信息 + * @param params 点位新增请求 + * @return 点位新增响应 + */ + AddPointResult addPoint(UvSystemInfo uvSystemInfo, PointParams params); + + /** + * 删除设备中的点位信息 + * + * @param uvSystemInfo 设备信息 + * @param channelIds 点位ID列表 + * @return 删除结果 + */ + Boolean deletePoint(UvSystemInfo uvSystemInfo, List channelIds); + + /** + * 更新设备中的点位信息 + * + * @param uvSystemInfo 设备信息 + * @param params 点位更新请求 + * @return 更新结果 + */ + Boolean updatePoint(UvSystemInfo uvSystemInfo, UpdatePointParams params); + + /** + * 根据设备信息和点位查找请求来查找点位信息 + * + * @param uvSystemInfo 设备信息 + * @param req 点位查找请求 + * @return 点位查找响应 + */ + QueryPointResult queryPoint(UvSystemInfo uvSystemInfo, QueryPointParams req); + + /** + * 批量添加点位信息到设备中 + * + * @param uvSystemInfo 设备信息 + * @param params 批量添加点位请求 + * @return 批量添加点位响应 + */ + BatchAddPersonResult batchAddPoint(UvSystemInfo uvSystemInfo, BatchAddPointParams params); + + /** + * 添加/修改 设备布防时间 + */ + Boolean pointControlTimeUpdate(UvSystemInfo uvSystemInfo, ModifyControlTime params); + + /** + * 获取布防时间 + * + * @param uvSystemInfo 设备信息 + * @param channel_id 通道 id + * @param algo_model 算法类型 + * @return 返回查询结果 + */ + ControlTime queryControlTime(UvSystemInfo uvSystemInfo, Integer channel_id, Integer algo_model); + + /** + * 新增工服库 + * + * @param systemInfo 设备信息 + * @param libName 工服库名称 + * @return 是否添加成功 + */ + Integer addWorkClothesLib(UvSystemInfo systemInfo, String libName); + + /** + * 修改工服库信息 + * + * @param systemInfo 设备信息 + * @param libId 库id + * @param libName 库名称 + * @return 是否修改成功 + */ + Boolean updateWorkClothesLib(UvSystemInfo systemInfo, Integer libId, String libName); + + /** + * 删除工服库 + * + * @param systemInfo 设备信息 + * @param libId 工服库id + * @return 是否删除成功 + */ + Boolean deleteWorkClothesLib(UvSystemInfo systemInfo, Integer libId); + + /** + * @param systemInfo 设备信息 + * @param libName 库名称 + * @param page 页码 + * @param pageSize 查询数量 + * @return 返回分页数据 + */ + QueryLibResult findPageWorkClothesLib(UvSystemInfo systemInfo, String libName, Integer page, Integer pageSize); + + /** + * 新增工服-单个 + * + * @param systemInfo 增加工服的设备 + * @param libId 新增工服的库id + * @param imageBase64 工服图片base64 + * @return 返回工服的人员id + */ + Integer addWorkClothes(UvSystemInfo systemInfo, Integer libId, String imageBase64); + + + /** + * 批量新增工服,一次最多添加50条 + * + * @param systemInfo 增加工服的设备 + * @param libId 新增工服的库id + * @param imageBase64s 工服图片base64列表 + * @return 返回成功以及失败的数据 + */ + BatchAddWorkClothesResult batchAddWorkClothes(UvSystemInfo systemInfo, Integer libId, List imageBase64s); + + /** + * 删除工服库 + * + * @param systemInfo 设备信息 + * @param libId 库id + * @param workClothesIds 工服id列表 + * @return + */ + Boolean deleteWorkClothes(UvSystemInfo systemInfo, Integer libId, List workClothesIds); + + /** + * 分页查询工服 + * + * @param systemInfo 设备 + * @param libId 设备id + * @param page 分页查询页码 + * @param size 分页查询size + * @param status 建模状态 999:全部;1:未建模 2:建模中;3:建模成功;4:建模失败 + */ + FindWorkClothesResult findPageWorkClothes(UvSystemInfo systemInfo, Integer libId, Integer page, Integer size, Integer status); + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UniViewConstants.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UniViewConstants.java new file mode 100644 index 0000000..4dea052 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/UniViewConstants.java @@ -0,0 +1,8 @@ +package org.dromara.iot.service.unview; + +public class UniViewConstants { + + + + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/UvModel.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/UvModel.java new file mode 100644 index 0000000..468f208 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/UvModel.java @@ -0,0 +1,728 @@ +package org.dromara.iot.service.unview.model; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +public class UvModel { + + @Data + public static class UniViewResult { + private Integer code; + private String msg; + private Integer status_code; + + private T data; + + public boolean success() { + return code.equals(0); + } + + public boolean unAuth() { + return code.equals(401); + } + + public static UniViewResult success(T data) { + UniViewResult result = new UniViewResult<>(); + result.setCode(0); + result.setStatus_code(0); + result.setMsg("Succeed"); + return result; + } + + public T result() { + if (success()) { + return data; + } else { + return null; + } + } + + } + + @Data + public static class Page { + private Integer pageNum; + + private Integer pageSize; + } + + @Data + public static class UvSystemInfo { + private String account; // 账号 + private String password; // 密码 + private String ip; // 设备ip + private Integer port; // 设备端口 + } + + @Data + public static class UvAuthInfo { + /** + * 摘要加密算法,首次请求时由设备返回 + */ + String algorithm; + /** + * 保护质量,首次请求时由设备返回 + */ + String qop; + /** + * 摘要加密字段,首次请求时由设备返回 + */ + String realm; + /** + * 随机字符串,每当返回 401 时就会生成一个新的值, + * 原值失效,客户端需使用此值生成新的摘要信息 + */ + String nonce; + + /** + * 指示上个请求中的 nonce 是否过期,由设备返回 + */ + String stale; + } + + @EqualsAndHashCode(callSuper = true) + @Data + public static class UvRequestAuthInfo extends UvAuthInfo { + /** + * 鉴权用户名,由设备分配 + */ + private String username; + + /** + * 当前请求的 URI + */ + private String uri; + + /** + * nonce 计数器,防止重放攻击,由请求方生成 + */ + private String nc; + + /** + * 唯一字符串,用于提供额外防护,由请求方生成 + */ + private String cnonce; + + /** + * 摘要信息,用于验证身份,由请求方生成 + */ + private String response; + } + + @Data + public static class AlarmReportInfo { + /** + * 上报内容 + * 1:行为分析告警数据 + * 2:告警恢复数据 + * 3:人脸抓拍数据 + * 4:人脸比对数据 + * 5:行为比对数据 + * 6:保活数据 + * 7:点位变更数据 + */ + private Integer type; + private String event_id; + /** + * 有无比对结果 1 有 0 无 + */ + private Integer has_result; + private DeviceInfo device_info; + private ChannelInfo channel_info; + private Behaviour behaviour; + /** + * 人脸抓拍数据 + */ + private Face face; + /** + * 人脸比对结果(为空代 + * 表比对失败) + */ + private List compare_results; + } + + @Data + public static class CompareResult { + private Integer target_id; + private Integer lib_id; + private String lib_name; + private Integer person_id; + private String person_name; + private Integer sex; + private String email; + private String tel; + private Integer certificate_type; + private String certificate_no; + private String image_path; + private String image_base64; + private String similarity; + } + + @Data + public static class Face { + private Integer capture_time; + private String point_x; + private String point_y; + private String orig_image_path; + private String crop_image_path; + private String orig_image_base64; // 人脸抓拍大图base64 + private String crop_image_base64; // 人脸抓拍小图base64 + } + + @Data + public static class CaptureInfo { + private Integer target_id; + private String point_x; + private String point_y; + private Integer object_type; + private String plate_no; + } + + @Setter + @Getter + public static class Behaviour { + private String algo_model; + private String image_base64; + private String image_path; + private Integer capture_time; + private Integer in_num; + private Integer out_num; + private Integer area_num; // 区域统计人数 + private String video_uuid; + private String video_url; + private List capture_info; // 目标信息 + + @Override + public String toString() { + return "Behaviour{" + + "algo_model='" + algo_model + '\'' + +// ", image_base64='" + image_base64 + '\'' + + ", image_path='" + image_path + '\'' + + ", capture_time=" + capture_time + + ", in_num=" + in_num + + ", out_num=" + out_num + + ", area_num=" + area_num + + ", video_uuid='" + video_uuid + '\'' + + ", video_url='" + video_url + '\'' + + ", capture_info=" + capture_info + + '}'; + } + } + + @Data + public static class ChannelInfo { + /** + * 上报模式: + * 0:点位信息 + * 1:添加点位 + * 2:修改点位 + * 3:删除点位 + * 4:点位状态变化 + */ + private Integer mode; + private String ipc_sn; + private String ipc_addr; + private Integer channel_id; + private String channel_name; + private Integer status; + private String custom_code; + } + + @Data + public static class DeviceInfo { + private Integer device_code; + private String device_name; + private String device_sn; + private String custom_code; + } + + + @Data + public static class AddPersonParams { + /** + * 人像名称 + * 必填 + */ + private String person_name; + /** + * 人像的base64图片 + * 必填 + */ + private String image_base64; + /** + * 人像库id + * 必填 + */ + private Integer lib_id; + /** + * 性别 + */ + private String sex; + /** + * 邮件 + */ + private String email; + /** + * 联系方式 + */ + private String tel; + + /** + * 证件类型 + * 1:身份证 2:护照 3:行驶证 99:其它 + */ + private String certificate_type; + /** + * 证件号码 + */ + private String certificate_no; + /** + * 出生日期 + */ + private String birth_date; + } + + @Data + public static class AddPersonResult { + private Integer person_id; + } + + + @Data + public static class BatchAddPersonParams { + /** + * 批量添加人像信息 + */ + private List person_list; + } + + @Data + public static class BatchAddPersonResult { + private List fail_list; + } + + @EqualsAndHashCode(callSuper = true) + @Data + public static class queryPersonPageParams extends Page { + /** + * 人员库 id + * 必填 + */ + private Integer lib_id; + + /** + * 姓名(支持模糊查询) + */ + private String person_name; + /** + * 性别 + * 999:全部 + * 1:男 + * 2:女 + * 99:未说明 + */ + private Integer sex = 999; + + /** + * 证件号 + */ + private String certificate_no; + + /** + * 建模状态 999:全部; + * 1:未建模 2:建模中;3:建模成功;4:建模失败 + */ + private Integer model_status = 999; + } + + @Data + public static class queryPersonPageResult { + /** + * 查询数据 + */ + private List data; + + /** + * 数据总数 + */ + private Integer total; + } + + @Data + public static class PersonInfo { + /** + * 人员 id + */ + private Integer person_id; + /** + * 姓名 + */ + private String person_name; + /** + * 性别 1:男 2:女 99:未说明 + */ + private Integer sex; + /** + * 邮箱 + */ + private String email; + /** + * 联系方式 + */ + private String tel; + /** + * 建模状态 1:未建模 2:建模中;3:建模成功;4:建模失败 + */ + private Integer modeling_type; + /** + * 证件类型 1:身份证 2:护照 3:行驶证 99:其它 + */ + private Integer certificate_type; + /** + * 证件号码 + */ + private String certificate_no; + /** + * 图片路径 + */ + private String image_path; + /** + * 人员库 id + */ + private Integer lib_id; + /** + * 出生日期 + */ + private String birth_date; + /** + * 创建时间 + */ + private Integer create_time; + } + + + /** + * 添加人像库请求参数封装 + */ + @Data + public static class UpdatePersonParams { + /** + * 人员 id + * 必填 + */ + private String person_id; + /** + * 名称 + */ + private String person_name; + /** + * 性别 + */ + private Integer sex; + /** + * 邮箱 + */ + private String email; + /** + * 联系方式 + */ + private String tel; + /** + * 证件类型 1:身份证 2:护照 3:行驶证 99:其它 + */ + private Integer certificate_type; + /** + * 证件号码 + */ + private Integer certificate_no; + /** + * 人脸照片 base64 + */ + private String image_base64; + /** + * 出生日期 + */ + private String birth_date; + } + + @Data + public static class QueryLibResult { + private Integer total; + private List list; + } + + @Data + public static class LibInfo { + private Integer lib_id; + private String lib_name; + private Integer create_time; + } + + @Data + public static class AddLibResult { + private Integer lib_id; + } + + @Data + public static class BatchAddWorkClothesResult { + private List workclothes_id; + private List fail_list; + } + + @Data + public static class BatchAddWorkClothesFailInfo { + private Integer index; + private String reason; + } + + @Data + public static class FindWorkClothesResult { + private Integer total; + private List workclothes_list; + } + + @Data + public static class WorkClothesInfo { + private Integer lib_id; + private Integer workclothes_id; + private String image_path; + private Integer create_time; + private Integer model_status; + } + + + @Data + public static class SearchBehaviorParams { + /** + * 页码数 + */ + private Integer page; + /** + * 每页数据量 + */ + private Integer pagesize; + /** + * 通道 id + */ + private List channel_id; + /** + * 算法类型,送空查全部 + */ + private List algo_model; + /** + * 开始时间,10 位时间戳(秒级) + */ + private Integer start_time; + /** + * 结束时间,10 位时间戳(秒级) + */ + private Integer end_time; + /** + * 是否有比对:1 全部,2 有比对 不传查全部 + */ + private Integer compare_flag; + /** + * 目标类型 区域入侵告警查询条件 1 行人 2 + * 机动车 3 非机动车 + */ + private Integer object_type; + /** + * 车牌号 + */ + private String plate_no; + } + + + @Data + public static class SearchBehaviorResult { + private Integer total; + private List list; + } + + @Data + public static class BehaviorInfo { + private Integer alarm_id; + private String big_picture_url; + private String BigImageData; + private String algo_model; + private Integer capture_time; + private Integer channel_id; + private String channel_name; + private String video_url; + private List object_list; + private List compare_list; + } + + @Data + public static class ObjectInfo { + private Integer plate_no; + } + + @Data + public static class CompareInfo { + private Integer base_image_id; + private String base_image_url; + private String name; + private String certificate_no; + private Integer similarity; + private Integer match_type; + } + + @Data + public static class TimeSlot { + /** + * 开始时间,例如 00:00 + */ + private String start; + /** + * 结束时间,例如:04:00 + */ + private String end; + + } + + @Data + public static class ControlTime { + private List monday; + private List tuesday; + private List wednesday; + private List thursday; + private List friday; + private List saturday; + private List sunday; + } + + @Data + public static class ModifyControlTime { + private Integer channel_id; // 点位 id + private String algo_model; // 算法类型 + private ControlTime control_time; // 布防时间 + } + + + @Data + public static class QueryOnvifResult { + /** + * 厂商 + */ + private String manufacturer; + /** + * 型号 + */ + private String model; + /** + * 固件版本 + */ + private String firmware_version; + /** + * 序列号 + */ + private String serial_number; + /** + * 硬件 id + */ + private String hardware_id; + + /** + * 码流列表 + */ + private List video; + } + + @Data + private static class OnvifVideoInfo { + /** + * 码流 id + */ + private Integer id; + /** + * rtsp 地址 + */ + private String rtsp; + /** + * 码率 + */ + private String bitrate; + /** + * 编码格式 + */ + private String encoding; + /** + * 帧率 + */ + private String fps; + /** + * 画面组 + */ + private String gop; + /** + * 质量 + */ + private String quality; + /** + * 分辨率 + */ + private String ratio; + } + + @Data + public static class GetPublickeyResult { + private String public_key; + } + + @Data + public static class PointParams { + private Integer type; // 视频协议 1:onvif 2:rtsp + private Integer transport_type; // 传输协议(AIBOX 需要,一体机不需要) 1: tcp 2: udp + private String channel_name; // 点位名称 + private String rtsp; // rtsp 地址(当视频协议为rtsp 时,该字段必填) + private String ip; // 相机 ip(onvif 添加流时必填) + private Integer port; // 相机端口(onvif 添加流时必填) + private String username; // 相机用户名 + private String pwd; // 相机密码(RSA 加密) + private Integer video_type; // onvif 设备码流添加方式:1:主码流 2:自定义码流 + private Integer video_id; // 码流 id:当选择自定义码流时,该字段必填,值为获取设备码流信息接口返回的码流 id + private String custom_code; // 自定义编码 + } + + @Data + public static class AddPointResult { + private Integer channel_id; // 点位id + } + + @Data + public static class BatchAddPointParams { + private List channel_list; + } + + @Data + public static class BatchAddPointResult { + /** + * 失败的点位名称列表 + */ + private List fail_list; + } + + @EqualsAndHashCode(callSuper = true) + @Data + public static class UpdatePointParams extends PointParams { + private Integer channel_id; // 点位 id + } + + @EqualsAndHashCode(callSuper = true) + @Data + public static class QueryPointParams extends Page { + private String channel_name; + } + + @Data + public static class QueryPointResult { + private String channel_name; + } + + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmModelEnum.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmModelEnum.java new file mode 100644 index 0000000..1eb8923 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmModelEnum.java @@ -0,0 +1,79 @@ +package org.dromara.iot.service.unview.model.enums; + +/** + * [ + * "FieldDetectorObjectsInside", // 区域入侵报警 + * "SafetyHelmetAlarm", // 未戴安全帽报警 + * "WorkClothesAlarm", // 未穿工服报警 + * "TelephoningAlarm", // 打电话报警 + * "NoMaskAlarm", // 未戴口罩报警 + * "FallOverAlarm", // 跌倒报警 + * "OffDutyDetectionAlarm", // 离岗报警 + * "SmokingAlarm", // 吸烟报警 + * "ReflectiveClothesDetectionAlarm", // 未穿反光服报警 + * "FireDetection", // 明火报警 + * "FumesAlarmBegin", // 烟雾报警 + * "CrowdDensityCriticalAlarm", //人员数量超限报警 + * "AbnormalParkingDetection", //车辆违停占用报警 + * "DisorderStackingDetection", // 物料乱堆放报警 + * "BareSoilCoverDetection", // 裸土未覆盖 + * "SafetyHarnessDetection", // 未穿安全背带报警 + * "UnwashedVehicleDetection" // 车辆未清洗报警 + * ] + */ +public enum AlarmModelEnum { + FieldDetectorObjectsInside(10, 1014, "区域入侵报警"), + SafetyHelmetAlarm(10, 1015, "未戴安全帽报警"), + WorkClothesAlarm(10, 1016, "未穿工服报警"), + TelephoningAlarm(10, 1017, "打电话报警"), + NoMaskAlarm(10, 1013, "未戴口罩报警"), + FallOverAlarm(10, 1018, "跌倒报警"), + OffDutyDetectionAlarm(10, 1019, "离岗报警"), + SmokingAlarm(10, 1020, "吸烟报警"), + ReflectiveClothesDetectionAlarm(10, 1021, "未穿反光服报警"), + FireDetection(10, 1022, "明火报警"), + FumesAlarmBegin(10, 1023, "烟雾报警"), + CrowdDensityCriticalAlarm(10, 1024, "人员数量超限报警"), + AbnormalParkingDetection(10, 1025, "车辆违停占用报警"), + DisorderStackingDetection(10, 1026, "物料乱堆放报警"), + BareSoilCoverDetection(10, 1027, "裸土未覆盖"), + SafetyHarnessDetection(10, 1028, "未穿安全背带报警"), + UnwashedVehicleDetection(10, 1029, "车辆未清洗报警"), + + UnKnow(-1, -1, "未知类型"); + + + private final Integer bigType; + + private final Integer smallType; + + private final String desc; + + AlarmModelEnum(Integer bigType, Integer smallType, String desc) { + this.bigType = bigType; + this.smallType = smallType; + this.desc = desc; + } + + public static AlarmModelEnum getAlarmModel(String alarmModel) { + for (AlarmModelEnum value : AlarmModelEnum.values()) { + if (value.name().equals(alarmModel)) { + return value; + } + } + return UnKnow; + } + + + public Integer getBigType() { + return bigType; + } + + public Integer getSmallType() { + return smallType; + } + + public String getDesc() { + return desc; + } +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmTypeEnum.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmTypeEnum.java new file mode 100644 index 0000000..8e97b42 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/AlarmTypeEnum.java @@ -0,0 +1,42 @@ +package org.dromara.iot.service.unview.model.enums; + +import java.util.Objects; + +public enum AlarmTypeEnum { + + BehaviorAnalysis(1, "行为分析告警数据"), + AlarmRecovery(2, "告警恢复数据"), + FacialCapture(3, "人脸抓拍数据"), + FacialComparison(4, "人脸比对数据"), + BehavioralComparison(5, "行为比对数据"), + HeartBerth(6, "保活数据"), + PointChange(7, "点位变更数据"), + ; + + private final Integer type; + + private final String desc; + + AlarmTypeEnum(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + + public static AlarmTypeEnum getAlarmType(Integer type) { + AlarmTypeEnum[] values = AlarmTypeEnum.values(); + for (AlarmTypeEnum value : values) { + if (Objects.equals(type, value.getType())) { + return value; + } + } + return null; + } + + public Integer getType() { + return type; + } + + public String getDesc() { + return desc; + } +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/UniViewApiEnum.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/UniViewApiEnum.java new file mode 100644 index 0000000..0b97b9d --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/model/enums/UniViewApiEnum.java @@ -0,0 +1,126 @@ +package org.dromara.iot.service.unview.model.enums; + +import lombok.Getter; +import org.springframework.http.HttpMethod; + +/** + * 宇视请求枚举 + */ +@Getter +public enum UniViewApiEnum { + /** + * 新增人像库 + */ + PERSONLIB_ADD("/api/v2/personlib/add", HttpMethod.POST), + + PERSONLIB_DEL("/api/v2/personlib/delete", HttpMethod.POST), + + PERSONLIB_UPDATE("/api/v2/personlib/update", HttpMethod.POST), + + PERSONLIB_FIND("/api/v2/personlib/list", HttpMethod.POST), + + /** + * 新增人像 + */ + PERSON_ADD("/api/v2/person/add", HttpMethod.POST), + /** + * 批量新增人像 + */ + PERSON_BATCH_ADD("/api/v2/person/import", HttpMethod.POST), + /** + * 批量删除 + */ + PERSON_BATCH_DEL("/api/v2/person/delete", HttpMethod.POST), + /** + * 修改人像信息 + */ + PERSON_UPDATE("/api/v2/person/update", HttpMethod.POST), + + /** + * 查询人像信息 + */ + PERSON_FIND("/api/v2/person/list", HttpMethod.POST), + + + /** + * 获取 rsa 公钥 + */ + POINT_RAS("/api/v2/rsa/publickey", HttpMethod.POST), + + /** + * 通过 onvif 获取设备码流信息 + */ + POINT_DEVICE_INFO("/api/v2/channel/device/info", HttpMethod.POST), + /** + * 新增点位 + */ + POINT_ADD("/api/v2/channel/add", HttpMethod.POST), + /** + * 删除点位 + */ + POINT_DEL("/api/v2/channel/delete", HttpMethod.POST), + /** + * 修改点位信息 + */ + POINT_UPDATE("/api/v2/channel/update", HttpMethod.POST), + /** + * 获取点位列表 + */ + POINT_FIND("/api/v2/channel/list", HttpMethod.POST), + /** + * 批量新增点位 + */ + POINT_BATCH_ADD("/api/v2/channel/import", HttpMethod.POST), + + /** + * 跟新布防时间 + */ + POINT_CONTROL_TIME_UPDATE("/api/v2/control/time/update", HttpMethod.POST), + + /** + * 查询布防时间 + */ + POINT_CONTROL_TIME_FIND("/api/v2/control/time/get", HttpMethod.POST), + + /** + * 工服库相关 + */ + WORK_CLOTHES_LIB_ADD("/api/v2/workclotheslib/add", HttpMethod.POST), + WORK_CLOTHES_LIB_UPDATE("/api/v2/workclotheslib/update", HttpMethod.POST), + WORK_CLOTHES_LIB_DELETE("/api/v2/workclotheslib/delete", HttpMethod.POST), + WORK_CLOTHES_LIB_FIND("/api/v2/workclotheslib/list", HttpMethod.POST), + + /** + * 工服管理相关 + */ + WORK_CLOTHES_ADD("/api/v2/workclothes/add", HttpMethod.POST), + WORK_CLOTHES_BATCH_ADD("/api/v2/workclothes/batchadd", HttpMethod.POST), + WORK_CLOTHES_DELETE("/api/v2/workclothes/delete", HttpMethod.POST), + WORK_CLOTHES_FIND("/api/v2/workclothes/list", HttpMethod.POST), + /*---------------------------------------------------- 数据检索 -------------------------------------------------------------*/ + SEARCH_BEHAVIOR("/api/v2/search/behavior", HttpMethod.POST), // 行为分析检索 + SEARCH_FACECAP("/api/v2/search/facecap", HttpMethod.POST), // 人脸检索 + SEARCH_BEHAVIORMATCH("/api/v2/search/behaviormatch", HttpMethod.POST), // 行为比对检索 + SEARCH_FACEMATCH("/api/v2/search/facematch", HttpMethod.POST), // 人脸检索 + ; + + /** + * 请求uri + */ + private final String uri; + + /** + * 请求方法类型 + */ + private final HttpMethod method; + + /** + * 资源路径描述 + */ + + UniViewApiEnum(String uri, HttpMethod method) { + this.uri = uri; + this.method = method; + } + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/UnViewAiBoxApiService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/UnViewAiBoxApiService.java new file mode 100644 index 0000000..34de467 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/UnViewAiBoxApiService.java @@ -0,0 +1,235 @@ +package org.dromara.iot.service.unview.service; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.dromara.iot.service.unview.UnViewAiBoxApi; +import org.dromara.iot.service.unview.model.enums.UniViewApiEnum; +import org.dromara.iot.service.unview.utils.UniViewHttp; +import org.springframework.stereotype.Component; +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.dromara.iot.service.unview.model.UvModel.*; + + +/** + * 宇试AI盒子接口 + * + * @author lxj + * @since 2025-06-24 + */ +@Slf4j +@Component +public class UnViewAiBoxApiService implements UnViewAiBoxApi { + + @Resource + private UniViewHttp uniViewHttp; + + public SearchBehaviorResult searchBehavior(UvSystemInfo uvSystemInfo, SearchBehaviorParams params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.SEARCH_BEHAVIOR, params, SearchBehaviorResult.class); + return request.getData(); + } + + public AddLibResult addPersonLib(UvSystemInfo systemInfo, String libName) { + Map params = new HashMap<>(1); + params.put("lib_name", libName); + UniViewResult request = uniViewHttp.request(systemInfo, UniViewApiEnum.PERSONLIB_ADD, params, AddLibResult.class); + return request.getData(); + } + + public boolean deletePersonLib(UvSystemInfo systemInfo, Integer... libIds) { + if (libIds.length == 0) { + log.info("libIds 不能为空"); + return false; + } + JSONObject params = new JSONObject(); + params.put("lib_id", Arrays.asList(libIds)); + UniViewResult request = uniViewHttp.request(systemInfo, UniViewApiEnum.PERSONLIB_DEL, params, Integer.class); + return request.success(); + } + + public boolean updatePersonLib(UvSystemInfo systemInfo, Integer libId, String LibName) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("lib_name", LibName); + UniViewResult request = uniViewHttp.request(systemInfo, UniViewApiEnum.PERSONLIB_UPDATE, params, Integer.class); + return request.success(); + } + + public QueryLibResult findPagePersonLib(UvSystemInfo systemInfo, String libName, Integer current, Integer size) { + JSONObject params = new JSONObject(); + if (StrUtil.isNotBlank(libName)) { + params.put("lib_name", libName); + } + if (current == null) { + current = 1; + } + if (size == null) { + size = 10; + } + params.put("page", current); + params.put("pagesize", size); + UniViewResult request = uniViewHttp.request(systemInfo, UniViewApiEnum.PERSONLIB_FIND, params, QueryLibResult.class); + return request.getData(); + } + + + public AddPersonResult addPerson(UvSystemInfo uvSystemInfo, AddPersonParams addPersonParams) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.PERSON_ADD, addPersonParams, AddPersonResult.class); + return request.result(); + } + + public BatchAddPersonResult batchAddPerson(UvSystemInfo uvSystemInfo, BatchAddPersonParams personParams) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.PERSON_BATCH_ADD, personParams, BatchAddPersonResult.class); + return request.result(); + } + + public Boolean batchDeletePerson(UvSystemInfo uvSystemInfo, Integer[] personIds) { + JSONObject params = new JSONObject(); + params.put("person_id_list", personIds); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.PERSON_BATCH_DEL, params, String.class); + return request.success(); + } + + public Boolean updatePerson(UvSystemInfo uvSystemInfo, UpdatePersonParams params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.PERSON_UPDATE, params, String.class); + return request.success(); + } + + + public queryPersonPageResult findPersonPage(UvSystemInfo uvSystemInfo, queryPersonPageParams params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.PERSON_FIND, params, queryPersonPageResult.class); + return request.result(); + } + + /*--------------------------------------------------------------------- 点位管理 -------------------------------------------------------------------------*/ + + public GetPublickeyResult getPublickey(UvSystemInfo uvSystemInfo) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_RAS, null, GetPublickeyResult.class); + return request.result(); + } + + public QueryOnvifResult getOnvif(UvSystemInfo uvSystemInfo) { + JSONObject params = new JSONObject(); + params.put("ip", uvSystemInfo.getIp()); + params.put("port", uvSystemInfo.getPort()); + params.put("username", uvSystemInfo.getAccount()); + params.put("pwd", uvSystemInfo.getPassword()); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_RAS, params, QueryOnvifResult.class); + return request.result(); + } + + public AddPointResult addPoint(UvSystemInfo uvSystemInfo, PointParams req) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_ADD, req, AddPointResult.class); + return request.result(); + } + + public Boolean deletePoint(UvSystemInfo uvSystemInfo, List channelIds) { + JSONObject params = new JSONObject(); + params.put("channel_id_list", channelIds); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_DEL, params, String.class); + return request.success(); + } + + public Boolean updatePoint(UvSystemInfo uvSystemInfo, UpdatePointParams params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_UPDATE, params, String.class); + return request.success(); + } + + public QueryPointResult queryPoint(UvSystemInfo uvSystemInfo, QueryPointParams req) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_FIND, req, QueryPointResult.class); + return request.result(); + } + + public BatchAddPersonResult batchAddPoint(UvSystemInfo uvSystemInfo, BatchAddPointParams params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_BATCH_ADD, params, BatchAddPersonResult.class); + return request.result(); + } + + public Boolean pointControlTimeUpdate(UvSystemInfo uvSystemInfo, ModifyControlTime params) { + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_CONTROL_TIME_UPDATE, params, String.class); + return request.success(); + } + + public ControlTime queryControlTime(UvSystemInfo uvSystemInfo, Integer channel_id, Integer algo_model) { + JSONObject params = new JSONObject(); + params.put("channel_id", channel_id); + params.put("algo_model", algo_model); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.POINT_CONTROL_TIME_FIND, params, ControlTime.class); + return request.result(); + } + + /*---------------------------------------------------------------- 工服库 ---------------------------------------------------------------------------*/ + public Integer addWorkClothesLib(UvSystemInfo uvSystemInfo, String libName) { + JSONObject params = new JSONObject(); + params.put("lib_name", libName); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_LIB_ADD, params, Integer.class); + return request.result(); + } + + public Boolean updateWorkClothesLib(UvSystemInfo uvSystemInfo, Integer libId, String libName) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("lib_name", libName); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_LIB_UPDATE, params, String.class); + return request.success(); + } + + public Boolean deleteWorkClothesLib(UvSystemInfo uvSystemInfo, Integer libId) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_LIB_DELETE, params, String.class); + return request.success(); + } + + public QueryLibResult findPageWorkClothesLib(UvSystemInfo uvSystemInfo, String libName, Integer page, Integer pageSize) { + JSONObject params = new JSONObject(); + params.put("lib_name", libName); + params.put("page", page); + params.put("pagesize", pageSize); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_LIB_FIND, params, QueryLibResult.class); + return request.result(); + } + + /*--------------------------------------------------------------------工服 ---------------------------------------------------------------------------*/ + + public Integer addWorkClothes(UvSystemInfo uvSystemInfo, Integer libId, String imageBase64) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("image_base64", imageBase64); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_ADD, params, Integer.class); + return request.result(); + } + + public BatchAddWorkClothesResult batchAddWorkClothes(UvSystemInfo uvSystemInfo, Integer libId, List imageBase64s) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("image_base64", imageBase64s); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_BATCH_ADD, params, BatchAddWorkClothesResult.class); + return request.result(); + } + + public Boolean deleteWorkClothes(UvSystemInfo uvSystemInfo, Integer libId, List workClothesIds) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("workclothes_id_list", workClothesIds); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_DELETE, params, String.class); + return request.success(); + } + + public FindWorkClothesResult findPageWorkClothes(UvSystemInfo uvSystemInfo, Integer libId, Integer page, Integer size, Integer status) { + JSONObject params = new JSONObject(); + params.put("lib_id", libId); + params.put("page", page); + params.put("pagesize", size); + params.put("model_status", status); + UniViewResult request = uniViewHttp.request(uvSystemInfo, UniViewApiEnum.WORK_CLOTHES_FIND, params, FindWorkClothesResult.class); + return request.result(); + } + + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/VideoAlarmService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/VideoAlarmService.java new file mode 100644 index 0000000..7c6e7b7 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/service/VideoAlarmService.java @@ -0,0 +1,121 @@ +package org.dromara.iot.service.unview.service; + +import lombok.extern.slf4j.Slf4j; +import org.dromara.iot.service.unview.model.UvModel; +import org.dromara.iot.service.unview.model.enums.AlarmTypeEnum; +import org.springframework.stereotype.Service; + +/** + * 宇视人体设备告警数据处理 + * + * @author lxj + */ +@Slf4j +@Service +public class VideoAlarmService { + + + public void handleAlarmData(UvModel.AlarmReportInfo alarmReportData) { + Integer type = alarmReportData.getType(); + AlarmTypeEnum alarmType = AlarmTypeEnum.getAlarmType(type); + if (alarmType == null) { + log.info("未知的数据上报类型。"); + return; + } + switch (alarmType) { + case BehaviorAnalysis: { + handleBehaviorAnalysis(alarmReportData); + break; + } + case AlarmRecovery: { + handleAlarmRecovery(alarmReportData); + break; + } + case FacialCapture: { + handleFacialCapture(alarmReportData); + break; + } + case FacialComparison: { + handleFacialComparison(alarmReportData); + break; + } + case BehavioralComparison: { + handleBehavioralComparison(alarmReportData); + break; + } + case HeartBerth: { + handleHeartBerth(alarmReportData); + break; + } + case PointChange: { + handlePointChange(alarmReportData); + break; + } + } + } + + /** + * 设备心跳上报 + * + * @param alarmReportData 上报数据 + */ + private void handleHeartBerth(UvModel.AlarmReportInfo alarmReportData) { + // 处理心跳数据 + log.info("设备心跳数据上报,data={}", alarmReportData); + } + + /** + * 行为分析告警数据上报 + * + * @param alarmReportData 告警数据 + */ + private void handleBehaviorAnalysis(UvModel.AlarmReportInfo alarmReportData) { + + } + + /** + * 告警恢复数据上报 + * + * @param alarmReportData 告警数据 + */ + private void handleAlarmRecovery(UvModel.AlarmReportInfo alarmReportData) { + + } + + /** + * 人脸抓拍上报 + * + * @param alarmReportData 告警数据 + */ + private void handleFacialCapture(UvModel.AlarmReportInfo alarmReportData) { + + } + + /** + * 人脸比对数据上报 + * + * @param alarmReportData 告警数据 + */ + private void handleFacialComparison(UvModel.AlarmReportInfo alarmReportData) { + + } + + /** + * 行为比对数据上报 + * + * @param alarmReportData 告警数据 + */ + private void handleBehavioralComparison(UvModel.AlarmReportInfo alarmReportData) { + + } + + /** + * 点位变更数据上报 + * + * @param alarmReportData 告警数据 + */ + private void handlePointChange(UvModel.AlarmReportInfo alarmReportData) { + + } + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/utils/UniViewHttp.java b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/utils/UniViewHttp.java new file mode 100644 index 0000000..769df06 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/iot/service/unview/utils/UniViewHttp.java @@ -0,0 +1,213 @@ +package org.dromara.iot.service.unview.utils; + + +import cn.hutool.core.util.IdUtil; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.http.HttpStatus; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import lombok.extern.slf4j.Slf4j; +import org.dromara.iot.service.unview.model.UvModel; +import org.dromara.iot.service.unview.model.enums.UniViewApiEnum; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.dromara.iot.service.unview.model.UvModel.*; + + +/** + * 宇视HTTP处理 + */ +@Slf4j +@Component +public class UniViewHttp { + + /** + * 请求头Authorization 字段前缀 + */ + public static final String UNIVIEW_HTTP_PROTOCOL = "http://"; + /** + * 请求头Authorization 字段前缀 + */ + public static final String UNIVIEW_AUTH_PREFIX = "Digest "; + /** + * 宇视请求返回401,鉴权信息字段 + */ + public static final String UNIVIEW_AUTH_FAIL_PRFIX = "WWW-Authenticate"; + /** + * Authorization 放入设备鉴权信息字段 + */ + public static final String UNIVIEW_REQUEST_AUTH_KEY = "Authorization"; + + @Resource + private RestTemplate restTemplate; + + /** + * 用于缓存宇视设备鉴权信息的map + * key:设备ip + * value:设备的鉴权信息 + */ + private static final Map CACHE_AUTH_MAP = new HashMap<>(16); + + public UniViewResult request(UvSystemInfo systemInfo, UniViewApiEnum api, Object data, Class cls) { + UniViewResult result = r(systemInfo, api, data, cls); + if (result.success()) { + log.info("宇视设备请求成功,result: {}", result); + return result; + } else if (result.unAuth()) { + // 鉴权失败则再次请求 + return r(systemInfo, api, data, cls); + } else { + // 如果请求失败,尝试再次请求,如果依然失败则放弃 + return r(systemInfo, api, data, cls); + } + } + + /** + * 发起宇视平台请求 + *

由于宇视所有请求均为POST,所以请求的时候不做区分

+ * + * @param systemInfo 请求到达的设备信息 + * @param api 请求资源信息 + * @param data 请求数据 + * @param cls 返回数据类型 + * @param 返回数据裂隙 + * @return 返回响应数据 + */ + private UniViewResult r(UvSystemInfo systemInfo, UniViewApiEnum api, Object data, Class cls) { + // 生成请求完整路径 + String requestUrl = UNIVIEW_HTTP_PROTOCOL + systemInfo.getIp() + ":" + systemInfo.getPort() + api.getUri(); + // 获取鉴权信息 + UvAuthInfo authData = CACHE_AUTH_MAP.get(systemInfo.getIp()); + // 如果存在鉴权信息,依据文档生成鉴权信息 + String authorization = null; + if (authData != null) { + authorization = createAuthData(systemInfo, api, authData); + } + + try { + // 设置请求头 + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + if (authorization != null) { + headers.add(UNIVIEW_REQUEST_AUTH_KEY, authorization); + } + HttpEntity requestEntity = null; + if (data == null) { + requestEntity = new HttpEntity<>(null, headers); + } + if (data instanceof JSONObject) { + JSONObject obj = (JSONObject) data; + requestEntity = new HttpEntity<>(obj.toJSONString(), headers); + } else { + requestEntity = new HttpEntity<>(JSONObject.toJSONString(data), headers); + } + ResponseEntity exchange = restTemplate.exchange(requestUrl, api.getMethod(), requestEntity, String.class); + int statusCode = exchange.getStatusCodeValue(); + String body = exchange.getBody(); + + if (HttpStatus.HTTP_UNAUTHORIZED == statusCode) { + // 处理401请求参数,并且返回鉴权信息 + handleAuthData(exchange.getHeaders(), systemInfo); + UvAuthInfo authData1 = CACHE_AUTH_MAP.get(systemInfo.getIp()); + log.info("宇视设备请求返回401, 开始处理鉴权数据,authData1 = {}", authData1); + return JSONObject.parseObject(body, new TypeReference>(cls) { + }); + } + UniViewResult result = JSONObject.parseObject(body, new TypeReference>(cls) { + }); + log.info("宇视设备请求返回完成,result={}", result); + return result; + } catch (Exception e) { + log.info("发起宇视设备请求失败,msg:{}", e.getMessage()); + if (e instanceof HttpClientErrorException exception) { + if (exception.getStatusCode().value() == 401) { + HttpHeaders responseHeaders = exception.getResponseHeaders(); + handleAuthData(responseHeaders, systemInfo); + UvAuthInfo authData1 = CACHE_AUTH_MAP.get(systemInfo.getIp()); + log.info("宇视设备请求返回401, 开始处理鉴权数据,authData1 = {}", authData1); + } + } + + UniViewResult uniViewResult = new UniViewResult<>(); + uniViewResult.setCode(-1); + uniViewResult.setMsg("发起请求异常,msg=" + e.getMessage()); + uniViewResult.setStatus_code(-1); + return uniViewResult; + } + } + + + private static String createAuthData(UvSystemInfo systemInfo, UniViewApiEnum api, UvAuthInfo authData) { + // r1 原始字符串 + String OriginalR1 = systemInfo.getAccount() + ":" + authData.getRealm() + ":" + systemInfo.getPassword(); + // 进行md5加密 + String md5R1 = SecureUtil.md5(OriginalR1); + // 生成r1 +// String r1 = HexUtil.encodeHexStr(md5R1); + // r2原始字符串 + String OriginalR2 = api.getMethod().name() + ":" + api.getUri(); + // 进行md5加密 + String md5R2 = SecureUtil.md5(OriginalR2); + // 生成r1 +// String r2 = HexUtil.encodeHexStr(md5R2); + + // response 原始字符串 + String cnonce = IdUtil.fastSimpleUUID(); + String nc = "00000002"; + String OriginalResponse = md5R1 + ":" + authData.getNonce() + ":" + nc + ":" + cnonce + ":" + authData.getQop() + ":" + md5R2; + // 进行md5加密 + String md5Response = SecureUtil.md5(OriginalResponse); + // 生成r1 +// String response = HexUtil.encodeHexStr(md5Response); + return UNIVIEW_AUTH_PREFIX + "username=\"" + systemInfo.getAccount() + "\"," + + "realm=\"" + authData.getRealm() + "\"," + + "nonce=\"" + authData.getNonce() + "\"," + + "uri=\"" + api.getUri() + "\"," + + "algorithm=\"" + authData.getAlgorithm() + "\"," + + "qop=\"" + authData.getQop() + "\"," + + "nc=\"" + nc + "\"," + + "cnonce=\"" + cnonce + "\"," + + "response=\"" + md5Response + "\""; + } + + /** + * 解析响应体参数,并缓存到鉴权map里 + */ + private void handleAuthData(HttpHeaders responseHeaders, UvSystemInfo systemInfo) { + List headers = responseHeaders.get(UNIVIEW_AUTH_FAIL_PRFIX); + headers.forEach(header -> { + log.info("获取到宇视设备返回的响应体参数: data: {}", header); + if (header.startsWith(UNIVIEW_AUTH_PREFIX)) { + header = header.replace(UNIVIEW_AUTH_PREFIX, ""); + } + String[] s = header.split(","); + if (s.length > 0) { + Map m = new HashMap<>(); + for (String str : s) { + String[] split = str.split("="); + String s1 = split[1].replaceAll("\"", ""); + m.put(split[0], s1); + } + UvRequestAuthInfo authData = new UvRequestAuthInfo(); + authData.setAlgorithm(m.get("algorithm")); + authData.setQop(m.get("qop")); + authData.setRealm(m.get("realm")); + authData.setNonce(m.get("nonce")); + authData.setStale(m.get("stale")); + CACHE_AUTH_MAP.put(systemInfo.getIp(), authData); + log.info("生成鉴权信息成功, authData={}", authData); + } + }); + } +} diff --git a/ruoyi-modules/Iot/src/main/resources/application.yml b/ruoyi-modules/Sis/src/main/resources/application.yml similarity index 98% rename from ruoyi-modules/Iot/src/main/resources/application.yml rename to ruoyi-modules/Sis/src/main/resources/application.yml index 63b34ac..71f0aaf 100644 --- a/ruoyi-modules/Iot/src/main/resources/application.yml +++ b/ruoyi-modules/Sis/src/main/resources/application.yml @@ -6,7 +6,7 @@ server: spring: application: # 应用名称 - name: iot + name: Sis profiles: # 环境配置 active: @profiles.active@ diff --git a/ruoyi-modules/Iot/src/main/resources/banner.txt b/ruoyi-modules/Sis/src/main/resources/banner.txt similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/banner.txt rename to ruoyi-modules/Sis/src/main/resources/banner.txt diff --git a/ruoyi-modules/Iot/src/main/resources/logback-plus.xml b/ruoyi-modules/Sis/src/main/resources/logback-plus.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/logback-plus.xml rename to ruoyi-modules/Sis/src/main/resources/logback-plus.xml diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/TbAccessControlMapper.xml b/ruoyi-modules/Sis/src/main/resources/mapper/TbAccessControlMapper.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/mapper/TbAccessControlMapper.xml rename to ruoyi-modules/Sis/src/main/resources/mapper/TbAccessControlMapper.xml diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/TdFactoryMapper.xml b/ruoyi-modules/Sis/src/main/resources/mapper/TdFactoryMapper.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/mapper/TdFactoryMapper.xml rename to ruoyi-modules/Sis/src/main/resources/mapper/TdFactoryMapper.xml diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/TdMeterConfigMapper.xml b/ruoyi-modules/Sis/src/main/resources/mapper/TdMeterConfigMapper.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/mapper/TdMeterConfigMapper.xml rename to ruoyi-modules/Sis/src/main/resources/mapper/TdMeterConfigMapper.xml diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/TdMeterMapper.xml b/ruoyi-modules/Sis/src/main/resources/mapper/TdMeterMapper.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/mapper/TdMeterMapper.xml rename to ruoyi-modules/Sis/src/main/resources/mapper/TdMeterMapper.xml diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/TdMeterRoomMapper.xml b/ruoyi-modules/Sis/src/main/resources/mapper/TdMeterRoomMapper.xml similarity index 100% rename from ruoyi-modules/Iot/src/main/resources/mapper/TdMeterRoomMapper.xml rename to ruoyi-modules/Sis/src/main/resources/mapper/TdMeterRoomMapper.xml diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 25f0253..8f73c2b 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -15,7 +15,7 @@ ruoyi-resource ruoyi-workflow Property - Iot + Sis ruoyi-modules diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties index 4542493..f1576ca 100644 --- a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties +++ b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties @@ -40,9 +40,9 @@ spring.sql.init.platform=mysql db.num=1 ### Connect URL of DB: -db.url.0=jdbc:mysql://127.0.0.1:3306/cloudconfig?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true +db.url.0=jdbc:mysql://47.109.37.87:3002/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true db.user.0=root -db.password.0=root +db.password.0=123456 ### the maximum retry times for push nacos.config.push.maxRetryTime=50