Method and apparatus for repairing database completeness rate, and electronic device

By automating detection and generating script prompts, the problem of low efficiency in improving database completeness in existing technologies is solved, achieving efficient and accurate database completeness repair.

CN117171152BActive Publication Date: 2026-04-28PING AN BANK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN BANK CO LTD
Filing Date
2023-09-05
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing data governance methods suffer from high manpower costs, long time costs, and poor accuracy in improving database completeness, and cannot effectively improve data quality.

Method used

By automatically detecting whether the target data table meets the preset data specifications, generating script prompts and sending them to the developer's terminal, the database completeness rate is improved.

Benefits of technology

It achieves automated data table detection and script prompt information generation, reducing manual intervention and improving the efficiency and accuracy of database integrity repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171152B_ABST
    Figure CN117171152B_ABST
Patent Text Reader

Abstract

The application provides a database completeness rate repairing method and device and electronic equipment. The method comprises the following steps: obtaining a target data table in a target database; the target database is a database with a metadata completeness rate less than a preset threshold; detecting whether the target data table meets a corresponding preset data specification; if not, generating script prompt information according to table structure information of the target data table; the script prompt information is used to prompt a relevant person to modify the table structure information; and the script prompt information is sent to a terminal of a developer corresponding to the target data table, so that the developer modifies the data table according to the script prompt information. The application can automatically detect the data table and generate the script prompt information for the detected database with an insufficient completeness rate, so that the relevant person can modify the data table in time and improve the database completeness rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and in particular to a method, apparatus, and electronic device for repairing database completeness. Background Technology

[0002] In the financial technology field, data quality issues are having an increasingly significant impact on the decision-making and operations of enterprises and banks. Data completeness rate is one of the important indicators for measuring data quality, reflecting the completeness and availability of the required information in the data set. Low data completeness rate can lead to erroneous decision-making and inefficient operations. However, existing data governance methods still have certain limitations in improving data completeness rate. Currently, the bank's completeness rate operation process mainly involves team leaders manually checking, locating, and modifying data tables that do not meet the standards, which requires a lot of manpower and time costs and has poor accuracy. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, and electronic device for repairing database completeness, which can automatically detect data tables and generate script prompts for databases with insufficient completeness, so that relevant personnel can make timely modifications to the data tables and improve the database completeness.

[0004] Firstly, this application provides a method for repairing database completeness, the method comprising: obtaining a target data table in a target database; the target database being a database with a metadata completeness rate less than a preset threshold; detecting whether the target data table meets the corresponding preset data specifications; if not, generating script prompt information based on the table structure information of the target data table; the script prompt information being used to prompt relevant personnel to modify the table structure information; and sending the script prompt information to the developer terminal corresponding to the target data table, so that the developer can modify the data table according to the script prompt information.

[0005] Furthermore, the steps for obtaining the target data tables in the target database include: detecting target databases with metadata completeness rates less than a preset threshold; obtaining all data tables in the target database; performing data cleaning on all data tables to obtain valid target data tables; and removing backup tables, useless tables, and temporary tables.

[0006] Furthermore, the metadata completeness rate is calculated as follows: Metadata completeness rate = (Table-level metadata completeness rate + Field-level metadata completeness rate) * 50%; where, Table-level metadata completeness rate = Number of tables with valid Chinese names in the database / Total number of tables in the database; Field-level metadata completeness rate = Number of valid fields in all tables in the database / Total number of fields in all tables.

[0007] Furthermore, the aforementioned preset data specifications include at least one of the following: data type specifications, data length specifications, data format specifications, and data content specifications; the step of detecting whether the target data table meets the corresponding preset data specifications includes: for each specification in the preset data specifications, determining whether the target data table meets it; if at least one specification is not met, then it is determined that the target data table does not meet the preset data specifications.

[0008] Furthermore, the steps described above for generating script prompt information based on the table structure information of the target data table include: obtaining the target fields from the table structure information of the target data table, wherein the target fields are fields that do not meet the preset data specifications; for each target field, obtaining the target script template corresponding to the target field, adding the target field to the corresponding position in the target script template, and generating the comment script information corresponding to the target field; and compressing the comment script information corresponding to multiple target fields to obtain the script prompt information.

[0009] Furthermore, the above-mentioned step of obtaining the target script template corresponding to the target field includes: obtaining a preset script template set corresponding to the database type; the preset script template set includes script templates corresponding to multiple specifications respectively; and searching for the target script template corresponding to the target specification item that the target field does not satisfy from the preset script template set.

[0010] Furthermore, the step of sending the script prompt information to the developer's terminal corresponding to the target data table includes: finding the owner information of the target data table; obtaining the corresponding developer's communication information from the owner system based on the owner information; and sending the script prompt information to the terminal corresponding to the communication information.

[0011] Secondly, this application also discloses a database completeness repair device, comprising: a table acquisition module for acquiring a target data table in a target database; the target database is a database whose metadata completeness rate is less than a preset threshold; a table detection module for detecting whether the target data table meets the corresponding preset data specifications; a script generation module for generating script prompt information based on the table structure information of the target data table when the detection result of the table detection module is negative; the script prompt information is used to prompt relevant personnel to modify the table structure information; and a script sending module for sending the script prompt information to the developer terminal corresponding to the target data table, so that the developer can modify the data table according to the script prompt information.

[0012] Thirdly, this application also provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method described in the first aspect above.

[0013] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in the first aspect above.

[0014] The database completeness repair method, apparatus, and electronic device provided in this application first acquire a target data table in a target database; this target database is one whose metadata completeness rate is less than a preset threshold; then, it checks whether the target data table meets the corresponding preset data specifications; if not, it generates script prompt information based on the table structure information of the target data table; this script prompt information is used to prompt relevant personnel to modify the table structure information; finally, it sends the script prompt information to the developer terminal corresponding to the target data table, so that the developers can modify the data table according to the script prompt information. This method can automatically detect data tables and generate script prompt information for databases with insufficient completeness, enabling relevant personnel to make timely data table modifications and improve the database completeness rate. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 A flowchart illustrating a method for improving database completeness in an embodiment of this application;

[0017] Figure 2 A flowchart illustrating the process of determining the target data table in a database integrity repair method provided in this application embodiment;

[0018] Figure 3 A schematic diagram illustrating the script prompt information generation process in a database integrity rate repair method provided in this application embodiment;

[0019] Figure 4 A structural block diagram of a database integrity repair device provided in this application embodiment;

[0020] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0021] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] Currently, the method for improving database completeness is as follows: staff export non-compliant database fields and push them to each system manager. The manager then locates the non-compliant fields in the production environment's tables. Developers also need to manually add script information and modify the fields themselves. After modification, the issue is fixed in the production environment. This process is time-consuming, inefficient, has poor timeliness, and low accuracy. 。

[0023] Based on this, embodiments of this application provide a method, apparatus, and electronic device for repairing database completeness, which can automatically detect data tables and generate script prompts for databases with insufficient completeness, so that relevant personnel can make timely modifications to the data tables and improve the database completeness.

[0024] To facilitate understanding of this embodiment, a method for repairing database completeness disclosed in this application embodiment will first be described in detail.

[0025] Figure 1 A flowchart of a database integrity repair method provided in this application embodiment is shown. The method specifically includes the following steps:

[0026] Step S102: Obtain the target data table from the target database; the target database is a database whose metadata completeness rate is less than a preset threshold. The target data table is a valid data table in the target database, that is, a data table after removing useless tables, backup tables, and temporary tables.

[0027] Metadata completeness is a standard that represents a norm for the entire data governance process. By checking the metadata completeness value of a database, non-compliant system databases can be identified and rectified. The role of completeness is to standardize data, thereby facilitating enterprise data management and use.

[0028] Step S104: Check whether the target data table meets the corresponding preset data specifications.

[0029] Pre-defined data specifications must include at least one of the following: data type specifications, data length specifications, data format specifications, and data content specifications. The specific detection method involves judging whether the value of each field in the data table conforms to the specifications corresponding to that field. If any of the above specifications are not met, the target data table is determined to not meet the pre-defined data specifications.

[0030] If so, no further action will be taken; the process ends here.

[0031] If not, proceed to step S106 to generate script prompts based on the table structure information of the target data table; the script prompts are used to prompt relevant personnel to modify the table structure information.

[0032] The table structure information described above corresponds to the target data table in the database, including fields, index specifications, etc. The generated script prompts may include information indicating modifications to specific table structure details, such as prompts for missing remarks.

[0033] Step S108: Send the script prompt information to the developer terminal corresponding to the target data table so that the developer can modify the data table according to the script prompt information.

[0034] The database completeness repair method provided in this application first obtains the target data table in the target database; this target database is one where the metadata completeness rate is less than a preset threshold; then, it checks whether the target data table meets the corresponding preset data specifications; if not, it generates script prompt information based on the table structure information of the target data table; this script prompt information is used to prompt relevant personnel to modify the table structure information; finally, it sends the script prompt information to the developer terminal corresponding to the target data table, so that the developers can modify the data table according to the script prompt information. This method can automatically detect data tables and generate script prompt information for databases with insufficient completeness, enabling relevant personnel to make timely data table modifications and improve the database completeness rate.

[0035] This application embodiment also provides another method for repairing database completeness, which is implemented based on the above embodiment; this embodiment focuses on describing the target data table acquisition method, the data completeness calculation method, the script generation process, etc.

[0036] See Figure 2 As shown, the steps for obtaining the target data table in the target database include:

[0037] Step S202: Detect target databases whose metadata completeness rate is less than a preset threshold;

[0038] The metadata completeness rate is calculated as follows: Metadata completeness rate = (Table-level metadata completeness rate + Field-level metadata completeness rate) * 50%; where, Table-level metadata completeness rate = Number of tables with valid Chinese names in the database / Total number of tables in the database; Field-level metadata completeness rate = Number of valid fields in all tables in the database / Total number of fields in all tables.

[0039] The above-mentioned criteria for determining "qualified Chinese names in the table" can be: the length of the Chinese names in the table is greater than or equal to 3 Chinese characters; the above-mentioned criteria for determining "qualified fields" can be: the length of the Comment field after deduplication in the same table is greater than 1, and it contains at least one Chinese character.

[0040] Based on the definition of metadata completeness mentioned above, system databases with a completeness rate less than the threshold can be identified as target databases.

[0041] Step S204: Obtain all data tables in the target database.

[0042] Step S206: Perform data cleaning on all data tables to obtain valid target data tables; data cleaning is used to remove backup tables, useless tables, and temporary tables. Among them, useless tables can be data tables containing incomplete, erroneous, or inconsistent data.

[0043] Furthermore, the steps for checking whether the target data table meets the corresponding preset data specifications are as follows:

[0044] For each specification in the preset data specifications, determine whether the target data table meets the requirements; if at least one specification is not met, then the target data table is determined not to meet the preset data specifications.

[0045] In practice, a comprehensive evaluation of the target data tables in the target database can be conducted to identify areas and reasons for insufficient data completeness. Pre-defined data specifications can include the following four aspects: data type specifications, data length specifications, data format specifications, and data content specifications. For example, data type specifications determine the data type of the data field, such as whether it is a number, string, or date; data length specifications determine the maximum length of the data field; data format specifications determine the format of the data field, such as whether it must contain numbers and letters; and data content specifications determine the range of values ​​for the data field, such as whether it must be a valid phone number.

[0046] Taking data length specifications as an example, the data length specifications include the following two points:

[0047] ① In the production database, after deduplication, the length of the Comment field in the same table must be greater than 1, and it must contain at least one Chinese character. Note: The purpose of "deduplication" is to avoid all Chinese comments in the same table being the same phrase, thereby improving the assessment score. For example, if a table has 10 fields, and the Chinese comments for all 10 fields are all called "primary key ID", then after deduplication, the completeness rate of this table is only 10%.

[0048] ② The length of the Chinese name in the table is greater than or equal to 3, and it contains at least 3 Chinese characters.

[0049] Further, see Figure 3As shown, the steps for generating script prompts based on the table structure information of the target data table include the following steps:

[0050] Step S302: Obtain the target field from the table structure information of the target data table. The target field is the relevant field that does not meet the preset data specifications.

[0051] Step S304: For each target field, obtain the target script template corresponding to the target field, add the target field to the corresponding position in the target script template, and generate the note script information corresponding to the target field.

[0052] The target script template mentioned above can be obtained as follows:

[0053] Retrieve the preset script template set corresponding to the database type; the preset script template set includes script templates corresponding to multiple specifications; from the preset script template set, find the target script template corresponding to the target specification item that the target field does not satisfy.

[0054] Step S306: Compress the comment script information corresponding to multiple target fields to obtain script prompt information.

[0055] For example, during data collection, it was found that the remarks for the ID_CASE and ID_TASK fields in the discourse_base_case_info table of the DISPTUE database were not filled in, while the remarks for the carD_nbr and acct_nbr fields were the same.

[0056] Then, the system collects the corresponding table structure information for this dispute table, including the table's database structure information, such as fields and index specifications. It then determines the database type, such as MySQL, Oracle, or SQL Server, and collects the aforementioned field information to generate script prompts for modifying the table structure. This is fixed syntax information, with each database corresponding to a different set of script templates. Each script template set further corresponds to script templates under different specifications.

[0057] For example, if the database is MySQL, then the prescribed script template is as follows:

[0058] The SQL statement is: `alter tabledispute.dispute_base_case_info modify `ID_CASE`varchar(15)NULL DEFAULT NULL COMMENT`. Here, `id_case` and `varchar(15)` are replaceable.

[0059] For each field that does not conform to the specifications, a script is generated. Then, multiple scripts are compressed to generate a script prompt message in the form of a compressed package.

[0060] The above process is actually an automated data completion method, which automatically fills in information according to a preset script template and generates processing comment script information. For example, if the comment information in the `dispute_case_info` table of the `DISPUTE` dataset is insufficient, the comments are empty, or the comment fields are duplicated, the program automatically obtains the data structure information of the fields where the current field is empty and automatically generates modified comment script information. This method greatly improves the efficiency of data inspection and data table repair.

[0061] Furthermore, the step of sending script prompts to the developer's terminal corresponding to the target data table includes:

[0062] Find the owner information of the target data table; based on the owner information, obtain the corresponding developer's contact information from the owner system; send the script prompt information to the terminal corresponding to the contact information.

[0063] In practice, the system owner information is determined based on the owner information in the table. The owner system is queried, and if the disputed system information is found, the developer's email address is obtained and dynamically sent to the email address of the current developer to inform the developer to fix it.

[0064] The database integrity repair method provided in this application has the following advantages:

[0065] 1. Automation: Improve data completeness through automation technologies and algorithms, reduce manual workload, and lower error rates.

[0066] 2. Intelligentization: Utilize intelligent algorithms to identify the reasons for insufficient data completeness and provide targeted solutions for data governance.

[0067] 3. Sustainability: Monitor data completeness in real time and continuously optimize data governance processes to achieve continuous improvement in data quality.

[0068] 4. Configurable: Dynamically generates repair annotation information based on the syntax (same template) of different databases, with high scalability.

[0069] Based on the above method embodiments, this application also provides a database integrity rate repair device, see [link to relevant documentation]. Figure 4As shown, the device includes: a table acquisition module 42, used to acquire target data tables in a target database; the target database is a database whose metadata completeness rate is less than a preset threshold; a table detection module 44, used to detect whether the target data table meets the corresponding preset data specifications; a script generation module 46, used to generate script prompt information based on the table structure information of the target data table when the detection result of the table detection module is negative; the script prompt information is used to prompt relevant personnel to modify the table structure information; and a script sending module 48, used to send the script prompt information to the developer terminal corresponding to the target data table, so that the developer can modify the data table according to the script prompt information.

[0070] The database completeness repair device provided in this application is essentially an automated database completeness repair mode. It mainly uses data standardization technology and automation technology to generate scripts, which can quickly help developers manage completeness, greatly improve the efficiency of database completeness repair, and reduce labor and time costs.

[0071] Furthermore, the table acquisition module 42 described above is used to: detect target databases with metadata completeness rates less than a preset threshold; acquire all data tables in the target database; perform data cleaning on all data tables to obtain valid target data tables; data cleaning is used to remove backup tables, useless tables, and temporary tables.

[0072] Furthermore, the metadata completeness rate is calculated as follows: Metadata completeness rate = (Table-level metadata completeness rate + Field-level metadata completeness rate) * 50%; where, Table-level metadata completeness rate = Number of tables with valid Chinese names in the database / Total number of tables in the database; Field-level metadata completeness rate = Number of valid fields in all tables in the database / Total number of fields in all tables.

[0073] Furthermore, the aforementioned preset data specifications include at least one of the following: data type specifications, data length specifications, data format specifications, and data content specifications; the table detection module 44 is used to: determine whether the target data table meets each specification in the preset data specifications; if at least one specification is not met, then it is determined that the target data table does not meet the preset data specifications.

[0074] Furthermore, the script generation module 46 described above is used to: obtain the target fields in the table structure information of the target data table, wherein the target fields are related fields that do not meet the preset data specifications; for each target field, obtain the target script template corresponding to the target field, add the target field to the corresponding position of the target script template, and generate the comment script information corresponding to the target field; compress the comment script information corresponding to multiple target fields to obtain script prompt information.

[0075] Furthermore, the script generation module 46 is used to: obtain a preset script template set corresponding to the database type; the preset script template set includes script templates corresponding to multiple specifications respectively; and search for the target script template corresponding to the target specification item that the target field does not satisfy from the preset script template set.

[0076] Furthermore, the script sending module 48 described above is used to: find the owner information of the target data table; obtain the corresponding developer's communication information from the owner system based on the owner information; and send the script prompt information to the terminal corresponding to the communication information.

[0077] The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts of the device embodiment not mentioned can be referred to the corresponding content in the aforementioned method embodiment.

[0078] This application also provides an electronic device, such as... Figure 5 The diagram shows the structure of the electronic device, which includes a processor 51 and a memory 50. The memory 50 stores computer-executable instructions that can be executed by the processor 51. The processor 51 executes the computer-executable instructions to implement the following method steps:

[0079] Obtain the target data table from the target database; the target database is a database with a metadata completeness rate less than a preset threshold; check whether the target data table meets the corresponding preset data specifications; if not, generate script prompt information based on the table structure information of the target data table; the script prompt information is used to prompt relevant personnel to modify the table structure information; send the script prompt information to the developer terminal corresponding to the target data table so that the developer can modify the data table according to the script prompt information.

[0080] Furthermore, the steps for obtaining the target data tables in the target database include: detecting target databases with metadata completeness rates less than a preset threshold; obtaining all data tables in the target database; performing data cleaning on all data tables to obtain valid target data tables; and removing backup tables, useless tables, and temporary tables.

[0081] Furthermore, the metadata completeness rate is calculated as follows: Metadata completeness rate = (Table-level metadata completeness rate + Field-level metadata completeness rate) * 50%; where, Table-level metadata completeness rate = Number of tables with valid Chinese names in the database / Total number of tables in the database; Field-level metadata completeness rate = Number of valid fields in all tables in the database / Total number of fields in all tables.

[0082] Furthermore, the aforementioned preset data specifications include at least one of the following: data type specifications, data length specifications, data format specifications, and data content specifications; the step of detecting whether the target data table meets the corresponding preset data specifications includes: for each specification in the preset data specifications, determining whether the target data table meets it; if at least one specification is not met, then it is determined that the target data table does not meet the preset data specifications.

[0083] Furthermore, the steps described above for generating script prompt information based on the table structure information of the target data table include: obtaining the target fields from the table structure information of the target data table, wherein the target fields are fields that do not meet the preset data specifications; for each target field, obtaining the target script template corresponding to the target field, adding the target field to the corresponding position in the target script template, and generating the comment script information corresponding to the target field; and compressing the comment script information corresponding to multiple target fields to obtain the script prompt information.

[0084] Furthermore, the above-mentioned step of obtaining the target script template corresponding to the target field includes: obtaining a preset script template set corresponding to the database type; the preset script template set includes script templates corresponding to multiple specifications respectively; and searching for the target script template corresponding to the target specification item that the target field does not satisfy from the preset script template set.

[0085] Furthermore, the step of sending the script prompt information to the developer's terminal corresponding to the target data table includes: finding the owner information of the target data table; obtaining the corresponding developer's communication information from the owner system based on the owner information; and sending the script prompt information to the terminal corresponding to the communication information.

[0086] The electronic device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the embodiment of the electronic device can be referred to the corresponding content in the aforementioned method embodiment.

[0087] exist Figure 5 In the illustrated embodiment, the electronic device further includes a bus 52 and a communication interface 53, wherein the processor 51, the communication interface 53, and the memory 50 are connected via the bus 52.

[0088] The memory 50 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 53 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 52 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0089] The processor 51 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 51 or by instructions in software form. The processor 51 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor 51 reads the information in the memory and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiment.

[0090] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-described method. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.

[0091] The computer program products of the methods, apparatus, and electronic devices provided in the embodiments of this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementations, please refer to the method embodiments, which will not be repeated here.

[0092] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application.

[0093] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0094] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0095] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for repairing database completeness, characterized in that, The method includes: Obtain the target data table from the target database; the target database is a database whose metadata completeness rate is less than a preset threshold. Check whether the target data table meets the corresponding preset data specifications; If not, generate script prompt information based on the table structure information of the target data table; the script prompt information is used to prompt relevant personnel to modify the table structure information; The script prompt information is sent to the developer's terminal corresponding to the target data table, so that the developer can modify the data table according to the script prompt information. The step of generating script prompt information based on the table structure information of the target data table includes: Obtain the target field from the table structure information of the target data table, wherein the target field is a field that does not meet the preset data specifications; For each target field, obtain the target script template corresponding to the target field, add the target field to the corresponding position of the target script template, and generate the note script information corresponding to the target field; The remark script information corresponding to multiple target fields is compressed to obtain script prompt information; The steps for obtaining the target script template corresponding to the target field include: Obtain the preset script template set corresponding to the type of the database; the preset script template set includes script templates corresponding to multiple specifications; From the preset script template set, find the target script template corresponding to the target specification item that the target field does not satisfy.

2. The method according to claim 1, characterized in that, The steps to obtain the target data table from the target database include: Detect target databases whose metadata completeness is less than a preset threshold; Retrieve all data tables in the target database; All the data tables are cleaned to obtain valid target data tables; the data cleaning is used to remove backup tables, useless tables, and temporary tables.

3. The method according to claim 2, characterized in that, The metadata completeness rate is calculated as follows: Metadata completeness rate = (Table-level metadata completeness rate + Field-level metadata completeness rate) 50%; Wherein, the table-level metadata completeness rate = the number of tables with valid Chinese names in the database / the total number of tables in the database; the field-level metadata completeness rate = the number of valid fields in all tables in the database / the total number of fields in all tables.

4. The method according to claim 1, characterized in that, The preset data specifications include at least one of the following: data type specifications, data length specifications, data format specifications, and data content specifications; The steps for detecting whether the target data table meets the corresponding preset data specifications include: For each specification in the preset data specifications, determine whether the target data table meets the requirements; If at least one specification is not met, then the target data table is determined not to meet the preset data specification.

5. The method according to claim 1, characterized in that, The step of sending the script prompt information to the developer's terminal corresponding to the target data table includes: Locate the owner information of the target data table; Based on the owner information, obtain the corresponding developer's communication information from the owner system; The script prompt information is sent to the terminal corresponding to the communication information.

6. A database integrity repair device, characterized in that, The device includes: The table acquisition module is used to acquire target data tables in the target database; the target database is a database whose metadata completeness rate is less than a preset threshold. The table detection module is used to detect whether the target data table meets the corresponding preset data specifications. The script generation module is used to generate script prompt information based on the table structure information of the target data table when the detection result of the table detection module is negative; the script prompt information is used to prompt relevant personnel to modify the table structure information. The script sending module is used to send the script prompt information to the developer terminal corresponding to the target data table, so that the developer can modify the data table according to the script prompt information. The script generation module is specifically used for: Obtain the target field from the table structure information of the target data table, wherein the target field is a field that does not meet the preset data specifications; For each target field, obtain the target script template corresponding to the target field, add the target field to the corresponding position of the target script template, and generate the note script information corresponding to the target field; The remark script information corresponding to multiple target fields is compressed to obtain script prompt information; The script generation module is specifically used for: Obtain the preset script template set corresponding to the type of the database; the preset script template set includes script templates corresponding to multiple specifications; From the preset script template set, find the target script template corresponding to the target specification item that the target field does not satisfy.

7. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data verification method and device based on biological recognition technology and computer equipment

    CN113742776A