ASOC2022: AliOS Things中多语言交互性能优化(C与Python间相互访问)
AliOS Things中多语言交互性能优化(C与Python间相互访问)
项目描述
嵌入式领域中最早是使用汇编语言进行编程,但汇编语言入门门槛很高;C/C++的出现降低嵌入式领域入门门槛的同时也提高了开发效率。和C/C++开发相比,Python的开发门槛更低,开发效率更高。但Python语言并不能直接操作硬件,所以Python语义需要经过Python引擎的翻译转换成对C/C++语言或汇编语言实现API的调用才能运行。 本项目则是对C和Python的双向通信进行优化,如下题目可以任选其一进行优化:
- Python到C的优化:对Python引擎进行优化提高Python语句的运行效率
- C到Python的优化:产生中断后C语言调用Python注册的回调机制优化,提高C到Python消息的传递效率
- 使用Python不可避免的会占用更多的内存,请思考并调研Python引擎中内存如何进行优化
In the embedded field, assembly language was first used for programming, but the entry threshold for assembly language was very high; the emergence of C/C++ lowered the entry threshold in the embedded field and improved development efficiency. Compared with C/C++ development, Python has a lower development threshold and higher development efficiency. However, the Python language cannot directly operate the hardware, so the Python semantics needs to be translated by the Python engine into a call to the C/C++ language or assembly language implementation API to run. This project is to optimize the two-way communication between C and Python. The following topics can be selected for optimization:
- Python to C optimization: optimize the Python engine to improve the efficiency of Python statements
- Optimization from C to Python: After an interrupt is generated, the C language calls the callback mechanism registered by Python to improve the efficiency of message transmission from C to Python
- Using Python will inevitably take up more memory, please think about and investigate how to optimize the memory in the Python engine
项目备注
在HaaS EDU K1上对HaaS Python引擎进行优化,HaaS Python是基于MicroPython扩展的云端一体轻应用开发框架,通过haaS Python可以快速连接到阿里云物联网平台。 原始代码仓库位置:https://github.com/alibaba/AliOS-Things/tree/rel_3.3.0 HaaS Python解决方案:https://github.com/alibaba/AliOS-Things/tree/rel_3.3.0/solutions/py_engine_demo MIcroPython原理介绍:第一节、第二节、第三节、第四节 MicroPython中断回调机制:链接
This optimization is based on HaaS EDU K1. HaaS Python is a AIoT application development framework based on MicroPython. HaaS Python can be used to connect to the Alibaba Cloud IoT platform. Original code repository location: https://github.com/alibaba/AliOS-Things/tree/rel_3.3.0 Solution: https://github.com/alibaba/AliOS-Things/tree/rel_3.3.0/solutions/py_engine_demo
项目产出要求:
-
任选一个方向进行深入研究并生成优化的patch以及优化前后性能指标
-
Choose one direction to conduct in-depth research and generate optimized patches and performance indicators before and after optimization
项目难度
基础
感谢您提出的宝贵问题,我们有7x24小时服务的“HaaS百事通”客服系统,
您可以先尝试能否解决您的问题(https://haas.iot.aliyun.com/?ask=1&f=a2cre.b82925042)
如果“HaaS百事通”没有解决您的问题,请回复“人工支持”,我们会在工作日(10:00-12:00/14:00-18:00)10分钟内回复您。