摘要
针对大坝安全监测系统中存在的相关点测值实时计算问题,提出了一种基于正则表达式和条件分支的本地化的用户自定义公式计算方法,即首先通过基于栈的正则表达式,分析与检验自定义公式的合法性和结构,确定运算顺序,然后迭代地匹配出本点嵌套引用的其他测点测值定义、用户自定义函数符,并替换成数值或者系统函数调用,从而完成整个公式的运算。同时,实现基于条件分支的计算功能,使相关点计算过程中,可以按指定的条件选择相应的分支自定义公式进行计算。实践证明,本方法具有任意层相关点嵌套计算、常见数学函数支持、支持条件分支计算等优点,是一种具有良好工程应用价值的轻量级的计算方法。
In this paper,a related point calculation model based on regex and conditional branch is proposed for dam safety monitoring.The structure and legality of the formula is analyzed by iteratively matching and replacing nested point measuring values and user-defined functions,then the whole calculation is completed.Meanwhile,multi formulas are supported by conditional branch,which would be chosen automatically by the model during the run time via the special varies.Practice has proved that this model is a local light-weight calculation solution with advantages as nested call calculations,functions support and so on.
出处
《水电自动化与大坝监测》
2013年第3期40-42,共3页
HYDROPOWER AUTOMATION AND DAM MONITORING