Commit 1cc3abec authored by 周昊's avatar 周昊

1、修改时间戳 毫秒级到秒级 计算逻辑错误

parent f0e5bef6
...@@ -56,7 +56,7 @@ public class AlarmSecondFilterFunction implements AlgorithmBaseFilterFunction { ...@@ -56,7 +56,7 @@ public class AlarmSecondFilterFunction implements AlgorithmBaseFilterFunction {
} }
//判断是否超过报警间隔 //判断是否超过报警间隔
if (alarmTimeStamp + alarmSecond * 1000 <= algorithmPushDto.getTimeStamp()) { if (alarmTimeStamp + alarmSecond <= algorithmPushDto.getTimeStamp()) {
cache.put(algorithmType, algorithmPushDto.getTimeStamp()); cache.put(algorithmType, algorithmPushDto.getTimeStamp());
return true; return true;
} }
......
...@@ -69,8 +69,8 @@ public class FrameFilterFunction implements AlgorithmBaseFilterFunction { ...@@ -69,8 +69,8 @@ public class FrameFilterFunction implements AlgorithmBaseFilterFunction {
//获取对应帧数匹配规则 //获取对应帧数匹配规则
//3.判断是否符合对应帧数限制 //3.判断是否符合对应帧数限制
//如果为连续 redis计数器加一 不连续制空 //如果为连续 redis计数器加一 不连续制空
if (frameNumberDto.getTimeStamp() + 1000 / frameSecond >= algorithmPushDto.getTimeStamp()) { if (frameNumberDto.getTimeStamp() * 1000 + 1000 / frameSecond >= algorithmPushDto.getTimeStamp() * 1000) {
frameNumberDto.setTimeStamp(algorithmPushDto.getTimeStamp()); frameNumberDto.setTimeStamp(algorithmPushDto.getTimeStamp()* 1000);
frameNumberDto.setFrameNumber(frameNumberDto.getFrameNumber() + 1); frameNumberDto.setFrameNumber(frameNumberDto.getFrameNumber() + 1);
cache.put(algorithmType, frameNumberDto); cache.put(algorithmType, frameNumberDto);
...@@ -79,7 +79,7 @@ public class FrameFilterFunction implements AlgorithmBaseFilterFunction { ...@@ -79,7 +79,7 @@ public class FrameFilterFunction implements AlgorithmBaseFilterFunction {
return false; return false;
} }
} else { } else {
frameNumberDto.setTimeStamp(algorithmPushDto.getTimeStamp()); frameNumberDto.setTimeStamp(algorithmPushDto.getTimeStamp() *1000);
frameNumberDto.setFrameNumber(0); frameNumberDto.setFrameNumber(0);
cache.put(algorithmType, frameNumberDto); cache.put(algorithmType, frameNumberDto);
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment