modify: 更新目录结构

This commit is contained in:
2026-08-03 16:56:10 +08:00
parent 17a94cfc37
commit 92e367d24f
5 changed files with 80 additions and 58 deletions
+17 -6
View File
@@ -1,3 +1,11 @@
# ====== 插件注册信息(控制加载方式) ======
[workers]
type = "aibox_sophon_adapter"
module = "plugins.aibox_sophon_adapter"
factory = "create_workers"
cleanup = "cleanup"
count = 1
[worker] [worker]
name = "aibox_sophon_adapter" name = "aibox_sophon_adapter"
version = "0.1.0" version = "0.1.0"
@@ -9,18 +17,21 @@ defaults = { method = "GET", timeout = 30, auth_required = false, cacheable = fa
router_prefix = "/aibox_sophon_adapter" router_prefix = "/aibox_sophon_adapter"
tags = ["aibox_sophon_adapter", "sophon", "adapter"] tags = ["aibox_sophon_adapter", "sophon", "adapter"]
# 心跳超时配置(秒),超过此时间未收到心跳视为离线 # ====== Worker 运行时配置(由 lifespan_setup 传递给 create_workers) ======
[worker.heartbeat] [workers.config]
data_dir = "./data"
mediamtx_addr = "rtsp://127.0.0.1:8554" # MediaMTX 地址
link_path = "/data/bm-app" # 软链接路径
[workers.config.heartbeat]
interval = 5 # 设备上报间隔(秒) interval = 5 # 设备上报间隔(秒)
timeout = 15 # 超时阈值(秒),超过此时间未收到心跳视为离线 timeout = 15 # 超时阈值(秒),超过此时间未收到心跳视为离线
check_interval = 10 # 服务端检查离线设备的间隔(秒) check_interval = 10 # 服务端检查离线设备的间隔(秒)
# 外部 MQTT 转发配置 — 将心跳数据转发到指定的外部 MQTT Broker [workers.config.mqtt_forward]
[worker.mqtt_forward]
enabled = true enabled = true
uri = "mqtt://admin:Mixc%402021@dg.datagoo.cn:48081" # %40 是 @ 的 URL 编码 uri = "mqtt://admin:Mixc%402021@dg.datagoo.cn:48081" # %40 是 @ 的 URL 编码
topic = "/board_ping" # 转发目标主题 topic = "/board_ping" # 转发目标主题
# 告警记录保留策略 — 超过 max_records 条时自动清理最早的记录(含关联视频文件) [workers.config.alarm_retention]
[worker.alarm_retention]
max_records = 100 # 最多保留的告警记录数,设为 0 表示不限制 max_records = 100 # 最多保留的告警记录数,设为 0 表示不限制
+12 -1
View File
@@ -1,3 +1,11 @@
# ====== 插件注册信息(控制加载方式) ======
[workers]
type = "auth"
module = "plugins.auth"
factory = "create_workers"
cleanup = "cleanup"
count = 3
[worker] [worker]
name = "auth" name = "auth"
version = "0.1.0" version = "0.1.0"
@@ -7,4 +15,7 @@ defaults = { method = "GET", ttl = 30, timeout = 2.0, auth_required = true, cach
[worker.registration] [worker.registration]
router_prefix = "/auth" router_prefix = "/auth"
tags = ["auth"] tags = ["auth"]
# ====== Worker 运行时配置(由 lifespan_setup 传递给 create_workers) ======
[workers.config]
+13 -50
View File
@@ -1,50 +1,13 @@
[[workers]] # 插件注册配置文件(旧版兼容)
type = "example" #
module = "plugins.example" # 新架构:框架自动扫描 config/workers/*/config.toml,
factory = "create_workers" # 从各插件的 [workers] 节读取注册信息。
cleanup = "cleanup" # 此文件仅作为旧版兼容保留,可留空或删除。
count = 3 #
# 若需在此文件中显式声明插件(兼容旧行为),格式如下:
[workers.config] # [[workers]]
type = "example" # type = "example"
data_dir = "./data" # module = "plugins.example"
# factory = "create_workers"
[[workers]] # cleanup = "cleanup"
type = "doubao" # count = 3
module = "plugins.doubao"
factory = "create_workers"
cleanup = "cleanup"
count = 3
[workers.config]
type = "doubao"
# is_aicc = true # 是否启用 AICC 安全通信模式(端云互信)
api_key = "ark-b149df84-a057-4ca0-b1a0-82a22c4e3c70-33cde"
base_url = "https://ark.cn-beijing.volces.com/api/v3"
model = "doubao-seed-evolving"
# AICC 模式下 base_url 使用 APIGateway 地址,如:
# api_key = "db04d42e-71e3-4119-abee-12ecc7ef5c34"
# base_url = "https://sd77a0f4ummt3i4vnems0.apigateway-cn-beijing.volceapi.com/api/v3"
# model = "ep-20260721154333-fre3bey"
[[workers]]
type = "auth"
module = "plugins.auth"
factory = "create_workers"
cleanup = "cleanup"
count = 3
[workers.config]
type = "auth"
[[workers]]
type = "aibox_sophon_adapter"
module = "plugins.aibox_sophon_adapter"
factory = "create_workers"
cleanup = "cleanup"
count = 1
[workers.config]
type = "aibox_sophon_adapter"
data_dir = "./data"
+26 -1
View File
@@ -1,3 +1,11 @@
# ====== 插件注册信息(控制加载方式) ======
[workers]
type = "doubao"
module = "plugins.doubao"
factory = "create_workers"
cleanup = "cleanup"
count = 3
[worker] [worker]
name = "doubao" name = "doubao"
version = "0.1.0" version = "0.1.0"
@@ -10,4 +18,21 @@ router_prefix = "/doubao"
tags = ["vision", "ai"] tags = ["vision", "ai"]
# is_aicc = true 时启用 AICC 安全通信(端云互信),使用 AsyncOpenAI + AsyncSecureHttpClient # is_aicc = true 时启用 AICC 安全通信(端云互信),使用 AsyncOpenAI + AsyncSecureHttpClient
# is_aicc = false 时使用标准 Ark SDK(AsyncArk),默认 false # is_aicc = false 时使用标准 Ark SDK(AsyncArk),默认 false
# ====== Worker 运行时配置(由 lifespan_setup 传递给 create_workers) ======
[workers.config]
api_key = "ark-b149df84-a057-4ca0-b1a0-82a22c4e3c70-33cde"
base_url = "https://ark.cn-beijing.volces.com/api/v3"
model = "doubao-seed-evolving"
# AICC 模式专用配置(按需启用):
# is_aicc = true
# api_key = "db04d42e-71e3-4119-abee-12ecc7ef5c34"
# base_url = "https://sd77a0f4ummt3i4vnems0.apigateway-cn-beijing.volceapi.com/api/v3"
# model = "ep-20260721154333-fre3bey"
# ra_url = "" # 远程证明地址(独立于 base_url 时配置)
# ra_service_name = "AICC.ConfidentialInference"
# ra_policy_id = "router_policy"
# ak = "" # 火山引擎 AK(TOP 网关鉴权模式)
# sk = "" # 火山引擎 SK(TOP 网关鉴权模式)
+12
View File
@@ -1,3 +1,11 @@
# ====== 插件注册信息(控制加载方式) ======
[workers]
type = "example"
module = "plugins.example"
factory = "create_workers"
cleanup = "cleanup"
count = 3
[worker] [worker]
name = "example" name = "example"
version = "0.1.0" version = "0.1.0"
@@ -8,3 +16,7 @@ defaults = { method = "GET", ttl = 30, timeout = 2.0, auth_required = true, cach
[worker.registration] [worker.registration]
router_prefix = "/calc" router_prefix = "/calc"
tags = ["example"] tags = ["example"]
# ====== Worker 运行时配置(由 lifespan_setup 传递给 create_workers) ======
[workers.config]
data_dir = "./data"