# ============================================================ # 龙亭新水岛 水厂配置文件 # ============================================================ # 使用方法:python tool/migrate_yaml_to_db.py --yaml 本文件路径 --force # 导入后可通过 API(:8080)在线修改,无需再编辑此文件 # ============================================================ # ---------------------------------------------------------- # 水厂列表 # ---------------------------------------------------------- plants: - name: 龙亭新水岛 # 水厂名称 enabled: true # 是否启用 project_id: 1450 # 平台项目 ID # 流量 PLC 映射(泵名称 -> PLC 地址) flow_plc: 高压泵1流量: ns=3;s=1#RO_JSFLOW_O 高压泵2流量: ns=3;s=2#RO_JSFLOW_O # 泵状态 PLC 点位(val=1 运行, val=0 停机) pump_status_plc: 段间泵: # pump_name(与 rtsp_streams.pump_name 对应) - point: ns=6;s=P_1#RODJB_RFB name: 1#RO段间泵 - point: ns=6;s=P_2#RODJB_RFB name: 2#RO段间泵 高压泵: - point: ns=6;s=P_1#ROGYB_RFB name: 1#RO高压泵 - point: ns=6;s=P_2#ROGYB_RFB name: 2#RO高压泵 # RTSP 拾音器流(每个流 = 一台拾音器) rtsp_streams: - name: 龙亭一层冲洗泵区域5 # 显示名称 url: rtsp://rtsp:newwater123@192.168.70.11:31016/cam/realmonitor?channel=5&subtype=0 channel: 5 # 通道号 device_code: LT-5 # 设备编码(唯一,训练数据/模型目录名) pump_name: 段间泵 # 关联泵名称 model_subdir: LT-5 # 模型目录(默认 = device_code) - name: 龙亭一层高压泵区域 url: rtsp://rtsp:newwater123@192.168.70.11:31016/cam/realmonitor?channel=2&subtype=0 channel: 2 device_code: LT-2 pump_name: 高压泵 model_subdir: LT-2 # ---------------------------------------------------------- # 音频采集参数 # ---------------------------------------------------------- audio: sample_rate: 16000 # 采样率 Hz(必须与训练一致) file_duration: 60 # 每个音频文件时长(秒) segment_duration: 60 # FFmpeg 切片时长(秒) auto_cleanup: enabled: true delete_normal: true keep_recent_count: 100 # ---------------------------------------------------------- # 异常检测参数 # ---------------------------------------------------------- prediction: batch_size: 64 # 推理批大小 check_interval: 1.0 # 检查新文件间隔(秒) default_threshold: 0.01 # 默认阈值(模型未加载时) voting: # 滑动窗口投票 enabled: true window_size: 5 # 5 个周期约 5 分钟 threshold: 3 # 5 次中 3 次异常才报 frequency_history: enabled: true history_minutes: 10 energy_detection: # 音频能量检测(无 PLC 时判断启停) enabled: true skip_when_stopped: true save_anomaly_audio: enabled: true save_dir: data/anomaly_detected cooldown_minutes: 15 context_capture: enabled: true pre_minutes: 2 post_minutes: 2 # ---------------------------------------------------------- # 推送通知 # ---------------------------------------------------------- push_notification: enabled: false # 总开关(false = 不推送任何消息) alert_enabled: false # false = 只推心跳不推告警 push_base_urls: - label: "外网" url: "http://120.55.44.4:8900/api/v1/dumu/push-msg" - label: "内网" url: "http://192.168.60.8:8900/api/v1/dumu/push-msg" timeout: 30 retry_count: 2 cooldown_minutes: 15 cooldown_same_type_hours: 24 cooldown_diff_type_hours: 1 alert_aggregate: enabled: true window_seconds: 300 min_devices: 2 # ---------------------------------------------------------- # SCADA/PLC 接口 # ---------------------------------------------------------- scada_api: enabled: true base_url: http://120.55.44.4:8900/api/v1/jinke-cloud/db/device/history-data realtime_url: http://47.96.12.136:8788/api/v1/jinke-cloud/device/current-data jwt_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6NywiVXNlcm5hbWUiOiJhZG1pbiIsIkRlcCI6IjEzNSIsImV4cCI6MTc3NjExOTExNCwiaXNzIjoiZ2luLWJsb2cifQ.0HTtzHZjyd2mHo8VCy8icYROxmntRMuQhyoZsAYRL_M timeout: 10 # ---------------------------------------------------------- # 人体检测抑制 # ---------------------------------------------------------- human_detection: enabled: false db_path: /data/human_detector/detection_status.db cooldown_minutes: 5