WO2021169300A1 - Method and apparatus for exporting database table structure, and terminal device - Google Patents

Method and apparatus for exporting database table structure, and terminal device Download PDF

Info

Publication number
WO2021169300A1
WO2021169300A1 PCT/CN2020/119294 CN2020119294W WO2021169300A1 WO 2021169300 A1 WO2021169300 A1 WO 2021169300A1 CN 2020119294 W CN2020119294 W CN 2020119294W WO 2021169300 A1 WO2021169300 A1 WO 2021169300A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
database table
name
field
comments
Prior art date
Application number
PCT/CN2020/119294
Other languages
French (fr)
Chinese (zh)
Inventor
耿相国
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021169300A1 publication Critical patent/WO2021169300A1/en

Links

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

Definitions

  • This application belongs to the field of big data, and in particular relates to a method, device and terminal equipment for deriving a database table structure.
  • databases are often used.
  • One database will include multiple tables, that is, database tables for recording project development; during project development, certain functions of the development project will be added or modified, and the corresponding database will also be added Many tables may need to modify the table structure; before the database is generated, the document of the table structure corresponding to the database is not improved or updated in time, which causes a lot of inconvenience to the later development and maintenance. Therefore, it is necessary to export the database table structure from the database in order to Modify or maintain later.
  • the installation tool takes up more hard disk space and also takes up a certain amount of memory when running.
  • the exported document is a document in a specified format and needs to be activated.
  • the tool program can only be opened, and users who have not installed the tool cannot view it. There are many inconveniences in the use process.
  • One of the objectives of the embodiments of the present application is to provide a method, device, and terminal device for deriving a database table structure, which can solve many inconvenience problems in the use of traditional database table structure derivation tools.
  • an embodiment of the present application provides a method for deriving a database table structure, including:
  • the database information including: address information, database user name, and database password;
  • the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  • the catalog worksheet is generated, the fields of the database table are read, and the database table worksheet is generated.
  • the database table comments in the catalog worksheet correspond to the database table worksheet and are located in the same table file .
  • an embodiment of the present application provides an apparatus for exporting a database table, including:
  • the obtaining module is used to obtain database information of the target database, the database information includes: address information, database user name, and database password;
  • a reading module configured to read the database table to be exported, database table comments, database table fields, and database table field comments according to the address information after the database password and the database user name are verified;
  • the execution module is used to export the database table and database table comments in a preset format and generate a catalog worksheet; export the database table fields and database table field comments in the preset format and generate a database table worksheet; wherein , The generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • a terminal device including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the computer program, Implement the described method.
  • an embodiment of the present application provides a computer-readable storage medium that stores a computer program that implements the method when the computer program is executed by a processor.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the method for exporting a database table described in any one of the above-mentioned first aspects.
  • the embodiment of the application has the following beneficial effects: by obtaining the database tables that need to be exported, generating the catalog worksheet, reading the fields of the database table, generating the database table worksheet, the database table comments in the catalog worksheet and the database
  • the table worksheets correspond to each other and are located in the same table file.
  • Fig. 1 is a schematic diagram of a system provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for exporting a database table provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of an interface for exporting a database table provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of an interface of a database table structure provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an interface for exporting a data table file provided by an embodiment of the present application
  • Figure 6(a) is a schematic diagram of an interface for exporting a data table file provided by another embodiment of the present application.
  • Figure 6(b) is a schematic diagram of an interface for exporting a data table file provided by another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an apparatus for deriving a database table provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • the method for exporting database tables provided in the embodiments of this application can be applied to tablet computers, notebook computers, and ultra-mobile personal computers (ultra-mobile personal computers).
  • personal computer UMPC
  • netbooks personal digital assistants
  • personal On terminal devices such as digital assistants, PDAs, etc.
  • the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
  • FIG. 1 shows a block diagram of a part of the structure of a terminal device provided in an embodiment of the present application.
  • the terminal device includes: a memory 110, an input unit 120, a display unit 130, wireless fidelity (wireless fidelity (WiFi) module 140, processor 150, power supply 160 and other components.
  • WiFi wireless fidelity
  • FIG. 1 does not constitute a limitation on the terminal device, and may include more or less components than shown in the figure, or a combination of certain components, or different component arrangements. .
  • the memory 110 may be used to store software programs and modules.
  • the processor 150 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 110.
  • the memory 110 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of terminal equipment (such as audio data, phone book, etc.), etc.
  • the memory 110 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 120 may be used to receive inputted number or character information, and generate key signal input related to user settings and function control of the terminal device.
  • the input unit 120 may include a touch panel 121 and other input devices 122.
  • the touch panel 121 also called a touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 121 or near the touch panel 121. Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 121 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 150, and can receive and execute the commands sent by the processor 150.
  • the touch panel 121 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the input unit 120 may also include other input devices 122.
  • the other input device 122 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • the display unit 130 may be used to display information input by the user or information provided to the user and various menus of the terminal device.
  • the display unit 130 may include a display panel 131.
  • a liquid crystal display Liquid Crystal Display, LCD
  • Organic Light Emitting Diode Organic Light Emitting Diode
  • the display panel 131 is configured in the form of Light-Emitting Diode, OLED).
  • the touch panel 121 can cover the display panel 131. When the touch panel 121 detects a touch operation on or near it, it transmits it to the processor 150 to determine the type of the touch event, and then the processor 150 responds to the touch event. The type provides corresponding visual output on the display panel 131.
  • the touch panel 121 and the display panel 131 are used as two independent components to implement the input and input functions of the terminal device, in some embodiments, the touch panel 121 and the display panel 131 may be integrated And realize the input and output functions of terminal equipment.
  • WiFi is a short-distance wireless transmission technology.
  • terminal devices can help users send and receive emails, browse web pages, and access streaming media. It provides users with wireless broadband Internet access.
  • FIG. 1 shows the WiFi module 140, it is understandable that it is not a necessary component of the terminal device, and can be omitted as needed without changing the essence of the invention.
  • the processor 150 is the control center of the terminal device. It uses various interfaces and lines to connect the various parts of the entire terminal device, runs or executes software programs and/or modules stored in the memory 110, and calls data stored in the memory 110 , Perform various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole.
  • the processor 150 may include one or more processing units; preferably, the processor 150 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 150.
  • the terminal device also includes a power supply 160 (such as a battery) for supplying power to various components.
  • a power supply 160 (such as a battery) for supplying power to various components.
  • the power supply may be logically connected to the processor 150 through a power management system, so that functions such as charging, discharging, and power management are realized through the power management system.
  • the following embodiments can be implemented on a terminal device having the above hardware structure.
  • the following embodiment will take a terminal device as an example to describe the method for deriving a database table provided in the embodiment of the present application.
  • the method for exporting a database table includes:
  • Step S201 Obtain database information of the target database, where the database information includes address information, database user name, and database password.
  • the type of the target database is a relational database Oracle, and the relational database stores data in the form of rows and columns to form a database table.
  • a database can include multiple database tables.
  • all database tables are displayed and stored in the form of the corresponding relationship between the database table name, database table type, and database table comment; for each database table, each database table The corresponding relationship between the fields contained in the table and the data table to which it belongs is displayed and stored.
  • FIG. 3 a schematic diagram of an interface for exporting a database table provided by an embodiment of the present application; an input box for the database address, database user name, and database password is set on the database table exporting interface, and the terminal device receives the user input through the input unit
  • the database information entered in the database table export interface includes: database address, database user name, and database password.
  • the database address includes the protocol name, sub-protocol name, IP address, port, and database instance name of the database
  • the database user name is the name of the user who has the authority to back up the database and operate the specified fields
  • the database password is used for verification
  • the reliability of the operating user's identity ensures that the security of the database is not leaked
  • the database user name and database password are used for identity confirmation.
  • the database table export interface is also provided with input boxes for the export path and export file name; exporting the database table also includes the determination of the export path and the export file name.
  • the database export interface is provided with an input box area for the export path and the export file name, which can receive the relevant information that the user inputs the export path and the export file name through the input unit of the terminal device.
  • the export path can be set to the default path, which is automatically generated before each export. For example, it can be the desktop of the terminal device being operated by default, or the specified path can be optionally set as needed; the export file name can be based on the current export Time node or receiving user input specific file name to confirm the name.
  • obtaining database information of the target database includes:
  • the database table is displayed and stored in the database in a form corresponding to the database table name, database field, and database field comment; when the database table is exported, the filter condition for the database table export can be set as needed.
  • the filter condition is that before exporting the database table, the terminal device receives the data table name or database table field that needs to be exported entered by the user on the database table export interface; specifically, filtering can be given in the filter condition input box area
  • the input template of the condition the user can fill in or modify the filter condition according to the input template; when exporting multiple times, the input filter condition can be stored in a preset time period, which can be selected by the user within the preset time period. There is no need to edit the database table again when it is exported multiple times, which saves data export time and makes the database table export operation more convenient.
  • the filter condition can be a statement for the database table that needs to be exported in the target database, or it can be a filter for the database table in the target database that does not need to be exported; the filter condition can include multiple databases that need to be exported Table or multiple database tables that do not need to be exported, you can set the export statement of the filter conditions according to your needs.
  • Step S202 After the database password and the database user name are verified, read the database table to be exported, the database table comment, the database table field, and the database table field comment according to the address information.
  • the obtained database password and database user name are authenticated to ensure the security of the database and the reliability of the identity of the user accessing the target data.
  • the database tables are stored in the form of columns, that is, the table names of all database tables are a column, the table comments corresponding to the table names are a column, the table fields are a column, and the table field comments corresponding to the table fields are a column.
  • Store display According to the export instruction, the terminal device reads relevant information of the database table to be exported, including: database table, database table comment, database table field, and database table field comment.
  • the database table list in the target database includes the table names of all database tables and corresponding table comments; it can also include the database table type corresponding to the table name of each database table and the comments corresponding to the database table; it can also include Multiple field names and field comments corresponding to the table name of the database table.
  • the target database includes the table name of the database table, such as ACCT, ACCTPERSON; Field names, such as PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH corresponding to ACCT, the field annotation corresponding to each field name "estimate method”, “does the store use inventory”, “is it connected to the fast food system”, “is it necessary “Purchase Confirmation”, “Whether Procurement Review Is Required", etc.
  • the table name of the database table such as ACCT, ACCTPERSON
  • Field names such as PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH corresponding to ACCT, the field annotation corresponding to each field name "estimate method”, “does the store use inventory”, “is it connected to the fast food system”, “is it necessary “Purchase Confirmation”, “Whether Procurement Review Is Required”, etc.
  • the read data is grouped according to the table name of the database table, for example,
  • the ACCT database table and its corresponding fields PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH are a group
  • the ACCTPERSON database table and its corresponding fields CARDID, VNAME, VTELE, VSIGN are a group.
  • reading the database table to be exported, database table comments, database table fields, and database table field comments according to the address information includes: obtaining the table name of the database table to be exported according to the database table; According to the database table comment, obtain the Chinese name corresponding to the table name of the database table to be exported; obtain the field name of the database table according to the database table field; obtain the Chinese name corresponding to the field name of the database table according to the table field comment Field comment.
  • query and read the table name of the database table through User_Tables For example, in Figure 5, the table Chinese name "financial table” corresponding to the table name "ACCT" of the database table is queried and read through USER_TAB_COMMENTS
  • the table comment of the database table that is, the Chinese name corresponding to the table name of the database table, for example, the Chinese name of the table "financial table” corresponding to the table name "ACCT” of the database table in Figure 5
  • query and read the field comments of the database table through USER_COL_COMMENTS that is, the Chinese field comments corresponding to the field names of the database table, such as those in Figure 4 Chinese field notes "estimate method", "does the store use inventory", etc.
  • Step S203 Export the database table and database table notes in a preset format and generate a catalog worksheet; export the database table fields and database table field notes in a preset format and generate a database table worksheet.
  • the database tables and database table comments of the target database are exported, that is, the table names of the database tables and the corresponding Chinese names are exported to generate a catalog work table of the database tables.
  • the interface diagram of the export data table file provided by an embodiment of this application has a preset format, one column of table names (ACCT, ACCTPERSON), and one column of corresponding Chinese names (financial table, financial personnel table).
  • the name of the catalog worksheet can be automatically set as the table catalog, which is convenient for quick distinction and selection when there are multiple database tables to export and generate multiple worksheets, which is more convenient for operation.
  • the database table fields and database table field comments are exported in a preset format and a database table worksheet is generated.
  • FIG 6(a) and Figure 6(b) another embodiment of the present application provides a schematic diagram of an interface for exporting a data table file.
  • the database tables ACCT and ACCTPERSON correspond to the table names and Chinese The names are in the table directory; the fields PLANTYP, YNKC, YNPOS, YNCGQR, and YNCGSH of the database table ACCT are all in the worksheet named ACCT.
  • the name of the worksheet is the 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 the worksheet named ACCTPERSON.
  • the name of the worksheet is the Chinese name corresponding to the table name of the database table.
  • exporting the database table and database table annotations in a preset format and generating a catalog work table includes:
  • exporting the database table fields and database table field comments in a preset format and generating a database table worksheet includes:
  • the database table field and the database table corresponding to the table name of the database table Field comments are grouped and exported and one or more database tables are generated.
  • the database table worksheet corresponding to each database table is established according to the database table field and the database table field comments, the address of the cell in the database table worksheet is obtained, and the name of the database table worksheet is set according to the table name of the database table
  • the data type of the database table field annotation is determined to determine the cell attributes in the corresponding database table worksheet, and the data type, default value, description and other related information corresponding to the field name are marked.
  • the catalog worksheet is the names and corresponding notes of all database tables that are required to be exported in the database table list, that is, the catalog of the tables;
  • the database table worksheet is the data structure and corresponding data of each database table Content; establish the link between the Chinese name of the database table in the catalog worksheet or the table name and the database table worksheet, from the Chinese name of the database table in the catalog worksheet, you can directly jump to the corresponding database table worksheet, in each In the database table worksheet, there is a connection with the directory worksheet, and you can directly jump from a certain database table worksheet to the directory worksheet, as shown in Figure 5, click "Financial Table” or "Financial Personnel Table” You can jump directly to the corresponding financial table or financial staff table.
  • the number of database table worksheets is determined by the number of database tables that need to be exported, that is, each name in the directory worksheet corresponds to a database table worksheet, and you can directly jump from the directory worksheet to the corresponding one through the established link In the selected database table worksheet, it is convenient to view and modify the database structure.
  • the catalog worksheet and the database worksheet are saved as a local table file in xls or xlsx format according to a preset path and a preset name.
  • the catalog worksheet and multiple database worksheets can be stored locally according to the preset path and preset name of the application, and the table file stored locally is an Excel table file in xls or xlsx format; the catalog worksheet and more Each database worksheet can be generated in a table file as required, and the table name of the database table in the directory worksheet includes all the database table worksheets in the file.
  • the preset path includes a default path and a selected save path
  • the file is stored with a preset name according to the default path or the selected saving path; the preset name includes the time node at which the database table is exported.
  • the preset name may be a name containing the date generated according to the current export time node, for example, it may be specific to year, month, day, hour and minute, which is used to avoid file names when exporting database table files of multiple databases. If the form file with the same name is repeated, it can be saved successfully every time.
  • the corresponding table query script information is generated according to the database table structure in each database table worksheet, so as to facilitate the modification or update of the table building program; the script information is directly copied Out, the database table can be built directly in the database client tool.
  • the format of the exported database structure document is concise and easy to view, without the need to install additional complex export tools.
  • the export progress can be displayed and prompts for the export process are given.
  • the export progress can be displayed and prompts for the export process are given.
  • Condition example when you click the export button to export data, a prompt of the export progress will be displayed; specifically, it can display the fields read during the export process and the storage location, and prompt the failure or problem during the export process, and prompt the user to input Whether there are errors in the information, and finally give a prompt of export success or export failure.
  • the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated.
  • the table catalog worksheets include the worksheets of multiple database tables. The corresponding jump can be realized. When there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
  • FIG. 7 is an apparatus for deriving a database table provided by an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown.
  • the device for exporting the database table includes:
  • the obtaining module 71 is configured to obtain database information of the target database, the database information including: address information, database user name, and database password;
  • the reading module 72 is configured to read the to-be-exported database table, database table comment, database table field, and database table field comment according to the address information after the database password and the database user name are verified;
  • the execution module 73 is configured to export the database table and database table notes in a preset format and generate a catalog worksheet; export the database table fields and database table field notes in the preset format and generate a database table worksheet; Wherein, the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  • the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated.
  • the table catalog worksheets include worksheets of multiple database tables, and the table catalog worksheets There is a link relationship between the work with the database table, which is located in different worksheets in the same table file, and the corresponding jump can be realized through the link instruction, that is, jump directly from the table directory worksheet to the corresponding data table as needed Worksheets can also be directly returned to the table catalog worksheets from the link instructions in the database table work; when there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
  • FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • the terminal device 8 of this embodiment includes: at least one processor 80 (only one is shown in FIG. A computer program 82 running on the processor 80, when the processor 80 executes the computer program 82, the steps in any of the foregoing embodiments of the method for exporting a database table are implemented.
  • the terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 80 and a memory 81.
  • FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), the processor 80 may also be other general-purpose processors or digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the terminal device 8 in some embodiments, such as a hard disk or 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 equipped on the terminal device 8, a smart memory card (Smart Memory Card). Media Card, SMC), Secure Digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device.
  • the memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
  • the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated.
  • the table catalog worksheets include the worksheets of multiple database tables. The corresponding jump can be realized. When there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
  • An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and running on the at least one processor, and the processor executes The computer program implements the steps in any of the foregoing method embodiments.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium stores a computer program, and the computer When the program is executed by the processor, the steps in the foregoing method embodiments can be realized.
  • the embodiments of the present application provide a computer program product.
  • the steps in the foregoing method embodiments can be realized when the mobile terminal is executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may at least include: any entity or device capable of carrying computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunications signals
  • software distribution media For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/network equipment and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

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

A method and apparatus for exporting a database table structure, and a terminal device, which are applicable to the technical field of computers. The method comprises: acquiring database information of a target database, wherein the database information comprises: address information, a database user name and a database password (S201); after the database password and the database user name pass verification, 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 (S202); and exporting the database table and the database table annotation according to a preset format and generating a directory worksheet, and exporting the database table field and the database table field annotation according to a preset format and generating a database table worksheet (S203). By means of the method, a worksheet of a database table is generated, and when there are a plurality of tables in a database, it is convenient to simultaneously export the tables for viewing and maintenance.

Description

一种数据库表结构导出的方法、装置及终端设备Method, device and terminal equipment for exporting database table structure
本申请要求于2020年02月28日在中华人民共和国国家知识产权局专利局提交的、申请号为202010131024.6、发明名称为“一种数据库表结构导出的方法、装置及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires a Chinese patent application filed at the Patent Office of the State Intellectual Property Office of the People’s Republic of China on February 28, 2020, with an application number of 202010131024.6, and the title of the invention "a method, device and terminal device for deriving a database table structure" The priority of, the entire content of which is incorporated in this application by reference.
技术领域Technical field
本申请属于大数据领域,尤其涉及一种数据库表结构导出的方法、装置及终端设备。This application belongs to the field of big data, and in particular relates to a method, device and terminal equipment for deriving a database table structure.
背景技术Background technique
在项目开发时,经常会使用到数据库,一个数据库会包括多张表,即记录项目开发的数据库表;项目开发过程中,会添加或修改开发项目的某些功能,相应的数据库中也会增加很多表或需要对表结构进行修改;由于在生成数据库之前,与数据库对应的表结构的文档没有及时完善或更新,对后期的开发维护造成诸多不便,因此需要从数据库中导出数据库表结构,以便后期进行修改或维护。During project development, databases are often used. One database will include multiple tables, that is, database tables for recording project development; during project development, certain functions of the development project will be added or modified, and the corresponding database will also be added Many tables may need to modify the table structure; before the database is generated, the document of the table structure corresponding to the database is not improved or updated in time, which causes a lot of inconvenience to the later development and maintenance. Therefore, it is necessary to export the database table structure from the database in order to Modify or maintain later.
发明人意识到,传统的数据库表结构导出的工具需要额外申请安装,安装工具需要占用较多的硬盘空间,运行时也会占用一定的内存,而且导出的文档为指定格式的文档,需要启动对应的工具程序才能打开,对没有安装该工具的用户则无法查看,在使用过程中存在诸多不便。The inventor realized that the traditional database table structure export tool requires additional application for installation. The installation tool takes up more hard disk space and also takes up a certain amount of memory when running. Moreover, the exported document is a document in a specified format and needs to be activated. The tool program can only be opened, and users who have not installed the tool cannot view it. There are many inconveniences in the use process.
技术问题technical problem
本申请实施例的目的之一在于:提供了一种数据库表结构导出的方法、装置及终端设备,可以解决传统数据库表结构导出工具在使用过程中存在诸多不便的问题。One of the objectives of the embodiments of the present application is to provide a method, device, and terminal device for deriving a database table structure, which can solve many inconvenience problems in the use of traditional database table structure derivation tools.
技术解决方案Technical solutions
为解决上述技术问题,本申请实施例采用的技术方案是:In order to solve the above technical problems, the technical solutions adopted in the embodiments of this application are:
第一方面,本申请实施例提供了一种数据库表结构导出的方法,包括:In the first aspect, an embodiment of the present application provides a method for deriving a database table structure, including:
获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;Acquiring database information of the target database, the database information including: address information, database user name, and database password;
对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;After the database password and the database user name are verified, read the database table to be exported, the database table comment, the database table field, and the database table field comment according to the address information;
将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;Exporting the database table and database table comments in a preset format and generating a catalog worksheet; exporting the database table fields and database table field comments in a preset format and generating the database table worksheet;
其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。Wherein, the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
在上述方式中,通过获取需要导出数据库表,生成目录工作表,读取数据库表的字段,生成数据库表工作表,目录工作表中数据库表注释与数据库表工作表相对应且位于同一表格文件中,在数据库中存在多个表时,便于同时导出、查看和维护,具有较强的易用性与实用性。In the above method, by obtaining the database tables that need to be exported, the catalog worksheet is generated, the fields of the database table are read, and the database table worksheet is generated. The database table comments in the catalog worksheet correspond to the database table worksheet and are located in the same table file , When there are multiple tables in the database, it is convenient to export, view and maintain at the same time, and has strong ease of use and practicality.
第二方面,本申请实施例提供了一种数据库表导出的装置,包括:In the second aspect, an embodiment of the present application provides an apparatus for exporting a database table, including:
获取模块,用于获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;The obtaining module is used to obtain database information of the target database, the database information includes: address information, database user name, and database password;
读取模块,用于对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;A reading module, configured to read the database table to be exported, database table comments, database table fields, and database table field comments according to the address information after the database password and the database user name are verified;
执行模块,用于将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。The execution module is used to export the database table and database table comments in a preset format and generate a catalog worksheet; export the database table fields and database table field comments in the preset format and generate a database table worksheet; wherein , The generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现所述的方法。In the third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, Implement the described method.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium that stores a computer program that implements the method when the computer program is executed by a processor.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的数据库表导出的方法。In a fifth aspect, the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the method for exporting a database table described in any one of the above-mentioned first aspects.
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It is understandable that, for the beneficial effects of the second aspect to the fifth aspect described above, reference may be made to the relevant description in the first aspect described above, and details are not repeated here.
有益效果Beneficial effect
本申请实施例与现有技术相比存在的有益效果是:通过获取需要导出数据库表,生成目录工作表,读取数据库表的字段,生成数据库表工作表,目录工作表中数据库表注释与数据库表工作表相对应且位于同一表格文件中,在数据库中存在多个表时,便于同时导出、查看和维护,具有较强的易用性与实用性。Compared with the prior art, the embodiment of the application has the following beneficial effects: by obtaining the database tables that need to be exported, generating the catalog worksheet, reading the fields of the database table, generating the database table worksheet, the database table comments in the catalog worksheet and the database The table worksheets correspond to each other and are located in the same table file. When there are multiple tables in the database, it is convenient to export, view and maintain at the same time, and has strong ease of use and practicability.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或示范性技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the embodiments or exemplary technical descriptions. Obviously, the accompanying drawings in the following description are only of the present application. For some embodiments, those of ordinary skill in the art can obtain other drawings based on these drawings without creative work.
图1是本申请一实施例提供的系统示意图;Fig. 1 is a schematic diagram of a system provided by an embodiment of the present application;
图2是本申请一实施例提供的数据库表导出的方法的流程示意图;2 is a schematic flowchart of a method for exporting a database table provided by an embodiment of the present application;
图3是本申请一实施例提供的数据库表导出的界面示意图;FIG. 3 is a schematic diagram of an interface for exporting a database table provided by an embodiment of the present application;
图4是本申请一实施例提供的数据库表结构的界面示意图;4 is a schematic diagram of an interface of a database table structure provided by an embodiment of the present application;
图5是本申请一实施例提供的导出数据表格文件的界面示意图;FIG. 5 is a schematic diagram of an interface for exporting a data table file provided by an embodiment of the present application;
图6(a)是本申请另一实施例提供的导出数据表格文件的界面示意图;Figure 6(a) is a schematic diagram of an interface for exporting a data table file provided by another embodiment of the present application;
图6(b)是本申请另一实施例提供的导出数据表格文件的界面示意图;Figure 6(b) is a schematic diagram of an interface for exporting a data table file provided by another embodiment of the present application;
图7是本申请实施例提供的数据库表导出的装置的结构示意图;FIG. 7 is a schematic structural diagram of an apparatus for deriving a database table provided by an embodiment of the present application;
图8是本申请实施例提供的终端设备的结构示意图。Fig. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
本申请实施例提供的数据库表导出的方法可以应用于平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The method for exporting database tables provided in the embodiments of this application can be applied to tablet computers, notebook computers, and ultra-mobile personal computers (ultra-mobile personal computers). personal computer, UMPC), netbooks, personal digital assistants (personal On terminal devices such as digital assistants, PDAs, etc., the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
图1示出的是与本申请实施例提供的终端设备的部分结构的框图。参考图1,终端设备包括:存储器110、输入单元120、显示单元130、无线保真(wireless fidelity,WiFi)模块140、处理器150、以及电源160等部件。本领域技术人员可以理解,图1中示出的终端设备的结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 1 shows a block diagram of a part of the structure of a terminal device provided in an embodiment of the present application. 1, the terminal device includes: a memory 110, an input unit 120, a display unit 130, wireless fidelity (wireless fidelity (WiFi) module 140, processor 150, power supply 160 and other components. Those skilled in the art can understand that the structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device, and may include more or less components than shown in the figure, or a combination of certain components, or different component arrangements. .
下面结合图1对终端设备的各个构成部件进行具体的介绍:The following describes the components of the terminal device in detail with reference to Figure 1:
存储器110可用于存储软件程序以及模块,处理器150通过运行存储在存储器110的软件程序以及模块,从而执行终端设备的各种功能应用以及数据处理。存储器110可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端设备的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器110可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 110 may be used to store software programs and modules. The processor 150 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 110. The memory 110 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of terminal equipment (such as audio data, phone book, etc.), etc. In addition, the memory 110 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
输入单元120可用于接收输入的数字或字符信息,以及产生与终端设备的用户设置以及功能控制有关的键信号输入。具体地,输入单元120可包括触控面板121以及其他输入设备122。触控面板121,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板121上或在触控面板121附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板121可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器150,并能接收处理器150发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板121。除了触控面板121,输入单元120还可以包括其他输入设备122。具体地,其他输入设备122可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 120 may be used to receive inputted number or character information, and generate key signal input 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, can collect the user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 121 or near the touch panel 121. Operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 121 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 150, and can receive and execute the commands sent by the processor 150. In addition, the touch panel 121 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 121, the input unit 120 may also include other input devices 122. Specifically, the other input device 122 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
显示单元130可用于显示由用户输入的信息或提供给用户的信息以及终端设备的各种菜单。显示单元130可包括显示面板131,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode, OLED)等形式来配置显示面板131。进一步的,触控面板121可覆盖显示面板131,当触控面板121检测到在其上或附近的触摸操作后,传送给处理器150以确定触摸事件的类型,随后处理器150根据触摸事件的类型在显示面板131上提供相应的视觉输出。虽然在图1中,触控面板121与显示面板131是作为两个独立的部件来实现终端设备的输入和输入功能,但是在某些实施例中,可以将触控面板121与显示面板131集成而实现终端设备的输入和输出功能。The display unit 130 may be used to display information input by the user or information provided to the user and various menus of the terminal device. The display unit 130 may include a display panel 131. Optionally, a liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode (Organic The display panel 131 is configured in the form of Light-Emitting Diode, OLED). Further, the touch panel 121 can cover the display panel 131. When the touch panel 121 detects a touch operation on or near it, it transmits it to the processor 150 to determine the type of the touch event, and then the processor 150 responds to the touch event. The type provides corresponding visual output on the display panel 131. Although in FIG. 1, the touch panel 121 and the display panel 131 are used as two independent components to implement the input and input functions of the terminal device, in some embodiments, the touch panel 121 and the display panel 131 may be integrated And realize the input and output functions of terminal equipment.
WiFi属于短距离无线传输技术,终端设备通过WiFi模块140可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图1示出了WiFi模块140,但是可以理解的是,其并不属于终端设备的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology. Through the WiFi module 140, terminal devices can help users send and receive emails, browse web pages, and access streaming media. It provides users with wireless broadband Internet access. Although FIG. 1 shows the WiFi module 140, it is understandable that it is not a necessary component of the terminal device, and can be omitted as needed without changing the essence of the invention.
处理器150是终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器110内的软件程序和/或模块,以及调用存储在存储器110内的数据,执行终端设备的各种功能和处理数据,从而对终端设备进行整体监控。可选的,处理器150可包括一个或多个处理单元;优选的,处理器150可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器150中。The processor 150 is the control center of the terminal device. It uses various interfaces and lines to connect the various parts of the entire terminal device, runs or executes software programs and/or modules stored in the memory 110, and calls data stored in the memory 110 , Perform various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole. Optionally, the processor 150 may include one or more processing units; preferably, the processor 150 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 150.
终端设备还包括给各个部件供电的电源160(比如电池),优选的,电源可以通过电源管理系统与处理器150逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The terminal device also includes a power supply 160 (such as a battery) for supplying power to various components. Preferably, the power supply may be logically connected to the processor 150 through a power management system, so that functions such as charging, discharging, and power management are realized through the power management system.
以下实施例可以在具有上述硬件结构的终端设备上实现。以下实施例将以终端设备为例,对本申请实施例提供的的数据库表导出的方法进行说明。The following embodiments can be implemented on a terminal device having the above hardware structure. The following embodiment will take a terminal device as an example to describe the method for deriving a database table provided in the embodiment of the present application.
如图2所示,本申请实施例提供的数据库表导出的方法,包括:As shown in FIG. 2, the method for exporting a database table provided by the embodiment of the present application includes:
步骤S201,获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码。Step S201: Obtain database information of the target database, where the database information includes address information, database user name, and database password.
在本实施例中,目标数据库的类型为关系型数据库Oracle,关系型数据库以行列的形式存储数据,构成数据库表。一个数据库中可以包括多个数据库表,在目标数据库中,以数据库表名称、数据库表类型、数据库表注释的对应关系的形式显示并存储所有的数据库表;针对每个数据库表,以每个数据库表中所包含的字段与所属的数据表的对应关系,进行显示并存储。In this embodiment, the type of the target database is a relational database Oracle, and the relational database stores data in the form of rows and columns to form a database table. A database can include multiple database tables. In the target database, all database tables are displayed and stored in the form of the corresponding relationship between the database table name, database table type, and database table comment; for each database table, each database table The corresponding relationship between the fields contained in the table and the data table to which it belongs is displayed and stored.
具体的,如图3所示,本申请一实施例提供的数据库表导出的界面示意图;在数据库表导出界面设置数据库地址、数据库用户名以及数据库密码的输入框,终端设备接收用户通过输入单元在数据库表导出界面输入的数据库信息,包括:数据库地址、数据库用户名以及数据库密码。其中,数据库地址包括协议名、子协议名、数据库的IP地址、端口以及数据库实例名;数据库用户名为对数据库具有对数据库进行备份及对指定字段进行操作权限的用户名称;数据库密码用于验证操作用户身份的可靠性,保证数据库的安全不被泄露;数据库用户名和数据库密码用于身份的确认。Specifically, as shown in Figure 3, a schematic diagram of an interface for exporting a database table provided by an embodiment of the present application; an input box for the database address, database user name, and database password is set on the database table exporting interface, and the terminal device receives the user input through the input unit The database information entered in the database table export interface includes: database address, database user name, and database password. Among them, the database address includes the protocol name, sub-protocol name, IP address, port, and database instance name of the database; the database user name is the name of the user who has the authority to back up the database and operate the specified fields; the database password is used for verification The reliability of the operating user's identity ensures that the security of the database is not leaked; the database user name and database password are used for identity confirmation.
在一种可能的实现方式中,如图3所示,在数据库表导出界面还设置有导出路径、导出文件名的输入框;导出数据库表还包括对导出路径、导出文件名以的确定,在数据库导出界面设置有导出路径、导出文件名的输入框区域,可以接收用户通过终端设备的输入单元输入导出路径及导出文件名的相关信息。其中,导出路径可以设置默认的路径,在每次导出之前自动生成,例如可以默认为所操作的终端设备的桌面,还可以根据需要可选择性设置指定的路径;导出文件名可以为根据当前导出时间节点或接收用户输入特定的文件名称进行确定的名称。In a possible implementation, as shown in Figure 3, the database table export interface is also provided with input boxes for the export path and export file name; exporting the database table also includes the determination of the export path and the export file name. The database export interface is provided with an input box area for the export path and the export file name, which can receive the relevant information that the user inputs the export path and the export file name through the input unit of the terminal device. Among them, the export path can be set to the default path, which is automatically generated before each export. For example, it can be the desktop of the terminal device being operated by default, or the specified path can be optionally set as needed; the export file name can be based on the current export Time node or receiving user input specific file name to confirm the name.
在一种可能的实现方式中,获取目标数据库的数据库信息,包括:In a possible implementation manner, obtaining database information of the target database includes:
获取所述目标数据库的过滤条件,所述过滤条件包括待导出的所述数据库表注释;根据所述过滤条件读取待导出的所述数据库表注释。Obtain a filter condition of the target database, where the filter condition includes the database table comment to be exported; read the database table comment to be exported according to the filter condition.
在一个实施例中,数据库表在数据库中以数据库表名称、数据库字段及数据库字段注释相对应的形式显示并存储;导出数据库表时,可以根据需要设置数据库表导出的过滤条件。如图3所示,过滤条件为在导出数据库表之前,终端设备接收用户在数据库表导出界面输入的需要导出的数据表名称或数据库表字段;具体的,在过滤条件输入框区域可以给出过滤条件的输入模板,用户可以根据输入模板填写或修改过滤条件;在进行多次导出时,可以对已输入的过滤条件进行预设时间段的记忆存储,在预设时间段内可供用户选择,对数据库表多次导出时不必再次进行编辑,节省数据的导出时间,使数据库表导出操作更便捷。In one embodiment, the database table is displayed and stored in the database in a form corresponding to the database table name, database field, and database field comment; when the database table is exported, the filter condition for the database table export can be set as needed. As shown in Figure 3, the filter condition is that before exporting the database table, the terminal device receives the data table name or database table field that needs to be exported entered by the user on the database table export interface; specifically, filtering can be given in the filter condition input box area The input template of the condition, the user can fill in or modify the filter condition according to the input template; when exporting multiple times, the input filter condition can be stored in a preset time period, which can be selected by the user within the preset time period. There is no need to edit the database table again when it is exported multiple times, which saves data export time and makes the database table export operation more convenient.
需要说明的是,过滤条件可以是针对目标数据库中需要导出的数据库表的声明,还可以是针对目标数据库中,不需要导出的数据库表的过滤;其中,过滤条件可以包括多个需要导出的数据库表或多个不需要导出的数据库表,可以根据需要自行设定过滤条件的导出语句。It should be noted that the filter condition can be a statement for the database table that needs to be exported in the target database, or it can be a filter for the database table in the target database that does not need to be exported; the filter condition can include multiple databases that need to be exported Table or multiple database tables that do not need to be exported, you can set the export statement of the filter conditions according to your needs.
步骤S202,对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释。Step S202: After the database password and the database user name are verified, read the database table to be exported, the database table comment, the database table field, and the database table field comment according to the address information.
在一个实施例中,对获取的数据库密码以及数据库用户名进行身份验证,确保数据库的安全及访问目标数据的用户身份的可靠性。在目标数据库中,数据库表以列的形式存储,即所有数据库表的表名称为一列,与表名称对应的表注释为一列,表字段为一列,与表字段对应的表字段注释为一列,进行存储显示。终端设备根据导出指令,读取待导出的数据库表相关信息,包括:数据库表、数据库表注释、数据库表字段以及数据库表字段注释。In one embodiment, the obtained database password and database user name are authenticated to ensure the security of the database and the reliability of the identity of the user accessing the target data. In the target database, the database tables are stored in the form of columns, that is, the table names of all database tables are a column, the table comments corresponding to the table names are a column, the table fields are a column, and the table field comments corresponding to the table fields are a column. Store display. According to the export instruction, the terminal device reads relevant information of the database table to be exported, including: database table, database table comment, database table field, and database table field comment.
其中,目标数据库中的数据库表列表包括所有数据库表的表名称及对应的表注释;还可以包括与每个数据库表的表名称对应的数据库表类型及数据库表对应的注释说明;还可以包括与数据库表的表名称对应的多个字段名及字段注释。Among them, the database table list in the target database includes the table names of all database tables and corresponding table comments; it can also include the database table type corresponding to the table name of each database table and the comments corresponding to the database table; it can also include Multiple field names and field comments corresponding to the table name of the database table.
在一个实施例中,如图4所示的,本申请一实施例提供的数据库表结构的界面示意图,目标数据库中包括数据库表的表名称,例如ACCT、ACCTPERSON;与每个数据库表对应的多个字段名,例如与ACCT对应的PLANTYP、YNKC、YNPOS、YNCGQR、YNCGSH,每个字段名对应的字段注释“预估方式”、“门店是否用库存”、“是否连接快餐系统”、“是否需要采购确认”、“是否需要采购审核”等。In one embodiment, as shown in FIG. 4, an interface schematic diagram of the database table structure provided by an embodiment of the present application, the target database includes the table name of the database table, such as ACCT, ACCTPERSON; Field names, such as PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH corresponding to ACCT, the field annotation corresponding to each field name "estimate method", "does the store use inventory", "is it connected to the fast food system", "is it necessary "Purchase Confirmation", "Whether Procurement Review Is Required", etc.
具体的,读取数据库表的表名称、对应的表注释、与数据库表的表名称对应的多个字段名及字段注释后,对读取的数据按照数据库表的表名称进行分组,例如,比如ACCT数据库表及其对应的字段PLANTYP、YNKC、YNPOS、YNCGQR、YNCGSH为一组,ACCTPERSON数据库表及其对应的字段CARDID、VNAME、VTELE、VSIGN为一组。Specifically, after reading the table name of the database table, the corresponding table comment, multiple field names and field comments corresponding to the table name of the database table, the read data is grouped according to the table name of the database table, for example, The ACCT database table and its corresponding fields PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH are a group, and the ACCTPERSON database table and its corresponding fields CARDID, VNAME, VTELE, VSIGN are a group.
在一个实施例中,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释,包括:根据所述数据库表,获取待导出数据库表的表名称;根据所述数据库表注释,获取待导出数据库表的表名称对应的中文名称;根据所述数据库表字段,获取所述数据库表的字段名;根据所述表字段注释,获取数据库表的字段名对应的中文字段注释。In one embodiment, reading the database table to be exported, database table comments, database table fields, and database table field comments according to the address information includes: obtaining the table name of the database table to be exported according to the database table; According to the database table comment, obtain the Chinese name corresponding to the table name of the database table to be exported; obtain the field name of the database table according to the database table field; obtain the Chinese name corresponding to the field name of the database table according to the table field comment Field comment.
在一种可能的实现方式中,通过User_Tables查询并读取数据库表的表名称,例如图5中与数据库表的表名称“ACCT”对应的表中文名“财务表”,通过USER_TAB_COMMENTS查询并读取数据库表的表注释,即数据库表的表名称对应的中文名称,例如图5中与数据库表的表名称“ACCT”对应的表中文名“财务表”;通过USER_TAB_COLS查询并读取数据库表的字段名,例如图4中的数据库表的字段PLANTYP、YNKC、YNPOS、YNCGQR、YNCGSH;通过USER_COL_COMMENTS查询并读取数据库表的字段注释,即数据库表的字段名对应的中文字段注释,例如图4中的中文字段注释“预估方式”、“门店是否用库存”等。In a possible implementation, query and read the table name of the database table through User_Tables. For example, in Figure 5, the table Chinese name "financial table" corresponding to the table name "ACCT" of the database table is queried and read through USER_TAB_COMMENTS The table comment of the database table, that is, the Chinese name corresponding to the table name of the database table, for example, the Chinese name of the table "financial table" corresponding to the table name "ACCT" of the database table in Figure 5; query and read the fields of the database table through USER_TAB_COLS Names, such as the fields PLANTYP, YNKC, YNPOS, YNCGQR, YNCGSH in the database table in Figure 4; query and read the field comments of the database table through USER_COL_COMMENTS, that is, the Chinese field comments corresponding to the field names of the database table, such as those in Figure 4 Chinese field notes "estimate method", "does the store use inventory", etc.
步骤S203,将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表。Step S203: Export the database table and database table notes in a preset format and generate a catalog worksheet; export the database table fields and database table field notes in a preset format and generate a database table worksheet.
在一种可能的实现方式中,将目标数据库的数据库表及数据库表注释导出,即将数据库表的表名称和相应的中文名称导出,生成数据库表的目录工作表。如图5所示的,本申请一实施例提供的导出数据表格文件的界面示意图,安预设格式,表名称(ACCT、ACCTPERSON)一列,对应的中文名称(财务表、财务人员表)一列,存储至目录工作表中,目录工作表的名称可以自动设置为表目录,便于存在多个数据库表导出生成多个工作表时的快速区分和选择,更加方便操作。In a possible implementation manner, the database tables and database table comments of the target database are exported, that is, the table names of the database tables and the corresponding Chinese names are exported to generate a catalog work table of the database tables. As shown in Figure 5, the interface diagram of the export data table file provided by an embodiment of this application has a preset format, one column of table names (ACCT, ACCTPERSON), and one column of corresponding Chinese names (financial table, financial personnel table). Stored in the catalog worksheet, the name of the catalog worksheet can be automatically set as the table catalog, which is convenient for quick distinction and selection when there are multiple database tables to export and generate multiple worksheets, which is more convenient for operation.
另外,将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表。如图6(a)和图6(b)所示的,本申请另一实施例提供的导出数据表格文件的界面示意图,在导出的工作表中,数据库表ACCT、ACCTPERSON 对应的表名称及中文名称都在表目录中;数据库表ACCT的字段PLANTYP、YNKC、YNPOS、YNCGQR、YNCGSH都在名为ACCT的工作表中,该工作表的名称为数据库表的表名称对应的中文名称;相应的,数据库表ACCTPERSON的字段CARDID、VNAME、VTELE、VSIGN都在名为ACCTPERSON的工作表中,该工作表的名称为数据库表的表名称对应的中文名称。In addition, the database table fields and database table field comments are exported in a preset format and a database table worksheet is generated. As shown in Figure 6(a) and Figure 6(b), another embodiment of the present application provides a schematic diagram of an interface for exporting a data table file. In the exported worksheet, the database tables ACCT and ACCTPERSON correspond to the table names and Chinese The names are in the table directory; the fields PLANTYP, YNKC, YNPOS, YNCGQR, and YNCGSH of the database table ACCT are all in the worksheet named ACCT. The name of the worksheet is the 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 the worksheet named ACCTPERSON. The name of the worksheet is the Chinese name corresponding to the table name of the database table.
在一个实施例中,将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表,包括:In one embodiment, exporting the database table and database table annotations in a preset format and generating a catalog work table includes:
A1、建立所述表名称、与所述表名称对应的所述中文名称分别与所述目录工作表中单元格的位置对应关系;A1. Establish the corresponding relationship between the table name, the Chinese name corresponding to the table name, and the position of the cell in the catalog work table;
具体的,根据读取的数据库表、数据库表注释,建立与数据库表、数据库表注释对应的目录工作表,获取目录工作表中单元格的地址,建立数据库表、数据库表注释中每个数据在目录工作表中每个单元格地址的对应关系。Specifically, according to the read database tables and database table comments, establish a catalog work table corresponding to the database table and database table comments, obtain the address of the cell in the catalog work table, and establish the database table and database table comments for each data in the database table and database table comments. Correspondence of each cell address in the table of contents.
A2、根据所述对应关系,将所述表名称和所述中文名称导出并生成目录工作表。A2. According to the corresponding relationship, export the table name and the Chinese name and generate a catalog work table.
具体的,根据数据库表、数据库表注释中每个数据在目录工作表中每个单元格地址的对应关系,将读取的数据库表、数据库表注释添加至目录工作表中,根据数据库表、数据库表注释的数据类型确定目录工作表中单元格的属性并记录对应的数据类型。Specifically, add the read database table and database table comment to the directory work table according to the correspondence between each data in the database table and the database table comment and each cell address in the directory work table. According to the database table, database table comment, The data type of the table note determines the attributes of the cells in the table of contents and records the corresponding data type.
在一个实施例中,将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表,包括:In one embodiment, exporting the database table fields and database table field comments in a preset format and generating a database table worksheet includes:
根据所述数据库表字段、所述数据库表字段注释以及数据库表的表名称的对应关系,按所述数据库的表名称,将与数据库表的表名称对应的所述数据库表字段、所述数据库表字段注释分组导出并生成一个或多个数据库表工作表。According to the correspondence between the database table field, the database table field comment, and the table name of the database table, according to the table name of the database, the database table field and the database table corresponding to the table name of the database table Field comments are grouped and exported and one or more database tables are generated.
具体的,根据数据库表字段、数据库表字段注释建立与每个数据库表对应的数据库表工作表,获取数据库表工作表中单元格的地址,根据数据库表的表名称设定数据库表工作表的名称,建立数据库表字段、数据库表字段注释中每个数据与数据库表工作表中每个单元格地址的对应关系,根据所述对应关系将数据库表字段、数据库表字段注释依次添加至数据库表工作表中,根据数据库表字段、数据库表字段注释的数据类型确定相应的数据库表工作表中的单元格属性,并标注字段名称对应的数据类型、默认值、描述等相关信息。Specifically, the database table worksheet corresponding to each database table is established according to the database table field and the database table field comments, the address of the cell in the database table worksheet is obtained, and the name of the database table worksheet is set according to the table name of the database table Establish the correspondence relationship between each data in the database table field and database table field comment and each cell address in the database table worksheet, and add the database table field and database table field comments to the database table worksheet in turn according to the corresponding relationship In the database table field, the data type of the database table field annotation is determined to determine the cell attributes in the corresponding database table worksheet, and the data type, default value, description and other related information corresponding to the field name are marked.
在一种可能的实现方式中,目录工作表为数据库表格列表中要求导出的所有数据库表的名称和对应的注释说明,即表格的目录;数据库表工作表为每一个数据库表对应的数据结构和内容;建立目录工作表中数据库表的中文名称或表名称与数据库表工作表的链接,由目录工作表中的数据库表的中文名称可以直接跳转至相对应的数据库表工作表,在每一个数据库表工作表中,设置有与目录工作表的连接,可以直接由某一数据库表工作表直接跳转至目录工作表,如图5所示的,点击“财务表”或“财务人员表”可以直接跳转至对应的财务表或财务人员表。如图6(a)或6(b)所示的,在财务表或财务人员表界面,可以通过“返回表目录”直接返回至目录表格。需要说明的是,数据库表工作表的数量根据需要导出的数据库表的数量确定,即目录工作表中每一个名称对应一个数据库表工作表,通过建立的链接可以从目录工作表直接跳转至对应选择的数据库表工作表中,便于对数据库结构进行查看和修改。In a possible implementation, the catalog worksheet is the names and corresponding notes of all database tables that are required to be exported in the database table list, that is, the catalog of the tables; the database table worksheet is the data structure and corresponding data of each database table Content; establish the link between the Chinese name of the database table in the catalog worksheet or the table name and the database table worksheet, from the Chinese name of the database table in the catalog worksheet, you can directly jump to the corresponding database table worksheet, in each In the database table worksheet, there is a connection with the directory worksheet, and you can directly jump from a certain database table worksheet to the directory worksheet, as shown in Figure 5, click "Financial Table" or "Financial Personnel Table" You can jump directly to the corresponding financial table or financial staff table. As shown in Figure 6(a) or 6(b), in the financial table or financial staff table interface, you can directly return to the table of contents through "Return to table of contents". It should be noted that the number of database table worksheets is determined by the number of database tables that need to be exported, that is, each name in the directory worksheet corresponds to a database table worksheet, and you can directly jump from the directory worksheet to the corresponding one through the established link In the selected database table worksheet, it is convenient to view and modify the database structure.
在一种可能的实现方式中,所述目录工作表和所述数据库工作表按预设路径、预设名称保存为本地的xls或xlsx格式的表格文件。In a possible implementation manner, the catalog worksheet and the database worksheet are saved as a local table file in xls or xlsx format according to a preset path and a preset name.
示例性的,目录工作表和多个数据库工作表可以按应用程序的预设路径和预设名称存储至本地,存储至本地的表格文件为xls或xlsx格式的Excel表格文件;目录工作表和多个数据库工作表可以根据需要生成在一个表格文件中,目录工作表中的数据库表的表名称包括该文件中的所有数据库表工作表。Exemplarily, the catalog worksheet and multiple database worksheets can be stored locally according to the preset path and preset name of the application, and the table file stored locally is an Excel table file in xls or xlsx format; the catalog worksheet and more Each database worksheet can be generated in a table file as required, and the table name of the database table in the directory worksheet includes all the database table worksheets in the file.
在一种可能的实现方式中,所述预设路径包括默认路径和选择保存路径;In a possible implementation manner, the preset path includes a default path and a selected save path;
将所述文件以预设名称,按所述默认路径或所述选择保存路径进行存储;所述预设名称包括导出所述数据库表的时间节点。The file is stored with a preset name according to the default path or the selected saving path; the preset name includes the time node at which the database table is exported.
在一个实施例中,预设名称可以是根据当前导出时间节点生成的包含日期的名称,例如可以具体到年月日时分钟,用于在导出多个数据库的数据库表文件时,避免文件名称的重复、出现同名的表格文件的情况,确保每次都能保存成功。In one embodiment, the preset name may be a name containing the date generated according to the current export time node, for example, it may be specific to year, month, day, hour and minute, which is used to avoid file names when exporting database table files of multiple databases. If the form file with the same name is repeated, it can be saved successfully every time.
在一个实施例中,在将数据库表导出至工作簿后,根据每个数据库表工作表中数据库表结构生成对应的表格查询脚本信息,便于对建表程序进行修改或更新;将脚本信息直接拷贝出来,在数据库客户端工具中可以直接建数据库表。尤其针对数据库表格比较多的场景,使导出的数据库结构文档格式简洁明了,查看方便,不需要额外安装复杂的导出工具。In one embodiment, after the database table is exported to the workbook, the corresponding table query script information is generated according to the database table structure in each database table worksheet, so as to facilitate the modification or update of the table building program; the script information is directly copied Out, the database table can be built directly in the database client tool. Especially for scenarios where there are many database tables, the format of the exported database structure document is concise and easy to view, without the need to install additional complex export tools.
另外,在导出过程可以显示导出进度,给出导出进程的提示,例如图3所示,在“导出”和“退出”键下方设置有显示框;在选择输入过滤条件时,可以显示对应的过滤条件示例;在点击导出键进行数据数据导出时,显示导出进度的提示;具体的,可以显示导出过程读取的字段以及存储位置,并提示导出过程中的出现的故障或问题,提示用户输入的信息是否存在错误,并最终给出导出成功或导出失败的提示。在导出的表格文件中,还可以预留“主页”工作表,供用户添加备注信息。In addition, during the export process, the export progress can be displayed and prompts for the export process are given. For example, as shown in Figure 3, there are display boxes under the "Export" and "Exit" keys; when selecting the input filter conditions, the corresponding filter can be displayed. Condition example; when you click the export button to export data, a prompt of the export progress will be displayed; specifically, it can display the fields read during the export process and the storage location, and prompt the failure or problem during the export process, and prompt the user to input Whether there are errors in the information, and finally give a prompt of export success or export failure. In the exported form file, you can also reserve a "home page" worksheet for users to add remarks.
通过本实施例,通过获取需要导出数据库表,生成表目录工作表,读取数据库表的字段,生成数据库表的工作表,表目录工作表中包括多个数据库表的工作表,两者之间可以实现对应的跳转,在数据库中存在多个表时,便于同时导出,以查看和维护。Through this embodiment, by obtaining the database tables that need to be exported, the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated. The table catalog worksheets include the worksheets of multiple database tables. The corresponding jump can be realized. When there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
需要说明的是,本领域技术人员在本申请揭露的技术范围内,可容易想到的其他排序方案也应在本申请的保护范围之内,在此不一一赘述。It should be noted that within the technical scope disclosed by this application, those skilled in the art can easily think of other sorting schemes that should also fall within the protection scope of this application, and will not be repeated here.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
参见图7,是本申请实施例提供的数据库表导出的装置,为了便于说明,仅示出了与本申请实施例相关的部分。Refer to FIG. 7, which is an apparatus for deriving a database table provided by an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown.
所述数据库表导出的装置包括:The device for exporting the database table includes:
获取模块71,用于获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;The obtaining module 71 is configured to obtain database information of the target database, the database information including: address information, database user name, and database password;
读取模块72,用于对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;The reading module 72 is configured to read the to-be-exported database table, database table comment, database table field, and database table field comment according to the address information after the database password and the database user name are verified;
执行模块73,用于将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。The execution module 73 is configured to export the database table and database table notes in a preset format and generate a catalog worksheet; export the database table fields and database table field notes in the preset format and generate a database table worksheet; Wherein, the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
通过本实施例,通过获取需要导出数据库表,生成表目录工作表,读取数据库表的字段,生成数据库表的工作表,表目录工作表中包括多个数据库表的工作表,表目录工作表和数据库表工作两者之间存在链接关系,位于同一表格文件中的不同工作表中,通过链接指示可以实现对应的跳转,即从表目录工作表中根据需要直接跳转至相应的数据表工作表,还可以从数据库表工作中的链接指示直接返回表目录工作表;在数据库中存在多个表时,便于同时导出,以查看和维护。Through this embodiment, by obtaining the database tables that need to be exported, the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated. The table catalog worksheets include worksheets of multiple database tables, and the table catalog worksheets There is a link relationship between the work with the database table, which is located in different worksheets in the same table file, and the corresponding jump can be realized through the link instruction, that is, jump directly from the table directory worksheet to the corresponding data table as needed Worksheets can also be directly returned to the table catalog worksheets from the link instructions in the database table work; when there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
图8为本申请一实施例提供的终端设备的结构示意图。如图8所示,该实施例的终端设备8包括:至少一个处理器80(图8中仅示出一个)处理器、存储器81以及存储在所述存储器81中并可在所述至少一个处理器80上运行的计算机程序82,所述处理器80执行所述计算机程序82时实现上述任意各个数据库表导出方法实施例中的步骤。FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of this application. As shown in FIG. 8, the terminal device 8 of this embodiment includes: at least one processor 80 (only one is shown in FIG. A computer program 82 running on the processor 80, when the processor 80 executes the computer program 82, the steps in any of the foregoing embodiments of the method for exporting a database table are implemented.
所述终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的举例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art can understand that FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),该处理器80还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), the processor 80 may also be other general-purpose processors or digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器81在一些实施例中可以是所述终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81在另一些实施例中也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the terminal device 8 in some embodiments, such as a hard disk or 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 equipped on the terminal device 8, a smart memory card (Smart Memory Card). Media Card, SMC), Secure Digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
通过本实施例,通过获取需要导出数据库表,生成表目录工作表,读取数据库表的字段,生成数据库表的工作表,表目录工作表中包括多个数据库表的工作表,两者之间可以实现对应的跳转,在数据库中存在多个表时,便于同时导出,以查看和维护。Through this embodiment, by obtaining the database tables that need to be exported, the table catalog worksheet is generated, the fields of the database tables are read, and the worksheets of the database tables are generated. The table catalog worksheets include the worksheets of multiple database tables. The corresponding jump can be realized. When there are multiple tables in the database, it is convenient to export at the same time for viewing and maintenance.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
本申请实施例还提供了一种网络设备,该网络设备包括:至少一个处理器、存储器以及存储在所述存储器中并可在所述至少一个处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任意各个方法实施例中的步骤。An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and running on the at least one processor, and the processor executes The computer program implements the steps in any of the foregoing method embodiments.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium stores a computer program, and the computer When the program is executed by the processor, the steps in the foregoing method embodiments can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a mobile terminal, the steps in the foregoing method embodiments can be realized when the mobile terminal is executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in the present application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may at least include: any entity or device capable of carrying computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, according to legislation and patent practices, computer-readable media cannot be electrical carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/network equipment and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units. Or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种数据库表导出的方法,其中,包括: A method for exporting database tables, including:
    获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;Acquiring database information of the target database, the database information including: address information, database user name, and database password;
    对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;After the database password and the database user name are verified, read the database table to be exported, the database table comment, the database table field, and the database table field comment according to the address information;
    将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;Exporting the database table and database table comments in a preset format and generating a catalog worksheet; exporting the database table fields and database table field comments in a preset format and generating the database table worksheet;
    其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。Wherein, the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  2. 如权利要求1所述的数据库表导出的方法,其中,获取目标数据库的数据库信息,包括: The method for exporting a database table according to claim 1, wherein obtaining database information of the target database comprises:
    获取所述目标数据库的过滤条件,所述过滤条件包括待导出的所述数据库表注释;根据所述过滤条件读取待导出的所述数据库表注释。Obtain a filter condition of the target database, where the filter condition includes the database table comment to be exported; read the database table comment to be exported according to the filter condition.
  3. 如权利要求1所述的数据库表导出的方法,其中,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释,包括: The method for exporting a database table according to claim 1, wherein reading the database table to be exported, database table comments, database table fields, and database table field comments according to the address information comprises:
    根据所述数据库表,获取待导出数据库表的表名称;According to the database table, obtain the table name of the database table to be exported;
    根据所述数据库表注释,获取待导出数据库表的表名称对应的中文名称;Acquire the Chinese name corresponding to the table name of the database table to be exported according to the database table comment;
    根据所述数据库表字段,获取所述数据库表的字段名;Obtaining the field name of the database table according to the database table field;
    根据所述表字段注释,获取数据库表的字段名对应的中文字段注释。According to the table field comment, the Chinese field comment corresponding to the field name of the database table is obtained.
  4. 如权利要求3所述的数据库表导出的方法,其中,将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表,包括: The method for exporting a database table according to claim 3, wherein exporting the database table and database table annotations in a preset format and generating a catalog work table comprises:
    建立所述表名称、与所述表名称对应的所述中文名称分别与所述目录工作表中单元格的位置对应关系;Establishing the corresponding relationship between the table name, the Chinese name corresponding to the table name and the position of the cell in the catalog work table;
    根据所述对应关系,将所述表名称和所述中文名称导出并生成目录工作表。According to the corresponding relationship, the table name and the Chinese name are derived and a directory work table is generated.
  5. 如权利要求3所述的数据库表导出的方法,其中,将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表,包括: The method for exporting a database table according to claim 3, wherein the exporting of the database table fields and the database table field comments in a preset format and generating a database table worksheet comprises:
    根据所述数据库表字段、所述数据库表字段注释以及数据库表的表名称的对应关系,按所述数据库的表名称,将与数据库表的表名称对应的所述数据库表字段、所述数据库表字段注释分组导出并生成一个或多个数据库表工作表。According to the correspondence between the database table field, the database table field comment, and the table name of the database table, according to the table name of the database, the database table field and the database table corresponding to the table name of the database table Field comments are grouped and exported and one or more database tables are generated.
  6. 如权利要求1所述的数据库表导出的方法,其中,包括:所述预设路径包括默认路径和选择保存路径; The method for exporting a database table according to claim 1, wherein the method comprises: the preset path includes a default path and a selected save path;
    将所述文件以预设名称,按所述默认路径或所述选择保存路径进行存储;Store the file with a preset name according to the default path or the selected save path;
    所述预设名称包括导出所述数据库表的时间节点。The preset name includes the time node at which the database table is derived.
  7. 如权利要求6所述的数据库表导出的方法,其中,包括: The method for exporting a database table according to claim 6, which comprises:
    所述目录工作表和所述数据库工作表按预设路径、预设名称保存为本地的xls或xlsx格式的表格文件。The catalog worksheet and the database worksheet are saved as a local table file in xls or xlsx format according to a preset path and a preset name.
  8. 一种数据库表导出的装置,其中,包括: A device for exporting database tables, which includes:
    获取模块,用于获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;The obtaining module is used to obtain database information of the target database, the database information includes: address information, database user name, and database password;
    读取模块,用于对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;A reading module, configured to read the database table to be exported, database table comments, database table fields, and database table field comments according to the address information after the database password and the database user name are verified;
    执行模块,用于将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。The execution module is used to export the database table and database table comments in a preset format and generate a catalog worksheet; export the database table fields and database table field comments in the preset format and generate a database table worksheet; wherein , The generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  9. 如权利要求8所述的装置,其中,所述获取模块具体用于: The device according to claim 8, wherein the acquiring module is specifically configured to:
    获取所述目标数据库的过滤条件,所述过滤条件包括待导出的所述数据库表注释;根据所述过滤条件读取待导出的所述数据库表注释。Obtain a filter condition of the target database, where the filter condition includes the database table comment to be exported; read the database table comment to be exported according to the filter condition.
  10. 如权利要求8所述的装置,其中,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释,包括: The device according to claim 8, wherein reading the database table to be exported, database table comments, database table fields, and database table field comments according to the address information comprises:
    根据所述数据库表,获取待导出数据库表的表名称;According to the database table, obtain the table name of the database table to be exported;
    根据所述数据库表注释,获取待导出数据库表的表名称对应的中文名称;Acquire the Chinese name corresponding to the table name of the database table to be exported according to the database table comment;
    根据所述数据库表字段,获取所述数据库表的字段名;Obtaining the field name of the database table according to the database table field;
    根据所述表字段注释,获取数据库表的字段名对应的中文字段注释。According to the table field comment, the Chinese field comment corresponding to the field name of the database table is obtained.
  11. 如权利要求10所述的装置,其中,将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表,包括: 10. The device of claim 10, wherein exporting the database table and database table annotations in a preset format and generating a catalog work table comprises:
    建立所述表名称、与所述表名称对应的所述中文名称分别与所述目录工作表中单元格的位置对应关系;Establishing the corresponding relationship between the table name, the Chinese name corresponding to the table name and the position of the cell in the catalog work table;
    根据所述对应关系,将所述表名称和所述中文名称导出并生成目录工作表。According to the corresponding relationship, the table name and the Chinese name are derived and a directory work table is generated.
  12. 如权利要求10所述的装置,其中,将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表,包括: 10. The device of claim 10, wherein exporting the database table fields and database table field comments in a preset format and generating a database table worksheet comprises:
    根据所述数据库表字段、所述数据库表字段注释以及数据库表的表名称的对应关系,按所述数据库的表名称,将与数据库表的表名称对应的所述数据库表字段、所述数据库表字段注释分组导出并生成一个或多个数据库表工作表。According to the correspondence between the database table field, the database table field comment, and the table name of the database table, according to the table name of the database, the database table field and the database table corresponding to the table name of the database table Field comments are grouped and exported and one or more database tables are generated.
  13. 如权利要求8所述的装置,其中,包括:所述预设路径包括默认路径和选择保存路径; The device according to claim 8, wherein it comprises: the preset path includes a default path and a selected save path;
    将所述文件以预设名称,按所述默认路径或所述选择保存路径进行存储;Store the file with a preset name according to the default path or the selected save path;
    所述预设名称包括导出所述数据库表的时间节点。The preset name includes the time node at which the database table is derived.
  14. 如权利要求13所述的装置,其中,包括: The device according to claim 13, wherein it comprises:
    所述目录工作表和所述数据库工作表按预设路径、预设名称保存为本地的xls或xlsx格式的表格文件。The catalog worksheet and the database worksheet are saved as a local table file in xls or xlsx format according to a preset path and a preset name.
  15. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如下步骤: A terminal device includes a memory, a processor, and a computer program that is stored in the memory and can run on the processor, wherein the processor implements the following steps when the processor executes the computer program:
    获取目标数据库的数据库信息,所述数据库信息包括:地址信息、数据库用户名以及数据库密码;Acquiring database information of the target database, the database information including: address information, database user name, and database password;
    对所述数据库密码以及所述数据库用户名验证通过后,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释;After the database password and the database user name are verified, read the database table to be exported, the database table comment, the database table field, and the database table field comment according to the address information;
    将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表;将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表;Exporting the database table and database table comments in a preset format and generating a catalog worksheet; exporting the database table fields and database table field comments in a preset format and generating the database table worksheet;
    其中,所生成的所述目录工作表和所述数据库工作表位于预设路径下的同一表格文件中,所述目录工作表中的数据库表注释与数据库表工作表相对应。Wherein, the generated catalog work table and the database work table are located in the same table file under a preset path, and the database table comments in the catalog work table correspond to the database table work table.
  16. 如权利要求15所述的终端设备,其中,获取目标数据库的数据库信息,包括: The terminal device according to claim 15, wherein acquiring database information of the target database comprises:
    获取所述目标数据库的过滤条件,所述过滤条件包括待导出的所述数据库表注释;根据所述过滤条件读取待导出的所述数据库表注释。Obtain a filter condition of the target database, where the filter condition includes the database table comment to be exported; read the database table comment to be exported according to the filter condition.
  17. 如权利要求15所述的终端设备,其中,根据所述地址信息读取待导出数据库表、数据库表注释、数据库表字段以及数据库表字段注释,包括: The terminal device according to claim 15, wherein reading the database table to be exported, database table comments, database table fields, and database table field comments according to the address information comprises:
    根据所述数据库表,获取待导出数据库表的表名称;According to the database table, obtain the table name of the database table to be exported;
    根据所述数据库表注释,获取待导出数据库表的表名称对应的中文名称;Acquire the Chinese name corresponding to the table name of the database table to be exported according to the database table comment;
    根据所述数据库表字段,获取所述数据库表的字段名;Obtaining the field name of the database table according to the database table field;
    根据所述表字段注释,获取数据库表的字段名对应的中文字段注释。According to the table field comment, the Chinese field comment corresponding to the field name of the database table is obtained.
  18. 如权利要求17所述的终端设备,其中,将所述数据库表及数据库表注释,按预设格式导出并生成目录工作表,包括: The terminal device according to claim 17, wherein exporting the database table and database table annotations in a preset format and generating a catalog work table comprises:
    建立所述表名称、与所述表名称对应的所述中文名称分别与所述目录工作表中单元格的位置对应关系;Establishing the corresponding relationship between the table name, the Chinese name corresponding to the table name and the position of the cell in the catalog work table;
    根据所述对应关系,将所述表名称和所述中文名称导出并生成目录工作表。According to the corresponding relationship, the table name and the Chinese name are derived and a directory work table is generated.
  19. 如权利要求17所述的终端设备,其中,将所述数据库表字段及数据库表字段注释按预设格式导出并生成数据库表工作表,包括: The terminal device of claim 17, wherein exporting the database table fields and database table field comments in a preset format and generating a database table worksheet comprises:
    根据所述数据库表字段、所述数据库表字段注释以及数据库表的表名称的对应关系,按所述数据库的表名称,将与数据库表的表名称对应的所述数据库表字段、所述数据库表字段注释分组导出并生成一个或多个数据库表工作表。According to the correspondence between the database table field, the database table field comment, and the table name of the database table, according to the table name of the database, the database table field and the database table corresponding to the table name of the database table Field comments are grouped and exported and one or more database tables are generated.
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 7 when the computer program is executed by a processor.
PCT/CN2020/119294 2020-02-28 2020-09-30 Method and apparatus for exporting database table structure, and terminal device WO2021169300A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010131024.6 2020-02-28
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
WO2021169300A1 true WO2021169300A1 (en) 2021-09-02

Family

ID=71194179

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111352986A (en) * 2020-02-28 2020-06-30 平安科技(深圳)有限公司 Method and device for exporting database table structure and terminal equipment
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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150193473A1 (en) * 2012-11-01 2015-07-09 Guangyi Tao Database Storage System based on Optical Disk and Method Using the System
CN105278961A (en) * 2015-10-28 2016-01-27 广州华多网络科技有限公司 Method and system for generating database table structure document
CN106202008A (en) * 2016-06-28 2016-12-07 武汉斗鱼网络科技有限公司 A kind of MySQL database structured document generates method and device
CN108121739A (en) * 2016-11-30 2018-06-05 株式会社日立制作所 Method of data capture and data gathering system
CN108664505A (en) * 2017-03-30 2018-10-16 腾讯科技(深圳)有限公司 A kind of deriving method and device of database table structure
CN111352986A (en) * 2020-02-28 2020-06-30 平安科技(深圳)有限公司 Method and device for exporting database table structure and terminal equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150193473A1 (en) * 2012-11-01 2015-07-09 Guangyi Tao Database Storage System based on Optical Disk and Method Using the System
CN105278961A (en) * 2015-10-28 2016-01-27 广州华多网络科技有限公司 Method and system for generating database table structure document
CN106202008A (en) * 2016-06-28 2016-12-07 武汉斗鱼网络科技有限公司 A kind of MySQL database structured document generates method and device
CN108121739A (en) * 2016-11-30 2018-06-05 株式会社日立制作所 Method of data capture and data gathering system
CN108664505A (en) * 2017-03-30 2018-10-16 腾讯科技(深圳)有限公司 A kind of deriving method and device of database table structure
CN111352986A (en) * 2020-02-28 2020-06-30 平安科技(深圳)有限公司 Method and device for exporting database table structure and terminal equipment

Also Published As

Publication number Publication date
CN111352986A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
WO2021169300A1 (en) Method and apparatus for exporting database table structure, and terminal device
US20210026613A1 (en) Data model api for live applications in a cloud collaboration platform
US7870164B2 (en) Database part creation, merge and reuse
US7689578B2 (en) Dealing with annotation versioning through multiple versioning policies and management thereof
US9696967B2 (en) Generation of an application from data
WO2021218034A1 (en) Report generation method and apparatus, and terminal device and storage medium
US8201079B2 (en) Maintaining annotations for distributed and versioned files
US7743071B2 (en) Efficient data handling representations
KR100961801B1 (en) Systems, methods, and media for processing a spreadsheet for storage in a database
CN107480551B (en) File management method and device
US20150178252A1 (en) Methods and apparatus for electronic document handling
US7720831B2 (en) Handling multi-dimensional data including writeback data
TW201346596A (en) Tracking co-authoring conflicts using document comments
CN107357593A (en) Source code file construction method, device, electric terminal and readable storage medium storing program for executing
CN108717516B (en) File labeling method, terminal and medium
CN111324609A (en) Knowledge graph construction method and device, electronic equipment and storage medium
WO2019153555A1 (en) Method and device for generating er relationships, computer device, and storage medium
CN110688145A (en) Android MVP code automatic generation method, device, medium and electronic equipment
CN107506494B (en) Document handling method, mobile terminal and computer readable storage medium
RU2377641C2 (en) Registration information system for use in computer environment
US20240028608A1 (en) Schema validation with support for ordering
WO2023202704A1 (en) Service information processing method and apparatus and electronic device
WO2023098630A1 (en) Method and apparatus for processing information in document, and device and medium
CN110263006A (en) A kind of method and apparatus for downloading file on a user device
US20220207168A1 (en) Identifying and enabling levels of dataset access

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20921999

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20921999

Country of ref document: EP

Kind code of ref document: A1