Data checking method and device, computer storage medium and electronic equipment
By creating a visual page on the front end to configure validation rules and generate a JSON Schema configuration file, the back end server performs a second validation, which solves the problem of inconsistent front end and back end validation and achieves efficient data validation and rule updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, the independent writing of front-end and back-end validation rules leads to inconsistent validation results. Adding new rules requires separate development on the front-end and back-end, resulting in a large workload and low efficiency.
By creating a visual page on the front end to configure validation rules, a validation configuration file in JSON Schema format is generated. The backend server uses this file to perform validation again, ensuring consistency between front-end and back-end validation. Update rules can also be easily configured in the visual page.
It achieves consistency between front-end and back-end validation results, reduces the amount of code developers need to write, lowers the complexity of rule updates, and improves data validation efficiency.
Smart Images

Figure CN115016978B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data verification method, a data verification device, a computer storage medium, and an electronic device. Background Technology
[0002] Typically, form validation involves two steps. First, after a user enters a piece of data, the front-end performs real-time validation and displays the results, allowing users to quickly and accurately enter data. Second, after the form is submitted to the back-end server, the back-end server needs to validate the data again to ensure its accuracy.
[0003] Currently, validation rules for the front-end and back-end are generally written separately and independently. For example, the front-end uses JS (JavaScript) methods for validation, while the back-end server uses a specific back-end server language for validation. Therefore, when creating or modifying a validation rule, the code for both the front-end and back-end must be modified simultaneously, resulting in high business complexity.
[0004] Therefore, there is an urgent need in this field to develop a new data verification method and apparatus.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure. Summary of the Invention
[0006] The purpose of this disclosure is to provide a data verification method, a data verification device, a computer storage medium, and an electronic device, thereby overcoming, to at least a certain extent, the problem of high complexity in updating verification rules caused by independent front-end and back-end verification.
[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0008] According to a first aspect of this disclosure, a data verification method is provided, comprising: in response to a page retrieval request, sending a pre-stored visualization page and verification rules to a front-end, so that the front-end displays the visualization page and verifies data input by a user through the visualization page based on the verification rules; after receiving target data that has passed verification by the front-end, re-verifying the target data using a verification configuration file; the verification configuration file being generated based on the verification rules; and in response to the re-verification passing, importing the target data into a database.
[0009] In an exemplary embodiment of this disclosure, the verification configuration file is obtained by: receiving verification rules for each field configured through the visualization page; aggregating the verification rules corresponding to each field to obtain a verification configuration corresponding to each field; and aggregating the verification configurations corresponding to multiple fields to obtain the verification configuration file.
[0010] In an exemplary embodiment of this disclosure, the verification rule is in JSON format; the verification configuration file is in JSONSchema format.
[0011] In an exemplary embodiment of this disclosure, re-validating the target data using a validation configuration file includes: converting the target data into JSON format; traversing each field of the target data and matching the target validation rule corresponding to each field from the validation configuration file; re-validating each field using each target validation rule to obtain a validation result for each field; and determining the validation result of the target data based on the validation results of the multiple fields.
[0012] In an exemplary embodiment of this disclosure, determining the verification result of the target data based on the verification results of the plurality of fields includes: determining that the target data verification has failed in response to any field among the plurality of fields failing verification.
[0013] In an exemplary embodiment of this disclosure, determining the verification result of the target data based on the verification results of the plurality of fields includes: determining that the target data has passed verification in response to all of the plurality of fields passing verification.
[0014] In an exemplary embodiment of this disclosure, importing the target data into the database in response to the successful re-verification includes: encrypting the target data in response to the successful re-verification; and importing the encrypted target data into the database.
[0015] According to a second aspect of this disclosure, a data verification apparatus is provided, comprising: a front-end verification module, configured to, in response to a page retrieval request, send a pre-stored visualization page and verification rules to a front-end, so that the front-end displays the visualization page and verifies data input by a user through the visualization page based on the verification rules; a back-end verification module, configured to, after receiving target data that has passed the front-end verification, re-verify the target data using a verification configuration file; the verification configuration file is generated based on the verification rules; and a data import module, configured to, in response to the re-verification passing, import the target data into a database.
[0016] According to a third aspect of this disclosure, a computer storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the data verification method described in the first aspect above.
[0017] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the data verification method described in the first aspect by executing the executable instructions.
[0018] As can be seen from the above technical solutions, the data verification method, data verification device, computer storage medium, and electronic device in the exemplary embodiments of this disclosure have at least the following advantages and positive effects:
[0019] In some embodiments of this disclosure, in response to a page retrieval request, a pre-stored visualization page and verification rules are sent to the front end, enabling the front end to display the visualization page and verify the data input by the user through the visualization page based on the verification rules. After receiving the target data that has passed the front end's verification, the target data is verified again using a verification configuration file; the verification configuration file is generated based on the verification rules; in response to the second successful verification, the target data is imported into the database. On one hand, this ensures the reuse of verification rules, solving the technical problem in related technologies where separate verification by front-end and back-end servers leads to inconsistent verification results and easily results in erroneous data being entered into the database, ensuring consistency of verification results between the front-end and back-end servers and improving the accuracy of the data entered into the database. On the other hand, when new verification rules need to be added, this disclosure only requires simple configuration on the visualization page to update the verification rules for both the front-end and back-end servers, eliminating the need for developers to write code separately on the front-end and back-end servers, reducing the amount of code developers need to write, lowering the complexity of rule updates, and improving data verification efficiency.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0022] Figure 1 A flowchart illustrating the data verification method in an embodiment of this disclosure is shown;
[0023] Figure 2 This illustration shows a flowchart of the process of pre-creating a visual page and configuring verification rules in an embodiment of this disclosure;
[0024] Figure 3 This illustration shows a flowchart of a process for re-verifying target data based on a verification configuration file in an embodiment of this disclosure.
[0025] Figure 4 This diagram illustrates the flowchart for determining the verification result of target data in an embodiment of this disclosure.
[0026] Figure 5 This diagram illustrates the overall flow of the data verification method in an embodiment of this disclosure.
[0027] Figure 6 This diagram illustrates the structure of the data verification device in an exemplary embodiment of the present disclosure.
[0028] Figure 7 A schematic diagram of the structure of an electronic device in an exemplary embodiment of this disclosure is shown. Detailed Implementation
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0030] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0031] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0032] Currently, the most common front-end and back-end validation solutions used in software development are independent front-end and back-end validation, that is, the front-end uses JS (JavaScript) for validation, and the back-end server uses a specific back-end server language (e.g., Java) for validation, with no correlation between the two.
[0033] Therefore, the above solution has the following drawbacks:
[0034] First, it cannot guarantee the consistency of front-end and back-end validation results, which can easily lead to erroneous data being entered into the database and affect business operations;
[0035] Secondly, adding new validation rules requires separate functional development for both the front-end and back-end, which is labor-intensive and inefficient.
[0036] In the embodiments of this disclosure, a data verification method is first provided, which at least to some extent overcomes the drawback of high complexity in updating verification rules caused by independent front-end and back-end verification.
[0037] Figure 1 The diagram shows a flowchart of a data verification method in an embodiment of this disclosure. The execution subject of this data verification method can be a backend server that verifies the data.
[0038] refer to Figure 1 A data verification method according to an embodiment of the present disclosure includes the following steps:
[0039] Step S110: In response to the page retrieval request, the pre-stored visualization page and validation rules are sent to the front end so that the front end can display the visualization page and validate the data entered by the user through the visualization page based on the validation rules.
[0040] Step S120: After receiving the target data that has passed the front-end verification, the target data is verified again using the verification configuration file; the verification configuration file is generated according to the verification rules.
[0041] In step S130, in response to the successful verification again, the target data is imported into the database.
[0042] exist Figure 1In the technical solution provided by the illustrated embodiment, in response to a page retrieval request, a pre-stored visualization page and verification rules are sent to the front end, enabling the front end to display the visualization page and verify the data input by the user through the visualization page based on the verification rules. After receiving the target data that has passed the front end verification, the target data is verified again using a verification configuration file; the verification configuration file is generated according to the verification rules. In response to the second successful verification, the target data is imported into the database. On the one hand, this ensures the reuse of verification rules, solving the technical problem in related technologies where separate verification by front-end and back-end servers leads to inconsistent verification results and easily results in erroneous data being entered into the database, ensuring the consistency of verification results between the front-end and back-end servers and improving the accuracy of the data entered into the database. On the other hand, when new verification rules need to be added, this disclosure only requires simple configuration in the visualization page to update the verification rules of the front-end and back-end servers, eliminating the need for developers to write code separately on the front-end and back-end servers, reducing the amount of code written by developers, lowering the complexity of rule updates, and improving data verification efficiency.
[0043] The following are Figure 1 The specific implementation process of each step in the process will be explained in detail:
[0044] Before step S110, it should be noted that developers can pre-create a visual interface on the front end. The purpose of this visual page is to allow developers to configure, quickly add and modify the validation rules for each field. When the page is output to the user, the user can enter data on the visual page.
[0045] Specifically, a visual page can be pre-created on the front end using a page editor based on the Vue framework. During the creation of the visual page, different styles of page components (e.g., icons, buttons) can be customized according to business needs to enhance its appeal. Vue is a progressive JavaScript framework for building user interfaces. Unlike other large frameworks, Vue is designed to be used layer by layer from the bottom up. Vue's core library focuses only on the view layer, making it easy to learn and integrate with third-party libraries or existing projects.
[0046] After creating the visualization page, you can sort out the various business fields and configure the corresponding validation rules for each business field in the visualization page according to the validation requirements of different business fields. For example, each business field can correspond to multiple validation rules, which can be set according to the actual situation. This disclosure does not make any special restrictions on this.
[0047] For example, taking the "tax rate" field (which represents the tax rate or amount levied on the taxable object) as an example, its validation rules can include one or more of the following: non-empty validation rules (i.e., checking whether the field value is empty), length validation rules (i.e., checking whether the length of the field value meets the specified length range), data type validation rules (i.e., checking whether the field value meets the specified data type, such as integer or decimal), date validation rules (i.e., checking whether the field value is valid data within a specified time period, whether it has expired, etc.), regular expression rules (i.e., using configured regular expressions to verify whether the field value is valid), and association validation rules (i.e., checking the association between different field values, such as whether it is greater than the field value of a certain field), etc., which can be set according to the actual situation. This disclosure does not impose any special limitations on this.
[0048] After configuring the validation rules for each field, the visualization page and the validation rules for each field can be submitted in JSON format to be saved to the backend server. JSON (JavaScript Object Notation) is a lightweight data-interchange format based on a subset of ECMAScript. JSON uses a completely language-independent text format, but also employs conventions similar to the C language. These characteristics make JSON an ideal data exchange language, easy for humans to read and write, and also easy for machines to parse and generate, improving network transmission speed.
[0049] Then, the backend server can receive the validation rules for each field configured through the visual page, aggregate the validation rules corresponding to each field to obtain the validation configuration for each field, and then aggregate the validation configurations corresponding to multiple fields to obtain a validation configuration file in JSON Schema format.
[0050] Specifically, the backend server can use JsonSchema.net (a tool that automatically generates JSON schema from JSON data) to convert the JSON format validation rules into a JSON schema format validation configuration file, and store it in a database (also known as a data management system, which is a collection of data that is processed and stored together in a certain way, allowing multiple users to share it and minimizing redundancy; in short, it can be regarded as an electronic filing cabinet) or a cache (a cache is a storage device that can perform high-speed data exchange, exchanging data with the processor before memory, so the speed is very fast) for use in subsequent validation processes.
[0051] JSONschema is a special set of JSON terms, and it is itself a JSON format. JSONSchema is generally used to validate JSON data format before data is submitted to the business layer.
[0052] By pre-configuring the visualization page, in the event of subsequent business changes (e.g., the need to add new validation rules or delete existing validation rules), developers can directly add or delete validation rules through simple interactive operations on the visualization page. After the operation is completed, they can submit and save it. Then, the backend server can convert the received validation rules into a JSONSchema format validation configuration file and save it for later use.
[0053] As can be seen, compared with the existing technology that requires developers to spend a lot of time modifying the front-end code and back-end server code and restarting the server to update the verification rules, this disclosure can reduce the cost of updating verification rules, reduce the amount of code developers need to write, improve the efficiency of updating verification rules, and reduce development costs.
[0054] For example, refer to Figure 2 , Figure 2 This diagram illustrates the process of pre-creating a visualization page and configuring verification rules in an embodiment of this disclosure, including steps S201-S208:
[0055] In step S201, begin;
[0056] In step S202, a visualization page is created on the front end;
[0057] In step S203, the validation rules for each business field are configured on the visualization page;
[0058] In step S204, submit and save at the front end;
[0059] In step S205, the backend server saves the visualization page and extracts the verification rules from it;
[0060] In step S206, the backend server parses the verification rules to convert them into a verification configuration file;
[0061] In step S207, the backend server saves the verification configuration file for use in subsequent verification processes;
[0062] In step S208, the process ends.
[0063] Next, refer to Figure 1In step S110, in response to the page retrieval request, the pre-stored visualization page and validation rules are sent to the front end so that the front end can display the visualization page and validate the data entered by the user through the visualization page based on the validation rules.
[0064] In this step, when a user needs to input form data, the front-end can send a page retrieval request to the back-end server. Then, the back-end server can send the pre-stored visualization page and validation rules to the front-end. Subsequently, the Vue engine can render the visualization page to display it on the front-end.
[0065] Furthermore, users can manually enter data on the aforementioned visualization page. After the user completes the data input and clicks the submit button, the front-end can validate the user's input data using the aforementioned validation rules. If the front-end validation fails, the data can be discarded, and the reason for the validation failure can be returned to the user, allowing the user to modify the data and resubmit it. If the front-end validation passes, the data can be submitted to the back-end server for further validation.
[0066] The purpose of front-end validation is to ensure the correctness of user interactions while also ensuring security. Front-end validation can filter out invalid data, allowing users to quickly correct their data, reducing server load, saving bandwidth, and providing a user-friendly experience. For example, if a phone number or email address is invalid, or a password is too weak, front-end validation can directly notify the user of the invalidity without waiting for a response from the back-end server, allowing the user to be aware and change their password promptly, avoiding unnecessary submissions and waiting for the server to return error information.
[0067] In step S120, after receiving the target data that has passed the front-end verification, the target data is verified again using the verification configuration file.
[0068] In this step, after obtaining the target data, the backend server can use the verification configuration file to perform a second verification of the target data. For details, please refer to... Figure 3 , Figure 3 This illustration shows a flowchart of the process for re-verifying target data according to the verification configuration file in an embodiment of this disclosure, including steps S301-S304:
[0069] In step S301, the target data is converted into JSON format.
[0070] In this step, the target data can be converted into JSON format first.
[0071] In step S302, each field of the target data is traversed, and the target validation rule corresponding to each field is matched from the validation configuration file.
[0072] In this step, since different fields correspond to different validation rules, and the validation configuration file is a file obtained by aggregating validation rules, it contains multiple validation rules. Therefore, we can iterate through each field of the target data and find the target validation rule corresponding to each field from the validation configuration file.
[0073] In step S303, each field is re-verified using the target verification rules to obtain the verification result for each field.
[0074] In this step, each field can be re-validated using the target validation rules to obtain the validation result for each field. This step is repeated until the validation results for all the fields are obtained.
[0075] It should be noted that if a validation rule for a certain field is not found in the validation configuration file, the validation process for that field can be omitted, and it will be assumed that the validation is passed.
[0076] In step S304, the verification result of the target data is determined based on the verification results of multiple fields.
[0077] In this step, refer to Figure 4 , Figure 4 This diagram illustrates the flowchart for determining the verification result of target data in an embodiment of this disclosure, including steps S401-S402:
[0078] In step S401, in response to the failure of validation of any of the multiple fields, it is determined that the target data validation has failed.
[0079] In this step, if any field in the target data fails validation, the validation result of the target data can be determined as a validation failure.
[0080] In step S402, in response to the fact that multiple fields have passed the verification, it is determined that the target data has passed the verification.
[0081] In this step, if all fields corresponding to the target data pass the verification, then the verification result of the target data can be determined as passed.
[0082] Next, refer to Figure 1 In step S130, in response to the successful verification again, the target data is imported into the database.
[0083] In an exemplary embodiment of this disclosure, after the backend server verifies the target data, the target data can be saved to the database in the form of a Map array (key-value).
[0084] A Map (also known as a dictionary or associative array) is used to store data with mapping relationships. It stores two sets of values: key and value. These two sets of values can be any type of data used in the application. The key refers to the keyword, such as an element's attribute. The value refers to the key-value pair, such as the element's attribute value. Key-value distributed storage systems offer fast query speeds, large data storage capacity, and support for high concurrency, making them suitable for queries based on primary keys.
[0085] In one optional implementation, after the above-mentioned verification passes again, the target data can be encrypted. For example, a hash algorithm, a symmetric encryption algorithm, or an asymmetric encryption algorithm can be used to encrypt the target data, and the encrypted target data can be imported into the database to ensure data security.
[0086] The purpose of backend server verification is to ensure security and the correctness of business logic, and to ensure that data has not been hijacked or tampered with. Backend server verification can prevent unauthorized API calls that could corrupt the database structure, avoid sending dirty data to the backend server through illegal means (such as directly simulating browser behavior), and guarantee the accuracy of the final data entered into the database.
[0087] refer to Figure 5 , Figure 5 This diagram shows the overall flowchart of the data verification method in this embodiment, including steps S501-S510:
[0088] In step S501, begin;
[0089] In step S502, the front end sends a page retrieval request (i.e., trigger operation), and the back end server retrieves the pre-stored visualization page and verification rules and returns them to the front end;
[0090] In step S503, the front end renders and displays the visualization page;
[0091] In step S504, the user enters data on the page;
[0092] In step S505, the front end verifies the data;
[0093] In step S506, it is determined whether the front-end verification has passed;
[0094] If the verification passes, proceed to step S507, where the backend server verifies the data; otherwise, proceed to step S510 and end.
[0095] In step S508, it is determined whether the backend server has passed the verification;
[0096] If the verification passes, proceed to step S509 to save the data; otherwise, proceed to step S510 to end.
[0097] Based on the above technical solutions, this disclosure not only solves the technical problem in related technologies where independent front-end and back-end validation leads to inconsistent validation results and erroneous data entry, but also ensures consistency of validation results and improves the accuracy of data entering the database. Furthermore, when new validation rules need to be added, it eliminates the need to develop corresponding functions for both the front-end and back-end, reducing development workload and improving development efficiency.
[0098] This disclosure also provides a data verification device. Figure 6 This diagram illustrates the structure of a data verification device in an exemplary embodiment of this disclosure; as shown below. Figure 6 As shown, the data verification device 600 may include a front-end verification module 610, a back-end verification module 620, and a data entry module 630. Wherein:
[0099] The front-end validation module 610 is used to respond to a page retrieval request by sending a pre-stored visualization page and validation rules to the front-end, so that the front-end displays the visualization page and validates the data entered by the user through the visualization page based on the validation rules.
[0100] The backend verification module 620 is used to re-verify the target data after receiving the target data that has passed the frontend verification, using a verification configuration file; the verification configuration file is generated based on the verification rules.
[0101] The data import module 630 is used to import the target data into the database in response to the successful re-verification.
[0102] In an exemplary embodiment of this disclosure, the verification configuration file is obtained by: receiving verification rules for each field configured through the visualization page; aggregating the verification rules corresponding to each field to obtain a verification configuration corresponding to each field; and aggregating the verification configurations corresponding to multiple fields to obtain the verification configuration file.
[0103] In an exemplary embodiment of this disclosure, the verification rule is in JSON format; the verification configuration file is in JSONSchema format.
[0104] In an exemplary embodiment of this disclosure, the backend verification module 620 is configured as follows:
[0105] The target data is converted into JSON format; each field of the target data is traversed, and the target validation rule corresponding to each field is matched from the validation configuration file; each field is validated again using each target validation rule to obtain the validation result of each field; based on the validation results of the multiple fields, the validation result of the target data is determined.
[0106] In an exemplary embodiment of this disclosure, the backend verification module 620 is configured as follows:
[0107] In response to the failure of validation of any of the plurality of fields, it is determined that the target data validation has failed.
[0108] In an exemplary embodiment of this disclosure, the backend verification module 620 is configured as follows:
[0109] If all of the aforementioned fields pass validation, the target data is determined to have passed validation.
[0110] In an exemplary embodiment of this disclosure, the data import module 630 is configured as follows:
[0111] In response to the successful verification, the target data is encrypted; the encrypted target data is then imported into the database.
[0112] The specific details of each module in the above data verification device have been described in detail in the corresponding data verification methods, so they will not be repeated here.
[0113] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0114] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0115] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0116] This application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device.
[0117] Computer-readable storage media can be, for example—but not limited to—electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0118] A computer-readable storage medium can be sent, propagated, or transmitted for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0119] A computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0120] Furthermore, this disclosure also provides an electronic device capable of implementing the above-described method.
[0121] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0122] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0123] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), and a display unit 740.
[0124] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 710 can perform actions such as... Figure 1 As shown: Step S110, in response to the page retrieval request, the pre-stored visualization page and validation rules are sent to the front end so that the front end can display the visualization page and validate the data entered by the user through the visualization page based on the validation rules; Step S120, after receiving the target data that has passed the front end validation, the target data is validated again using the validation configuration file; the validation configuration file is generated according to the validation rules; Step S130, in response to the second successful validation, the target data is imported into the database.
[0125] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include a read-only memory (ROM) 7203.
[0126] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0127] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0128] Electronic device 700 can also communicate with one or more external devices 800 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0129] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A data checking method, characterized by, The application is applied to a backend server, and comprises: In response to a page acquisition request, a pre-stored visual page and a verification rule are sent to a front end, so that the front end displays the visual page and verifies data input by a user through the visual page based on the verification rule; After receiving target data verified by the front end, the target data is re-verified by using a verification configuration file; the verification configuration file is generated based on the verification rule; In response to the re-verification passing, the target data is imported into a database; The verification configuration file is obtained by: Receiving a verification rule of each field configured through the visual page; Aggregating the verification rule corresponding to each field to obtain a verification configuration corresponding to each field; Aggregating the verification configurations corresponding to multiple fields to obtain the verification configuration file.
2. The method of claim 1, wherein, The verification rule is in JSON format; and the verification configuration file is in JSONSchema format.
3. The method according to claim 1 or 2, characterized in that, The re-verification of the target data by using the verification configuration file comprises: Converting the target data into JSON format; Iterating each field of the target data and matching a target verification rule corresponding to each field from the verification configuration file; Re-verifying each field by using the target verification rule to obtain a verification result of each field; Based on the verification results of the multiple fields, a verification result of the target data is determined.
4. The method of claim 3, wherein, The determination of the verification result of the target data based on the verification results of the multiple fields comprises: In response to a verification failure of any field in the multiple fields, it is determined that the target data fails to pass verification.
5. The method of claim 3, wherein, The determination of the verification result of the target data based on the verification results of the multiple fields comprises: In response to the multiple fields all passing verification, it is determined that the target data passes verification.
6. The method of claim 1, wherein, The importing of the target data into the database in response to the re-verification passing comprises: In response to the re-verification passing, the target data is encrypted; The target data after the encryption is imported into the database.
7. A data checking apparatus, characterized by comprising: The application comprises: A front-end verification module is configured to, in response to a page acquisition request, send a pre-stored visual page and a verification rule to a front end, so that the front end displays the visual page and verifies data input by a user through the visual page based on the verification rule; A back-end verification module is configured to, after receiving target data verified by the front end, re-verify the target data by using a verification configuration file; the verification configuration file is generated based on the verification rule; The verification configuration file is obtained by: Receiving a verification rule of each field configured through the visual page; Aggregating the verification rule corresponding to each field to obtain a verification configuration corresponding to each field; Aggregating the verification configurations corresponding to multiple fields to obtain the verification configuration file; A data warehousing module is configured to, in response to the re-verification passing, import the target data into a database.
8. A computer storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the data verification method in any one of claims 1-6.
9. An electronic device, comprising: Comprise: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the data checking method of any one of claims 1-6 via executing the executable instructions.
Citation Information
Patent Citations
Form data verification method and system, server and user terminal
CN111736811A