System data automatic check and repair method
By presetting the checksum repair rule table in the system data, the abnormal data is automatically judged and repaired, and the problem of system abnormal data not being processed in time in operation and maintenance is solved, and the operation and maintenance efficiency and productivity are improved.
Patent Information
- Application Number
- CN202010777699.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-05
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-08-05
AI Technical Summary
In daily operation and maintenance work, the failure to detect and process abnormal data in a timely manner will lead to unpredictable consequences, occupying a large amount of workload, affecting operation and maintenance efficiency.
Through the association relationship between tables in system data and data storage rules in tables, preset data verification rules tables and data repair rules tables, abnormal data are automatically judged and repaired, and the data verification rules tables are used to verify system data using data verification rules tables. , and repair abnormal data through the data repair rule table.
Automatic discovery and repair of system abnormal data is realized, which significantly improves the inspection and repair efficiency of operation and maintenance personnel and improves productivity.
Smart Images

Figure CN112099981B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer systems, and in particular to a method for automatically checking and repairing system data. Background Art
[0002] At present, in daily operation and maintenance work, various abnormal situations, such as failures and program bugs, can be reflected in the system data, and various abnormalities will basically cause the system to generate abnormal data. The operators have to repair the abnormal data, which takes up a lot of work. If the system abnormal data is not discovered and processed in time, it will often cause unpredictable consequences and cause great negative impacts. Summary of the invention
[0003] In response to the above problems, the present invention provides a method for automatically checking and repairing system data. By utilizing the association between tables in the system data and the data preservation rules in the tables, a data verification rule table and a data repair rule table are preset. The system data is verified through the data verification rule table, and it is determined whether the system data is abnormal data according to the preset verification rules. The abnormal data is repaired through the data repair rule table, thereby automatically discovering system abnormal data and automatically repairing abnormal data, discovering system problems in advance, greatly improving the inspection and repair efficiency of operation and maintenance personnel, and improving productivity.
[0004] To achieve the above-mentioned purpose, the present invention provides a method for automatically checking and repairing system data, comprising: reading a data verification rule table, and querying the root node configuration information in the data verification rule table; querying and obtaining sub-rule information under the verification rule according to the root node configuration information; judging whether the corresponding system data is abnormal according to the sub-rule information, and inputting the relevant information of the abnormal data into an abnormal data record table; reading the corresponding data repair rule information in the data repair rule table according to the abnormal data information in the abnormal data record table; performing data repair on the corresponding abnormal data using the data repair rule information, and updating the abnormal data record table.
[0005] In the above technical scheme, preferably, the root node configuration information in the data verification rule table obtained by query includes the rule id, the data volume query verification statement and the business information query statement, the data volume query verification statement and the business information query statement are executed, and the query results are used for the next level configuration rule information judgment.
[0006] In the above technical scheme, preferably, judging whether the corresponding system data is abnormal according to the sub-rule information specifically includes: obtaining verification statement variable information from the data verification rule table according to the sub-rule information; replacing the condition information in the data volume query verification statement and the business information query statement according to the query result obtained according to the previous level configuration rule information; executing the data volume query verification statement and the business information query statement, and the query result of the business information query statement is used for the judgment of the next level configuration rule information; judging whether the system data corresponding to the sub-rule information is abnormal according to the query result of the data volume query verification statement and the verification success and failure identifier and comparison condition data volume in the sub-rule information.
[0007] In the above technical scheme, preferably, the judging whether the system data corresponding to the sub-rule information is abnormal specifically includes: judging the size relationship between the query result of the data volume query verification statement and the comparison condition data volume according to the value of the verification success or failure flag, wherein the verification success or failure flag includes ">", "<" and "="; when the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is consistent with the verification success or failure flag, the verification is successful; when the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is inconsistent with the verification success or failure flag, the verification fails.
[0008] In the above technical solution, preferably, reading the corresponding data repair rule information in the data repair rule table according to the abnormal data information in the abnormal data record table specifically includes: using a data query statement to obtain the abnormal data configuration information in the abnormal data record table; reading the data repair rule table to obtain a recovery data query statement, an abnormal data processing statement and a correct data processing statement; using the abnormal data configuration information to replace the variable information in the recovery data query statement, the abnormal data processing statement and the correct data processing statement.
[0009] In the above technical solution, preferably, the use of the data repair rule information to repair the corresponding abnormal data specifically includes: executing the recovery data query statement to obtain the correct data corresponding to the abnormal data from the history table; executing the abnormal data processing statement to delete the abnormal data; executing the correct data processing statement to insert the correct data into the storage location of the abnormal data.
[0010] In the above technical solution, preferably, before performing data repair on the corresponding abnormal data using the data repair rule information, the abnormal data to be processed is backed up in an abnormal data backup table.
[0011] In the above technical solution, preferably, after the data repair is completed, if an error occurs during the execution of the recovery data query statement, the exception data processing statement or the correct data processing statement, the status is updated to failure in the exception data record table, and the failure cause and error location are recorded; if the repair is successful, the status is updated to successful repair in the exception data record table.
[0012] In the above technical solution, preferably, according to the multiple pieces of sub-rule information obtained by querying the point configuration information, the sub-rule information is cyclically judged whether the corresponding system data is abnormal.
[0013] In the above technical solution, preferably, according to the abnormal data information in the abnormal data record table, a data processing task is used to perform cyclic repair processing on the abnormal data.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: by utilizing the association relationship between the tables in the system data and the data preservation rules in the tables, a data verification rule table and a data repair rule table are preset, the system data is verified through the data verification rule table, and it is determined whether the system data is abnormal data according to the preset verification rules, and the abnormal data is repaired through the data repair rule table, thereby realizing automatic discovery of system abnormal data and automatic repair of abnormal data, discovering system problems in advance, greatly improving the inspection and repair efficiency of operation and maintenance personnel, and improving productivity. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 The present invention is a flowchart of a method for automatically checking and repairing system data disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0018] like Figure 1As shown, a method for automatically checking and repairing system data provided by the present invention includes: reading a data verification rule table, and querying the root node configuration information in the data verification rule table; querying and obtaining sub-rule information under the verification rule according to the root node configuration information; judging whether the corresponding system data is abnormal according to the sub-rule information, and inputting the relevant information of the abnormal data into the abnormal data record table; reading the corresponding data repair rule information in the data repair rule table according to the abnormal data information in the abnormal data record table; performing data repair on the corresponding abnormal data using the data repair rule information, and updating the abnormal data record table.
[0019] In this embodiment, the association relationship between each table in the system data and the data preservation rules in the table are utilized to preset a data verification rule table and a data repair rule table. The system data is verified through the data verification rule table, and it is determined whether the system data is abnormal data according to the preset verification rules. The abnormal data is repaired through the data repair rule table, thereby realizing automatic discovery of system abnormal data and automatic repair of abnormal data, discovering system problems in advance, greatly improving the inspection and repair efficiency of operation and maintenance personnel, and improving productivity.
[0020] Specifically, the following Tables 1 to 4 list a data verification rule table, an abnormal data recording table, a data repair rule table, and an abnormal data backup table as examples.
[0021] Table 1 Data verification rules table
[0022]
[0023] Table 2 Abnormal data record table
[0024]
[0025] Table 3 Data repair rules table
[0026]
[0027] Table 4 Abnormal data backup table
[0028]
[0029]
[0030] In the above tables, the table name, data type, length, description and other information are all sample information. In the specific implementation process, the table is created based on the specific data type and other information, and the field name, field name and other information are created based on the specific required information of the system data to be verified and repaired in the specific implementation process.
[0031] According to the specific information of the system data to be verified and repaired, formulate corresponding verification rules and data repair rules, create tables in the database and store them.
[0032] In the data verification rule table, query to obtain the root node configuration information, which is the basic table information. Any type of data stored in the database has a basic information table, for example, the basic information table for user-related information is the user table, and the basic information table for customer-related information is the customer table. The rule table is to associate other tables related to the basic information table through the basic information table for verification.
[0033] Preferably, the root node configuration information query statement is used to query the data verification rule table to obtain the root node configuration information. Specifically, the root node configuration information query statement is shown as follows:
[0034]
[0035] In the above embodiment, preferably, the root node configuration information in the data verification rule table obtained by query includes the rule id, table name, data volume query verification statement and business information query statement, the data volume query verification statement and the business information query statement are executed, and the query results are used for the next level configuration rule information judgment.
[0036] By using the sub-rule information query statement, you can query the sub-rule information under the corresponding rule id. Specifically, the sub-rule information query statement is as follows:
[0037]
[0038]
[0039] Specifically, the information that can be queried is: rule id, table name, data volume query verification sql, business information query sql, parameter information, verification success or failure flag, and number of comparison conditions; among them, Par_rule_id is the parent rule id.
[0040] In the above embodiment, preferably, judging whether the corresponding system data is abnormal according to the sub-rule information specifically includes: obtaining the verification statement variable information from the data verification rule table according to the sub-rule information; replacing the condition information in the data volume query verification statement and the business information query statement according to the query result obtained according to the previous level configuration rule information; executing the data volume query verification statement and the business information query statement, and the query result of the business information query statement is used for the judgment of the next level configuration rule information; judging whether the system data corresponding to the sub-rule information is abnormal according to the query result of the data volume query verification statement and the verification success and failure identifier and comparison condition data volume in the sub-rule information.
[0041] In the above embodiment, preferably, determining whether the system data corresponding to the sub-rule information is abnormal specifically includes: determining the size relationship between the query result of the data volume query verification statement and the comparison condition data volume according to the value of the verification success or failure flag, wherein the verification success or failure flag includes ">", "<" and "="; when the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is consistent with the verification success or failure flag, the verification is successful; when the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is inconsistent with the verification success or failure flag, the verification fails, and the corresponding system data information is input into the abnormal data record table.
[0042] In the above embodiment, preferably, reading the corresponding data repair rule information in the data repair rule table according to the abnormal data information in the abnormal data record table specifically includes: using the data query statement to obtain the abnormal data configuration information in the abnormal data record table; reading the data repair rule table to obtain the recovery data query statement, the abnormal data processing statement and the correct data processing statement; using the abnormal data configuration information to replace the variable information in the recovery data query statement, the abnormal data processing statement and the correct data processing statement.
[0043] Specifically, the query statement for querying the abnormal data configuration information for the abnormal data record table is shown as follows:
[0044]
[0045]
[0046] As shown in Table 2, the query results are: primary key id, rule id, abnormal data primary key field name, abnormal data primary key id.
[0047] According to the rule ID, the data repair rule information is queried in the data repair rule table. The query statement is as follows:
[0048]
[0049] The query results are: recovery data query statement, abnormal data processing statement and correct data processing statement.
[0050] The variable information in the recovery data query statement, the abnormal data processing statement and the correct data processing statement is replaced with the abnormal data primary key ID queried from the abnormal data record table. Preferably, before the corresponding abnormal data is repaired using the data repair rule information, the abnormal data to be processed is backed up to the abnormal data backup table shown in Table 4. Then, the recovery data query statement, the abnormal data processing statement and the correct data processing statement after the variable replacement are executed.
[0051] Preferably, using data repair rule information to repair corresponding abnormal data specifically includes: executing a recovery data query statement to obtain correct data corresponding to the abnormal data from the history table; executing an abnormal data processing statement to delete the abnormal data; executing a correct data processing statement to insert the correct data into the storage location of the abnormal data.
[0052] In the above embodiment, preferably, after the data repair is completed, if an error occurs during the execution of the recovery data query statement, the exception data processing statement or the correct data processing statement, the status is updated to failure in the exception data record table, and the failure reason and the error location are recorded; if the repair is successful, the status is updated to successful repair in the exception data record table.
[0053] In the above embodiment, preferably, according to the multiple pieces of sub-rule information obtained by querying the point configuration information, the sub-rule information is cyclically checked to determine whether the corresponding system data is abnormal.
[0054] In the above embodiment, preferably, according to the abnormal data information in the abnormal data record table, a data processing task is used to perform cyclic repair processing on the abnormal data.
[0055] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automatically checking and repairing system data, characterized in that: include: Read the data verification rule table, and query the root node configuration information in the data verification rule table; According to the root node configuration information, query and obtain sub-rule information under the verification rule; Judging whether the corresponding system data is abnormal according to the sub-rule information, and inputting the relevant information of the abnormal data into the abnormal data record table, specifically includes: Obtain verification statement variable information from the data verification rule table according to the sub-rule information; Replace the condition information in the data volume query verification statement and the business information query statement with the query result obtained according to the previous level configuration rule information; Execute the data volume query verification statement and the business information query statement, and the query result of the business information query statement is used for the next level configuration rule information judgment; According to the query result of the data volume query verification statement and the verification success or failure flag and the comparison condition data volume in the sub-rule information, it is determined whether the system data corresponding to the sub-rule information is abnormal; According to the abnormal data information in the abnormal data record table, reading the corresponding data repair rule information in the data repair rule table specifically includes: Using a data query statement to obtain the abnormal data configuration information in the abnormal data record table; Read the data repair rule table to obtain a recovery data query statement, an abnormal data processing statement, and a correct data processing statement; Using the abnormal data configuration information to replace the variable information in the recovery data query statement, the abnormal data processing statement and the correct data processing statement; The data repair rule information is used to repair the corresponding abnormal data, and the abnormal data record table is updated, specifically including: Execute the recovery data query statement to obtain the correct data corresponding to the abnormal data from the history table; Execute the abnormal data processing statement to delete the abnormal data; The correct data processing statement is executed to insert the correct data into the storage location of the abnormal data.
2. The method for automatically checking and repairing system data according to claim 1, characterized in that: The root node configuration information in the data verification rule table obtained by query includes rule id, data volume query verification statement and business information query statement, execute the data volume query verification statement and the business information query statement, and use the query result for the next level configuration rule information judgment.
3. The method for automatically checking and repairing system data according to claim 1, characterized in that: The determining whether the system data corresponding to the sub-rule information is abnormal specifically includes: According to the value of the verification success or failure flag, determine the relationship between the query result of the data volume query verification statement and the comparison condition data volume, wherein the verification success or failure flag includes ">", "<" and "="; When the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is consistent with the verification success or failure flag, the verification is successful; When the size relationship between the query result of the data volume query verification statement and the comparison condition data volume is inconsistent with the verification success or failure flag, the verification fails.
4. The method for automatically checking and repairing system data according to claim 1, characterized in that: Before performing data repair on the corresponding abnormal data using the data repair rule information, the abnormal data to be processed is backed up in an abnormal data backup table.
5. The method for automatically checking and repairing system data according to claim 1, characterized in that: After the data repair is completed, if an error occurs during the execution of the recovery data query statement, the exception data processing statement or the correct data processing statement, the status is updated to failure in the exception data record table, and the failure reason and error location are recorded. If the repair is successful, the status is updated to successful repair in the exception data record table.
6. The method for automatically checking and repairing system data according to claim 1, characterized in that: The plurality of sub-rule information obtained by querying the root node configuration information is cyclically checked to determine whether corresponding system data is abnormal.
7. The method for automatically checking and repairing system data according to claim 1, characterized in that: According to the abnormal data information in the abnormal data record table, a data processing task is used to perform cyclic repair processing on the abnormal data.
