-
Notifications
You must be signed in to change notification settings - Fork 0
First Demo
EnerOS Bot edited this page Jul 5, 2026
·
1 revision
中文 | English
维护版本:v0.51.2 | 最后更新:2026-07-06
v0.50.0 引入的 enerosctl demo 一条命令启动电力 MVP 纵向闭环:IEEE-14 标准测试系统的 SCADA 测点流 → 时序存储 → 潮流周期求解 → 约束校验 → Agent 决策 → SafetyGateway 执行 → 审计回放 → HTTP API 全链路。启动约 1.13 秒。
完整说明见 README §快速演示。
cargo run --release --bin enerosctl -- demo
# 或自定义端口 + headless 模式
cargo run --release --bin enerosctl -- demo --port 8090 --headless预期启动日志:
[INFO] Loading IEEE-14 bus model...
[INFO] Starting IEC 104 mock server on port 18050...
[INFO] Starting time-series engine (SQLite)...
[INFO] SafetyGateway initialized (lockfree mode)
[INFO] Agent decision bridge ready (DispatchAgent)
[INFO] HTTP API listening on 0.0.0.0:8080
[INFO] Demo loop started. Press Ctrl-C to exit.
curl http://127.0.0.1:8080/health
# 预期:OK (200)curl http://127.0.0.1:8080/api/v1/demo/state预期返回(数值随运行时长增长):
{
"bus_count": 14,
"branch_count": 20,
"decision_count": 42,
"audit_count": 38,
"timeseries_points": 1260,
"uptime_secs": 63
}curl http://127.0.0.1:8080/api/v1/demo/decisions返回 Agent 控制建议 + 命令派发结果(DispatchAgent 经济调度决策)。
curl http://127.0.0.1:8080/api/v1/demo/audit返回审计条目,含 3 种 v0.50.0 新增变体:
-
ConstraintViolation— 约束违规 -
CommandRejected— SafetyGateway 拒绝 -
WcetViolation— WCET 预算超限
curl http://127.0.0.1:8080/api/v1/demo/replay/<decision_id>按 decision_id 查询决策详情 + 时间窗内审计。
Ctrl-C
预期:守护线程优雅退出,SQLite 落盘完成。
v0.50.0 同时交付 5 个故障注入端到端测试(端口 18070-18074),83.77s 全部通过:
# 运行全部 v0.50.0 e2e 测试
cargo test --test e2e_tests -- --test-threads=1 mvp_fault
cargo test --test e2e_tests -- --test-threads=1 test_e2e_v0500_mvp_loop| 限制 | 说明 | 清偿版本 |
|---|---|---|
| IEC 104 mock server 非 production-grade | 仅 STARTDT_ACT/TESTFR_ACT 握手 + M_ME_NC_1 测点推送 | v0.52.0+ |
GridSimulator::step(1.0) 替代 PowerFlowSolver::solve
|
暂态积分仍是稳态桩 | v0.52.0+ |
InMemoryAuditSink 不维护 HMAC 链 |
已由 v0.51.0 RepositoryAuditSink 清偿 |
✅ v0.51.0 |
dispatch_result_to_command 是占位函数 |
TODO | v0.52.0+ |
详见 CHANGELOG §"已知限制(v0.50.0)"。
- 了解 SafetyGateway 如何拒绝违规命令 → Safety Gateway
- Agent 如何生成控制建议 → Agent Runtime
- 完整 README 演示文档 → README §快速演示
EnerOS Wiki | v0.51.2