| | |
| | | # golden实时数据库适配程序 |
| | | # Monibuca监控处理程序 |
| | | |
| | | |
| | | **同步获取golden实时数据库的程序,技术选型:Springboot+JPA** |
| | | **暂时不要使用,半成品** |
| | | **通过使用http的方式调用Monica实例,处理视频流** |
| | | |
| | | ## V1.0 |
| | | #### 准备工作 |
| | | - 运行Monica实例机器IP |
| | | |
| | | #### 已有功能 |
| | | |
| | | - 同步所有表与标签信息的数据结构 |
| | | - 针对SMS,ktnz2c_plc,dlz_plc,djw_plc,bds_plc进行基本数据同步,每三十秒同步更新一次 |
| | | - 将rtsp流转换成 HLS,WebRTC,FLV.js,Jessibuca 并进行H5播放 |
| | | |
| | | #### 目前还存在的已知一些问题 |
| | | |
| | | - 持久层操作冗余 |
| | | - 同步操作时间过长,需要优化 |
| | | - 介入数据只是基本数据,针对详细数据未完全介入进来 |
| | | |
| | | |
| | | #### 环境介绍 |
| | | |
| | | - golden数据库服务器 来自:47.92.145.232机器上 |
| | | - 同步环境 :开发环境MariaDB 的库名为:localgd上 |
| | | |
| | | |
| | | #### 标签点完整数据结构 (示例): |
| | | ```json |
| | | { |
| | | "basePoint": { |
| | | "alarmindex": 0, |
| | | "archive": true, |
| | | "calcindex": 917504, |
| | | "changedate": 1575520921000, |
| | | "changer": "sa", |
| | | "classof": "RTDB_CALC", |
| | | "compdev": 1.0, |
| | | "compdevpercent": 0.009999999776482582, |
| | | "compress": true, |
| | | "comptimemax": 28800, |
| | | "comptimemin": 0, |
| | | "createdate": 1574164482000, |
| | | "creator": "sa", |
| | | "desc": "1号空压机故障指示", |
| | | "digits": -5, |
| | | "excdev": 0.5, |
| | | "excdevpercent": 0.004999999888241291, |
| | | "exctimemax": 600, |
| | | "exctimemin": 0, |
| | | "highlimit": 100.0, |
| | | "id": 9838, |
| | | "lowlimit": 0.0, |
| | | "microsecond": false, |
| | | "mirror": false, |
| | | "padding": "AAAAAAA=", |
| | | "scanindex": 0, |
| | | "shutdown": false, |
| | | "step": false, |
| | | "summary": false, |
| | | "table": 11, |
| | | "table_dot_tag": "SMS.SMS01_1号空压机故障指示", |
| | | "tag": "SMS01_1号空压机故障指示", |
| | | "type": "RTDB_BOOL", |
| | | "typical": 50.0, |
| | | "unit": "" |
| | | }, |
| | | "calcPoint": { |
| | | "equation": "if('DLZ_PLC.1号空压机故障指示'==1,1,0)", |
| | | "id": 9838, |
| | | "period": 65536, |
| | | "timecopy": "RTDB_CALC_TIME" |
| | | }, |
| | | "error": 0 |
| | | } |
| | | ``` |
| | | |
| | | #### 项目部署可能会涉及到Linux命令 |
| | | |
| | |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | //@Configuration |
| | | //@EnableSwagger2 |
| | | public class Swagger2Conf extends WebMvcConfigurationSupport { |
| | | |
| | | @Bean |
| | |
| | | registry.addResourceHandler("/**").addResourceLocations( |
| | | "classpath:/static/"); |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations( |
| | | "classpath:/META-INF/resources/"); |
| | | "classpath:/META-INF/resources/public/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations( |
| | | "classpath:/META-INF/resources/webjars/"); |
| | | super.addResourceHandlers(registry); |
| | |
| | | @Override |
| | | @RequestMapping(value = "/test/video", method = RequestMethod.GET) |
| | | @ApiOperation("test") |
| | | public CallResult<String> parseVideoRTSP() { |
| | | public String parseVideoRTSP() { |
| | | try { |
| | | CallResult<String> result = monibucaManager.parseVideo(); |
| | | String result = monibucaManager.parseVideo(); |
| | | return result; |
| | | } catch (Exception e) { |
| | | log.error("接口:com.hbbh.adapter.controller.api.MonibucaAPIController.parseVideoRTSP 调用失败"); |
| | |
| | | * @return |
| | | * -1 解析失败 |
| | | */ |
| | | public CallResult<String> parseVideoRTSP(); |
| | | public String parseVideoRTSP(); |
| | | |
| | | /** |
| | | * @param param streamPath地址 |
| | |
| | | * .flv 视频流格式 |
| | | * |
| | | */ |
| | | CallResult<String> parseVideo(); |
| | | String parseVideo(); |
| | | } |
| | |
| | | * @return jessibucaDemo |
| | | */ |
| | | @Override |
| | | public CallResult<String> parseVideo() { |
| | | public String parseVideo() { |
| | | String url="http://localhost:8081/rtsp/pull"; |
| | | Map<String, String> params = Maps.newLinkedHashMap(); |
| | | params.put("target",rtspDemo); |
| | |
| | | String code = map.get("code")+""; |
| | | String msg = map.get("msg")+""; |
| | | if (!StringUtils.equals("0",code)){ |
| | | CallResult.success(msg,"-1"); |
| | | return "-1"; |
| | | } |
| | | return CallResult.success(jessibucaDemo); |
| | | return jessibucaDemo; |
| | | } |
| | | } |
| | |
| | | |
| | | <script src="./ajax.js"></script> |
| | | <script src="./renderer.js"></script> |
| | | <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> |
| | | |
| | | <script> |
| | | onerror = handleErr; |
| | | var txt = ""; |
| | |
| | | return; |
| | | } |
| | | isPlaying = true; |
| | | play(); |
| | | $.get("http://127.0.0.1:8088/monica/test/video", function (data) { |
| | | h5lc.play(data) |
| | | } |
| | | ); |
| | | //play(); |
| | | $playDom.style.display = 'none'; |
| | | $stopDom.style.display = 'block'; |
| | | }, false); |
| | |
| | | // h5lc.play("ws://localhost:8080/live/test.flv", canvas) |
| | | |
| | | } |
| | | |
| | | function getFastCdnFromList(ipList) { |
| | | ipList = ipList || []; |
| | | var firstResponseIp = ''; |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | function stop() { |
| | | h5lc.close() |
| | | } |