Database table creation method and device, electronic equipment, storage medium and product

By determining the import method and syntax rule detection of table building data, and automatically creating database tables, the problem of professional knowledge required for database table creation in the existing technology is solved, and efficiency and accuracy are improved.

CN119149532APending Publication Date: 2024-12-17MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411124679.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the existing technology, the creation of database tables requires the participation of theories and professional knowledge of multiple databases, resulting in high labor costs, large technical thresholds and low efficiency.

Method used

By determining the import method of table building data, obtaining the target table building data, and using syntax rules to detect its legitimacy, automatically creating database tables, reducing dependence on professional knowledge.

Benefits of technology

It realizes automation of database table creation, reduces labor costs and technical thresholds, and improves creation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149532A_ABST
    Figure CN119149532A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a database table creating method and device, electronic equipment, a storage medium and a product. The method comprises the following steps: determining an import mode of table building data; obtaining target table building data according to the import mode; detecting the target table building data by adopting a grammar rule to obtain a target detection result; and creating the target database table corresponding to the target table creation data based on the target detection result, thereby realizing no need of participation of personnel with theories and professional knowledge of various databases, and improving the creation efficiency and accuracy of the database table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device, storage medium and product for creating a database table. Background Art

[0002] Database tables are the basic components of relational database management systems (RDBMS), which are mainly used to store and manage data. In related technologies, when designing and creating database tables, the creation of database tables requires the participation of personnel with various database theories and professional knowledge to effectively improve the creation quality of database tables and ensure efficient management and use of data. This not only increases the labor cost of database table creation, but also is not conducive to improving the efficiency of database table creation. Summary of the invention

[0003] In view of the deficiencies in the prior art, the present application provides a database table creation method, device, electronic device, readable storage medium and product, which can not only reduce the labor cost of database table creation and improve the efficiency of database table creation, but also lower the technical threshold for database table creation.

[0004] To solve the above problems, in a first aspect, the present application provides a method for creating a database table, which comprises:

[0005] Determine the method for importing table data;

[0006] Obtain the target table data based on the import method;

[0007] Use grammar rules to detect the target table data and obtain the target detection result;

[0008] Create a target database table corresponding to the target table data based on the target detection results.

[0009] In a second aspect, the present application also provides a database table creation device, which includes:

[0010] A determination unit is used to determine the import method of the table creation data;

[0011] The acquisition unit is used to acquire the target table creation data according to the import method;

[0012] A detection unit, used to detect the target table data using grammatical rules to obtain a target detection result;

[0013] The creation unit is used to create a target database table corresponding to the target table creation data based on the target detection result.

[0014] In a third aspect, the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads the instructions from the memory to execute the database table creation method of the first aspect.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for a processor to load and execute the database table creation method of the first aspect.

[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, where the computer program or instructions are executed by a processor to implement the database table creation method of the first aspect.

[0017] In the database table creation method provided in the present application, the target table creation data is obtained by determining the import method of the table creation data, and after the target table creation data is obtained, the grammatical rules are used to detect the target table creation data to determine whether the target table creation data meets the requirements for creating a target database table, and after the target table creation data meets the requirements, the target database table corresponding to the target table creation data is created, thereby realizing automatic construction of the database table without the participation of personnel with theoretical and professional knowledge of multiple databases, thereby improving the efficiency and accuracy of database table creation. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A schematic diagram of a first process for creating a database table in the prior art;

[0020] Figure 2 A second flow chart showing the creation of a database table in the prior art;

[0021] Figure 3 An application scenario diagram of the database table creation method provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of a first process of a method for creating a database table provided in an embodiment of the present application;

[0023] Figure 5 A first implementation schematic diagram of the database table creation method provided in an embodiment of the present application;

[0024] Figure 6 A second implementation schematic diagram of the database table creation method provided in an embodiment of the present application;

[0025] Figure 7 A second flow chart of the method for creating a database table provided in an embodiment of the present application;

[0026] Figure 8 A schematic diagram of a database table creation device provided in an embodiment of the present application;

[0027] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0030] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0031] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0032] The database table creation mentioned in this application refers to the fact that in storage management, the database will create a mapping table for each process, each column contains a specific type of information of all authors, and each row contains all the information of a segment or page. In the database, a table is an object used to store data in the database. It is a collection of structured data and the basis of the entire database.

[0033] In the related art, there are two ways to create a database table: manually creating a database table and manually combining a database table to create a system. Figure 1As shown, when constructing a database table by manually creating a database table, the user is required to submit the table creation data of the database table first, and then the database administrator (Database Administrator, DBA) or Internet operation and maintenance engineer (Operations, OP) audits the table creation statement and sends the audit result to the user. If the table creation statement submitted by the user is qualified, the database administrator or Internet operation and maintenance engineer uses the corresponding suite in the corresponding database to execute the statement to create the table, and determines whether the table creation is completed based on the execution result of the suite.

[0034] like Figure 2 As shown, when constructing a database table by manually combining a database table creation system, the user is also required to submit the database table creation data first, and then the database administrator or Internet operation and maintenance engineer audits the table creation statement and sends the audit result to the user. If the table creation statement submitted by the user is qualified, the database administrator or Internet operation and maintenance engineer sends a database table creation instruction to the database table creation system. The database table creation system executes the corresponding statement according to the instruction to create the table, and feeds back the execution result to the database administrator or Internet operation and maintenance engineer to determine whether the table creation is completed.

[0035] Both of the above two methods of creating database tables require the participation of database administrators or Internet operation and maintenance engineers. At the same time, in the process of manually creating database tables, it is also necessary to consider whether the database administrator or Internet operation and maintenance engineer is professional and careful. In order to ensure that the creation of database tables is error-free and improve the efficiency of database table creation, users need to submit statements to create database tables, which makes the technical threshold for database table creation too high.

[0036] Although the efficiency of creating database tables can be improved by combining manual work with the database table creation system, database administrators or Internet operation and maintenance engineers may still make mistakes due to business scenarios and other factors. At the same time, when an enterprise has multiple business lines and each business line has its own database, it is necessary to assign a database administrator or Internet operation and maintenance engineer to each business line to ensure that the quality of creating database tables corresponding to each business line can be effectively improved, thereby ensuring efficient management and use of data.

[0037] It can be seen from this that the above two database table creation methods increase the labor cost of database table creation, and the technical threshold for database table creation is high, which is not conducive to improving the efficiency of database table creation.

[0038] To this end, the present application provides a method for creating a database table. The present application obtains target table data by determining the import method of table data, and after obtaining the target table data, uses grammatical rules to detect the target table data to determine whether the target table data meets the requirements for creating a target database table, and after the target table data meets the requirements, creates a target database table corresponding to the target table data, thereby achieving the goal of not requiring the participation of personnel with theories and professional knowledge of multiple databases, greatly reducing the labor cost of database table creation, and facilitating the improvement of database table creation efficiency. At the same time, the table data submitted by the user does not need to be written as a statement for creating a database table, which greatly reduces the technical threshold for database table creation, improves the efficiency and accuracy of database table creation, and effectively improves the user experience.

[0039] See also Figure 3 The architecture of the database table creation method provided in the present application may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0040] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, search applications, instant messaging tools, etc.

[0041] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0042] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0043] It should be noted that the database table creation method provided in the embodiment of the present application is generally executed by a server or a terminal device, and accordingly, the database table creation device is generally configured in the server or the terminal device.

[0044] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0045] It should be noted that the application scenarios described in the above-mentioned embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0046] The following is a detailed description of the database table creation method provided by this application.

[0047] like Figure 4 As shown, the database table creation method includes step 210 , step 220 , step 230 and step 240 .

[0048] Step 210: Determine the method for importing table data;

[0049] Step 220: Obtain target table creation data according to the import method.

[0050] like Figure 2 As shown, when determining the import method of table creation data, the present application can determine the import method of table creation data required to create a database table according to the table creation request sent by the self-service table creation system on the terminal where the user is currently located. Among them, the table creation request is the request information that the user needs to submit when requesting to create a database table.

[0051] Specifically, Figure 5 As shown in the figure, when a user needs to create a database table corresponding to a certain database, he can log in to the self-service table creation system on the terminal and perform independent operations in the self-service table creation system. After the user completes the independent operations on the self-service table creation system, the self-service table creation system submits the table creation data required to create the database table to the background, and then the background can execute the creation of the database table according to the submitted table creation data.

[0052] In this embodiment, the table building data required to create a database table can be imported by the self-service table building system in a variety of import methods, such as page operation, batch import, API call, copy or other methods. Among them, when the user operates on the self-service table building system, he can fill in the form or / and SQL statement to create a database table in the interface of the self-service table building system, or batch import the Excel file or / and SQL file to create the database table, or call the API interface to import the table building data required to create the database table, or directly copy the existing database table directly to the self-service table building system. In other words, the table building data provided by this application can create a database table without requiring the user to directly provide the statement required to create the database table, thereby reducing the technical threshold for creating a database table.

[0053] At the same time, when users make API calls on the self-service table creation system, the called API must support protocols such as http and tcp, thereby providing a data transmission channel for the table creation data required to create the database table, so as to facilitate obtaining the table creation data required to create the database table from the outside world.

[0054] After the table creation data is imported into the self-service table creation system, the user also needs to select the database type corresponding to the database table to be created, and then the self-service table creation system can submit the imported table creation data and database type to the backend in the form of a table creation request. The table creation request includes at least the table creation data, the import method of the table creation data, and the database type to which the database table belongs. The import method can be understood as the method in which the user enters the table creation data in the self-service table creation system.

[0055] After obtaining the table creation request submitted by the user, the application can determine the import method of the table creation data from the table creation request, and obtain the target table creation data from the table creation request according to the import method to realize the creation of the target database table.

[0056] In addition, the table creation data submitted by users can be used to create database tables of different database types, and are also suitable for the creation of database tables required by different business lines, thereby avoiding the need to assign corresponding database administrators or Internet operation and maintenance engineers according to different businesses and different databases, thereby reducing the cost of creating database tables and improving the flexibility of database table creation.

[0057] Step 230: Use grammatical rules to detect the target table building data to obtain a target detection result.

[0058] Specifically, in the process of using grammatical rules to detect target table creation data, the present application can use a grammatical rule library formed after training with data from multiple channels to perform grammar detection on the target table creation data, so as to avoid grammatical, corpus and other errors in the process of creating database tables. At the same time, the target detection results of the target table creation data can be fed back to the user so that the user can correct the target table creation data in time.

[0059] Further, in some embodiments, step 230 may include the following steps:

[0060] Determine the database type corresponding to the target table data;

[0061] Determine the target grammar rule corresponding to the database type from the grammar rule library;

[0062] The table building data is tested according to the target grammatical rules to obtain the target detection results.

[0063] Specifically, the grammar rule library provided by the present application can perform grammar detection on the table building data required for creating database tables corresponding to different types of databases. The table building data required for the database table corresponding to each type of database has corresponding grammar rules in the grammar rule library, namely, target grammar rules. Therefore, when the present application uses the target grammar rule to perform grammar detection on the target table building data, it is necessary to predetermine the database type to which the target database table corresponding to the target table building data belongs, namely, the database type of the target database table, and then determine the target grammar rule for performing grammar detection on the target table building data from the grammar rule library based on the database type, and then perform grammar detection on the target table building data according to the target grammar rule to obtain the target detection result of the target table building data.

[0064] Among them, the database corresponding to the target database table mentioned in this application can be MySQL database, TiDB database, Doris database, etc. MySQL database is a relational database management system. In terms of Web applications, it can support cross-platform operations and can cooperate with multiple programming languages ​​such as PHP, Java, etc., which is suitable for small and medium-sized projects; TiDB database is a fusion distributed database product that supports both online transaction processing and online analytical processing (Hybrid Transactional and Analytical Processing, HTAP), with horizontal expansion or contraction, financial-grade high availability, real-time HTAP, cloud-native distributed database, compatible with MySQL 5.7 protocol and MySQL ecology, etc.; Doris database is a high-performance, real-time analytical database based on MPP architecture, which is extremely fast and easy to use. Doris database only needs sub-second response time to return query results under massive data. It can support high-concurrency point query scenarios and high-throughput complex analysis scenarios.

[0065] It should be noted that when the target grammar rule is used to perform grammar detection on the target table building data, the target grammar rule used to perform grammar detection on the target table building data can be determined from the grammar rule library according to the statement type corresponding to the target table building data. Among them, the statement corresponding to the target table building data can be the SQL statement required by Hive. Hive is a data warehouse tool based on Hadoop, which can map structured data files to a database table, provide simple SQL query functions, and convert SQL statements into MapReduce tasks for execution.

[0066] In some embodiments, detecting the target table building data according to the target grammar rule to obtain the target detection result may include the following steps:

[0067] Perform syntax detection on the target table creation data based on the target syntax rules to obtain preliminary syntax detection results of the target table creation data;

[0068] If the preliminary syntax detection result is the first result, a custom detection is performed on the target table creation data to obtain a custom detection result of the target table creation data;

[0069] If the custom detection result is the second result, the custom detection result is used as the target detection result.

[0070] The first result is information that the target table building data passes the syntax check, and the second result is information that the target table building data passes the custom check. Specifically, after the application uses the target syntax rule to perform syntax check on the table building data, if the target table building data passes the syntax check, that is, the preliminary syntax check result is the first result, the target table building data can also be customized to obtain the custom check result of the target table building data.

[0071] Therefore, when the target table creation data is detected, the present application can implement multi-dimensional detection of the target table creation data, thereby further ensuring the quality of the created target database table.

[0072] At the same time, in the process of performing syntax detection on the target table building data, the present application can specifically determine the target syntax detection plug-in for performing syntax detection on the target table building data by the database type to which the target database table corresponding to the target table building data belongs, so as to realize syntax detection on the target table building data. Among them, the target syntax detection plug-in can perform syntax detection on the target table building data based on the target syntax rules.

[0073] A grammar checker plugin is a tool used to check and correct grammatical errors in text. Different types of databases have a corresponding grammar checker plugin, which can be a MySQL grammar checker plugin, a Hive grammar checker plugin, a Doris grammar checker plugin, a TiDB grammar checker plugin, etc.

[0074] Furthermore, in the process of using the target syntax detection plug-in to perform syntax detection on the target table data, the target syntax detection plug-in can detect whether the keywords and symbols in the target table data are missing, wrong, or repeated. For example, whether the target table data lacks field types, whether the target table data lacks keywords, whether the target table data has multiple punctuation marks, whether the target table data lacks closed brackets, etc.

[0075] Exemplarily, when performing syntax detection on the target table creation data of the MySQL database table, the present application can detect whether the target table creation data of the MySQL database table lacks field types, whether the target table creation data lacks keywords, whether the target table creation data has multiple punctuation marks, and whether the target table creation data lacks brackets, etc.

[0076] For example, under normal circumstances, the target table data for a MySQL database table can be:

[0077] CREATE TABLE Employees(

[0078] EmpIoyeeID INT NOT NULL AUTO_INCREMENT,

[0079] FirstName VARCHAR(25)NOT NULL,

[0080] LastName VARCHAR(25)NOT NULL,

[0081] BirthDate DATE.

[0082] Address VARCHAR(5O).

[0083] PRIMARY KEY(EmployeeID)

[0084] )ENGINE=InnoDB;

[0085] If the target table data lacks a field type, such as the lack of VARCHAR(25) field type between FirstName and NOT, the MySQL syntax detection plug-in can detect that the target table data lacks a field type; if the target table data lacks a keyword, such as the lack of TABLE keyword between CREATE and Employees, the MySQL syntax detection plug-in can detect that the target table data lacks a keyword; if there are extra punctuation marks in the target table data, such as extra punctuation marks after PRIMARY KEY(EmployeelD), the MySQL syntax detection plug-in can detect that there are extra punctuation marks in the target table data; if there are missing closed brackets in the target table data, such as the lack of closed brackets before ENGINE, the MySQL syntax detection plug-in can detect that there are missing closed brackets before ENGINE in the target table data.

[0086] Exemplarily, when the present application performs syntax detection on the target table building data of the Doris database table, it can detect whether the target table building data lacks keywords, whether there are multiple punctuation marks, whether reserved words are misspelled, etc.

[0087] For example, under normal circumstances, the target table data for the Doris database table can be:

[0088] CREATE TABLE IF NOT EXISTS test_dbtest_range_par_table (

[0090] 'user_id' LARGEINT NOT NULL COMMENT "user id".

[0091] 'date'DATE NOT NULL COMMENT"Date when the data is written".

[0092] 'timestamp'DATETIME NOT NULL COMMENT"data writing time",

[0093] 'city' VARCHAR(20) COMMENT "city".

[0094] 'age'SMALUINT COMMENT"wage".

[0095] 'sex'TINYINT COMMENT"User gender",

[0096] 'Last_visit_date' DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "Last visit time",

[0097] 'cost'BIGINT SUM DEFAULT"O"COMMENT"Total consumption".

[0098] 'max_dweII time' INT MAX DEFAULT "O" COMMENT "Maximum dwell time",

[0099] 'min dwell time' INT MIN DEFAULT "99999" COMMENT "Minimum dwell time")

[0100] ENGINE=olap

[0101] AGGREGATE KEY("user_id","date","timestamp","city","age","sex")

[0102] PARTITION BY RANGE("date") (

[0104] PARTITION'0202401'VALUES LESS THAN("2024-02-01"),

[0105] PARTITION'0202401'VALUES LESS THAN("2024-03-01"),

[0106] PARTITION'0202401'VALUES LESS THAN("2024-04-01"), )

[0108] DISTRIBUTED BY HASH("user_id")BUCKETS16

[0109] PROPERTIES (

[0111] "replication_num" = "3",

[0112] "storage_medlum"="ssD",

[0113] "storage_cooldown_time"="2024-01-01 12:00:00" );

[0115] If the target table data lacks keywords, such as the keyword BY is missing in the PARTITION partition range, the Doris syntax detection plug-in can detect that the target table data lacks keywords; if there are extra punctuation marks in the target table data, such as a comma "," added after the bracket ")", the Doris syntax detection plug-in can detect that the target table data lacks keywords; if there are errors in the reserved words in the target table data, such as the reserved word "AGGREGATE" is written as "AGG", the Doris syntax detection plug-in can detect that there are errors in the reserved words in the target table data.

[0116] In the process of using the target syntax detection plug-in to perform syntax detection on the target table creation data in this application, if the syntax detection of the target table creation data fails, the result of the syntax detection failure of the target table creation data needs to be used as the creation result of the target database table and fed back to the self-service table creation system; if the syntax detection of the target table creation data passes, the target table creation data can be detected in the next dimension, such as custom detection.

[0117] Specifically, Figure 6 As shown, when the application performs customized detection on the target table building data, it can specifically detect whether the field naming in the target table building data complies with the specification, whether the target table building data contains sensitive fields, etc. Among them, whether the field naming in the target table building data complies with the specification and whether the target table building data contains sensitive fields can be customized according to the requirements of the enterprise.

[0118] The process of detecting whether the field naming in the target table creation data complies with the specifications in the present application may include: the first field of the statement of the target database table corresponding to the target table creation data must not be a number, the first field of the statement of the target database table corresponding to the target table creation data must start with a preset rule, the name of the target database table corresponding to the target table creation data must not exceed a preset length, and the name of the target database table corresponding to the target table creation data does not contain special characters.

[0119] For example, in the process of detecting that the first field must not be a number, if "123_test_abc" exists in the target table data corresponding to the target database table, the target table data will be identified as non-standard; in the process of detecting that the first field must start with a lowercase English letter, if "Abc_2024_xy" or "_abc_2024" exists in the target table data corresponding to the target database table, the target table data will be identified as non-standard; in the process of detecting that the name does not exceed 10 characters, if "ods_busi_2024" exists in the target table data corresponding to the target database table, the target table data will be identified as non-standard; in the process of detecting that it does not contain special characters, if "^, &, and *" exist in the target table data corresponding to the target database table, "ods_^busi" in the target table data will be identified as non-standard.

[0120] At the same time, in the process of detecting whether the target table data contains sensitive fields, the application can pre-define sensitive field data sets, and the sensitive field data sets include ID card number, mobile phone number, etc.

[0121] In addition, in the process of detecting whether the target table data contains sensitive fields, if the target table data contains sensitive fields, the target table data can be marked and can directly enter the next approval process to take precautions in advance.

[0122] In some embodiments, after the target table building data is detected by using the grammatical rules to obtain the target detection result, the following steps may also be included:

[0123] According to the target detection results, determine the feedback statement after the target table data is tested;

[0124] The grammar rules are updated according to the feedback sentences.

[0125] In this embodiment, the target detection result is data information after at least grammar detection of the target table building data, and the target detection result includes detection qualified information and detection failed information of the target table building data. After obtaining the target detection result of the target table building data, the application can further train and learn the corresponding grammar rules in the grammar rule library based on the target detection result to ensure that the grammar rule library can be more accurate in subsequent grammar detection.

[0126] Specifically, the present application can determine the feedback statement after the target table building data is detected according to the target detection result. The feedback statement can be generated based on the target detection result. At the same time, the feedback statement can be an SQL statement, and key structure matching can be performed in the grammar rule library. If the feedback statement is successfully matched in the grammar rule library, there is no need to update the corresponding grammar rules in the grammar rule library; if the feedback statement is not successfully matched in the grammar rule library, a row of rule data can be inserted into the table building rule table of the grammar rule library to implement rule updates for the corresponding grammar rules in the grammar rule library.

[0127] Step 240: Create a target database table corresponding to the target table creation data based on the target detection result.

[0128] In this embodiment, the target detection result includes detection qualification information and detection failure information of the target table building data. If the target detection result includes detection qualification information, feature extraction can be performed on the target table building data, such as extracting the table name and field name used to build the target database table from the target table building data, and at the same time, the type of database to which the target database table belongs can be determined from the table building request, and the table name, field name and database type of the target database table are combined to convert into an execution statement of the target database table; when the target detection result includes detection failure information, the detection failure information can be used as the target database table creation result, and the self-service table building system can be fed back to the user to prompt the user to modify the table building data required to create the target database table in a timely manner.

[0129] In some embodiments, step 240 may include the following steps: determining evaluation information of target table building data based on the target detection result;

[0130] When the evaluation information is the first information, a target database table corresponding to the target table creation data is created.

[0131] In this embodiment, the evaluation information is information for evaluating the value of the target table building data after the target table building data passes the test. In order to ensure the quality of the target database table after creation, after the target table building data is tested, if the target test result includes qualified test information, the target database table created by the target table building data needs to be evaluated for at least one of necessity, completeness and rationality. Specifically, the value of the target database table can be determined by evaluating the target table building data.

[0132] The evaluation information may be data information on whether the data is approved, that is, the first information may be data information on whether the target table building data is approved. When the evaluation information is the first information, a target database table corresponding to the target table building data may be created based on the target table building data.

[0133] In some embodiments, creating a target database table corresponding to the target table creation data may further include the following steps:

[0134] According to the import method, feature extraction is performed on the target table building data to obtain feature information of the target table building data;

[0135] Generate execution statements for the target database table based on the feature information;

[0136] According to the execution statement, a target database table corresponding to the target table data is created.

[0137] Due to different import methods of the target table building data, the type of the target table building data may be different. Therefore, in the process of creating the target database table, it is necessary to predetermine the import method of the target table building data. For example, the target table building data can be an SQL statement. The user can directly fill in the SQL statement in the interface of the self-service table building system. Then, the import method of the target table building data can be determined as the method of filling in the SQL statement. Then, it can be determined that the target table building data is an SQL statement, and the feature extraction rules of the SQL statement can be directly used to extract the features of the target table building data, and the extracted feature information is used to construct the execution statement of the target database table, and then the target database table can be created according to the execution statement; at the same time, the target table building data can also be a non-SQL statement. For example, the user directly imports the target table building data in the form of an Excel file in the interface of the self-service table building system. Then, the import method of the target table building data can be determined as a batch import method, and then the target table building data can be determined as a non-SQL statement. At this time, it is necessary to parse the Excel file where the target table building data is located to extract the feature information of the target table building data from the Excel file, and the extracted feature information is used to construct the execution statement of the target database table, and then the target database table can be created according to the execution statement.

[0138] Exemplarily, if the target table creation data is data filled in by the user in the form of the self-service table creation system, then the database type corresponding to the target database table, the table name of the target database table, the fields of the target database table, the basic data types of the target database table, the standard library type corresponding to the target database table and other features can be extracted from the form. After the database type corresponding to the target database table, the table name of the target database table, the fields of the target database table, the basic data types of the target database table, the standard library type corresponding to the target database table and other features are extracted from the form, they can be combined and converted into execution statements of the target database table, and then the target database table can be created according to the execution statements.

[0139] Among them, the database can be a MySQL database, TiDB database, Doris database and other types of databases, the table name can be test, the fields can be id, name, etc., the basic data type can be int, and the standard library type can be string; the execution statement can be create table test(id int,name string).

[0140] For example, if the target table creation data is an Excel file imported by the user in the self-service table creation system, the table name, column name, field, etc. in the Excel file can be extracted. After the table name, column name and type are extracted from the Excel file, they can be combined and converted into execution statements of the target database table, and then the target database table can be created according to the execution statements.

[0141] Among them, the table name can be the sheet name in the Excel file; the column name can be the name of the first column in the Excel file, which can be int, string, etc.; the field can be the name of the first row in the Excel file, which can be id, name, etc.; the execution statement of the target database table can be create tableie test (id int, name string).

[0142] In some embodiments, Figure 7 As shown, the database table creation method further includes step 310 , step 320 and step 330 .

[0143] Step 310: construct an initial grammar rule base for the database table; wherein the initial grammar rule base includes a database type table and a table creation rule table.

[0144] Specifically, the initial grammar rule base can be the initial form of the grammar rule base. After building the initial grammar rule base, the present application can input corpus into the initial grammar rule base to perform continuous learning and training on the initial grammar rule base, thereby forming a grammar rule base for detecting target table building data.

[0145] In this embodiment, the initial grammar rule base may include a database type table, a table creation rule table, and a rule operation record table.

[0146] Among them, the database type table can be a database type dimension table, and the database type dimension table includes a primary key ID field, a database name field, a database type field, and an official website syntax address. Among them, the primary key ID field can be used to serialize the record database, which can usually be set to auto-increment (AUTO_INCREMENT). For example, the Hive database record is 1, the MySQL database record is 2, the Tidb database record is 3, and so on. Then, the database type dimension table can automatically increase the value of the primary key ID field each time a new record is inserted, without manual specification, thereby simplifying the data insertion process; the database name field is used to identify the database type, and can distinguish between relational databases, non-relational databases and other databases; the official website syntax address can be used to store the official website syntax addresses of various databases, so that the corpus input service can regularly learn and train the grammar rule library.

[0147] The table creation rule table includes the primary key ID field, foreign key field, table creation rule name field, rule syntax field, syntax correctness field, validity field, creation time field, update time field, etc.

[0148] Among them, the foreign key field can be associated with the database type dimension and output the database ownership of the corresponding rule; the table creation rule name field can be used to identify the table creation rule, such as 1_hive_create_table_as, 2_mysql_create_table, etc.; the rule syntax field can record the key structure of the syntax and perform rule detection, such as create table test2 asselect viewTime,ip from test_table, or CREATE TABLE Employees(EmployeeID INTNOT NULL AUTO_INCREMENT,FirstName VARCHAR(25)NOT NULL,PRIMARY KEY(EmployeeID))ENGINE=InnoDB, etc.; the syntax correctness field can indicate whether the collected syntax is correct (for example, correct syntax can be indicated as T, and syntax error can be indicated as F); the validity field can indicate whether the table creation rule is valid (Y means valid, N means invalid); if the validity field is displayed as Y, rule support will be provided for table creation data during the detection service; if the validity field is displayed as N, the syntax detection of table creation data will not be involved; the creation time field can record the storage time of the corresponding rule; the update time field can record the update time of the corresponding rule; the creation / update time field can analyze the availability of the corresponding rule.

[0149] The rule operation record table includes the primary key ID field, foreign key, operation type, operation path and additional records.

[0150] Among them, the foreign key can be associated with the grammar rule ID; the operation type can be operations such as adding, overwriting, invalidating and validating; the operation methods include manual injection, OCR (Optical Character Recognition) injection, execution result injection and other injection methods; the additional record can be information such as documents / pictures / links during OCR injection, which includes the original SQL statement during execution result injection, injection results and other information.

[0151] Step 320: Use the database type table and the table creation rule table to associate the injected grammatical data to obtain association information.

[0152] After constructing an initial grammar rule base using a database type table, a table creation rule table, and a rule operation record table, the present application can perform rule training on the initial grammar rule base through injected grammar data, thereby forming a grammar rule base for detecting target table creation data.

[0153] After the syntax data is injected, key data can be captured from the syntax data, and the key data can be associated with the database type table and the table creation rule table. Specifically, the database type dimension table and the table creation rule table can be used for association.

[0154] Furthermore, the present application can also associate key data with database type dimension table and table creation rule table by foreign key to obtain association information of grammatical data, and then update database type table, table creation rule table and rule operation record table according to the association information to complete the rule training of grammatical rule base. Among them, foreign key association can establish an association relationship between database type dimension table and table creation rule table to ensure the integrity and consistency of database type dimension table and table creation rule table.

[0155] In some embodiments, step 320 may include the following steps:

[0156] Determine how grammatical data is injected;

[0157] Based on the injection method, the database type table and the table building rule table are used to associate the grammatical data to obtain the associated information of the grammatical data.

[0158] In this embodiment, the injection method may include three methods, which may be manual injection, crawler injection, and target detection result feedback statement injection. Among them, manual injection is to inject grammatical data manually, crawler injection is to crawl grammatical data from the official website of each database in the form of a crawler for injection, and feedback statement injection is to inject the feedback statement of the target detection result of the target table data.

[0159] Specifically, in the process of injecting grammatical data using different injection methods, the key data of the injected grammatical data may be different due to the different injection methods. Therefore, after receiving the injected grammatical data, it is necessary to predetermine the injection method of the grammatical data, and then determine the method for extracting the grammatical data according to the injection method, so as to extract the key data in the grammatical data, and the extracted key data can be associated with the database type table and the table creation rule table. Specifically, the database type dimension table and the table creation rule table can be used for association.

[0160] Furthermore, the present application can also establish foreign key associations between key data and the database type dimension table and the table creation rule table to obtain association information of the injected grammatical data, and then update the database type dimension table, the table creation rule table and the rule operation record table according to the association information to complete the rule training of the current stage of the grammar rule library.

[0161] Among them, after the injected grammatical data is obtained by crawling, since the grammatical data of the official website of each database exists in the form of pictures, it is necessary to perform OCR (Optical Character Recognition) on the grammatical data to extract the grammatical data for training the grammatical rule library from the picture.

[0162] Step 330: Update the initial grammar rule base according to the associated information to obtain a grammar rule base.

[0163] In this embodiment, the association information is used to characterize whether there is key data of the grammatical data in the database type dimension table and the table building rule table of the grammatical rule base, and whether the key data is valid in the grammatical rule base. If the association information characterizes that there is key data of the grammatical data in the database type dimension table and the table building rule table of the grammatical rule base, and the association data is in a valid state in the grammatical rule base, then there is no need to update the database type dimension table, the table building rule table, and the rule operation record table of the grammatical rule base; if the association information characterizes that there is no key data of the grammatical data in the database type dimension table and the table building rule table of the grammatical rule base, or / and the association data is in an invalid state in the grammatical rule base, then it is necessary to use the key data of the grammatical data to update the database type dimension table, the table building rule table, and the rule operation record table of the grammatical rule base to obtain the grammatical rule base.

[0164] Exemplarily, if the grammatical data used to train the grammatical rule base is injected manually, for example, a database administrator or an Internet operation and maintenance engineer can inject the grammatical data of the database table corresponding to Hive into the initial grammatical rule base or the grammatical rule base after rule training, the grammatical data can be create table soldier(id int,name string,high int,country string)partitioned by(dt string)row formatdelimited fields terminated by'\n', then the key data createtable xxx(xxx int,xxx string,…)partition by(xxx string)row format delimitedfields terminated by'xxx' in the above grammatical data can be captured, and the database type dimension table and the table creation rule table can be used to perform foreign key association on the key data of the injected grammatical data to obtain the association information of the grammatical data.

[0165] If the associated information shows that the injected grammar data key data does not exist in the database type dimension table and the table creation rule table of the grammar rule base, or / and the injected grammar data associated data is invalid in the grammar rule base, a row of rule data can be inserted in the table creation rule table in advance. At this time, the primary key ID field of the table creation rule table will be automatically incremented, and the foreign key field of the table creation rule table can be filled in the database type dimension table. At the same time, the table creation rule name field of the table creation rule table can be composed of prefix rule + suffix randomly.

[0166] The prefix rule can be database type id_table creation rule table id_create_table, the suffix random naming can be 1_1_create_table_xxx, the rule syntax field of the table creation rule table can be stored in create table xxx(xxx int,xxx string,…)partition by(xxx string)row format delimited fieldsterminated by'xxx', the syntax correctness field of the table creation rule table is changed to T, the validity field of the table creation rule table is changed to Y, a timestamp is inserted into the creation time field of the table creation rule table, and a timestamp corresponding to the time is inserted into the update time field of the table creation rule table. Finally, a record can be inserted into the rule operation record table, thereby completing the update of the database type dimension table, the table creation rule table, and the rule operation record table.

[0167] For example, if the grammatical data used to train the grammatical rule base is injected by crawling, for example, the corresponding grammatical data can be periodically crawled from the official website of each database and saved in the form of a picture, and then OCR (Optical Character Recognition) recognition is performed to extract the grammatical data in the picture. The grammatical data can be CREATE TABLE new_tbl AS SELECT*FROM orig_tbl, then two key data can be captured from the above grammatical data, which are create table xxx like xxx and create table xxx as selectxxx from xxx, and the database type dimension table and the table creation rule table are used to perform foreign key associations on each key data of the injected grammatical data to obtain the associated information of the injected grammatical data.

[0168] If the association information shows that each key data of the injected grammatical data does not exist in the database type dimension table and the table creation rule table of the grammar rule library, or / and each associated data of the injected grammatical data is in at least one invalid state in the grammar rule library, for example, the key data is create table xxx like xxx, then a row of rule data can be inserted in advance into the table creation rule table, the primary key ID field of the table creation rule table will be automatically incremented, the foreign key field of the table creation rule table can be filled in the database type dimension table, and at the same time, the table creation rule name field of the table creation rule table can be composed of a prefix rule + a suffix randomly, which can be 1_2_create_table_like_xxx, the rule grammar field of the table creation rule table can be stored in create table xxx like_xxx, the grammatical correctness field of the table creation rule table can be changed to T, the validity field of the table creation rule table can be changed to Y, a timestamp can be inserted into the creation time field of the table creation rule table, and a timestamp corresponding to the time can be inserted into the update time field of the table creation rule table. Finally, a record can be inserted into the rule operation record table.

[0169] Similarly, the key data of the injected grammar data create table xxx as select xxx fromxxx can also be used to update the database type dimension table, table creation rule table, and rule operation record table in the above manner. At the same time, after the database type dimension table, table creation rule table, and rule operation record table are updated using the two key data of the injected grammar data, the grammar rule library is also updated.

[0170] For example, if the grammatical data used to train the grammatical rule base is the feedback sentence of the target detection result of the target table building data, for example, the target table building data is:

[0171] CREATE TABLE Employees(

[0172] EmpIoyeeID INT NOT NULL AUTO_INCREMENT,

[0173] FirstName,

[0174] PRIMARY KEY(EmployeeID) );

[0176] It can be seen that the field at FirstName in the above target table building data lacks a type. After the syntax check of the target table building data, the failure information of the target table building data will be obtained. The above target table building data can be used as a feedback statement. At this time, two key data can be captured from the target table building data. The first key data is the database type, and the second key data is create table xxx(xxx INT NOT NULL AUTO_INCREMENT,xxx,PRIMARY KEY(XXX)). Then, the first key data can be used for matching first, and after the matching is successful, the corresponding database type dimension table and table building rule table can be used to perform foreign key association on the second key data to obtain the association information of the feedback statement. If the association information shows that the second key data does not exist in the database type dimension table and the table creation rule table of the grammar rule library, or / and the second association data is invalid in the grammar rule library, a row of rule data can be inserted into the table creation rule table in advance, the primary key ID field of the table creation rule table can be automatically incremented, and the foreign key field of the table creation rule table can be filled in the database type dimension table. At the same time, the table creation rule name field of the table creation rule table can be composed of a prefix rule + a random suffix, which can be 3_2_create_table_xxx_, and the rule syntax field of the table creation rule table can be stored in create table xxx(xxxINT NOT NULL AUTO_INCREMENT,xxx,PRIMARY KEY(XXX)), the syntax correctness field of the table creation rule table can be changed to F, the validity field of the table creation rule table can be changed to Y, a timestamp can be inserted into the creation time field of the table creation rule table, a timestamp corresponding to the time can be inserted into the update time field of the table creation rule table, and finally a record can be inserted into the rule operation record table to complete the update of the database type dimension table, the table creation rule table, and the rule operation record table of the grammar rule library.

[0177] In the database table creation method provided in the present application, the import method of table creation data is determined; according to the import method, the target table creation data is obtained; the target table creation data is detected using grammatical rules to obtain the target detection result; and the target database table corresponding to the target table creation data is created based on the target detection result. The present application can achieve the participation of personnel without the need for the theory and professional knowledge of multiple databases, greatly reducing the manpower cost of database table creation, and facilitating the improvement of database table creation efficiency. At the same time, the table creation data submitted by the user can also be submitted without being written as a statement for creating a database table, which greatly reduces the technical threshold for database table creation, improves the efficiency and accuracy of database table creation, and effectively improves the user experience.

[0178] The embodiment of the present application further provides a database table creation device 400, which is used to execute any embodiment of the aforementioned database table creation method.

[0179] For details, please refer to Figure 8 , Figure 8 It is a schematic block diagram of a database table creation device 400 provided in an embodiment of the present application.

[0180] like Figure 8 As shown, the database table creation device 400 includes: a determination unit 410 , an acquisition unit 420 , a detection unit 430 and a creation unit 440 .

[0181] The determination unit 410 is used to determine the import method of the table creation data; the acquisition unit 420 is used to obtain the target table creation data according to the import method; the detection unit 430 is used to detect the target table creation data using grammatical rules to obtain the target detection result; the creation unit 440 is used to create a target database table corresponding to the target table creation data based on the target detection result.

[0182] In some embodiments, the detection unit 430 is further used to determine the database type corresponding to the target table creation data; determine the target grammar rule corresponding to the database type from the grammar rule library; and detect the target table creation data according to the target grammar rule to obtain a target detection result.

[0183] In some embodiments, the detection unit 430 is also used to perform grammar detection on the table creation data based on the target grammar rules to obtain a preliminary grammar detection result of the table creation data; if the preliminary grammar detection result is a first result, a custom detection is performed on the target table creation data to obtain a custom detection result of the target table creation data; if the custom detection result is a second result, the custom detection result is used as the target detection result.

[0184] In some embodiments, the database table creation device 400 is further used to determine a feedback sentence after the target table creation data is detected according to the target detection result; and perform grammar update on the grammar rules according to the feedback sentence.

[0185] In some embodiments, the creation unit 440 is further used to determine evaluation information of the target table creation data based on the target detection result; when the evaluation information is the first information, create a target database table corresponding to the target table creation data.

[0186] In some embodiments, the creation unit 440 is further used to extract features of the target table creation data according to the import method to obtain feature information of the target table creation data; generate an execution statement of the target database table according to the feature information; and create a target database table corresponding to the target table creation data according to the execution statement.

[0187] In some embodiments, the database table creation device 400 is also used to construct an initial grammar rule base for the database table; wherein the initial grammar rule base includes a database type table and a table creation rule table; the database type table and the table creation rule table are used to associate the injected grammar data to obtain association information of the grammar data; the initial grammar rule base is updated according to the association information to obtain a grammar rule base.

[0188] In some embodiments, the database table creation device 400 is further used to determine an injection method of the grammatical data; based on the injection method, the database type table and the table creation rule table are used to associate the grammatical data to obtain association information of the grammatical data.

[0189] The database table creation device 400 provided in the embodiment of the present application is used to execute the above-mentioned process by determining the import method of table creation data; obtaining target table creation data according to the import method; using grammatical rules to detect the target table creation data to obtain target detection results; and creating a target database table corresponding to the target table creation data based on the target detection results.

[0190] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned database table creation device 400 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.

[0191] The above-mentioned database table creation device 400 can be implemented in the form of a computer program. The computer program can be used in Fig. 9 The electronic device shown is running.

[0192] See also Fig. 9 , Fig. 9 5 is a schematic block diagram of an electronic device provided in an embodiment of the present application. The electronic device 500 may be a terminal, wherein the terminal may be a cloud, a vehicle-mounted terminal device, a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, a wearable device, etc.

[0193] See also Fig. 9 The electronic device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0194] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a database table creation method.

[0195] The processor 502 is used to provide computing and control capabilities to support the operation of the entire electronic device 500 .

[0196] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a database table creation method.

[0197] The network interface 505 is used to communicate with other devices over the network. Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device 500 to which the scheme of the present application is applied. The specific electronic device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0198] Among them, the processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps: determine the import method of the table building data; obtain the target table building data according to the import method; use grammatical rules to detect the target table building data to obtain the target detection result; create a target database table corresponding to the target table building data based on the target detection result.

[0199] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0200] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device implements the following steps: determining an import method for table building data; obtaining target table building data according to the import method; detecting the target table building data using grammatical rules to obtain a target detection result; and creating a target database table corresponding to the target table building data based on the target detection result.

[0201] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0202] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps: determining an import method for table building data; obtaining target table building data according to the import method; detecting the target table building data using grammatical rules to obtain a target detection result; and creating a target database table corresponding to the target table building data based on the target detection result.

[0203] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.

[0204] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0205] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0206] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0207] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0208] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for creating a database table, characterized in that: include: Determine the method for importing table data; According to the import method, obtain the target table creation data; Using grammatical rules to detect the target table building data to obtain a target detection result; A target database table corresponding to the target table creation data is created based on the target detection result.

2. The method for creating a database table according to claim 1, characterized in that: The target table building data is detected by using grammatical rules to obtain a target detection result, including: Determine the database type corresponding to the target table creation data; Determine the target grammar rule corresponding to the database type from the grammar rule library; The target table building data is detected according to the target grammar rule to obtain the target detection result.

3. The method for creating a database table according to claim 2, characterized in that: The detecting the target table building data according to the target grammar rule to obtain the target detection result includes: Performing grammar detection on the table creation data based on target grammar rules to obtain preliminary grammar detection results of the table creation data; If the preliminary grammar detection result is the first result, performing a custom detection on the target table creation data to obtain a custom detection result of the target table creation data; If the user-defined detection result is the second result, the user-defined detection result is used as the target detection result.

4. The method for creating a database table according to claim 1, characterized in that: After the target table building data is detected by using the grammatical rules to obtain the target detection result, the method further includes: Determine, according to the target detection result, a feedback statement after the target table building data is detected; The grammatical rules are grammatically updated according to the feedback sentence.

5. The method for creating a database table according to claim 1, characterized in that: The step of creating a target database table corresponding to the target table creation data based on the target detection result includes: Based on the target detection result, determining evaluation information of the target table building data; In a case where the evaluation information is the first information, a target database table corresponding to the target table creation data is created.

6. The method for creating a database table according to claim 1, characterized in that: The step of creating a target database table corresponding to the target table creation data includes: According to the import method, feature extraction is performed on the target table creation data to obtain feature information of the target table creation data; Generate an execution statement for the target database table according to the characteristic information; According to the execution statement, a target database table corresponding to the target table creation data is created.

7. The method for creating a database table according to any one of claims 1 to 6, characterized in that: The method further comprises: Constructing an initial grammar rule base; wherein the initial grammar rule base includes a database type table and a table building rule table; The injected grammatical data is associated with the database type table and the table creation rule table to obtain associated information; The initial grammar rule base is updated according to the association information to obtain a grammar rule base.

8. The method for creating a database table according to claim 7, characterized in that: The step of using the database type table and the table creation rule table to associate the injected grammatical data to obtain association information includes: Determining a method for injecting the grammatical data; Based on the injection method, the database type table and the table creation rule table are used to associate the grammatical data to obtain association information of the grammatical data.

9. A database table creation device, characterized in that: include: A determination unit is used to determine the import method of the table creation data; An acquisition unit, used for acquiring target table building data according to the import method; A detection unit, used to detect the target table building data using grammatical rules to obtain a target detection result; A creation unit is used to create a target database table corresponding to the target table creation data based on the target detection result.

10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the database table creation method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the database table creation method according to any one of claims 1 to 8 are implemented. 12 . A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the database table creation method according to claim 1 .

Citation Information

Patent Citations

  • Data table creation method and device

    CN111831638A

  • Database table generation system, method and device

    CN115658694A