feat: add dynamic config reload, unique device identity (UUID), and MQTT support

- New StreamManager for dynamic RTSP/FLV stream lifecycle
- Dynamic worker scaling for inference
- Device UUID generation and persistence
- Telegraf config and NPU monitoring scripts
- .gitignore for build artifacts
This commit is contained in:
2026-05-08 16:26:10 +08:00
parent 2e7245d62e
commit 6e88d2392f
12 changed files with 433 additions and 70 deletions

View File

@@ -1,13 +1,21 @@
edge_id: edge-demo-001
cloud_url: http://101.36.73.102:8004
mqtt_broker: "tcp://101.36.73.102:1883"
mqtt_user: ""
mqtt_pass: ""
edge_token: ""
# RTSP 流地址(留空使用演示模式)
# 视频流配置
rtsp_urls: []
# 推理配置
infer_socket: /tmp/edge-infer.sock
infer_fps: 5
infer_workers: 3
conf_threshold: 0.5
dedup_window_sec: 30
version: 1.0.0
# OTA 配置 (可选: Hawkbit URL 或 Nginx URL)
ota_url: http://101.36.73.102:8087
version: 1.0.0

32
config/telegraf.conf Normal file
View File

@@ -0,0 +1,32 @@
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
flush_interval = "10s"
hostname = "edge-001" # 启动时替换为实际 edge_id
# 输出到云端 InfluxDB
[[outputs.influxdb_v2]]
urls = ["http://101.36.73.102:18086"]
token = "my-super-secret-token" # 替换为实际 token
organization = "tianyan"
bucket = "edge_metrics"
# 基础硬件监控
[[inputs.cpu]]
percpu = false
totalcpu = true
[[inputs.mem]]
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
[[inputs.net]]
# NPU 自定义监控
[[inputs.exec]]
commands = ["/opt/tianyan-edge/scripts/npu_info.sh"]
timeout = "5s"
data_format = "influx"