A database migration method and device, electronic equipment and storage medium

By partitioning the source database data and employing multi-threaded or multi-process migration, combined with flashback time parameters and historical version views, the problems of low database migration efficiency and poor consistency were solved, achieving efficient and low-cost data migration.

CN115033551BActive Publication Date: 2026-01-13CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111652659.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2026-01-13
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing technologies suffer from low database migration efficiency and poor data consistency, especially when migrating large amounts of data, which is time-consuming and requires additional verification at high costs.

Method used

By partitioning the source database data and using multi-threaded or multi-process migration, combined with flashback time parameters and historical version views, data consistency is ensured, and verification analysis is performed in the target database.

Benefits of technology

It significantly improved database migration efficiency, reduced time and computational costs, and ensured the consistency and integrity of migrated data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033551B_ABST
    Figure CN115033551B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a database migration method and device, electronic equipment and storage medium, specifically, multi-threading or multi-processing is used to execute corresponding migration services, which improves the migration efficiency of the database, and by setting the flashback time parameter and the historical version query data parameter, the source database stores the historical version view of the historical change state of the related migration data before the execution of the multi-threading or multi-processing migration service according to the set flashback time period, so that the migration data is verified through the corresponding historical version view, ensuring the consistency and integrity of the migration data, and greatly reducing the time cost and calculation cost caused by the verification of each piece of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data migration technology, and in particular to a database migration method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of the Internet era, various data storage technologies have emerged. Among them, database (DB) storage has been widely used due to its efficient retrieval capabilities. However, with the rapid development of industries such as integrated circuits, there are often situations in real-world scenarios where data migration from source databases is necessary. For example, some organizations, in pursuit of higher database storage capacity, often need to migrate data from source databases to target databases with superior storage performance. Similarly, to meet actual business needs, upgrades or switches to the source Database Management System (DBMS) are required. Before such upgrades / switches, each database under the source DBMS needs to be migrated to the target DBMS to prevent damage to important data.

[0003] Specifically, database migration can be divided into two types: physical migration and logical migration. Logical migration primarily uses third-party data synchronization or data stream synchronization to migrate stored data from the source database to the target database. This synchronization method does not require interrupting the source DBMS's running processes and can perform database synchronization migration while the source DBMS's business operations are running normally. Therefore, it has received widespread attention. However, this method still has the following drawbacks:

[0004] 1. Low migration efficiency.

[0005] In related technologies, database logical migration for different source DBMSs is usually carried out in a single thread. When the amount of data stored in the database to be migrated is large, this method often takes a lot of time to achieve a full database migration. In other words, related technologies have the problem of low database migration efficiency.

[0006] 2. Poor data consistency.

[0007] In related technologies, third-party data synchronization or data stream synchronization methods cannot ensure that the data format of the migrated database is consistent with that of the source database. Therefore, in related technologies, it is often necessary to verify the migrated data in the target database, which incurs additional time and computation costs. Summary of the Invention

[0008] This application provides a database migration method, apparatus, electronic device, and storage medium to improve database migration efficiency while ensuring data consistency.

[0009] In a first aspect, embodiments of this application provide a database migration method, including:

[0010] Retrieve the target data to be migrated from the source database.

[0011] Based on the preset partitioning rules, the target data is divided into at least one corresponding migration data, and based on at least one migration data, corresponding migration verification information is generated.

[0012] At least one set of migration data and migration verification information are migrated to the designated target database through the corresponding data migration channels.

[0013] Based on the migration verification information, data verification is performed on each migration data in the target database to determine the migration result of the target data.

[0014] Secondly, embodiments of this application provide a database migration apparatus, comprising:

[0015] The acquisition module is used to retrieve the target data to be migrated from the source database.

[0016] The partitioning module is used to partition the target data into at least one corresponding migration data based on preset partitioning rules, and generate corresponding migration verification information based on at least one migration data.

[0017] The migration module is used to migrate at least one set of migration data and migration verification information to a specified target database through the corresponding data migration channels.

[0018] The verification module is used to verify each piece of migration data in the target database based on migration verification information, and to determine the migration result of the target data.

[0019] In an optional embodiment, before retrieving the target data to be migrated from the source database, the retrieval module is further configured to:

[0020] Obtain the source database identifier of the source database, and obtain the target database identifier of the target database.

[0021] A data source connection is established between the source database and the target database based on the source database identifier and the target database identifier.

[0022] In an optional embodiment, before obtaining the target data to be migrated from the source database, the method further includes: obtaining the target database format of the target database; then, when obtaining the target data to be migrated from the source database, the obtaining module is further configured to:

[0023] Retrieve the specified target raw data from the source database.

[0024] The target original data is converted to obtain target converted data corresponding to the target database format, and the target converted data is used as the target data to be migrated.

[0025] In one optional embodiment, when generating corresponding migration verification information based on at least one migration data point, the partitioning module is specifically used for:

[0026] Obtain a historical data view of the source database, wherein the historical data view contains at least: historical migration data of the source database;

[0027] Generate a corresponding data validation table based on the data type of at least one migration data.

[0028] Based on historical data views and data validation tables, corresponding migration validation information is generated.

[0029] In an optional embodiment, when verifying the migration data in the target database based on migration verification information to determine the migration result of the target data, the verification module is specifically used for:

[0030] Based on a preset analysis algorithm, data analysis is performed on each migration data in the target database to obtain at least one corresponding verification analysis data, and a verification analysis table corresponding to at least one verification analysis data is generated.

[0031] The verification analysis table is compared with the data verification table in the migration verification information to obtain the corresponding comparison results. Based on the comparison results and historical data view, the migration result of the target data is determined.

[0032] In one optional embodiment, when performing data analysis on each migration data in the target database based on a preset analysis algorithm to obtain at least one corresponding verification analysis data, the verification module is specifically used for:

[0033] Based on the hash algorithm, data analysis is performed on each migration data in the target database to obtain at least one corresponding hash record, and each hash record is used as at least one corresponding verification analysis data.

[0034] or,

[0035] Based on the standard deviation algorithm (SD), data analysis is performed on each migration data in the target database to obtain at least one standard deviation statistical record, and each of these records is used as at least one verification analysis data.

[0036] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it causes the processor to implement any of the database migration methods described in the first aspect above.

[0037] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the database migration method of the first aspect.

[0038] The technical effects of any of the implementation methods in the second to fourth aspects can be found in the technical effects of the corresponding implementation methods in the first aspect, and will not be repeated here.

[0039] This application provides a database migration method, apparatus, electronic device, and storage medium. Specifically, the migration data in the source database is divided, and multi-threading or multi-processing is used to execute corresponding migration operations on the divided data, which significantly improves the migration efficiency of the source database. On the other hand, in this application embodiment, by setting flashback time parameters and historical version query data parameters, the source database stores historical version views of the historical change status of relevant migration data according to the set flashback time period before the multi-threaded or multi-process migration operations are executed. Furthermore, by obtaining the historical version views related to the current migration data and verifying the migration data based on the historical version views, the consistency and integrity of the migration data are ensured, reducing the large time and computation costs caused by verifying each piece of data. Attached Figure Description

[0040] Figure 1 A data migration system architecture diagram provided in this application embodiment;

[0041] Figure 2 A flowchart of a data migration method provided in an embodiment of this application;

[0042] Figure 3 A flowchart illustrating a method for determining migration verification information provided in an embodiment of this application;

[0043] Figure 4 A flowchart of a method for determining a historical data view provided in an embodiment of this application;

[0044] Figure 5 This is a schematic diagram of a data migration scenario provided in an embodiment of this application;

[0045] Figure 6 A schematic diagram of a data migration device provided in an embodiment of this application;

[0046] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this invention.

[0048] To address the issues of poor data consistency and low migration efficiency in related database migration solutions, this application provides a database migration method, apparatus, electronic device, and storage medium. Specifically, the migration data in the source database is divided, and multi-threading or multi-processing is used to execute corresponding migration operations on each division, significantly improving the migration efficiency of the source database. Furthermore, by setting flashback time parameters and historical version query data parameters, the source database stores historical version views of the historical changes in the relevant migration data according to the set flashback time period before the execution of multi-threaded or multi-process migration operations. Further, by obtaining the historical version views related to the current migration data and verifying the migration data based on these historical version views, the consistency and integrity of the migration data are ensured, reducing the significant time and computational costs associated with verifying each data entry individually.

[0049] The preferred embodiments of this application will now be described and explained in conjunction with the accompanying drawings.

[0050] See Figure 1 The diagram shown is a possible data migration system architecture diagram according to an embodiment of this application. The system architecture diagram includes a first terminal device 110, a second terminal device 120, and a server 130.

[0051] In this embodiment, the first terminal device 110 and the second terminal device 120 include, but are not limited to, mobile phones, tablets, laptops, desktop computers, e-book readers, smart voice interaction devices, smart home appliances, and vehicle terminals. The first terminal device 110 and the second terminal device 120 may have a client related to database migration installed on them. This client can be software (e.g., a browser), a webpage, or a mini-program. The first terminal device 110 and the second terminal device 120 can interact with the server 130 based on the aforementioned client related to database migration. Furthermore, the first terminal device 110 deploys the source database to be migrated, and the second terminal device 120 deploys the specified target database. In one possible scenario, it should be understood that the first terminal device 110 and the second terminal device 120 can be the same electronic device; this application does not specifically limit this.

[0052] On the other hand, server 130 is a backend server corresponding to software, web pages, mini-programs, etc., or a server specifically used for database migration; this application does not impose specific limitations. Server 130 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0053] It should be noted that the database migration method in this application embodiment can be executed by an electronic device, which can be a server 130, a first terminal device 110, or a second terminal device 120. That is, the method can be executed by the server 130, the first terminal device 110, or the second terminal device 120 alone, or by any combination of the server 130, the first terminal device 110, or the second terminal device 120.

[0054] In one alternative implementation, the first terminal device 110, the second terminal device 120, and the server 130 can communicate via a communication network.

[0055] In one alternative implementation, the communication network is a wired network or a wireless network.

[0056] It should be noted that, Figure 1 The examples shown are merely illustrative; in reality, the number of terminal devices and servers is unlimited and is not specifically limited in the embodiments of this application.

[0057] Based on the above application scenario, before database migration, in order to identify the source database to be migrated and the specified target database, server 130 obtains the source database identifier of the source database and the target database identifier of the target database, and establishes a data source connection between the source database and the target database based on the source database identifier and the target database identifier, thereby ensuring the rapid migration of relevant data based on the established data source connection.

[0058] The database migration method provided by the exemplary embodiments of this application will now be described with reference to the accompanying drawings and the application scenarios described above.

[0059] See Figure 2 As shown in the figure, this application provides a database migration method, including:

[0060] S201: Obtain the target data to be migrated from the source database.

[0061] Specifically, the target data can be any database object in the source database, including but not limited to: data tables, views, stored procedures, functions, etc. In an optional embodiment, since the database format of the target database may not be consistent with the database format of the source database, the server 130 obtains the specified target original data from the source database based on the obtained target database format. The target original data can be any database object in the source database, and the target original data is converted into a format. The target converted data that conforms to the target database format is used as the target data to be migrated.

[0062] S202: Based on the preset partitioning rules, the target data is divided into at least one corresponding migration data, and based on at least one migration data, corresponding migration verification information is generated.

[0063] Specifically, the target data is divided into corresponding migration data, and for each migration data, a corresponding process or thread is used to execute the relevant migration business. Optionally, the current number of idle threads (multiThreadNum) or the current number of idle processes (multiProssNum) is queried to evenly divide the target data based on the number of idle threads or idle processes, thereby obtaining the corresponding migration data.

[0064] For further details, please refer to [link / reference]. Figure 3 As shown, based on the divided migration data, the corresponding migration verification information is generated in the following ways, including:

[0065] S2021: Obtain the historical data view of the source database, wherein the historical data view contains at least the historical migration data of the source database.

[0066] To ensure the consistency of the current migration data, a historical data view of the current target data is obtained from the source database. This historical data view is determined by setting a preset flashback period (allow_flash_time) and a preset flashback time point (flashtime). Specifically, at each set flashback time point (flashtime), the source database performs a full data consistency verification on the data it saves and saves the corresponding historical data view. By obtaining the corresponding historical data view, the server 130 can determine the historical modification status of the target data, and thus determine the consistency of the target data based on the determined historical modification status.

[0067] Optional, see below Figure 4 As shown, the corresponding historical data view is determined using the following methods:

[0068] S401: Determine the most recent flashback time point (flashtime) and determine the corresponding time period between the current time and the most recent flashback time point (flashtime).

[0069] S402: Determine whether the time period belongs to the preset flashback history time period. If yes, execute S403 below; otherwise, execute S404.

[0070] S403: Determine the correspondence between the most recent flashback time (flashtime) and the corresponding storage times of each service in the preset service-balanced binary tree <service storage time, service ID>, where:

[0071] If the most recent flashback time is less than the minimum business storage time in the preset business balanced binary tree <business storage time, business ID>, then execute the following step S406;

[0072] If the most recent flashback time point (flashtime) matches any of the service storage times in the preset service balanced binary tree <service storage time, service ID>, then execute the following S407;

[0073] If the most recent flashback time (flashtime) corresponds to the maximum business storage time in the preset business balanced binary tree <business storage time, business ID>, then execute the following S408.

[0074] S404: Returns the status of the erroneous data set.

[0075] S406: Take the business ID corresponding to the minimum business storage time as the target business ID to be queried, and based on the target business ID, retrieve the historical data view corresponding to the target business ID from the preset historical data view set.

[0076] S407: Take the business ID corresponding to the consistent business storage time as the target business ID to be queried, and based on the target business ID, obtain the historical data view corresponding to the target business ID from the preset historical data view set.

[0077] S408: Take the business ID corresponding to the maximum business storage time as the target business ID to be queried, and based on the target business ID, retrieve the historical data view corresponding to the target business ID from the preset historical data view set.

[0078] Furthermore, after S406, S407, and S408 are executed, S404 is executed to avoid duplicate execution of related business processes.

[0079] Based on the above steps, the corresponding business ID can be obtained from the preset business balanced binary tree based on the corresponding time length between the current time and the set most recent flashtime point. Based on the determined business ID, the historical data view corresponding to the target data version can be obtained, ensuring data consistency and integrity.

[0080] S2022: Generate a corresponding data validation table based on the data type of at least one migration data.

[0081] Specifically, to further ensure data consistency, a corresponding data validation table is generated based on the data type of each migrated data. This data validation table must contain at least the data type of each migrated data. Optionally, the data validation table may also contain indexes, default values, rules, triggers, users, and functions.

[0082] S2023: Generate corresponding migration verification information based on historical data views and data verification tables.

[0083] Furthermore, based on historical data views and data verification tables, migration verification information is generated for the target data to be migrated. This migration verification information represents the storage status of the target data in the source database.

[0084] S203: Migrate at least one piece of migration data and migration verification information to the specified target database through the corresponding data migration channels.

[0085] Furthermore, each migration data and its corresponding migration verification information are migrated to the specified target database through the data migration channels of the corresponding idle threads or idle processes, thereby achieving data migration for the current target data.

[0086] S204: Based on migration verification information, perform data verification on each migration data in the target database to determine the migration result of the target data.

[0087] Optionally, based on a preset analysis algorithm, data analysis is performed on each migration data in the target database to obtain at least one corresponding verification analysis data, and a verification analysis table corresponding to at least one verification analysis data is generated.

[0088] For example, based on the hash algorithm HASH, data analysis is performed on each migration data in the target database to obtain at least one corresponding hash record, and at least one hash record is used as at least one corresponding verification analysis data.

[0089] For example, based on the standard deviation algorithm (SD) in statistical analysis algorithms, data analysis is performed on each migration data in the target database to obtain at least one standard deviation statistical record, and each of these at least one standard deviation statistical records is used as at least one corresponding verification analysis data.

[0090] Each verification analysis data point represents the correlation between the data volume, data type, and data structure of the corresponding migration data in the target database and the data volume, data type, and data structure of the corresponding migration data in the source database. Furthermore, based on the obtained verification analysis data, a corresponding verification analysis table is generated to reflect the data changes of each migration data point.

[0091] Furthermore, to ensure data consistency, the verification analysis table is compared with the data verification table to obtain the corresponding comparison results. If the verification analysis table and the data verification table are consistent, the data comparison is confirmed to be error-free. Furthermore, based on the comparison results and the historical data view, the historical state of the target data is determined. If the historical state of the target data is confirmed to be consistent with the current state, it is further confirmed that the target data has achieved data migration from the source database to the target database while ensuring data consistency.

[0092] See Figure 5 As shown in the figure, which is a scenario example provided by an embodiment of this application, in the scenario shown, the corresponding target data is obtained from the source database and the target data is divided into a preset n equal parts to obtain n migration data. Furthermore, the above n migration data are migrated to the specified target database through n threads or processes, thereby realizing the data migration of the target data in the source database. In the above process, the migration method based on multi-process / multi-thread increases the amount of data to be migrated within the same time range, shortens the time required for full database migration, and significantly improves the database migration efficiency.

[0093] See Figure 6As shown, a database migration apparatus provided in an embodiment of this application includes an acquisition module 601, a partitioning module 602, a migration module 603, and a verification module 604, wherein:

[0094] The acquisition module 601 is used to retrieve the target data to be migrated from the source database.

[0095] The partitioning module 602 is used to partition the target data into at least one corresponding migration data based on a preset partitioning rule, and generate corresponding migration verification information based on at least one migration data.

[0096] The migration module 603 is used to migrate at least one migration data and migration verification information to a specified target database through corresponding data migration channels.

[0097] The verification module 604 is used to perform data verification on each migration data in the target database based on migration verification information, and to determine the migration result of the target data.

[0098] In an optional embodiment, before retrieving the target data to be migrated from the source database, the retrieval module 601 is further configured to:

[0099] Obtain the source database identifier of the source database, and obtain the target database identifier of the target database.

[0100] A data source connection is established between the source database and the target database based on the source database identifier and the target database identifier.

[0101] In an optional embodiment, before obtaining the target data to be migrated from the source database, the method further includes: obtaining the target database format of the target database; then, when obtaining the target data to be migrated from the source database, the obtaining module 601 is further configured to:

[0102] Retrieve the specified target raw data from the source database.

[0103] The target original data is converted to obtain target converted data corresponding to the target database format, and the target converted data is used as the target data to be migrated.

[0104] In an optional embodiment, when generating corresponding migration verification information based on at least one migration data point, the partitioning module 602 is specifically used for:

[0105] Obtain a historical data view of the source database, wherein the historical data view contains at least: historical migration data of the source database;

[0106] Generate a corresponding data validation table based on the data type of at least one migration data.

[0107] Based on historical data views and data validation tables, corresponding migration validation information is generated.

[0108] In an optional embodiment, when verifying each piece of migration data in the target database based on migration verification information to determine the migration result of the target data, the verification module 604 is specifically used for:

[0109] Based on a preset analysis algorithm, data analysis is performed on each migration data in the target database to obtain at least one corresponding verification analysis data, and a verification analysis table corresponding to at least one verification analysis data is generated.

[0110] The verification analysis table is compared with the data verification table in the migration verification information to obtain the corresponding comparison results. Based on the comparison results and historical data view, the migration result of the target data is determined.

[0111] In an optional embodiment, when performing data analysis on each migration data in the target database based on a preset analysis algorithm to obtain at least one corresponding verification analysis data, the verification module 604 is specifically used for:

[0112] Based on the hash algorithm, data analysis is performed on each migration data in the target database to obtain at least one corresponding hash record, and each hash record is used as at least one corresponding verification analysis data.

[0113] or,

[0114] Based on the standard deviation algorithm (SD), data analysis is performed on each migration data in the target database to obtain at least one standard deviation statistical record, and each of these records is used as at least one verification analysis data.

[0115] Based on the same inventive concept as the embodiments described above, this application also provides an electronic device that can be used for database migration. In one embodiment, the electronic device can be a server, a terminal device, or other electronic equipment. In this embodiment, the structure of the electronic device can be as follows: Figure 7 As shown, it includes a memory 701, a communication interface 703, and one or more processors 702.

[0116] The memory 701 is used to store computer programs executed by the processor 702. The memory 701 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0117] Memory 701 may be volatile memory, such as random-access memory (RAM); memory 701 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 701 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 901 may be a combination of the above-described memories.

[0118] The processor 702 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 702 is used to implement the aforementioned database migration method when it calls a computer program stored in the memory 701.

[0119] Communication interface 703 is used to communicate with terminal devices and other servers.

[0120] This application embodiment does not limit the specific connection medium between the memory 701, the communication interface 703, and the processor 702 described above. This application embodiment... Figure 7 The memory 701 and the processor 702 are connected via a bus 704, and the bus 704 is in Figure 7 The connections between other components are shown in bold lines only and are not intended to be limiting. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0121] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the database migration methods described in the above embodiments. The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0122] This application provides a database migration method, apparatus, electronic device, and storage medium. Specifically, the migration data in the source database is divided, and multi-threading or multi-processing is used to execute corresponding migration operations on the divided data, which significantly improves the migration efficiency of the source database. On the other hand, in this application embodiment, by setting flashback time parameters and historical version query data parameters, the source database stores historical version views of the historical change status of relevant migration data according to the set flashback time period before the multi-threaded or multi-process migration operations are executed. Furthermore, by obtaining the historical version views related to the current migration data and verifying the migration data based on the historical version views, the consistency and integrity of the migration data are ensured, reducing the large time and computation costs caused by verifying each piece of data.

[0123] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0126] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A database migration method characterized by, The method comprises the following steps: obtaining target data to be migrated from a source database; dividing the target data into at least one migration data according to a preset division rule, and obtaining a historical data view of the source database, wherein the historical data view at least includes historical migration data of the source database, and the historical data view is determined based on a corresponding time length between a current time and a preset nearest flashback time point, and a business ID obtained from a preset business balance binary tree; generating a corresponding data verification table based on the data type of each of the at least one migration data; generating corresponding migration check information based on the historical data view and the data verification table; migrating the at least one migration data and the migration check information to a specified target database through a corresponding data migration channel; performing data analysis on each migration data in the target database based on a preset analysis algorithm, obtaining at least one check analysis data, and generating a check analysis table corresponding to the at least one check analysis data; comparing the check analysis table with the data verification table in the migration check information to obtain a corresponding comparison result, and determining a migration result of the target data based on the comparison result and the historical data view.

2. The method of claim 1, wherein, Before the step of obtaining target data to be migrated from a source database, the method further comprises the following steps: obtaining a source database identifier of the source database, and obtaining a target database identifier of the target database; establishing a data source connection between the source database and the target database based on the source database identifier and the target database identifier.

3. The method of claim 1 or 2, wherein, Before the step of obtaining target data to be migrated from a source database, the method further comprises the following step: obtaining a target database format of the target database; and the step of obtaining target data to be migrated from a source database further comprises the following steps: obtaining specified target original data from the source database; performing format conversion on the target original data to obtain target converted data corresponding to the target database format, and taking the target converted data as the target data to be migrated.

4. The method of claim 1, wherein, The step of performing data analysis on each migration data in the target database based on a preset analysis algorithm to obtain at least one check analysis data comprises the following steps: performing data analysis on each migration data in the target database based on a hash algorithm HASH to obtain at least one hash record, and taking the at least one hash record as at least one check analysis data; or performing data analysis on each migration data in the target database based on a standard deviation algorithm SD to obtain at least one standard deviation statistical record, and taking the at least one standard deviation statistical record as at least one check analysis data.

5. A database migration apparatus characterized by comprising: The method comprises the following steps: an obtaining module, configured to obtain target data to be migrated from a source database; The dividing module is configured to divide the target data into at least one migration data according to a preset division rule, and obtain a history data view of the source database, wherein the history data view at least includes history migration data of the source database, and the history data view is determined based on a corresponding time length between a current time and a preset latest flashback time point, and a business ID obtained from a preset business balance binary tree. The migration module is configured to migrate the at least one migration data and the migration check information to a designated target database through a corresponding data migration channel. The check module is configured to perform data analysis on each migration data in the target database based on a preset analysis algorithm, obtain at least one check analysis data, and generate a check analysis table corresponding to the at least one check analysis data; compare the check analysis table with the data verification table in the migration check information to obtain a corresponding comparison result, and determine a migration result of the target data based on the comparison result and the history data view.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the database migration method of any one of claims 1-4.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1-4.

8. A computer program product, characterised in that, The computer program product, when invoked by a computer, causes the computer to perform the steps of the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Database migration data verification method and system

    CN104504122A

  • Data migration method and device

    CN112579569A