A configurable rule relational data entry verification method, device and storage medium
By obtaining the table identifier at the data entry point to find and verify the validation rules, the problem of lacking data entry validation in the existing technology is solved. This enables accurate and timely validation of newly added or modified data records, expands the validation scope, and supports dynamic rule adjustment.
Patent Information
- Application Number
- CN202310164695.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-02-08
AI Technical Summary
The technical problem with existing data verification technologies is the lack of separate verification for data entry points, especially for newly added or modified data records. Furthermore, existing technologies mainly focus on batch data verification and cannot perform correlation verification.
This paper provides a configurable rule-based method for validating relational data entry points. By obtaining the table identifier of the data record, the corresponding validation rule is found, validation is performed sequentially, and the validation result is returned. It supports dynamic adjustment of validation rules and is based on the validation logic defined by SQL.
It achieves accurate verification at the data entry point, promptly identifies and reports problems, facilitates user modifications, expands verification capabilities, supports dynamic rule adjustments, and ensures the reliability of verification results.
Smart Images

Figure CN116204520B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer data processing, and more particularly, to a configurable rule-based relational data entry verification method, device and storage medium. BACKGROUND
[0002] Data quality is crucial to the operation of information systems and the organization and use of data, and data verification is an important means to improve data quality, so data verification is an important link in the data life cycle. Generally, data verification is mainly concentrated in two occasions: one is when the data is just generated and enters the database, the newly generated or modified data is verified; the other is after the data enters the database, a large amount of data is verified. The existing data verification technology focuses on batch data verification, and there is no research on separate verification of entry-specific data records. For example, the existing technology 1 provides a method for verifying massive data, which is suitable for batch data verification, and the idea includes: ① defining a template data verification view; ② forming a data verification result; ③ periodically calling the verification result using a timer, and pushing it to the user; ④ jumping to the data editing interface according to the result. The existing technology 2 provides a method for verifying batch data according to verification rules and obtaining verification results, and the idea includes: ① configuring verification rules using structured query language and regular expressions; ② verifying the data to be verified according to the verification rules.
[0003] For data acquisition and entry systems, batch data verification functions can only verify the data in the database, which is a check and correction behavior for the data in the database. For entry data verification, similar data verification modules in similar software products in the industry generally implement direct verification of input data through front-end technology, which is a verification of single input data items in terms of specification, and does not verify database records. Moreover, there are limitations such as fixed verification rules, specification verification of only single data items, and inability to perform associated verification.
[0004] Existing technology 1: CN109299074A, a data verification method and system based on template database view;
[0005] Existing technology 2: CN107908725A, a batch data verification method, device and system. SUMMARY
[0006] In view of at least one defect or improvement requirement of the existing technology, the present application provides a configurable rule-based relational data entry verification method, device and storage medium, which implements targeted and accurate verification for newly added or modified data records currently being saved.
[0007] To achieve the above object, according to the first aspect of the present application, a configurable rule-based relational data entry checking method is provided, which comprises:
[0008] S1. obtaining the newly added or modified data record currently being saved at the data entry, and obtaining the table identifier of the current record;
[0009] S2. searching for all the checking rules with the same table identifier as the table identifier of the current record from all the preset checking rules according to the table identifier of the current record, to form a rule list;
[0010] S3. checking each of the checking rules in the rule list and feeding back the checking result.
[0011] Further, the above configurable rule-based relational data entry checking method further comprises:
[0012] Before the step S1, the checking rules need to be classified, and the classification basis is the attribute of the checking rules.
[0013] Further, the above configurable rule-based relational data entry checking method further comprises:
[0014] The attribute of the checking rules at least includes: rule name, rule id, table identifier, primary key field, checking SQL, rule description, and problem description.
[0015] Further, the step S3 of the above configurable rule-based relational data entry checking method specifically comprises:
[0016] checking each of the checking rules in the rule list in turn and storing in the form of a checking result list; and feeding back the checking result to the user after all the checking rules are completed.
[0017] Further, the step S3 of the above configurable rule-based relational data entry checking method specifically comprises:
[0018] S31. judging whether the rule list is empty; if not, going to S32; if empty, jumping to S37;
[0019] S32. obtaining the first rule in the rule list, defining the first rule as the current rule, and obtaining the primary key field and the first checking SQL of the current rule;
[0020] S33. obtaining the primary key value of the current record; assembling the primary key field of the current rule and the primary key value into a primary key key-value pair; and using the primary key key-value pair and the first checking SQL of the current rule to form a second checking SQL;
[0021] S34. The second check SQL is executed. If the check result is not empty, S35 is entered, otherwise S36 is entered;
[0022] S35. After the check result is recorded in the check result list, S36 is entered;
[0023] S36. After the current rule is deleted, S31 is returned to;
[0024] S37. It is judged whether the check result list is empty. If not, S38 is entered, otherwise the process is ended;
[0025] S38. The check result list is fed back to the user.
[0026] According to a second aspect of the present application, a configurable rule relational data entry check device is also provided, comprising at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program which, when executed by the processing unit, causes the processing unit to perform the steps of any of the above-mentioned methods.
[0027] According to a third aspect of the present application, a storage medium is also provided, which stores a computer program executable by an access authentication device, which, when running on the access authentication device, causes the access authentication device to perform the steps of any of the above-mentioned methods.
[0028] Overall, the above technical solutions conceived by the present application can achieve the following beneficial effects compared with the prior art:
[0029] (1) The configurable rule relational data entry check method provided by the present application can obtain the newly added or modified data record currently being saved at the data entry, can implement targeted and accurate check on the newly added or modified data record currently being saved, and can timely feed back the user about the problems found by the check, so as to facilitate the user to discover and modify the data problems at the data entry in time;
[0030] (2) The configurable rule relational data entry check method provided by the present application can formulate and manage targeted check rules for all business data tables, and supports dynamic adjustment of the check rules according to business needs during operation;
[0031] (3) The check rule of the present application is defined based on SQL, supports check on the specification, integrity and consistency of data, and expands the range of check capabilities;
[0032] (4) The configurable rule relational data entry checking method provided by the application can ensure that checking is performed at the data entry and all checking rules are traversed in the checking process, thereby ensuring the reliability of the checking result. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0034] Figure 1 A flowchart of the configurable rule relational data entry checking method provided by the embodiment of the application;
[0035] Figure 2 A schematic diagram of the checking rule classification management method provided by the embodiment of the application;
[0036] Figure 3 A flowchart of the sequential checking according to the checking rules provided by the embodiment of the application. DETAILED DESCRIPTION
[0037] In order to make the objects, technical solutions and advantages of the application more clear, the application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and not to limit the application. In addition, the technical features involved in each embodiment of the application described below can be combined with each other as long as they do not conflict with each other.
[0038] The terms "first", "second", "third" and the like in the specification and claims of the application and the above drawings are used to distinguish different objects and are not used to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed or can optionally include other steps or units inherent to the process, method, product or device.
[0039] As shown in FIG. 1, the application provides a configurable rule relational data entry checking method, which comprises: Figure 1 S1. Obtain the newly added or modified data record currently being saved at the data entry, and obtain the table identifier of the current record.
[0040] S2. Obtain the checking rule corresponding to the table identifier of the current record. S3. Traverse all the checking rules in the checking rule set, and sequentially check the data record according to the checking rules. S4. If the checking result is not correct, perform the corresponding processing.
[0041] S2. According to the table identifier of the current record, find all the check rules with the same table identifier as the current record in all preset check rules to form a rule list; wherein the check rule at least includes a primary key field and a first check SQL;
[0042] S3. Check each check rule in the rule list and feed back the check result.
[0043] The application performs targeted check on data records at the data entry and timely feeds back the check result, so that the data collection and entry personnel can obtain feedback on data quality problems in the first time and timely modify, which is more suitable in the check opportunity and more accurate in the check range.
[0044] The configurable rule relational data entry check method provided by the application can formulate and manage targeted check rules for all business data tables and support dynamic adjustment of check rules according to business needs in the running process.
[0045] The check rule of the application is based on SQL definition and supports check on data specification, integrity and consistency, which expands the ability range of the check.
[0046] As shown in Figure 2 Further, the application provides a configurable rule relational data entry check method, which further comprises:
[0047] Before the step S1, the check rules need to be classified, and the classification basis is the attribute of the check rule.
[0048] Further, the above configurable rule relational data entry check method further comprises:
[0049] The attribute of the check rule at least includes: rule name, rule id, table identifier, primary key field, check SQL, rule description and problem description.
[0050] The application sets a check rule management method, constructs and manages targeted check rules for all data in the business field involved by the information system. Further, the application also sets a classification method of the check rule, which can more conveniently manage all check rules.
[0051] Further, the step S3 of the application specifically comprises:
[0052] Check each check rule in the rule list in turn and store in the form of a check result list; after all check rules are completed, feed back the check result to the user.
[0053] As shown in Figure 3As shown, further, the step S3 of the present application specifically comprises:
[0054] S31. judging whether the rule list is empty; if not, entering S32; if empty, jumping to S37;
[0055] S32. obtaining the first rule in the rule list, defining the first rule as the current rule, and obtaining its primary key field and first check SQL;
[0056] S33. obtaining the primary key value of the current record; assembling the primary key field of the current rule and the primary key value into a primary key key-value pair, and using the primary key key-value pair and the first check SQL of the current rule to form a second check SQL;
[0057] S34. executing the second check SQL, if the check result is not empty, entering S35, otherwise entering S36;
[0058] S35. recording the check result in the check result list, and entering S36;
[0059] S36. deleting the current rule, and returning to S31;
[0060] S37. judging whether the check result list is empty; if not, entering S38, otherwise ending the process;
[0061] S38. feeding back the check result list to the user.
[0062] After the present application extracts the corresponding check rules, the method of successive checking can ensure that the checking is performed at the data entry, and all the check rules are traversed in the checking process, thereby ensuring the reliability of the check result.
[0063] The specific implementation of the step S33 in the present embodiment is shown as follows:
[0064] The first check SQL in the check rule describes the batch check rule, and needs to be combined with the primary key value of the current record to form a single-row SQL effective for the current record. The specific method is to add the primary key key-value pair of the current record into the query condition, so that the execution of the SQL is only for the current record. Assuming that the primary key fields are keyField1, keyField2, …, keyFieldn, the primary key values corresponding to the current record are keyValue1, keyValue2, …, keyValuen, and the first check SQL is "select*from tables where conditions", the assembled second check SQL is:
[0065] select keyField1, keyField2, …, keyFieldn from (select * from tables where conditions) where keyField1 = keyValue1 and keyField2 = keyValue2 and … and keyFieldn = keyValuen.
[0066] If the result of the above SQL execution is empty, it means that the current record meets the requirement of the rule, otherwise, it means that the current record does not meet the requirement of the rule.
[0067] According to a second aspect of the present application, there is also provided a configurable relational data entry verification device, comprising at least one processing unit, and at least one storage unit, wherein the storage unit stores a computer program, when the computer program is executed by the processing unit, the processing unit executes the steps of any of the above-mentioned methods.
[0068] The present application also provides a computer readable storage medium, which stores a computer program, when the computer program is executed by a processor, the steps of the above-mentioned method are implemented. Wherein the computer readable storage medium can include but not limited to any type of disk, including floppy disk, optical disk, DVD, CD-ROM, micro drive and magneto-optical disk, ROM, RAM, EPROM, EEPROM, DRAM, VRAM, flash memory device, magnetic card or optical card, nanometer system (including molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0069] Those skilled in the art will easily understand that the above-mentioned is only the preferred embodiment of the present application, and is not used to limit the present application, any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A configurable rules relational data entry validation method, characterized by, Comprising: S1. Acquire the newly added or modified data record currently being saved at the data entry, and acquire the table identifier of the current record; S2. According to the table identifier of the current record, find all the check rules with the same table identifier as the table identifier of the current record in all the preset check rules, and form a rule list; S3. Check each of the check rules in the rule list, and feed back the check result; Step S3 specifically comprises: Check each of the check rules in the rule list in turn, and store in the form of a check result list; after all the check rules are completed, feed back the check result to the user; Step S3 further comprises: S31. Determine whether the rule list is empty; if not, go to S32; if empty, jump to S37; S32. Acquire the first rule in the rule list, define the first rule as the current rule, and acquire its primary key field and first check SQL; S33. Acquire the primary key value of the current record; assemble the primary key field of the current rule and the primary key value into a primary key key-value pair, use the primary key key-value pair and the first check SQL of the current rule to form a second check SQL; S34. Execute the second check SQL, if the check result is not empty, go to S35, otherwise go to S36; S35. Record the check result in the check result list, and go to S36; S36. Delete the current rule, and return to S31; S37. Determine whether the check result list is empty, if not, go to S38, otherwise end the process; S38. Feed back the check result list to the user.
2. The configurable rules relational data entry validation method of claim 1, wherein, Further comprising: Before the step S1, the check rules need to be classified, and the basis of the classification is the attribute of the check rule.
3. The configurable rules relational data entry validation method of claim 2, wherein, Further comprising: The attribute of the check rule at least includes: rule name, rule id, table identifier, primary key field, first check SQL, rule description, and problem description.
4. A configurable rules relational data entry validation device, characterized by, Comprising at least one processing unit, and at least one storage unit, wherein the storage unit stores a computer program, when the computer program is executed by the processing unit, makes the processing unit execute the steps of the method of any one of claims 1-3.
5. A storage medium, characterized by It stores a computer program executable by an access authentication device, when the computer program runs on the access authentication device, makes the access authentication device execute the steps of the method of any one of claims 1-3.
Citation Information
Patent Citations
Batch data check method, device and system
CN107908725A
A method and a system for data verification based on a templated database view
CN109299074A
Master data quality management method and device, computer equipment and storage medium
CN115328948A
Data import method and system and electronic equipment
CN115544132A