Method, system and equipment for checking data quality before storage and medium

By adding an interceptor before data insertion and using preset and custom functions for data verification, it solves the problem of existing technology being unable to verify before entering the database and relying on user parameters, and achieves early detection of data quality and optimization of database performance. , improving data accuracy and consistency.

CN118550909APending Publication Date: 2024-08-27INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410779231.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing data quality verification methods cannot verify data before it is put into the database, causing potential quality problems to be discovered only after the data is put into the database. Relying on user-defined parameters may lead to biased results and burden the database performance.

Method used

By adding a pre-database operation interceptor before the data insertion operation, built-in preset proxy functions and custom functions are used for data verification, including data type checking, uniqueness checking, integrity checking, etc., reducing the burden on database query operations and user input. rely.

Benefits of technology

It realizes the detection of quality problems before data is entered into the database, improves data accuracy and consistency, reduces database load, and improves the accuracy and reliability of data quality verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550909A
    Figure CN118550909A
Patent Text Reader

Abstract

The invention discloses a method, a system and equipment for verifying data quality before storage and a medium, mainly relates to the technical field of data quality verification, and is used for solving the problems that data quality verification is performed only after storage in an existing data quality verification scheme, a large amount of query operation needs to be performed on a database, and user-defined parameters provided by a user are excessively relied on. Comprising an interceptor creating module used for adding an interceptor before database operation before data insertion operation; the preset function adding module is used for adding a preset built-in proxy function; the user-defined function adding module is used for adding a user-defined proxy function; the data verification module is used for calling the interceptor before the database operation when the data insertion operation is triggered, and then verifying the data to be inserted into the database according to a preset built-in proxy function and a self-defined function in the interceptor before the database operation; and the result processing module is used for acquiring a return result and determining the next operation based on the return result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data quality verification, and in particular to a method, system, device and medium for verifying data quality before storage. Background Art

[0002] In the field of data management and quality control, data quality verification is an important link. The purpose of data quality verification is to ensure the accuracy, consistency and integrity of data, thereby improving the quality and efficiency of data analysis. However, existing data quality verification methods are mainly aimed at data that has been stored, which has some problems.

[0003] First, existing data quality verification methods usually require obtaining user-defined parameters, and then use dynamic SQL to query the database to perform quality verification on the data that has been stored. A major problem with this method is that it cannot perform quality verification on the data that is about to be stored. This means that if there are quality problems with the data before it is stored, these problems can only be discovered after the data has been stored. This not only wastes storage space, but may also lead to deviations in the results of data analysis.

[0004] Secondly, existing data quality verification methods usually require a large number of query operations on the database, which may affect the performance of the database. Especially when processing a large amount of data, frequent query operations may cause the database to respond slowly, thus affecting the user experience of other users.

[0005] In addition, existing data quality verification methods usually require users to provide customized parameters, which requires users to have a deep understanding of the structure and content of the data. However, in actual applications, users may not always be able to provide accurate and complete parameters, which may lead to deviations in the results of data quality verification.

[0006] Therefore, there is an urgent need for a method, system, equipment and medium for verifying data quality before storage, so as to solve the problems that the existing data quality verification scheme only performs data quality verification after storage, requires a large number of query operations on the database, and relies too much on custom parameters provided by users. Summary of the invention

[0007] In view of the above-mentioned deficiencies in the prior art, the present application provides a method, system, device and medium for verifying data quality before storage, so as to solve the problems that the existing data quality verification scheme only performs data quality verification after storage, requires a large number of query operations on the database, and relies too much on custom parameters provided by users.

[0008] In the first aspect, the present application provides a system for verifying the quality of data before storage, and the system includes: an interceptor creation module, which is used to add a database operation interceptor before the data insertion operation; a preset function adding module, which is used to add a preset built-in proxy function in the database operation interceptor before the data insertion operation; a custom function adding module, which is used to add a custom proxy function in the database operation interceptor before the data insertion operation; a data verification module, which is used to call the database operation interceptor before the data insertion operation is triggered, and then verify the data to be inserted into the database according to the preset built-in proxy function and the custom function in the database operation interceptor before the data insertion operation; a result processing module, which is used to obtain the return results of the preset built-in proxy function and the custom function, and determine the next operation based on the return results.

[0009] Furthermore, the interceptor creation module includes an interceptor adding unit for adding a database pre-operation interceptor using aspect-oriented programming technology.

[0010] Furthermore, the preset built-in proxy functions at least include a data type check function, a range check function, a uniqueness check function, a consistency check function, an integrity check function, a pattern matching function, and a list check function; wherein the data type check function is a function that uses Java's reflection technology to obtain the type information of the field and then performs a type check on the data; the range check function is a function that uses Java's BigDecimal class to check whether it belongs to a preset numerical range; the uniqueness check function is a function that uses the unique index of the database to detect whether the inserted data violates the uniqueness constraint; the consistency check function is a function that uses Java's preset regular expression to check whether the data conforms to the preset regular expression; the integrity check function is a function that uses Java's Optional class to determine whether the preset required data is provided, and records the operator's IP address; the pattern matching function is a function that uses Java's Pattern and Matcher classes to check whether it conforms to the preset string data format and records the operation type; the list check function is a Java List interface that checks whether the data is in a predefined list and records the operation result.

[0011] Furthermore, the custom function adding module includes a custom function creating unit for creating a custom proxy function by realizing an interface or inheriting an abstract class.

[0012] Furthermore, the result processing module includes an operation docking unit, which is used to call Java's exception handling mechanism, throw an exception, and record the returned result as exception information when the returned result belongs to a preset abnormal result; when the returned result belongs to a preset normal result, perform a data insertion operation.

[0013] On the second aspect, the present application provides a method for verifying the quality of data before storage, the method comprising: adding a database operation interceptor before the data insertion operation; adding a preset built-in proxy function in the database operation interceptor before the database operation; adding a custom proxy function in the database operation interceptor before the database operation; when the data insertion operation is triggered, calling the database operation interceptor before the data insertion operation, and then verifying the data to be inserted into the database according to the preset built-in proxy function and the custom function in the database operation interceptor before the database operation; obtaining the return results of the preset built-in proxy function and the custom function, and determining the next operation based on the return results.

[0014] Furthermore, before adding the custom proxy function in the interceptor before the database operation, the method also includes: creating the custom proxy function by implementing an interface or inheriting an abstract class.

[0015] Furthermore, based on the returned result, the next operation is determined, which specifically includes: when the returned result is a preset abnormal result, calling Java's exception handling mechanism, throwing an exception, and recording the returned result as abnormal information; when the returned result is a preset normal result, executing a data insertion operation.

[0016] In a third aspect, the present application provides a device for verifying the quality of data before storage, the device comprising: a processor; and a memory on which executable code is stored, and when the executable code is executed, the processor executes a method for verifying the quality of data before storage such as any of the above items.

[0017] In a fourth aspect, the present application provides a non-volatile computer storage medium having computer instructions stored thereon, which, when executed, implement a method for verifying the quality of data before storage as described in any of the above items.

[0018] Those skilled in the art can understand that the present application has at least the following beneficial effects: This application implements the addition of an interceptor before database operations through an interceptor creation module; implements the addition of a preset built-in proxy function to the interceptor before database operations through a preset function addition module; implements the addition of a custom proxy function to the interceptor before database operations through a custom function addition module; and implements the calling of preset built-in proxy functions and custom proxy functions in the interceptor before database operations through a data verification module, thereby implementing the verification of data quality before storage, and being able to determine the next specific operation based on the specific results of data quality before storage. This application can discover data quality problems in advance by performing quality verification before data is stored, thereby avoiding the problem of data quality problems being discovered after the data has been stored, thereby improving the accuracy and consistency of the data.

[0019] In addition, since the present application performs quality verification before data is stored in the database, query operations on the database can be reduced, thereby reducing the load on the database.

[0020] In addition, the present application reduces the reliance on user input parameters, thereby improving the accuracy and reliability of data quality verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Some embodiments of the present disclosure are described below with reference to the accompanying drawings, in which: Figure 1 It is a schematic diagram of the internal structure of a system for verifying the quality of data before storage provided in an embodiment of the present application.

[0022] Figure 2 This is a flow chart of a method for verifying data quality before storage provided in an embodiment of the present application.

[0023] Figure 3 It is a schematic diagram of the internal structure of a pre-storage data quality verification device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] It should be understood by those skilled in the art that the embodiments described below are only preferred embodiments of the present disclosure, and do not mean that the present disclosure can only be implemented through the preferred embodiments. The preferred embodiments are only used to explain the technical principles of the present disclosure, and are not used to limit the protection scope of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present disclosure.

[0025] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0026] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0027] Figure 1 A pre-warehousing data quality verification system is provided in the embodiment of the present application. Figure 1 As shown, the system provided in the embodiment of the present application mainly includes: The interceptor creation module 110 is used to add a database pre-operation interceptor before the data insertion operation.

[0028] It should be noted that the interceptor creation module 110 is a component that can add a database operation pre-interceptor at a preset position. Among them, the data insertion operation is an operation of inserting data into the database.

[0029] Among them, the specific solution for adding a database operation pre-interceptor can be: The interceptor adding unit in the interceptor creation module 110 uses aspect-oriented programming technology to add a database operation pre-interceptor.

[0030] It should be noted that the present application uses aspect-oriented programming technology to implement the operation of adding a pre-interceptor for database operations, and additional logic can be added without modifying the original code.

[0031] The preset function adding module 120 is used to add a preset built-in proxy function in the interceptor before the database operation.

[0032] It should be noted that the preset function adding module 120 is a component that can add a preset built-in proxy function in the interceptor.

[0033] As an example, the preset built-in proxy functions include a data type check function, a range check function, a uniqueness check function, a consistency check function, an integrity check function, a pattern matching function, and a list check function.

[0034] Among them, the data type check function can be a function that uses Java's reflection technology to obtain the type information of the field and then performs type check on the data; the range check function can be a function that uses Java's BigDecimal class to check whether it belongs to a preset numerical range; the uniqueness check function can be a function that uses the unique index of the database to detect whether the inserted data violates the uniqueness constraint; the consistency check function can be a function that uses Java's preset regular expression to check whether the data conforms to the preset regular expression; the integrity check function can be a function that uses Java's Optional class to determine whether the preset required data is provided, and records the operator's IP address; the pattern matching function can be a function that uses Java's Pattern and Matcher classes to check whether it conforms to the preset string data format and records the operation type; the list check function can be a Java List interface that checks whether the data is in a predefined list and records the operation result.

[0035] The custom function adding module 130 is used to add a custom proxy function in the interceptor before the database operation.

[0036] It should be noted that the custom function adding module 130 is a component that can add a custom proxy function in the interceptor. The custom proxy function can be any feasible function that can perform complex verification or information recording. For example, it can record the access to sensitive fields, record exception handling information, etc.

[0037] In addition, before adding a custom proxy function, the present application can implement an interface or inherit an abstract class through the custom function creation unit in the custom function adding module 130, thereby creating a custom proxy function.

[0038] The data verification module 140 is used to call the database pre-operation interceptor when the data insertion operation is triggered, and then verify the data to be inserted into the database according to the preset built-in proxy function and the user-defined function in the database pre-operation interceptor.

[0039] It should be noted that the data verification module 140 is a component that can call a database pre-operation interceptor when a data insertion operation is triggered.

[0040] The result processing module 150 is used to obtain the return results of the preset built-in proxy function and the user-defined function, and determine the next operation based on the returned results.

[0041] It should be noted that the result processing module 150 is a component that can return results and determine the next operation based on the returned results.

[0042] The next step is determined based on the returned result, which may be: When the returned result belongs to the preset abnormal result, the Java exception handling mechanism is called through the operation docking unit in the result processing module 150, an exception is thrown, and the returned result is recorded as abnormal information; when the returned result belongs to the preset normal result, the data insertion operation is performed.

[0043] In addition, this step can be implemented using a Java logging framework (such as Log4j or SLF4J), which can easily record operation logs and exception information.

[0044] Based on the above description, those skilled in the art can understand that, the present application implements the addition of a database operation interceptor through the interceptor creation module 110; implements the addition of a preset built-in proxy function to the database operation interceptor through the preset function addition module 120; implements the addition of a custom proxy function to the database operation interceptor through the custom function addition module 130; and implements the calling of the preset built-in proxy function and the custom proxy function in the database operation interceptor through the data verification module 140, thereby implementing the verification of the data quality before storage, and can use the result processing module 150 to determine the next specific operation according to the specific result of the data quality before storage, thereby avoiding the storage of abnormal data and improving the data quality of the stored data.

[0045] In addition, the present application also provides a method for verifying the quality of data before storage, such as Figure 2 As shown, the method provided in the embodiment of the present application mainly includes the following steps: Step 210: Before the data insertion operation, add a database operation interceptor.

[0046] Step 220: Add a preset built-in proxy function in the interceptor before the database operation.

[0047] Step 230: Add a custom proxy function in the interceptor before the database operation.

[0048] Before adding a custom proxy function in the interceptor before the database operation, the method can also include: Create custom proxy functions by implementing an interface or inheriting an abstract class.

[0049] Step 240: When the data insertion operation is triggered, the database pre-operation interceptor is called, and then the data to be inserted into the database is verified according to the preset built-in proxy function and the custom function in the database pre-operation interceptor.

[0050] Step 250: Obtain the return results of the preset built-in proxy function and the user-defined function, and determine the next operation based on the return results.

[0051] The next step is determined based on the returned result, which may be: When the returned result belongs to the preset abnormal result, the Java exception handling mechanism is called, an exception is thrown, and the returned result is recorded as the abnormal information; when the returned result belongs to the preset normal result, the data insertion operation is performed.

[0052] The above is a method embodiment of the present application. Based on the same inventive concept, the present application embodiment also provides a device for verifying the quality of data before storage. Figure 3As shown, the device includes: a processor; and a memory, on which executable codes are stored. When the executable codes are executed, the processor executes a method for verifying the quality of data before storage as in the above embodiment.

[0053] Specifically, before the data insertion operation, the server adds a database operation interceptor before the operation; adds a preset built-in proxy function in the database operation interceptor before the operation; adds a custom proxy function in the database operation interceptor before the operation; when the data insertion operation is triggered, the database operation interceptor before the operation is called, and then the data to be inserted into the database is verified according to the preset built-in proxy function and the custom function in the database operation interceptor before the operation; the return results of the preset built-in proxy function and the custom function are obtained, and the next operation is determined based on the return results.

[0054] In addition, an embodiment of the present application further provides a non-volatile computer storage medium on which executable instructions are stored. When the executable instructions are executed, a method for verifying the quality of data before storage as described above is implemented.

[0055] So far, the technical solutions of the present disclosure have been described in combination with the above multiple embodiments, but it is easy for those skilled in the art to understand that the protection scope of the present disclosure is not limited to these specific embodiments. Without departing from the technical principles of the present disclosure, those skilled in the art can split and combine the technical solutions in the above-mentioned various embodiments, and can also make equivalent changes or replacements to the relevant technical features. Any changes, equivalent replacements, improvements, etc. made within the technical concept and / or technical principle of the present disclosure will fall within the protection scope of the present disclosure.

Claims

1. A data quality verification system before storage, characterized in that: The system comprises: The interceptor creation module is used to add a database operation interceptor before the data insertion operation; The preset function adding module is used to add preset built-in proxy functions in the interceptor before database operation; Custom function adding module, used to add custom proxy functions in the interceptor before database operation; The data verification module is used to call the database pre-operation interceptor when the data insertion operation is triggered, and then verify the data to be inserted into the database according to the preset built-in proxy function and custom function in the database pre-operation interceptor; The result processing module is used to obtain the return results of the preset built-in proxy function and the custom function, and determine the next operation based on the returned results.

2. The pre-warehousing data quality verification system according to claim 1 is characterized in that: The interceptor creation module includes the interceptor adding unit, Used to use aspect-oriented programming technology to add a database operation interceptor.

3. The pre-warehousing data quality verification system according to claim 1 is characterized in that: The preset built-in proxy functions at least include a data type check function, a range check function, a uniqueness check function, a consistency check function, an integrity check function, a pattern matching function, and a list check function; Among them, the data type check function is a function that uses Java's reflection technology to obtain the type information of the field and then performs type check on the data; the range check function is a function that uses Java's BigDecimal class to check whether it belongs to the preset numerical range; the uniqueness check function is a function that uses the unique index of the database to detect whether the inserted data violates the uniqueness constraint; the consistency check function is a function that uses Java's preset regular expression to check whether the data conforms to the preset regular expression; the integrity check function is a function that uses Java's Optional class to determine whether the preset required data is provided, and records the operator's IP address; the pattern matching function is a function that uses Java's Pattern and Matcher classes to check whether it conforms to the preset string data format and records the operation type; the list check function is a function of Java's List interface to check whether the data is in the predefined list and record the operation result.

4. The pre-warehousing data quality verification system according to claim 1 is characterized in that: The custom function adding module includes a custom function creation unit. Used to create custom proxy functions by implementing an interface or inheriting an abstract class.

5. The pre-warehousing data quality verification system according to claim 1 is characterized in that: The result processing module includes an operation docking unit, It is used to call Java's exception handling mechanism, throw an exception, and record the return result as exception information when the return result belongs to the preset abnormal result; when the return result belongs to the preset normal result, perform the data insertion operation.

6. A method for verifying data quality before storage, characterized in that: The method comprises: Before inserting data, add a database operation interceptor; Add a preset built-in proxy function in the interceptor before database operation; Add a custom proxy function in the interceptor before database operation; When the data insertion operation is triggered, the database operation interceptor is called, and then the data to be inserted into the database is verified according to the preset built-in proxy function and custom function in the database operation interceptor; Get the return results of preset built-in proxy functions and custom functions, and determine the next step based on the return results.

7. The method for verifying the quality of data before storage according to claim 6, characterized in that: Before adding a custom proxy function in the interceptor before database operation, the method further includes: Create custom proxy functions by implementing an interface or inheriting an abstract class.

8. The method for verifying the quality of data before storage according to claim 6, characterized in that: Based on the returned results, determine the next step, including: When the returned result belongs to the preset abnormal result, the Java exception handling mechanism is called, an exception is thrown, and the returned result is recorded as the abnormal information; when the returned result belongs to the preset normal result, the data insertion operation is performed.

9. A device for checking data quality before storage, characterized in that: The device comprises: processor; and a memory having executable codes stored thereon, which, when executed, causes the processor to execute a method for verifying the quality of data before storage as described in any one of claims 6 to 8.

10. A non-volatile computer storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed, they implement a method for verifying the quality of data before storage as described in any one of claims 6 to 8.

Citation Information

Patent Citations

  • Data source information checking method and device

    CN106940695A

  • SpringAop-based method, device and system of intercepting DAO layer and verifying SQL

    CN108108483A

  • Data quality verification method and data quality verification equipment

    CN117076435A

  • Interceptor Framework Using Java Dynamic Proxies

    US20090138893A1