Disclosure of Invention
In view of this, an embodiment of the present invention provides a method and an apparatus for generating a data table, which can quickly generate a data table specifying a storage engine class according to a custom template, and can automatically analyze input information according to different storage engines to obtain each field information, and then combine preset template information to generate a table-building statement corresponding to the storage engine by one key. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a data table generating method, including:
responding to a data table generation request, and acquiring input information corresponding to a data table to be generated and a storage carrier element, wherein the storage carrier element comprises a storage engine type;
Obtaining a corresponding data table object template according to the storage engine type;
Analyzing the input information to obtain data field information of a data table to be generated;
generating a table-building sentence according to the storage carrier element, the data table object template and the data field information, and generating a data table by using the table-building sentence.
Optionally, analyzing the input information to obtain data field information of the data table to be generated includes determining a regular expression according to a data format corresponding to the input information, and performing row-by-row matching on the input information by using the regular expression to obtain the data field information of the data table to be generated.
Optionally, the data format corresponding to the input information is determined according to the value of a data format keyword, wherein the data format keyword comprises a field name keyword, a field type keyword and a field annotation keyword.
Optionally, after the input information is parsed to obtain the data field information of the data table to be generated, the method further comprises the step of displaying the parsed data field information in a table mode through a page so as to enable a user to perform local correction on the data field information.
The data table object template is generated by respectively acquiring data table object grammar specifications corresponding to each storage engine, and carrying out space occupation on each storage engine by using a placeholder according to the position of the actually used scene filling content in the data table object grammar specifications to obtain the data table object template corresponding to the storage engine.
Optionally, generating a table construction statement from the storage carrier element, the data table object template and the data field information includes replacing placeholders in the data table object template according to the storage carrier element and the data field information to generate a table construction statement.
The method comprises the steps of storing a data field information in a data table object template, replacing the data field information in the data table object template according to the data field information, and replacing the data field information in the data table object template according to the data field information.
The placeholder comprises a keyword format placeholder and a content format placeholder, the placeholder in the data table object template is replaced according to the storage carrier element and the data field information, the placeholder in the keyword format is replaced according to the storage carrier element and the data field information in a keyword matching mode, data corresponding to the content format placeholder is generated according to the storage carrier element and the data field information, and the data corresponding to the content format placeholder is used for replacing the content format placeholder.
According to another aspect of the embodiment of the present invention, there is provided a data table generating apparatus, including:
The data acquisition module is used for responding to the data table generation request and acquiring input information corresponding to the data table to be generated and a storage carrier element, wherein the storage carrier element comprises a storage engine type;
the template acquisition module is used for acquiring a corresponding data table object template according to the storage engine type;
the field analysis module is used for analyzing the input information to obtain data field information of a data table to be generated;
and the data table generating module is used for generating a table establishing sentence according to the storage carrier element, the data table object template and the data field information, and generating a data table by using the table establishing sentence.
According to still another aspect of the embodiment of the invention, an electronic device is provided, which comprises one or more processors, and a storage device, wherein the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the generation method of the data table provided by the embodiment of the invention.
According to still another aspect of the embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method for generating a data table provided by the embodiments of the present invention.
The embodiment of the invention has the advantages that the input information and the storage carrier elements corresponding to the data table to be generated are acquired by responding to the data table generation request, the storage carrier elements comprise storage engine types, the corresponding data table object templates are acquired according to the storage engine types, the input information is analyzed to obtain the data field information of the data table to be generated, the table construction statement is generated according to the storage carrier elements, the data table object templates and the data field information, and the table construction statement is generated by using the technical scheme of the table construction statement, so that the data table of the specified storage engine type is quickly generated according to the custom template, each field information can be automatically analyzed according to the input information for different storage engines, and then the preset template information is combined to generate the table construction statement of the corresponding storage engine by one key. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme disclosed by the invention, the aspects of acquisition, collection, updating, analysis, processing, use, transmission, storage and the like of the related user personal information all conform to the rules of related laws and regulations, are used for legal purposes, and do not violate the popular public order. Necessary measures are taken for the personal information of the user, illegal access to the personal information data of the user is prevented, and the personal information security, network security and national security of the user are maintained.
In the description of the embodiments of the present invention, the terms and definitions of the terms involved are as follows:
schema, which is a recommendation issued by W3C and 5 th 2001 initially, indicates how elements of an XML document are described in a formal manner, refers to a generic term describing contents such as data table organization structures and field information, and is called as a data table object in the description of the embodiment;
Hive is a data warehouse tool based on Hadoop, and is used for extracting, converting and loading data, which is a mechanism capable of storing, inquiring and analyzing large-scale data stored in Hadoop;
The elastiscearch is a distributed, high-expansion, high-real-time search and data analysis engine. First submitting data to an elastic search database before searching and analyzing the data;
Paradigm database terms are a collection of relational patterns that conform to a certain level. Constructing a database must follow certain rules, which are norms in the relational database;
JSON JavaScript Object Notation, JS object numbered musical notation, is a lightweight data exchange format;
DDL Data Definition Language, database schema definition language, is a language used to describe real world entities to be stored in a database.
In order to solve the problems in the prior art, the invention provides a data table generating method, which can automatically analyze according to the field column information which is input rapidly aiming at different storage engines to obtain each field information, and then combine preset template information to generate a table statement corresponding to the storage engines by one key. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications. The invention is used as a complete independent function, so that a developer focuses on the definition of template normal forms and similar engine data table object (schema) templates when facing different storage engines, the background automatically completes the output of schema results corresponding to different input information according to the appointed template information, and meanwhile, the schema templates are highly multiplexed for the same engine, thereby realizing the repeated use of one definition.
Fig. 1 is a schematic diagram of main steps of a data table generating method according to an embodiment of the present invention. As shown in fig. 1, the method for generating a data table according to the embodiment of the present invention mainly includes the following steps S101 to S104.
Step S101, responding to a data table generation request, and acquiring input information corresponding to a data table to be generated and a storage carrier element, wherein the storage carrier element comprises a storage engine type.
In the invention, the specification details of the table construction among different storage engines are shielded through a template paradigm. The essential elements of the storage carrier are a name space, a unique carrier name and a data type, taking Mysql database as an example, the name space is represented as a database, and the carrier name is represented as a unique table name under the database, no matter what storage engine is executed. The present invention is not limited to a particular storage engine and therefore storage engine type is also one of the indispensable elements, that is, the storage carrier element of the present invention includes a name space, a carrier name, a data type, and a storage engine type. In addition, when implemented, the storage carrier elements may include annotation information, presentation forms of schema sentences, and the like, depending on the scenario.
In addition, when a data table generation request is received, a storage carrier element may be acquired therefrom, and then represented or defined by the following rule g:
Engine.NameSpace.Table[defaultDateType[DataType,......],DateFor mat,Comment]。
DataFormat in the rule g represents the expression form of the schema statement, the expression form of the schema of the SQL-like storage engine is defined by a keyword DDL, the expression form of the schema of the Json-like storage engine is defined by a keyword JSON, and the like. Comment indicates whether the field requires annotation information, defined using TRUE and FALSE.
When in use, the model paradigm is defined according to the rule g, and in order to avoid repeated definition of the paradigm when in use for multiple times, the defined Fan Shibao is stored in a metadata base Mysql of the system for quick selection when in repeated use. And meanwhile, the template model supporting definition provides a function of sharing release, so that resource waste caused by repeated definition work is further reduced.
Specifically, in one embodiment of the present invention, assuming that data is to be pushed or saved to an elastic search storage engine, the target index is index_tmp, doc is doc_tmp, the default data type is keyword, the data types involved in the table are keyword and integer, and the data format is json, the template paradigm defined is:
elasticsearch.index_tmp.doc_tmp[keyword[keyword,integer],json]。
the storage carrier elements are represented by the template paradigm, so that corresponding storage carrier elements can be conveniently obtained when a table building statement is generated later.
Step S102, obtaining a corresponding data table object template according to the storage engine type.
According to one embodiment of the invention, the data table object template is generated by respectively acquiring the data table object grammar specifications corresponding to each storage engine, and carrying out preemption on each storage engine by using a placeholder according to the position of the filling content of the actual use scene in the data table object grammar specifications to obtain the data table object template corresponding to the storage engine.
Because the schema grammar specifications of the data tables in different storage engines are different, the corresponding schema grammar specifications are preset in the system, and the support of any storage engine is realized by adding the custom schema grammar specifications. And after the corresponding grammar specification is obtained, the place of the grammar specification, which is needed to be filled with the content according to the actual use scene, is pre-occupied by using the placeholder. Thereby obtaining a data table object schema template corresponding to the storage engine. Here, the placeholders may include, for example, a keyword format placeholder ({ KEY } } -format placeholder) and a content format placeholder ([ [ content ] ] format placeholder).
And step S103, analyzing the input information to obtain data field information of the data table to be generated. In an embodiment of the present invention, the input information is, for example, two cases, one is SQL script (typically, insert into select type SQL) for data manipulation and the other is data in an existing data table (e.g., hive table) in the data warehouse.
When the input information is a data processing SQL script, the SQL script completely contains the field information of the result table, such as the contents from the select to the from part shown in the codes of the following table 1, and the text of the part is directly used as the input information to be analyzed to obtain the field information of the data table to be generated.
TABLE 1
When the input information is data in an existing data table in the data warehouse, the field information in the data table can be obtained by checking the table structure of the existing data table, and the like, and various manners of checking the data table structure are possible, but the obtained field information is generally shown in the following table 2, and at this time, the part of text is directly analyzed as the input information to obtain the data field information of the data table to be generated.
TABLE 2
According to one embodiment of the invention, the method for analyzing the input information to obtain the data field information of the data table to be generated specifically comprises the steps of determining a regular expression according to a data format corresponding to the input information, and performing row-by-row matching on the input information by using the regular expression to obtain the data field information of the data table to be generated. Specifically, the data format corresponding to the input information is determined according to the value of a data format keyword, wherein the data format keyword comprises a field name keyword, a field type keyword and a field annotation keyword.
The format of the input information may be varied in the actual use process, but regardless of the storage engine, the information elements of the fields mainly include three kinds of field names, field types, and field annotation commands, wherein the commands are optional padding items. The problem of different input formats is solved by means of template normal form keywords. Thus, in an embodiment of the present invention, the defined data format key includes a field name key, a field type key, and a field annotation key. Define field name key as CN, field type key as CT, and field comment key as CC. Since there is a case where the information element of the field may be missing, the case of whether or not missing is indicated by adding [0/1] after the key, for example, CC [0] indicates that the field notes that the key CC exists partially (partially missing), and CC [1] indicates that it must be included. The input information includes a value (0 or 1) corresponding to each data format keyword or provides a data sample for parsing to generate a regular expression, and three elements (field name, field type and field annotation) included in the parsing result of the input information can be encapsulated. The data sample does not need to pay attention to blank characters among the data cells, and the definition of the data sample is carried out according to the data with the longest length when the input data lengths are inconsistent.
The input information is analyzed by means of a regular analysis mode, and the method specifically comprises the following steps:
For the input information given in Table 1, assuming that the given data sample format is "as CN [1] - -CC [0]", the keywords of the given data sample are parsed to obtain the input information including field names and partial presence field annotation information. The regular expression is generated as (++ -/s+as + - - -/s + (.+ -.), then the input information is processed sequentially by line, by extracting the values in the first and second brackets as field names and field notes. Since no field type information is contained in SQL, all field types are set as model data types given in the template paradigm definition, and the result is encapsulated.
For the input information given in table 2, there may be a difference in order and the number of results due to the table structure information obtained by different means. It is necessary to additionally define the input order and the number information when inputting information. Given a data sample format of "CN 1 CT 1 CC 1", the generated regular expression is (++) \s+ ([ a-zA-Z ] +) \s+ (+), line-by-line matching is performed by extracting text in the first bracket, the second bracket and the third bracket as field names, field types and field comments, and the result is packaged.
According to one embodiment of the present invention, after the input information is parsed to obtain the data field information of the data table to be generated, the parsed data field information may also be displayed in a form of a table through a page, so that a user may perform local correction on the data field information. After the input information is completely analyzed, the results are listed in a form through a web page for a user to carry out local correction on the fields in order to make the results accurate. Wherein the field type information fills the drop-down box option drop-down options with the type values given in the template paradigm, presented in drop-down box fashion, for modification by the user to provide user-friendly operation as functionality enhancement. And finally, replacing the automatically parsed data by the corrected data.
Step S104, generating a table establishing sentence according to the storage carrier element, the data table object template and the data field information, and generating a data table by using the table establishing sentence.
According to one embodiment of the invention, generating the table construction statement according to the storage carrier element, the data table object template and the data field information can comprise replacing placeholders in the data table object template according to the storage carrier element and the data field information to generate the table construction statement.
In one particular embodiment of the invention, the placeholders are categorized from the content to which they correspond, including storage carrier element placeholders and data field placeholders. Replacing the placeholder in the data table object template according to the storage carrier element and the data field information comprises replacing the placeholder of the storage carrier element in the data table object template according to the storage carrier element and replacing the placeholder of the data field in the data table object template according to the data field information.
In another embodiment of the present invention, the placeholders are categorized from the format to which they correspond, including key format placeholders and content format placeholders. Wherein, the keyword format placeholder is a { { KEY } } -format placeholder, namely, the placeholder is expressed by "{ { } }, and the content format placeholder is a" [ [ content ] ] "format placeholder, namely, the placeholder is expressed by" [ [ ] ". Some key format placeholders may also be included in the content format placeholders. The replacing of the placeholder in the data table object template according to the storage carrier element and the data field information can comprise the steps of replacing the keyword format placeholder according to the storage carrier element and the data field information in a keyword matching mode, generating data corresponding to the content format placeholder according to the storage carrier element and the data field information, and replacing the content format placeholder by using the data corresponding to the content format placeholder. Specifically, the { { { KEY } } -format placeholder is obtained by directly matching corresponding values from the storage carrier element and the data field information by means of keyword matching and directly replacing, the [ [ content ] ] format placeholder represents a field iteration part, the { { { KEY } -placeholder existing in the [ [ content ] ] content is also directly matched and replaced, the content other than { { { KEY } -in the [ [ content ] ] content is kept unchanged, the content is added at the end according to the actual field content iteration, the [ [ content ] ] content can be generated without reserving element connectors (commas) in the end [ [ content ] ] content, and then the [ [ content ] ] format placeholder in the template is replaced by the [ [ content ] ] content.
After replacing all placeholders in the data table object template, a table building sentence can be generated, so that the table building sentence is used for generating the data table. The method realizes the rapid generation of the data table designating the class of the storage engine according to the custom template, can automatically analyze according to the input information to obtain each field information aiming at different storage engines, and then combines the preset template information to generate a table-building statement corresponding to the storage engine by one key. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications.
In the embodiment of the present invention, the step S102 and the step S103 may be performed simultaneously or sequentially, and the sequence between the two steps is not fixed.
FIG. 2 is a schematic diagram of a data table generation flow according to one embodiment of the invention. In the embodiment of the invention, as shown in fig. 2, when generating a data table, front-end information input by a user is firstly acquired, the front-end information is analyzed to obtain data field information, model paradigm processing is carried out on the front-end information to obtain storage carrier elements, the storage carrier elements comprise storage engine types, then a corresponding data table object template is acquired according to the storage engine types, and then the data table is generated by combining the storage carrier elements, the data table object template and the data field information.
Fig. 3 is a schematic diagram of main modules of a data table generating apparatus according to an embodiment of the present invention. As shown in fig. 3, the data table generating apparatus 300 according to the embodiment of the present invention mainly includes:
a data obtaining module 301, configured to obtain, in response to a data table generation request, input information and a storage carrier element corresponding to a data table to be generated, where the storage carrier element includes a storage engine type;
the template obtaining module 302 is configured to obtain a corresponding data table object template according to the storage engine type;
a field parsing module 303, configured to parse the input information to obtain data field information of a data table to be generated;
The data table generating module 304 is configured to generate a table creating sentence according to the storage carrier element, the data table object template, and the data field information, and generate a data table using the table creating sentence.
According to an embodiment of the present invention, the field parsing module 303 may be further configured to determine a regular expression according to a data format corresponding to the input information, and match the input information line by line using the regular expression, so as to obtain data field information of the data table to be generated.
According to another embodiment of the present invention, the data format corresponding to the input information is determined according to the value of a data format key, the data format key including a field name key, a field type key, and a field annotation key.
According to still another embodiment of the present invention, the data table generating apparatus 300 may further include a field correction module (not shown in the figure) for, after parsing the input information to obtain data field information of the data table to be generated, displaying the parsed data field information in a form of a table through a page, so that a user can perform local correction on the data field information.
According to another embodiment of the invention, the data table object template is generated by respectively acquiring the data table object grammar specifications corresponding to each storage engine, and carrying out preemption on the data table object grammar specifications by using a placeholder according to the position of the actual usage scene filling content to obtain the data table object template corresponding to each storage engine.
According to yet another embodiment of the present invention, the data table generation module 304 may be further configured to replace placeholders in the data table object template according to the storage carrier element and the data field information to generate a table build statement.
According to a further embodiment of the invention, the placeholders comprise storage carrier element placeholders and data field placeholders, and the data table generation module 304 is further configured to replace the storage carrier element placeholders in the data table object template according to the storage carrier elements and to replace the data field placeholders in the data table object template according to the data field information.
According to a further embodiment of the present invention, the placeholder comprises a keyword format placeholder and a content format placeholder, the data table generation module 304 is further configured to replace the keyword format placeholder according to the storage carrier element and the data field information in a keyword matching manner, generate data corresponding to the content format placeholder according to the storage carrier element and the data field information, and replace the content format placeholder with the data corresponding to the content format placeholder.
According to the technical scheme, the method and the device for generating the data table according to the data table comprise the steps of responding to a data table generation request, obtaining input information and storage carrier elements corresponding to the data table to be generated, wherein the storage carrier elements comprise storage engine types, obtaining corresponding data table object templates according to the storage engine types, analyzing the input information to obtain data field information of the data table to be generated, generating a table construction statement according to the storage carrier elements, the data table object templates and the data field information, and generating the data table by using the table construction statement. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications.
Fig. 4 shows an exemplary system architecture 400 to which the data table generating method or the data table generating apparatus of the embodiment of the present invention can be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 is used as a medium to provide communication links between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 405 via the network 404 using the terminal devices 401, 402, 403 to receive or send messages or the like. Various communication client applications, such as database class applications, data table applications, search class applications, data management software, etc., may be installed on the terminal devices 401, 402, 403, as just examples.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 401, 402, 403. The background management server can respond to the received data such as the data table generation request and the like to acquire input information and a storage carrier element corresponding to the data table to be generated, wherein the storage carrier element comprises a storage engine type, acquires a corresponding data table object template according to the storage engine type, analyzes the input information to obtain data field information of the data table to be generated, generates a table construction statement according to the storage carrier element, the data table object template and the data field information, generates a data table by using the table construction statement and the like, and feeds back a processing result (such as the generated data table, which is only an example) to the terminal equipment.
It should be noted that, the method for generating a data table according to the embodiment of the present invention is generally executed by the server 405, and accordingly, the device for generating a data table is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing a terminal device or server in accordance with an embodiment of the present invention. The terminal device or server shown in fig. 5 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Connected to the I/O interface 505 are an input section 506 including a keyboard, a mouse, and the like, an output section 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like, a storage section 508 including a hard disk, and the like, and a communication section 509 including a network interface card such as a LAN card, a modem, and the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, a processor may be described as comprising a data acquisition module, a template acquisition module, a field parsing module, and a data table generation module. The names of these units or modules do not in some cases limit the units or modules themselves, and for example, the field parsing module may also be described as "a module for parsing the input information to obtain data field information of the data table to be generated".
As a further aspect, the invention also provides a computer readable medium which may be comprised in the device described in the above embodiments or may be present alone without being fitted into the device. The computer readable medium carries one or more programs, which when executed by the apparatus, cause the apparatus to include obtaining input information corresponding to a data table to be generated and a storage carrier element in response to a data table generation request, the storage carrier element including a storage engine type, obtaining a corresponding data table object template according to the storage engine type, parsing the input information to obtain data field information of the data table to be generated, generating a table construction statement according to the storage carrier element, the data table object template and the data field information, and generating the data table using the table construction statement.
According to the technical scheme, the method and the device for generating the data table according to the data table comprise the steps of responding to a data table generation request, obtaining input information and storage carrier elements corresponding to the data table to be generated, wherein the storage carrier elements comprise storage engine types, obtaining corresponding data table object templates according to the storage engine types, analyzing the input information to obtain data field information of the data table to be generated, generating a table construction statement according to the storage carrier elements, the data table object templates and the data field information, and generating the data table by using the table construction statement. The method has the advantages of realizing repeated use of one-time configuration of the template, inputting field information rapidly, simplifying the development process, improving the working efficiency, and reducing the learning cost of different storage engine table-building grammar specifications.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.