Font Size: a A A

Research And Implementation Of Micropython Optimization Technology

Posted on:2022-12-10Degree:MasterType:Thesis
Country:ChinaCandidate:Y J HuangFull Text:PDF
GTID:2518306764476624Subject:Computer Software and Application of Computer
Abstract/Summary:PDF Full Text Request
With the rapid development of the Internet of Things technology,embedded devices have penetrated into all aspects of people's lives,and the embedded system can be said to be one of the hottest fields at the moment.At present,in the development of the embedded system,most developers still use C\C++.However,there are some defects when this kind of language is employed to develop the embedded system.First,during the development,each change needs to go through the procedure of compiling-downloading,which usually takes a lot of time and thus influences the efficiency of development.Second,since the embedded software is platform-dependent,the certain application may require different apprpaches to complie on different device platforms,which results in a lot of repetitive developments and the waste of human resources.As an emerging development language in the field of the embedded system,MicroPython inherits the advantages of Python,such as simple syntax,powerful functions,and strong scalability.MicroPython can be compiled once and run multiple times,and the code is highly portable,which greatly improves the development efficiency and effectively solves the above-mentioned pain points of using C language for the development of embedded system.Nevertheless,MicroPython has the following problems:(1)As an interpreted language,MicroPython probably has low execution efficiency.Compared with programs developed in C language,programs developed in MicroPython may execute dozens or even hundreds of times slower.Although the existing frameworks apply indirect threading technology to optimize performance,the room for this technology to improve performance is still limited.(2)Usually when the MicroPython firmware is complied,unused modules are also compiled into it,resulting in a waste of embedded resources.This thesis further analyzes the implementation mechanism of MicroPython,including its object model,virtual machine,garbage collection and other underlying principles.In view of its execution efficiency,this thesis probes into the implementation architecture of the interpreter,the related instruction dispatching technology,and the optimization technology related to the virtual machine.Combined with the characteristics of embedded devices,this thesis makes a comparative analysis of the difficulties of applying optimization technology based on compilation to embedded devices.In the meantime,it optimizes MicroPython virtual machine by using the optimization technology based on interpretation.With regard to the solution of the waste of resources in compiling firmware,a new idea is proposed to reduce the MicroPython firmware size by "customizing" virtual machine functions according to scripts,so as to further optimize the MicroPython virtual machine.Finally,through a number of test cases,the optimized virtual machine is tested.The comparative experiments prove that the optimization scheme can effectively optimize MicroPython.
Keywords/Search Tags:Micro Python, Interpreter optimization, Virtual machine optimization, Embedded
PDF Full Text Request
Related items