Regular Expression Generation for Application Parameter Validation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for checking parameter validity in application systems are inefficient, as they often require invoking methods and reporting errors, leading to increased time and calculation costs, especially in larger systems with numerous methods.
Innovation Solution
A method is provided to generate regular expressions based on common information extracted from historical parameter configuration data, reducing the number and length of regular expressions, and thereby simplifying the parameter validity check process.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a regular expression is generated based on each piece of parameter configuration data of each parameter, then the parameter validity check can be performed, but the number of regular expressions becomes very large, increasing matching complexity
Solution Approach 1:
The patent merges multiple parameter configuration data pieces into a single consolidated regular expression by extracting common patterns and structures. Instead of generating separate regular expressions for each parameter configuration instance, the system combines them into one unified expression that covers all cases, thereby reducing the total number of regular expressions while maintaining validation reliability.
Solution Approach 2:
The patent creates a universal regular expression that serves multiple parameter validation purposes simultaneously. By designing the regular expression to handle diverse parameter configurations through common patterns, a single expression performs the function of what would otherwise require many separate expressions, reducing complexity while maintaining broad applicability.
2Reliability
If a regular expression is generated based on original data of historical parameter configuration data, then parameter validity can be checked, but the generated regular expression is relatively long, increasing matching complexity
Solution Approach 1:
The patent extracts only the essential common patterns and structures from historical parameter configuration data, removing redundant and unnecessary components. By taking out only the critical validation rules and discarding duplicate or irrelevant information, the resulting regular expression is significantly shortened while retaining its ability to perform valid parameter checking.
Solution Approach 2:
The patent transforms the regular expression by changing its parameter representation - converting detailed, verbose parameter specifications into compact, optimized patterns. This parameter transformation reduces the length of the regular expression while preserving its validation functionality through more efficient pattern matching.
Data Source
AI summary
Implementations of the present specification provide a method of generating a regular expression for a parameter of an application system and a method and an apparatus of checking validity of a parameter of an application system. To generate a regular expression for a parameter of the application system, parameter values of each parameter in each method code block are obtained from a historical implementation of the application system. Common information is extracted from the corresponding parameter values for each parameter in each method code block. Then a corresponding regular expression is generated for each parameter in each method code block based on the extracted common information.


