计算机工程与设计2024,Vol.45Issue(1) :79-87.DOI:10.16208/j.issn1000-7024.2024.01.011

编译型嵌入式Python的设计与实现

Design and implementation of compiled embedded Python

李春亭 王宜怀 施连敏 张露
计算机工程与设计2024,Vol.45Issue(1) :79-87.DOI:10.16208/j.issn1000-7024.2024.01.011

编译型嵌入式Python的设计与实现

Design and implementation of compiled embedded Python

李春亭 1王宜怀 1施连敏 2张露1
扫码查看

作者信息

  • 1. 苏州大学计算机科学与技术学院,江苏苏州 215000
  • 2. 苏州大学计算机科学与技术学院,江苏苏州 215000;武夷学院认知计算与智能信息处理福建省高校重点实验室,福建 武夷山 354300
  • 折叠

摘要

针对面向微控制器的解释型MicroPython具有实时性弱、占用存储空间大和可移植性较差等问题,提出一种将Python语言转化为C++语言并将构件层与应用层分离的编译型嵌入式Python方案,设计基于抽象语法树及类型注释的源码映射机制.在此基础上,设计嵌入式Python编译器,实现集成开发环境AHL-GEC-IDE(for Python版),完成Py-thon 源文件的编辑、编译、链接和下载.实践结果表明,该编译型Python方案可行,为嵌入式人工智能领域提供了一种实时性较高、编辑编译方便、可移植性较强的编译型Python集成开发环境.

Abstract

Aiming at the problems of poor real-time performance,large storage space and poor portability of Micro controller oriented interpretive Python,a compiled embedded Python scheme was proposed,which converted Python language into C++language and separated component layer from application layer.A source code mapping mechanism based on abstract syntax tree and type annotation was designed.On this basis,the embedded Python compiler was designed and the integrated development environment AHL-GEC-IDE(for Python version)was implemented,which completed the editing,compiling,linking and down-loading of Python source files.The practice shows that the compiled Python scheme is feasible.It provides a compiled Python integrated development environment with high real-time,easy editing and compiling,and strong portability for the field of em-bedded artificial intelligence.

关键词

编译型嵌入式Python/微型Python解释器/微控制器/抽象语法树/类型注释/混合编程/可移植性

Key words

compiled embedded Python/MicroPython/microcontroller unit/abstract syntax tree/type annotation/hybrid pro-gramming/portability

引用本文复制引用

基金项目

国家自然科学基金项目(61672369)

江苏高校优势学科建设工程基金项目(PAPD)()

武夷学院认知计算与智能信息处理福建省高校重点实验室开放课题基金项目(KLCCIIP2021201)

出版年

2024
计算机工程与设计
中国航天科工集团二院706所

计算机工程与设计

CSTPCD北大核心
影响因子:0.617
ISSN:1000-7024
参考文献量3
段落导航相关论文