基于图谱的知识增强检索的雷达系统MATLAB代码仿真实现
KG-Augmented Retrieval for Radar System MATLAB Simulation
DOI: 10.12677/app.2026.164034, PDF,   
作者: 凌晨然:南京邮电大学贝尔英才学院,江苏 南京;姚思怡:南京邮电大学通信与信息工程学院,江苏 南京;赵博文*:南京电子技术研究所,江苏 南京
关键词: MATLAB仿真物理约束知识图谱检索增强生成代码生成MATLAB Simulation Physical Constraints Knowledge Graph RAG Code Generation
摘要: 通用大语言模型(Large language model, LLM)生成给雷达垂直领域仿真代码时,幻觉的问题十分显著,本文提出了一个由物理约束驱动的知识增强检索生成(Retrieval-Augmented Generation, RAG)框架。通过整合各种复杂来源的原始知识资料,搭建多源异构知识库,再用改进后的七步法,建立包含雷达体制、系统组件、关键参数、函数算子、物理约束的领域知识图谱,搭配MCP协议,可以在已有工程化架构中强制对齐物理逻辑,实现代码语法的闭环校验。为全面评估生成代码的工程可用性,本文确立了物理幻觉率和平均圈复杂度两大核心评价指标。实验结果显示,相较于基线大模型,本方法将物理幻觉率从90%以上显著降至42%左右,同时生成的雷达全链路仿真代码不仅具备极高的代码可执行率,且其平均圈复杂度逼近专家基准水平(降低至1.0053),大幅提升了代码的可维护性与工程落地价值。
Abstract: General Large Language Models (LLM) exhibit significant hallucination issues when generating simulation code for the specialized domain of radar engineering. This paper proposes a Knowledge-Augmented Retrieval-Augmented Generation (RAG) framework driven by physical constraints. By integrating raw knowledge from various complex sources, a multi-source heterogeneous knowledge base is constructed. An improved “seven-step method” is then employed to establish a domain-specific Knowledge Graph—encompassing radar systems, system components, key parameters, functional operators, and physical constraints. Combined with the MCP (Model Context Protocol), this framework enforces the alignment of physical logic within the engineering architecture, achieving closed-loop verification of code syntax. To comprehensively evaluate the engineering viability of the generated code, this paper establishes two core metrics: Physical Hallucination Rate, and Average Cyclomatic Complexity. Experimental results demonstrate that, compared to baseline models, this method significantly reduces the physical hallucination rate from 90% and more to nearly 42%. Furthermore, the generated full-link radar simulation code exhibits a high executability rate and an average cyclomatic complexity nearing expert benchmarks (reduced to 1.0053), substantially enhancing code maintainability and engineering practical value.
文章引用:凌晨然, 姚思怡, 赵博文. 基于图谱的知识增强检索的雷达系统MATLAB代码仿真实现[J]. 应用物理, 2026, 16(4): 366-378. https://doi.org/10.12677/app.2026.164034

参考文献

[1] 邹丽娟. 基于Matlab/Simulink的测量雷达伺服系统的仿真方法[J]. 现代雷达, 2004, 26(8): 64-67.
[2] 夏栋, 察豪, 张伟, 等. 基于软件产品线技术的软件雷达[J]. 现代雷达, 2012, 34(4): 32-35.
[3] 郭子乐, 郑庆琳, 张宁. 基于MDA的雷达信息处理系统构件化设计[J]. 现代雷达, 2024, 46(5): 19-25.
[4] Kwon, W., et al. (2023) Efficient Memory Management for Large Language Model Serving with PagedAttention. arXiv: 2309.06180.
[5] Li, Z., Perera, S., Zhang, Y., Zhang, G. and Doviak, R. (2019) Phased-Array Radar System Simulator (PASIM): Development and Simulation Result Assessment. Remote Sensing, 11, Article 422. [Google Scholar] [CrossRef
[6] Lu, T., Xu, Z., Chen, X., Huang, Y. and Wang, C. (2022) Model-Based Radar System Simulation and Verification. IET Conference Proceedings, 2022, 558-563. [Google Scholar] [CrossRef
[7] Skolnik, M.I. (2008) Radar Handbook. 3rd Edition, McGraw-Hill.
[8] Li, Z., et al. (2024) Radar Algorithm Generation System Based on Domain-Adaptive Retrieval-Augmented Generation. The 2024 27th International Conference on Computer Supported Cooperative Work in Design (CSCWD 2024), Tianjin, 8-10 May 2024, 1325-1331.
[9] Richards, M.A. (2005) Fundamentals of Radar Signal Processing. McGraw-Hill.
[10] The MathWorks Inc (2024) Radar Toolbox and Phased Array System Toolbox Documentation. MATLAB R2024b.
[11] 黄振铭. 面向雷达装备领域的知识图谱构建方法研究[D]: [硕士学位论文]. 北京: 军事科学院, 2024.
[12] Lewis, P., et al. (2020) Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Proceedings of the 34th International Conference on Neural Information Processing Systems, Vancouver, 6-12 December 2020, 9459-9474.
[13] Zhang, G., et al. (2018) Advanced Radar Techniques for Weather Observation. NOAA/NSSL Technical Report 2018.