From dbe8a3146a6ce9d6c7255e869a8a0b501c6b530a Mon Sep 17 00:00:00 2001 From: weidong Date: Wed, 27 Nov 2024 15:53:29 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=91=8A=E8=AD=A6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=95=BF=E6=9C=9F=E6=97=A0=E6=9C=89?= =?UTF-8?q?=E6=95=88=E8=A7=A3=E5=91=8A=E8=AD=A6=202=E3=80=81=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E8=A7=A3=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.txt | 8 +++- .../com/imdroid/secapi/dto/WarningCfg.java | 6 +-- .../executor/D331RtcmMessageExecutor.java | 13 +++++-- .../executor/D341LocationMessageExecutor.java | 9 +++-- .../D3F0SelfCheckMessageExecutor.java | 19 ++++++---- .../D3F2StopIndicationMessageExecutor.java | 20 +++------- .../com/imdroid/sideslope/sal/Device.java | 12 +++--- .../service/DataPersistServiceImpl.java | 10 +++++ .../sideslope/service/WarningServiceImpl.java | 37 +++++++++++++++++-- .../beidou/controller/IndexController.java | 5 +-- .../beidou/controller/WarningController.java | 2 +- .../beidou/task/DeviceStatusChecker.java | 7 +--- .../templates/page/device_overview.html | 2 +- .../beidou/test_device/task/BeidouDevice.java | 15 +++++--- 14 files changed, 109 insertions(+), 56 deletions(-) diff --git a/readme.txt b/readme.txt index 65786d47..77c78864 100644 --- a/readme.txt +++ b/readme.txt @@ -35,4 +35,10 @@ beidou-exapi 9908(外) 3)幅度压缩:压缩值=上个周期平滑值+(单位周期解算值-上个周期平滑值)*幅度压缩系数,平滑值=滤波窗口内avg(压缩值) 4)初值作为参考点的有效时长,缺省为1个周期。从初始值更新时间开始算起 -小树林算法:1b+2b+3高程0.1+4的48小时 \ No newline at end of file +小树林算法:1b+2b+3高程0.1+4的48小时 + +2024-11 +告警: +1)离线:设备记录最后一次收到任何数据的时间。定时任务检查设备最后一次时间,如果与当前时间差距大于门限,则判断为离线;D3F0/D3F2清除离线告警 +2)连续无效解:每次解算完,如果是无效解,则无效解次数加1;否则清0;如果等于N,则产生一次告警。 +3)连续无固定解:每个周期结束,如果是有效解解,则记录当前时间;D3F2检测当前时间和最近一次有效解时间差距,如果大于N,则产生一次告警。 \ No newline at end of file diff --git a/sec-api/src/main/java/com/imdroid/secapi/dto/WarningCfg.java b/sec-api/src/main/java/com/imdroid/secapi/dto/WarningCfg.java index 684b1a3a..2b4970fb 100644 --- a/sec-api/src/main/java/com/imdroid/secapi/dto/WarningCfg.java +++ b/sec-api/src/main/java/com/imdroid/secapi/dto/WarningCfg.java @@ -38,8 +38,8 @@ public class WarningCfg { public static final String TYPE_NAME_LESS_B562 = "固定解少"; public static final int TYPE_NO_FIXED_RESULT = 0x100; public static final String TYPE_NAME_NO_FIXED_RESULT = "连续无固定解"; - //public static final int TYPE_BS_NO_RESULT = 0x200; - //public static final String TYPE_NAME_BS_NO_RESULT = "基站下的测站均无解"; + public static final int TYPE_CONT_INVALID_RESULT = 0x200; + public static final String TYPE_NAME_CONT_INVALID_RESULT = "长时间无有效解"; public static final int TYPE_INCLINE = 0x400; public static final String TYPE_NAME_INCLINE = "异常倾斜"; @@ -66,7 +66,7 @@ public class WarningCfg { if((code & TYPE_LESS_D3XX) !=0) warningInfo.add(TYPE_NAME_LESS_D3XX); if((code & TYPE_LESS_B562) !=0) warningInfo.add(TYPE_NAME_LESS_B562); if((code & TYPE_NO_FIXED_RESULT) !=0) warningInfo.add(TYPE_NAME_NO_FIXED_RESULT); - //if((code & TYPE_BS_NO_RESULT) !=0) warningInfo.add(TYPE_NAME_BS_NO_RESULT); + if((code & TYPE_CONT_INVALID_RESULT) !=0) warningInfo.add(TYPE_NAME_CONT_INVALID_RESULT); if((code & TYPE_INCLINE) !=0) warningInfo.add(TYPE_NAME_INCLINE); return warningInfo; } diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java index ed35df8a..6240d092 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D331RtcmMessageExecutor.java @@ -70,17 +70,22 @@ public class D331RtcmMessageExecutor implements Executor if(deviceBs.getD3xxbytes()>0){ LocalDateTime now = LocalDateTime.now(); if(deviceBs.getLastRxTime().isBefore(now.minusMinutes(1)) && - (deviceBs.getLastD3f0f2Time() == null || - deviceBs.getLastD3f0f2Time().isBefore(now.minusMinutes(30)))) { + (deviceBs.getLastD3f2Time() == null || + deviceBs.getLastD3f2Time().isBefore(now.minusMinutes(30)))) { // new cycle logger.info("device {} rx {} d331 in a cycle while not d3f0f2",deviceBs.getDeviceId(),deviceBs.getD3xxCount()); Device lastCycleDevice = new Device(); lastCycleDevice.setDeviceId(deviceBs.getDeviceId()); + lastCycleDevice.setDeviceType(deviceBs.getDeviceType()); lastCycleDevice.setTenantId(deviceBs.getTenantId()); - lastCycleDevice.setD3xxbytes(deviceBs.getD3xxbytes()); - lastCycleDevice.setD3xxCount(deviceBs.getD3xxCount()); + lastCycleDevice.setD341bytes(deviceBs.getD341bytes()); + lastCycleDevice.setD341Count(deviceBs.getD341Count()); + lastCycleDevice.setFixedNum(deviceBs.getFixedNum()); + lastCycleDevice.setFloatNum(deviceBs.getFloatNum()); + lastCycleDevice.setNoFixedAndFloatResult(deviceBs.getNoFixedAndFloatResult()); lastCycleDevice.setLastRxTime(deviceBs.getLastRxTime()); + lastCycleDevice.setLastValidCalcDataTime(deviceBs.getLastValidCalcDataTime()); lastCycleDevice.setSatelitesInUse(deviceBs.getSatelitesInUse()); deviceBs.clearStat(); ThreadManager.getFixedThreadPool().submit(() -> { diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D341LocationMessageExecutor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D341LocationMessageExecutor.java index d32417fc..013a5944 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D341LocationMessageExecutor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D341LocationMessageExecutor.java @@ -44,18 +44,21 @@ public class D341LocationMessageExecutor implements Executor0) { LocalDateTime now = LocalDateTime.now(); - if (device.getLastRxTime().isBefore(now.minusMinutes(2)) && - (device.getLastD3f0f2Time() == null || - device.getLastD3f0f2Time().isBefore(now.minusMinutes(30)))) { + if (device.getLastRxTime().isBefore(now.minusMinutes(1)) && + (device.getLastD3f2Time() == null || + device.getLastD3f2Time().isBefore(now.minusMinutes(30)))) { // new cycle Device lastCycleDevice = new Device(); lastCycleDevice.setDeviceId(device.getDeviceId()); + lastCycleDevice.setDeviceType(device.getDeviceType()); lastCycleDevice.setTenantId(device.getTenantId()); lastCycleDevice.setD341bytes(device.getD341bytes()); lastCycleDevice.setD341Count(device.getD341Count()); lastCycleDevice.setFixedNum(device.getFixedNum()); lastCycleDevice.setFloatNum(device.getFloatNum()); + lastCycleDevice.setNoFixedAndFloatResult(device.getNoFixedAndFloatResult()); lastCycleDevice.setLastRxTime(device.getLastRxTime()); + lastCycleDevice.setLastValidCalcDataTime(device.getLastValidCalcDataTime()); lastCycleDevice.setSatelitesInUse(device.getSatelitesInUse()); device.clearStat(); ThreadManager.getFixedThreadPool().submit(() -> { diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F0SelfCheckMessageExecutor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F0SelfCheckMessageExecutor.java index cd82d5e2..53e84877 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F0SelfCheckMessageExecutor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F0SelfCheckMessageExecutor.java @@ -25,6 +25,10 @@ import java.time.LocalDateTime; /** * @author Layton * @date 2023/2/2 20:40 + * 1、回ACK,以便终端判断是否连接上服务器后台 + * 2、同步参数 + * 3、判断是否发冷启动指令 + * 4、保存状态信息,判断是否有低电压等告警,清除离线告警 */ @Component public class D3F0SelfCheckMessageExecutor implements Executor { @@ -49,30 +53,31 @@ public class D3F0SelfCheckMessageExecutor implements Executor { + // 检查是否需要对设备的F9P进行冷启动操作 + checkAndSendF9PColdStartCommand(device); + // 通知beidou服务设备上线,这里会触发参数同步 GnssStatus lastGnssStatus = dataPersistService.getDeviceState(message.getId()); try { if (lastGnssStatus != null && lastGnssStatus.getState() == GnssStatus.STATE_OFFLINE) { beidouClient.onLine(lastGnssStatus.getDeviceid(), lastGnssStatus.getTenantid(), lastGnssStatus.getUpdatetime()); } else { - // 通知beidou服务设备上线 beidouClient.onDeviceActive(message.getId(), device.getTenantId()); } } catch (Exception e){ } + //保存状态信息,判断是否有低电压等告警,清除离线告警 dataPersistService.saveDeviceState(message); }); @@ -101,7 +106,7 @@ public class D3F0SelfCheckMessageExecutor implements Executor= 6){ //sendF9PColdStartCommand(device); - logger.info("{}: 类型{}, 连续{}次无固定解和浮点解,发送 F9P 冷启动指令",device.getDeviceId(), device.getDeviceType(),device.getNoFixedAndFloatResult()); + logger.info("{}: 连续{}次无固定解和浮点解,发送 F9P 冷启动指令",device.getDeviceId(), device.getNoFixedAndFloatResult()); device.clearNoResultStat(); } } diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F2StopIndicationMessageExecutor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F2StopIndicationMessageExecutor.java index b65c9102..ee6fa0aa 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F2StopIndicationMessageExecutor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/executor/D3F2StopIndicationMessageExecutor.java @@ -11,7 +11,6 @@ import com.imdroid.sideslope.sal.Device; import com.imdroid.sideslope.sal.DeviceService; import com.imdroid.sideslope.service.DataPersistService; import com.imdroid.sideslope.service.GnssSingleBufferServiceImpl; -import com.imdroid.sideslope.service.WarningService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -24,6 +23,9 @@ import java.time.LocalDateTime; * 停止指示消息处理器 * * @author LiGang + * 1、更新统计 + * 2、启动单周期固定解处理 + * 3、保存统计信息,判断是否有连续无固定解、连续无有效解等告警,清除离线告警 */ @Component public class D3F2StopIndicationMessageExecutor implements Executor { @@ -40,23 +42,21 @@ public class D3F2StopIndicationMessageExecutor implements Executor
0
- + 2020
diff --git a/sec-test-device/src/main/java/com/imdroid/beidou/test_device/task/BeidouDevice.java b/sec-test-device/src/main/java/com/imdroid/beidou/test_device/task/BeidouDevice.java index f65fe239..035cff7f 100644 --- a/sec-test-device/src/main/java/com/imdroid/beidou/test_device/task/BeidouDevice.java +++ b/sec-test-device/src/main/java/com/imdroid/beidou/test_device/task/BeidouDevice.java @@ -67,13 +67,13 @@ public class BeidouDevice { executeAsD342("C:\\Users\\wd\\Desktop\\log\\2412254_0424_4xx.log"); executeAsD342("C:\\Users\\wd\\Desktop\\log\\2412254_0424_5xx.log"); */ - execute("C:\\Users\\wd\\Desktop\\log\\2345076_0424_5xx.log"); + //execute("C:\\Users\\wd\\Desktop\\log\\2345076_0424_5xx.log"); //executeAsD342("C:\\Users\\wd\\Desktop\\log\\b562_2412270_1xx.log"); //executeAsD342("C:\\Users\\wd\\Desktop\\log\\b562_2412270_2xx.log"); - /* executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_1.log"); - executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_2.log"); - executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_1xx.log"); + //execute("C:\\Users\\wd\\Desktop\\log\\2345076_0424_1.log"); + execute("C:\\Users\\wd\\Desktop\\log\\2345076_0424_2.log"); + /*executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_1xx.log"); executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_2xx.log"); executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_3xx.log"); executeAsD342("C:\\Users\\wd\\Desktop\\log\\2345076_0424_4xx.log"); @@ -120,7 +120,12 @@ public class BeidouDevice { cycleCount++; } - udpClient.sendData(ByteUtil.hexStringTobyte(arrs[2])); + if(arrs[2].startsWith("d3f2")){ + b562Count = b562Count; + } + else{ + udpClient.sendData(ByteUtil.hexStringTobyte(arrs[2])); + } b562Count++; lastTime = time.getTime(); Thread.sleep(100);