Verification method and system for input value of web terminal or mobile terminal

By establishing a verification rule database on the web or mobile terminal, and directly editing and applying verification rules, it solves the problems of cumbersome and inefficient updating of input value verification rules in the existing technology, and realizes simpler and more efficient verification rules. Management improves user experience.

CN118734833AInactive Publication Date: 2024-10-01佛山众陶联供应链服务有限公司 +4
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410849317.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing web or mobile applications, updating and adjusting input value verification rules requires rewriting the front-end code and applying it by releasing a new version, which results in a cumbersome and inefficient process, affecting the user experience.

Method used

Establish a verification rule database, including rule name, rule number, rule description and rule details. Directly modify and apply verification rules by editing and querying the database to avoid modifying rules by publishing a new version.

Benefits of technology

It simplifies the modification process of verification rules, improves efficiency, and improves user experience. Rules can be updated and applied by directly editing the verification rule information in the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734833A_ABST
    Figure CN118734833A_ABST
Patent Text Reader

Abstract

The invention discloses a verification method and system for an input value of a web terminal or a mobile terminal, and the method comprises the following steps: building a verification rule database which comprises the information of a plurality of verification rules; when the verification rule in the verification rule database needs to be modified, information of the verification rule needing to be modified is directly edited; obtaining a numerical value input by a user at the web terminal or the mobile terminal, and calling the rule number of the corresponding verification rule; according to the rule number of the corresponding verification rule, obtaining rule details of the verification rule from a verification rule database; traversing the rule details of the verification rule, and obtaining the regular expression of the rule; and checking a numerical value input by the user by using a regular rule expression in the rule details of the checking rule. According to the method and the device, the problems that the modified inspection rule is applied to a web terminal or a mobile terminal by releasing a new version in the prior art, and the modification mode of the inspection rule is tedious in process and low in efficiency are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of web or mobile terminal input value verification, and in particular to a web or mobile terminal input value verification method and system. Background Art

[0002] In existing web or mobile applications, validation rules are used to validate the values ​​entered by users in the application interface, and the validation rules for the input values ​​of the application interface are usually embedded in the front-end code. Whenever these validation rules need to be updated or adjusted, developers have to rewrite or modify the front-end code and apply the modified validation rules to the web or mobile terminal by releasing a new version. This validation rule modification method is not only cumbersome and inefficient, but also frequently releasing new versions may have a negative impact on user experience. Summary of the invention

[0003] In view of the above-mentioned defects, the present invention proposes a method and system for verifying input values ​​of a web or mobile terminal, aiming to solve the problem that the existing method of applying modified verification rules to the web or mobile terminal by releasing a new version is not only cumbersome but also inefficient.

[0004] To achieve this object, the present invention adopts the following technical solutions:

[0005] A method for verifying a value inputted by a web terminal or a mobile terminal comprises the following steps:

[0006] Step S1: Establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text;

[0007] When the verification rule in the verification rule database needs to be modified, the information of the verification rule to be modified is directly edited;

[0008] Step S2: Obtain the value entered by the user on the web terminal or mobile terminal, and call the rule number of the corresponding verification rule;

[0009] Step S3: according to the rule number of the corresponding verification rule, obtain the rule details of the verification rule from the verification rule database;

[0010] Step S4: traverse the rule details of the verification rule and obtain the rule regular expression therein;

[0011] Step S5: Verify the value input by the user with the rule regular expression in the rule details of the verification rule. When the value input by the user meets the rule regular expression in the rule details of the verification rule, verify the value input by the user with the next verification rule; when the value input by the user does not meet the rule regular expression in the rule details of the verification rule, obtain the prompt text corresponding to the rule regular expression and display it visually.

[0012] Preferably, in step S3, the following steps are specifically included: format conversion of the rule details of the verification rule in the string format into the rule details of the verification rule in the array object format.

[0013] Preferably, step S5 specifically includes the following sub-steps: checking the numerical value input by the user according to the priority order using the rule regular expression in the rule details of the verification rule.

[0014] Another aspect of the present application provides a verification system for a web or mobile terminal input value, the system comprising:

[0015] Establishing a module, used for establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text;

[0016] The editing module is used to directly edit the information of the verification rule that needs to be modified when the verification rule in the verification rule database needs to be modified;

[0017] The first acquisition module is used to obtain the value input by the user on the web terminal or the mobile terminal;

[0018] A calling module, used for calling the rule number of the verification rule corresponding to the obtained user input value;

[0019] A second acquisition module is used to acquire rule details of the verification rule from the verification rule database according to the rule number of the corresponding verification rule;

[0020] The traversal module is used to traverse the rule details of the verification rule;

[0021] A third acquisition module is used to obtain a rule regular expression in the rule details of the verification rule;

[0022] The verification module is used to verify the numerical value input by the user according to the rule regular expression in the rule details of the verification rule. When the numerical value input by the user meets the rule regular expression in the rule details of the verification rule, the next verification rule is used to verify the numerical value input by the user; when the numerical value input by the user does not meet the rule regular expression in the rule details of the verification rule, the prompt text corresponding to the rule regular expression is obtained and displayed visually.

[0023] Preferably, it also includes a format conversion module for converting the rule details of the verification rule in a string format into the rule details of the verification rule in an array object format.

[0024] Preferably, the verification module comprises a verification submodule, and the verification submodule is used to verify the rule regular expression in the rule details of the verification rule against the numerical value input by the user in order of priority.

[0025] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0026] This solution not only facilitates the storage of several verification rules by establishing a verification rule database, but also, when the verification rules need to be modified, users can directly edit the information of the corresponding verification rules in the verification rule database, without having to modify the verification rules by releasing a new version. This method of modifying the verification rules is simpler and more efficient, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The invention is a flowchart of steps of a method for verifying input values ​​of a web terminal or a mobile terminal. DETAILED DESCRIPTION

[0028] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0029] A method for verifying a value inputted by a web terminal or a mobile terminal comprises the following steps:

[0030] Step S1: Establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text;

[0031] When the verification rule in the verification rule database needs to be modified, the information of the verification rule to be modified is directly edited;

[0032] Step S2: Obtain the value entered by the user on the web terminal or mobile terminal, and call the rule number of the corresponding verification rule;

[0033] Step S3: according to the rule number of the corresponding verification rule, obtain the rule details of the verification rule from the verification rule database;

[0034] Step S4: traverse the rule details of the verification rule and obtain the rule regular expression therein;

[0035] Step S5: Verify the value input by the user with the rule regular expression in the rule details of the verification rule. When the value input by the user meets the rule regular expression in the rule details of the verification rule, verify the value input by the user with the next verification rule; when the value input by the user does not meet the rule regular expression in the rule details of the verification rule, obtain the prompt text corresponding to the rule regular expression and display it visually.

[0036] A verification method for input value of a web or mobile terminal in this solution, such as Figure 1As shown, the first step is to establish a verification rule database, wherein the verification rule database includes information of several verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text; when it is necessary to modify the verification rule in the verification rule database, directly edit the information of the verification rule that needs to be modified. In this embodiment, the establishment of the verification rule database is conducive to the storage and processing of information of several verification rules. When it is necessary to modify the verification rule, the information of the corresponding verification rule in the verification rule database can be directly edited, and the purpose of modifying the verification rule does not need to be achieved by releasing a new version. Further explanation, there are multiple rule regular expressions set in the rule details of the verification rule, each rule regular expression corresponds to a prompt text, and the use of each rule regular expression to verify the input value is operated according to the priority. The second step is to obtain the numerical value entered by the user on the web or mobile terminal, and call the rule number of the corresponding verification rule. In this embodiment, when the user enters a numerical value on the web or mobile application interface, the backend needs to verify the input value. Only after the verification is passed can it be used as the input of the web or mobile terminal, thereby ensuring the accuracy of the input value. During the verification process, the rule number of the verification rule corresponding to the input value that needs to be verified will be automatically called. The third step is to obtain the rule details of the verification rule from the verification rule database according to the rule number of the corresponding verification rule. In this embodiment, by searching for the rule details of the verification rule from the verification rule database, it is convenient for the subsequent verification of the input value. The fourth step is to traverse the rule details of the verification rule and obtain the rule regular expression therein. In this embodiment, by traversing and searching for the rule regular expression in the rule details of the verification rule, it is convenient to use the rule regular expression to verify the input value in the future. The fifth step is to verify the value entered by the user with the rule regular expression in the rule details of the verification rule. When the value entered by the user meets the rule regular expression in the rule details of the verification rule, the next verification rule is used to verify the value entered by the user; when the value entered by the user does not meet the rule regular expression in the rule details of the verification rule, the prompt text in the rule details of the verification rule is obtained and displayed visually. In one embodiment, if one of the rule regular expressions in the rule details of the verification rule is "^.{3,12}$", if the value entered by the user is 222, the Pattern.matches() function is used to verify whether there is a match for the input value. Since 222 meets the requirements of 3 to 12 characters, it means that the test is passed. If the value entered by the user is 22, since 22 does not meet the requirements of 3 to 12 characters, it means that the test fails, and the prompt text corresponding to the rule expression "Only characters of 3-12 digits can be entered" is obtained.

[0037] This solution not only facilitates the storage of several verification rules by establishing a verification rule database, but also, when the verification rules need to be modified, users can directly edit the information of the corresponding verification rules in the verification rule database, without having to modify the verification rules by releasing a new version. This method of modifying the verification rules is simpler and more efficient, thereby improving the user experience.

[0038] Preferably, in step S3, the following steps are specifically included: converting the format of the rule details of the verification rules in the string format into the rule details of the verification rules in the array object format. In this embodiment, the rule details of the verification rules stored in the verification rule database are in the string format, which is conducive to the convenience of saving these rule details in the verification rule database. Converting the rule details of the verification rules in the string format into the rule details of the verification rules in the array object format is conducive to the convenience of subsequent traversal of each rule expression in the rule details array object and performing corresponding verification.

[0039] Preferably, in step S5, the following sub-steps are specifically included: the rule regular expression in the rule details of the verification rule is used to check the numerical value input by the user in the order of priority. In this embodiment, the priority is divided into priority operation and last operation. In the process of checking the numerical value input by the user, the inspection operation with the priority of priority delivery is performed first, that is, the input value is checked using the rule regular expression corresponding to the priority of the priority operation, and the inspection operation with the priority of last delivery is performed last, that is, the input value is checked using the rule regular expression corresponding to the priority of the last operation. By checking in order of priority, those verification rules that are most likely to fail can be processed first, so that input problems can be discovered as early as possible and error prompts are returned, thereby improving user experience.

[0040] Another aspect of the present application provides a verification system for a web or mobile terminal input value, the system comprising:

[0041] Establishing a module, used for establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text;

[0042] The editing module is used to directly edit the information of the verification rule that needs to be modified when the verification rule in the verification rule database needs to be modified;

[0043] The first acquisition module is used to obtain the value input by the user on the web terminal or the mobile terminal;

[0044] A calling module, used for calling the rule number of the verification rule corresponding to the obtained user input value;

[0045] A second acquisition module is used to acquire rule details of the verification rule from the verification rule database according to the rule number of the corresponding verification rule;

[0046] The traversal module is used to traverse the rule details of the verification rule;

[0047] A third acquisition module is used to obtain a rule regular expression in the rule details of the verification rule;

[0048] The verification module is used to verify the numerical value input by the user according to the rule regular expression in the rule details of the verification rule. When the numerical value input by the user meets the rule regular expression in the rule details of the verification rule, the next verification rule is used to verify the numerical value input by the user; when the numerical value input by the user does not meet the rule regular expression in the rule details of the verification rule, the prompt text corresponding to the rule regular expression is obtained and displayed visually.

[0049] The present solution is a verification system for input values ​​of a web or mobile terminal, which realizes the verification of input values ​​of the web or mobile terminal application interface by cooperating with each other through the establishment module, the editing module, the first acquisition module, the calling module, the second acquisition module, the traversal module, the third acquisition module and the verification module, thereby ensuring the accuracy of the input values. The present solution not only facilitates the storage of a number of verification rules by establishing a verification rule database, but also allows users to directly edit the information of the corresponding verification rules in the verification rule database when the verification rules need to be modified, without the need to modify the verification rules by releasing a new version. This method of modifying the verification rules is simpler and more efficient, thereby improving the user experience.

[0050] Preferably, a format conversion module is also included, which is used to convert the rule details of the verification rule in string format into the rule details of the verification rule in array object format. In this embodiment, by setting the format conversion module, it is convenient to subsequently traverse each rule expression in the rule details array object and perform corresponding verification.

[0051] Preferably, the verification module includes a verification submodule, and the verification submodule is used to verify the value input by the user according to the priority order using the rule regular expression in the rule details of the verification rule. In this embodiment, in the verification submodule, by verifying according to the priority order, those verification rules that are most likely to fail can be processed first, so as to find input problems as early as possible and return error prompts, thereby improving user experience.

[0052] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0053] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for verifying input values ​​on a web terminal or a mobile terminal, characterized in that: The following steps are involved: Step S1: Establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text; When the verification rule in the verification rule database needs to be modified, the information of the verification rule to be modified is directly edited; Step S2: Obtain the value entered by the user on the web terminal or mobile terminal, and call the rule number of the corresponding verification rule; Step S3: according to the rule number of the corresponding verification rule, obtain the rule details of the verification rule from the verification rule database; Step S4: traverse the rule details of the verification rule and obtain the rule regular expression therein; Step S5: Verify the value input by the user with the rule regular expression in the rule details of the verification rule. When the value input by the user meets the rule regular expression in the rule details of the verification rule, verify the value input by the user with the next verification rule; when the value input by the user does not meet the rule regular expression in the rule details of the verification rule, obtain the prompt text corresponding to the rule regular expression and display it visually.

2. A web or mobile terminal input value verification method according to claim 1, characterized in that: In step S3, the following steps are specifically included: converting the format of the rule details of the verification rule in the string format into the rule details of the verification rule in the array object format.

3. A web or mobile terminal input value verification method according to claim 1, characterized in that: In step S5, the following sub-steps are specifically included: the rule regular expression in the rule details of the verification rule is checked against the numerical value input by the user in order of priority.

4. A web or mobile terminal input value verification system, characterized in that: Using the verification method of a web-end or mobile-end input value as described in any one of claims 1 to 3, the system comprises: Establishing a module, used for establishing a verification rule database, wherein the verification rule database includes information of a number of verification rules, the verification rule information includes rule name, rule number, rule description and rule details, and the rule details include priority, rule regular expression and prompt text; The editing module is used to directly edit the information of the verification rule that needs to be modified when the verification rule in the verification rule database needs to be modified; The first acquisition module is used to obtain the value input by the user on the web terminal or the mobile terminal; A calling module, used for calling the rule number of the verification rule corresponding to the obtained user input value; A second acquisition module is used to acquire rule details of the verification rule from the verification rule database according to the rule number of the corresponding verification rule; A traversal module is used to traverse the rule details of the verification rule; A third acquisition module is used to obtain a rule regular expression in the rule details of the verification rule; The verification module is used to verify the numerical value input by the user according to the rule regular expression in the rule details of the verification rule. When the numerical value input by the user meets the rule regular expression in the rule details of the verification rule, the next verification rule is used to verify the numerical value input by the user; when the numerical value input by the user does not meet the rule regular expression in the rule details of the verification rule, the prompt text corresponding to the rule regular expression is obtained and displayed visually.

5. A web or mobile terminal input value verification system according to claim 4, characterized in that: It also includes a format conversion module, which is used to convert the rule details of the verification rule in a string format into the rule details of the verification rule in an array object format.

6. A web or mobile terminal input value verification system according to claim 4, characterized in that: The verification module includes a verification submodule, and the verification submodule is used to verify the rule regular expression in the rule details of the verification rule against the numerical value input by the user according to the priority order.

Citation Information

Patent Citations

  • Method for verifying page input by using database technology

    CN102799690A

  • Data quality centralized-monitoring method and device based on electric power enterprise ERP

    CN105893214A

  • Parameter verification method and device, electronic equipment and readable storage medium

    CN111290742A

  • Rule verification and configuration method for annuity business

    CN117745437A