Database table automatic migration method and device, equipment and storage medium
Through the automated migration method, the identification and configuration information of the database table are obtained and used, and the database tables are automatically logged in and copied, which solves the problems of low manual migration efficiency and error proneness, and achieves efficient and accurate automated migration.
Patent Information
- Application Number
- CN202311596326.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-27
AI Technical Summary
When manually migrating data, data migration is low and error-prone, especially when the amount of data is too large.
Provides an automated migration method for database tables. By obtaining the identification and configuration information of the target database table, automatically log in to the source host and execute a copy command to copy the target database table to the target host.
It improves data migration efficiency, reduces the probability of migration errors, realizes automated migration, and reduces the risk of manual operations.
Smart Images

Figure CN120045541A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a method, device, equipment and storage medium for automatic migration of database tables. Background Art
[0002] Relational database management systems, such as MySQL, are database management systems that use relational models to organize data. The relational model can be simply understood as a database table that stores data in the form of rows and columns, and a relational database management system is a system that manages database tables and the relationships between them. In order to prevent data loss due to operational errors or system failures in the system, a disaster recovery solution needs to be deployed. Data migration is the basis of disaster recovery and is the process of copying all or part of the data set from the hard disk or array of the application host to other storage media.
[0003] In the related art, data migration is usually achieved by manual migration by users. However, when the amount of data to be migrated is too large, the manual migration method will lead to low data migration efficiency and high error-proneness. Summary of the invention
[0004] The present application provides a method, device, equipment and storage medium for automatic migration of database tables, which are used to solve the technical problems of low data migration efficiency and high error probability in manual data migration.
[0005] In a first aspect, the present application provides a method for automatically migrating a database table, which is applied to a relational database management system. The method for automatically migrating a database table comprises:
[0006] Obtaining an identifier of a target database table to be migrated and first configuration information of the target database table, wherein the first configuration information includes a backup source server address, a backup source server host user name, and a backup source server host password;
[0007] Log in to the source host of the target database table according to the backup source server address, backup source server host user name and backup source server host password;
[0008] The source host is controlled to execute a copy command on the target database table to copy the target database table to the target host.
[0009] In a possible implementation manner, before the source host is controlled to execute a copy command on the target database table, the method further includes:
[0010] The source host is controlled to execute a backup command on the target database table to back up the target database table before migration.
[0011] In one possible implementation, the current status of the target database table, the current processing link, and the backup task step detail table data are recorded, wherein the current status includes the status to be backed up, the status to be migrated, the migration execution status, and the migration end status; the current processing link includes the step status and the start execution time; the backup task step detail table data includes the backup database table identity code, step number, creation date, start execution time, completion time, database table data size, and the number of database table records.
[0012] In a possible implementation manner, the above-mentioned obtaining the identifier of the target database table to be migrated and the first configuration information of the target database table includes:
[0013] Reading a backup task list, the backup task list includes at least one backup task and a detailed table data for recording the status of a database table, a processing link, and a backup task step;
[0014] The backup task list is traversed to obtain a backup task, wherein the backup task includes an identifier of a database table to be migrated and first configuration information of the database table, and the database table includes a target database table.
[0015] In a possible implementation manner, the backup task list is obtained in the following manner:
[0016] Get the database table scanning task;
[0017] Establishing a connection with a source database operated by the database table scanning task according to second configuration information corresponding to the database table scanning task, wherein the second configuration information includes a database port number, a database user name, a database password, and a source server address;
[0018] Based on the source database, according to the third configuration information corresponding to the database table scanning task, obtain the database table backup data size and database table record quantity information of the corresponding database table, wherein the third configuration information includes the database name and database table name of the backup database table;
[0019] Determine, according to fourth configuration information corresponding to the database table scanning task, whether the size of database table backup data and the number of database table records of the database table exceed the limit, the fourth configuration information including the size limit of database table backup data and the number limit of database table records;
[0020] If either the database table backup data size or the database table record quantity of the database table exceeds the limit, the database table is added to the backup task list.
[0021] In a possible implementation, the above-mentioned database table automatic migration method further includes controlling the source host to execute a delete command on the target database table after controlling the source host to execute a backup command on the target database table to delete the target database table; and updating the status, processing links and backup task step detail table data of the target database table in the backup task list.
[0022] In a possible implementation manner, the first configuration information further includes a backup target server address, a backup target server host user name, and a backup target server host password. After the source host is controlled to execute a copy command on the target database table, the following is further included:
[0023] Log in to the target host of the target database table according to the target database table name, backup target server address, backup target server host user name and backup target server host password;
[0024] Control the target host to execute the following command on the target database table, and update the status, processing link, and backup task step details of the target database table in the backup task list:
[0025] Restore command to restore the target database table;
[0026] File deletion command to delete the target database table.
[0027] In a possible implementation manner, the first configuration information further includes a database port number, a database user name, a database password, and a source server address, and also includes:
[0028] Establish a connection with the source database of the target database table according to the database port number, database user name, database password and source server address corresponding to the target database table;
[0029] Based on the set renaming rules, change the name of the target database table in the source database, and create a new database table with the original table name;
[0030] And / or, after establishing a connection to the source database, use the delete command to delete the newly named backup database table in the source database.
[0031] In a second aspect, the present application provides a database table automatic migration device, which is applied to a relational database management system. The above-mentioned database table automatic migration device includes:
[0032] An acquisition module, used to acquire an identifier of a target database table to be migrated and first configuration information of the target database table, wherein the first configuration information includes a backup source server address, a backup source server host user name, and a backup source server host password;
[0033] A login module, used to log in to the source host of the target database table according to the backup source server address, the backup source server host user name and the backup source server host password;
[0034] The replication module is used to control the source host to execute a replication command on the target database table to replicate the target database table to the target host.
[0035] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0036] Memory stores computer-executable instructions;
[0037] The processor executes the computer-executable instructions stored in the memory to implement any one of the database table automatic migration methods in the first aspect.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed, they are used to implement the database table automatic migration method of any one of the first aspects.
[0039] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed, is used to implement the method for automatic database table migration of any one of the first aspects.
[0040] The method, device, equipment and storage medium for automatic migration of database tables provided by the present application are applied to a relational database management system, and the method includes obtaining the identifier of the target database table to be migrated and the first configuration information of the target database table, wherein the first configuration information includes the backup source server address, the backup source server host user name and the backup source server host password; logging in to the source host of the target database table according to the backup source server address, the backup source server host user name and the backup source server host password; and controlling the source host to execute a copy command on the target database table to copy the target database table to the target host. By automatically logging in to the source host of the target database table and controlling the source host to execute a copy command on the target database table, the target database table is automatically migrated to the target host, thereby improving the efficiency of data migration and reducing the probability of data migration errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 A schematic diagram of a process for automatically migrating a database table provided in an embodiment of the present application;
[0043] Figure 2A schematic diagram of a flow chart of controlling a source host to execute a delete command on a target database table provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the specific functions of the file migration subroutine provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the specific functions of the backup subroutine provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the specific functions of the file restoration subroutine provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of the specific functions of the database table scanning subroutine provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of the specific functions of the database table renaming and creating subroutine provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of the specific functions of the database table cleaning subroutine provided in an embodiment of the present application;
[0050] Fig. 9 A schematic diagram of the specific functions of the file cleaning subroutine (source) provided in an embodiment of the present application;
[0051] Fig.10 A schematic diagram of the specific functions of the file cleaning subroutine (target) provided in an embodiment of the present application;
[0052] Fig.11 A schematic diagram of the structure of a database table automatic migration device provided in one embodiment of the present application;
[0053] Fig.12 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0054] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0055] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0056] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0057] First, some technical terms involved in this application are explained:
[0058] Target host: The host where the database used to restore the database backup file is located.
[0059] Source host: the host where the database to be backed up is located.
[0060] Target database: The database to which the database backup file is restored.
[0061] Source database: the database that needs to be backed up.
[0062] Source file: The database backup file stored on the source host.
[0063] Target file: The database backup file stored on the target host.
[0064] Scan configuration table: used to store database tables that need to be scanned regularly when the data size or number of records exceeds the limit.
[0065] Backup task table: used to store database tables that meet the conditions and need to be migrated and backed up after being scanned by the scanning subroutine.
[0066] Backup task details table: a database table used to store detailed records of each step of the migration backup task.
[0067] MySQL is a relational database management system. Compared with other large databases such as Oracle, DB2, SQL Server, etc., MySQL has its own shortcomings, but this does not reduce its popularity. For general individual users and small and medium-sized enterprises, the functions provided by MySQL are more than enough, and because MySQL is open source software, it can greatly reduce the total cost of ownership.
[0068] In response to the problems of low efficiency and easy errors in manual operation when migrating database tables using manual data migration in related technologies, the present application proposes a technical solution for automated migration of database tables. The solution can automatically realize the migration of database tables, improve the migration efficiency, avoid manual errors, and ensure correctness, that is, it can improve the efficiency of data migration and reduce the probability of data migration errors.
[0069] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0070] Figure 1 The flowchart of the method for automatically migrating a database table provided in one embodiment of the present application is shown in FIG. The present application provides a method for automatically migrating a database table, which is applied to a relational database management system. For example, the relational database management system may be a server or server cluster with relational database management functions. Figure 1 As shown, the automatic migration method of the database table includes:
[0071] S101: Obtain an identifier of a target database table to be migrated and first configuration information of the target database table, where the first configuration information includes a backup source server address, a backup source server host user name, and a backup source server host password.
[0072] The target database table is the database table to be migrated. When the target database table needs to be migrated, for example, a migration instruction for the target database table is detected, or it is detected that the target database table meets the migration condition, the relational database management system executes S101 to obtain the identifier of the target database table and the first configuration information of the target database table, so as to determine the migration object and the location of the migration object.
[0073] S102: Log in to the source host of the target database table according to the backup source server address, the backup source server host user name, and the backup source server host password.
[0074] Through this step, the relational database management system can automatically log in to the source host, and then execute step S103.
[0075] S103: Control the source host to execute a copy command on the target database table to copy the target database table to the target host.
[0076] In this step, the embodiment of the present application does not limit the specific implementation of the copy command, as long as the target database table can be copied to the target host.
[0077] In the embodiment of the present application, the relational database management system obtains the identifier of the target database table to be migrated and the first configuration information of the target database table, the first configuration information including the backup source server address, the backup source server host user name and the backup source server host password; logs in to the source host of the target database table according to the backup source server address, the backup source server host user name and the backup source server host password; controls the source host to execute a copy command on the target database table to copy the target database table to the target host. By automatically logging in to the source host of the target database table and controlling the source host to execute a copy command on the target database table, the target database table is automatically migrated to the target host, the data migration efficiency is improved, and the probability of data migration errors is reduced.
[0078] Based on the above embodiment, in one implementation, before performing S103 operation, the database table automatic migration method further includes: controlling the source host to execute a backup command on the target database table to back up the target database table before migration. It can be understood that the target database table needs to be backed up before migration in order to prevent data loss in the database table.
[0079] Furthermore, the database table automatic migration method may also include: recording the current state of the target database table, the current processing link and the backup task step detail table data. Among them, the current state includes the state to be backed up, the state to be migrated, the migration execution state and the migration end state; the current processing link includes the step state and the start execution time; the backup task step detail table data includes the backup database table identification code, step number, creation date, start execution time, completion time, database table data size and database table record quantity.
[0080] It can be understood that recording the current state of the target database table, the current processing state, and the backup task step detail table data is to record correspondingly at different stages, for example, after the backup, the current state is recorded as backed up or to be migrated; for another example, after the migration, the current state is recorded as migrated, etc. The application does not limit the specific content of the actual record, as long as it can indicate or distinguish different progress.
[0081] The embodiment of the present application records the current status of the target database table, the current processing status and the backup task step detail table data, so that when problems occur in the migration data, the detailed recorded information can help analyze the source of the problem and solve the problem.
[0082] Based on the above embodiment, obtaining the identifier of the target database table to be migrated and the first configuration information of the target database table in S101 may further include: reading a backup task list, the backup task list including at least one backup task and a detailed table data for recording the status, processing links and backup task steps of the database table; traversing the backup task list to obtain a backup task, the backup task including the identifier of the database table to be migrated and the first configuration information of the database table, the database table including the target database table.
[0083] For this embodiment, it can be understood that the backup task list records backup tasks, wherein each backup task corresponds to a database table to be migrated. In this way, the database table to be migrated and the first configuration information of the database table to be migrated can be determined by reading the backup task list. The backup task list is traversed to obtain backup tasks, and for each backup task, S102 and S103 are executed to realize the automatic migration of the corresponding database table.
[0084] Optionally, the backup task list is obtained in the following manner: obtaining a database table scanning task; establishing a connection with the source database of the database table scanning task operation according to the second configuration information corresponding to the database table scanning task, the second configuration information including the database port number, database user name, database password and source server address; based on the source database, obtaining the database table backup data size and database table record quantity information of the corresponding database table according to the third configuration information corresponding to the database table scanning task, the third configuration information including the database name and database table name of the backup database table; determining whether the database table backup data size and database table record quantity of the database table exceed the limit according to the fourth configuration information corresponding to the database table scanning task, the fourth configuration information including the database table backup data size limit and the database table record quantity limit; if any one of the database table backup data size and the database table record quantity of the database table exceeds the limit, then adding the database table to the backup task list. Among them, the source database refers to the database that needs to be backed up, the backup task list refers to the database table used to store the database table that meets the conditions and needs to be migrated and backed up after the scanning task, and the task step detail table data refers to the database table used to store the detailed operation records of each step of the migration backup task.
[0085] To obtain a database table scanning task, it is necessary to read the second configuration information, the third configuration information, and the fourth configuration information of the scanning configuration database table in the configuration database table, which includes reading the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record number limit and other related information lists of the database table to be backed up, wherein the configuration database table refers to the configuration information used to store database tables that need to be scanned regularly. After obtaining the database table scanning task, start the scheduled scanning database table task processing process, traverse the backup task list and determine whether any of the database table backup data size and database table record number of the database table exceeds the limit. As an example, start the scheduled scanning database table task processing process once a day and traverse the backup task list to obtain the backup task.
[0086] When it is determined that either the database table backup data size or the number of database table records of the database table exceeds the limit, the exceeded database table needs to be added to the backup task list, and the information written includes the backup database table identity code, step status, execution status, creation date, start execution time, completion time, database table data size, number of database table records and other information.
[0087] By obtaining the identifier of the target database table to be migrated and the configuration information of the target database table, and using the configuration information to add the over-limit database table to the backup task list, the efficiency of data migration can be improved.
[0088] Furthermore, the method for automatic migration of database tables may also include: after controlling the source host to execute a backup command on the target database table, controlling the source host to execute a delete command on the target database table to delete the target database table; and updating the status, processing link, and backup task step detail table data of the target database table in the backup task list. It should be noted that when controlling the source host to execute a delete command on the target database, the source file is deleted, and the source file refers to the backup file of the database table stored on the source host. By controlling the source host to use a delete command on the target database table to delete the target database table, storage resources can be released to avoid backups from occupying more storage space and save storage space.
[0089] Optionally, the first configuration information may further include a backup target server address, a backup target server host user name, and a backup target server host password. Correspondingly, after the source host is controlled to execute a copy command on the target database table, the database table automatic migration method may further include:
[0090] Log in to the target host of the target database table according to the target database table name, backup target server address, backup target server host user name and backup target server host password;
[0091] Control the target host to execute the following command on the target database table, and update the status, processing link, and backup task step details of the target database table in the backup task list:
[0092] Restore command to restore the target database table;
[0093] File deletion command to delete the target database table.
[0094] The specific flow chart is similar to the above embodiment, and will not be described in detail here. The file deleted by the file deletion command is the target file, and the target file refers to the backup file of the database table stored on the target host.
[0095] In the embodiment of the present application, after controlling the source host to execute a copy command on the target database table, the target host is controlled to execute a restore command and / or a file delete command on the target database table, thereby reducing the probability of data migration errors.
[0096] Furthermore, the first configuration information may also include a database port number, a database user name, a database password, and a source server address. In this case, in one implementation, the database table automatic migration method may also include: establishing a connection with the source database of the target database table according to the database port number, database user name, database password, and source server address corresponding to the target database table; changing the name of the target database table in the source database based on the set renaming rule, and creating a new database table according to the original table name.
[0097] For example, the target database table to be changed is renamed, where the naming rule of the newly created name is the original table name_new, and then the target database table to be changed is renamed, where the naming rule of the renamed table is the original table name——bakyyyMMdd, and the original table_new is renamed again to the original table name. It should be noted that the above-mentioned renaming rule is only an example, and this application does not limit the renaming rule.
[0098] In another implementation, the database table automatic migration method may further include: after establishing a connection with the source database, using a delete command to delete the newly named backup database table in the source database.
[0099] By renaming the target database table, the migrated database table can be logically distinguished from the existing database table, so that the database table can be better managed and maintained.
[0100] After completing the above operations for the target database table, it is necessary to determine whether the traversal of the backup task list has ended and whether the scheduled task has ended. The basis for determining whether the traversal of the backup task list has ended is the number of backup tasks in the backup task list. If the traversal of the backup task list has ended, wait for the scheduled scanning task to start next time, otherwise continue to scan the backup task list. To determine whether the scheduled task has ended, the configuration information of the scheduled task start and stop configuration table is used as the basis. If the configuration information of the scheduled task start and stop configuration table shows 0, it means that the scheduled task has ended, ending the entire process, otherwise it is necessary to wait for the scheduled task to start next time.
[0101] Supplementary explanation: For the specific flow chart of controlling the source host to execute the delete command on the target database table, see Figure 2 , Figure 2 The flowchart of controlling the source host to execute a delete command on the target database table provided in the embodiment of the present application is as follows. Figure 2 Similar, no further description is given here.
[0102] Next, we will explain the different processing sub-processes in the above database table automatic migration process:
[0103] Optionally, the file migration sub-process corresponding to S101 to S103 may be implemented through a file migration sub-program. Figure 3 A schematic diagram of the specific functions of the file migration subroutine provided in an embodiment of the present application, wherein the specific functions of the file migration subroutine are as follows: Figure 3 As shown:
[0104] 3.1 Read the scan configuration database table
[0105] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0106] 3.2 Start the scheduled backup task processing process
[0107] 3.3 Read the backup task list
[0108] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0109] 3.4 Cycle each backup task
[0110] Process each backup task according to the configuration information obtained in the backup task list in step 3.3.
[0111] 3.5 Use the program to log in to the source host
[0112] Use the program to log in to the source host according to the backup source server address, backup source server host user name, backup source server host password and other configuration information.
[0113] 3.6 Copy the backup file to the target host
[0114] Use the copy command to copy the backup file of the target database table to the target host.
[0115] 3.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0116] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0117] 3.8 Determine whether the loop is finished
[0118] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0119] 3.9 Determine whether the scheduled task has ended
[0120] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0121] For the backup sub-process, it can be implemented through the backup sub-program. Figure 4 A schematic diagram of the specific functions of the backup subroutine provided in the embodiment of the present application. The specific functions of the backup subroutine are as follows: Figure 4 As shown:
[0122] 4.1 Read the scan configuration database table
[0123] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0124] 4.2 Start the scheduled backup task processing process
[0125] 4.3 Read the backup task list
[0126] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0127] 4.4 Cycle each backup task
[0128] Process each backup task according to the configuration information obtained in the backup task list in step 4.3.
[0129] 4.5 Use the program to log in to the source host
[0130] Use the program to log in to the source host according to the backup source server address, backup source server host user name, backup source server host password and other configuration information.
[0131] 4.6 Backing up database tables
[0132] Use the backup command to back up the target database table.
[0133] 4.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0134] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0135] 4.8 Determine whether the loop is finished
[0136] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0137] 4.9 Determine whether the scheduled task has ended
[0138] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0139] The file restoration subprocess can be implemented through the file restoration subroutine. Figure 5 A schematic diagram of the specific functions of the file restoration subroutine provided in an embodiment of the present application, wherein the specific functions of the file restoration subroutine are as follows: Figure 5 As shown:
[0140] 5.1 Read the scan configuration database table
[0141] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0142] 5.2 Start the scheduled backup task processing process
[0143] 5.3 Read the backup task list
[0144] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0145] 5.4 Cycle each backup task
[0146] Process each backup task according to the configuration information obtained in the backup task list in step 5.3.
[0147] 5.5 Use the program to log in to the target host
[0148] Use the program to log in to the target host according to the configuration information such as the backup target server address, backup target server host user name, backup target server host password, etc.
[0149] 5.6 Restore Database Table
[0150] Use the restore command to restore the target database table.
[0151] 5.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0152] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0153] 5.8 Determine whether the loop is finished
[0154] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0155] 5.9 Determine whether the scheduled task has ended
[0156] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0157] The database table scanning subprocess can be implemented through the database table scanning subroutine. Figure 6 Schematic diagram of the specific functions of the database table scanning subroutine provided in the embodiment of the present application. The specific functions of the database table scanning subroutine are as follows: Figure 6 As shown:
[0158] 6.1 Read the scan configuration database table
[0159] For example, a scan configuration database table is read in the configuration database. The scan configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0160] 6.2 Start the scheduled scanning database table task processing process
[0161] 6.3 Loop each scanning task
[0162] Process each scan task according to the configuration information in the scan configuration database table obtained in step 6.1.
[0163] 6.4 Use the program to log in to the source database
[0164] Use the program to connect to the source database based on the configuration information such as the database port number, database user name, database password, and backup source server address.
[0165] 6.5 Determine whether the database table needs to be backed up
[0166] According to the configuration information such as the database name and database table name of the backup database table, the database table data size and database table record quantity information of the corresponding database table are obtained, and compared with the configuration information such as the database table backup data size limit and the database table backup record quantity limit. If one of them exceeds the limit, continue to execute downward, otherwise proceed to the next scanning task.
[0167] 6.6 Add to backup task list
[0168] The over-limit database table is added to the backup task list, and the information written includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, number of database table records and other information.
[0169] 6.7 Determine whether the loop is finished
[0170] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0171] 6.8 Determine whether the scheduled task has ended
[0172] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0173] For the database table renaming and creating a new sub-process, it can be implemented through the database table renaming and creating a new sub-program. Figure 7 Schematic diagram of the specific functions of the database table renaming and creating a new subroutine provided in the embodiment of the present application. The specific functions of the database table renaming and creating a new subroutine are as follows Figure 7 As shown:
[0174] 7.1 Read the scan configuration database table
[0175] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0176] 7.2 Start the scheduled backup task processing process
[0177] 7.3 Read the backup task list
[0178] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0179] 7.4 Cycle each backup task
[0180] Process each backup task according to the configuration information obtained in the backup task list in step 7.3.
[0181] 7.5 Use the program to log in to the source database
[0182] Use the program to connect to the source database based on the configuration information such as the database port number, database user name, database password, and backup source server address.
[0183] 7.6 Renaming Database Tables
[0184] Rename the database table to be backed up and migrated. The renaming rule is, for example, original table name + _bak_yyyyMMdd.
[0185] 7.7 Create a new database table
[0186] Create a new database table with the same name as the original table name.
[0187] 7.8 Update the status and current processing link of the backup task list, and add backup task step details table data
[0188] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0189] 7.9 Determine whether the loop is finished
[0190] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0191] 7.10 Determine whether the scheduled task has ended
[0192] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0193] The database table cleaning subprocess can be implemented through the database table cleaning subprogram. Figure 8 Schematic diagram of the specific functions of the database table cleaning subroutine provided in the embodiment of the present application. The specific functions of the database table cleaning subroutine are as follows: Figure 8 As shown:
[0194] 8.1 Read the scan configuration database table
[0195] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0196] 8.2 Start the scheduled backup task processing process
[0197] 8.3 Read the backup task list
[0198] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0199] 8.4 Cycle each backup task
[0200] Process each backup task according to the configuration information obtained in the backup task list in step 8.3.
[0201] 8.5 Use the program to log in to the source database
[0202] Use the program to connect to the source database based on the configuration information such as the database port number, database user name, database password, and backup source server address.
[0203] 8.6 Cleaning up database tables
[0204] Use SQL commands to delete the newly named backup database table.
[0205] 8.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0206] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0207] 8.8 Determine whether the loop is finished
[0208] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0209] 8.9 Determine whether the scheduled task has ended
[0210] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0211] The file cleaning subprocess in the source host can be implemented through a file cleaning subprogram (source). Fig. 9 A schematic diagram of the specific functions of the file cleaning subroutine (source) provided in an embodiment of the present application, wherein the specific functions of the file cleaning subroutine (source) are as follows: Fig. 9 As shown:
[0212] 9.1 Read the scan configuration database table
[0213] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0214] 9.2 Start the scheduled backup task processing process
[0215] 9.3 Read the backup task list
[0216] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0217] 9.4 Cycle each backup task
[0218] Process each backup task according to the configuration information obtained in the backup task list in step 9.3.
[0219] 9.5 Use the program to log in to the source host
[0220] Use the program to log in to the source host according to the backup source server address, backup source server host user name, backup source server host password and other configuration information.
[0221] 9.6 Cleaning up source files
[0222] Use the file deletion command to delete the backup file.
[0223] 9.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0224] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0225] 9.8 Determine whether the loop is finished
[0226] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0227] 9.9 Determine whether the scheduled task has ended
[0228] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0229] The file cleaning subprocess in the target host can be implemented through a file cleaning subprogram (target). Fig.10 A schematic diagram of the specific functions of the file cleaning subroutine (target) provided in an embodiment of the present application, wherein the specific functions of the file cleaning subroutine (target) are as follows: Fig.10 As shown:
[0230] 10.1 Read the scan configuration database table
[0231] For example, a configuration database table is read in the configuration database, and the configuration database table includes the database name, database port number, database user name, database password, database table name, backup source server address, backup source server host user name, backup source server host password, backup target server address, backup target server host user name, backup target server host password, database table backup data size limit, database table backup record quantity limit and other related information.
[0232] 10.2 Start the scheduled backup task processing process
[0233] 10.3 Read the backup task list
[0234] Among them, the backup task list contains at least one backup task, and the configuration information contained in each backup task includes: backup database table identification code, step status, execution status, creation date, start execution time, completion time, database table data size, database table record quantity and other information.
[0235] 10.4 Cycle each backup task
[0236] Process each backup task according to the configuration information obtained in the backup task list in step 10.3.
[0237] 10.5 Use the program to log in to the target host
[0238] Use the program to log in to the target host according to the configuration information such as the backup target server address, backup target server host user name, backup target server host password, etc.
[0239] 10.6 Cleaning up target files
[0240] Use the file deletion command to delete the backup file.
[0241] 10.7 Update the status and current processing link of the backup task list, and add backup task step details table data
[0242] Update the status of the backup task list to the execution status, the step status in the current processing link and the start execution time and other information, and add a backup task step details table, such as the backup database table identity code, step number, creation date, start execution time, completion time and other data information.
[0243] 10.8 Determine whether the loop is finished
[0244] Determine whether the loop is finished. If it is finished, wait for the scheduled scan task to start next time. Otherwise, scan the next database table to be backed up.
[0245] 10.9 Determine whether the scheduled task has ended
[0246] Determine whether the scheduled task has ended. If so, exit the program; otherwise, wait for the scheduled scanning task to start next time.
[0247] In summary, the database table automatic migration method provided by the present application can automatically implement the following functions, thereby improving work efficiency, avoiding manual errors, and ensuring correctness. In addition, it can also improve the query performance affected by the large amount of database table data and improve the query performance (speed):
[0248] Automatically scan the database table to reach the limit size to be backed up and migrated, automatically back up the database table, automatically copy the backup file to the migration target host, automatically restore the database table, automatically clean up the source host backup file, automatically clean up the target host backup file, and automatically clean up the migrated database table.
[0249] Fig.11 The structure diagram of the automatic migration device for database tables provided in one embodiment of the present application is shown in FIG. The automatic migration device for database tables provided in one embodiment of the present application is applied to a relational database management system. Fig.11 As shown, the database table automatic migration device 1100 includes:
[0250] The acquisition module 1101 is used to acquire the identifier of the target database table to be migrated and the first configuration information of the target database table, wherein the first configuration information includes the backup source server address, the backup source server host user name and the backup source server host password;
[0251] A login module 1102 is used to log in to the source host of the target database table according to the backup source server address, the backup source server host user name and the backup source server host password;
[0252] The copy module 1103 is used to control the source host to execute a copy command on the target database table, so as to copy the target database table to the target host.
[0253] In a possible implementation, the database table automatic migration device 1100 further includes a backup module (not shown) for controlling the source host to execute a backup command on the target database table before the replication module 1103 controls the source host to execute a replication command on the target database table, so as to perform a pre-migration backup on the target database table.
[0254] In a possible implementation manner, the database table automatic migration device 1100 further includes a recording module (not shown), which is used to: record the current state of the target database table, the current processing link, and the backup task step detail table data, wherein the current state includes the state to be backed up, the state to be migrated, the migration execution state, and the migration end state; the current processing link includes the step state and the start execution time; the backup task step detail table data includes the backup database table identity code, the step number, the creation date, the start execution time, the completion time, the database table data size, and the number of database table records.
[0255] In one possible implementation, the acquisition module 1101 is specifically used to: read a backup task list, the backup task list includes at least one backup task and a detailed table of data for recording the status of a database table, a processing link, and backup task steps; traverse the backup task list to obtain a backup task, the backup task includes an identifier of a database table to be migrated and first configuration information of the database table, and the database table includes a target database table.
[0256] In a possible implementation manner, the backup task list is obtained in the following manner:
[0257] Get the database table scanning task;
[0258] Establishing a connection with a source database operated by the database table scanning task according to second configuration information corresponding to the database table scanning task, wherein the second configuration information includes a database port number, a database user name, a database password, and a source server address;
[0259] Based on the source database, according to the third configuration information corresponding to the database table scanning task, obtain the database table backup data size and database table record quantity information of the corresponding database table, wherein the third configuration information includes the database name and database table name of the backup database table;
[0260] Determine, according to fourth configuration information corresponding to the database table scanning task, whether the size of database table backup data and the number of database table records of the database table exceed the limit, the fourth configuration information including the size limit of database table backup data and the number limit of database table records;
[0261] If either the database table backup data size or the database table record quantity of the database table exceeds the limit, the database table is added to the backup task list.
[0262] In a possible implementation, the database table automatic migration device also includes: a deletion module (not shown), which is used to control the source host to execute a deletion command on the target database table after controlling the source host to execute a backup command on the target database table, so as to delete the target database table; and update the status, processing links and backup task step detail table data of the target database table in the backup task list.
[0263] In a possible implementation manner, the first configuration information further includes a backup target server address, a backup target server host user name, and a backup target server host password. The login module 1102 may also be used to: after controlling the source host to execute a copy command on the target database table, log in to the target host of the target database table according to the target database table name, the backup target server address, the backup target server host user name, and the backup target server host password; control the target host to execute the following command on the target database table, and update the status, processing link, and backup task step detail table data of the target database table in the backup task list:
[0264] Restore command to restore the target database table;
[0265] File deletion command to delete the target database table.
[0266] In a possible implementation manner, the above-mentioned first configuration information also includes a database port number, a database user name, a database password and a source server address. Correspondingly, the database table automatic migration device 1100 also includes: a processing module (not shown), which is used to establish a connection with the source database of the target database table according to the database port number, database user name, database password and source server address corresponding to the target database table; based on the set renaming rule, change the name of the target database table in the source database, and create a new database table according to the original table name; and / or, after establishing a connection with the source database, use a delete command to delete the newly named backup database table in the source database.
[0267] The database table automatic migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0268] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0269] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element to allocate program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0270] Fig.12 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.12 As shown, the electronic device 1200 provided in the embodiment of the present application may include: a processor 1201 and a memory 1202, wherein:
[0271] Memory 1202, used to store computer-executable instructions;
[0272] The processor 1201 is used to execute the computer-executable instructions stored in the memory 1202 to implement the database table automatic migration method described in the above method embodiment.
[0273] It should be understood that the processor 1201 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The memory 1202 may include a high-speed random access memory (RAM), and may also include non-volatile storage NVM (non-volatile memory), such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0274] Optionally, the electronic device 1200 may further include a communication interface 1203. In a specific implementation, if the communication interface 1203, the memory 1202 and the processor 1201 are implemented independently, the communication interface 1203, the memory 1202 and the processor 1201 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0275] Optionally, in a specific implementation, if the communication interface 1203, the memory 1202 and the processor 1201 are integrated on a chip, the communication interface 1203, the memory 1202 and the processor 1201 can communicate through an internal interface.
[0276] The embodiment of the present application also provides a capability reuse system, which includes a low-code system for providing a visual interface and basic components, and generating a first object in response to a user's interactive operation on a target basic component in the visual interface, and encapsulating the first object into a first component library, the first component library is deployed in a content distribution network, and the content distribution network also includes a second component library encapsulating the basic components, the first object includes a page and a composite component. Among them, the composite component includes a template component and a page rendering component, and the template component is a reusable component.
[0277] A development system is used to provide development services, and in the process of providing development services, when a second object in a low-code system is detected for reuse, a target component library encapsulating the second object is introduced from a content distribution network in the form of a script to reuse the second object in the target component library.
[0278] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the database table automatic migration method described in any of the aforementioned embodiments.
[0279] It is understood that the computer readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special computer.
[0280] An exemplary computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be an integral part of the processor. The processor and the computer-readable storage medium can be located in an ASIC. Of course, the processor and the computer-readable storage medium can also exist in an electronic device as discrete components.
[0281] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a computer-readable storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.
[0282] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements the database table automatic migration method described in any of the aforementioned embodiments.
[0283] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0284] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0285] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0286] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0287] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for automatic migration of database tables, characterized in that, applied to a relational database management system, the method for automatic migration of database tables includes: Obtain the identifier of the target database table to be migrated and the first configuration information of the target database table, where the first configuration information includes the backup source server address, the backup source server host username, and the backup source server host password; Log in to the source host of the target database table according to the backup source server address, the backup source server host username, and the backup source server host password; Control the source host to execute a copy command on the target database table to copy the target database table to the target host.
2. The method for automatic migration of database tables according to claim 1, characterized in that, Before controlling the source host to execute a copy command on the target database table, it further includes: Controlling the source host to execute a backup command on the target database table to perform a pre-migration backup of the target database table.
3. The method for automatic migration of database tables according to claim 2, characterized in that, It further includes: Record the current status, current processing link, and backup task step detail list data of the target database table, where the current status includes the to-be-backup status, to-be-migrated status, migration execution status, and migration end status; the current processing link includes the step status and start execution time; The backup task step detail list data includes the backup database table identity code, step number, creation date, start execution time, completion time, database table data size, and database table record number.
4. The method for automatic migration of database tables according to claim 3, characterized in that, The obtaining of the identifier of the target database table to be migrated and the first configuration information of the target database table includes: Read the backup task list, where the backup task list contains at least one backup task and is used to record the status, processing link, and backup task step detail list data of the database table; Traverse the backup task list to obtain a backup task, where the backup task contains the identifier of the database table to be migrated and the first configuration information of the database table, and the database table includes the target database table.
5. The method for automatic migration of database tables according to claim 4, characterized in that, The backup task list is obtained through the following method: Obtain a database table scanning task; Establish a connection with the source database corresponding to the database table scanning task according to the second configuration information corresponding to the database table scanning task, where the second configuration information includes the database port number, database username, database password, and source server address; Based on the source database, obtain the database table backup data size and database table record number information of the corresponding database table according to the third configuration information corresponding to the database table scanning task, where the third configuration information includes the database name of the backup database table and the database table name. Determine whether the database table backup data size and the number of database table records of the database table exceed the limit according to the fourth configuration information corresponding to the database table scanning task, where the fourth configuration information includes the database table backup data size limit and the database table record number limit; If any one of the database table backup data size and the number of database table records of the database table exceeds the limit, add the database table to the backup task list.
6. The database table automatic migration method according to claim 4, characterized in that, further comprising: After controlling the source host to execute the backup command on the target database table, control the source host to execute the delete command on the target database table to delete the target database table; update the status, processing link and backup task step detail list data of the target database table in the backup task list.
7. The database table automatic migration method according to claim 4, characterized in that, The first configuration information further includes the backup target server address, the backup target server host username, and the backup target server host password. After controlling the source host to execute the copy command on the target database table, it further includes: Log in to the target host of the target database table according to the target database table name, the backup target server address, the backup target server host username, and the backup target server host password; Control the target host to execute the following commands on the target database table, and update the status, processing link and backup task step detail list data of the target database table in the backup task list: The restore command to restore the target database table; The file delete command to delete the target database table.
8. The database table automatic migration method according to claim 4, characterized in that, The first configuration information further includes the database port number, the database username, the database password, and the source server address, and further includes: Establish a connection with the source database of the target database table according to the database port number, the database username, the database password, and the source server address corresponding to the target database table; Based on the set renaming rule, change the name of the target database table in the source database, and create a new database table according to the original table name; and / or, after establishing a connection with the source database, use the delete command to delete the newly named backup database table in the source database.
9. A database table automatic migration device, characterized in that, Applied to a relational database management system, the database table automatic migration device includes: An acquisition module, configured to acquire the identifier of the target database table to be migrated and the first configuration information of the target database table, where the first configuration information includes the backup source server address, the backup source server host username, and the backup source server host password; A login module, configured to log in to the source host of the target database table according to the backup source server address, the backup source server host username, and the backup source server host password; A replication module, configured to control the source host to execute a replication command on the target database table, so as to replicate the target database table to the target host.
10. An electronic device, characterized in that it includes: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.