Commit Graph

8 Commits

Author SHA1 Message Date
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