A database schema evaluation system and method
By defining database schema evaluation criteria and automated matching evaluation rules, the problems of error-prone and inefficient manual evaluation in existing technologies are solved, and the automation and quality assurance of database schema design are achieved.
Patent Information
- Application Number
- CN202111374603.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-11-19
AI Technical Summary
The existing manual evaluation of database schema design is prone to errors and inefficient, and the evaluation methods are not unified among different expert teams, making it difficult to ensure the quality of database schema design.
A database schema evaluation system and method are designed. By defining database schema evaluation criteria, including standard structure tree, standard data table and evaluation rules, the database schema is automatically matched and evaluated, thus realizing automatic evaluation of the database schema design of the software system.
It realizes the automated evaluation of database schema design, improves the accuracy and efficiency of evaluation, and ensures the quality of database schema design.
Smart Images

Figure CN114138742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database-related technologies, and in particular to a database schema evaluation system and method. Background Art
[0002] A database schema is a structure described in a formal language and is a collection of database objects. In a relational database, the schema defines the tables, the fields within each table, and the relationships between tables and fields based on a standard structure tree.
[0003] Good database schema design is crucial for ensuring software system functionality, data quality, and inter-system data sharing. The traditional approach to ensuring database schema design quality is to adhere to specific data standards and organize expert evaluations based on these standards. This evaluation process requires multiple rounds of manual intervention by experts, is cumbersome, error-prone, and time-consuming. Furthermore, the evaluation methods used by different expert teams may differ from one another, hindering the effective implementation of database schema improvements based on data standards.
[0004] Therefore, it is necessary to design a method that can express data standards in a structured manner and realize automatic evaluation of software system database schema design. Summary of the Invention
[0005] The purpose of the present invention is to provide a database schema evaluation system and method to solve the problem that manual evaluation of existing database schema design is prone to errors and inefficient, and to ensure the quality of database schema design.
[0006] The first object of the present invention is to provide a database schema evaluation method, comprising the following steps:
[0007] 1) Define database schema evaluation criteria;
[0008] 2) Connect to the database to be evaluated and obtain the database schema;
[0009] 3) Based on the database schema evaluation criteria, the database schema to be evaluated, and the field matching rules, search and match the standard data table and determine the matching results;
[0010] 4) Perform database schema evaluation.
[0011] Preferably, the evaluation criteria for defining a database schema include:
[0012] 1) defining a standard structure tree for the database schema evaluation criteria;
[0013] 2) defining a standard data table for the database schema evaluation standard, including a standard data table name, a list of synonyms for the standard data table name, a standard data table description, and its location on the standard structure tree; the standard data table name must be unique within a database schema evaluation standard;
[0014] 3) defining fields for the standard data table, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between the standard data tables defined by the fields;
[0015] 4) Defining evaluation rules for the standard data table.
[0016] Preferably, the standard data table can inherit any fields and evaluation rules of any standard data table under the parent node according to the standard structure tree.
[0017] Preferably, the evaluation rules include at least one of the following types: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints.
[0018] Preferably, the executing database schema evaluation includes: evaluating the data table to be evaluated according to the evaluation rules defined in the matching standard data table that matches the data table to be evaluated, and obtaining the evaluation result of the database schema to be evaluated in combination with the matching result.
[0019] The evaluation results of the database schema to be evaluated include:
[0020] 1) The matching results between the data table to be evaluated and the matching standard data table;
[0021] 2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact matching fields and matching fields;
[0022] 3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results.
[0023] Preferably, the evaluation rules may define evaluation rules for other referenced standard data tables and fields thereof based on reference relationships.
[0024] Preferably, before searching and matching the standard data table, the following steps are used to define the field matching rules between the database schema evaluation criteria and the database schema to be evaluated:
[0025] 1) Select a standard data table in the database schema evaluation criteria and extract fields from the standard data table;
[0026] 2) Select the fields of the data table to be evaluated in the database schema to be evaluated, and associate them with the fields of the extracted standard data table;
[0027] 3) Define the association between the fields of the data table to be evaluated and the fields of the standard data table as field matching rules.
[0028] Preferably, the field matching rule definition further includes at least one of the following methods:
[0029] 1) The standard data sheet and the data sheet to be evaluated can be matched one to one;
[0030] 2) The standard data table and the data table to be evaluated can be matched one-to-many;
[0031] 3) The standard data table and the data table to be evaluated can be matched many-to-one;
[0032] 4) Standard data tables and data tables to be evaluated can be matched many-to-many.
[0033] A second object of the present invention is to provide a database schema evaluation system, comprising:
[0034] 1) Database Schema evaluation criteria definition module, used to define database Schema evaluation criteria;
[0035] 2) The module for obtaining the schema of the database to be evaluated is used to connect to the database to be evaluated and obtain the schema of the database to be evaluated;
[0036] 3) Standard data table search and matching module, used to search and match standard data tables based on database schema evaluation criteria, the database schema to be evaluated, and field matching rules, and determine the matching results;
[0037] 4) Database Schema evaluation execution module, used to perform database Schema evaluation.
[0038] Preferably, the database Schema evaluation standard definition module includes:
[0039] 1) A standard structure tree definition submodule, used to define a standard structure tree for the database schema evaluation standard;
[0040] 2) A standard data table definition submodule, which is used to define a standard data table for the database schema evaluation standard, including the standard data table name, a list of synonyms for the standard data table name, a standard data table description, and its position on the standard structure tree; the standard data table name is unique within a database schema evaluation standard;
[0041] 3) A field definition submodule, which is used to define fields for the standard data table, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between standard data tables defined by the fields;
[0042] 4) An evaluation rule definition submodule, used to define evaluation rules for the standard data table.
[0043] Preferably, the evaluation rules include at least one of the following types: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints.
[0044] Preferably, the database Schema evaluation execution module includes: a data table evaluation sub-module for evaluating the data table to be evaluated, which is used to evaluate the data table to be evaluated according to the evaluation rules defined in the matching standard data table that matches the data table to be evaluated; and a database Schema evaluation result acquisition sub-module for obtaining the database Schema evaluation result in combination with the matching result.
[0045] Preferably, the schema evaluation result of the database to be evaluated includes:
[0046] 1) The matching results between the data table to be evaluated and the matching standard data table;
[0047] 2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact matching fields and matching fields;
[0048] 3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results.
[0049] Preferably, a module for defining field matching rules between database schema evaluation criteria and the database schema to be evaluated is also included, including:
[0050] 1) A standard data table field extraction submodule is used to select a standard data table in the database schema evaluation standard and extract fields from the standard data table;
[0051] 2) the sub-module for associating the fields of the data table to be evaluated with the fields of the standard data table, used for selecting the fields of the data table to be evaluated in the database Schema to be evaluated, and associating the selected fields with the extracted fields of the standard data table;
[0052] 3) the sub-module for defining the field matching rules, used for associating the fields of the data table to be evaluated with the fields of the standard data table and defining the association as the field matching rules.
[0053] The present application has the following beneficial effects compared with the prior art: the present application provides a database Schema evaluation system and method, which realizes automatic evaluation of the database Schema design of a software system by structurally expressing data standards and designing matching and evaluation rules, solves the problems of easy errors and low efficiency in manual evaluation of the database Schema, and guarantees the quality of the database Schema design. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1a and Figure 1b Method flowcharts of two embodiments of the method of the present application.
[0055] Figure 2 Standard structure tree diagram of the database Schema evaluation standard of the embodiment of the present application.
[0056] Figure 3 Standard data representation diagram of the database Schema evaluation standard of the embodiment of the present application.
[0057] Figure 4 Schematic diagram of the database Schema to be evaluated of the embodiment of the present application.
[0058] Figure 5 、 6 Field matching rule diagram of the embodiment of the present application.
[0059] Figure 8 Schematic diagram of the comparison between the completely matched fields of the data table to be evaluated book_type and the matched standard data table book_type of the embodiment of the present application.
[0060] Figure 9 Schematic diagram of the comparison between the incompletely matched fields of the data table to be evaluated tushu and the matched standard data table book of the embodiment of the present application.
[0061] Figure 10 Schematic diagram of the comparison between the incompletely matched fields of the data table to be evaluated account and the matched standard data table user of the embodiment of the present application.
[0062] Figure 11This is a schematic diagram of fields of the borrow_record data table to be evaluated that does not have a matching standard data table according to an embodiment of the present invention.
[0063] Figure 12a and Figure 12b 2 is a principle block diagram of two embodiments of the system of the present invention. DETAILED DESCRIPTION
[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 making creative efforts are within the scope of protection of the present invention.
[0065] Example 1
[0066] See also Figure 1a This embodiment provides a database schema evaluation method, including the following steps:
[0067] Step S101: Define the database schema evaluation criteria, including defining the standard structure tree, standard data table, standard data table fields, and standard data table evaluation rules. The details are as follows:
[0068] The step S101 includes:
[0069] (1) defining a standard structure tree for the database schema evaluation criteria;
[0070] (2) defining a standard data table for the database schema evaluation criteria, which is also called a standard table. The standard data table includes a standard data table name, a list of synonyms for the standard data table name, a standard data table description, and a location on the standard structure tree. The standard data table name is unique within a database schema evaluation criterion;
[0071] (3) defining fields for the standard data tables, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between the standard data tables defined by the fields;
[0072] (4) Define evaluation rules for the standard data table.
[0073] The standard data table can inherit any fields and evaluation rules of any standard data table under the parent node according to the standard structure tree.
[0074] The evaluation rules are defined according to the application scenario of the database schema evaluation standard, and include at least one of the following evaluation rules: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints.
[0075] The evaluation rule of the standard data table name is to evaluate the data table name to be evaluated according to the standard data table name definition;
[0076] The evaluation rule of the standard data table field name is to evaluate the data table field name to be evaluated according to the standard data table field name definition;
[0077] The evaluation rules of the standard data table field type are to evaluate the data table field type to be evaluated according to the standard data table field type definition;
[0078] The evaluation rule of the standard data table field constraint is to evaluate the data table field constraint to be evaluated according to the standard data table field constraint definition.
[0079] The evaluation rules may define evaluation rules for other referenced standard data tables and their fields based on reference relationships.
[0080] See also Figure 2 ,This embodiment constructs a standard structure tree including two nodes, where: 1. L0 is the root node of the standard structure tree, with a sequence number of 1, a parent node of empty, and a level of one;
[0081] 2. L1 is the child node of L0, with the sequence number 1-1, the parent node is L0, and the level is level 2.
[0082] See also Figure 3 In this embodiment, four standard data tables are constructed, each of which contains fields in its own table, where:
[0083] 1. Basic data table, standard table name: base_table, standard table name synonym list: [jichu_biao], standard table description: basic data, standard structure: L0, the table contains two fields:
[0084] Field name: is_deleted, Field name synonym list: [ deleted ], Field type: bool, Field constraint: None, Field description: Whether it has been deleted.
[0085] Field name: created_at, Field name synonym list: [], Field type: datetime, Field constraint: None, Field description: Creation time.
[0086] 2. Book type table, standard table name: book_type, standard table name synonym list: [tushu_type, tushu_leixing, tushu_lx], standard table description: book type, standard structure: L0 / L1, the table contains two fields:
[0087] a) Field name: id, Field name synonym list: None, Field type: long, Field constraint: Not nullable, Field description: Book type id.
[0088] b) Field name: name, Field name synonym list: [type_name], Field type: string, Field constraints: cannot be empty, length less than 50, Field description: Book type name.
[0089] 3. Book table, standard table name: book, standard table name synonym list: [tushu], standard table description: book, standard structure: L0 / L1, the table contains five fields:
[0090] a) Field name: id, Field name synonym list: None, Field type: long, Field constraint: Not nullable, Field description: Book id.
[0091] b) Field name: name, Field name synonym list: [book_name, tushu_name] Field type: string, Field constraints: cannot be empty, length less than 50, Field description: Book name.
[0092] c) Field name: type_id, Field name synonym list: None, Field type: long, Field constraint: Not nullable, Field description: Book type id.
[0093] d) Field Name: type_name, Field Name Synonym List: None, Field Type: string, Field Constraints: Not nullable, length less than 50, Field Description: Book type name. This field is referenced from the name field in the standard table book_type.
[0094] e) Field name: total, Field name synonym list: [zongshu, heji], Field type: intunsigned, Field constraint: cannot be empty, Field description: Total number of books.
[0095] 4. User table, standard table name: user, standard table name synonym list: [account], standard table description: user, standard structure: L0 / L1, the table contains four fields:
[0096] a) Field name: id, Field name synonym list: None, Field type: long, Field constraint: Not nullable, Field description: User id.
[0097] b) Field name: email, Field name synonym list: [youjian], Field type: string, Field constraints: cannot be empty, length less than 50, Field description: email.
[0098] c) Field name: password, Field name synonym list: [pw], Field type: string, Field constraint: Not nullable, Field description: Password.
[0099] d) Field name: name, Field name synonym list: [username, account_name], Field type: string, Field constraints: cannot be empty, length less than 50, Field description: name.
[0100] In this embodiment, seven evaluation rules are constructed based on the above standard data table:
[0101] 1. In the standard data table base_table, the is_deleted field is evaluated as qualified when the type is bool, and as unqualified when it is any other type. This evaluation rule applies to the name field type of the standard data table.
[0102] 2. In the standard data table base_table, if the created_at field type is datetime, it is evaluated as qualified; if it is any other type, it is evaluated as unqualified. This evaluation rule applies to the standard data table name field type.
[0103] 3. In the standard data table book, the total field type is evaluated as excellent when it is int unsigned, qualified when it is int, and unqualified when it is other types. This evaluation rule applies to standard data table field types.
[0104] 4. In the standard data table "book", the evaluation for the total field name is "total", the evaluation is excellent, the evaluation for "zongshu" or "heji" is qualified, and the evaluation for other names is unqualified. This evaluation rule applies to the evaluation rules for the field names of standard data tables.
[0105] 5. In the standard data table "book," the type_name field is evaluated as qualified if it is of string type and has a maximum length constraint; otherwise, it is evaluated as unqualified. This evaluation rule applies to both standard data table field types and constraints. In this embodiment, the type_name field is referenced from the name field in the standard data table "book_type." This evaluation rule also applies to the name field in the standard data table "book_type."
[0106] 6. In the standard data table "book", the evaluation is excellent when the data table name is "book", qualified when it is "tushu", and unqualified when it is any other name. This evaluation rule applies to standard data table names.
[0107] 7. In the standard data table "user," the "name" field is evaluated as qualified if it is of string type and has a maximum length constraint; otherwise, it is evaluated as unqualified. This evaluation rule applies to both standard data table field types and constraints.
[0108] In this embodiment, the standard data tables book_type, book, and user are located at L0 / L1 in the standard structure tree and can inherit any fields and evaluation rules from any standard data table under the parent node. For example, the standard data tables book_type, book, and user inherit the is_deleted field from the standard data table base_table on the parent node L0. The standard data table book_type inherits the evaluation rule of the standard data table base_table on the parent node L0: "In the standard data table base_table, if the is_deleted field type is bool, it is evaluated as qualified; if it is any other type, it is evaluated as unqualified."
[0109] Step S102: Connect to the database to be evaluated and obtain the schema of the database to be evaluated.
[0110] See also Figure 4 In step S102 of this embodiment, the schema of the database to be evaluated is obtained, which includes obtaining the name and description of the data table to be evaluated in the schema of the database to be evaluated, as well as the field names, field types, field constraints, field descriptions of the fields contained in the data table to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields. The data table to be evaluated is also called the table to be evaluated.
[0111] The "reference relationship" of the "reference relationship between the standard data tables defined by the fields" and the "reference relationship between the data tables to be evaluated defined by the fields" refers to the foreign key of the relational database. For example, the book table and the borrowing record table, the book ID in the borrowing record table corresponds to the ID of the book table. For example Figure 4 The to-be-evaluated database Schema of the embodiment includes four to-be-evaluated data tables:
[0112] 1. Book type table
[0113] To-be-evaluated table name: book_type; to-be-evaluated table description: book type; the table contains three fields:
[0114] a) Field name: id; field type: long; field constraint: not null; field description: book type id.
[0115] b) Field name: name; field type: string; field constraint: not null, length less than 50; field description: book type name.
[0116] c) Field name: is_deleted; field type: bool; field constraint: none; field description: whether it has been deleted.
[0117] 2. Book table
[0118] To-be-evaluated table name: tushu; to-be-evaluated table description: book; the table contains five fields:
[0119] a) Field name: id; field type: long; field constraint: not null; field description: book id.
[0120] b) Field name: tushu_name; field type: string; field constraint: not null, length less than 50; field description: book name.
[0121] c) Field name: type_id; field type: long; field constraint: not null; field description: book type id.
[0122] d) Field name: total; field type: int; field constraint: not null; field description: total number of books.
[0123] e) Field name: is_deleted; field type: bool; field constraint: none; field description: whether it has been deleted.
[0124] 3. Account table
[0125] To-be-evaluated table name: account; to-be-evaluated table description: account; the table contains five fields:
[0126] a) Field name: id; Field type: long; Field constraint: cannot be empty; Field description: user id.
[0127] b) Field name: email; Field type: string; Field constraints: cannot be empty, length less than 50; Field description: email.
[0128] c) Field name: password; Field type: string; Field constraint: cannot be empty; Field description: password.
[0129] d) Field name: name; Field type: string; Field constraints: cannot be empty, length less than 50; Field description: name.
[0130] e) Field name: is_deleted; Field type: bool; Field constraint: None; Field description: Whether it has been deleted.
[0131] 4. Borrowing Record Sheet
[0132] The name of the table to be evaluated is borrow_record; the description of the table to be evaluated is borrowing record; the table contains six fields:
[0133] a) Field name: record_id; Field type: long; Field constraint: cannot be empty; Field description: Borrowing record ID.
[0134] b) Field name: account_id; Field type: long; Field constraint: cannot be empty; Field description: Account ID.
[0135] c) Field name: tushu_id; Field type: long; Field constraint: cannot be empty; Field description: book ID.
[0136] d) Field name: borrow_time; Field type: datetime; Field constraint: cannot be null; Field description: Borrowing time.
[0137] e) Field name: is_returned; Field type: bool; Field constraint: None; Field description: Whether the item has been returned.
[0138] f) Field name: return_time; Field type: datetime; Field constraint: None; Field description: Return time.
[0139] Step S103: defining the field matching rules between the database schema evaluation criteria and the database schema to be evaluated;
[0140] Step S104 searches and matches the standard data table, which needs to be searched and matched according to the field matching rules. The evaluation system of this embodiment includes two field matching rules, which do not need to be defined. This step S103 defines a set of field matching rules between the database schema evaluation criteria and the database schema to be evaluated, in addition to the two field matching rules of the system itself. It includes the following steps:
[0141] Select the standard data table in the database schema evaluation criteria and extract the fields in the standard data table;
[0142] Select step S102 to obtain the fields of the data table to be evaluated in the schema of the database to be evaluated, associate them with the fields of the standard data table selected above, and define them as field matching rules.
[0143] See also Figure 5 The following is an example of constructing field matching rules between the standard data table book and the data table to be evaluated tushu, where:
[0144] 1. The standard field ID is associated with the field ID to be evaluated;
[0145] 2. The standard field type_id is associated with the field type_id to be evaluated;
[0146] 3. The standard field type_name is associated with the field type_name to be evaluated;
[0147] 4. The standard field total is associated with the field total to be evaluated;
[0148] 5. The standard field is_deleted is associated with the field to be evaluated is_deleted.
[0149] The field matching rules can also be defined across tables. The field matching rules between the standard data table and the data table to be evaluated can include at least one of the following methods:
[0150] 1) The standard data sheet and the data sheet to be evaluated can be matched one to one;
[0151] 2) The standard data table and the data table to be evaluated can be matched one-to-many;
[0152] 3) The standard data table and the data table to be evaluated can be matched many-to-one;
[0153] 2) Standard data tables and data tables to be evaluated can be matched many-to-many.
[0154] join Figure 6, build the field matching rules between the standard data table base_table and the data table to be evaluated tushu, where: the standard field is_deleted is associated with the field to be evaluated is_deleted; Figure 7 , constructing a field matching rule between the standard data table base_table and the table to be evaluated, account. The standard field is_deleted is associated with the field to be evaluated, is_deleted. This is an example of defining a field matching rule across tables and in a many-to-many relationship.
[0155] The step S103 for defining the field matching rules may also be omitted. When step S103 is omitted, the evaluation system only performs field matching based on the two field matching rules within the system. If step S103 is not omitted, in addition to performing field matching based on the two field matching rules when step S103 is omitted, field matching may also be performed based on the defined field matching rules.
[0156] Step S104: searching and matching the standard data table to determine the matching result;
[0157] In this embodiment, the search for matching standard data tables and determination of matching results refers to searching for standard data tables that are fully matched or partially matched with the data table to be evaluated based on the database schema evaluation criteria, the database schema to be evaluated, and the field matching rules. The search and matching methods include the following three:
[0158] (1) Search and match method 1
[0159] In the database schema evaluation criteria, search for a standard data table with the same name as the data table to be evaluated. If a standard data table with the same name as the data table to be evaluated exists in the database schema evaluation criteria, determine that the standard data table is a matching standard data table and perform the following operations:
[0160] Extract matching standard data table fields and select the data table fields to be evaluated one by one;
[0161] Search for completely matching fields in matching standard data table fields through the field names, field types, field constraints of the data table to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields;
[0162] If all fields in the data table to be evaluated have exact matching fields in the matching standard data table fields, the matching result is an exact match; if any field in the data table to be evaluated does not have an exact matching field in the matching standard data table fields, the matching result is an incomplete match.
[0163] (2) Search and match method 2
[0164] In the database Schema evaluation standard, find the standard data table with the same name as the data table to be evaluated. If there is no standard data table with the same name as the data table to be evaluated in the database Schema evaluation standard, find the standard data table in the database Schema evaluation standard whose standard data table name synonym list contains the name of the data table to be evaluated. If there is a standard data table in the database Schema evaluation standard whose standard data table name synonym list contains the name of the data table to be evaluated, determine that the standard data table is a matching standard data table:
[0165] Extract the matching standard data table fields, and select the data table fields to be evaluated one by one;
[0166] Search for matching fields one by one in the standard data table whose standard data table name synonym list contains the name of the data table to be evaluated through the field name, field type, field constraint, reference relationship between the data tables defined by the field, and the matching rule associated with the field. Select the standard data table with the maximum number of matching fields and the number of matching fields not being 0, determine that the standard data table is a matching standard data table and the matching result is an incomplete match. If the maximum number of matching fields is 0, determine that there is no matching standard data table in one or more standard data tables whose standard data table name synonym list contains the name of the data table to be evaluated.
[0167] (3) Method three of finding and matching
[0168] In the database Schema evaluation standard, find the standard data table with the same name as the data table to be evaluated. If there is no standard data table with the same name as the data table to be evaluated in the database Schema evaluation standard, find the standard data table in the database Schema evaluation standard whose standard data table name synonym list contains the name of the data table to be evaluated. If there is no standard data table in the database Schema evaluation standard whose standard data table name synonym list contains the name of the data table to be evaluated, then:
[0169] Search for matching fields in the database Schema evaluation standard through the field name, field type, field constraint, reference relationship between the data tables defined by the field, and the field matching rule associated with the field of the data table to be evaluated;
[0170] Select the matching field number, if the standard data table with the maximum number of matching fields and the number of matching fields is not 0, determine that the standard data table is a matching standard data table and the matching result is an incomplete match. If the maximum number of matching fields is 0, determine that there is no matching standard data table.
[0171] The fully matched fields refer to fields whose field names, field types, field constraints and reference relationships between the data tables to be evaluated defined by the fields in the data table to be evaluated are completely consistent with the field names, field types, field constraints and reference relationships between the standard data tables defined by the fields in the standard data table.
[0172] The above search and matching methods 1, 2, and 3 use the following three field matching rules:
[0173] 1) Field matching rule 1: Fields whose field names, field types, field constraints, and reference relationships between the data tables to be evaluated defined by the fields in the data table to be evaluated are completely consistent with those in the standard data table;
[0174] 2) Field matching rule 2: The field names in the data table to be evaluated are inconsistent with the field names in the standard data table, and the field names in the data table to be evaluated are included in the field name synonym list in the standard data table, and the field types, field constraints in the data table to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields are completely consistent with the field types, field constraints, and the reference relationships between the standard data tables defined by the fields in the data table to be evaluated.
[0175] 3) Field Matching Rule 3: When neither Field Matching Rules 1 nor 2 can find a matching field, Field Matching Rule 3 is used. Field Matching Rule 3 performs field matching based on the fields that are consistent with the standard data table and the data table to be evaluated, as determined by the matching rule defined in step S103.
[0176] The following is a specific example of step S104 in an embodiment of the present invention. In this example, the database schema to be evaluated includes four data tables to be evaluated: book_type, tushu, account, and borrow_record. The database schema evaluation criteria include four standard data tables: base_table, book_type, book, and user. The matching results are as follows:
[0177] 1. The table book_type of the data to be evaluated has the same name as the standard table book_type. The standard table book_type is determined to be the matching standard table for the table book_type of the data to be evaluated. According to the definition of the exact match field, all fields in the table book_type of the data to be evaluated have an exact match field in the matching standard table book_type: the exact match field of the field id of the field to be evaluated is the standard field id, the exact match field of the field name of the field to be evaluated is the standard field name, and the exact match field of the field is_deleted of the field to be evaluated is the standard field is_deleted. The matching result is an exact match.
[0178] 2. For the data table to be evaluated, tushu, there is no standard data table with the same name as the data table to be evaluated, tushu, in the database schema evaluation criteria. In this embodiment, the database schema evaluation criteria only include the standard table name synonym list [tushu] for the standard data table book, which includes the name of the data table to be evaluated, tushu. Based on the definition of matching fields, a matching field is searched for in the standard data table book. Step S103 defines the field matching rules between the standard data table book and the data table to be evaluated, tushu: the standard field id is associated with the field to be evaluated, id; the standard field type_id is associated with the field to be evaluated, type_id; the standard field type_name is associated with the field to be evaluated, type_name; the standard field total is associated with the field to be evaluated, total; and the standard field is_deleted is associated with the field to be evaluated, is_deleted. These five fields are matching fields. The synonym list for the standard field name is [book_name, tushu_name], which includes the field name of the field to be evaluated, tushu_name. If the field type, field constraints, and references between the data tables to be evaluated defined by the field are identical to those of the standard field name, then the matching field for the field to be evaluated, tushu_name, in the standard data table book, is the standard field name. The maximum number of matching fields is 6. Therefore, the standard data table book is determined to be the matching standard data table for the data table to be evaluated, and the matching result is an incomplete match.
[0179] 3. For the data table account to be evaluated, there is no standard data table with the same name as the data table to be evaluated in the database schema evaluation criteria. In this embodiment, the database schema evaluation criteria only include the standard table name synonym list [account] for the standard data table user, which includes the name of the data table to be evaluated. Based on the definition of matching fields, a matching field is searched in the standard data table user. The matching field for the field id to be evaluated is the standard field id, the matching field for the field password to be evaluated is the standard field password, the matching field for the field name to be evaluated is the standard field name, and the matching field for the field is_deleted to be evaluated is the standard field is_deleted. No matching field is found for the email field in the data table account to be evaluated in the standard data table user. The maximum number of matching fields is four. The standard data table user is determined to be the matching standard data table for the data table account to be evaluated, and the matching result is an incomplete match.
[0180] 4. For the table borrow_record to be evaluated, there is no standard table with the same name as the table to be evaluated in the database schema evaluation criteria. Nor is there a standard table whose synonym list includes the name account. Based on the definition of matching fields, a search for matching fields in the database schema evaluation criteria reveals that the maximum number of matching fields is 0, confirming that there is no matching standard table for the table borrow_record to be evaluated in the database schema evaluation criteria.
[0181] Step S105: Execute database schema evaluation. Executing database schema evaluation includes:
[0182] The data table to be evaluated is evaluated using the evaluation rules defined in the matching standard data table that matches the data table to be evaluated, and combined with the matching result determined in step S104, an evaluation result of the schema of the database to be evaluated is obtained. The evaluation result of the schema of the database to be evaluated includes:
[0183] (1) The matching results between the data table to be evaluated and the matching standard data table;
[0184] (2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the complete matching fields and matching fields;
[0185] (3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results.
[0186] The following is a specific example of step S105 in an embodiment of the present invention. In this example, the data table to be evaluated is evaluated using the evaluation rules defined in the matching standard data table that matches the data table to be evaluated. Combined with the matching result determined in step S104, an evaluation result of the schema of the database to be evaluated is obtained. The evaluation result of the schema of the database to be evaluated includes:
[0187] 1. Matching results between the data table to be evaluated and the matching standard data table:
[0188] (1) The standard data table book_type is the matching standard data table of the data table book_type to be evaluated, and the matching result is a complete match;
[0189] (2) The standard data table book is the matching standard data table of the data table to be evaluated tushu, and the matching result is an incomplete match;
[0190] (3) The standard data table user is the matching standard data table of the data table account to be evaluated, and the matching result is an incomplete match;
[0191] (4) The borrow_record data table to be evaluated does not have a matching standard data table in the database schema evaluation criteria.
[0192] 2. Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact match fields and matching fields:
[0193] (1) The total number of data tables to be evaluated is 4. The number of data tables to be evaluated with complete match, incomplete match, and no matching standard data table is 1, 2, and 1 respectively. The proportion of the number of data tables to be evaluated with the three matching results in the total number of data tables to be evaluated is 25%, 50%, and 25% respectively.
[0194] (2) The matching result of the data table book_type to be evaluated is a complete match. The total number of fields in the data table book_type to be evaluated is 3. The comparison between the fields of the data table book_type to be evaluated and the fields of the matching standard data table book_type is shown in Figure 8 .
[0195] (3) The matching result of the table tushu to be evaluated is an incomplete match. The total number of fields in the table tushu to be evaluated is 6, the number of completely matched fields is 4, and the number of matching fields is 2. The proportions of completely matched fields and matching fields in the total number of fields in the table to be evaluated are 67% and 33% respectively. The comparison between the fields in the table tushu to be evaluated and the fields in the matching standard table book is shown in Figure 9The matching result of the to-be-evaluated data table account is not complete matching, the total number of fields of the to-be-evaluated data table account is 5, the number of completely matched fields is 4, the number of matched fields is 0, and the proportions of the number of completely matched fields and the number of matched fields in the total number of fields of the to-be-evaluated data table are 80% and 0% respectively. The comparison of the fields of the to-be-evaluated data table account and the fields of the matched standard data table user is shown in Table 5. Figure 10 .
[0196] (4) The to-be-evaluated data table borrow_record does not have a matched standard data table in the database Schema evaluation standard, and the total number of fields is 6. The field information is shown in Table 6. Figure 11 .
[0197] 3. The evaluation rule defined in the matched standard data table is executed on the to-be-evaluated data table and the fields of the to-be-evaluated data table to obtain the evaluation rule result, including:
[0198] (1) The result obtained by executing the evaluation rule of the matched standard data table name on the to-be-evaluated data table name: through the evaluation rule defined in the standard data table book, the to-be-evaluated data table tushu is evaluated, the data table name of the to-be-evaluated data table tushu is tushu, and the evaluation result is qualified.
[0199] (2) The result obtained by executing the evaluation rule of the field name, the field type and the field constraint of the matched standard data table on the completely matched fields and the matched fields in the to-be-evaluated data table:
[0200] Through the evaluation rule defined in the standard data table book_type, the to-be-evaluated data table book_type is evaluated. In the to-be-evaluated data table book_type, the matched field is_deleted of the is_deleted field in the standard data table book_type is of the type bool, and the evaluation result is qualified. Here, the evaluation rule is executed on the evaluation rule inherited from the parent node;
[0201] Through the evaluation rule defined in the standard data table book, the to-be-evaluated data table book_type is evaluated according to the reference relationship. In the to-be-evaluated data table book_type, the matched field name of the name field in the standard data table book_type is of the type string and has a maximum length limit, and the evaluation result is qualified. Here, the evaluation rule is executed on the evaluation rule defined through the reference relationship;
[0202] The evaluation rule defined in the standard data table book is used to evaluate the to-be-evaluated data table tushu. In the to-be-evaluated data table tushu, the matching field total of the total field in the standard data table book is of the int type, and the evaluation result is qualified. In the to-be-evaluated data table tushu, the matching field name of the total field in the standard data table book is total, and the evaluation result is excellent. In the to-be-evaluated data table tushu, the matching field type_name of the type_name field in the standard data table book is of the string type and has a maximum length limit, and the evaluation result is qualified.
[0203] The evaluation rule defined in the standard data table user is used to evaluate the to-be-evaluated data table account. In the to-be-evaluated data table account, the name field is of the string type and has a maximum length limit, and the evaluation result is qualified.
[0204] The database Schema evaluation is performed through S105, and the matching result determined in step S104 is combined to obtain the to-be-evaluated database Schema evaluation result. A database Schema evaluation report can be output. The report can include the following aspects:
[0205] (1) the matching result of the to-be-evaluated data table and the matching standard data table;
[0206] (2) statistical analysis results obtained according to the matching result of the to-be-evaluated data table and the matching standard data table, and the completely matched field and the matching field;
[0207] (3) the evaluation rule result obtained by performing the evaluation rule defined in the matching standard data table on the to-be-evaluated data table and the to-be-evaluated data table field.
[0208] Embodiment 2
[0209] Another evaluation method is provided in this embodiment, and step S103 is omitted in this embodiment. At this time, the field matching rules used in the first, second, and third matching methods include only two kinds: the first field matching rule and the second field matching rule. As shown in Figure 1b , only steps S101, 102, 104, and 105 are used.
[0210] The implementation of steps S101 and S102 is referred to the previous example.
[0211] The implementation of step S104 is similar to the previous example. Since step S103 is omitted, in this embodiment, neither the database schema evaluation criteria nor the field matching rules for the database schema to be evaluated are defined. Therefore, the search and matching methods 1, 2, and 3 in step S104 use only the following two field matching rules:
[0212] 1) Field matching rule 1: Fields whose field names, field types, field constraints, and reference relationships between the data tables to be evaluated defined by the fields in the data table to be evaluated are completely consistent with those in the standard data table;
[0213] 2) Field matching rule 2: The field names in the data table to be evaluated are inconsistent with the field names in the standard data table, and the field names in the data table to be evaluated are included in the field name synonym list in the standard data table, and the field types, field constraints in the data table to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields are completely consistent with the field types, field constraints, and the reference relationships between the standard data tables defined by the fields in the data table to be evaluated.
[0214] The following is a specific example of step S104 of this embodiment. In this embodiment, the database schema to be evaluated includes four data tables to be evaluated: book_type, tushu, account, and borrow_record. The database schema evaluation criteria include four standard data tables: base_table, book_type, book, and user. The matching results are as follows:
[0215] 1. The table book_type of the data to be evaluated has the same name as the standard table book_type. The standard table book_type is determined to be the matching standard table for the table book_type of the data to be evaluated. According to the definition of the exact match field, all fields in the table book_type of the data to be evaluated have an exact match field in the matching standard table book_type: the exact match field of the field id of the field to be evaluated is the standard field id, the exact match field of the field name of the field to be evaluated is the standard field name, and the exact match field of the field is_deleted of the field to be evaluated is the standard field is_deleted. The matching result is an exact match.
[0216] 2. For the data table tushu to be evaluated, there is no standard data table with the same name as the data table tushu to be evaluated in the database schema evaluation criteria. In this embodiment, the database schema evaluation criteria only include the standard table name synonym list [tushu] for the standard data table book, which includes the name of the data table to be evaluated tushu. According to field matching rules one and two, a matching field is searched in the standard data table book: the matching field for the field id to be evaluated is the standard field id, the matching field for the field tushu_name to be evaluated is the standard field name, the matching field for the field type_id to be evaluated is not the standard field type_id, and the matching field for the field is_deleted to be evaluated is the standard field is_deleted. These four groups of fields are matching fields. The maximum number of matching fields is four. The standard data table book is determined to be the matching standard data table for the data table tushu to be evaluated, and the matching result is an incomplete match.
[0217] 3. For the data table account to be evaluated, there is no standard data table with the same name as the data table to be evaluated in the database schema evaluation criteria. In this embodiment, the database schema evaluation criteria only include the standard table name synonym list [account] for the standard data table user, which contains the name of the data table to be evaluated. According to field matching rules one and two, a matching field is searched in the standard data table user: the matching field for the field id to be evaluated is the standard field id, the matching field for the field password to be evaluated is the standard field password, the matching field for the field name to be evaluated is the standard field name, and the matching field for the field is_deleted to be evaluated is the standard field is_deleted. No matching field is found for the email field in the data table account to be evaluated in the standard data table user. The maximum number of matching fields is four. The standard data table user is determined to be the matching standard data table for the data table account to be evaluated, and the matching result is an incomplete match.
[0218] 4. For the table borrow_record to be evaluated, there is no standard table with the same name as the table to be evaluated in the database schema evaluation criteria. Nor is there a standard table whose synonym list includes the name account in the standard table name. Based on field matching rules 1 and 2, a search for matching fields in the database schema evaluation criteria reveals that the maximum number of matching fields is 0, confirming that there is no matching standard table for the table borrow_record to be evaluated in the database schema evaluation criteria.
[0219] The implementation of step S105 refers to the previous example.
[0220] The following is a specific example of step S105 in an embodiment of the present invention. In this embodiment, the data table to be evaluated is evaluated using the evaluation rules defined in the matching standard data table that matches the data table to be evaluated, and combined with the matching result determined in step S104, an evaluation result of the schema of the database to be evaluated is obtained. The evaluation result of the schema of the database to be evaluated includes:
[0221] (1) Matching results between the data table to be evaluated and the matching standard data table:
[0222] 1) The standard data table book_type is the matching standard data table for the data table book_type to be evaluated, and the matching result is a complete match;
[0223] 2) The standard data table book is the matching standard data table of the data table to be evaluated tushu, and the matching result is an incomplete match;
[0224] 3) The standard data table user is the matching standard data table for the data table account to be evaluated, and the matching result is an incomplete match;
[0225] 4) The borrow_record data table to be evaluated does not have a matching standard data table in the database schema evaluation criteria.
[0226] (2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the complete matching fields and matching fields:
[0227] 1) The total number of data tables to be evaluated is 4. The number of data tables to be evaluated with a complete match, an incomplete match, and no matching standard data table is 1, 2, and 1 respectively. The proportion of the number of data tables to be evaluated with the three matching results in the total number of data tables to be evaluated is 25%, 50%, and 25% respectively.
[0228] 2) The matching result of the table book_type to be evaluated is a complete match. The total number of fields in the table book_type to be evaluated is 3. The comparison between the fields of the table book_type to be evaluated and the fields of the matching standard table book_type is shown in Figure 8 .
[0229] 3) The matching result of the data table tushu to be evaluated is an incomplete match. The total number of fields in the data table tushu to be evaluated is 5, the number of fully matched fields is 3, the number of matched fields is 1, and the ratio of the number of fully matched fields to the number of matched fields in the total number of fields in the data table to be evaluated is 60% and 20% respectively. The matching result of the data table account to be evaluated is an incomplete match. The total number of fields in the data table account to be evaluated is 5, the number of fully matched fields is 4, the number of matched fields is 0, and the ratio of the number of fully matched fields to the total number of fields in the data table to be evaluated is 80% and 0% respectively. The comparison between the fields of the data table account to be evaluated and the fields of the matching standard data table user is shown in Figure 10 .
[0230] 4) The borrow_record table to be evaluated does not have a matching standard table in the database schema evaluation criteria. The total number of fields is 6. For field information, see Figure 11 .
[0231] (3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results, including:
[0232] 1) The result of executing the evaluation rule that matches the standard data table name on the data table name to be evaluated: The data table tushu to be evaluated is evaluated according to the evaluation rules defined in the standard data table book. The data table name of the data table tushu to be evaluated is tushu, and the evaluation result is qualified.
[0233] 2) The results of executing the evaluation rules for field names, field types, and field constraints defined in the matching standard data table for the fully matched fields and matching fields in the data table to be evaluated are as follows: The data table book_type to be evaluated is evaluated using the evaluation rules defined in the standard data table book_type. The matching field is_deleted in the standard data table book_type is of type bool, and the evaluation result is qualified. The data table book_type to be evaluated is evaluated using the evaluation rules defined in the standard data table book based on the reference relationship. The matching field name in the standard data table book_type is of type string and has a maximum length restriction, and the evaluation result is qualified. The data table tushu to be evaluated is evaluated using the evaluation rules defined in the standard data table book. In the data table tushu to be evaluated, the matching field type_name of the type_name field in the standard data table book is of type string and has a maximum length restriction, so the evaluation result is qualified. The data table account to be evaluated is evaluated using the evaluation rules defined in the standard data table user. In the data table account to be evaluated, the name field is of type string and has a maximum length restriction, so the evaluation result is qualified.
[0234] In this embodiment, according to field matching rules 1 and 2, the total field does not match, but since step S103 is omitted and no other rules are defined, the evaluation rule defined for the total field in the standard table here is not executed.
[0235] By performing database schema evaluation in step S105 and combining it with the matching result determined in step S104, the database schema evaluation result to be evaluated is obtained, and a database schema evaluation report can be output. The report may include the following aspects:
[0236] (1) The matching results between the data table to be evaluated and the matching standard data table;
[0237] (2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the complete matching fields and matching fields;
[0238] (3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results.
[0239] See also Figure 12a and 12b. These are two database schema evaluation system embodiments of the present invention. Figure 12a The database schema evaluation system of this embodiment includes: a database schema evaluation standard definition module 1, a database schema to be evaluated acquisition module 2, a field matching rule definition module 3 between the database schema evaluation standard and the database schema to be evaluated, a standard data table search and matching module 4, and a database schema evaluation execution module 5. Among them:
[0240] The database schema evaluation standard definition module 1 is used to define the database schema evaluation standard. It further includes:
[0241] 1) A standard structure tree definition submodule, used to define a standard structure tree for the database schema evaluation standard;
[0242] 2) A standard data table definition submodule, which is used to define a standard data table for the database schema evaluation standard, including the standard data table name, a list of synonyms for the standard data table name, a standard data table description, and its position on the standard structure tree; the standard data table name is unique within a database schema evaluation standard;
[0243] 3) A field definition submodule, which is used to define fields for the standard data table, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between standard data tables defined by the fields;
[0244] 4) An evaluation rule definition submodule, used to define evaluation rules for the standard data table.
[0245] The standard data table can inherit any fields and evaluation rules of any standard data table under the parent node according to the standard structure tree.
[0246] The evaluation rules include at least one of the following types: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints.
[0247] The evaluation rules may define evaluation rules for other referenced standard data tables and their fields based on reference relationships.
[0248] The database schema acquisition module to be evaluated is used to obtain the name of the data table to be evaluated and the description of the data table to be evaluated in the database schema to be evaluated, as well as the field names, field types, field constraints, field descriptions of the fields contained in the data table to be evaluated and the reference relationships between the data tables to be evaluated defined by the fields.
[0249] The module 2 for obtaining the schema of the database to be evaluated is used to connect to the database to be evaluated and obtain the schema of the database to be evaluated.
[0250] The field matching rule definition module 3 between the database schema evaluation criteria and the database schema to be evaluated includes:
[0251] 1) A standard data table field extraction submodule is used to select a standard data table in the database schema evaluation standard and extract fields from the standard data table;
[0252] 2) The submodule for associating fields of the data table to be evaluated with the standard data table is used to select and obtain fields of the data table to be evaluated in the database schema to be evaluated, and associate them with the fields of the extracted standard data table;
[0253] 3) A field matching rule definition submodule is used to define the association between the fields of the data table to be evaluated and the fields of the standard data table as field matching rules. The standard data table search and matching module 4 is used to search and match the standard data table according to the database schema evaluation criteria, the database schema to be evaluated and the field matching rules, and determine the matching result.
[0254] The database schema evaluation execution module 5 is used to perform database schema evaluation. It further includes: a data table evaluation submodule for evaluating the data table to be evaluated according to the evaluation rules defined in the matching standard data table that matches the data table to be evaluated; and a database schema evaluation result acquisition submodule for obtaining the database schema evaluation result based on the matching results.
[0255] The evaluation results of the database schema to be evaluated include:
[0256] 1) The matching results between the data table to be evaluated and the matching standard data table;
[0257] 2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact matching fields and matching fields;
[0258] 3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results.
[0259] like Figure 12b As shown, this embodiment and Figure 12a Compared with the embodiment, the field matching rule definition module 3 between the database schema evaluation standard and the database schema to be evaluated is omitted. Figure 12a and Figure 12bFor further explanation, please refer to the aforementioned Example 1 and Example 2 respectively.
[0260] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A database schema evaluation method, characterized in that: The following steps are involved: 1) Define database schema evaluation criteria; 2) Connect to the database to be evaluated and obtain the database schema; 3) Based on the database schema evaluation criteria, the database schema to be evaluated, and the field matching rules, search and match the standard data table and determine the matching results; The field matching rules include: searching for and obtaining completely matching fields and matching fields in the matching standard data table fields through the field names, field types, field constraints of the data table fields to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields; 4) Perform database schema evaluation; The evaluation criteria for defining the database schema include: 1) defining a standard structure tree for the database schema evaluation criteria; 2) defining a standard data table for the database schema evaluation standard, including a standard data table name, a list of synonyms for the standard data table name, a standard data table description, and its location on the standard structure tree; the standard data table name must be unique within a database schema evaluation standard; 3) defining fields for the standard data table, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between the standard data tables defined by the fields; 4) defining evaluation rules for the standard data table; The standard data table can inherit any fields and evaluation rules of any standard data table under the parent node according to the standard structure tree; The evaluation rules include at least one of the following types: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints; The performing of database schema evaluation includes: evaluating the data table to be evaluated according to the evaluation rules defined in the matching standard data table that matches the data table to be evaluated, and obtaining the evaluation result of the database schema to be evaluated in combination with the matching result; The evaluation results of the database schema to be evaluated include: 1) The matching results between the data table to be evaluated and the matching standard data table; 2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact matching fields and matching fields; 3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results, including: a. The result obtained by executing the evaluation rule matching the standard data table name on the data table name to be evaluated; b. Results obtained by executing the evaluation rules for field names, field types, and field constraints defined in the matching standard data table on the fully matched fields and the field names, field types, and field constraints of the matching fields in the data table to be evaluated. The evaluation results set by the evaluation rules include excellent, qualified, and unqualified. Among them, for the fields in the standard data table that declare reference relationships, when executing the evaluation rules, the evaluation rules defined by the reference relationships are executed.
2. The database schema evaluation method according to claim 1, characterized in that: Before searching and matching standard data tables, use the following steps to define the field matching rules between the database schema evaluation criteria and the database schema to be evaluated: 1) Select a standard data table in the database schema evaluation criteria and extract fields from the standard data table; 2) Select the fields of the data table to be evaluated in the database schema to be evaluated, and associate them with the fields of the extracted standard data table; 3) Define the association between the fields of the data table to be evaluated and the fields of the standard data table as field matching rules.
3. The database schema evaluation method according to claim 2, characterized in that The definition of field matching rules also includes at least one of the following methods: 1) The standard data sheet and the data sheet to be evaluated can be matched one to one; 2) The standard data table and the data table to be evaluated can be matched one-to-many; 3) The standard data table and the data table to be evaluated can be matched many-to-one; 4) Standard data tables and data tables to be evaluated can be matched many-to-many.
4. A database schema evaluation system, characterized in that: include: 1) Database Schema evaluation criteria definition module, used to define database Schema evaluation criteria; 2) The module for obtaining the schema of the database to be evaluated is used to connect to the database to be evaluated and obtain the schema of the database to be evaluated; 3) Standard data table search and matching module, used to search and match standard data tables based on database schema evaluation criteria, the database schema to be evaluated, and field matching rules, and determine the matching results; 4) Database Schema evaluation execution module, used to perform database schema evaluation; The field matching rules include: searching for and obtaining completely matching fields and matching fields in the matching standard data table fields through the field names, field types, field constraints of the data table fields to be evaluated, and the reference relationships between the data tables to be evaluated defined by the fields; The database Schema evaluation standard definition module includes: 1) A standard structure tree definition submodule, used to define a standard structure tree for the database schema evaluation standard; 2) A standard data table definition submodule, which is used to define a standard data table for the database schema evaluation standard, including the standard data table name, a list of synonyms for the standard data table name, a standard data table description, and its position on the standard structure tree; the standard data table name is unique within a database schema evaluation standard; 3) A field definition submodule, which is used to define fields for the standard data table, including field names, a list of field name synonyms, field types, field constraints, field descriptions, and reference relationships between standard data tables defined by the fields; 4) an evaluation rule definition submodule, used to define evaluation rules for the standard data table; The standard data table can inherit any fields and evaluation rules of any standard data table under the parent node according to the standard structure tree; the evaluation rules include at least one of the following types: evaluation rules for standard data table names, evaluation rules for standard data table field names, evaluation rules for standard data table field types, and evaluation rules for standard data table field constraints; The database schema evaluation execution module includes: a data table evaluation submodule for evaluating the data table to be evaluated according to the evaluation rules defined in the matching standard data table that matches the data table to be evaluated; a database schema evaluation result acquisition submodule for obtaining the database schema evaluation result based on the matching results; The evaluation results of the database schema to be evaluated include: 1) The matching results between the data table to be evaluated and the matching standard data table; 2) Statistical analysis results based on the matching results of the data table to be evaluated and the matching standard data table, as well as the exact matching fields and matching fields; 3) Execute the evaluation rules defined in the matching standard data table on the data table to be evaluated and the fields of the data table to be evaluated to obtain the evaluation rule results, including: a. The result obtained by executing the evaluation rule matching the standard data table name on the data table name to be evaluated; b. Results obtained by executing the evaluation rules for field names, field types, and field constraints defined in the matching standard data table on the fully matched fields and the field names, field types, and field constraints of the matching fields in the data table to be evaluated. The evaluation results set by the evaluation rules include excellent, qualified, and unqualified. Among them, for the fields in the standard data table that declare reference relationships, when executing the evaluation rules, the evaluation rules defined by the reference relationships are executed.
5. The database schema evaluation system according to claim 4, characterized in that It also includes a module for defining field matching rules between database schema evaluation criteria and the database schema to be evaluated, including: 1) A standard data table field extraction submodule is used to select a standard data table in the database schema evaluation standard and extract fields from the standard data table; 2) The submodule for associating fields of the data table to be evaluated with the standard data table is used to select and obtain fields of the data table to be evaluated in the database schema to be evaluated, and associate them with the fields of the extracted standard data table; 3) Field matching rule definition submodule, used to associate the fields of the data table to be evaluated with the fields of the standard data table to define field matching rules.
Citation Information
Patent Citations
Detection method and system for housing accumulation fund business system
CN108363751A
Database detection method and device
CN112181936A