目录

卫星算法服务(新项目)

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

当前边界

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

当前规划主算法仍调用复用过来的旧规划核心;新项目负责新版接口适配、输入/输出隔离和规划结果投影。按 2026-07-14 最新边界,规划服务只选择调用方给出的候选窗口,不再调用星间路径规划接口,也不输出星链路由字段。算法9新方案将改为输出带完整路径的端到端可用数传窗口;设计细化完成前,算法9路由只保留位置并返回 HTTP 501。

安装依赖

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  /docs

规划:
POST /solutionManager/taskSolution/

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

拦截DJ:
POST /SatAlg/Basic/atmStrikeRoute/

端到端数传窗口:
POST /SatAlg/Basic/atmTaskRoute/

以上四个路径与 4.20260622算法接口集合.docx 一致,是提交上游联调时使用的正式URL。浏览器打开 http://127.0.0.1:8001/docs 可查看 6/7/8/9 的请求样例、响应包络和错误码。算法9自动计算星间连通性和路径,算法5窗口作为最后一跳。内部发现、版本化执行和执行产物查询路由不属于接口文档约定,已从 Swagger 页面隐藏。

本地测试

python -m unittest discover -s src\algorithm_service\tests -v
python -m compileall src\algorithm_service src\mission_planning

6/7/8/9 基线数据生成

python -m src.algorithm_service.baseline_data

默认输出到 generated_6789/,包含:

  • interface_06_planning_request.json
  • interface_07_effectiveness_topsis_request.json
  • interface_07_effectiveness_fuzzy_request.json
  • interface_08_intercept_request.json
  • interface_08_intercept_minimal_response.json
  • interface_09_task_route_to_ground_request.json
  • interface_09_task_route_to_satellite_request.json
  • interface_09_task_route_to_weapon_request.json
  • manifest.json

7 章按文档响应包络返回带分值指标树;8 章当前提供可运行的最小抛物线拦截实现。上述9章基线样例仅作为旧契约留档;当前可用接口采用新版端到端窗口结构,详见 docs/services/09_upstream_interface_spec.md,机器Schema为 json/upstream/downlink_window_input.schema.jsondownlink_window_output.schema.json

手动 smoke test:

Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/solutionManager/taskSolution/ `
  -ContentType "application/json" `
  -InFile .\examples\planning_case_1_smoke.json

算法9 smoke test:

Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/SatAlg/Basic/atmTaskRoute/ `
  -ContentType "application/json" `
  -InFile .\examples\downlink_window_request.json
Invoke-RestMethod `
  -Method Post `
  -Uri http://127.0.0.1:8001/SatAlg/Basic/atmAes/ `
  -ContentType "application/json" `
  -InFile .\examples\effectiveness_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__/,或重新从干净目录打包。

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

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