CN111352986A - Method and device for exporting database table structure and terminal equipment - Google Patents

Method and device for exporting database table structure and terminal equipment Download PDF

Info

Publication number
CN111352986A
CN111352986A CN202010131024.6A CN202010131024A CN111352986A CN 111352986 A CN111352986 A CN 111352986A CN 202010131024 A CN202010131024 A CN 202010131024A CN 111352986 A CN111352986 A CN 111352986A
Authority
CN
China
Prior art keywords
database
database table
worksheet
name
field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010131024.6A
Other languages
Chinese (zh)
Inventor
耿相国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010131024.6A priority Critical patent/CN111352986A/en
Publication of CN111352986A publication Critical patent/CN111352986A/en
Priority to PCT/CN2020/119294 priority patent/WO2021169300A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a method, a device and a terminal device for exporting a database table structure, wherein the method comprises the following steps: obtaining database information of a target database, wherein the database information comprises: address information, a database user name and a database password; after the database password and the database user name are verified, reading a database table to be exported, a database table annotation, a database table field and a database table field annotation according to the address information; exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; and exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet. Through the method and the device, the worksheet of the database table is generated, and when a plurality of tables exist in the database, the worksheets can be conveniently exported simultaneously for viewing and maintaining.

Description

Method and device for exporting database table structure and terminal equipment
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a device for exporting a database table structure and terminal equipment.
Background
During project development, databases are often used, and one database comprises a plurality of tables, namely a database table for recording project development; in the process of project development, certain functions of a development project can be added or modified, and a plurality of tables can be added in a corresponding database or the table structure needs to be modified; because documents of the table structure corresponding to the database are not completed or updated in time before the database is generated, and inconvenience is caused to later development and maintenance, the table structure of the database needs to be exported from the database so as to be modified or maintained later.
At present, tools exported by a traditional database table structure need to be additionally applied for installation, installation tools need to occupy more hard disk space, certain memory can be occupied during operation, and exported documents are documents in a specified format and can be opened only by starting corresponding tool programs, so that users who do not install the tools cannot check the documents, and a great deal of inconvenience is caused in the use process.
Disclosure of Invention
The embodiment of the application provides a method and a device for exporting a database table structure and terminal equipment, and can solve the problem that a traditional database table structure exporting tool is inconvenient to use.
In a first aspect, an embodiment of the present application provides a method for exporting a database table structure, including:
obtaining database information of a target database, wherein the database information comprises: address information, a database user name and a database password;
after the database password and the database user name are verified, reading a database table to be exported, a database table annotation, a database table field and a database table field annotation according to the address information;
exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet;
the generated directory worksheet and the generated database worksheet are located in the same table file under a preset path, and database table annotations in the directory worksheet correspond to the database table worksheet.
In a possible implementation manner of the first aspect, the obtaining database information of the target database includes:
obtaining a filter condition of the target database, wherein the filter condition comprises the database table annotation to be exported; and reading the database table annotation to be exported according to the filtering condition.
In a possible implementation manner of the first aspect, reading a database table to be exported, a database table annotation, a database table field, and a database table field annotation according to the address information includes:
acquiring a table name of a database table to be exported according to the database table;
acquiring a Chinese name corresponding to the table name of the database table to be exported according to the database table annotation;
acquiring a field name of the database table according to the database table field;
and acquiring the Chinese field annotation corresponding to the field name of the database table according to the table field annotation.
In a possible implementation manner of the first aspect, deriving and generating a directory worksheet from the database table and the database table annotations according to a preset format includes:
establishing the corresponding relation between the table name, the Chinese name corresponding to the table name and the position of the cell in the directory worksheet;
and exporting the table name and the Chinese name according to the corresponding relation and generating a directory worksheet.
In a possible implementation manner of the first aspect, deriving the database table fields and the database table field annotations according to a preset format and generating a database table worksheet includes:
and according to the corresponding relation among the database table fields, the database table field comments and the table names of the database tables, grouping and exporting the database table fields and the database table field comments corresponding to the table names of the database tables according to the table names of the database tables, and generating one or more database table worksheets.
In a possible implementation manner of the first aspect, the preset path includes a default path and a selected saving path;
storing the file with a preset name according to the default path or the selected saving path;
the preset name includes a time node from which the database table is derived.
In a possible implementation manner of the first aspect, the directory worksheet and the database worksheet are saved as local table files in xls or xlsx format according to a preset path and a preset name.
In a second aspect, an embodiment of the present application provides an apparatus for deriving a database table, including:
an obtaining module, configured to obtain database information of a target database, where the database information includes: address information, a database user name and a database password;
the reading module is used for reading a database table to be exported, a database table annotation, a database table field and a database table field annotation according to the address information after the database password and the database user name are verified;
the execution module is used for exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet; the generated directory worksheet and the generated database worksheet are located in the same table file under a preset path, and database table annotations in the directory worksheet correspond to the database table worksheet.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the method for deriving a database table according to any one of the first aspect.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that: the database table is generated by acquiring the database table needing to be exported, reading the field of the database table, and generating the database table worksheet, wherein the database table annotation in the database worksheet corresponds to the database table worksheet and is located in the same table file, and when a plurality of tables exist in the database, the database table annotation and the database table worksheet are convenient to export, view and maintain simultaneously, and have strong usability and practicability.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of a system provided by an embodiment of the present application;
FIG. 2 is a flow chart of a method for database table export according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an interface for database table export provided by an embodiment of the present application;
FIG. 4 is a schematic interface diagram of a database table structure according to an embodiment of the present application;
FIG. 5 is a schematic interface diagram of exporting a data table file according to an embodiment of the present application;
FIG. 6(a) is an interface diagram of an export data table file according to another embodiment of the present application;
FIG. 6(b) is an interface diagram of an export data table file according to another embodiment of the present application;
FIG. 7 is a schematic structural diagram of an apparatus for deriving a database table according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The method for deriving the database table provided in the embodiment of the present application may be applied to terminal devices such as a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a Personal Digital Assistant (PDA), and the embodiment of the present application does not limit the specific type of the terminal device.
Fig. 1 is a block diagram illustrating a partial structure of a terminal device provided in an embodiment of the present application. Referring to fig. 1, the terminal device includes: memory 110, input unit 120, display unit 130, wireless fidelity (WiFi) module 140, processor 150, and power supply 160. Those skilled in the art will appreciate that the configuration of the terminal device shown in fig. 1 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following specifically describes each constituent component of the terminal device with reference to fig. 1:
the memory 110 may be used to store software programs and modules, and the processor 150 executes various functional applications and data processing of the terminal device by operating the software programs and modules stored in the memory 110. The memory 110 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 110 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 120 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the input unit 120 may include a touch panel 121 and other input devices 122. The touch panel 121, also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 121 (e.g., an operation performed by the user on or near the touch panel 121 using any suitable object or accessory such as a finger or a stylus), and drive a corresponding connection device according to a preset program. Alternatively, the touch panel 121 may include two parts, i.e., a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 150, and can receive and execute commands sent by the processor 150. In addition, the touch panel 121 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 120 may include other input devices 122 in addition to the touch panel 121. In particular, other input devices 122 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 130 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The Display unit 130 may include a Display panel 131, and optionally, the Display panel 131 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 121 can cover the display panel 131, and when the touch panel 121 detects a touch operation on or near the touch panel 121, the touch operation is transmitted to the processor 150 to determine the type of the touch event, and then the processor 150 provides a corresponding visual output on the display panel 131 according to the type of the touch event. Although in fig. 1, the touch panel 121 and the display panel 131 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 121 and the display panel 131 may be integrated to implement the input and output functions of the terminal device.
WiFi belongs to a short-distance wireless transmission technology, and the terminal device can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 140, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 140, it is understood that it does not belong to the essential constitution of the terminal device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 150 is a control center of the terminal device, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 110 and calling data stored in the memory 110, thereby performing overall monitoring of the terminal device. Alternatively, processor 150 may include one or more processing units; preferably, the processor 150 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 150.
The terminal device also includes a power supply 160 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 150 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
The following embodiments may be implemented on a terminal device having the above-described hardware structure. The following embodiment will describe a method for deriving a database table provided in the embodiment of the present application, by taking a terminal device as an example.
As shown in fig. 2, the method for deriving a database table provided in the embodiment of the present application includes:
step S201, obtaining database information of a target database, where the database information includes: address information, database username, and database password.
In this embodiment, the type of the target database is a relational database Oracle, and the relational database stores data in a row-column manner to form a database table. One database can comprise a plurality of database tables, and all the database tables are displayed and stored in a target database in the form of corresponding relations among database table names, database table types and database table annotations; and displaying and storing the corresponding relation between the fields contained in each database table and the data table to which the fields belong aiming at each database table.
Specifically, as shown in fig. 3, an interface schematic diagram derived from a database table provided in an embodiment of the present application; the method comprises the following steps that an input box of a database address, a database user name and a database password is set on a database table export interface, and terminal equipment receives database information input by a user through an input unit on the database table export interface, and the method comprises the following steps: a database address, a database username, and a database password. The database address comprises a protocol name, a subprotocol name, an IP address of a database, a port and a database instance name; the database user name is a user name which has the authority of backing up the database and operating the specified field; the database password is used for verifying the reliability of the identity of the operating user and ensuring that the security of the database is not leaked; the database username and database password are used for identity validation.
In a possible implementation manner, as shown in fig. 3, an input box for exporting a path and a file name is further provided on the database table export interface; the export database table also comprises the determination of the export path and the export file name, an input box area for the export path and the export file name is arranged on the export interface of the database, and the relevant information of the export path and the export file name input by a user through an input unit of the terminal equipment can be received. The export path may be a default path, and may be automatically generated before each export, for example, default to a desktop of the operated terminal device, or an assigned path may be selectively set as required; the export filename may be a name determined from the current export time node or a receiving user input specific filename.
In one possible implementation, obtaining database information of a target database includes:
obtaining a filter condition of the target database, wherein the filter condition comprises the database table annotation to be exported; and reading the database table annotation to be exported according to the filtering condition.
In one embodiment, the database table is displayed and stored in the database in a form corresponding to the database table name, the database field and the database field annotation; when the database table is exported, the filter condition exported by the database table can be set as required. As shown in fig. 3, the filtering condition is that before exporting the database table, the terminal device receives the name of the database table or the field of the database table that needs to be exported and is input by the user at the export interface of the database table; specifically, an input template of the filter condition can be given in the filter condition input box area, and a user can fill or modify the filter condition according to the input template; when the database table is exported for multiple times, the input filter conditions can be memorized and stored for a preset time period, the filter conditions can be selected by a user within the preset time period, the database table does not need to be edited again when being exported for multiple times, the export time of the data is saved, and the export operation of the database table is more convenient.
It should be noted that the filtering condition may be a statement for a database table that needs to be exported in the target database, or may be a filtering condition for a database table that does not need to be exported in the target database; the filter condition may include a plurality of database tables that need to be exported or a plurality of database tables that do not need to be exported, and the export statement of the filter condition may be set by itself as needed.
And step S202, after the database password and the database user name are verified, reading a database table to be exported, a database table comment, a database table field and a database table field comment according to the address information.
In one embodiment, the obtained database password and the database user name are subjected to identity verification, so that the safety of the database and the reliability of the user identity for accessing the target data are ensured. In the target database, the database tables are stored in a column form, that is, the table names of all the database tables are a column, the table annotations corresponding to the table names are a column, the table fields are a column, and the table fields corresponding to the table fields are a column, and are stored and displayed. The terminal equipment reads the relevant information of the database table to be exported according to the export instruction, and the method comprises the following steps: database tables, database table annotations, database table fields, and database table field annotations.
The database table list in the target database comprises table names and corresponding table annotations of all database tables; the method can also comprise the database table type corresponding to the table name of each database table and the annotation specification corresponding to the database table; a plurality of field names and field annotations corresponding to the table names of the database table may also be included.
In an embodiment, as shown in fig. 4, in an interface schematic diagram of a database table structure provided in an embodiment of the present application, a target database includes table names of database tables, such as ACCT and ACCTPERSON; a plurality of field names corresponding to each database table, for example, plodyp, YNKC, YNPOS, YNCGQR, and YNCGSH corresponding to ACCT, and the field comments "estimate method", "whether store is in stock", "whether fast food system is connected", "whether purchase confirmation is required", "whether purchase audit is required", and the like corresponding to each field name.
Specifically, after reading the table name of the database table, the corresponding table annotation, and the plurality of field names and field annotations corresponding to the table name of the database table, the read data are grouped according to the table name of the database table, for example, the ACCT database table and the corresponding fields plodyp, YNKC, YNPOS, YNCGQR, and YNCGSH are in one group, and the ACCTPERSON database table and the corresponding fields card id, VNAME, VTELE, and VSIGN are in one group.
In one embodiment, reading a database table to be exported, a database table annotation, a database table field, and a database table field annotation according to the address information includes: acquiring a table name of a database table to be exported according to the database table; acquiring a Chinese name corresponding to the table name of the database table to be exported according to the database table annotation; acquiring a field name of the database table according to the database table field; and acquiring the Chinese field annotation corresponding to the field name of the database table according to the table field annotation.
In one possible implementation, the table name of the database table, for example, the table Chinese name "financial table" in fig. 5 corresponding to the table name "ACCT" of the database table, is queried and read by User _ TAB _ communists, the table annotation of the database table, that is, the Chinese name corresponding to the table name of the database table, for example, the table Chinese name "financial table" in fig. 5 corresponding to the table name "ACCT" of the database table; querying and reading field names of the database table, such as fields PLANTYP, YNKC, YNPOS, YNCQR, YNCGSH of the database table in FIG. 4, through USER _ TAB _ COLS; the field COMMENTS of the database table, i.e. the Chinese field COMMENTS corresponding to the field names of the database table, such as the Chinese field COMMENTS "forecast method", "store is in stock", etc. in fig. 4, are queried and read through USER _ COL _ COMMENTS.
Step S203, exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; and exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet.
In one possible implementation, the database table and the database table annotation of the target database are exported, that is, the table name of the database table and the corresponding Chinese name are exported, and a directory worksheet of the database table is generated. As shown in fig. 5, an interface diagram for exporting a data table file provided in an embodiment of the present application is provided with a preset format, a list of table names (ACCT, ACCTPERSON), and a list of corresponding chinese names (financial table, financial staff table), and is stored in a directory worksheet, and the names of the directory worksheet may be automatically set as a table directory, so as to facilitate rapid differentiation and selection when a plurality of database tables are exported to generate a plurality of worksheets, and facilitate operation.
And in addition, the database table fields and the database table field annotations are exported according to a preset format, and a database table worksheet is generated. As shown in fig. 6(a) and fig. 6(b), in another embodiment of the present application, an interface diagram for exporting a data table file is provided, in the exported worksheet, table names and chinese names corresponding to the database table ACCT and ACCTPERSON are all in the table directory; fields PLANTYP, YNKC, YNPOS, YNCQR and YNCGSH of the database table ACCT are all in a working table named ACCT, and the name of the working table is a Chinese name corresponding to the table name of the database table; correspondingly, the fields CARDID, VNAME, VTELE and VSIGN of the database table ACCTPERSON are all in a working table named ACCTPERSON, and the name of the working table is a Chinese name corresponding to the table name of the database table.
In one embodiment, exporting the database table and the database table annotation according to a preset format and generating a directory worksheet, the method includes:
a1, establishing the corresponding relation between the table name, the Chinese name corresponding to the table name and the position of the cell in the catalog worksheet;
specifically, according to the read database table and the database table annotations, a directory worksheet corresponding to the database table and the database table annotations is established, the addresses of the cells in the directory worksheet are obtained, and the corresponding relation of each data in the database table and the database table annotations to the addresses of each cell in the directory worksheet is established.
And A2, exporting the table name and the Chinese name according to the corresponding relation and generating a directory worksheet.
Specifically, according to the corresponding relation of each data in the database table and the database table annotation to each cell address in the directory worksheet, the read database table and the read database table annotation are added into the directory worksheet, the attributes of the cells in the directory worksheet are determined according to the data types of the database table and the database table annotation, and the corresponding data types are recorded.
In one embodiment, exporting the database table fields and database table field annotations according to a preset format and generating a database table worksheet, comprising:
and according to the corresponding relation among the database table fields, the database table field comments and the table names of the database tables, grouping and exporting the database table fields and the database table field comments corresponding to the table names of the database tables according to the table names of the database tables, and generating one or more database table worksheets.
Specifically, a database table worksheet corresponding to each database table is established according to database table fields and database table field annotations, the addresses of cells in the database table worksheet are obtained, the names of the database table worksheets are set according to the table names of the database tables, the corresponding relation between each data in the database table fields and the database table field annotations and the addresses of each cell in the database table worksheets is established, the database table fields and the database table field annotations are sequentially added into the database table worksheets according to the corresponding relation, the cell attributes in the corresponding database table worksheets are determined according to the data types of the database table fields and the database table field annotations, and relevant information such as data types, default values and descriptions corresponding to the field names is marked.
In one possible implementation, the directory worksheet is the names and corresponding annotation descriptions of all database tables required to be exported in the database table list, i.e. the directory of the tables; the database table worksheet is a data structure and content corresponding to each database table; establishing a link between the Chinese name of the database table in the directory worksheet or the table name and the database table worksheet, directly jumping to the corresponding database table worksheet from the Chinese name of the database table in the directory worksheet, setting a connection with the directory worksheet in each database table worksheet, directly jumping to the directory worksheet from a certain database table worksheet, and directly jumping to the corresponding financial table or financial staff table by clicking the 'financial table' or 'financial staff table' as shown in fig. 5. As shown in fig. 6(a) or 6(b), in the finance table or finance staff table interface, the list table can be directly returned through the "return list". It should be noted that the number of the database table worksheets is determined according to the number of the database tables to be derived, that is, each name in the directory worksheet corresponds to one database table worksheet, and the established link can directly jump from the directory worksheet to the corresponding selected database table worksheet, so that the database structure can be conveniently checked and modified.
In a possible implementation manner, the directory worksheet and the database worksheet are saved as local table files in xls or xlsx format according to a preset path and a preset name.
For example, the directory worksheet and the database worksheets may be stored locally according to a preset path and a preset name of the application program, and the table file stored locally is an Excel table file in an xls or xlsx format; the directory worksheet and the plurality of database worksheets may be generated in a table file as desired, with the table names of the database tables in the directory worksheet including all of the database table worksheets in the file.
In a possible implementation manner, the preset path includes a default path and a selected saving path;
storing the file with a preset name according to the default path or the selected saving path; the preset name includes a time node from which the database table is derived.
In one embodiment, the preset name may be a name containing a date and generated according to the current export time node, and may be embodied to, for example, the year, month, day, hour and minute, so as to avoid duplication of file names and occurrence of table files with the same name when exporting database table files of multiple databases, and ensure that the files can be successfully saved each time.
In one embodiment, after the database table is exported to the workbook, corresponding table query script information is generated according to the database table structure in each database table worksheet, so that the table building program can be modified or updated conveniently; the script information is directly copied, and a database table can be directly built in a database client tool. Especially for the scene with more database tables, the exported database structure document format is simple and clear, the viewing is convenient, and no complicated export tool needs to be additionally installed.
In addition, the export progress can be displayed in the export process, and a prompt of the export progress is given, for example, as shown in fig. 3, display frames are arranged below the "export" and "quit" keys; when the input filtering condition is selected, a corresponding filtering condition example can be displayed; when a export key is clicked to export data, a prompt of an export progress is displayed; specifically, the fields and storage locations read by the export process may be displayed, and a fault or problem occurring in the export process may be prompted, whether an error exists in the information input by the user may be prompted, and finally a prompt may be given for success or failure of export. In the exported form file, a 'homepage' worksheet can be reserved for the user to add remark information.
Through this embodiment, through obtaining the database table that needs to derive, generate the table directory worksheet, read the field of database table, generate the worksheet of database table, including the worksheet of a plurality of database tables in the table directory worksheet, can realize corresponding jump between the two, when having a plurality of tables in the database, be convenient for derive simultaneously to look over and maintain.
It should be noted that, within the technical scope of the present disclosure, other sequencing schemes that can be easily conceived by those skilled in the art should also be within the protection scope of the present disclosure, and detailed description is omitted here.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Referring to fig. 7, it is a device for deriving database tables provided in the embodiment of the present application, and for convenience of explanation, only the relevant portions of the embodiment of the present application are shown.
The device for exporting the database table comprises:
an obtaining module 71, configured to obtain database information of a target database, where the database information includes: address information, a database user name and a database password;
a reading module 72, configured to read a database table to be exported, a database table annotation, a database table field, and a database table field annotation according to the address information after the database password and the database username are verified;
the execution module 73 is used for exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet; the generated directory worksheet and the generated database worksheet are located in the same table file under a preset path, and database table annotations in the directory worksheet correspond to the database table worksheet.
According to the embodiment, the database table needing to be exported is obtained, the table directory worksheet is generated, the fields of the database table are read, the worksheet of the database table is generated, the table directory worksheet comprises worksheets of a plurality of database tables, the table directory worksheets and the database table work have a link relation, the linkage relation is located in different worksheets in the same table file, corresponding jump can be achieved through linkage indication, namely, the corresponding data table worksheets are directly jumped to from the table directory worksheets according to needs, and the table directory worksheets can be directly returned from the linkage indication in the database table work; where multiple tables exist in a database, simultaneous export is facilitated for viewing and maintenance.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal device 8 of this embodiment includes: at least one processor 80 (only one shown in fig. 8), a memory 81, and a computer program 82 stored in the memory 81 and executable on the at least one processor 80, the processor 80 implementing the steps in any of the various database table derivation method embodiments described above when executing the computer program 82.
The terminal device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of the terminal device 8, and does not constitute a limitation of the terminal device 8, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 80 may be a Central Processing Unit (CPU), and the Processor 80 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may in some embodiments be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal device 8. The memory 81 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 81 may also be used to temporarily store data that has been output or is to be output.
Through this embodiment, through obtaining the database table that needs to derive, generate the table directory worksheet, read the field of database table, generate the worksheet of database table, including the worksheet of a plurality of database tables in the table directory worksheet, can realize corresponding jump between the two, when having a plurality of tables in the database, be convenient for derive simultaneously to look over and maintain.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides a network device, where the network device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method of database table export, comprising:
obtaining database information of a target database, wherein the database information comprises: address information, a database user name and a database password;
after the database password and the database user name are verified, reading a database table to be exported, a database table annotation, a database table field and a database table field annotation according to the address information;
exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet;
the generated directory worksheet and the generated database worksheet are located in the same table file under a preset path, and database table annotations in the directory worksheet correspond to the database table worksheet.
2. The method of database table derivation according to claim 1, wherein obtaining database information for the target database comprises:
obtaining a filter condition of the target database, wherein the filter condition comprises the database table annotation to be exported; and reading the database table annotation to be exported according to the filtering condition.
3. The method of database table export according to claim 1 wherein reading the database table to be exported, the database table annotation, the database table field, and the database table field annotation based on the address information comprises:
acquiring a table name of a database table to be exported according to the database table;
acquiring a Chinese name corresponding to the table name of the database table to be exported according to the database table annotation;
acquiring a field name of the database table according to the database table field;
and acquiring the Chinese field annotation corresponding to the field name of the database table according to the table field annotation.
4. The method of database table export according to claim 3 wherein exporting the database tables and database table annotations in a predetermined format and generating a catalog worksheet comprises:
establishing the corresponding relation between the table name, the Chinese name corresponding to the table name and the position of the cell in the directory worksheet;
and exporting the table name and the Chinese name according to the corresponding relation and generating a directory worksheet.
5. The method of database table export according to claim 3 wherein exporting the database table fields and database table field annotations in a predetermined format and generating a database table worksheet comprises:
and according to the corresponding relation among the database table fields, the database table field comments and the table names of the database tables, grouping and exporting the database table fields and the database table field comments corresponding to the table names of the database tables according to the table names of the database tables, and generating one or more database table worksheets.
6. The method of database table derivation according to claim 1, comprising: the preset path comprises a default path and a selected saving path;
storing the file with a preset name according to the default path or the selected saving path;
the preset name includes a time node from which the database table is derived.
7. The method of database table derivation according to claim 6, comprising:
and the directory worksheet and the database worksheet are stored as local table files in an xls or xlsx format according to a preset path and a preset name.
8. An apparatus for database table derivation, comprising:
an obtaining module, configured to obtain database information of a target database, where the database information includes: address information, a database user name and a database password;
the reading module is used for reading a database table to be exported, a database table annotation, a database table field and a database table field annotation according to the address information after the database password and the database user name are verified;
the execution module is used for exporting the database table and the database table annotation according to a preset format and generating a directory worksheet; exporting the database table fields and the database table field comments according to a preset format and generating a database table worksheet; the generated directory worksheet and the generated database worksheet are located in the same table file under a preset path, and database table annotations in the directory worksheet correspond to the database table worksheet.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202010131024.6A 2020-02-28 2020-02-28 Method and device for exporting database table structure and terminal equipment Pending CN111352986A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010131024.6A CN111352986A (en) 2020-02-28 2020-02-28 Method and device for exporting database table structure and terminal equipment
PCT/CN2020/119294 WO2021169300A1 (en) 2020-02-28 2020-09-30 Method and apparatus for exporting database table structure, and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010131024.6A CN111352986A (en) 2020-02-28 2020-02-28 Method and device for exporting database table structure and terminal equipment

Publications (1)

Publication Number Publication Date
CN111352986A true CN111352986A (en) 2020-06-30

Family

ID=71194179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010131024.6A Pending CN111352986A (en) 2020-02-28 2020-02-28 Method and device for exporting database table structure and terminal equipment

Country Status (2)

Country Link
CN (1) CN111352986A (en)
WO (1) WO2021169300A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984670A (en) * 2020-07-27 2020-11-24 北京天健源达科技股份有限公司 Method for generating display view annotation information script
CN112035565A (en) * 2020-09-03 2020-12-04 天元大数据信用管理有限公司 Method for generating sql script according to word document
WO2021169300A1 (en) * 2020-02-28 2021-09-02 平安科技(深圳)有限公司 Method and apparatus for exporting database table structure, and terminal device
CN115376636A (en) * 2022-08-05 2022-11-22 河南翔宇医疗设备股份有限公司 Method, system and device for generating gauge and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968460B (en) * 2012-11-01 2015-09-02 陶光毅 Based on CD database storage system and utilize the method for this system
CN105278961B (en) * 2015-10-28 2018-07-13 广州华多网络科技有限公司 Generate the method and system of database table structure document
CN106202008B (en) * 2016-06-28 2019-04-05 武汉斗鱼网络科技有限公司 A kind of MySQL database structured document generation method and device
CN108121739B (en) * 2016-11-30 2022-07-19 株式会社日立制作所 Data collection method and data collection system
CN108664505B (en) * 2017-03-30 2021-08-13 腾讯科技(深圳)有限公司 Method and device for exporting database table structure
CN111352986A (en) * 2020-02-28 2020-06-30 平安科技(深圳)有限公司 Method and device for exporting database table structure and terminal equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021169300A1 (en) * 2020-02-28 2021-09-02 平安科技(深圳)有限公司 Method and apparatus for exporting database table structure, and terminal device
CN111984670A (en) * 2020-07-27 2020-11-24 北京天健源达科技股份有限公司 Method for generating display view annotation information script
CN111984670B (en) * 2020-07-27 2024-03-19 北京天健源达科技股份有限公司 Method for generating script of annotation information of display view
CN112035565A (en) * 2020-09-03 2020-12-04 天元大数据信用管理有限公司 Method for generating sql script according to word document
CN115376636A (en) * 2022-08-05 2022-11-22 河南翔宇医疗设备股份有限公司 Method, system and device for generating gauge and computer readable storage medium

Also Published As

Publication number Publication date
WO2021169300A1 (en) 2021-09-02

Similar Documents

Publication Publication Date Title
CN111352986A (en) Method and device for exporting database table structure and terminal equipment
US20210240922A1 (en) Grid data management
US8234562B1 (en) Error checking for data entry
US7689578B2 (en) Dealing with annotation versioning through multiple versioning policies and management thereof
AU2012209157B2 (en) Formatting data by example
US7870164B2 (en) Database part creation, merge and reuse
CN107480551B (en) File management method and device
US7743071B2 (en) Efficient data handling representations
US9442618B2 (en) Mobile device interface generator
CN107357593A (en) Source code file construction method, device, electric terminal and readable storage medium storing program for executing
CN102291456A (en) account number management method, device and system
CN109978565B (en) Product packaging data management method and device, terminal equipment and readable storage medium
JP7209306B2 (en) Online work system for Excel documents based on templates
WO2014035430A1 (en) Active regions of an image with accessible links
CN108717516B (en) File labeling method, terminal and medium
CN111930753B (en) Data retrieving method and device, electronic equipment and storage medium
WO2024001679A1 (en) Data publishing method and system
CN116414854A (en) Data asset query method, device, computer equipment and storage medium
CN107294766B (en) Centralized control method and system
JP2021131795A (en) Information processor, information processing method, and program
CN114327372B (en) Quality requirement configuration method, device, equipment and medium
US11568090B2 (en) Digital signatures for analytics
US20070050421A1 (en) Document management system, method of setting document management system, and computer product
JP5372997B2 (en) Quality analysis server and program
CN117555858A (en) Digital archive safe storage and retrieval system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40032343

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination