Skip to main content

SURGE — Scalable Universal Runtime for Group Execution

分布式动态任务执行系统 | MIT License


一句话

终端即插即用,任务动态拆解,全网资源共享,无人干预自主协同。


快速开始(仿真器,无需硬件)

git clone https://github.com/your-org/surge
cd surge

# 运行基础场景(5个终端入列、选举、任务分配、终端死亡重分配)
python sim/simulator.py --scenario basic --speed 10

# 计算卸荷场景(弱算力终端拆分大任务到多个计算节点)
python sim/simulator.py --scenario compute

# 监视器场景(带地面站的手动指挥)
python sim/simulator.py --scenario monitor

# 运行所有场景
python sim/simulator.py --scenario all

# 查看监视器界面
python sim/monitor_ui.py

核心特性

  • 零出厂预设:密钥首次上电时自生成,无任何预烧录秘密
  • 全参数可配置:所有权重、阈值、策略运行时可改,无需重编译
  • 随进随出:终端加入/退出不中断系统,任务自动重分配
  • 计算拆分:弱终端将大计算卸荷到多终端协同
  • 借调存储:中间结果可在其他终端暂存,满时自动迁移
  • 多通信介质:WiFi/蓝牙/LoRa/CAN/以太网自适应
  • 即下即用:固件 make flash 烧录后自动入网

架构

监视器(可选)  ──→  主机  ←──→  辅机  ←──→  从机1..N
                      │
            蓝牙/WiFi/LoRa/CAN/以太网
                      │
           ┌──────────┼──────────┐
       从机2        从机3      从机N

项目结构

surge/
├── docs/                     # 技术文档
│   └── 系统方案.md             # 完整技术方案
├── src/                      # 嵌入式C实现
│   ├── core/                 # 协议 + 信息池 + 配置
│   ├── security/             # 密钥自生成 + 加密
│   ├── interpreter/          # .mydrone 脚本解释器
│   ├── scheduler/            # 任务调度 + 计算拆分
│   ├── comms/                # 通信抽象层
│   └── terminal/             # 终端主运行时
├── sim/                      # Python仿真平台
│   ├── simulator.py          # 主仿真器
│   ├── virtual_terminal.py   # 虚拟终端
│   └── monitor_ui.py         # 监视器界面
├── scripts/                  # 工具
│   ├── config_gen.py         # 配置生成器
│   └── flash_tool.py         # 固件烧录工具
├── tests/                    # 单元测试
├── CMakeLists.txt
├── Makefile
└── README.md

使用

生成自定义配置

# 交互式
python scripts/config_gen.py --interactive

# 预设
python scripts/config_gen.py --preset drone --json my_config.json

# 参数覆盖
python scripts/config_gen.py --set join_policy 0 --set heartbeat_interval 500

烧录固件

# ESP32
python scripts/flash_tool.py --port COM3 --platform esp32 --firmware build/surge_esp32.bin

# 扫描并批量烧录
python scripts/flash_tool.py --platform esp32 --all

许可

MIT License — 自由使用、修改、分发。

贡献

欢迎提交 Issue 和 Pull Request。开发路线图见 docs/系统方案.md 第19章。

Release files for surge-system 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for surge-system 0.4.1
File Size Uploaded
surge_system-0.4.1.tar.gz 72.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for surge-system 0.4.1
File Interpreter ABI Platform
surge_system-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 147.7 kB

Release files / surge_system-0.4.1.tar.gz

Download URL surge_system-0.4.1.tar.gz
Size 72.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0d44a8e82c1e44ebe63e5c7c29a54f2ab06eb7c9d69cee48c74c5ab247631dc9
BLAKE2b-256 checksum
How to use checksums
f4d08a4c23642ec67ea1804066c07d1a28650c6dedf53f89de18f7c76cc388cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / surge_system-0.4.1-py3-none-any.whl

Download URL surge_system-0.4.1-py3-none-any.whl
Size 75.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7ff3fff1b5b1b0c9fdc1154d67b5fa9e1b7b6c8f728cf8026b786f162650876
BLAKE2b-256 checksum
How to use checksums
0f25bbe8d3cd448a29fdf3ef7e4540a9fcef37509f802dcf99427db1f4cfa0bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.2

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page