WO2023134627A1 - Data migration methods and apparatuses, electronic device, and storage medium - Google Patents

Data migration methods and apparatuses, electronic device, and storage medium Download PDF

Info

Publication number
WO2023134627A1
WO2023134627A1 PCT/CN2023/071319 CN2023071319W WO2023134627A1 WO 2023134627 A1 WO2023134627 A1 WO 2023134627A1 CN 2023071319 W CN2023071319 W CN 2023071319W WO 2023134627 A1 WO2023134627 A1 WO 2023134627A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
migration
strategy
export
import
Prior art date
Application number
PCT/CN2023/071319
Other languages
French (fr)
Chinese (zh)
Inventor
王增臣
沈文宽
侯博文
付裕
黄健
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023134627A1 publication Critical patent/WO2023134627A1/en

Links

Images

Classifications

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

Definitions

  • the embodiments of the present application relate to the technical field of databases, and in particular, to a data migration method and device, electronic equipment, and storage media.
  • a distributed database is a logically unified database composed of multiple physically dispersed database units connected by a computer network. It has the characteristics of large storage capacity, high concurrent business volume, and good scalability, so its application is increasingly widely.
  • cross-database migration of data is a common operation, which puts forward higher requirements for reliable data migration technology.
  • the current data migration method mainly adopts simple multi-threaded migration.
  • the database of the original database is migrated by multi-threaded data according to the table or file strategy.
  • the uneven data of different source tables or files leads to a long overall migration time and low migration efficiency. lower.
  • Embodiments of the present application provide a data migration method and device, electronic equipment, and a storage medium.
  • the embodiment of the present application provides a data migration method, which is applied to the migration terminal.
  • the method includes: obtaining source data from the original database; receiving migration request information sent by the client; the migration request information includes the A data attribute parameter of the source data; a migration strategy is generated according to the data attribute parameter; and the source data is migrated to a target database according to the migration strategy.
  • the embodiment of the present application provides a data migration method, which is applied to a client, and the method includes: obtaining migration request information; the migration request information includes the data attribute parameters of the source data; sending the migration request information to the migrating end, so that the migrating end executes the method described in the first aspect of the present application.
  • the embodiment of the present application provides a data migration device for the migration terminal, including: a source data acquisition module, configured to acquire source data from the original database; a migration request information receiving module, configured to receive the client The migration request information sent; the migration request information includes the data attribute parameters of the source data; the migration strategy generation module is configured to generate a migration strategy according to the data attribute parameters; the migration module is configured to generate a migration strategy according to the migration strategy Migrate the source data to the target database.
  • an embodiment of the present application provides a data migration device for a client, including: a data acquisition module configured to acquire migration request information; the migration request information includes data attribute parameters of the source data; data The sending module is configured to send the migration request information to the migration end, so that the migration end executes the method described in the first aspect of the present application.
  • the embodiment of the present application provides an electronic device, including: at least one memory; at least one processor; at least one program; the program is stored in the memory, and the processor executes the at least one program to realize: Apply the method as described in the first aspect above; or, the method as described in the second aspect above.
  • the embodiment of the present application provides a storage medium, the storage medium is a computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer perform:
  • the beneficial effects of the above-mentioned second aspect to the sixth aspect compared with the related technology are the same as those of the above-mentioned first aspect compared with the related technology. Please refer to the relevant description in the above-mentioned first aspect. This will not be repeated here.
  • FIG. 1 is a schematic diagram of a system architecture of a data migration method provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a data migration method provided by an embodiment of the present application.
  • Fig. 3 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 4 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 5 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 6 is a flowchart of a data migration method provided by another embodiment of the present application.
  • FIG. 7 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 8 is a flowchart of a data migration method provided by another embodiment of the present application.
  • FIG. 9 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 10 is a flowchart of a data migration method provided by another embodiment of the present application.
  • FIG. 11 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 12 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 13 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 14 is a flowchart of a data migration method provided by another embodiment of the present application.
  • Fig. 15 is a flowchart of a data migration method provided by another embodiment of the present application.
  • FIG. 16 is a schematic diagram of the principle of the data migration method provided by the embodiment of the present application.
  • FIG. 17 is a schematic diagram of a data migration module provided by an embodiment of the present application.
  • Fig. 18 is a schematic diagram of a data migration module provided by another embodiment of the present application.
  • Reference numerals original database 100, client 110, migration terminal 120, strategy optimization module 121, data export module 122, data import module 123, result output module 124, destination database 130, source data acquisition module 1710, migration request information reception Module 1720 , migration policy generation module 1730 , migration module 1740 , data acquisition module 1810 , and data sending module 1820 .
  • references to “one embodiment” or “some embodiments” described in the description of the embodiments of the present application mean that specific features described in conjunction with the embodiments of the present application are included in one or more embodiments of the embodiments of the present application. , structure or characteristics.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • Database is a warehouse that organizes, stores and manages data according to the data structure. It is a collection of large amounts of data stored in a computer for a long time, organized, shareable, and uniformly managed.
  • Database Management System is a large-scale software for manipulating and managing databases, used to create, use and maintain databases. It manages and controls the database in a unified way to ensure the security and integrity of the database.
  • Data migration generally refers to the process of converting and migrating the source data of the old database management system to the new database management system. The data migration tool is an important auxiliary tool to ensure the integrity and consistency of the data and effectively complete the replacement and upgrade of the database system.
  • Distributed database refers to the use of smaller computer systems, each computer can be placed in a separate place, each computer may have a complete copy of the DBMS, or a partial copy of the copy, and has its own local database, located in Many computers in different locations are connected to each other through the network to form a complete and global logically centralized and physically distributed large database.
  • a distributed database is a logically unified database composed of multiple physically dispersed database units connected by a computer network. It has the characteristics of large storage capacity, high concurrent business volume, and good scalability, so its application is increasingly widely.
  • cross-database migration of data is a common operation, which puts forward higher requirements for reliable data migration technology.
  • the current data migration method mainly adopts simple multi-threaded migration.
  • the database of the original database is migrated by multi-threaded data according to the table or file strategy.
  • the migration efficiency of processing massive data is still not up to expectations.
  • Different source tables or files The unevenness of the data leads to a long overall migration time and low migration efficiency.
  • the current data migration method does not consider the processing of cross-database field type conversion, resulting in a decrease in the accuracy of data migration; the current data migration method is mainly applicable to general database data migration scenarios, and cannot realize data migration to distributed databases , and did not consider the distribution and distribution of data on the distributed database.
  • the customer replaces and upgrades the database system, it is urgent to complete the migration of massive data from the Oracle database to the new distributed database in a short period of time. At the same time, selective migration of some data cannot be realized, so the flexibility of data migration is very poor.
  • an embodiment of the present disclosure provides a data migration method and device, electronic equipment, and a storage medium.
  • the source data from the original database is obtained, and the migration request information sent by the client is received, wherein the migration request information includes the source data According to the data attribute parameters, a migration strategy is generated according to the data attribute parameters, and then the source data is migrated to the destination database according to the migration strategy.
  • the migration request information is obtained and sent to the migration end to complete the migration task.
  • the technical solution provided by the example can realize the multi-process and multi-thread migration of the database, avoid the problem of long migration time caused by uneven data, and improve the efficiency of data migration; realize the processing of cross-database field type conversion, improve It improves the accuracy of data migration; realizes data migration to distributed databases, considers the distribution and distribution of data on distributed databases, and realizes the selective migration of some data at the same time, which improves the flexibility of data migration.
  • Embodiments of the present disclosure provide a data migration method and device, electronic equipment, and a storage medium, which are described through the following embodiments. First, the data migration method in the embodiments of the present disclosure is described.
  • FIG. 1 is a schematic diagram of a system architecture of a data migration method provided by an embodiment of the present application.
  • the system architecture includes an original database 100, a client 110, a migration terminal 120, and a destination database 130, wherein the migration terminal 120 includes a strategy optimization module 121, a data export module 122, a data import module 123, and a result output module 124 .
  • the original database 100 is connected with the data export module
  • the client 110 is connected with the strategy optimization module 121
  • the strategy optimization module 121 is connected with the data export module 122
  • the data export module 122 is connected with the data import module 123
  • the data import module 123 is connected with the target database 130
  • the result output module 124 is connected to the data export module 122 and the data import module 123 respectively.
  • the original database 100 is a database to be migrated, and the client 110 is set to send migration request information to the strategy optimization module 121, so that the strategy optimization module 121 can generate a migration strategy according to the migration request information, and then according to
  • the data in the original database 100 is exported by the migration strategy in the data export module 122 to obtain an intermediate file, and then the data is imported in the data import module 123 according to the migration strategy, and the intermediate file is distributed and imported into the destination database 130 to complete the migration process.
  • the result output module 124 records the intermediate file in the data export module 122 and the migration process file in the data import module 123 to generate a migration result report file, so as to record the migration result.
  • the target database 130 is a distributed database platform
  • the migration terminal 120 is an import service platform, such as an Oraclecap platform.
  • the distributed database platform is the entity and core of the existing distributed database, which is mainly responsible for the management and monitoring of data storage and system status;
  • the data import service platform Oraclecap provides data export from the oral database to CSV files, and then through CSV The files are imported into the internal distributed database system.
  • each device can call its stored data migration program to execute the data migration method.
  • the embodiment of the present application provides a data migration method, which is applied to the migration terminal.
  • the method includes: obtaining the source data from the original database; receiving the migration request information sent by the client; the migration request information includes the data attribute parameters of the source data; according to the data attribute Parameters generate a migration strategy; migrate the source data to the destination database according to the migration strategy.
  • the data attribute parameters include one or more of the following: table quantity parameters, or table data quantity parameters, or row quantity parameters.
  • Figure 2 is a flow chart of a data migration method provided by an embodiment of the present application, the data migration method is applied to the migration end, for example, it is applied to the migration end 120 in the embodiment shown in Figure 1, the The data migration method includes but not limited to step S210 and step S240.
  • S220 Receive migration request information sent by the client; the migration request information includes data attribute parameters of source data;
  • step S210 the source data is data in the original database, and the original database is directly connected to the migration end for sending the source data to the migration end for the migration end to migrate the source data.
  • step S220 the migration request information is used by the client to transmit commands and parameters related to the migration process to the migration end, so that the migration platform performs migration processing on the source data according to the above commands and parameters.
  • the commands and parameters related to the migration process include but are not limited to data attribute parameters and authority authentication requests.
  • the data attribute parameters include but are not limited to one or more of the following: table quantity parameters, or table data quantity parameters, or row quantity parameters.
  • the table quantity parameters represent the data table in the source data Quantity
  • the table data quantity parameter represents the size of the data table in the source data
  • the row quantity parameter represents the setting value of each row of data.
  • Data attribute parameters can be used both to generate migration strategies and to manipulate data during export and import.
  • step S240 according to the migration strategy generated in step S230, the migration terminal is instructed to migrate the source data, so that the data can be imported into the target database reasonably and efficiently.
  • the source data from the original database is obtained, and the migration request information sent by the client is received, wherein the migration request information includes the data attribute parameters of the source data, and a migration strategy is generated according to the data attribute parameters, Furthermore, the source data is migrated to the destination database according to the migration strategy.
  • the multi-process and multi-thread migration of the database can be realized, which avoids the problem of long migration time caused by uneven data, and improves the The efficiency of data migration; realize the processing of cross-database field type conversion, improve the accuracy of data migration; realize the data migration to distributed databases, consider the distribution and distribution of data on distributed databases, and realize the partial Selective migration of data improves the flexibility of data migration.
  • the data migration method provided in this application is only to export and import the source data, which will not cause damage to the original database environment, and also ensures the data validity of the target database.
  • the migration strategy includes an export strategy and an import strategy; migrating the source data to the destination database according to the migration strategy includes: converting the source data into an intermediate file according to the export strategy; and migrating the intermediate file to the destination database according to the import strategy.
  • step S240 may include but not limited to the following steps:
  • the migration terminal first exports the source data, homogenizes the data according to the export strategy, generates an intermediate file, and then distributes the data to the intermediate file according to the import strategy, and completes the migration of the data to the destination database.
  • the data migration of distributed databases avoids the problem of long migration time caused by uneven data, improves the efficiency of data migration, and makes the data migration requirements between various databases have certain adaptability and reliability. scalability.
  • the export strategy includes export-in thread strategy; converting the source data into an intermediate file according to the export strategy, including: configuring the number of export processes and the number of export threads according to the data attribute parameters; according to the number of export processes, the number of export threads and the data Attribute parameters, evenly distribute the data to the corresponding export threads for data export, and generate intermediate files.
  • step S310 may include but not limited to the following steps:
  • the data attribute parameters include but are not limited to table quantity parameters and table data volume parameters.
  • the table quantity parameter represents the number of data tables in the source data
  • the table data volume parameter represents the size of the data tables in the source data
  • the number of rows parameter represents the setting value of each row of data.
  • the number of export processes is configured to be 5, and the number of export threads is configured to be 20.
  • the table number parameter is 700 means that the data center has 700 tables
  • the table data volume parameter is 10 billion means that there are 10 billion pieces of data in the data.
  • the data attribute parameter includes a row number parameter.
  • the row number parameter is 1 million, indicating that the fixed data row is set to 1 million rows of data during the data export process, and the fixed data row of the table data Split threads, realize concurrent export and generate intermediate files.
  • the setting of the table quantity parameter, the table data quantity parameter and the row quantity parameter can be changed according to different source data, as long as the corresponding technical effect can be achieved.
  • the export strategy includes a data placement strategy, and converting the source data into an intermediate file according to the export strategy includes: obtaining a preset file division rule; the file division rule includes generating the data volume or data of each intermediate file The number of rows; according to the file division rules, the source data is correspondingly exported as at least one intermediate file.
  • step S310 may include but not limited to the following steps:
  • the file division rule includes generating the data volume or data row number of each intermediate file, in some embodiments, generating the data volume number of each intermediate file is 64M, generating the data row number of each intermediate file It is 100,000 lines. It should be noted that the setting of the amount of data or the number of data lines for generating each intermediate file can be changed according to the source data, as long as the corresponding technical effect can be achieved.
  • step S520 according to the file division rules, the source data is correspondingly exported into at least one intermediate file, the process of data storage is completed, and the uniform export of data is realized, which provides preparatory conditions for the rapid import of data, and can also facilitate The export process converts the format of the file.
  • the generated intermediate file can be used not only for the data migration process, but also for the generation of the migration result report file, so as to realize the analysis and recording of the migration result.
  • the import strategy includes import thread strategy; the intermediate file is migrated to the destination database according to the import strategy, including: configuring the number of import processes and the number of import threads according to the data attribute parameters; according to the number of import processes, the number of import threads and the data Attribute parameters, evenly distribute the data to the corresponding import threads for data import, and migrate the intermediate files to the destination database.
  • step S320 may include but not limited to the following steps:
  • the data attribute parameters include but are not limited to table number parameters and table data volume parameters.
  • the table number parameters represent the number of data tables in the intermediate file
  • the table data volume parameters represent the number of data tables in the source data.
  • the size, number of rows parameter characterizes the setting value of each row of data.
  • the number of import processes is configured to be 5 and the number of import threads to be 20.
  • the table number parameter is 700 means that the data center has 700 tables
  • the table data volume parameter is 10 billion means that there are 10 billion pieces of data in the data.
  • the data attribute parameter includes a row quantity parameter.
  • the row quantity parameter is 5000, indicating that the file data is divided into threads every 5000 pieces, and the fixed data rows of the table data are split into threads to realize Concurrent imports to the destination database.
  • the setting of the table quantity parameter, the table data quantity parameter and the row quantity parameter can be changed according to different source data, as long as the corresponding technical effect can be achieved.
  • generating the migration strategy according to the data attribute parameters includes: performing prediction processing according to the table quantity parameter and the table data quantity parameter to obtain intermediate parameters; and generating an import thread strategy according to the intermediate parameters.
  • step S230 may include but not limited to the following steps:
  • step S710 the generation of the migration strategy is completed before the data export, including the export strategy and the import strategy, because the generation of the import strategy needs to depend on the number of data tables and the size of the data in the intermediate file, so it needs to be based on the source data before data import.
  • the size of the data volume predicts the size of the intermediate file to obtain intermediate parameters for importing into the generation of the thread strategy, wherein the intermediate parameters include but are not limited to the table quantity parameters and table data volume parameters of the predicted intermediate files.
  • the prediction process in step S710 includes but is not limited to manual prediction and machine learning prediction.
  • manual prediction is based on the staff's previous experience in data migration and the size of the generated intermediate file based on the size of the source file to predict the size of the generated intermediate file, obtain intermediate parameters, and input it into the system;
  • machine prediction includes the use of machine learning, Deep learning and other methods train the prediction model through historical configuration data, and use the prediction model to realize the prediction process of intermediate parameters.
  • step S720 after the intermediate parameters are predicted, the imported thread policy is configured using the intermediate parameters.
  • the principle of the configuration is the same as the principle of configuring the exported thread policy according to the data attribute parameters.
  • the destination database includes multiple partitions; the import strategy includes a data distribution strategy; migrating the intermediate file to the destination database according to the import strategy includes: obtaining distribution key information; according to the distribution key information, obtaining and matching the distribution key information The intermediate file; migrate the intermediate file to the corresponding partition of the destination database.
  • the distribution key information includes at least any one of the following: a continuous interval distribution key, an enumeration value distribution key, or a partition distribution key.
  • step S320 may include but not limited to the following steps:
  • the distribution key information is used to characterize the data distribution type for different types of data tables, and the distribution key information includes at least any of the following: continuous interval distribution key, or enumerated value distribution key, or partition distribution key, Among them, the continuous interval distribution key includes but is not limited to RANGE, which assigns data to different partitions based on a given continuous interval range; the enumerated value distribution key includes but is not limited to LIST, which partitions based on the enumerated value list; partition distribution Keys include but are not limited to HASH, which assigns data to different partitions based on a given number of partitions.
  • distribution key information there are two ways to obtain distribution key information, namely direct acquisition and indirect acquisition.
  • the corresponding distribution key information can be obtained by directly matching the attributes of the basic data table; for business data In other words, you need to rely on the use of basic data for the selection of distribution keys.
  • the distribution key information has its own distribution rules.
  • the core principle of the distribution key information is to migrate the matched intermediate files to the corresponding partitions of the destination database according to different distribution rules, thus realizing the distribution on the destination database.
  • Distribution which distributes business-related data to the same database unit, makes the data distribution reasonable and even after data migration, and improves the flexibility of data migration.
  • the intermediate file includes basic data and business data
  • obtaining the distribution key information also includes: obtaining the priority of the basic data; sorting the basic data according to the priority to obtain the sorting result; sorting the key according to the sorting result Segment query matching processing to obtain the basic data associated with the business data; obtain the distribution key corresponding to the basic data associated with the business data.
  • step S810 may include but not limited to the following steps:
  • the intermediate file includes basic data and business data
  • the basic data includes but not limited to the basic information table
  • the business data includes but not limited to the business information table.
  • the basic information table refers to a table that stores data such as user basic information, and has the characteristics of being dependent and relatively stable data. Among them, some field information of the table can distinguish and reflect the characteristics of the table data, such as gender, place of origin and other information ;
  • the business table is the business information data generated by the user in the process of handling business, which has a high correlation with the basic information table, and is generally related to the information of one or more basic information tables.
  • the priority of the basic data is one of the attributes of the basic data, and is used for query matching according to the priority, so as to process the basic data with higher importance in advance and ensure the reliability of data distribution.
  • the priorities of the basic tables are: jc1, jc2, jc3.
  • step S920 to step S940 query and match the key fields of the business data according to the priority order of the basic information table.
  • the distribution key of the table data if the basic information table cannot be matched, the distribution key of the business table data is set to the default value, for example, the default value can be hash(00001), where hash indicates that the distribution key is HASH.
  • the migration request information also includes platform operating environment information
  • converting the source data into an intermediate file according to the export strategy includes: generating a format conversion strategy according to the platform operating environment information; performing format conversion processing on the source data according to the format conversion strategy , get the target format data; update the intermediate file according to the target format data.
  • step S310 may include but not limited to the following steps:
  • S1020 performing format conversion processing on the source data according to the format conversion strategy to obtain target format data
  • the export process after the export process is completed, it is necessary to consider whether the format of the intermediate file meets the requirements of the current operating platform, so as to convert the format of the intermediate file.
  • the process of format conversion occurs during the data export process.
  • the platform operating environment information is the operating environment information of the migration platform currently used by the migration terminal, and the format conversion strategy is the corresponding relationship between different platform operating environments and file formats.
  • Different types of platforms have different requirements for file formats, so It is necessary to convert the file type of the source data according to the characteristics of the platform to improve the efficiency of data migration.
  • the target format data includes but is not limited to CSV files. It should be noted that the format of the target format data can also be adaptively adjusted according to the characteristics of other platforms or databases, as long as the corresponding technical effects can be achieved. For example, convert varchar2 type to varchar type; or convert number type to decimal type, etc.
  • the migration request information further includes data screening information
  • generating a migration strategy according to data attribute parameters includes: performing data source screening processing according to source data and data screening information to obtain target data; generating Migration strategy; correspondingly, migrating the source data to the destination database according to the migration strategy, including: migrating the target data to the destination database according to the migration strategy.
  • step S230 may include but not limited to the following steps:
  • step S240 may include but not limited to the following steps:
  • step S1110 in some data migration scenarios, it is not necessary to migrate all the source data of the original database, but it is necessary to selectively migrate the required data or key data, wherein the target data is selected from the source data The required data or key data that come out.
  • steps S1120 to S1130 the generation process of the migration strategy and the principle of data migration have not changed due to the change of the migration object.
  • Customers can select the required or key data for migration according to business needs, so as to achieve the data cleaning effect on the original database and maintain This ensures high data availability in the destination database and improves the flexibility of the data migration process.
  • the migration request information also includes a permission authentication request
  • the migration policy is generated according to the data attribute parameters, including: parsing the permission authentication request to obtain permission information; performing authentication processing on the permission information to obtain authentication result information; Result information and data attribute parameters generate a migration strategy.
  • step S230 may include but not limited to the following steps:
  • step S1210 the user sends migration request information to the migration terminal through the client, wherein the migration terminal includes but is not limited to a data migration tool, and the data migration tool parses the data migration command to obtain permission information, and the permission information is used to indicate whether the client has Within the authority of data migration.
  • the migration terminal includes but is not limited to a data migration tool
  • the data migration tool parses the data migration command to obtain permission information, and the permission information is used to indicate whether the client has Within the authority of data migration.
  • step S1220 after obtaining the authority information, the migrating end performs authentication processing on the authority information to obtain authentication result information, which is used to represent the migrating end's authentication result of the client's authority.
  • step S1230 if the authentication result is successful, that is, after the authority authentication is passed, the migration terminal generates a migration policy according to the authentication result information and data attribute parameters.
  • the method further includes: generating a migration result report file according to the intermediate file.
  • the data migration method further includes:
  • the intermediate file is an intermediate file obtained during the export process
  • the migration process file is during the export and import process
  • the migration process file is a record of whether the export and import of each file is successful or not.
  • step S1320 the intermediate files and migration process files are collected to generate a migration result report file for reuse in data analysis and the like.
  • the migration process file is used to judge whether each data table in the data source has been successfully migrated. If the migration is not successful, it can be judged by the recorded intermediate file, which step in the migration process of the data table has an error, and then for Data tables that have not been successfully migrated are migrated twice to ensure the reliability of data migration.
  • the target database is a distributed database.
  • the target database is a distributed database, which is used when the database system is replaced and upgraded, and the data in the original database is migrated to the distributed database system as needed.
  • the data migration method of this application can be used to complete the migration process.
  • the embodiment of the present application provides a data migration method, which is applied to the client.
  • the method includes: obtaining migration request information; the migration request information includes the data attribute parameters of the source data; sending the migration request information to the migration end, so that the migration end performs the above tasks A method for migrating endpoints.
  • FIG. 14 is a flowchart of a data migration method provided by an embodiment of the present application.
  • the data migration method is applied to a client, for example, to the client 110 in the embodiment shown in FIG. 1.
  • the data migration method includes but not limited to step S1410 and step S1420.
  • the migration request information is used by the client to transmit commands and parameters related to the migration process to the migration end, so that the migration platform performs migration processing on the source data according to the above commands and parameters.
  • the commands and parameters related to the migration process include but are not limited to data attribute parameters and authority authentication requests.
  • step S1420 the migration request information is sent to the migration end, so that the migration end executes any of the above-mentioned methods for the migration end.
  • the migration request information is obtained at the client end and sent to the migration end to complete the migration task.
  • the technical solution provided by the embodiment of this application can realize the database Multi-process and multi-thread migration avoids the problem of long migration time caused by uneven data and improves the efficiency of data migration; realizes the processing of cross-database field type conversion and improves the accuracy of data migration;
  • the data migration of distributed databases considers the distribution and distribution of data on distributed databases, and at the same time realizes the selective migration of some data, which improves the flexibility of data migration.
  • the client acquires and sends migration request information to the migration terminal
  • the migration terminal acquires source data from the original database, and receives migration request information sent by the client; the migration request information includes data attribute parameters and data screening information of the source data;
  • the migration terminal parses the permission authentication request to obtain permission information, and then performs authentication processing on the permission information to obtain authentication result information;
  • the strategy optimization module generates an export strategy and an import strategy according to the table quantity parameter and the table data quantity parameter of the target data; wherein, the export strategy includes the number of export processes and the number of export threads.
  • the data export module configures the number of export processes and the number of export threads according to the data attribute parameters, evenly distributes the data to corresponding export threads for data export, and correspondingly exports the source data into at least one intermediate file according to file division rules.
  • the data export module generates a format conversion strategy according to the platform operating environment information, performs format conversion processing on the source data according to the format conversion strategy, obtains data in a target format, and then uses the data in the target format to update the intermediate file.
  • the data import module configures the number of import processes and the number of import threads according to the data attribute parameters, evenly distributes the data to corresponding import threads for data import, uses the distribution key information to obtain an intermediate file matching the distribution key information, and migrates the intermediate file to The partition corresponding to the destination database.
  • the result output module acquires the intermediate file and the migration process file, and generates a migration result report file.
  • the target data table number parameter is 700
  • the table data volume parameter is 10 billion
  • the configuration export process number and import process number are 5, and the export thread number and import thread number are 20.
  • the thread distribution is performed with a fixed data line of 1 million lines, and the data is placed to disk with a fixed line number of 100,000 lines to generate a csv intermediate file.
  • 5000 data records are used for thread distribution, and the basic data and business data are deployed in the distributed database according to the corresponding distribution rules according to the distribution key information such as RANGE, LIST, and HASH.
  • the data migration process shown in Figure 15 occupies a total of 4T table space in the Oracle database, and completes all data migration within 3 hours, greatly improving the efficiency of data migration.
  • the original database (the source database in the figure) sends massive data to the data export module, and the data export module sends a policy query command to the policy optimization module.
  • the policy optimization module returns policy information to the data export module, and then, the data
  • the export module exports the source data into intermediate files according to the policy information, and the intermediate files are sequentially recorded as TB1.csv1...TBm.csv1, TBn.csv1...TBn.csvk
  • the data import module distributes the intermediate files to the destination database according to the policy information , the files of the target database are recorded as TB1 import...TBm import, TBn import...TBn import, and then the data migration is completed.
  • the result output module forms a result file according to the data migration record, and the result file is recorded as result.
  • an embodiment of the embodiment of the present application also provides a data migration device for the migration terminal.
  • the data migration device includes:
  • source data acquisition module 1710 configured to acquire source data from the original database
  • the migration request information receiving module 1720 is configured to receive the migration request information sent by the client; the migration request information includes the data attribute parameters of the source data;
  • the migration strategy generation module 1730 is configured to generate a migration strategy according to the data attribute parameters
  • the migration module 1740 is configured to migrate the source data to the target database according to the migration strategy.
  • the source data acquisition module 1710 is connected to the migration request information receiving module 1720 , the migration request information receiving module 1720 is connected to the migration strategy generation module 1730 , and the migration strategy generation module 1730 is connected to the migration module 1740 .
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • an embodiment of the embodiment of the present application also provides a data migration device for a client.
  • the data migration device includes:
  • the data acquisition module 1810 is configured to acquire migration request information; the migration request information includes data attribute parameters of source data;
  • the data sending module 1820 is configured to send migration request information to the migration end, so that the migration end performs any one of the above-mentioned methods for the migration end in this application.
  • the data acquisition module 1810 is connected with the data sending module 1820 .
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • an embodiment of the embodiments of the present application further provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor and memory can be connected by a bus or other means.
  • memory can be used to store non-transitory software programs and non-transitory computer-executable programs.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the memory may include memory located remotely from the processor, which remote memory may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the electronic device in this embodiment can be applied as the client 110 or the migration terminal 120 in the system architecture of the embodiment shown in FIG. 1 .
  • the electronic device in this embodiment is as shown in FIG. 2
  • the data migration methods in the embodiments have the same idea, so these embodiments have the same implementation principles and technical effects, and will not be described in detail here.
  • the non-transitory software programs and instructions required to implement the data migration method of the above-mentioned embodiments are stored in the memory, and when executed by the processor, the data migration method in any of the above-mentioned embodiments is executed.
  • an embodiment of the embodiment of the present application also provides a storage medium, the storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the Execution by one processor may cause the above-mentioned processor to execute the data migration method in the above-mentioned embodiments, for example, execute the data migration method in any of the above-described embodiments.
  • the data migration method provided by the first aspect of the embodiment of the present application uses the migration request information sent by the client, wherein the migration request information includes the data attribute parameters of the source data, and generates a migration strategy according to the data attribute parameters, and then Migrate the source data to the destination database according to the migration strategy.
  • the multi-process and multi-thread migration of the database can be realized according to the data attribute parameters, avoiding the problem of long migration time caused by uneven data, and improving the efficiency of data migration.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

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

Abstract

Embodiments of the present application relate to the technical field of databases and provide data migration methods and apparatuses, an electronic device, and a storage medium. The data migration method comprises: acquiring source data from an original database (S210); receiving migration request information sent by a client end, the migration request information comprising a data attribute parameter of the source data (S220); generating a migration policy according to the data attribute parameter (S230); and migrating the source data to a destination database according to the migration policy (S240).

Description

数据迁移方法和装置、电子设备、存储介质Data migration method and device, electronic device, storage medium
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202210035298.4、申请日为2022年01月13日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202210035298.4 and a filing date of January 13, 2022, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本申请实施例涉及数据库技术领域,尤其涉及一种数据迁移方法和装置、电子设备、存储介质。The embodiments of the present application relate to the technical field of databases, and in particular, to a data migration method and device, electronic equipment, and storage media.
背景技术Background technique
信息业务的发展带来了数据量的与日俱增,数据库在信息系统中承担着不可或缺的数据桥梁作用。例如,分布式数据库是用计算机网络将物理上分散的多个数据库单元连接起来组成的一个逻辑上统一的数据库,有着存储量大、业务并发量高、可扩展性好的特点,故其应用日益广泛。在分布式数据库的应用场景中,数据的跨数据库迁移是常见操作,这对可靠的数据迁移技术提出了更高的要求。The development of information services has brought about an increasing amount of data, and databases play an indispensable role as a data bridge in information systems. For example, a distributed database is a logically unified database composed of multiple physically dispersed database units connected by a computer network. It has the characteristics of large storage capacity, high concurrent business volume, and good scalability, so its application is increasingly widely. In the application scenarios of distributed databases, cross-database migration of data is a common operation, which puts forward higher requirements for reliable data migration technology.
当前的数据迁移方法主要采取的迁移方式是简单多线程迁移,将原始数据库的数据库按照表或者文件策略进行多线程数据迁移,不同源表或文件的数据不均匀导致整体迁移时间较长,迁移效率较低。The current data migration method mainly adopts simple multi-threaded migration. The database of the original database is migrated by multi-threaded data according to the table or file strategy. The uneven data of different source tables or files leads to a long overall migration time and low migration efficiency. lower.
发明内容Contents of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics described in detail in this article. This summary is not intended to limit the scope of the claims.
本申请实施例提供一种数据迁移方法和装置、电子设备、存储介质。Embodiments of the present application provide a data migration method and device, electronic equipment, and a storage medium.
第一方面,本申请实施例提供一种数据迁移方法,应用于迁移端,所述方法包括:获取来自原始数据库的源数据;接收客户端发送的迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;根据所述数据属性参数生成迁移策略;根据所述迁移策略将所述源数据迁移到目的数据库。In the first aspect, the embodiment of the present application provides a data migration method, which is applied to the migration terminal. The method includes: obtaining source data from the original database; receiving migration request information sent by the client; the migration request information includes the A data attribute parameter of the source data; a migration strategy is generated according to the data attribute parameter; and the source data is migrated to a target database according to the migration strategy.
第二方面,本申请实施例提供一种数据迁移方法,应用于客户端,所述方法包括:获取迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;发送所述迁移请求信息给迁移端,以使所述迁移端执行本申请如上述第一方面所述的方法。In the second aspect, the embodiment of the present application provides a data migration method, which is applied to a client, and the method includes: obtaining migration request information; the migration request information includes the data attribute parameters of the source data; sending the migration request information to the migrating end, so that the migrating end executes the method described in the first aspect of the present application.
第三方面,本申请实施例提供一种数据迁移装置,用于迁移端,包括:源数据获取模块,被设置为获取来自原始数据库的源数据;迁移请求信息接收模块,被设置为接收客户端发送的迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;迁移策略生成模块,被设置为根据所述数据属性参数生成迁移策略;迁移模块,被设置为根据所述迁移策略将所述源数据迁移到目的数据库。In the third aspect, the embodiment of the present application provides a data migration device for the migration terminal, including: a source data acquisition module, configured to acquire source data from the original database; a migration request information receiving module, configured to receive the client The migration request information sent; the migration request information includes the data attribute parameters of the source data; the migration strategy generation module is configured to generate a migration strategy according to the data attribute parameters; the migration module is configured to generate a migration strategy according to the migration strategy Migrate the source data to the target database.
第四方面,本申请实施例提供一种数据迁移装置,用于客户端,包括:数据获取模块,被设置为获取迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;数据发送模块,被设置为发送所述迁移请求信息给迁移端,以使所述迁移端执行本申请如上述第一方面所述的方法。In a fourth aspect, an embodiment of the present application provides a data migration device for a client, including: a data acquisition module configured to acquire migration request information; the migration request information includes data attribute parameters of the source data; data The sending module is configured to send the migration request information to the migration end, so that the migration end executes the method described in the first aspect of the present application.
第五方面,本申请实施例提供一种电子设备,包括:至少一个存储器;至少一个处理器;至少一个程序;所述程序被存储在存储器中,处理器执行所述至少一个程序以实现:本申请如上述第一方面所述的方法;或,如上述第二方面所述的方法。In the fifth aspect, the embodiment of the present application provides an electronic device, including: at least one memory; at least one processor; at least one program; the program is stored in the memory, and the processor executes the at least one program to realize: Apply the method as described in the first aspect above; or, the method as described in the second aspect above.
第六方面,本申请实施例提供一种存储介质,该存储介质是计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行: 如上述第一方面所述的方法;或,如上述第二方面所述的方法。可以理解的是,上述第二方面至第六方面与相关技术相比存在的有益效果与上述第一方面与相关技术相比存在的有益效果相同,可以参见上述第一方面中的相关描述,在此不再赘述。In a sixth aspect, the embodiment of the present application provides a storage medium, the storage medium is a computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer perform: The method as described in the first aspect above; or, the method as described in the second aspect above. It can be understood that the beneficial effects of the above-mentioned second aspect to the sixth aspect compared with the related technology are the same as those of the above-mentioned first aspect compared with the related technology. Please refer to the relevant description in the above-mentioned first aspect. This will not be repeated here.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the embodiments or related technical descriptions. Obviously, the drawings in the following description are only the embodiments of the present application For some embodiments of the present invention, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.
图1是本申请实施例提供的数据迁移方法的系统架构的示意图。FIG. 1 is a schematic diagram of a system architecture of a data migration method provided by an embodiment of the present application.
图2是本申请实施例提供的数据迁移方法的流程图。FIG. 2 is a flowchart of a data migration method provided by an embodiment of the present application.
图3是本申请另一实施例提供的数据迁移方法的流程图。Fig. 3 is a flowchart of a data migration method provided by another embodiment of the present application.
图4是本申请另一实施例提供的数据迁移方法的流程图。Fig. 4 is a flowchart of a data migration method provided by another embodiment of the present application.
图5是本申请另一实施例提供的数据迁移方法的流程图。Fig. 5 is a flowchart of a data migration method provided by another embodiment of the present application.
图6是本申请另一实施例提供的数据迁移方法的流程图。Fig. 6 is a flowchart of a data migration method provided by another embodiment of the present application.
图7是本申请另一实施例提供的数据迁移方法的流程图。FIG. 7 is a flowchart of a data migration method provided by another embodiment of the present application.
图8是本申请另一实施例提供的数据迁移方法的流程图。Fig. 8 is a flowchart of a data migration method provided by another embodiment of the present application.
图9是本申请另一实施例提供的数据迁移方法的流程图。FIG. 9 is a flowchart of a data migration method provided by another embodiment of the present application.
图10是本申请另一实施例提供的数据迁移方法的流程图。Fig. 10 is a flowchart of a data migration method provided by another embodiment of the present application.
图11是本申请另一实施例提供的数据迁移方法的流程图。FIG. 11 is a flowchart of a data migration method provided by another embodiment of the present application.
图12是本申请另一实施例提供的数据迁移方法的流程图。Fig. 12 is a flowchart of a data migration method provided by another embodiment of the present application.
图13是本申请另一实施例提供的数据迁移方法的流程图。Fig. 13 is a flowchart of a data migration method provided by another embodiment of the present application.
图14是本申请另一实施例提供的数据迁移方法的流程图。Fig. 14 is a flowchart of a data migration method provided by another embodiment of the present application.
图15是本申请另一实施例提供的数据迁移方法的流程图。Fig. 15 is a flowchart of a data migration method provided by another embodiment of the present application.
图16是本申请实施例提供的数据迁移方法的原理示意图。FIG. 16 is a schematic diagram of the principle of the data migration method provided by the embodiment of the present application.
图17是本申请实施例提供的数据迁移模块的示意图。FIG. 17 is a schematic diagram of a data migration module provided by an embodiment of the present application.
图18是本申请另一实施例提供的数据迁移模块的示意图。Fig. 18 is a schematic diagram of a data migration module provided by another embodiment of the present application.
附图标记:原始数据库100、客户端110、迁移端120、策略优化模块121、数据导出模块122、数据导入模块123、结果输出模块124、目的数据库130、源数据获取模块1710、迁移请求信息接收模块1720、迁移策略生成模块1730、迁移模块1740、数据获取模块1810、数据发送模块1820。Reference numerals: original database 100, client 110, migration terminal 120, strategy optimization module 121, data export module 122, data import module 123, result output module 124, destination database 130, source data acquisition module 1710, migration request information reception Module 1720 , migration policy generation module 1730 , migration module 1740 , data acquisition module 1810 , and data sending module 1820 .
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些细节的其它实施例中也可以实现本申请实施例。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请实施例的描述。In the following description, for the purpose of illustration rather than limitation, details such as specific system structures and technologies are presented so as to thoroughly understand the embodiments of the present application. However, it should be apparent to those skilled in the art that the embodiments of the present application can also be practiced in other embodiments without these details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the embodiments of the present application with unnecessary detail.
需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than in the flowchart. The terms "first", "second" and the like in the specification and claims and the above drawings are used to distinguish similar objects, and not necessarily used to describe a specific sequence or sequence.
还应当理解,在本申请实施例说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请实施例的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个 或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。It should also be understood that references to "one embodiment" or "some embodiments" described in the description of the embodiments of the present application mean that specific features described in conjunction with the embodiments of the present application are included in one or more embodiments of the embodiments of the present application. , structure or characteristics. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
数据库(Database,DB)是按照数据结构来组织、存储和管理数据的仓库,是一个长期存储在计算机内的、有组织的、可共享的、统一管理的大量数据的集合。数据库管理系统(Database Management System,DBMS)是一种操纵和管理数据库的大型软件,用于建立、使用和维护数据库。它对数据库进行统一的管理和控制,以保证数据库的安全性和完整性。数据迁移(Data Migration,DM)一般是指将旧数据库管理系统的源数据转换迁移到新数据库管理系统中的过程。数据迁移工具是保证数据的完整性和一致性,有效完成数据库系统替换升级的重要辅助工具。Database (Database, DB) is a warehouse that organizes, stores and manages data according to the data structure. It is a collection of large amounts of data stored in a computer for a long time, organized, shareable, and uniformly managed. Database Management System (DBMS) is a large-scale software for manipulating and managing databases, used to create, use and maintain databases. It manages and controls the database in a unified way to ensure the security and integrity of the database. Data migration (Data Migration, DM) generally refers to the process of converting and migrating the source data of the old database management system to the new database management system. The data migration tool is an important auxiliary tool to ensure the integrity and consistency of the data and effectively complete the replacement and upgrade of the database system.
分布式数据库指常使用较小的计算机系统,每台计算机可单独放在一个地方,每台计算机中都可能有DBMS的一份完整拷贝副本,或者部分拷贝副本,并具有自己局部的数据库,位于不同地点的许多计算机通过网络互相连接,共同组成一个完整的、全局的逻辑上集中、物理上分布的大型数据库。Distributed database refers to the use of smaller computer systems, each computer can be placed in a separate place, each computer may have a complete copy of the DBMS, or a partial copy of the copy, and has its own local database, located in Many computers in different locations are connected to each other through the network to form a complete and global logically centralized and physically distributed large database.
信息业务的发展带来了数据量的与日俱增,数据库在信息系统中承担着不可或缺的数据桥梁作用。例如,分布式数据库是用计算机网络将物理上分散的多个数据库单元连接起来组成的一个逻辑上统一的数据库,有着存储量大、业务并发量高、可扩展性好的特点,故其应用日益广泛。在分布式数据库的应用场景中,数据的跨数据库迁移是常见操作,这对可靠的数据迁移技术提出了更高的要求。The development of information services has brought about an increasing amount of data, and databases play an indispensable role as a data bridge in information systems. For example, a distributed database is a logically unified database composed of multiple physically dispersed database units connected by a computer network. It has the characteristics of large storage capacity, high concurrent business volume, and good scalability, so its application is increasingly widely. In the application scenarios of distributed databases, cross-database migration of data is a common operation, which puts forward higher requirements for reliable data migration technology.
当前的数据迁移方法主要采取的迁移方式是简单多线程迁移,将原始数据库的数据库按照表或者文件策略进行多线程数据迁移,处理海量数据的迁移效率上依然达不到期望,不同源表或文件的数据不均匀导致整体迁移时间较长,迁移效率较低。The current data migration method mainly adopts simple multi-threaded migration. The database of the original database is migrated by multi-threaded data according to the table or file strategy. The migration efficiency of processing massive data is still not up to expectations. Different source tables or files The unevenness of the data leads to a long overall migration time and low migration efficiency.
除此之外,当前的数据迁移方法没有考虑跨数据库字段类型转换的处理,导致数据迁移准确度降低;当前的数据迁移方法主要适用于一般数据库数据迁移场景,不能实现对分布式数据库的数据迁移,更没有考虑数据在分布式数据库上的分发和分布问题,在客户对数据库系统进行替换升级时,亟待需要在短期内完成Oracle数据库海量数据向新型分布式数据库迁移问题。同时,也不能实现对部分数据的选择迁移,因此数据迁移的灵活性很差。In addition, the current data migration method does not consider the processing of cross-database field type conversion, resulting in a decrease in the accuracy of data migration; the current data migration method is mainly applicable to general database data migration scenarios, and cannot realize data migration to distributed databases , and did not consider the distribution and distribution of data on the distributed database. When the customer replaces and upgrades the database system, it is urgent to complete the migration of massive data from the Oracle database to the new distributed database in a short period of time. At the same time, selective migration of some data cannot be realized, so the flexibility of data migration is very poor.
基于此,本公开实施例提供一种数据迁移方法和装置、电子设备、存储介质,在迁移端,获取来自原始数据库的源数据,接收客户端发送的迁移请求信息,其中迁移请求信息包括源数据的数据属性参数,并根据数据属性参数生成迁移策略,进而根据迁移策略将源数据迁移到目的数据库,在客户端,获取迁移请求信息,并发送给迁移端使其完成迁移任务,通过本申请实施例提供的技术方案可以实现对数据库多进程多线程的迁移,避免了因数据不均匀而导致的迁移时长较大的问题,提升了数据迁移的效率;实现了跨数据库字段类型转换的处理,提升了数据迁移准确度;实现了对分布式数据库的数据迁移,考虑了数据在分布式数据库上的分发和分布问题,同时实现对部分数据的选择迁移,提升了数据迁移的灵活性。Based on this, an embodiment of the present disclosure provides a data migration method and device, electronic equipment, and a storage medium. At the migration end, the source data from the original database is obtained, and the migration request information sent by the client is received, wherein the migration request information includes the source data According to the data attribute parameters, a migration strategy is generated according to the data attribute parameters, and then the source data is migrated to the destination database according to the migration strategy. On the client side, the migration request information is obtained and sent to the migration end to complete the migration task. This application is implemented The technical solution provided by the example can realize the multi-process and multi-thread migration of the database, avoid the problem of long migration time caused by uneven data, and improve the efficiency of data migration; realize the processing of cross-database field type conversion, improve It improves the accuracy of data migration; realizes data migration to distributed databases, considers the distribution and distribution of data on distributed databases, and realizes the selective migration of some data at the same time, which improves the flexibility of data migration.
本公开实施例提供数据迁移方法和装置、电子设备、存储介质,通过如下实施例进行说明,首先描述本公开实施例中的数据迁移方法。Embodiments of the present disclosure provide a data migration method and device, electronic equipment, and a storage medium, which are described through the following embodiments. First, the data migration method in the embodiments of the present disclosure is described.
下面结合附图,对本申请实施例作进一步阐述。The embodiments of the present application will be further described below in conjunction with the accompanying drawings.
如图1所示,图1是本申请一个实施例提供的数据迁移方法的系统架构的示意图。在图1中,该系统架构包括原始数据库100、客户端110、迁移端120、目的数据库130,其中,迁移端120包括策略优化模块121、数据导出模块122、数据导入模块123、结果输出模块124。As shown in FIG. 1 , FIG. 1 is a schematic diagram of a system architecture of a data migration method provided by an embodiment of the present application. In Fig. 1, the system architecture includes an original database 100, a client 110, a migration terminal 120, and a destination database 130, wherein the migration terminal 120 includes a strategy optimization module 121, a data export module 122, a data import module 123, and a result output module 124 .
其中,原始数据库100与数据导出模块连接,客户端110与策略优化模块121连接,策略优化模块121与数据导出模块122连接,数据导出模块122与数据导入模块123连接,数据导入模块123与目的数据库130连接,结果输出模块124分别与数据导出模块122和数据导入模块123连接。Wherein, the original database 100 is connected with the data export module, the client 110 is connected with the strategy optimization module 121, the strategy optimization module 121 is connected with the data export module 122, the data export module 122 is connected with the data import module 123, and the data import module 123 is connected with the target database 130, and the result output module 124 is connected to the data export module 122 and the data import module 123 respectively.
在本实施例中,原始数据库100为待进行数据迁移的数据库,客户端110被设置为发送迁移请求信息给策略优化模块121,以使策略优化模块121能够根据迁移请求信息生成迁移 策略,进而根据迁移策略在数据导出模块122对原始数据库100中的数据进行数据导出,得到中间文件,再根据迁移策略在数据导入模块123进行数据导入,将中间文件分发导入到目的数据库130中,完成迁移过程。另外,结果输出模块124通过对数据导出模块122中的中间文件,和数据导入模块123中的迁移过程文件进行记录以生成迁移结果报告文件,实现对迁移结果的记录。In this embodiment, the original database 100 is a database to be migrated, and the client 110 is set to send migration request information to the strategy optimization module 121, so that the strategy optimization module 121 can generate a migration strategy according to the migration request information, and then according to The data in the original database 100 is exported by the migration strategy in the data export module 122 to obtain an intermediate file, and then the data is imported in the data import module 123 according to the migration strategy, and the intermediate file is distributed and imported into the destination database 130 to complete the migration process. In addition, the result output module 124 records the intermediate file in the data export module 122 and the migration process file in the data import module 123 to generate a migration result report file, so as to record the migration result.
在一实施例中,目标数据库130为分布式数据库平台,迁移端120为导入服务平台,如Oraclecap平台。其中,分布式数据库平台是现有分布式数据库的实体与核心,主要负责数据存储与系统状态的管理和监控;数据导入服务平台Oraclecap提供从oralce数据库中将数据导出到CSV文件中,再通过CSV文件导入到内部分布式数据库系统中。In one embodiment, the target database 130 is a distributed database platform, and the migration terminal 120 is an import service platform, such as an Oraclecap platform. Among them, the distributed database platform is the entity and core of the existing distributed database, which is mainly responsible for the management and monitoring of data storage and system status; the data import service platform Oraclecap provides data export from the oral database to CSV files, and then through CSV The files are imported into the internal distributed database system.
本申请实施例描述的系统架构以及应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域技术人员可知,随着系统架构的演变和新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute limitations on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the system architecture The evolution of the technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
本领域技术人员可以理解的是,图1中示出的系统架构并不构成对本申请实施例的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the system architecture shown in Figure 1 does not constitute a limitation to the embodiment of the present application, and may include more or less components than those shown in the illustration, or combine some components, or different components layout.
在图1所示的系统架构中,各个设备可以分别调用其储存的数据迁移程序,以执行数据迁移方法。In the system architecture shown in FIG. 1 , each device can call its stored data migration program to execute the data migration method.
基于上述系统架构,提出本申请实施例的数据迁移方法的各个实施例。Based on the above system architecture, various embodiments of the data migration method according to the embodiments of the present application are proposed.
本申请实施例提供一种数据迁移方法,应用于迁移端,方法包括:获取来自原始数据库的源数据;接收客户端发送的迁移请求信息;迁移请求信息包括源数据的数据属性参数;根据数据属性参数生成迁移策略;根据迁移策略将源数据迁移到目的数据库。The embodiment of the present application provides a data migration method, which is applied to the migration terminal. The method includes: obtaining the source data from the original database; receiving the migration request information sent by the client; the migration request information includes the data attribute parameters of the source data; according to the data attribute Parameters generate a migration strategy; migrate the source data to the destination database according to the migration strategy.
在一实施方式中,数据属性参数包括以下的一种或多种:表数量参数、或表数据量参数、或行数量参数。In one embodiment, the data attribute parameters include one or more of the following: table quantity parameters, or table data quantity parameters, or row quantity parameters.
如图2所示,图2是本申请一个实施例提供的数据迁移方法的流程图,该数据迁移方法应用于迁移端,例如应用于如图1所示实施例中的迁移端120中,该数据迁移方法包括但不限于有步骤S210和步骤S240。As shown in Figure 2, Figure 2 is a flow chart of a data migration method provided by an embodiment of the present application, the data migration method is applied to the migration end, for example, it is applied to the migration end 120 in the embodiment shown in Figure 1, the The data migration method includes but not limited to step S210 and step S240.
S210,获取来自原始数据库的源数据;S210, acquire source data from the original database;
S220,接收客户端发送的迁移请求信息;迁移请求信息包括源数据的数据属性参数;S220. Receive migration request information sent by the client; the migration request information includes data attribute parameters of source data;
S230,根据数据属性参数生成迁移策略;S230, generating a migration strategy according to the data attribute parameter;
S240,根据迁移策略将源数据迁移到目的数据库。S240. Migrate the source data to the target database according to the migration strategy.
在步骤S210中,源数据为原始数据库中的数据,原始数据库直接与迁移端连接,用于将源数据发送至迁移端,用于迁移端对源数据进行迁移。In step S210, the source data is data in the original database, and the original database is directly connected to the migration end for sending the source data to the migration end for the migration end to migrate the source data.
在步骤S220中,迁移请求信息用于客户端向迁移端传递与迁移过程相关的命令和参数,以使迁移平台根据上述命令和参数对源数据进行迁移处理。其中,与迁移过程相关的命令和参数包括但不限于数据属性参数、权限认证请求。In step S220, the migration request information is used by the client to transmit commands and parameters related to the migration process to the migration end, so that the migration platform performs migration processing on the source data according to the above commands and parameters. Wherein, the commands and parameters related to the migration process include but are not limited to data attribute parameters and authority authentication requests.
在步骤S230中,数据属性参数包括但不限于以下的一种或多种:表数量参数、或表数据量参数、或行数量参数,在实施例中,表数量参数表征源数据中数据表的数量,表数据量参数表征源数据中数据表的大小,行数量参数表征每行数据的设置值。数据属性参数既可以用于生成迁移策略,又可以用于在导出和导入过程中对数据进行处理。In step S230, the data attribute parameters include but are not limited to one or more of the following: table quantity parameters, or table data quantity parameters, or row quantity parameters. In an embodiment, the table quantity parameters represent the data table in the source data Quantity, the table data quantity parameter represents the size of the data table in the source data, and the row quantity parameter represents the setting value of each row of data. Data attribute parameters can be used both to generate migration strategies and to manipulate data during export and import.
在步骤S240中,依据步骤S230生成的迁移策略,指导迁移端对源数据进行迁移,使得数据合理地、高效地导入到目的数据库中。In step S240, according to the migration strategy generated in step S230, the migration terminal is instructed to migrate the source data, so that the data can be imported into the target database reasonably and efficiently.
本申请提供的数据迁移方法,在迁移端,获取来自原始数据库的源数据,接收客户端发送的迁移请求信息,其中迁移请求信息包括源数据的数据属性参数,并根据数据属性参数生成迁移策略,进而根据迁移策略将源数据迁移到目的数据库,通过本申请实施例提供的技术方案可以实现对数据库多进程多线程的迁移,避免了因数据不均匀而导致的迁移时长较大的问题,提升了数据迁移的效率;实现了跨数据库字段类型转换的处理,提升了数据迁移准确 度;实现了对分布式数据库的数据迁移,考虑了数据在分布式数据库上的分发和分布问题,同时实现对部分数据的选择迁移,提升了数据迁移的灵活性。In the data migration method provided by this application, at the migration end, the source data from the original database is obtained, and the migration request information sent by the client is received, wherein the migration request information includes the data attribute parameters of the source data, and a migration strategy is generated according to the data attribute parameters, Furthermore, the source data is migrated to the destination database according to the migration strategy. Through the technical solution provided by the embodiment of the present application, the multi-process and multi-thread migration of the database can be realized, which avoids the problem of long migration time caused by uneven data, and improves the The efficiency of data migration; realize the processing of cross-database field type conversion, improve the accuracy of data migration; realize the data migration to distributed databases, consider the distribution and distribution of data on distributed databases, and realize the partial Selective migration of data improves the flexibility of data migration.
另外,本申请提供的数据迁移方法只是对源数据进行导出和导入操作,不会对原始数据库环境造成破坏,也保证了目的数据库的数据有效性。In addition, the data migration method provided in this application is only to export and import the source data, which will not cause damage to the original database environment, and also ensures the data validity of the target database.
在一实施方式中,迁移策略包括导出策略、导入策略;根据迁移策略将源数据迁移到目的数据库,包括:根据导出策略将源数据转化为中间文件;根据导入策略将中间文件迁移到目的数据库。In one embodiment, the migration strategy includes an export strategy and an import strategy; migrating the source data to the destination database according to the migration strategy includes: converting the source data into an intermediate file according to the export strategy; and migrating the intermediate file to the destination database according to the import strategy.
另外,在一实施例中,参照图3,步骤S240可以包括但不限于有以下步骤:In addition, in an embodiment, referring to FIG. 3, step S240 may include but not limited to the following steps:
S310,根据导出策略将源数据转化为中间文件;S310, converting the source data into an intermediate file according to the export policy;
S320,根据导入策略将中间文件迁移到目的数据库。S320. Migrate the intermediate file to the destination database according to the import policy.
在一实施例中,迁移端先对源数据进行导出,依据导出策略使得数据均匀化,生成中间文件,进而再对中间文件依据导入策略进行数据分发,完成数据到目的数据库的迁移工作,实现了对分布式数据库的数据迁移,避免了因数据不均匀而导致的迁移时长较大的问题,提升了数据迁移的效率,使得针对各种数据库之间的数据迁移需求具有一定的适配性和可扩展性。In one embodiment, the migration terminal first exports the source data, homogenizes the data according to the export strategy, generates an intermediate file, and then distributes the data to the intermediate file according to the import strategy, and completes the migration of the data to the destination database. The data migration of distributed databases avoids the problem of long migration time caused by uneven data, improves the efficiency of data migration, and makes the data migration requirements between various databases have certain adaptability and reliability. scalability.
在一实施方式中,导出策略包括导出进线程策略;根据导出策略将源数据转化为中间文件,包括:根据数据属性参数配置导出进程数量和导出线程数量;根据导出进程数量、导出线程数量和数据属性参数,将数据均匀分配到对应导出线程进行数据导出,生成中间文件。In one embodiment, the export strategy includes export-in thread strategy; converting the source data into an intermediate file according to the export strategy, including: configuring the number of export processes and the number of export threads according to the data attribute parameters; according to the number of export processes, the number of export threads and the data Attribute parameters, evenly distribute the data to the corresponding export threads for data export, and generate intermediate files.
另外,在一实施例中,参照图4,步骤S310可以包括但不限于有以下步骤:In addition, in an embodiment, referring to FIG. 4, step S310 may include but not limited to the following steps:
S410,根据数据属性参数配置导出进程数量和导出线程数量;S410, configure the number of export processes and the number of export threads according to the data attribute parameters;
S420,根据导出进程数量、导出线程数量和数据属性参数,将数据均匀分配到对应导出线程进行数据导出,生成中间文件。S420. According to the number of export processes, the number of export threads, and the data attribute parameters, evenly distribute the data to corresponding export threads for data export, and generate an intermediate file.
在步骤S410中,数据属性参数包括但不限于表数量参数、表数据量参数,在实施例中,表数量参数表征源数据中数据表的数量,表数据量参数表征源数据中数据表的大小,行数量参数表征每行数据的设置值。In step S410, the data attribute parameters include but are not limited to table quantity parameters and table data volume parameters. In the embodiment, the table quantity parameter represents the number of data tables in the source data, and the table data volume parameter represents the size of the data tables in the source data , the number of rows parameter represents the setting value of each row of data.
在一些实施例中,针对表数量参数为700、表数据量参数为100亿的数据,配置导出进程数量为5,导出线程数量为20。其中,表数量参数为700表示数据中心有700个表,表数据量参数为100亿表示数据中有100亿条数据。In some embodiments, for data whose table number parameter is 700 and table data volume parameter is 10 billion, the number of export processes is configured to be 5, and the number of export threads is configured to be 20. Among them, the table number parameter is 700 means that the data center has 700 tables, and the table data volume parameter is 10 billion means that there are 10 billion pieces of data in the data.
在步骤S420中,数据属性参数包括行数量参数,在一些实施例中,行数量参数为100万,表示在数据导出过程中将固定数据行设置为100万行数据,针对表数据的固定数据行进行拆分线程,实现了并发导出并生成中间文件。In step S420, the data attribute parameter includes a row number parameter. In some embodiments, the row number parameter is 1 million, indicating that the fixed data row is set to 1 million rows of data during the data export process, and the fixed data row of the table data Split threads, realize concurrent export and generate intermediate files.
需要说明的是,表数量参数、表数据量参数和行数量参数的设定可以根据源数据的不同而改变,能达到相应的技术效果即可。It should be noted that the setting of the table quantity parameter, the table data quantity parameter and the row quantity parameter can be changed according to different source data, as long as the corresponding technical effect can be achieved.
在一实施方式中,导出策略包括数据落盘策略,根据导出策略将源数据转化为中间文件,包括:获取预设的文件划分规则;文件划分规则包括生成每一中间文件的数据量数或数据行数;根据文件划分规则,将源数据对应导出为至少一个中间文件。In one embodiment, the export strategy includes a data placement strategy, and converting the source data into an intermediate file according to the export strategy includes: obtaining a preset file division rule; the file division rule includes generating the data volume or data of each intermediate file The number of rows; according to the file division rules, the source data is correspondingly exported as at least one intermediate file.
另外,在一实施例中,参照图5,步骤S310可以包括但不限于有以下步骤:In addition, in an embodiment, referring to FIG. 5, step S310 may include but not limited to the following steps:
S510,获取预设的文件划分规则;S510, acquiring a preset file division rule;
S520,根据文件划分规则,将源数据对应导出为至少一个中间文件。S520. Correspondingly export the source data into at least one intermediate file according to the file division rule.
在步骤S510中,文件划分规则包括生成每一中间文件的数据量数或数据行数,在一些实施例中,生成每一中间文件的数据量数为64M,生成每一中间文件的数据行数为10万行,需要说明的是,生成每一中间文件的数据量数或数据行数的设定可以根据源数据的不同而改变,能达到相应的技术效果即可。In step S510, the file division rule includes generating the data volume or data row number of each intermediate file, in some embodiments, generating the data volume number of each intermediate file is 64M, generating the data row number of each intermediate file It is 100,000 lines. It should be noted that the setting of the amount of data or the number of data lines for generating each intermediate file can be changed according to the source data, as long as the corresponding technical effect can be achieved.
在步骤S520中,根据文件划分规则,将源数据对应导出为至少一个中间文件,完成数据落盘的过程,实现了数据的均匀化导出,为数据的快速导入提供了准备条件,也能便于在导出过程进行文件的格式转换,此外,生成的中间文件除了用于数据迁移过程之外,还可以用 于迁移结果报告文件的生成,以实现对迁移结果的分析和记录。In step S520, according to the file division rules, the source data is correspondingly exported into at least one intermediate file, the process of data storage is completed, and the uniform export of data is realized, which provides preparatory conditions for the rapid import of data, and can also facilitate The export process converts the format of the file. In addition, the generated intermediate file can be used not only for the data migration process, but also for the generation of the migration result report file, so as to realize the analysis and recording of the migration result.
在一实施方式中,导入策略包括导入进线程策略;根据导入策略将中间文件迁移到目的数据库,包括:根据数据属性参数配置导入进程数量和导入线程数量;根据导入进程数量、导入线程数量和数据属性参数,将数据均匀分配到对应导入线程进行数据导入,将中间文件迁移到目的数据库。In one embodiment, the import strategy includes import thread strategy; the intermediate file is migrated to the destination database according to the import strategy, including: configuring the number of import processes and the number of import threads according to the data attribute parameters; according to the number of import processes, the number of import threads and the data Attribute parameters, evenly distribute the data to the corresponding import threads for data import, and migrate the intermediate files to the destination database.
另外,在一实施例中,参照图6,步骤S320可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 6, step S320 may include but not limited to the following steps:
S610,根据数据属性参数配置导入进程数量和导入线程数量;S610, configuring the number of import processes and the number of import threads according to the data attribute parameters;
S620,根据导入进程数量、导入线程数量和数据属性参数,将数据均匀分配到对应导入线程进行数据导入,将中间文件迁移到目的数据库。S620. According to the number of import processes, the number of import threads and the data attribute parameters, evenly distribute the data to the corresponding import threads for data import, and migrate the intermediate files to the destination database.
在步骤S610中,数据属性参数包括但不限于表数量参数、表数据量参数,在一些实施例中,表数量参数表征中间文件中数据表的数量,表数据量参数表征源数据中数据表的大小,行数量参数表征每行数据的设置值。In step S610, the data attribute parameters include but are not limited to table number parameters and table data volume parameters. In some embodiments, the table number parameters represent the number of data tables in the intermediate file, and the table data volume parameters represent the number of data tables in the source data. The size, number of rows parameter characterizes the setting value of each row of data.
在一些实施例中,针对表数量参数为700、表数据量参数为100亿的数据,配置导入进程数量为5,导入线程数量为20。其中,表数量参数为700表示数据中心有700个表,表数据量参数为100亿表示数据中有100亿条数据。In some embodiments, for data whose table number parameter is 700 and table data volume parameter is 10 billion, the number of import processes is configured to be 5 and the number of import threads to be 20. Among them, the table number parameter is 700 means that the data center has 700 tables, and the table data volume parameter is 10 billion means that there are 10 billion pieces of data in the data.
在步骤S420中,数据属性参数包括行数量参数,在一些实施例中,行数量参数为5000条,表示文件数据每5000条进行拆分线程,针对表数据的固定数据行进行拆分线程,实现了对目的数据库的并发导入。In step S420, the data attribute parameter includes a row quantity parameter. In some embodiments, the row quantity parameter is 5000, indicating that the file data is divided into threads every 5000 pieces, and the fixed data rows of the table data are split into threads to realize Concurrent imports to the destination database.
需要说明的是,表数量参数、表数据量参数和行数量参数的设定可以根据源数据的不同而改变,能达到相应的技术效果即可。It should be noted that the setting of the table quantity parameter, the table data quantity parameter and the row quantity parameter can be changed according to different source data, as long as the corresponding technical effect can be achieved.
在一实施方式中,根据数据属性参数生成迁移策略,包括:根据表数量参数和表数据量参数进行预测处理,得到中间参数;根据中间参数生成导入进线程策略。In one embodiment, generating the migration strategy according to the data attribute parameters includes: performing prediction processing according to the table quantity parameter and the table data quantity parameter to obtain intermediate parameters; and generating an import thread strategy according to the intermediate parameters.
另外,在一实施例中,参照图7,步骤S230可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 7, step S230 may include but not limited to the following steps:
S710,根据表数量参数和表数据量参数进行预测处理,得到中间参数;S710, performing prediction processing according to the table quantity parameter and the table data quantity parameter, to obtain intermediate parameters;
S720,根据中间参数生成导入进线程策略。S720. Generate an imported thread policy according to the intermediate parameter.
在步骤S710中,迁移策略的生成在数据导出之前完成,包括导出策略和导入策略,因为导入策略的生成需要依赖中间文件的数据表数量和数据量大小,因此需要在数据导入之前根据源数据的数据体量情况对中间文件的规模进行预测,得到中间参数,用于导入进线程策略的生成,其中,中间参数包括但不限于预测得到的中间文件的表数量参数和表数据量参数。In step S710, the generation of the migration strategy is completed before the data export, including the export strategy and the import strategy, because the generation of the import strategy needs to depend on the number of data tables and the size of the data in the intermediate file, so it needs to be based on the source data before data import. The size of the data volume predicts the size of the intermediate file to obtain intermediate parameters for importing into the generation of the thread strategy, wherein the intermediate parameters include but are not limited to the table quantity parameters and table data volume parameters of the predicted intermediate files.
需要说明的是,步骤S710中的预测过程包括但不限于人工预测、机器学习预测。其中,人工预测是由工作人员根据以往的数据迁移的经验,根据源文件的体量对生成的中间文件的规模进行预测,得到中间参数,并输入在系统中;而机器预测包括利用机器学习、深度学习等手段,通过历史的配置数据来对预测模型进行训练,利用预测模型实现对中间参数的预测过程。It should be noted that the prediction process in step S710 includes but is not limited to manual prediction and machine learning prediction. Among them, manual prediction is based on the staff's previous experience in data migration and the size of the generated intermediate file based on the size of the source file to predict the size of the generated intermediate file, obtain intermediate parameters, and input it into the system; machine prediction includes the use of machine learning, Deep learning and other methods train the prediction model through historical configuration data, and use the prediction model to realize the prediction process of intermediate parameters.
在步骤S720中,预测得到中间参数之后,就利用中间参数对导入进线程策略进行配置,其配置的原理同根据数据属性参数对导出进线程策略配置的原理相同。In step S720, after the intermediate parameters are predicted, the imported thread policy is configured using the intermediate parameters. The principle of the configuration is the same as the principle of configuring the exported thread policy according to the data attribute parameters.
在一实施方式中,目的数据库包括多个分区;导入策略包括数据分发策略;根据导入策略将中间文件迁移到目的数据库,包括:获取分发键信息;根据分发键信息,获取与分发键信息相匹配的中间文件;将中间文件迁移到目的数据库对应的分区。In one embodiment, the destination database includes multiple partitions; the import strategy includes a data distribution strategy; migrating the intermediate file to the destination database according to the import strategy includes: obtaining distribution key information; according to the distribution key information, obtaining and matching the distribution key information The intermediate file; migrate the intermediate file to the corresponding partition of the destination database.
在一实施方式中,分发键信息至少包括以下任一种:连续区间分发键、或枚举值分发键、或分区分发键。In an embodiment, the distribution key information includes at least any one of the following: a continuous interval distribution key, an enumeration value distribution key, or a partition distribution key.
另外,在一实施例中,参照图8,步骤S320可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 8, step S320 may include but not limited to the following steps:
S810,获取分发键信息;S810, acquiring distribution key information;
S820,根据分发键信息,获取与分发键信息相匹配的中间文件;S820. According to the distribution key information, obtain an intermediate file matching the distribution key information;
S830,将中间文件迁移到目的数据库对应的分区。S830. Migrate the intermediate file to a partition corresponding to the destination database.
在步骤S810中,分发键信息用于表征对不同类型数据表的数据分发类型,分发键信息包 括至少包括以下任一种:连续区间分发键、或枚举值分发键、或分区分发键,其中,连续区间分发键包括但不限于RANGE,基于一个给定连续区间范围把数据分配到不同的分区;枚举值分发键包括但不限于LIST,基于枚举出的值列表分区;分区分发键包括但不限于HASH,基于给定的分区个数,把数据分配到不同的分区。In step S810, the distribution key information is used to characterize the data distribution type for different types of data tables, and the distribution key information includes at least any of the following: continuous interval distribution key, or enumerated value distribution key, or partition distribution key, Among them, the continuous interval distribution key includes but is not limited to RANGE, which assigns data to different partitions based on a given continuous interval range; the enumerated value distribution key includes but is not limited to LIST, which partitions based on the enumerated value list; partition distribution Keys include but are not limited to HASH, which assigns data to different partitions based on a given number of partitions.
需要说明的是,分发键信息的获取方式有两种,分别为直接获取和间接获取,对于基础数据来说,可以通过基础数据表的属性直接匹配得到其对应的分发键信息;对于业务数据来说,需要依赖利用基础数据来进行分发键的选择。It should be noted that there are two ways to obtain distribution key information, namely direct acquisition and indirect acquisition. For basic data, the corresponding distribution key information can be obtained by directly matching the attributes of the basic data table; for business data In other words, you need to rely on the use of basic data for the selection of distribution keys.
在步骤S820至S830中,分发键信息有着各自的分发规则,分发键信息的核心原理就是依据不同的分发规则,将匹配到的中间文件迁移到目的数据库对应的分区,实现了在目的数据库上的分发,将业务相关的数据分发到相同的数据库单元中,使得数据迁移后数据分布合理均匀,提升了数据迁移的灵活性。In steps S820 to S830, the distribution key information has its own distribution rules. The core principle of the distribution key information is to migrate the matched intermediate files to the corresponding partitions of the destination database according to different distribution rules, thus realizing the distribution on the destination database. Distribution, which distributes business-related data to the same database unit, makes the data distribution reasonable and even after data migration, and improves the flexibility of data migration.
在一实施方式中,中间文件包括基础数据和业务数据,获取分发键信息,还包括:获取基础数据的优先级;根据优先级对基础数据进行排序处理,得到排序结果;根据排序结果进行关键字段查询匹配处理,得到与业务数据关联的基础数据;获取与业务数据关联的基础数据对应的分发键。In one embodiment, the intermediate file includes basic data and business data, and obtaining the distribution key information also includes: obtaining the priority of the basic data; sorting the basic data according to the priority to obtain the sorting result; sorting the key according to the sorting result Segment query matching processing to obtain the basic data associated with the business data; obtain the distribution key corresponding to the basic data associated with the business data.
另外,在一实施例中,参照图9,步骤S810可以包括但不限于有以下步骤:In addition, in an embodiment, referring to FIG. 9, step S810 may include but not limited to the following steps:
S910,获取基础数据的优先级;S910, acquiring the priority of the basic data;
S920,根据优先级对基础数据进行排序处理,得到排序结果;S920, sorting the basic data according to the priority to obtain a sorting result;
S930,根据排序结果进行关键字段查询匹配处理,得到与业务数据关联的基础数据;S930. Perform key field query and matching processing according to the sorting results to obtain basic data associated with the business data;
S940,获取与业务数据关联的基础数据对应的分发键。S940. Obtain a distribution key corresponding to the basic data associated with the service data.
在一些实施例中,中间文件包括基础数据和业务数据,基础数据包括但不限于基础信息表,业务数据包括但不限于业务信息表。在一些实施例中,基础信息表指存储用户基本信息等数据的表,具有被依赖和数据相对稳定的特点,其中,表的某些字段信息能够区分体现表数据特点,例如性别、籍贯等信息;业务表是用户在办理业务过程中产生的业务信息数据,与基础信息表有很高的关联性,一般关联一张或多张基础信息表的信息。In some embodiments, the intermediate file includes basic data and business data, the basic data includes but not limited to the basic information table, and the business data includes but not limited to the business information table. In some embodiments, the basic information table refers to a table that stores data such as user basic information, and has the characteristics of being dependent and relatively stable data. Among them, some field information of the table can distinguish and reflect the characteristics of the table data, such as gender, place of origin and other information ; The business table is the business information data generated by the user in the process of handling business, which has a high correlation with the basic information table, and is generally related to the information of one or more basic information tables.
在步骤S910中,基础数据的优先级是基础数据的属性之一,用于根据优先级进行查询匹配,以提前处理重要程度较高的基础数据,保证数据分发的可靠性。比如,基础表的优先级分别为:jc1、jc2、jc3。In step S910, the priority of the basic data is one of the attributes of the basic data, and is used for query matching according to the priority, so as to process the basic data with higher importance in advance and ensure the reliability of data distribution. For example, the priorities of the basic tables are: jc1, jc2, jc3.
在步骤S920至步骤S940中,针对业务数据按照基础信息表优先等级顺序循环进行关键字段的查询匹配,若匹配到基础信息表,则跳出循环匹配,将该基础信息表的分发键作为本业务表数据的分发键;若匹配不到基础信息表,将本业务表数据的分发键置为默认值,比如,默认值可以为hash(00001),其中,hash表明其分发键为HASH。From step S920 to step S940, query and match the key fields of the business data according to the priority order of the basic information table. The distribution key of the table data; if the basic information table cannot be matched, the distribution key of the business table data is set to the default value, for example, the default value can be hash(00001), where hash indicates that the distribution key is HASH.
在一实施方式中,迁移请求信息还包括平台运行环境信息,根据导出策略将源数据转化为中间文件,包括:根据平台运行环境信息生成格式转换策略;根据格式转换策略对源数据进行格式转化处理,得到目标格式数据;根据目标格式数据更新中间文件。In one embodiment, the migration request information also includes platform operating environment information, and converting the source data into an intermediate file according to the export strategy includes: generating a format conversion strategy according to the platform operating environment information; performing format conversion processing on the source data according to the format conversion strategy , get the target format data; update the intermediate file according to the target format data.
另外,在一实施例中,参照图10,步骤S310可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 10, step S310 may include but not limited to the following steps:
S1010,根据平台运行环境信息生成格式转换策略;S1010, generating a format conversion strategy according to the platform operating environment information;
S1020,根据格式转换策略对源数据进行格式转化处理,得到目标格式数据;S1020, performing format conversion processing on the source data according to the format conversion strategy to obtain target format data;
S1030,根据目标格式数据更新中间文件。S1030, updating the intermediate file according to the target format data.
在一些实施例中,完成导出过程之后,需要考虑中间文件的格式是否符合当前运行平台的要求,从而进行中间文件的格式转换,一般情况下,格式转换的过程发生在数据导出的过程中。In some embodiments, after the export process is completed, it is necessary to consider whether the format of the intermediate file meets the requirements of the current operating platform, so as to convert the format of the intermediate file. Generally, the process of format conversion occurs during the data export process.
在步骤S1010中,平台运行环境信息为迁移端当前使用的迁移平台的运行环境信息,格式转换策略为不同的平台运行环境于文件格式的对应关系,不同类型的平台对文件格式的要求不同,因此需要依据平台的特征对源数据的文件类型进行转换,以提升数据迁移的效率。In step S1010, the platform operating environment information is the operating environment information of the migration platform currently used by the migration terminal, and the format conversion strategy is the corresponding relationship between different platform operating environments and file formats. Different types of platforms have different requirements for file formats, so It is necessary to convert the file type of the source data according to the characteristics of the platform to improve the efficiency of data migration.
在步骤S1020至S1030中,目标格式数据包括但不限于CSV文件,需要说明的是,目标 格式数据的格式也可以依据其他平台或数据库的特征进行适应性调整,能达到相应的技术效果即可,比如将varchar2类型转换为varchar类型;或者number类型转换为decimal类型等。In steps S1020 to S1030, the target format data includes but is not limited to CSV files. It should be noted that the format of the target format data can also be adaptively adjusted according to the characteristics of other platforms or databases, as long as the corresponding technical effects can be achieved. For example, convert varchar2 type to varchar type; or convert number type to decimal type, etc.
在一实施方式中,迁移请求信息还包括数据筛选信息,根据数据属性参数生成迁移策略,包括:根据源数据、数据筛选信息进行数据源筛选处理,得到目标数据;根据目标数据的数据属性参数生成迁移策略;对应的,根据迁移策略将源数据迁移到目的数据库,包括:根据迁移策略将目标数据迁移到目的数据库。In one embodiment, the migration request information further includes data screening information, and generating a migration strategy according to data attribute parameters includes: performing data source screening processing according to source data and data screening information to obtain target data; generating Migration strategy; correspondingly, migrating the source data to the destination database according to the migration strategy, including: migrating the target data to the destination database according to the migration strategy.
另外,在一实施例中,参照图11,步骤S230可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 11, step S230 may include but not limited to the following steps:
S1110,根据源数据、数据筛选信息进行数据源筛选处理,得到目标数据;S1110. Perform data source screening processing according to the source data and data screening information to obtain target data;
S1120,根据目标数据的数据属性参数生成迁移策略;S1120, generating a migration strategy according to the data attribute parameters of the target data;
对应的,步骤S240可以包括但不限于有以下步骤:Correspondingly, step S240 may include but not limited to the following steps:
S1130,根据迁移策略将目标数据迁移到目的数据库。S1130. Migrate the target data to the destination database according to the migration policy.
在步骤S1110中,在一些数据迁移的场景下,不需要对原始数据库的所有源数据进行迁移,需要进行有选择地对所需数据或关键数据进行迁移,其中,目标数据是从源数据中筛选出来的所需数据或关键数据。In step S1110, in some data migration scenarios, it is not necessary to migrate all the source data of the original database, but it is necessary to selectively migrate the required data or key data, wherein the target data is selected from the source data The required data or key data that come out.
在步骤S1120至S1130中,迁移策略的生成过程和数据迁移的原理没有因迁移对象的改变而改变,客户可以根据业务需要选择迁移需要的或者关键的数据,达到对原始数据库的数据清洗作用,保持了目的数据库的数据高有效性,也提升了数据迁移过程的灵活性。In steps S1120 to S1130, the generation process of the migration strategy and the principle of data migration have not changed due to the change of the migration object. Customers can select the required or key data for migration according to business needs, so as to achieve the data cleaning effect on the original database and maintain This ensures high data availability in the destination database and improves the flexibility of the data migration process.
在一实施方式中,迁移请求信息还包括权限认证请求,根据数据属性参数生成迁移策略,包括:对权限认证请求进行解析,得到权限信息;对权限信息进行认证处理,得到认证结果信息;根据认证结果信息、数据属性参数生成迁移策略。In one embodiment, the migration request information also includes a permission authentication request, and the migration policy is generated according to the data attribute parameters, including: parsing the permission authentication request to obtain permission information; performing authentication processing on the permission information to obtain authentication result information; Result information and data attribute parameters generate a migration strategy.
另外,在一实施例中,参照图12,步骤S230可以包括但不限于有以下步骤:In addition, in one embodiment, referring to FIG. 12, step S230 may include but not limited to the following steps:
S1210,对权限认证请求进行解析,得到权限信息;S1210, analyzing the permission authentication request to obtain permission information;
S1220,对权限信息进行认证处理,得到认证结果信息;S1220. Perform authentication processing on the authority information to obtain authentication result information;
S1230,根据认证结果信息、数据属性参数生成迁移策略。S1230. Generate a migration policy according to the authentication result information and data attribute parameters.
在步骤S1210中,用户通过客户端向迁移端发送迁移请求信息,其中,迁移端包括但不限于数据迁移工具,数据迁移工具解析数据迁移命令得到权限信息,权限信息用于表征该客户端是否具有数据迁移的权限内。In step S1210, the user sends migration request information to the migration terminal through the client, wherein the migration terminal includes but is not limited to a data migration tool, and the data migration tool parses the data migration command to obtain permission information, and the permission information is used to indicate whether the client has Within the authority of data migration.
在步骤S1220中,迁移端得到权限信息之后,对权限信息进行认证处理,得到认证结果信息,认证结果信息用于表征迁移端对客户端权限的认证结果。In step S1220, after obtaining the authority information, the migrating end performs authentication processing on the authority information to obtain authentication result information, which is used to represent the migrating end's authentication result of the client's authority.
在步骤S1230中,若认证结果为认证成功,即权限认证通过后,迁移端根据认证结果信息、数据属性参数生成迁移策略。In step S1230, if the authentication result is successful, that is, after the authority authentication is passed, the migration terminal generates a migration policy according to the authentication result information and data attribute parameters.
在一实施方式中,方法还包括:根据中间文件生成迁移结果报告文件。In an embodiment, the method further includes: generating a migration result report file according to the intermediate file.
另外,在一实施例中,参照图13,数据迁移方法还包括:In addition, in one embodiment, referring to FIG. 13 , the data migration method further includes:
S1310,获取中间文件、迁移过程文件;S1310, acquiring intermediate files and migration process files;
S1320,根据中间文件、迁移过程文件生成迁移结果报告文件。S1320. Generate a migration result report file according to the intermediate file and the migration process file.
在步骤S1310中,中间文件为在导出过程中得到的中间文件,迁移过程文件为在导出和导入过程中,迁移过程文件为每个文件的导出和导入成功与否的记录。In step S1310, the intermediate file is an intermediate file obtained during the export process, the migration process file is during the export and import process, and the migration process file is a record of whether the export and import of each file is successful or not.
在步骤S1320中,将中间文件、迁移过程文件进行汇总,生成迁移结果报告文件,以供数据分析等再利用。比如,迁移过程文件用于判断数据源中的每个数据表是否迁移成功,若未迁移成功,可通过记录的中间文件来判断,该数据表的迁移过程是在哪个步骤出现了错误,进而针对未迁移成功的数据表进行二次迁移,保证数据迁移的可靠性。In step S1320, the intermediate files and migration process files are collected to generate a migration result report file for reuse in data analysis and the like. For example, the migration process file is used to judge whether each data table in the data source has been successfully migrated. If the migration is not successful, it can be judged by the recorded intermediate file, which step in the migration process of the data table has an error, and then for Data tables that have not been successfully migrated are migrated twice to ensure the reliability of data migration.
在一实施方式中,目的数据库为分布式数据库。In one embodiment, the target database is a distributed database.
在一些实施例中,目的数据库为分布式数据库,在数据库系统的替换升级时使用,将原始数据库中的数据根据需要进行数据迁移到分布式数据库系统中,此时,无论原始数据库是分布式数据库,还是普通数据库,都可以利用本申请的数据迁移方法完成迁移过程。In some embodiments, the target database is a distributed database, which is used when the database system is replaced and upgraded, and the data in the original database is migrated to the distributed database system as needed. At this time, no matter whether the original database is a distributed database , or common databases, the data migration method of this application can be used to complete the migration process.
需要说明的是,若原始数据库和目的数据库都为普通数据库,则省去本申请提供的数据 迁移方法的数据分发功能,依然可完成数据迁移的任务,这提升了本申请的数据迁移方法的普适性。It should be noted that if both the original database and the target database are common databases, the data distribution function of the data migration method provided by this application is omitted, and the task of data migration can still be completed, which improves the universality of the data migration method of this application. fitness.
本申请实施例提供一种数据迁移方法,应用于客户端,方法包括:获取迁移请求信息;迁移请求信息包括源数据的数据属性参数;发送迁移请求信息给迁移端,以使迁移端执行上述任一用于迁移端的方法。The embodiment of the present application provides a data migration method, which is applied to the client. The method includes: obtaining migration request information; the migration request information includes the data attribute parameters of the source data; sending the migration request information to the migration end, so that the migration end performs the above tasks A method for migrating endpoints.
如图14所示,图14是本申请一个实施例提供的数据迁移方法的流程图,该数据迁移方法应用于客户端,例如应用于如图1所示实施例中的客户端110中,该数据迁移方法包括但不限于有步骤S1410和步骤S1420。As shown in FIG. 14, FIG. 14 is a flowchart of a data migration method provided by an embodiment of the present application. The data migration method is applied to a client, for example, to the client 110 in the embodiment shown in FIG. 1. The data migration method includes but not limited to step S1410 and step S1420.
S1410,获取迁移请求信息;S1410, acquiring migration request information;
S1420,发送迁移请求信息给迁移端。S1420. Send migration request information to the migration end.
在步骤S1410中,迁移请求信息用于客户端向迁移端传递与迁移过程相关的命令和参数,以使迁移平台根据上述命令和参数对源数据进行迁移处理。其中,与迁移过程相关的命令和参数包括但不限于数据属性参数、权限认证请求。In step S1410, the migration request information is used by the client to transmit commands and parameters related to the migration process to the migration end, so that the migration platform performs migration processing on the source data according to the above commands and parameters. Wherein, the commands and parameters related to the migration process include but are not limited to data attribute parameters and authority authentication requests.
在步骤S1420中,发送迁移请求信息给迁移端,以使迁移端执行上述任一用于迁移端的方法。In step S1420, the migration request information is sent to the migration end, so that the migration end executes any of the above-mentioned methods for the migration end.
针对上述相关技术中所存在的技术问题,在本实施例中,在客户端,获取迁移请求信息,并发送给迁移端使其完成迁移任务,通过本申请实施例提供的技术方案可以实现对数据库多进程多线程的迁移,避免了因数据不均匀而导致的迁移时长较大的问题,提升了数据迁移的效率;实现了跨数据库字段类型转换的处理,提升了数据迁移准确度;实现了对分布式数据库的数据迁移,考虑了数据在分布式数据库上的分发和分布问题,同时实现对部分数据的选择迁移,提升了数据迁移的灵活性。In view of the technical problems existing in the above-mentioned related technologies, in this embodiment, the migration request information is obtained at the client end and sent to the migration end to complete the migration task. The technical solution provided by the embodiment of this application can realize the database Multi-process and multi-thread migration avoids the problem of long migration time caused by uneven data and improves the efficiency of data migration; realizes the processing of cross-database field type conversion and improves the accuracy of data migration; The data migration of distributed databases considers the distribution and distribution of data on distributed databases, and at the same time realizes the selective migration of some data, which improves the flexibility of data migration.
下面参考图15,以一个实施例详细描述数据迁移方法。值得理解的是,下述描述仅是说明,而不是对申请的具体限制。Referring to FIG. 15 , the data migration method is described in detail in an embodiment. It should be understood that the following description is only an illustration, rather than a specific limitation on the application.
S1510,客户端获取并发送迁移请求信息给迁移端;S1510, the client acquires and sends migration request information to the migration terminal;
S1520,迁移端获取来自原始数据库的源数据,并接收客户端发送的迁移请求信息;迁移请求信息包括源数据的数据属性参数、数据筛选信息;S1520. The migration terminal acquires source data from the original database, and receives migration request information sent by the client; the migration request information includes data attribute parameters and data screening information of the source data;
S1530,迁移端对权限认证请求进行解析,得到权限信息,再对权限信息进行认证处理,得到认证结果信息;S1530. The migration terminal parses the permission authentication request to obtain permission information, and then performs authentication processing on the permission information to obtain authentication result information;
S1540,若迁移端判断认证结果信息为权限合法;则根据源数据、数据筛选信息进行数据源筛选处理,得到目标数据;S1540, if the migration terminal determines that the authentication result information is legal; then perform data source screening processing according to the source data and data screening information to obtain the target data;
S1550,策略优化模块根据目标数据的表数量参数和表数据量参数生成导出策略和导入策略;其中,导出策略包括导出进程数量、导出线程数量。S1550. The strategy optimization module generates an export strategy and an import strategy according to the table quantity parameter and the table data quantity parameter of the target data; wherein, the export strategy includes the number of export processes and the number of export threads.
S1560,数据导出模块根据数据属性参数配置导出进程数量和导出线程数量,将数据均匀分配到对应导出线程进行数据导出,根据文件划分规则,将源数据对应导出为至少一个中间文件。S1560. The data export module configures the number of export processes and the number of export threads according to the data attribute parameters, evenly distributes the data to corresponding export threads for data export, and correspondingly exports the source data into at least one intermediate file according to file division rules.
S1570,数据导出模块根据平台运行环境信息生成格式转换策略,根据格式转换策略对源数据进行格式转化处理,得到目标格式数据,再利用目标格式数据更新中间文件。S1570. The data export module generates a format conversion strategy according to the platform operating environment information, performs format conversion processing on the source data according to the format conversion strategy, obtains data in a target format, and then uses the data in the target format to update the intermediate file.
S1580,数据导入模块根据数据属性参数配置导入进程数量和导入线程数量,将数据均匀分配到对应导入线程进行数据导入,利用分发键信息获取与分发键信息相匹配的中间文件,将中间文件迁移到目的数据库对应的分区。S1580, the data import module configures the number of import processes and the number of import threads according to the data attribute parameters, evenly distributes the data to corresponding import threads for data import, uses the distribution key information to obtain an intermediate file matching the distribution key information, and migrates the intermediate file to The partition corresponding to the destination database.
S1590,结果输出模块获取中间文件、迁移过程文件,生成迁移结果报告文件。S1590, the result output module acquires the intermediate file and the migration process file, and generates a migration result report file.
在一些实施例中,目标数据的表数量参数为700、表数据量参数为100亿,配置导出进程数量和导入进程数量为5,导出线程数量和导入线程数量为20。In some embodiments, the target data table number parameter is 700, the table data volume parameter is 10 billion, the configuration export process number and import process number are 5, and the export thread number and import thread number are 20.
在导出过程中,以100万行的固定数据行进行线程分发,以10万行的固定行数设来进行数据落盘,生成csv中间文件。During the export process, the thread distribution is performed with a fixed data line of 1 million lines, and the data is placed to disk with a fixed line number of 100,000 lines to generate a csv intermediate file.
在导入过程中,以5000条数据记录进行线程分发,根据RANGE、LIST、HASH等分发 键信息将基础数据和业务数据按照对应的分发规则部署在分布式数据库中。During the import process, 5000 data records are used for thread distribution, and the basic data and business data are deployed in the distributed database according to the corresponding distribution rules according to the distribution key information such as RANGE, LIST, and HASH.
在实际应用中,图15展示的数据迁移过程共占用Oracle数据库4T大小的表空间,在3小时内完成全部的数据迁移,极大地提升了数据迁移的效率。In practical applications, the data migration process shown in Figure 15 occupies a total of 4T table space in the Oracle database, and completes all data migration within 3 hours, greatly improving the efficiency of data migration.
以下一个应用实施例,说明本申请的数据迁移方法。The following application example illustrates the data migration method of this application.
一种典型的数据迁移流程如图16所示,简单说明如下:A typical data migration process is shown in Figure 16, and a brief description is as follows:
原始数据库(图示为源数据库)将海量数据发送至数据导出模块,数据导出模块向策略优化模块发送策略查询命令,策略优化模块接收到查询命令之后,返回策略信息给数据导出模块,进而,数据导出模块根据策略信息将源数据导出为中间文件,中间文件依次记为TB1.csv1……TBm.csv1、TBn.csv1……TBn.csvk,然后数据导入模块根据策略信息将中间文件分发到目的数据库,目的数据库的文件记为TB1导入……TBm导入、TBn导入……TBn导入,进而完成数据迁移。最后,结果输出模块根据数据迁移记录形成结果文件,结果文件记为result。The original database (the source database in the figure) sends massive data to the data export module, and the data export module sends a policy query command to the policy optimization module. After receiving the query command, the policy optimization module returns policy information to the data export module, and then, the data The export module exports the source data into intermediate files according to the policy information, and the intermediate files are sequentially recorded as TB1.csv1...TBm.csv1, TBn.csv1...TBn.csvk, and then the data import module distributes the intermediate files to the destination database according to the policy information , the files of the target database are recorded as TB1 import...TBm import, TBn import...TBn import, and then the data migration is completed. Finally, the result output module forms a result file according to the data migration record, and the result file is recorded as result.
另外,本申请实施例的一个实施例还提供了一种数据迁移装置,用于迁移端,参照图17,该数据迁移装置包括:In addition, an embodiment of the embodiment of the present application also provides a data migration device for the migration terminal. Referring to FIG. 17, the data migration device includes:
源数据获取模块1710,被设置为获取来自原始数据库的源数据;source data acquisition module 1710, configured to acquire source data from the original database;
迁移请求信息接收模块1720,被设置为接收客户端发送的迁移请求信息;迁移请求信息包括源数据的数据属性参数;The migration request information receiving module 1720 is configured to receive the migration request information sent by the client; the migration request information includes the data attribute parameters of the source data;
迁移策略生成模块1730,被设置为根据数据属性参数生成迁移策略;The migration strategy generation module 1730 is configured to generate a migration strategy according to the data attribute parameters;
迁移模块1740,被设置为根据迁移策略将源数据迁移到目的数据库。The migration module 1740 is configured to migrate the source data to the target database according to the migration strategy.
源数据获取模块1710与迁移请求信息接收模块1720连接,迁移请求信息接收模块1720与迁移策略生成模块1730连接,迁移策略生成模块1730与迁移模块1740连接。The source data acquisition module 1710 is connected to the migration request information receiving module 1720 , the migration request information receiving module 1720 is connected to the migration strategy generation module 1730 , and the migration strategy generation module 1730 is connected to the migration module 1740 .
需要说明的是,本实施例中的数据迁移装置与用于迁移端的数据迁移方法,属于相同的构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。It should be noted that the data migration device in this embodiment and the data migration method for the migration end belong to the same idea, so these embodiments have the same implementation principle and technical effect, and will not be described in detail here.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,本申请实施例的一个实施例还提供了一种数据迁移装置,用于客户端,参照图18,该数据迁移装置包括:In addition, an embodiment of the embodiment of the present application also provides a data migration device for a client. Referring to FIG. 18, the data migration device includes:
数据获取模块1810,被设置为获取迁移请求信息;迁移请求信息包括源数据的数据属性参数;The data acquisition module 1810 is configured to acquire migration request information; the migration request information includes data attribute parameters of source data;
数据发送模块1820,被设置为发送迁移请求信息给迁移端,以使迁移端执行本申请如上述任一用于迁移端的方法。The data sending module 1820 is configured to send migration request information to the migration end, so that the migration end performs any one of the above-mentioned methods for the migration end in this application.
其中,数据获取模块1810与数据发送模块1820连接。Wherein, the data acquisition module 1810 is connected with the data sending module 1820 .
需要说明的是,本实施例中的数据迁移装置与用于客户端的数据迁移方法,属于相同的构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。It should be noted that the data migration device in this embodiment and the data migration method for the client belong to the same idea, so these embodiments have the same implementation principle and technical effect, and will not be described in detail here.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,本申请实施例的一个实施例还提供了一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序。In addition, an embodiment of the embodiments of the present application further provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor.
处理器和存储器可以通过总线或者其他方式连接。The processor and memory can be connected by a bus or other means.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。As a non-transitory computer-readable storage medium, memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may include memory located remotely from the processor, which remote memory may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
需要说明的是,本实施例中的电子设备,可以应用为如图1所示实施例的系统架构中的客户端110或者迁移端120中,本实施例中的电子设备和如图2所示实施例的数据迁移方法具有相同的构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。It should be noted that the electronic device in this embodiment can be applied as the client 110 or the migration terminal 120 in the system architecture of the embodiment shown in FIG. 1 . The electronic device in this embodiment is as shown in FIG. 2 The data migration methods in the embodiments have the same idea, so these embodiments have the same implementation principles and technical effects, and will not be described in detail here.
实现上述实施例的数据迁移方法所需的非暂态软件程序以及指令存储在存储器中,当被处理器执行时,执行上述任一实施例中的数据迁移方法。The non-transitory software programs and instructions required to implement the data migration method of the above-mentioned embodiments are stored in the memory, and when executed by the processor, the data migration method in any of the above-mentioned embodiments is executed.
此外,本申请实施例的一个实施例还提供了一种存储介质,该存储介质存储有计算机可执行指令,该计算机可执行指令被一个处理器或控制器执行,例如,被上述实施例中的一个处理器执行,可使得上述处理器执行上述实施例中的数据迁移方法,例如,执行以上描述的任一实施例的数据迁移方法。In addition, an embodiment of the embodiment of the present application also provides a storage medium, the storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the Execution by one processor may cause the above-mentioned processor to execute the data migration method in the above-mentioned embodiments, for example, execute the data migration method in any of the above-described embodiments.
本申请实施例第一方面提供的数据迁移方法,与相关技术相比,通过客户端发送的迁移请求信息,其中迁移请求信息包括源数据的数据属性参数,并根据数据属性参数生成迁移策略,进而根据迁移策略将源数据迁移到目的数据库。通过本申请实施例提供的技术方案可以实现根据数据属性参数对数据库多进程多线程的迁移,避免了因数据不均匀而导致的迁移时长较大的问题,提升了数据迁移的效率。Compared with related technologies, the data migration method provided by the first aspect of the embodiment of the present application uses the migration request information sent by the client, wherein the migration request information includes the data attribute parameters of the source data, and generates a migration strategy according to the data attribute parameters, and then Migrate the source data to the destination database according to the migration strategy. Through the technical solution provided by the embodiment of the present application, the multi-process and multi-thread migration of the database can be realized according to the data attribute parameters, avoiding the problem of long migration time caused by uneven data, and improving the efficiency of data migration.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those skilled in the art can understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware and an appropriate combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit . Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
以上是对本申请实施例的一些实施例进行了说明,但本申请实施例并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请实施例精神的前提下还可作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请实施例权利要求所限定的范围内。The above is a description of some embodiments of the embodiments of the present application, but the embodiments of the present application are not limited to the above-mentioned embodiments, and those skilled in the art can make various equivalents without violating the spirit of the embodiments of the present application. Modifications or replacements, these equivalent modifications or replacements are all included within the scope defined in the claims of the embodiments of the present application.

Claims (20)

  1. 一种数据迁移方法,包括:A data migration method comprising:
    获取来自原始数据库的源数据;Get the source data from the original database;
    接收客户端发送的迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;receiving migration request information sent by the client; the migration request information includes data attribute parameters of the source data;
    根据所述数据属性参数生成迁移策略;generating a migration strategy according to the data attribute parameters;
    根据所述迁移策略将所述源数据迁移到目的数据库。The source data is migrated to the target database according to the migration strategy.
  2. 根据权利要求1所述的方法,其中,数据属性参数包括以下的一种或多种:表数量参数、或表数据量参数、或行数量参数。The method according to claim 1, wherein the data attribute parameters include one or more of the following: table quantity parameters, or table data quantity parameters, or row quantity parameters.
  3. 根据权利要求2所述的方法,其中,所述迁移策略包括导出策略、导入策略;所述根据所述迁移策略将所述源数据迁移到目的数据库,包括:The method according to claim 2, wherein the migration strategy includes an export strategy and an import strategy; and migrating the source data to the destination database according to the migration strategy includes:
    根据所述导出策略将所述源数据转化为中间文件;converting the source data into an intermediate file according to the export strategy;
    根据所述导入策略将所述中间文件迁移到所述目的数据库。The intermediate file is migrated to the target database according to the import policy.
  4. 根据权利要求3所述的方法,其中,所述导出策略包括导出进线程策略;所述根据所述导出策略将所述源数据转化为中间文件,包括:The method according to claim 3, wherein said export policy includes exporting into a thread policy; said converting said source data into an intermediate file according to said export policy comprises:
    根据所述数据属性参数配置导出进程数量和导出线程数量;Configure the number of export processes and the number of export threads according to the data attribute parameters;
    根据所述导出进程数量、所述导出线程数量和所述数据属性参数,将数据均匀分配到对应导出线程进行数据导出,生成所述中间文件。According to the number of export processes, the number of export threads, and the data attribute parameters, evenly distribute data to corresponding export threads for data export, and generate the intermediate file.
  5. 根据权利要求3所述的方法,其中,所述导出策略包括数据落盘策略,所述根据所述导出策略将所述源数据转化为中间文件,包括:The method according to claim 3, wherein the export strategy includes a data placement strategy, and converting the source data into an intermediate file according to the export strategy includes:
    获取预设的文件划分规则;所述文件划分规则包括生成每一所述中间文件的数据量数或数据行数;Acquiring preset file division rules; the file division rules include generating the number of data volumes or the number of data lines for each of the intermediate files;
    根据所述文件划分规则,将所述源数据对应导出为至少一个中间文件。Correspondingly exporting the source data into at least one intermediate file according to the file division rule.
  6. 根据权利要求3所述的方法,其中,所述导入策略包括导入进线程策略;所述根据所述导入策略将所述中间文件迁移到所述目的数据库,包括:The method according to claim 3, wherein the import strategy includes importing a thread strategy; and migrating the intermediate file to the destination database according to the import strategy comprises:
    根据所述数据属性参数配置导入进程数量和导入线程数量;Configure the number of import processes and the number of import threads according to the data attribute parameters;
    根据所述导入进程数量、所述导入线程数量和所述数据属性参数,将数据均匀分配到对应导入线程进行数据导入,将所述中间文件迁移到所述目的数据库。According to the number of import processes, the number of import threads and the data attribute parameters, evenly distribute data to corresponding import threads for data import, and migrate the intermediate files to the target database.
  7. 根据权利要求6所述的方法,其中,所述根据所述数据属性参数生成迁移策略,包括:The method according to claim 6, wherein said generating a migration strategy according to said data attribute parameters comprises:
    根据所述表数量参数和所述表数据量参数进行预测处理,得到中间参数;performing prediction processing according to the table quantity parameter and the table data quantity parameter to obtain intermediate parameters;
    根据所述中间参数生成所述导入进线程策略。Generate the imported thread policy according to the intermediate parameters.
  8. 根据权利要求3所述的方法,其中,所述目的数据库包括多个分区;所述导入策略包括数据分发策略;所述根据所述导入策略将所述中间文件迁移到所述目的数据库,包括:The method according to claim 3, wherein the target database includes a plurality of partitions; the import policy includes a data distribution policy; and migrating the intermediate file to the target database according to the import policy includes:
    获取分发键信息;Obtain distribution key information;
    根据所述分发键信息,获取与所述分发键信息相匹配的所述中间文件;Acquiring the intermediate file matching the distribution key information according to the distribution key information;
    将所述中间文件迁移到所述目的数据库对应的分区。Migrating the intermediate file to the partition corresponding to the target database.
  9. 根据权利要求8所述的方法,其中,所述中间文件包括基础数据和业务数据,所述获取分发键信息,还包括:The method according to claim 8, wherein the intermediate file includes basic data and business data, and the obtaining distribution key information further includes:
    获取所述基础数据的优先级;Acquiring the priority of the basic data;
    根据所述优先级对所述基础数据进行排序处理,得到排序结果;sorting the basic data according to the priority to obtain a sorting result;
    根据所述排序结果进行关键字段查询匹配处理,得到与所述业务数据关联的所述基础数据;performing key field query matching processing according to the sorting results to obtain the basic data associated with the business data;
    获取与所述业务数据关联的所述基础数据对应的所述分发键。Acquiring the distribution key corresponding to the basic data associated with the service data.
  10. 根据权利要求8或9任一项所述的方法,其中,所述分发键信息至少包括以下任一种:连续区间分发键、或枚举值分发键、或分区分发键。The method according to any one of claims 8 or 9, wherein the distribution key information includes at least any one of the following: a continuous interval distribution key, an enumerated value distribution key, or a partition distribution key.
  11. 根据权利要求3所述的方法,其中,所述迁移请求信息还包括平台运行环境信息, 所述根据所述导出策略将所述源数据转化为中间文件,包括:The method according to claim 3, wherein the migration request information further includes platform operating environment information, and converting the source data into an intermediate file according to the export strategy includes:
    根据所述平台运行环境信息生成格式转换策略;generating a format conversion policy according to the platform operating environment information;
    根据所述格式转换策略对所述源数据进行格式转化处理,得到目标格式数据;performing format conversion processing on the source data according to the format conversion strategy to obtain target format data;
    根据所述目标格式数据更新所述中间文件。The intermediate file is updated according to the target format data.
  12. 根据权利要求1所述的方法,其中,所述迁移请求信息还包括数据筛选信息,所述根据所述数据属性参数生成迁移策略,包括:The method according to claim 1, wherein the migration request information further includes data screening information, and generating a migration strategy according to the data attribute parameters includes:
    根据所述源数据、所述数据筛选信息进行数据源筛选处理,得到目标数据;performing data source screening processing according to the source data and the data screening information to obtain target data;
    根据所述目标数据的所述数据属性参数生成所述迁移策略;generating the migration strategy according to the data attribute parameters of the target data;
    对应的,所述根据所述迁移策略将所述源数据迁移到目的数据库,包括:Correspondingly, the migrating the source data to the destination database according to the migration strategy includes:
    根据所述迁移策略将所述目标数据迁移到所述目的数据库。Migrate the target data to the target database according to the migration strategy.
  13. 根据权利要求1所述的方法,其中,所述迁移请求信息还包括权限认证请求,所述根据所述数据属性参数生成迁移策略,包括:The method according to claim 1, wherein the migration request information further includes a permission authentication request, and generating a migration strategy according to the data attribute parameters includes:
    对所述权限认证请求进行解析,得到权限信息;Analyzing the permission authentication request to obtain permission information;
    对所述权限信息进行认证处理,得到认证结果信息;Perform authentication processing on the authority information to obtain authentication result information;
    根据所述认证结果信息、所述数据属性参数生成所述迁移策略。The migration policy is generated according to the authentication result information and the data attribute parameters.
  14. 根据权利要求3所述的方法,其中,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    根据所述中间文件生成迁移结果报告文件。A migration result report file is generated according to the intermediate file.
  15. 根据权利要求1、2、3、4、5、6、7、8、9、11、12、13或14所述的方法,其中,所述目的数据库为分布式数据库。The method according to claim 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13 or 14, wherein the target database is a distributed database.
  16. 一种数据迁移方法,包括:A data migration method comprising:
    获取迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;Obtain migration request information; the migration request information includes data attribute parameters of the source data;
    发送所述迁移请求信息给迁移端,以使所述迁移端执行如权利要求1至15任一项所述的方法。Sending the migration request information to the migration end, so that the migration end executes the method according to any one of claims 1-15.
  17. 一种数据迁移装置,包括:A data migration device, comprising:
    源数据获取模块,被设置为获取来自原始数据库的源数据;a source data acquisition module configured to acquire source data from the original database;
    迁移请求信息接收模块,被设置为接收客户端发送的迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;The migration request information receiving module is configured to receive the migration request information sent by the client; the migration request information includes the data attribute parameters of the source data;
    迁移策略生成模块,被设置为根据所述数据属性参数生成迁移策略;A migration strategy generation module, configured to generate a migration strategy according to the data attribute parameters;
    迁移模块,被设置为根据所述迁移策略将所述源数据迁移到目的数据库。The migration module is configured to migrate the source data to the target database according to the migration strategy.
  18. 一种数据迁移装置,包括:A data migration device, comprising:
    数据获取模块,被设置为获取迁移请求信息;所述迁移请求信息包括所述源数据的数据属性参数;A data acquisition module configured to acquire migration request information; the migration request information includes data attribute parameters of the source data;
    数据发送模块,被设置为发送所述迁移请求信息给迁移端,以使所述迁移端执行如权利要求1至15任一项所述的方法。The data sending module is configured to send the migration request information to the migration end, so that the migration end executes the method according to any one of claims 1 to 15.
  19. 一种电子设备,包括:An electronic device comprising:
    至少一个存储器;at least one memory;
    至少一个处理器;at least one processor;
    至少一个程序;at least one program;
    所述程序被存储在存储器中,处理器执行所述至少一个程序以实现:The programs are stored in memory, and the processor executes the at least one program to:
    如权利要求1至15任一项所述的方法;A method as claimed in any one of claims 1 to 15;
    或,如权利要求16所述的方法。Or, the method of claim 16.
  20. 一种存储介质,所述存储介质为计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行:A storage medium, the storage medium is a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer perform:
    如权利要求1至15任一项所述的方法;A method as claimed in any one of claims 1 to 15;
    或,如权利要求16所述的方法。Or, the method of claim 16.
PCT/CN2023/071319 2022-01-13 2023-01-09 Data migration methods and apparatuses, electronic device, and storage medium WO2023134627A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210035298.4A CN114077602B (en) 2022-01-13 2022-01-13 Data migration method and device, electronic equipment and storage medium
CN202210035298.4 2022-01-13

Publications (1)

Publication Number Publication Date
WO2023134627A1 true WO2023134627A1 (en) 2023-07-20

Family

ID=80284514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/071319 WO2023134627A1 (en) 2022-01-13 2023-01-09 Data migration methods and apparatuses, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114077602B (en)
WO (1) WO2023134627A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117278394A (en) * 2023-11-21 2023-12-22 京东科技信息技术有限公司 Gateway traffic migration method, device and system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114077602B (en) * 2022-01-13 2022-05-17 中兴通讯股份有限公司 Data migration method and device, electronic equipment and storage medium
CN114461369B (en) * 2022-04-12 2022-08-19 山东省计算中心(国家超级计算济南中心) Adaptive data scheduling system and method for complex application scene

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080255895A1 (en) * 2006-11-17 2008-10-16 Infosys Technologies Ltd. System And Method For Generating Data Migration Plan
EP3686750A1 (en) * 2019-01-23 2020-07-29 Accenture Global Solutions Limited Data migration
CN112015716A (en) * 2020-08-04 2020-12-01 北京人大金仓信息技术股份有限公司 Database data migration method, device, medium and electronic equipment
CN112035439A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Data migration method and device, computer equipment and computer readable storage medium
CN113297182A (en) * 2021-06-16 2021-08-24 中国农业银行股份有限公司 Data migration method, device, storage medium and program product
CN114077602A (en) * 2022-01-13 2022-02-22 中兴通讯股份有限公司 Data migration method and device, electronic equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653630B (en) * 2015-12-25 2019-12-24 北京奇虎科技有限公司 Data migration method and device for distributed database
CN108132949B (en) * 2016-12-01 2021-02-12 腾讯科技(深圳)有限公司 Data migration method and device in database cluster
CN106708968B (en) * 2016-12-01 2019-11-26 成都华为技术有限公司 Data processing method in distributed data base system and distributed data base system
CN108280148A (en) * 2018-01-02 2018-07-13 中国民生银行股份有限公司 A kind of data migration method and data migration server
CN112241398A (en) * 2019-07-19 2021-01-19 北京京东尚科信息技术有限公司 Data migration method and system
CN111753016B (en) * 2020-06-28 2024-06-04 深圳前海微众银行股份有限公司 Data processing method, device, system and computer readable storage medium
CN112650736B (en) * 2020-12-31 2024-07-05 中国农业银行股份有限公司 Data migration method and device
CN113190534A (en) * 2021-05-26 2021-07-30 中国工商银行股份有限公司 Database data migration method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080255895A1 (en) * 2006-11-17 2008-10-16 Infosys Technologies Ltd. System And Method For Generating Data Migration Plan
EP3686750A1 (en) * 2019-01-23 2020-07-29 Accenture Global Solutions Limited Data migration
CN112015716A (en) * 2020-08-04 2020-12-01 北京人大金仓信息技术股份有限公司 Database data migration method, device, medium and electronic equipment
CN112035439A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Data migration method and device, computer equipment and computer readable storage medium
CN113297182A (en) * 2021-06-16 2021-08-24 中国农业银行股份有限公司 Data migration method, device, storage medium and program product
CN114077602A (en) * 2022-01-13 2022-02-22 中兴通讯股份有限公司 Data migration method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117278394A (en) * 2023-11-21 2023-12-22 京东科技信息技术有限公司 Gateway traffic migration method, device and system
CN117278394B (en) * 2023-11-21 2024-04-05 京东科技信息技术有限公司 Gateway traffic migration method, device and system

Also Published As

Publication number Publication date
CN114077602B (en) 2022-05-17
CN114077602A (en) 2022-02-22

Similar Documents

Publication Publication Date Title
WO2023134627A1 (en) Data migration methods and apparatuses, electronic device, and storage medium
US10176225B2 (en) Data processing service
US8285686B2 (en) Executing prioritized replication requests for objects in a distributed storage system
CN110147411A (en) Method of data synchronization, device, computer equipment and storage medium
US10877810B2 (en) Object storage system with metadata operation priority processing
US9426219B1 (en) Efficient multi-part upload for a data warehouse
US20140229582A1 (en) System And Method For Offline Downloading Network Resource Files
US10860604B1 (en) Scalable tracking for database udpates according to a secondary index
WO2016169237A1 (en) Data processing method and device
US8650216B2 (en) Distributed storage for collaboration servers
CN111324606B (en) Data slicing method and device
CN104462185A (en) Digital library cloud storage system based on mixed structure
US10262024B1 (en) Providing consistent access to data objects transcending storage limitations in a non-relational data store
WO2017174013A1 (en) Data storage management method and apparatus, and data storage system
CN113407600B (en) Enhanced real-time calculation method for dynamically synchronizing multi-source large table data in real time
WO2023050713A1 (en) Method, apparatus and system for managing container clusters and components, and storage medium
CN111459913B (en) Capacity expansion method and device of distributed database and electronic equipment
US20210334284A1 (en) System and method of querying objects on demand
CN109947739B (en) Data source management method and device
US20220215021A1 (en) Data Query Method and Apparatus, Computing Device, and Storage Medium
US10762139B1 (en) Method and system for managing a document search index
CN113760600B (en) Database backup method, database restoration method and related devices
US11175905B2 (en) Optimizing uploads for an offline scenario by merging modification operations
CN114238390A (en) Data warehouse optimization method, device, equipment and storage medium
CN112835887A (en) Database management method, database management device, computing equipment and storage medium

Legal Events

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

Ref document number: 23739969

Country of ref document: EP

Kind code of ref document: A1