| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- # ============================================================
- # 龙亭新水岛 水厂配置文件
- # ============================================================
- # 使用方法: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
- # ----------------------------------------------------------
- # 项目模式调度(参观/检修/调试模式下自动暂停异响检测)
- # ----------------------------------------------------------
- project_mode:
- base_url: http://120.55.44.4:8900 # 平台 API 根地址
- poll_interval: 60 # 查询间隔(秒)
- request_timeout: 10 # 请求超时(秒)
- # ----------------------------------------------------------
- # 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://120.55.44.4:8900/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
- # ----------------------------------------------------------
- # 自动增量训练
- # ----------------------------------------------------------
- auto_training:
- enabled: True # 总开关(暂时关闭自动增训)
- data:
- keep_normal_days: 7 # 正常音频保留天数
- keep_anomaly_days: -1 # 异常音频保留天数(-1=永久)
- cleanup_time: "00:00" # 每日清理时间(0点)
- incremental:
- enabled: true
- schedule_time: "02:00" # 每日训练时间
- use_days_ago: 1 # 使用N天前的数据(1=昨天)
- sample_hours: 1 # 随机采样时长(小时),0=使用全部
- min_samples: 50 # 最少样本数,不足则跳过
- epochs: 30 # 训练轮数(配合早停,实际通常更少)
- learning_rate: 0.0001 # 学习率
- batch_size: 32 # 批大小(降低显存占用)
- early_stop_patience: 5 # 早停耐心值:连续N轮loss无改善则停止
- training_device: auto
- min_gpu_mem_mb: 512 # auto模式下GPU空闲显存低于此值(MB)时回退CPU
- model:
- backup_before_train: true # 训练前备份
- keep_backups: 7 # 保留备份数量
- auto_deploy: true # 自动部署新模型
- update_thresholds: true # 训练后更新阈值npy
- rollback_on_degradation: true # 训练后损失异常时自动回滚到备份
- rollback_factor: 2.0 # 新模型损失 > 旧阈值 * 此因子则判定为退化
- validation:
- enabled: true
- cold_start:
- enabled: true
- wait_hours: 2 # 等待收集数据时长
- min_samples: 100 # 最少样本数
|