Custom form verification system and control method based on asynchronous verification library

The custom form verification system based on the asynchronous verification library solves the problem of inability to implement targeted verification in the existing technology, realizes fast and accurate verification of input values ​​​​in the form verification area and displays exceptions, and improves efficiency. Check efficiency.

CN118377557BActive Publication Date: 2024-08-30浙江网盛数新软件股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410817589.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-08-30
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

The existing form verification system cannot achieve targeted verification effects, resulting in limitations in verification operations. It is impossible to truly and accurately obtain the final verification results of the form, which reduces the verification efficiency of the form.

Method used

A custom form verification system based on the asynchronous verification library, which divides the verification area through the form partition module, the mode determination module determines the verification mode, the verification rule module extracts verification features and formulates custom verification rules, and the real-time verification module Perform verification, the verification and error correction module generates an error correction frame, and combines the error correction coefficient to generate a verification display sheet.

Benefits of technology

It realizes fast and accurate verification processing of input values ​​in the form verification area, improves the pertinence and applicability of verification, concisely and accurately displays abnormal phenomena in the form, and improves the verification efficiency of the form.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377557B
    Figure CN118377557B
Patent Text Reader

Abstract

The present invention relates to the technical field of form verification, and discloses a custom form verification system and a control method based on an asynchronous verification library; the system comprises marking a verification element and dividing a verification area, obtaining the attribute state of an input value, extracting a verification feature from the verification element, formulating a custom verification rule in a Joi verification library, verifying the input value, determining whether to enter an error correction mode, inputting an error correction value into an error correction box, obtaining an error correction coefficient of a verification area, and generating a verification display sheet; compared with the prior art, the system can accurately extract the verification feature from the form, and formulate a custom verification rule based on the verification feature, thereby avoiding the limitations brought about when the form is verified under a specific verification rule, improving the pertinence and applicability of the form verification, and also being able to perform corresponding verification display operations on different results after verification, thereby effectively improving the verification efficiency of the form.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of form verification, and more specifically, to a custom form verification system and a control method based on an asynchronous verification library. Background Art

[0002] In the process of web development, form validation is always taken seriously. Whether you develop validation functions yourself or use open source validation plug-ins, you need to write dedicated validation code for a single control or form in the program. In order to achieve fast validation of different types of forms, you need to perform customized form validation processing in the asynchronous validation library.

[0003] The patent application with reference publication number CN106990952A discloses a form verification method and system based on Vue.js, which can greatly improve the performance of form verification by associating form elements, verification rules and error messages; and almost no HTML code needs to be written, only simple Vue.js objects need to be defined to create a form and complete the form verification function, making the code easy to maintain and maintain extensibility; at the same time, form element components and verification rules can be customized, greatly improving development efficiency;

[0004] The prior art has the following deficiencies:

[0005] The existing form verification system achieves a generalized verification effect on the verification elements in the form by formulating verification rules of a specific pattern in the verification library. Since the verification rules are not based on the verification characteristics of the verification elements when they are formulated, the verification rules cannot achieve a targeted verification effect when verifying the verification elements, resulting in limitations in the form verification operation, and it is impossible to truly and accurately obtain the final verification result of the form, which reduces the verification efficiency of the form.

[0006] In view of this, the present invention proposes a custom form verification system and control method based on an asynchronous verification library to solve the above problems. Summary of the invention

[0007] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution: a custom form verification system based on an asynchronous verification library, comprising:

[0008] The form partitioning module is used to receive the form verification request, mark the verification elements in the form, and divide the verification area;

[0009] A mode determination module is used to obtain the attribute status of the input value in the verification area and determine whether to enter the verification mode;

[0010] The validation rule module is used to extract validation features from validation elements and formulate custom validation rules in the Joi validation library based on the validation features.

[0011] The real-time verification module is used to verify the input value through custom verification rules, obtain the verification status, and determine whether to enter the error correction mode;

[0012] A verification and error correction module, used to generate an error correction frame after eliminating input values ​​whose verification status is an error state, and input an error correction value into the error correction frame;

[0013] The verification display module is used to obtain the error correction coefficient of the verification area, and generate a verification display sheet in combination with the error correction coefficient and the verification status.

[0014] Furthermore, the method for dividing the verification area includes:

[0015] Identify i elements in the form through Hypertext Markup Language;

[0016] Identify the keywords of i elements one by one through natural language processing technology;

[0017] Elements with the keywords text box, drop-down box, check box, hidden box, and upload box are recorded as verification elements, and p verification elements are obtained;

[0018] Mark the locations of p check elements in the form, and measure the distances of the p check elements from the upper end and the lower end of the form, which are recorded as upper distance values ​​and lower distance values ​​respectively;

[0019] The position of the check element corresponding to the minimum upper distance value is recorded as the first dividing point, and a horizontal auxiliary line is drawn through the first dividing point to obtain the first dividing line;

[0020] The position of the check element corresponding to the minimum value of the lower distance value is recorded as the second dividing point, and a horizontal auxiliary line is drawn through the second dividing point to obtain a second dividing line;

[0021] The area between the first dividing line and the second dividing line in the form is recorded as the verification area.

[0022] Further, the attribute state includes a low state and a high state;

[0023] The determination methods of whether to enter the verification mode include:

[0024] Mark the p status boxes in the verification area one by one, and filter out the input values ​​in the p status boxes;

[0025] Query the attribute status of p input values ​​in sequence through the form management system;

[0026] When the attribute status of p input values ​​is in a low state, it is determined not to enter the verification mode;

[0027] When the attribute state of the input value is high, it is determined to enter the verification mode.

[0028] Furthermore, the verification features include format features, character features, and required features;

[0029] Methods for extracting format features, character features, and required features include:

[0030] The denotative semantics and the expressive semantics of the p check elements are identified by natural language processing technology, and the p check elements are split into p denotative semantic words and p expressive semantic words by word segmentation technology based on the denotative semantics and the expressive semantics.

[0031] The formats of p referential semantic words are sequentially queried through the form management system, and the referential semantic words with the same format are recorded as the first extracted words;

[0032] After combining the referential semantics in the first extracted word, a format feature is generated;

[0033] Query the character values ​​of p referential semantic words in sequence, and record the referential semantic words corresponding to the maximum character value and the minimum character value as the second extracted word and the third extracted word;

[0034] The semantics of the second extracted word and the semantics of the third extracted word are combined and the union is calculated to generate a character feature;

[0035] Query the attributes of p referential semantic words in sequence, and record the referential semantic words with required attributes as the fourth extracted words;

[0036] After combining the referential semantics in the fourth extracted word, a required feature is generated.

[0037] Furthermore, the custom validation rule is: first, verify the format feature of the validation element, second, verify the character feature of the validation element, and finally, verify the required feature of the validation element;

[0038] The methods for formulating custom validation rules include:

[0039] Constructing a check set having a first check digit, a second check digit and a third check digit in the Joi check library;

[0040] Counting the number of format features, the number of long and short features, and the number of required features one by one, and obtaining a first value, a second value, and a third value respectively;

[0041] Compare the first value, the second value and the third value, and arrange them in descending order from large to small;

[0042] importing the check features corresponding to the first value, the second value, and the third value arranged in descending order into the first check digit, the second check digit, and the third check digit in sequence;

[0043] The check sequences of the first check digit, the second check digit, and the third check digit are numbered in sequence to obtain a custom check rule.

[0044] Further, the verification status includes a correct status and an error status;

[0045] The methods for obtaining the correct state and the error state include:

[0046] Mark the m input values ​​whose attribute states are in the high state one by one, and number the m input values ​​in ascending order according to the order of marking;

[0047] Verify the m input values ​​in ascending order using custom verification rules;

[0048] When the format characteristics of the m input values ​​are inconsistent with the pre-stored standard format, the verification state is an error state;

[0049] When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, and the character characteristics of the m input values ​​are inconsistent with the pre-stored standard characters, the verification state is an error state;

[0050] When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, the character characteristics of the m input values ​​are consistent with the pre-stored standard characters, and the required characteristics of the m input values ​​are inconsistent with the pre-stored standard required fields, the verification state is an error state;

[0051] When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, the character characteristics of the m input values ​​are consistent with the pre-stored standard characters, and the required field characteristics of the m input values ​​are consistent with the pre-stored standard required fields, the verification status is a correct status;

[0052] The determination methods of whether to enter the error correction mode include:

[0053] When the verification state is a correct state, it is determined not to enter the error correction mode;

[0054] When the check state is an error state, it is determined to enter the error correction mode.

[0055] Furthermore, the method for inputting the error correction value includes:

[0056] Mark n status boxes in the verification area where the verification status of the input value is an error status, and assign numbers that are consistent with the numbers of the input values ​​to the n status boxes respectively;

[0057] After removing the input values ​​in the n status boxes, n error correction boxes are obtained;

[0058] According to the ascending order of the error correction box numbers, error correction values ​​consistent with the pre-stored standard format, pre-stored standard characters or pre-stored standard required fields are entered into the n error correction boxes in sequence.

[0059] Furthermore, the method for obtaining the error correction coefficient includes:

[0060] Verify the error correction values ​​entered in n error correction boxes using custom verification rules;

[0061] When the check states of the error correction values ​​input into the n error correction frames are all in the correct state, the total number of times the error correction values ​​are input into the n error correction frames is recorded to obtain the total error correction value;

[0062] Count the number of error correction boxes whose input times are 2 and 3 respectively, to obtain a first quantity value and a second quantity value;

[0063] Obtaining an error correction coefficient based on the first quantity value, the second quantity value, and the total error correction value;

[0064] The expression of the error correction coefficient is: The expression of the error correction coefficient is: ;

[0065] In the formula, is the error correction coefficient, is the first quantity value, is the second quantity value, is the total error correction value, is the weight factor of the first quantity value, is the weight factor of the second quantity value, is the weight factor of the total error correction value, , , Both are greater than 0.

[0066] Further, the verification presentation sheet includes a first presentation sheet and a second presentation sheet;

[0067] The method for generating the first display sheet and the second display sheet includes:

[0068] Construct a duplex bit display sheet with m original bits and m state bits;

[0069] Import the m input values ​​into the m original bits in sequence, and import the check states of the m input values ​​into the m status bits accordingly;

[0070] Record the duplex display sheet that imports m input values ​​and the verification status of the m input values ​​as the first display sheet;

[0071] Construct a four-station display sheet with n original bits, n error correction bits, n status bits, and coefficient bits;

[0072] Import the n input values ​​into the n original bits in sequence, import the n error correction values ​​into the n error correction bits accordingly, import the check states of the n error correction values ​​into the n state bits accordingly, and import the error correction coefficients into the coefficient bits;

[0073] The four-station display sheet for importing n input values, n error correction values, verification states of n error correction values, and error correction coefficients is recorded as the second display sheet.

[0074] Custom form validation control method based on asynchronous validation library, including:

[0075] S1: Receive a form verification request, mark the verification elements in the form, and divide the verification area;

[0076] S2: Get the attribute status of the input value in the verification area and determine whether to enter the verification mode; if entering the verification mode, execute S3; if not entering the verification mode, repeat S1-S2;

[0077] S3: Extract verification features from the verification elements, and formulate custom verification rules in the Joi verification library based on the verification features;

[0078] S4: Verify the input value through the custom verification rule, obtain the verification status, and determine whether to enter the error correction mode; if entering the error correction mode, execute S5-S6; if not entering the error correction mode, execute S6;

[0079] S5: after eliminating the input values ​​whose verification status is an error status, generating an error correction box, and inputting the error correction value into the error correction box;

[0080] S6: Obtain the error correction coefficient of the verification area, and generate a verification display sheet based on the error correction coefficient and the verification status.

[0081] The technical effects and advantages of the custom form verification system and control method based on the asynchronous verification library of the present invention are as follows:

[0082] The present invention receives a verification request of a form, marks the verification elements in the form, divides the verification area, obtains the attribute state of the input value in the verification area, determines whether to enter the verification mode, extracts the verification feature from the verification element, and formulates a custom verification rule in the Joi verification library based on the verification feature, verifies the input value by the custom verification rule, obtains the verification state, and determines whether to enter the error correction mode, after eliminating the input value whose verification state is an error state, generates an error correction box, inputs the error correction value into the error correction box, obtains the error correction coefficient of the verification area, and generates a verification display sheet in combination with the error correction coefficient and the verification state; compared with the prior art, the present invention can extract the verification feature from the form, obtain the verification feature, and generate a verification display sheet in combination with the error correction coefficient and the verification state; The form is accurately divided into verification areas, the verification features of the verification areas are accurately extracted, and custom verification rules are formulated based on the verification features, so that the input values ​​that have changed in the verification area can be quickly and accurately verified, avoiding the limitations of the form when it is verified under specific verification rules. Targeted verification rules can be formulated according to the characteristics of the verification area in the actual form, which improves the pertinence and applicability of the form verification. At the same time, it can also perform corresponding verification display operations on different results after verification, and concisely and accurately display the abnormal phenomena in the form, thereby providing a basis for the modification and submission of the form, and effectively improving the verification efficiency of the form. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 A schematic diagram of a custom form verification system based on an asynchronous verification library provided in Example 1 of the present invention;

[0084] Figure 2 A schematic diagram of a flow chart of a custom form verification control method based on an asynchronous verification library provided in Example 2 of the present invention;

[0085] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention;

[0086] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided in Example 4 of the present invention. DETAILED DESCRIPTION

[0087] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0088] Example 1: Please refer to Figure 1 As shown, the custom form verification system based on the asynchronous verification library described in this embodiment includes:

[0089] The form partitioning module receives the form verification request, marks the verification elements in the form, and divides the verification area;

[0090] A verification request is a request that is sent to ensure the rationality and accuracy of the data in the created form before the form is created and uploaded to the server for processing. This can guide the verification operation of the form and serve as a pre-processing step for the form verification operation.

[0091] Since the form contains many types of data and the location of the data that needs to be verified is fixed, after receiving the verification request of the form, all areas in the form need to be divided according to the area type and reference, so as to obtain the areas that need to be verified, and the areas that need to be verified are recorded as verification areas.

[0092] The verification area division methods include:

[0093] Identify i elements in the form through hypertext markup language; an element refers to a data unit constituting the form, so that the element can accurately represent the specific value in the form, and each element corresponds to an independent meaning;

[0094] The keywords of the i elements are identified one by one through natural language processing technology; keywords are phrases used to concisely and accurately express the meaning of the elements, thereby accurately referring to the true meaning of the elements;

[0095] Elements with the keywords text box, drop-down box, check box, hidden box, and upload box are recorded as verification elements, and p verification elements are obtained;

[0096] Mark the locations of p check elements in the form, and measure the distances of the p check elements from the upper end and the lower end of the form, which are recorded as upper distance values ​​and lower distance values ​​respectively;

[0097] The position of the check element corresponding to the minimum upper distance value is recorded as the first dividing point, and a horizontal auxiliary line is drawn through the first dividing point to obtain the first dividing line; by drawing the first horizontal dividing line, an auxiliary line can be provided for the upper end of the check area to ensure that the upper end of the check area can be kept flush;

[0098] The position of the check element corresponding to the minimum value of the lower distance value is recorded as the second dividing point, and a horizontal auxiliary line is drawn through the second dividing point to obtain the second dividing line; by drawing the second horizontal dividing line, an auxiliary line can be provided for the lower end of the check area, ensuring that the lower end of the check area can be kept flush, so that the check area can be kept in a rectangular structure, avoiding the phenomenon that the local position of the check area is bent and causes inconvenience in marking the check element;

[0099] The area between the first dividing line and the second dividing line in the form is recorded as the verification area;

[0100] It should be noted that since the form is usually a rectangular structure, the verification area between the first dividing line and the second dividing line is also usually a rectangular structure, and the verification area can include all verification elements, which not only ensures the comprehensiveness of the verification elements, but also eliminates the negative impact of a large number of elements not related to the verification on subsequent verification, and also improves the accuracy of the verification.

[0101] The mode determination module obtains the attribute status of the input value in the verification area and determines whether to enter the verification mode;

[0102] The attribute state is used to represent the current state of the check element in the check area, which can be used as the basis for whether the check element in the check area needs to be checked, while the input value is used to represent the actual value of the corresponding check element in the check area and serves as the basis for subsequent judgment.

[0103] The attribute state includes a low-bit state and a high-bit state; the low-bit state is used to indicate that the input value of the check element in the check area is blank, and at this time there is no element to be checked in the check area; the high-bit state is used to indicate that the input value of the check element in the check area is not blank, and at this time there is an element to be checked in the check area;

[0104] The determination methods of whether to enter the verification mode include:

[0105] Mark the p status boxes in the verification area one by one, and filter out the input values ​​in the p status boxes; the status box refers to the area in the verification area where the verification element inputs data, which is used to limit the position of the input value of the verification element;

[0106] Query the attribute status of p input values ​​in sequence through the form management system;

[0107] When the attribute status of p input values ​​is in a low state, it means that the input values ​​in the p status boxes have not changed. At this time, there is no need to verify the input values, and it is determined not to enter the verification mode.

[0108] When the attribute state of the input value is in the high state, it means that the input value in the p state boxes has changed. At this time, it is necessary to verify the input value with the change phenomenon, and it is determined to enter the verification mode;

[0109] It should be noted that when it is determined to enter the verification mode, it is necessary to verify the input value in the status box that has changed, to determine whether the change in the input value meets the custom verification rules, and then to achieve a custom verification effect on the form.

[0110] The validation rule module extracts validation features from validation elements and formulates custom validation rules in the Joi validation library based on the validation features.

[0111] Verification features refer to representations that can truly represent the specific attributes and meanings of verification elements in the verification area. They can provide concise, accurate and true representations of verification elements with unclear and complex meanings, and provide a basis for the formulation of subsequent custom verification rules.

[0112] Verification features include format features, character features, and required features; format features are used to indicate verification elements that have consistent formats in verification elements, character features are used to indicate the span range of character lengths in verification elements, and required features are used to indicate verification elements that must be filled in among verification elements;

[0113] Methods for extracting format features, character features, and required features include:

[0114] The denotative semantics and the representational semantics of the p check elements are identified by natural language processing technology. The p check elements are split into p denotative semantic words and p representational semantic words by word segmentation technology, with the denotative semantics and the representational semantics as the splitting criteria. The denotative semantics is used to represent the name of the check element, and the representational semantics is used to represent the numerical value of the check element, so that the check element can be represented by text and numerical value, so as to facilitate the subsequent rapid and accurate recognition of the check features.

[0115] The formats of p referential semantic words are sequentially queried through the form management system, and the referential semantic words with the same format are recorded as the first extracted words;

[0116] After combining the referential semantics in the first extracted word, a format feature is generated;

[0117] Query the character values ​​of p referential semantic words in sequence, and record the referential semantic words corresponding to the maximum character value and the minimum character value as the second extracted word and the third extracted word;

[0118] The semantics of the second extracted word and the semantics of the third extracted word are combined and obtained to generate a character feature; the method of obtaining the union can merge the same features in the second extracted word and the third extracted word, so that the character feature can accurately represent the second extracted word and the third extracted word, thereby improving the accuracy of the character feature;

[0119] Query the attributes of p referential semantic words in sequence, and record the referential semantic words with required attributes as the fourth extracted words;

[0120] After combining the referential semantics in the fourth extracted word, a required feature is generated.

[0121] After obtaining the format features, character features and required features, the basic conditions for formulating custom validation rules can be provided, so that custom validation rules can be accurately and reasonably formulated based on the validation features to meet the subsequent fast and accurate validation of validation elements, thereby ensuring that custom validation rules can perform targeted validation processing on validation elements, greatly improving the validation effect of the form;

[0122] The custom validation rules are: first, verify the format characteristics of the validation element, second, verify the character characteristics of the validation element, and finally, verify the required characteristics of the validation element;

[0123] The methods for formulating custom validation rules include:

[0124] A check set with the first check digit, the second check digit and the third check digit is constructed in the Joi check library; the check digit is used to specifically refer to the custom check rule, and one check digit corresponds to one check rule, so as to ensure the orderliness of the custom check rule, and the check set is a combination of check digits, which is used to represent the custom check rule as a whole;

[0125] Counting the number of format features, the number of long and short features, and the number of required features one by one, and obtaining a first value, a second value, and a third value respectively;

[0126] Compare the first value, the second value and the third value, and arrange them in descending order from large to small;

[0127] importing the check features corresponding to the first value, the second value, and the third value arranged in descending order into the first check digit, the second check digit, and the third check digit in sequence;

[0128] The check orders of the first check digit, the second check digit, and the third check digit are numbered in sequence to obtain a custom check rule;

[0129] Exemplarily, when the first check digit, the second check digit and the third check digit are numbered 1, 2, and 3 respectively, and when the check features corresponding to the first value, the second value and the third value are the format feature, the character feature and the required feature respectively, the format feature, the character feature and the required feature are imported into the check digits numbered 1, 2 and 3 respectively. At this time, the check order of the format feature is 1, the check order of the character feature is 2, and the check order of the required feature is 3. At this time, when checking the form, it is necessary to check the format feature first, then the character feature, and finally the required feature, thereby achieving the effect of custom verification and satisfying the orderly, fast and reasonable custom verification effect of the verification elements in the form.

[0130] The real-time verification module verifies the input value through custom verification rules, obtains the verification status, and determines whether to enter the error correction mode;

[0131] The verification status refers to the representation of the verification result after the input value is verified, which is used to distinguish the verification results of the input value and serve as the basis for judging whether to enter the error correction mode later;

[0132] The verification status includes a correct status and an error status; the correct status means that the verification result after the input value verification is correct, and there is no input value error phenomenon; the error status means that the verification result after the input value verification is wrong, and there is an input value error phenomenon;

[0133] The methods for obtaining the correct state and the error state include:

[0134] Mark the m input values ​​whose attribute states are in the high state one by one, and number the m input values ​​in ascending order according to the order of marking;

[0135] Verify the m input values ​​in ascending order using custom verification rules;

[0136] First, the format features of the m input values ​​are compared with the pre-stored standard formats. When the format features of the m input values ​​are inconsistent with the pre-stored standard formats, it means that the format features of the m input values ​​are wrong at this time, and the verification status of the input values ​​is an error state; the pre-stored standard format refers to the format features with a correct verification status pre-stored in the Joi verification library, which can provide a verification basis for the subsequent verification of the format features of the input values, ensuring that the format features can be accurately verified;

[0137] When the format features of the m input values ​​are consistent with the pre-stored standard format, the character features of the m input values ​​are compared with the pre-stored standard characters; the pre-stored standard characters refer to the character features of the correct state pre-stored in the Joi verification library, which can provide a verification basis for the subsequent verification of the character features of the input values, ensuring that the character features can be accurately verified;

[0138] When the character features of the m input values ​​are inconsistent with the pre-stored standard characters, it means that the character features of the m input values ​​are wrong, and the verification state of the input value is an error state;

[0139] When the format features of the m input values ​​are consistent with the pre-stored standard format, and the character features of the m input values ​​are consistent with the pre-stored standard characters, the required features of the m input values ​​are finally compared with the pre-stored standard required features; the pre-stored standard required features refer to the required features with the correct verification status pre-stored in the Joi verification library, which can provide a verification basis for the verification of the required features of the subsequent input values, ensuring that the required features can be accurately verified;

[0140] When the required features of the m input values ​​are inconsistent with the pre-stored standard required features, it means that the required features of the m input values ​​are wrong, and the verification status of the input values ​​is an error state;

[0141] When the format characteristics of m input values ​​are consistent with the pre-stored standard format, the character characteristics of the m input values ​​are consistent with the pre-stored standard characters, and the required characteristics of the m input values ​​are consistent with the pre-stored standard required characteristics, it means that there are no errors in the format characteristics, character characteristics and required characteristics of the m input values, and the verification status of the input values ​​is correct.

[0142] When the verification status of the input value is obtained, it can be determined whether it is necessary to enter the error correction mode according to the verification status, so that the form can correct the input value errors in the verification and error correction mode and provide a basis for re-entering the input value in the subsequent form;

[0143] The determination methods of whether to enter the error correction mode include:

[0144] When the verification state is correct, it means that there is no error in the input value in the verification area at this time, and no error correction processing is required for the input value, so it is determined not to enter the error correction mode;

[0145] When the verification state is an error state, it means that an error has occurred in the input value in the verification area at this time, and the input value needs to be corrected, and it is determined to enter the error correction mode.

[0146] The verification and error correction module generates an error correction frame after eliminating the input value whose verification status is an error status, and inputs the error correction value into the error correction frame;

[0147] The error correction box refers to the state box that is left after the input values ​​in the verification area with the verification status in the error state are eliminated. When the input value is eliminated, the state box corresponding to the input value is in an idle state. Then, the corresponding data can be re-entered into the idle state box so that the input values ​​in the verification area can be fully filled;

[0148] The error correction value refers to the data re-entered into the error correction box after the input value in the error state of the verification status is eliminated, which can be used as a replacement value for the input value;

[0149] The error correction value input methods include:

[0150] Mark n status boxes in the verification area where the verification status of the input value is an error status, and assign numbers that are consistent with the numbers of the input values ​​to the n status boxes respectively;

[0151] After removing the input values ​​in the n status boxes, n error correction boxes are obtained; the error correction box is used to indicate the position where the error correction value is input, that is, to provide a true and accurate input position for the error correction value, ensuring that the error correction value can be quickly and accurately input to the correct position;

[0152] Entering error correction values ​​that are consistent with pre-stored standard formats, pre-stored standard characters, or pre-stored standard mandatory fields into n error correction boxes in ascending order of the error correction box numbers;

[0153] It should be noted that since the generation of the error correction value is affected by the inspection status, the error correction value will change when it is input due to the difference between the pre-stored standard format, pre-stored standard characters or pre-stored standard required fields. When the required field characteristics of the eliminated input value are inconsistent with the pre-stored standard required fields, the error correction value entered at this time only needs to be consistent with the pre-stored standard required fields, that is, the error correction value only needs to be entered once to meet the demand. Conversely, when the format characteristics of the eliminated input value are inconsistent with the pre-stored standard format, the error correction value entered at this time may need to be entered once, twice or three times, so that the number of times the error correction value is entered will vary depending on the specific verification position of the error status.

[0154] The verification display module obtains the error correction coefficient of the verification area and generates a verification display sheet based on the error correction coefficient and the verification status;

[0155] The error correction coefficient refers to the error correction difficulty of the input value that can enter the error correction mode of the verification area, and is used to represent the number of inputs of the error correction value. Different input times will correspond to different error correction difficulties, and ultimately affect the subsequent verification display sheet;

[0156] Since the number of input times of the error correction value varies with the occurrence position of the error state, the number of input times also varies, including once, twice and three times. When the number of input times is larger, the error correction coefficient is larger;

[0157] The methods for obtaining the error correction coefficient include:

[0158] Verify the error correction values ​​entered in n error correction boxes using custom verification rules;

[0159] When the check states of the error correction values ​​input into the n error correction frames are all in the correct state, the total number of times the error correction values ​​are input into the n error correction frames is recorded to obtain the total error correction value;

[0160] Count the number of error correction boxes whose input times are 2 and 3 respectively, to obtain a first quantity value and a second quantity value;

[0161] Obtaining an error correction coefficient based on the first quantity value, the second quantity value, and the total error correction value;

[0162] The expression of the error correction coefficient is: ;

[0163] In the formula, is the error correction coefficient, is the first quantity value, is the second quantity value, is the total error correction value, is the weight factor of the first quantity value, is the weight factor of the second quantity value, is the weight factor of the total error correction value, , , All are greater than 0;

[0164] in, For example, is 0.32, is 0.27, is 0.41;

[0165] It should be noted that the size of the weight factor is a specific numerical value obtained by quantifying each data to facilitate subsequent comparison. The size of the weight factor depends on the first quantity value, the second quantity value and the total error correction value, and the technical personnel in this field initially set the corresponding weight factor for each group of first quantity values, second quantity values ​​and total error correction values.

[0166] The verification display sheet is used to display the results of the verification and error correction of the verification area in the form, so as to comprehensively display the correct input values ​​in the verification area in the form, and then the verification results of the form can be intuitively and accurately understood through the verification display sheet;

[0167] The verification display sheet includes a first display sheet and a second display sheet; the first display sheet is used to verify and display the form that does not enter the error correction mode, and the second display sheet is used to verify and display the form that enters the error correction mode;

[0168] The method for generating the first display sheet and the second display sheet includes:

[0169] When the error correction mode is not entered, a dual-station display sheet with m original bits and m status bits is constructed; the dual-station display sheet refers to a display sheet that can provide an import station for the input value and the verification status when the error correction mode is not entered, thereby meeting the generation requirements of the first display sheet;

[0170] Import the m input values ​​into the m original bits in sequence, and import the check states of the m input values ​​into the m status bits accordingly;

[0171] Record the duplex display sheet that imports m input values ​​and the verification status of the m input values ​​as the first display sheet;

[0172] When entering the error correction mode, a four-station display sheet with n original bits, n error correction bits, n status bits and coefficient bits is constructed; the four-station display sheet refers to a display sheet that can provide an import station for the input value, error correction value, check status and error correction coefficient when entering the error correction mode, thereby meeting the generation requirements of the second display sheet;

[0173] Import the n input values ​​into the n original bits in sequence, import the n error correction values ​​into the n error correction bits accordingly, import the check states of the n error correction values ​​into the n state bits accordingly, and import the error correction coefficients into the coefficient bits;

[0174] Recording a four-station display sheet that imports n input values, n error correction values, verification states of n error correction values, and error correction coefficients as a second display sheet;

[0175] It should be noted that the first display sheet is only used to display the verification results of the form without entering the error correction mode, realizing one of the verification display effects of the form, and the second display sheet is only used to display the verification results of the form in the error correction mode, realizing another verification display effect of the form, thereby satisfying the adaptive display effects of two different verification results.

[0176] In this embodiment, by receiving a verification request of a form, marking the verification elements in the form, and dividing the verification area, obtaining the attribute status of the input value in the verification area, and determining whether to enter the verification mode, extracting the verification feature from the verification element, and based on the verification feature, formulating a custom verification rule in the Joi verification library, verifying the input value through the custom verification rule, obtaining the verification status, and determining whether to enter the error correction mode, after eliminating the input value whose verification status is an error state, generating an error correction box, and inputting the error correction value into the error correction box, obtaining the error correction coefficient of the verification area, and combining the error correction coefficient and the verification status to generate a verification display sheet; compared with the prior art, it is possible to The form is accurately divided into verification areas, the verification features of the verification areas are accurately extracted, and custom verification rules are formulated based on the verification features, so that the input values ​​that have changed in the verification area can be quickly and accurately verified, avoiding the limitations of the form when it is verified under specific verification rules. Targeted verification rules can be formulated according to the characteristics of the verification area in the actual form, improving the pertinence and applicability of the form verification. At the same time, it can also perform corresponding verification display operations on different results after verification, and concisely and accurately display the abnormal phenomena in the form, thereby providing a basis for the modification and submission of the form, and effectively improving the verification efficiency of the form.

[0177] Example 2: Please refer to Figure 2 As shown, the part not described in detail in this embodiment is described in Example 1, and a custom form verification control method based on an asynchronous verification library is provided, which is used in a custom form verification system based on an asynchronous verification library, including:

[0178] S1: Receive a form verification request, mark the verification elements in the form, and divide the verification area;

[0179] S2: Get the attribute status of the input value in the verification area and determine whether to enter the verification mode; if entering the verification mode, execute S3; if not entering the verification mode, repeat S1-S2;

[0180] S3: Extract verification features from the verification elements, and formulate custom verification rules in the Joi verification library based on the verification features;

[0181] S4: Verify the input value through the custom verification rule, obtain the verification status, and determine whether to enter the error correction mode; if entering the error correction mode, execute S5-S6; if not entering the error correction mode, execute S6;

[0182] S5: after eliminating the input values ​​whose verification status is an error status, generating an error correction box, and inputting the error correction value into the error correction box;

[0183] S6: Obtain the error correction coefficient of the verification area, and generate a verification display sheet based on the error correction coefficient and the verification status.

[0184] Example 3: Please refer to Figure 3 As shown, this embodiment discloses an electronic device, including a processor and a memory;

[0185] Wherein, the memory stores a computer program that can be called by the processor;

[0186] The processor executes the custom form verification control method based on the asynchronous verification library by calling the computer program stored in the memory.

[0187] Since the electronic device introduced in this embodiment is an electronic device used to implement the custom form verification control method based on the asynchronous verification library in Example 2 of this application, based on the custom form verification control method based on the asynchronous verification library introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as the technical personnel of this field implement the electronic device used by the custom form verification control method based on the asynchronous verification library in the embodiment of this application, it belongs to the scope of protection of this application.

[0188] Example 4: Please refer to Figure 4 As shown, this embodiment discloses a computer-readable storage medium on which a rewritable computer program is stored;

[0189] When the computer program is run, the custom form verification control method based on the asynchronous verification library is implemented.

[0190] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A custom form verification system based on an asynchronous verification library, characterized in that: include: The form partitioning module is used to receive the form verification request, mark the verification elements in the form, and divide the verification area; A mode determination module is used to obtain the attribute status of the input value in the verification area and determine whether to enter the verification mode; The validation rule module is used to extract validation features from validation elements and formulate custom validation rules in the Joi validation library based on the validation features. Verification features include format features, character features, and required features; Methods for extracting format features, character features, and required features include: The denotative semantics and the expressive semantics of the p check elements are identified by natural language processing technology, and the p check elements are split into p denotative semantic words and p expressive semantic words by word segmentation technology based on the denotative semantics and the expressive semantics. The formats of p referential semantic words are sequentially queried through the form management system, and the referential semantic words with the same format are recorded as the first extracted words; After combining the referential semantics in the first extracted word, a format feature is generated; Query the character values ​​of p referential semantic words in sequence, and record the referential semantic words corresponding to the maximum character value and the minimum character value as the second extracted word and the third extracted word; The semantics of the second extracted word and the semantics of the third extracted word are combined and the union is calculated to generate a character feature; Query the attributes of p referential semantic words in sequence, and record the referential semantic words with required attributes as the fourth extracted words; After combining the referential semantics in the fourth extracted word, a required feature is generated; The custom validation rules are: first, verify the format characteristics of the validation element, second, verify the character characteristics of the validation element, and finally, verify the required characteristics of the validation element; The methods for formulating custom validation rules include: Constructing a check set having a first check digit, a second check digit and a third check digit in the Joi check library; Counting the number of format features, the number of long and short features, and the number of required features one by one, and obtaining a first value, a second value, and a third value respectively; Compare the first value, the second value and the third value, and arrange them in descending order from large to small; importing the check features corresponding to the first value, the second value, and the third value arranged in descending order into the first check digit, the second check digit, and the third check digit in sequence; The check orders of the first check digit, the second check digit, and the third check digit are numbered in sequence to obtain a custom check rule; The real-time verification module is used to verify the input value through custom verification rules, obtain the verification status, and determine whether to enter the error correction mode; A verification and error correction module, used to generate an error correction frame after eliminating input values ​​whose verification status is an error state, and input an error correction value into the error correction frame; The verification display module is used to obtain the error correction coefficient of the verification area and generate a verification display sheet based on the error correction coefficient and the verification status.

2. The custom form verification system based on the asynchronous verification library according to claim 1 is characterized in that: The method for dividing the verification area includes: Identify i elements in the form through Hypertext Markup Language; Identify the keywords of i elements one by one through natural language processing technology; Elements with the keywords text box, drop-down box, check box, hidden box, and upload box are recorded as verification elements, and p verification elements are obtained; Mark the locations of p check elements in the form, and measure the distances of the p check elements from the upper end and the lower end of the form, which are recorded as upper distance values ​​and lower distance values ​​respectively; The position of the check element corresponding to the minimum upper distance value is recorded as the first dividing point, and a horizontal auxiliary line is drawn through the first dividing point to obtain the first dividing line; The position of the check element corresponding to the minimum value of the lower distance value is recorded as the second dividing point, and a horizontal auxiliary line is drawn through the second dividing point to obtain a second dividing line; The area between the first dividing line and the second dividing line in the form is recorded as the verification area.

3. The custom form verification system based on the asynchronous verification library according to claim 2 is characterized in that: The attribute state includes a low state and a high state; The determination methods of whether to enter the verification mode include: Mark the p status boxes in the verification area one by one, and filter out the input values ​​in the p status boxes; Query the attribute status of p input values ​​in sequence through the form management system; When the attribute status of p input values ​​is in a low state, it is determined not to enter the verification mode; When the attribute state of the input value is high, it is determined to enter the verification mode.

4. The custom form verification system based on asynchronous verification library according to claim 3 is characterized in that: The verification status includes a correct status and an error status; The methods for obtaining the correct state and the error state include: Mark the m input values ​​whose attribute states are in the high state one by one, and number the m input values ​​in ascending order according to the order of marking; Verify the m input values ​​in ascending order using custom verification rules; When the format characteristics of the m input values ​​are inconsistent with the pre-stored standard format, the verification state is an error state; When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, and the character characteristics of the m input values ​​are inconsistent with the pre-stored standard characters, the verification state is an error state; When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, the character characteristics of the m input values ​​are consistent with the pre-stored standard characters, and the required characteristics of the m input values ​​are inconsistent with the pre-stored standard required fields, the verification state is an error state; When the format characteristics of the m input values ​​are consistent with the pre-stored standard format, the character characteristics of the m input values ​​are consistent with the pre-stored standard characters, and the required field characteristics of the m input values ​​are consistent with the pre-stored standard required fields, the verification status is a correct status; The determination methods of whether to enter the error correction mode include: When the verification state is a correct state, it is determined not to enter the error correction mode; When the check state is an error state, it is determined to enter the error correction mode.

5. The custom form verification system based on asynchronous verification library according to claim 4 is characterized in that: The method for inputting the error correction value comprises: Mark n status boxes in the verification area where the verification status of the input value is an error status, and assign numbers that are consistent with the numbers of the input values ​​to the n status boxes respectively; After removing the input values ​​in the n status boxes, n error correction boxes are obtained; According to the ascending order of the error correction box numbers, error correction values ​​consistent with the pre-stored standard format, pre-stored standard characters or pre-stored standard required fields are entered into the n error correction boxes in sequence.

6. The custom form verification system based on asynchronous verification library according to claim 5 is characterized in that: The method for obtaining the error correction coefficient includes: Verify the error correction values ​​entered in n error correction boxes using custom verification rules; When the check states of the error correction values ​​input into the n error correction frames are all in the correct state, the total number of times the error correction values ​​are input into the n error correction frames is recorded to obtain the total error correction value; Count the number of error correction boxes whose input times are 2 and 3 respectively, to obtain a first quantity value and a second quantity value; Obtaining an error correction coefficient based on the first quantity value, the second quantity value, and the total error correction value; The expression of the error correction coefficient is: ; In the formula, is the error correction coefficient, is the first quantity value, is the second quantity value, is the total error correction value, is the weight factor of the first quantity value, is the weight factor of the second quantity value, is the weight factor of the total error correction value, , , Both are greater than 0.

7. The custom form verification system based on asynchronous verification library according to claim 6 is characterized in that: The verification presentation sheet includes a first presentation sheet and a second presentation sheet; The method for generating the first display sheet and the second display sheet includes: Construct a duplex bit display sheet with m original bits and m state bits; Import the m input values ​​into the m original bits in sequence, and import the check states of the m input values ​​into the m status bits accordingly; Record the duplex display sheet that imports m input values ​​and the verification status of the m input values ​​as the first display sheet; Construct a four-station display sheet with n original bits, n error correction bits, n status bits, and coefficient bits; Import the n input values ​​into the n original bits in sequence, import the n error correction values ​​into the n error correction bits accordingly, import the check states of the n error correction values ​​into the n state bits accordingly, and import the error correction coefficients into the coefficient bits; The four-station display sheet for importing n input values, n error correction values, verification states of n error correction values, and error correction coefficients is recorded as the second display sheet.

8. A custom form verification control method based on an asynchronous verification library, used to implement a custom form verification system based on an asynchronous verification library as described in any one of claims 1 to 7, characterized in that: include: S1: Receive a form verification request, mark the verification elements in the form, and divide the verification area; S2: Obtain the attribute status of the input value in the verification area and determine whether to enter the verification mode; If the verification mode is entered, execute S3; if the verification mode is not entered, repeat S1-S2; S3: Extract verification features from the verification elements, and formulate custom verification rules in the Joi verification library based on the verification features; S4: Verify the input value through the custom verification rule, obtain the verification status, and determine whether to enter the error correction mode; if entering the error correction mode, execute S5-S6; if not entering the error correction mode, execute S6; S5: after eliminating the input values ​​whose verification status is an error status, generating an error correction box, and inputting the error correction value into the error correction box; S6: Obtain the error correction coefficient of the verification area, and generate a verification display sheet based on the error correction coefficient and the verification status.

Citation Information

Patent Citations

  • A Vue.js-based form verification method and system

    CN106990952A

  • Dynamic form verification method and device based on dynamic attributes and medium

    CN117708142A