Arduino安全递归调用  被引量:2

Arduino Secure Recursive Function Call

在线阅读下载全文

作  者:乐万德 刘舟洲 曹敬馨 初建杰[2] YUE Wande;LIU Zhouzhou;CAO Jingxin;CHU Jianjie(School of Computer,Xi’an Aeronautical University,Xi’an 710077,China;Key Laboratory of Industrial Design and Ergonomics,Ministry of Industry and Information Technology,Northwestern Polytechnical University,Xi’an 710072,China)

机构地区:[1]西安航空学院计算机学院,西安710077 [2]西北工业大学,工业设计与人机功效工信部重点实验室,西安710072

出  处:《实验室研究与探索》2021年第8期13-18,共6页Research and Exploration In Laboratory

基  金:国家自然科学基金(61871313);陕西省重点研发计划项目(2020GY-084);陕西省教育厅科研计划项目(20JG014)。

摘  要:针对Arduino支持递归调用及栈溢出隐患问题,设计了安全递归调用算法。在该算法中,每次递归调用前探测剩余内存并记录递归调用的深度,在内存不足以进行下一次递归调用时给出递归调用过深告警及最大递归调用深度提示,并安全返回。以斐波那契数列、汉诺塔等典型的递归调用问题为实验对象,在分析其递归调用栈溢出风险的基础上,采用这种算法在Arduino中进行了安全递归调用验证。针对栈溢出和非溢出典型场景进行测试均可正常工作,验证了安全递归调用算法的有效性和实用性,从而进一步增强Arduino应用潜能。Aiming at the problem of Arduino supporting recursive call and stack overflow,a secure recursive call algorithm is designed.In this algorithm,the remaining memory is detected and the depth of recursive call is recorded before each recursive call.When the memory is insufficient for the next recursive call,the alarm of too deep recursive call and the prompt of maximum recursive call depth are given,and the system returns safely.Taking Fibonacci sequence,Hanoi Tower and other typical recursive call problems as the experimental objects,based on the analysis of the risk of overflow in the recursive call stack,the algorithm proposed is used to verify the safe recursive call in Arduino.It works well in both typical scenarios of stack overflow and non overflow,which verifies the effectiveness and practicability of secure recursive call algorithm,so as to further enhance the innovative application potential of Arduino.

关 键 词:ARDUINO 递归调用 栈溢出 

分 类 号:TP273[自动化与计算机技术—检测技术与自动化装置] G642.423[自动化与计算机技术—控制科学与工程]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象