feat: 新增设备 API 拉取采集及配套处理能力

- 接入 NDRServer 告警和流量日志,支持凭据与任务管理
- 支持分页拉取、窗口拆分、调度优先级及 WAL 持久化后推进断点
- 增加迟到告警规则重放,优化多条泛化规则选择和事件时间处理
- 补充回归测试、数据库升级脚本及部署文档
This commit is contained in:
王绍宏
2026-09-06 16:46:21 +08:00
parent b61ec2e37c
commit 00c0a1fb7f
141 changed files with 11318 additions and 467 deletions
@@ -108,9 +108,22 @@ public class kafkaProducer {
String receiveTime,
String eventId,
Long pointTimeNs) {
return messagePush(deviceDevice, syslog, receiveTime, receiveTime, eventId, pointTimeNs);
}
/**
* 显式区分接收时间和事件时间。TCP/UDP 调用旧签名时两者相同,
* 后续 API 拉取可以在不改 Kafka 头结构的前提下传入设备事件时间。
*/
public CompletableFuture<DeliveryResult> messagePush(DeviceDevice deviceDevice,
String syslog,
String receiveTime,
String eventTime,
String eventId,
Long pointTimeNs) {
// [流程节点3.1] event_id 在接入边界生成并写入加密载荷,Retry/Replay 不再重新生成。
String fullMessage = DeviceInfoUtil.getFullLogString(
deviceDevice, syslog, receiveTime, eventId, pointTimeNs, appProperties);
deviceDevice, syslog, receiveTime, eventTime, eventId, pointTimeNs, appProperties);
// [流程节点3.2] Kafka 中保存携带 event_id 的完整密文,原始正文不写普通应用日志。
String encrypted = Sm4Util.encryptCbc(fullMessage, appProperties.getSm4Key());
ProducerRecord<String, String> record = buildRecord(deviceDevice.getId(), eventId, encrypted);