提出了一种紧固式虚拟机,并在嵌入式智能相机中设计实现。在动态类装载时进行常量池解析和方法表建立,开发了机器视觉本地方法接口,以提高运行速度;采用两个双向链表对内存进行管理,从而提高虚拟机的稳定性。通过该虚拟机实现了智能相机的用户自定义工具。测试表明,虚拟机在智能相机的装载时间达到1 ms,实际平均每条字节码指令运行时间只有0.12μs,满足实时性要求。
This paper designs a type of fastening virtual machine,which can be realized in a embedded smart camera.It resolved the constant-pool and established a method-table when classes loading,and developed a native method interface to improve the speed.To enhance the stability of the virtual machine,a double linked list is used to automatically manage memory.Finally,the custom tools of the embedded machine vision can be realized through the virtual machine.The experiment has reveals that it takes 1 ms for the virtual machine to load and the actual average running time of each instruction is only 0.12 μs.In this way,it meets the real-time requirement.