66c8039889
fix(config-sync): 修复全量同步时空配置不清理旧数据的bug
...
问题描述:
- 当sync_mode=full且incoming_ids为空时,条件判断失败
- 导致旧的孤儿ROI配置残留在本地数据库
- 后续配置更新时尝试启动孤儿ROI对应的摄像头,产生警告
根本原因:
- line 889: if self._db_manager and incoming_ids:
- 当incoming_ids为空列表时,条件判断为False
- 跳过了清理旧配置的逻辑
修复方案:
- 移除incoming_ids的条件判断
- 全量同步时始终执行清理逻辑
- incoming_ids为空时,清除所有旧配置(符合全量同步语义)
- incoming_ids不为空时,清除不在列表中的旧配置
附加工具:
- cleanup_orphan_rois.py: 清理当前残留的孤儿ROI记录
影响:
- 修复配置同步逻辑bug
- 避免孤儿ROI警告
- 提高配置同步的可靠性
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-14 11:25:42 +08:00
181623428a
feat(aiot): 告警冷却时间调整 + 截图本地保留 + 中文路径修复
...
- 离岗检测冷却时间: 300s → 600s(10分钟)
- 入侵检测冷却时间: 120s → 300s(5分钟)
- 入侵告警级别改为高(alarm_level=3)
- COS 不可用时保留本地截图文件,不再上报后删除
- 修复 cv2.imwrite 中文路径失败,改用 imencode + write_bytes
- 配置订阅在 LOCAL 模式下跳过 Redis 连接
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-11 09:57:02 +08:00
0191e498f1
feat: 告警HTTP上报 + 日志精简 + 边缘节点统一为edge
...
- 新增 alarm_upload_worker.py 异步告警上报(COS+HTTP)
- result_reporter 重构为Redis队列模式
- config_sync 适配WVP直推的聚合配置格式
- settings 默认 EDGE_DEVICE_ID 改为 edge
- 日志设置非告警模块为WARNING级别减少噪音
- main.py 集成新的告警上报流程
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-10 15:21:45 +08:00
20ba192e7f
feat: 启动时自动从Redis同步配置到SQLite
...
- 在start_config_subscription()中增加启动时全量同步
- 解决边缘服务重启后丢失配置的问题
- 如Redis不可用则使用本地SQLite已有配置
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-05 16:56:48 +08:00
1529322ca9
feat: 收到config_update时同步Redis配置到SQLite
...
主推理管线从SQLite读取摄像头/ROI/绑定配置,而云端pushConfig
只写入Redis。新增_sync_redis_to_sqlite方法,在收到config_update
通知后将Redis中的camera/roi/bind keys同步写入SQLite,
并清除全部内存缓存确保下次读取获得最新数据。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-05 09:58:04 +08:00
bef62e430c
fix: 修复get_bindings_from_redis空roi_id过滤bug
...
当roi_id为空字符串时(reload_all_algorithms调用),原逻辑
data.get('roi_id') == "" 匹配不到任何bind,导致全量重载
始终返回0个算法。改为 not roi_id or 匹配,空值时返回全部。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-05 09:57:20 +08:00
fa0304aa47
feat: 重构数据库schema分离空间与业务配置 - 新增algorithm_registry和roi_algo_bind表 - roi_configs简化为纯空间配置 - 新增AlgorithmInfo/ROIAlgoBind数据模型
2026-02-03 14:26:52 +08:00
101b26fc95
feat: 实现配置热更新机制
...
数据库扩展:
- roi_configs 新增算法参数字段(working_hours, confirm_on_duty_sec等)
- 新增 config_update_log 表记录配置变更日志
Redis缓存:
- ROI/摄像头配置缓存到 Redis(TTL 1小时)
- sync_all_to_redis() 批量同步配置
- notify_config_change() 发布配置变更通知
热更新:
- AlgorithmManager 订阅 Redis config_update 频道
- load_from_redis() 从 Redis 加载算法参数
- reload_algorithm() 热更新单个算法
- reload_all_algorithms() 重新加载所有算法
配置模型:
- ROIInfo 添加算法参数字段
2026-01-30 13:51:58 +08:00
2c0fe7f3c5
fix: 适配 SQLite API 替换 MySQL
...
- config_sync.py:
- 修复导入: get_sqlite_manager 替代 get_database_manager
- 修复方法: get_all_camera_configs 替代 get_camera_info
- 修复方法: get_rois_by_camera 替代 get_roi_configs
- 修复方法: get_camera_config 替代 get_camera_info
- 修复方法: get_roi_config 替代 get_roi_configs
- result_reporter.py:
- 更新注释: 移除 MySQL 相关描述
2026-01-30 11:46:15 +08:00
b0ddb6ee1a
feat(project): move edge_inference_service contents to root and update paths
...
- Moved all project files and directories (config, core, models, etc.) from
edge_inference_service/ to the repository root ai_edge/
- Updated model path in config/settings.py to reflect new structure
- Revised usage paths in __init__.py documentation
2026-01-29 18:43:19 +08:00