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.0

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.0
File Size Uploaded
surge_system-0.4.0.tar.gz 85.8 kB Details

Built distribution (wheel)

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

Total release size: 178.6 kB

Release files / surge_system-0.4.0.tar.gz

Download URL surge_system-0.4.0.tar.gz
Size 85.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a26c2c1f980ceb059446591e603a99694fdb8d26e3fd78624b7f7316e3a8eae5
BLAKE2b-256 checksum
How to use checksums
d2066519a0b0d12a6e8af6897b84081ec0da7edfe44eb4e0139927411a340ac8
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.0-py3-none-any.whl

Download URL surge_system-0.4.0-py3-none-any.whl
Size 92.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c111a4f2943bc54d8f08a34d0ca252eac37a93e97ced4c7ead438859e04c21f0
BLAKE2b-256 checksum
How to use checksums
bf4c165cb9aa5ce5afe0711719b19990c4965a9e6af21b60bbb2ce13d07cff59
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

0.4.1

2 release files

This release

0.4.0 This release

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