rtsp_config_longting.yaml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # ============================================================
  2. # 龙亭新水岛 水厂配置文件
  3. # ============================================================
  4. # 使用方法:python tool/migrate_yaml_to_db.py --yaml 本文件路径 --force
  5. # 导入后可通过 API(:8080)在线修改,无需再编辑此文件
  6. # ============================================================
  7. # ----------------------------------------------------------
  8. # 水厂列表
  9. # ----------------------------------------------------------
  10. plants:
  11. - name: 龙亭新水岛 # 水厂名称
  12. enabled: true # 是否启用
  13. project_id: 1450 # 平台项目 ID
  14. # 流量 PLC 映射(泵名称 -> PLC 地址)
  15. flow_plc:
  16. 高压泵1流量: ns=3;s=1#RO_JSFLOW_O
  17. 高压泵2流量: ns=3;s=2#RO_JSFLOW_O
  18. # 泵状态 PLC 点位(val=1 运行, val=0 停机)
  19. pump_status_plc:
  20. 段间泵: # pump_name(与 rtsp_streams.pump_name 对应)
  21. - point: ns=6;s=P_1#RODJB_RFB
  22. name: 1#RO段间泵
  23. - point: ns=6;s=P_2#RODJB_RFB
  24. name: 2#RO段间泵
  25. 高压泵:
  26. - point: ns=6;s=P_1#ROGYB_RFB
  27. name: 1#RO高压泵
  28. - point: ns=6;s=P_2#ROGYB_RFB
  29. name: 2#RO高压泵
  30. # RTSP 拾音器流(每个流 = 一台拾音器)
  31. rtsp_streams:
  32. - name: 龙亭一层冲洗泵区域5 # 显示名称
  33. url: rtsp://rtsp:newwater123@192.168.70.11:31016/cam/realmonitor?channel=5&subtype=0
  34. channel: 5 # 通道号
  35. device_code: LT-5 # 设备编码(唯一,训练数据/模型目录名)
  36. pump_name: 段间泵 # 关联泵名称
  37. model_subdir: LT-5 # 模型目录(默认 = device_code)
  38. - name: 龙亭一层高压泵区域
  39. url: rtsp://rtsp:newwater123@192.168.70.11:31016/cam/realmonitor?channel=2&subtype=0
  40. channel: 2
  41. device_code: LT-2
  42. pump_name: 高压泵
  43. model_subdir: LT-2
  44. # ----------------------------------------------------------
  45. # 音频采集参数
  46. # ----------------------------------------------------------
  47. audio:
  48. sample_rate: 16000 # 采样率 Hz(必须与训练一致)
  49. file_duration: 60 # 每个音频文件时长(秒)
  50. segment_duration: 60 # FFmpeg 切片时长(秒)
  51. auto_cleanup:
  52. enabled: true
  53. delete_normal: true
  54. keep_recent_count: 100
  55. # ----------------------------------------------------------
  56. # 异常检测参数
  57. # ----------------------------------------------------------
  58. prediction:
  59. batch_size: 64 # 推理批大小
  60. check_interval: 1.0 # 检查新文件间隔(秒)
  61. default_threshold: 0.01 # 默认阈值(模型未加载时)
  62. voting: # 滑动窗口投票
  63. enabled: true
  64. window_size: 5 # 5 个周期约 5 分钟
  65. threshold: 3 # 5 次中 3 次异常才报
  66. frequency_history:
  67. enabled: true
  68. history_minutes: 10
  69. energy_detection: # 音频能量检测(无 PLC 时判断启停)
  70. enabled: true
  71. skip_when_stopped: true
  72. save_anomaly_audio:
  73. enabled: true
  74. save_dir: data/anomaly_detected
  75. cooldown_minutes: 15
  76. context_capture:
  77. enabled: true
  78. pre_minutes: 2
  79. post_minutes: 2
  80. # ----------------------------------------------------------
  81. # 推送通知
  82. # ----------------------------------------------------------
  83. push_notification:
  84. enabled: false # 总开关(false = 不推送任何消息)
  85. alert_enabled: false # false = 只推心跳不推告警
  86. push_base_urls:
  87. - label: "外网"
  88. url: "http://120.55.44.4:8900/api/v1/dumu/push-msg"
  89. - label: "内网"
  90. url: "http://192.168.60.8:8900/api/v1/dumu/push-msg"
  91. timeout: 30
  92. retry_count: 2
  93. cooldown_minutes: 15
  94. cooldown_same_type_hours: 24
  95. cooldown_diff_type_hours: 1
  96. alert_aggregate:
  97. enabled: true
  98. window_seconds: 300
  99. min_devices: 2
  100. # ----------------------------------------------------------
  101. # 项目模式调度(参观/检修/调试模式下自动暂停异响检测)
  102. # ----------------------------------------------------------
  103. project_mode:
  104. base_url: http://120.55.44.4:8900 # 平台 API 根地址
  105. poll_interval: 60 # 查询间隔(秒)
  106. request_timeout: 10 # 请求超时(秒)
  107. # ----------------------------------------------------------
  108. # SCADA/PLC 接口
  109. # ----------------------------------------------------------
  110. scada_api:
  111. enabled: true
  112. base_url: http://120.55.44.4:8900/api/v1/jinke-cloud/db/device/history-data
  113. realtime_url: http://120.55.44.4:8900/api/v1/jinke-cloud/device/current-data
  114. jwt_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6NywiVXNlcm5hbWUiOiJhZG1pbiIsIkRlcCI6IjEzNSIsImV4cCI6MTc3NjExOTExNCwiaXNzIjoiZ2luLWJsb2cifQ.0HTtzHZjyd2mHo8VCy8icYROxmntRMuQhyoZsAYRL_M
  115. timeout: 10
  116. # ----------------------------------------------------------
  117. # 人体检测抑制
  118. # ----------------------------------------------------------
  119. human_detection:
  120. enabled: false
  121. db_path: /data/human_detector/detection_status.db
  122. cooldown_minutes: 5
  123. # ----------------------------------------------------------
  124. # 自动增量训练
  125. # ----------------------------------------------------------
  126. auto_training:
  127. enabled: True # 总开关(暂时关闭自动增训)
  128. data:
  129. keep_normal_days: 7 # 正常音频保留天数
  130. keep_anomaly_days: -1 # 异常音频保留天数(-1=永久)
  131. cleanup_time: "00:00" # 每日清理时间(0点)
  132. incremental:
  133. enabled: true
  134. schedule_time: "02:00" # 每日训练时间
  135. use_days_ago: 1 # 使用N天前的数据(1=昨天)
  136. sample_hours: 1 # 随机采样时长(小时),0=使用全部
  137. min_samples: 50 # 最少样本数,不足则跳过
  138. epochs: 30 # 训练轮数(配合早停,实际通常更少)
  139. learning_rate: 0.0001 # 学习率
  140. batch_size: 32 # 批大小(降低显存占用)
  141. early_stop_patience: 5 # 早停耐心值:连续N轮loss无改善则停止
  142. training_device: auto
  143. min_gpu_mem_mb: 512 # auto模式下GPU空闲显存低于此值(MB)时回退CPU
  144. model:
  145. backup_before_train: true # 训练前备份
  146. keep_backups: 7 # 保留备份数量
  147. auto_deploy: true # 自动部署新模型
  148. update_thresholds: true # 训练后更新阈值npy
  149. rollback_on_degradation: true # 训练后损失异常时自动回滚到备份
  150. rollback_factor: 2.0 # 新模型损失 > 旧阈值 * 此因子则判定为退化
  151. validation:
  152. enabled: true
  153. cold_start:
  154. enabled: true
  155. wait_hours: 2 # 等待收集数据时长
  156. min_samples: 100 # 最少样本数