US 12,299,436 B2
Method and apparatus of generating regular expression for parameter of application system and method and apparatus of checking validity of parameter of application system
Bingxu Chai, Zhejiang (CN); Wei Jiang, Zhejiang (CN); Jianguo Li, Zhejiang (CN); and Haoxuan Yu, Zhejiang (CN)
Assigned to Alipay (Hangzhou) Information Technology Co., Ltd., Hangzhou (CN)
Filed by Alipay (Hangzhou) Information Technology Co., Ltd., Zhejiang (CN)
Filed on May 16, 2023, as Appl. No. 18/318,632.
Claims priority of application No. 202210539375.X (CN), filed on May 17, 2022.
Prior Publication US 2023/0376303 A1, Nov. 23, 2023
Int. Cl. G06F 8/70 (2018.01); G06F 11/36 (2006.01); G06F 11/3604 (2025.01)
CPC G06F 8/70 (2013.01) [G06F 11/3604 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method of generating regular expressions for a plurality of parameters of different parameter types within a method code block on an application system, comprising:
obtaining parameter values of each parameter in the method code block from a historical implementation of the application system;
extracting common information from the corresponding parameter values for each parameter of the plurality of parameters in the method code block, wherein the extracting comprises:
for each parameter in the method code block, performing a parameter parsing algorithm, the parameter parsing algorithm corresponding to a respective parameter type, and the performing the parameter parsing algorithm including:
performing parameter format parsing on each parameter value to determine a parameter type based on whether all parameter content of a parameter value of the parameter is capable of undergoing format parsing, whether all parameter content of the parameter value of the parameter is incapable of format parsing, or whether part of the parameter content of the parameter value of the parameter is capable of undergoing format parsing and part of the parameter content of the parameter value of the parameter is incapable of undergoing format parsing; and
extracting common information from the parameter values corresponding to their respective parameter types by using an extraction approach correspond to a respective parameter type, wherein each extraction approach is different for each parameter type; and
generating a corresponding regular expression for each parameter of the plurality of parameters in the method code block based on its respective extracted common information and parameter type;
executing the method code block on the application system;
obtaining a parameter value of a parameter in the method code block on the application system during execution; and
performing parameter validity check of the obtained parameter value based on whether the intercepted parameter value matches the generated regular expression for the respective parameter.