1、完善kafka 接收消息进行sm4 解密

2、新增IP联动封禁相关的API接口,供探针模块进行调用。
This commit is contained in:
2026-05-06 17:30:21 +08:00
parent 206985a65e
commit 5e73c1c8f6
14 changed files with 197 additions and 111 deletions
@@ -33,11 +33,27 @@ public class ETLOrchestrator {
private NormalizeRuleHitTimeService normalizeRuleHitTimeService;
/**
* 定时任务 - 从每小时第1分钟开始,5分钟间隔执行
* 20260317:暂硬规则关联分析
* 20260317:暂硬规则关联分析,由可配置关联分析规则取代
* 泛化规则最新命中时间更新任务保留
*/
//@Scheduled(cron = "0 1/5 * * * ?")
@Scheduled(cron = "0 1/5 * * * ?")
public void scheduledETL() {
//暂停ETL数据降噪任务(关联分析)
//RunETL();
//泛化规则最新命中时间更新任务
try {
normalizeRuleHitTimeService.updateRuleHitTimeTask();
} catch (Exception e) {
log.error("泛化规则最新命中时间更新任务执行失败", e);
}
}
//ETL数据降噪任务处理
private void RunETL()
{
long startTime = System.currentTimeMillis();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime[] currentWindow=TimeWindowCalculator.getPrevious5MinuteWindow();
@@ -48,7 +64,7 @@ public class ETLOrchestrator {
try {
//retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcess24HoursGroupedData());
//retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcessQueryHoursGroupedData(strStartTime,strEndTime ));
retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcessQueryHoursAlarm(strStartTime,strEndTime ));
//retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcessQueryHoursAlarm(strStartTime,strEndTime ));
long endTime = System.currentTimeMillis();
long duration = (endTime - startTime) / 1000;
log.info("定时ETL任务执行完成,耗时: {} 秒", duration);
@@ -56,14 +72,6 @@ public class ETLOrchestrator {
} catch (Exception e) {
log.error("定时ETL任务执行失败", e);
}
//泛化规则最新命中时间更新任务
try {
normalizeRuleHitTimeService.updateRuleHitTimeTask();
} catch (Exception e) {
log.error("泛化规则最新命中时间更新任务执行失败", e);
}
}
/**
@@ -105,12 +113,12 @@ public class ETLOrchestrator {
* 每天凌晨3点清理2天前的数据
*/
@Scheduled(cron = "0 0 3 * * ?")
//@Scheduled(cron = "0 * * * * ?")
public void cleanupOldLogs() {
public void cleanupOldLogs() {
try {
LocalDateTime cutoffTime = LocalDateTime.now().minusDays(2);
//默认删除7天内接收日志记录
LocalDateTime cutoffTime = LocalDateTime.now().minusDays(7);
int deleted = deviceReceiveLogService.deleteOldLogs(cutoffTime);
log.info("定时清理任务完成,删除{}条2天前的日志", deleted);
log.info("定时清理任务完成,删除{}条7天前的日志", deleted);
} catch (Exception e) {
log.error("定时清理日志失败", e);
}
@@ -52,15 +52,7 @@ public class PartitionTableSchedule {
logger.info("测试任务: 分区表创建完成");
}
/**
* 每天检查一次分区表状态(可选)
*/
@Scheduled(cron = "0 0 2 * * ?")
public void checkPartitionTableStatus() {
logger.info("开始检查分区表状态...");
// 这里可以添加分区表状态检查逻辑
logger.info("分区表状态检查完成");
}
/**