目录

卫星算法服务(新项目)

这是从原仓库中拆出的新算法接口项目。它和旧规划项目分开运行,但复用了旧规划核心代码 src/mission_planning

当前边界

  • 新项目服务入口:sat_alg_api_server.py
  • 新接口框架:src/algorithm_service
  • 复用旧规划核心:src/mission_planning
  • 复用公共优化框架:src/opt_framework
  • 接口 schema:json/upstream
  • 旧项目的 api_server.py 没有放入本项目,避免两个项目入口混在一起。

当前规划主算法仍调用复用过来的旧规划核心;新项目负责新版接口适配、输入/输出隔离、按 20260622 文档输出投影。星间路径规划接口已可调用,但目前是结构化 stub,不是真正的多跳优化算法。

安装依赖

cd C:\work\zhongnandaxue\yuxing\code\satellite_algorithm_service
python -m pip install -r requirements.txt

启动服务

cd C:\work\zhongnandaxue\yuxing\code\satellite_algorithm_service
python -m uvicorn sat_alg_api_server:app --host 0.0.0.0 --port 8001

接口

GET  /health
GET  /api/v2/algorithms

规划:
POST /api/v2/planning/planning.multi_sat_greedy/solve

效能评估:
POST /SatAlg/Basic/atmAes/

星间路径规划:
POST /SatAlg/Basic/atmTaskRoute/
POST /api/v2/link-planning/link.multi_hop/solve

本地测试

python -m unittest src.algorithm_service.tests.test_framework src.algorithm_service.tests.test_adapters src.algorithm_service.tests.test_evaluation src.algorithm_service.tests.test_upstream_schemas
python -m compileall src\algorithm_service src\mission_planning

手动 smoke test:

Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/api/v2/planning/planning.multi_sat_greedy/solve `
  -ContentType "application/json" `
  -InFile .\examples\planning_case_1_smoke.json
Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/SatAlg/Basic/atmAes/ `
  -ContentType "application/json" `
  -InFile .\examples\effectiveness_request.json
Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/SatAlg/Basic/atmTaskRoute/ `
  -ContentType "application/json" `
  -InFile .\examples\task_route_request.json

输出隔离

规划接口每次执行会在 results/algorithm_service/executions/{execution-id}/ 下保存:

legacy_input.json      # 旧规划核心实际收到的输入
legacy_output.json     # 旧规划核心原始输出
upstream_input.json    # 新接口原始输入
upstream_output.json   # 新接口按 20260622 文档投影后的输出
extensions.json        # 旧规划核心不能消费的新接口扩展字段

打包

在本项目目录的上一级执行:

cd C:\work\zhongnandaxue\yuxing\code
Compress-Archive -Path .\satellite_algorithm_service\* -DestinationPath ..\satellite_algorithm_service_20260625.zip -Force

打包前建议先删除 results/__pycache__/,或重新从干净目录打包。

关于
361.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号