Database data export method, device, computer equipment and storage medium

By writing Oracle database data into python tuples and generating SQL statements, the problem of low Oracle database data export efficiency is solved, automated data export is realized, export efficiency is improved, and manual operations are reduced.

CN112163025BActive Publication Date: 2024-09-10CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010988959.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-18
Publication Date
2024-09-10
Estimated Expiration
2040-09-18

AI Technical Summary

Technical Problem

In the process of financial software development, using the Oracle database's own tools to export data requires complicated configuration and operations, resulting in low efficiency in exporting Structured Query Language (SQL) statements.

Method used

By connecting to the target database, the target data is written into python tuples, and SQL statements are generated based on the tuples. The target file is created using the preset file format to realize the automated SQL statement export process.

Benefits of technology

It improves the efficiency of exporting SQL statements, reduces the amount of manual operations, and provides a low-cost, reusable Oracle database data export solution that is suitable for the export of other databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112163025B
    Figure CN112163025B
Patent Text Reader

Abstract

The present invention discloses a method, device, computer equipment and storage medium for exporting database data. The method includes: connecting to a target database; writing target data in the target database into a python tuple; generating a structured query language statement according to the python tuple; creating a target file according to a preset file format, and writing the structured query language statement into the target file. The database data export scheme provided in the embodiment of the present application can save the target data in the target database using the python Python tuple after connecting to the target database, and then generate a structured query language statement according to the data stored in the python tuple, write the structured query language statement into the created target file, and in the process of exporting the structured query language statement, use the python tuple as an intermediate medium to realize automatic export of the target data in the database into a structured query language statement, thereby improving the export efficiency of the structured query language statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to database data processing technology, and more particularly to a database data export method, device, computer equipment and storage medium. Background Art

[0002] In the software development process in the financial field, in order to meet the needs of agile development and iterative deployment, it is necessary to publish the data in the table of Oracle database in one development and test environment to another development and test environment.

[0003] When using the tools provided by the Oracle database to export data, complex configuration and operation are required to convert the Structured Query Language (SQL) statements, and the export efficiency of the SQL statements is low. Summary of the invention

[0004] The present invention provides a database data export method, device, computer equipment and storage medium, so as to improve the export efficiency of SQL statements of Oracle database.

[0005] In a first aspect, an embodiment of the present invention provides a method for exporting database data, comprising:

[0006] Connect to the target database;

[0007] Write the target data in the target database into a python tuple;

[0008] Generates structured query language statements from python tuples;

[0009] A target file is created according to a preset file format, and a structured query language statement is written into the target file.

[0010] In a second aspect, an embodiment of the present invention further provides a database data export device, comprising:

[0011] A connection module, used to connect to the target database;

[0012] Tuple writing module, used to write target data in target database into python tuple;

[0013] A query statement generation module, used to generate structured query language statements based on Python tuples;

[0014] The target file writing module is used to create a target file according to a preset file format and write the structured query language statement into the target file.

[0015] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the database data export method as shown in the embodiment of the present application is implemented.

[0016] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the database data export method as shown in the embodiment of the present application.

[0017] The database data export scheme provided in the embodiment of the present application can connect to the target database; write the target data in the target database into a python tuple; generate a structured query language statement according to the python tuple; create a target file according to a preset file format, and write the structured query language statement into the target file. Compared with the current low efficiency of exporting structured query language statements, the database data export scheme provided in the embodiment of the present application can use a python (Python) tuple to save the target data in the target database after connecting to the target database, and then generate a structured query language statement according to the data stored in the python tuple, write the structured query language statement into the created target file, and in the process of exporting the structured query language statement, use the python tuple as an intermediate medium to realize the automatic export of the target data in the database into a structured query language statement, thereby improving the export efficiency of the structured query language statement. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flowchart of a method for exporting database data in Embodiment 1 of the present invention;

[0019] Figure 2 It is a structural diagram of a database data export device in Embodiment 2 of the present invention;

[0020] Figure 3 is a structural diagram of another database data export device in Embodiment 2 of the present invention;

[0021] Figure 4 It is a schematic diagram of the structure of the computer device in the third embodiment of the present invention. DETAILED DESCRIPTION

[0022] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0023] The term Structured Query Language (SQL) used in this article is a database query and programming language used to access data and query, update and manage relational database systems.

[0024] The term Python used in this article is an object-oriented interpreted computer programming language. It is a scripting language that combines interpretation, compilation, interactivity, and object orientation.

[0025] The term Python tuple is used in this article to represent a tuple used in Python to represent a set of data suitable for storing data that changes while the program is running. Lists can be modified.

[0026] The term Oracle used in this article: The full name is Oracle Database, also known as Oracle RDBMS, or simply Oracle, which is a relational database management system.

[0027] The term UTF8 (8-bit, Universal Character Set / Unicode Transformation Format) used in this article refers to a variable-length character encoding for Unicode. It can be used to represent any character in the Unicode standard, and the first byte in its encoding is still compatible with ASCII, so that software that originally processes ASCII characters can continue to be used without or with only a few modifications.

[0028] The term GBK (Chinese Internal Code Specification) used in this article is an internal code extension specification based on the GB2312-80 standard. It uses a double-byte encoding scheme with an encoding range from 8140 to FEFE (excluding xx7F), a total of 23,940 code positions, and a total of 21,003 Chinese characters. It is fully compatible with the GB2312-80 standard, supports all Chinese, Japanese, and Korean characters in the international standard ISO / IEC10646-1 and the national standard GB13000-1, and includes all Chinese characters in the BIG5 encoding.

[0029] Embodiment 1

[0030] Figure 1 This is a flowchart of a method for exporting database data provided in Embodiment 1 of the present invention. This embodiment is applicable to the case where data in an Oracle database is exported as SQL statements. The method can be executed by a computer device for data migration, and specifically includes the following steps:

[0031] Step 110: Connect to the target database.

[0032] The target database is a database storing target data, and the target database is an Oracle database. This application is used to export the target data in the target database.

[0033] In one implementation, step 110 may be implemented in the following manner: receiving a database address, a target data table identifier, and an identity identifier input by a user; and connecting to the target database according to the database address.

[0034] When data export is required, an interface for entering the database address is provided to the user. The user enters the database address, target data table identifier, and identity identifier in the interface. The target database can be accessed according to the database address. The target database is accessed using the identity identifier. After the target database verifies the user's identity according to the identity identifier, a connection with the computer device is established.

[0035] Step 120: Write the target data in the target database into a python tuple.

[0036] After connecting to the target database, get the target data from the target database and write the target data into a Python tuple (python tuple). You can get all the data tables in the target database, and then write each record in the obtained data table into a Python tuple in turn.

[0037] In the above implementation, step 120 can be implemented in the following manner: searching the target table according to the target data table identifier; writing the target records in the target table into the python tuple in sequence, the target records including the field information and field content in the target records.

[0038] The target data table identifier is used to represent the data table specified by the user. When the user enters the target data table identifier in step 110, the target data table is searched according to the target data table identifier. Then, each record in the target data table is obtained in turn, and the currently read record is used as the target record. Among them, the record identifies a row in the target data table, and a row includes multiple fields. All the data in each row of the target table is written into a Python tuple. Each element in the Python tuple corresponds to a field in a row of the target table. In addition to recording the content of each field in the target data table through a Python tuple, the field information of each field in the target data table can also be recorded through a Python tuple. Field information refers to field identifiers, such as "name", "value", "address", etc., and field content refers to the actual value in the field. For example, if the field information is "name", the field content corresponding to the field information is "nameA".

[0039] Step 130: Generate a structured query language statement according to the python tuple.

[0040] For any Python tuple, extract each element in the Python tuple and concatenate the elements to obtain a structured query language SQL statement.

[0041] Optionally, step 130 may be implemented in the following manner:

[0042] Step 3.1, sort multiple field information according to the structured query language syntax.

[0043] Since the structured query language SQL has a fixed syntax, the field information can be sorted according to the syntax to obtain a field sequence that complies with the structured query language syntax.

[0044] Step 3.2: According to the sorting results, obtain the field contents corresponding to the field information in turn.

[0045] Then obtain the field content corresponding to the field information in the Python tuple, and sort the field content according to the sorting order of step 3.1 above.

[0046] Step 3.3: Concatenate the field contents to obtain a structured query language statement.

[0047] Concatenate the field contents stored in the Python tuple to obtain a structured query language statement.

[0048] Furthermore, before step 3.3, the method further includes:

[0049] According to the field information and the preset format conversion rules, the field content corresponding to the field information is format converted. The preset conversion rules are used to indicate the data type that needs to be converted, the conversion function used for data conversion, and the target data format after conversion.

[0050] The interactive interface provides users with the configuration function of preset format conversion rules. Users can configure the field type that needs to be converted to a special format, the conversion function used for the conversion, and the target data format after the conversion. For fields that the user has not configured, they can be processed according to the preset default method. The default method is to write the field content directly into a Python tuple. Users can quickly and flexibly configure the fields that need to be converted according to their needs through the interactive interface to improve ease of use.

[0051] For example, the preset format conversion rules can be configured for date data type data and timestamp data type data. As shown in Table 1, Table 1 includes five fields: data type, conversion flag, conversion rule, conversion format, and data length. Among them,

[0052] The data type indicates the field type of the field content, for example, date indicates date data type data, timestamp indicates timestamp data type data, varchar indicates character data, and number indicates numeric data.

[0053] The conversion flag indicates whether conversion is required. If the conversion flag is yes, it means that the field needs to be converted. If the conversion flag is no, it means that the field does not need to be converted.

[0054] The conversion rule is used to represent the conversion function used for the conversion. For example, for date data type data, the to_date conversion function is used for conversion. The to_date conversion function is used to convert the date to the target date format. The target date format can be "yyyy-mm-dd hh24:mi", and the target date format represents the date data type data in "year-month-day hour (24-hour system): minute". For another example, for timestamp type data, the to_timestamp conversion function is used for conversion. The to_timestamp conversion function is used to convert the timestamp to the target timestamp format. The target timestamp format can be "yyyy-mm-dd hh24:mi:ss", and the target timestamp format represents the timestamp type data in "year-month-day hour (24-hour system): minute: second".

[0055] The conversion format indicates the target conversion format. For example, the target date format is "year-month-day hour (24-hour system): minute", and the target timestamp format is "yyyy-mm-dd hh24:mi:ss".

[0056] The data length is used to indicate the data length when Python is exported. For example, for the date data type data, its length is configured to be 19 bits.

[0057] Table 1

[0058]

[0059]

[0060] Step 140: Create a target file according to a preset file format, and write the structured query language statement into the target file.

[0061] The preset file format and the total number of records that each single file can contain, also known as the preset quantity, can be obtained through the preset interactive interface. Optionally, the preset file format and the preset quantity are used as global variables, so that when the user modifies the preset file format or the preset quantity, it can be applied to the data export in time to avoid modifying different conversion processes separately.

[0062] The preset file format may be UTF8 or GBK. The preset number may be determined according to usage requirements, and an exemplary number may be 50,000.

[0063] Optionally, the statement is written to the target file, which can be implemented as follows:

[0064] Step 4.1: Determine whether the structured query language statement written into the target file meets the batching condition.

[0065] Step 4.2: If the batch conditions are met, a new target file is generated;

[0066] Step 4.3: Write the structured query language statement into the new target file until all the target data is read.

[0067] When the structured query language statement is written into the established target file, it can be determined whether the batching condition is met. If the batching condition is met, step 4.2 is executed. If the batching condition is not met, step 4.3 is executed.

[0068] Exemplarily, it is determined whether the number of structured query language statements written into the target file is greater than a preset number; if it is greater than the preset number, it is determined that the batching condition is met; if it is less than or equal to the preset number, it is determined that the batching condition is not met.

[0069] When the user sets a preset number of global variables, it can be determined whether the batching condition is met based on whether the number of structured query language statements existing in the target file is greater than the preset number. If the number of structured query language statements in the target file is greater than the preset number, it is determined that the batching condition is met. If the number of structured query language statements in the target file is less than or equal to the preset number, it is determined that the batching condition is not met.

[0070] Exemplarily, it can also be set to batch by data table. At this time, it is determined whether the conversion of all rows in the target table in the target database is completed. If yes, it is determined that the batching condition is met, and a new target file is established. When the structured query language statement in the new target table is obtained, it is stored in the newly created target file. Otherwise, the structured query language statement continues to be written into the established target file.

[0071] The above implementation method can determine whether to batch by preset number or by table, thereby realizing automatic generation of target files and effectively controlling the number of structured query language statements in the target files.

[0072] Furthermore, before step 110, connecting to the target database, the process further includes:

[0073] Configure the default file format to UTF8 or GBK;

[0074] Configure preset quantity;

[0075] The preset file format configuration and preset quantity are global variables;

[0076] Configure preset format conversion rules.

[0077] Before executing step 110 , the user may be prompted to input a preset file format and a preset number of global variables through an interactive interface.

[0078] The database data export method provided in the embodiment of the present application can be connected to the target database; write the target data in the target database into a python tuple; generate a structured query language statement according to the python tuple; create a target file according to a preset file format, and write the structured query language statement into the target file. Compared with the current low efficiency of exporting structured query language statements, the database data export method provided in the embodiment of the present application can use a python (Python) tuple to save the target data in the target database after connecting to the target database, and then generate a structured query language statement according to the data stored in the python tuple, write the structured query language statement into the created target file, and in the export process of the structured query language statement, use the python tuple as an intermediate medium to realize the automatic export of the target data in the database into a structured query language statement, and improve the export efficiency of the structured query language statement. The database data export method provided in the embodiment of the present application is based on Python technology, uses Python tuples as intermediate media, and automatically realizes the export of the target data of the target table from the target database into SQL statements through preset format conversion rules. Only a small amount of configuration is required to realize reusable and flexible export data, which is a low-cost solution for exporting Oracle database data into SQL statements, which can greatly reduce the amount of manual operation. When exporting, the program of this synchronization solution is deployed independently, and there is no need to deploy it on the export database side. It has less coupling and is not only applicable to the export of Oracle database, but also to the export of other databases.

[0079] Embodiment 2

[0080] Figure 2 This is a structural diagram of a database data export device provided in Example 2 of the present application, which exports data from an Oracle database as SQL statements. The device can be applied to computer equipment for data migration, including: a connection module 210, a tuple writing module 220, a query statement generation module 230, and a target file writing module 240.

[0081] A connection module 210, used to connect to a target database;

[0082] A tuple writing module 220, for writing target data in a target database into a python tuple;

[0083] A query statement generating module 230, for generating a structured query language statement according to the python tuple;

[0084] The target file writing module 240 is used to create a target file according to a preset file format and write the structured query language statement into the target file.

[0085] Based on the above embodiment, the connection module 210 is used for:

[0086] Receive the database address, target data table identifier and identity identifier input by the user;

[0087] Connect to the target database according to the database address;

[0088] Accordingly, write the target data in the target database into a python tuple, including:

[0089] Find the target table according to the target data table identifier;

[0090] Write the target records in the target table into the python tuple in sequence, and the target records include the field information and field content in the target records.

[0091] Based on the above embodiment, the query statement generating module 230 is used to:

[0092] Sort multiple fields of information according to structured query language syntax;

[0093] According to the sorting results, the field contents corresponding to the field information are obtained in sequence;

[0094] The field contents are concatenated to obtain a structured query language statement.

[0095] like Figure 3 As shown, based on the above embodiment, a format conversion module 250 is further included, and the format conversion module 250 is used to:

[0096] According to the field information and the preset format conversion rules, the field content corresponding to the field information is format converted. The preset conversion rules are used to indicate the data type that needs to be converted, the conversion function used for data conversion, and the target data format after conversion.

[0097] Based on the above embodiment, the target file writing module 240 is used to:

[0098] Determine whether the structured query language statement written into the target file meets the batching condition;

[0099] If the batch conditions are met, a new target file is generated;

[0100] Write the structured query language statement to the new target file until all the target data is read.

[0101] Based on the above embodiment, the target file writing module 240 is used to:

[0102] Determining whether the number of structured query language statements written into the target file is greater than a preset number;

[0103] If it is greater than the preset quantity, it is determined to meet the batching conditions;

[0104] If it is less than or equal to the preset quantity, it is determined that the batching conditions are not met.

[0105] Based on the above embodiment, a configuration module 260 is further included. The configuration module 260 is used to

[0106] Configure the default file format to UTF8 or GBK;

[0107] Configure preset quantity;

[0108] The preset file format configuration and preset quantity are global variables;

[0109] Configure preset format conversion rules.

[0110] The database data export device provided by the embodiment of the present application, the connection module 210 can be connected to the target database; the tuple writing module 220 writes the target data in the target database into the python tuple; the query statement generation module 230 generates a structured query language statement according to the python tuple; the target file writing module 240 creates a target file according to the preset file format, and writes the structured query language statement into the target file. Compared with the current low efficiency of exporting structured query language statements, the database data export device provided by the embodiment of the present application can use the python (Python) tuple to save the target data in the target database after connecting to the target database, and then generate a structured query language statement according to the data stored in the python tuple, write the structured query language statement into the created target file, and in the export process of the structured query language statement, the python tuple is used as an intermediate medium to realize the automatic export of the target data in the database into a structured query language statement, thereby improving the export efficiency of the structured query language statement. The database data export method provided by the embodiment of the present application is based on Python technology, uses Python tuples as intermediate media, and automatically realizes the export of the target data of the target table from the target database into SQL statements through preset format conversion rules. Only a few configurations are needed to realize reusable and flexible data export. It is a low-cost solution for exporting Oracle database data to SQL statements, which can greatly reduce the amount of manual operations. This synchronization solution is independently deployed when exporting, and does not need to be deployed on the export database side. It has less coupling and is not only suitable for exporting Oracle databases, but also for exporting other databases.

[0111] The database data export device provided in the embodiment of the present invention can execute the database data export method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] Embodiment 3

[0113] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention is shown in FIG. Figure 4 As shown, the computer device includes a processor 30, a memory 31, an input device 32 and an output device 33; the number of processors 30 in the computer device can be one or more. Figure 4 A processor 30 is taken as an example; the processor 30, memory 31, input device 32 and output device 33 in the computer device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0114] The memory 31, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the database data export method in the embodiment of the present invention (for example, the connection module 210, the tuple writing module 220, the query statement generation module 230 and the target file writing module 240). The processor 30 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 31, that is, realizes the above-mentioned database data export method.

[0115] The memory 31 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 31 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 31 may further include a memory remotely arranged relative to the processor 30, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The input device 32 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 33 may include a display device such as a display screen.

[0117] Embodiment 4

[0118] Embodiment 4 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a method for exporting database data when executed by a computer processor, the method comprising:

[0119] Connect to the target database;

[0120] Write the target data in the target database into a python tuple;

[0121] Generates structured query language statements from python tuples;

[0122] A target file is created according to a preset file format, and a structured query language statement is written into the target file.

[0123] Further, connect to the target database, including:

[0124] Receive the database address, target data table identifier and identity identifier input by the user;

[0125] Connect to the target database according to the database address;

[0126] Accordingly, write the target data in the target database into a python tuple, including:

[0127] Find the target table according to the target data table identifier;

[0128] Write the target records in the target table into the python tuple in sequence, and the target records include the field information and field content in the target records.

[0129] Further, a structured query language statement is generated according to the python tuple, including:

[0130] Sort multiple fields of information according to structured query language syntax;

[0131] According to the sorting results, the field contents corresponding to the field information are obtained in sequence;

[0132] The field contents are concatenated to obtain a structured query language statement.

[0133] Furthermore, before concatenating the field contents to obtain the structured query language statement, the following is also included:

[0134] According to the field information and the preset format conversion rules, the field content corresponding to the field information is format converted. The preset conversion rules are used to indicate the data type that needs to be converted, the conversion function used for data conversion, and the target data format after conversion.

[0135] Further, the structured query language statements are written into the target file, including:

[0136] Determine whether the structured query language statement written into the target file meets the batching condition;

[0137] If the batch conditions are met, a new target file is generated;

[0138] Write the structured query language statement to the new target file until all the target data is read.

[0139] Further, determining whether the structured query language statement written into the target file meets the batching condition includes:

[0140] Determining whether the number of structured query language statements written into the target file is greater than a preset number;

[0141] If it is greater than the preset quantity, it is determined to meet the batching conditions;

[0142] If it is less than or equal to the preset quantity, it is determined that the batching conditions are not met.

[0143] Furthermore, before connecting to the target database, it also includes:

[0144] Configure the default file format to UTF8 or GBK;

[0145] Configure preset quantity;

[0146] The preset file format configuration and preset quantity are global variables;

[0147] Configure preset format conversion rules.

[0148] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present invention is not limited to the above method operations, and the computer executable instructions can also execute related operations in the database data export method provided in any embodiment of the present invention.

[0149] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0150] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0151] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for exporting database data. It is characterized in that include: Connect to the target database; Writing target data in the target database into a python tuple; generating a structured query language statement according to the python tuple; Creating a target file according to a preset file format, and writing the structured query language statement into the target file; Wherein, the connecting to the target database includes: Receive the database address, target data table identifier and identity identifier input by the user; Connecting to the target database according to the database address; Accordingly, the step of writing the target data in the target database into a python tuple includes: Searching for a target table according to the target data table identifier; Writing target records in the target table into python tuples in sequence, the target records including field information and field content in the target records; Wherein, generating a structured query language statement according to the python tuple includes: Sort multiple fields of information according to structured query language syntax; According to the sorting result, the field contents corresponding to the field information are obtained in sequence; The field contents are concatenated to obtain a structured query language statement.

2. The method according to claim 1, It is characterized in that Before concatenating the field contents to obtain a structured query language statement, the method further includes: According to the field information and preset format conversion rules, the field content corresponding to the field information is format converted, and the preset format conversion rules are used to indicate the data type to be converted, the conversion function used for data conversion, and the target data format after conversion.

3. The method according to claim 2, It is characterized in that The step of writing the structured query language statement into the target file comprises: Determining whether the structured query language statement written into the target file meets the batching condition; If the batch conditions are met, a new target file is generated; The structured query language statement is written into the new target file until all the target data are read.

4. The method according to claim 3, It is characterized in that The determining whether the structured query language statement written into the target file meets the batching condition includes: Determining whether the number of structured query language statements written into the target file is greater than a preset number; If it is greater than the preset quantity, it is determined to meet the batching conditions; If it is less than or equal to the preset quantity, it is determined that the batching conditions are not met.

5. The method according to claim 4, It is characterized in that Before connecting to the target database, also include: Configure the preset file format to UTF8 or GBK; configuring the preset quantity; The preset file format configuration and the preset quantity are global variables; Configure the preset format conversion rule.

6. A database data export device, It is characterized in that include: A connection module, used to connect to the target database; A tuple writing module, used for writing target data in the target database into a python tuple; A query statement generation module, used for generating a structured query language statement according to the python tuple; A target file writing module, used to create a target file according to a preset file format, and write the structured query language statement into the target file; Wherein, the connection module is used for: Receive the database address, target data table identifier and identity identifier input by the user; Connecting to the target database according to the database address; Accordingly, the step of writing the target data in the target database into a python tuple includes: Searching for a target table according to the target data table identifier; Writing target records in the target table into python tuples in sequence, the target records including field information and field content in the target records; Wherein, the query statement generation module is used to: Sort multiple fields of information according to structured query language syntax; According to the sorting result, the field contents corresponding to the field information are obtained in sequence; The field contents are concatenated to obtain a structured query language statement.

7. The device according to claim 6, It is characterized in that Also includes format conversion modules for: According to the field information and preset format conversion rules, the field content corresponding to the field information is format converted, and the preset format conversion rules are used to indicate the data type to be converted, the conversion function used for data conversion, and the target data format after conversion.

8. The device according to claim 7, It is characterized in that The target file writing module is used for: Determining whether the structured query language statement written into the target file meets the batching condition; If the batch conditions are met, a new target file is generated; The structured query language statement is written into the new target file until all the target data are read.

9. The device according to claim 8, It is characterized in that The target file writing module is used for: Determining whether the number of structured query language statements written into the target file is greater than a preset number; If it is greater than the preset quantity, it is determined to meet the batching conditions; If it is less than or equal to the preset quantity, it is determined that the batching conditions are not met.

10. The device according to claim 9, It is characterized in that Also includes configuration modules for: Configure the preset file format to UTF8 or GBK; configuring the preset quantity; The preset file format configuration and the preset quantity are global variables; Configure the preset format conversion rule.

11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the database data export method as described in any one of claims 1-5 is implemented.

12. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the database data export method according to any one of claims 1 to 5 when executed by a computer processor.