mcp_test_report.md 14 KB

通风模型算法 MCP 接口测试报告

测试时间: 2026-08-04 09:56:56
MCP 服务地址: http://39.97.59.228:8071/mcp
测试模型 ID: 2012326636757958658
传输协议: streamable-http | 客户端库: fastmcp

📊 测试汇总

传输层结果

指标 数值
接口总数 15
✅ 传输层通过 15
❌ 传输层失败 0
传输层通过率 100.0%
总耗时 378669 ms
平均响应 25245 ms

业务层结果

指标 数值
✅ 业务正常 11
⏱️ 服务端超时 (408) 2
🔴 服务端错误 (500) 1
🔴 服务不可用 (503) 1
❌ 客户端校验失败 0
综合可用率 73.3%

分类统计

分类 总数 传输通过 业务正常 平均耗时
故障诊断 5 5 4 37060 ms
避灾路线 2 2 1 69164 ms
关键阻力 5 5 5 1378 ms
压能/解算 3 3 1 16049 ms

📋 详细测试结果

✅ TC-01: 模型网络连通检查 (check_model_connect_status)

  • 分类: 故障诊断 | 业务状态: 正常
  • 耗时: 1148.5 ms | 结果大小: 23.3 KB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(19924)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"data\":{\"0\":[\"4\",\"6\",\"8\",\"10\",\"12\",\"14\",\"16\",\"18\",\"22\",\"28\",\"30\",\"32\",\"37\",\"41\",\"43\",\"49\",\"51\",\"52\",\"54\",\"56\",\"58\",\"59\",\"61\",\"62\",\"64\",\"66\",\"68\",\"69\",\"71\",\"73\",\"77\",\"78\",\"80\",\"82\",\"84\",\"88\",\"89\",\"90\",\"92\",\"95\",\"97\",\"98\",\"100\",\"102\",\"104\",\"105\",\"107\",\"108\",\"110\",\"113\",\"116\",\"117\",\"121\",\"122\",\"124\",\"126\",\"127\",\"1 ```

✅ TC-02: 模型循环风路检查 (check_model_one_dir_cycle)

  • 分类: 故障诊断 | 业务状态: 正常
  • 耗时: 850.65 ms | 结果大小: 152 B
  • 数据结构: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":0,\"cnt\":0,\"strRemark\":\"模型中没有单向回路\"}"}, "timestamp": 1785808101540} ```

✅ TC-03: 模型单向节点检查 (check_model_one_dir_node)

  • 分类: 故障诊断 | 业务状态: 正常
  • 耗时: 760.43 ms | 结果大小: 165 B
  • 数据结构: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":1,\"cnt\":0,\"ids\":[],\"strRemark\":\"网络中不含有单风向节点\"}"}, "timestamp": 1785808102295} ```

⏱️ TC-04: 模型角联结构诊断(计算重,耗时较长) (check_model_diagonal_structure)

  • 分类: 故障诊断 | 业务状态: 服务端超时 (408)
  • 耗时: 180176.28 ms | 结果大小: 48 B
  • 数据结构: {success: bool, error: str, code: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": false, "error": "请求超时", "code": 408} ```

✅ TC-05: 模型故障诊断(聚合,不含角联) (get_model_fault_diagnosis)

  • 分类: 故障诊断 | 业务状态: 正常
  • 耗时: 2366.39 ms | 结果大小: 23.7 KB
  • 数据结构: {success: bool, code: int, modelID: int, result: {connect_status: {success: bool, message: str, code: int, result: {result: str(19924)}, timestamp: int}, one_dir_cycle: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}, one_dir_node: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}}}
  • 调用参数: model_id=2012326636757958658, include_diagonal=False
📄 数据预览 ```json {"success": true, "code": 200, "modelID": 2012326636757958658, "result": {"connect_status": {"success": true, "message": "", "code": 200, "result": {"result": "{\"data\":{\"0\":[\"51\",\"52\",\"54\",\"56\",\"58\",\"59\",\"61\",\"62\",\"64\",\"66\",\"68\",\"69\",\"71\",\"73\",\"77\",\"78\",\"80\",\"82\",\"84\",\"88\",\"89\",\"90\",\"92\",\"95\",\"97\",\"98\",\"100\",\"102\",\"104\",\"105\",\"107\",\"108\",\"110\",\"113\",\"116\",\"117\",\"121\",\"122\",\"124\",\"126\",\"127\",\"129\",\"131\",\"13 ```

✅ TC-06: 避灾路线模拟 (get_escape_path)

  • 分类: 避灾路线 | 业务状态: 正常
  • 耗时: 18138.89 ms | 结果大小: 204.3 KB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(187009)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658, fire_tun_id=4, person_tun_id=6
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":1,\"nTunCount\":1796,\"fCostTime\":192861.796875,\"data\":{\"tuns\":[{\"4\":{\"nextId\":[\"6\",\"1735448793881634\"],\"startTime\":0.000000,\"endTime\":0.000000,\"coVal\":2000.000000}},{\"6\":{\"nextId\":[\"8\"],\"startTime\":0.000000,\"endTime\":215.592896,\"coVal\":2000.000000}},{\"1735448793881634\":{\"nextId\":[\"1735448793881478\"],\"startTime\":0.000000,\"endTime\":221.394775,\"coVal\":2000.000000}},{\"8\":{\" ```

⏱️ TC-07: 避灾路线模拟(各出口,含CO参数) (get_escape_path_each_exit)

  • 分类: 避灾路线 | 业务状态: 服务端超时 (408)
  • 耗时: 120188.95 ms | 结果大小: 48 B
  • 数据结构: {success: bool, error: str, code: int}
  • 调用参数: model_id=2012326636757958658, fire_tun_id=4, person_tun_id=6, co_per=2000.0, during_time=30.0
📄 数据预览 ```json {"success": false, "error": "请求超时", "code": 408} ```

✅ TC-08: 获取回风井巷道ID列表 (get_out_shafts)

  • 分类: 关键阻力 | 业务状态: 正常
  • 耗时: 1073.53 ms | 结果大小: 130 B
  • 数据结构: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"cnt\":2,\"ids\":[3957,3963]}"}, "timestamp": 1785808424370} ```

✅ TC-09: 获取进风井巷道ID列表 (get_in_shafts)

  • 分类: 关键阻力 | 业务状态: 正常
  • 耗时: 1284.8 ms | 结果大小: 144 B
  • 数据结构: {success: bool, message: str, code: int, result: {result: str}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"cnt\":6,\"ids\":[4,37,113,3214,3964,3986]}"}, "timestamp": 1785808425643} ```

✅ TC-10: 最大阻力路线 (get_max_resistance_path)

  • 分类: 关键阻力 | 业务状态: 正常
  • 耗时: 1549.44 ms | 结果大小: 1.0 KB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(959)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658, node_id=3958
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":0,\"fMaxH\":1077.614465,\"path\":[0,4,6,8,10,12,14,16,28,98,100,102,104,105,107,108,110,117,122,121,124,149,151,160,159,158,141,143,145,204,206,208,211,215,218,1133,1134,223,225,232,257,258,260,273,275,277,280,284,310,311,289,291,302,313,315,335,334,345,340,342,344,365,366,382,384,404,415,417,420,439,442,447,501,505,509,517,544,564,566,576,587,590,657,681,1123,662,664,685,686,1735211924946739,1734397888359985,721,72 ```

✅ TC-11: 三区阻力分布 (get_three_area_distribution)

  • 分类: 关键阻力 | 业务状态: 正常
  • 耗时: 1825.01 ms | 结果大小: 366.0 KB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(328985)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":1,\"tuns\":{\"4\":{\"dQ\":127.000000,\"strName\":\"辅运平硐\",\"dV\":6.685196,\"dHTotal\":74.494432,\"dHFric\":74.494432,\"dHLocal\":0.000000,\"dHNature\":0,\"nAirType\":1,\"strAirType\":\"FreshQEdges\"},\"6\":{\"dQ\":59.790000,\"strName\":\"2#辅运平硐联络巷\",\"dV\":2.778617,\"dHTotal\":2.539730,\"dHFric\":2.539730,\"dHLocal\":0.000000,\"dHNature\":0,\"nAirType\":1,\"strAirType\":\"FreshQEdges\"},\"8\":{\"dQ\":59.790000,\"str ```

✅ TC-12: 关键路径决策 (get_key_path_decision)

  • 分类: 关键阻力 | 业务状态: 正常
  • 耗时: 1158.9 ms | 结果大小: 33.2 KB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(29908)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\"bSucced\":1,\"nNum1\":67,\"nNum2\":123,\"AmendEdges1\":{\"549\":{\"strName\":\"二水平中部回风大巷\",\"dLength\":65.226318,\"dQ\":47.620000,\"dH\":10.191495,\"dHAmend\":7.753141,\"AmendTypes\":\"新增设施调节\",\"dRAmend\":0.003419,\"dAmendArea\":11.541236},\"622\":{\"strName\":\"42上204主运顺槽\",\"dLength\":62.211524,\"dQ\":2.820000,\"dH\":0.024795,\"dHAmend\":2.043394,\"AmendTypes\":\"新增设施调节\",\"dRAmend\":0.256953,\"dAmendArea\":2.164311},\"912 ```

✅ TC-13: 节点压能图 (get_path_press_power)

  • 分类: 压能/解算 | 业务状态: 正常
  • 耗时: 12464.22 ms | 结果大小: 3.8 MB
  • 数据结构: {success: bool, message: str, code: int, result: {result: str(2874396)}, timestamp: int}
  • 调用参数: model_id=2012326636757958658, id_from=2, id_to=3958
📄 数据预览 ```json {"success": true, "message": "", "code": 200, "result": {"result": "{\n\t\"bSucced\":\t1,\n\t\"PathNum\":\t154,\n\t\"Paths\":\t{\n\t\t\"0\":\t{\n\t\t\t\"nTunNum\":\t31,\n\t\t\t\"Tuns\":\t[{\n\t\t\t\t\t\"strID\":\t\"4\",\n\t\t\t\t\t\"strName\":\t\"辅运平硐\",\n\t\t\t\t\t\"dFromPower\":\t0.000000,\n\t\t\t\t\t\"dToPower\":\t74.494432,\n\t\t\t\t\t\"dQ\":\t127.000000,\n\t\t\t\t\t\"dH\":\t74.494432,\n\t\t\t\t\t\"dLength\":\t341.101060\n\t\t\t\t}, {\n\t\t\t\t\t\"strID\":\t\"6\",\n\t\t\t\t\t\"strName\":\t\" ```

🔴 TC-14: 网络解算(耗时较长) (net_cal)

  • 分类: 压能/解算 | 业务状态: 服务端内部错误 (500)
  • 耗时: 35607.82 ms | 结果大小: 601 B
  • 数据结构: {success: bool, error: str, code: int, message: str(500)}
  • 调用参数: model_id=2012326636757958658
📄 数据预览 ```json {"success": false, "error": "HTTP错误: 500", "code": 500, "message": "{\"timestamp\":\"2026-08-04 09:54:38\",\"path\":\"/ventanaly-model/Vmodel/VentanalyAirthmeticJson/netcal\",\"status\":500,\"error\":\"Internal Server Error\",\"message\":\"Connection prematurely closed BEFORE response\",\"requestId\":\"7d7be25a-37578\",\"exception\":\"reactor.netty.http.client.PrematureCloseException\",\"trace\":\"reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response\\n ```

🔴 TC-15: 方案模拟解算 (net_cal_for_plan)

  • 分类: 压能/解算 | 业务状态: 服务不可用 (503)
  • 耗时: 74.82 ms | 结果大小: 605 B
  • 数据结构: {success: bool, error: str, code: int, message: str(500)}
  • 调用参数: model_id=2012326636757958658, plan={}
📄 数据预览 ```json {"success": false, "error": "HTTP错误: 503", "code": 503, "message": "{\"timestamp\":\"2026-08-04 09:54:38\",\"path\":\"/ventanaly-model/Vmodel/VentanalyAirthmeticJson/getNetCalForPlan\",\"status\":503,\"error\":\"Service Unavailable\",\"message\":\"Unable to find instance for ventanaly-model\",\"requestId\":\"dc06103d-37682\",\"exception\":\"org.springframework.cloud.gateway.support.NotFoundException\",\"trace\":\"org.springframework.cloud.gateway.support.NotFoundException: 503 SERVICE_UNAVAILABL ```

💡 问题与建议

⚠️ 发现 4 个问题

接口 问题 建议
check_model_diagonal_structure 服务端超时 (408),耗时 180176ms 优化后端算法或增加超时时间;前端设置 180s+ 超时并显示进度
get_escape_path_each_exit 服务端超时 (408),耗时 120189ms 优化后端算法或增加超时时间;前端设置 180s+ 超时并显示进度
net_cal 服务端内部错误 (500) - Connection prematurely closed BEFORE response 检查后端 Netty 连接池/响应超时配置
net_cal_for_plan 服务不可用 (503) - Unable to find instance for ventanaly-model 检查微服务 ventanaly-model 实例是否在注册中心在线

📝 通用建议

  1. 响应时间差异大:快速接口(进/回风井查询、循环风路检查)约 0.8-1.5s,重计算接口(压能图 12s、避灾路线 18s)约 12-35s,超时接口约 180s。建议按接口类型设置差异化超时
  2. 数据量大get_three_area_distribution (366KB) 和 get_path_press_power (3.8MB) 返回数据量大,移动端需考虑分页或压缩。
  3. 参数校验net_cal_for_planplan 参数不能为空字符串,建议后端明确 plan 格式规范并提供示例。
  4. 返回值结构:外层统一为 {success, code, result},但 get_model_fault_diagnosis 直接在外层暴露 modelID 字段,略有风格不一致。
  5. 节点 vs 隧道 IDget_max_resistance_pathget_path_press_power 使用 node_id(节点ID),其他接口使用 tun_id(隧道ID),文档已有说明但调用时容易混淆。
  6. 内层 JSON:多数接口的 result.result 是 JSON 字符串,需要二次 json.loads 解析,建议统一为对象格式。