Database migration verification method and device, equipment, storage medium and product

By selecting an appropriate consistency verification algorithm based on the importance score and data volume of the database tables during the database migration process, the problem of low efficiency in data consistency verification during non-stop migration is solved, and fast and accurate data consistency verification is achieved.

CN120910018APending Publication Date: 2025-11-07AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511008602.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-07

Smart Images

  • Figure CN120910018A_ABST
    Figure CN120910018A_ABST
Patent Text Reader

Abstract

The invention discloses a database migration verification method and device, an equipment storage medium and a product. The method comprises the following steps: determining an importance score of a to-be-migrated database table contained in a migration task; in each migration stage of the migration task, according to the current migration stage, the importance score of the database table and the data size of the database table, a corresponding consistency verification algorithm is determined, consistency verification is conducted through the determined consistency verification algorithm, and the migration stages comprise the migration preparation stage, the double-writing stage and the migration ending stage. According to the method, the data consistency verification scheme is flexibly selected in the non-stop database migration process, and the data consistency verification speed and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database data migration automation verification, and in particular to a database migration verification method, device, equipment, storage medium and product. BACKGROUND

[0002] With the advent of the era of big data and mobile payment, in the process of updating and iterating the transaction system in various fields, the data in the database often needs to be migrated, and efficient and accurate consistency verification of the data in the migration process is required to ensure the integrity of the data and the continuity of the business.

[0003] At present, the existing database migration data consistency verification method mostly uses migration tools to compare the data in the source database and the target database one by one or uses a single verification method for comparison after the migration task is completed.

[0004] However, the above scheme has low data consistency verification efficiency when facing non-stop database migration tasks. SUMMARY

[0005] The present application provides a database migration verification method, device, equipment, storage medium and product, which can solve the problem of low data consistency verification efficiency in the process of non-stop database migration.

[0006] According to an aspect of the present application, a database migration verification method is provided, comprising:

[0007] determining the importance score of the database table to be migrated in the migration task;

[0008] In each migration stage of the migration task, a corresponding consistency verification algorithm is determined according to the current migration stage, the importance score of the database table and the data volume of the database table, and the determined consistency verification algorithm is used for consistency verification, wherein the migration stage includes a migration preparation stage, a double-write stage and a migration end stage.

[0009] According to another aspect of the present application, a database migration verification device is provided, comprising:

[0010] a database table importance determination module for determining the importance score of the database table to be migrated in the migration task;

[0011] A consistency check module is configured to determine a corresponding consistency check algorithm according to the current migration stage, the importance score of the database table, and the data volume of the database table, and perform consistency check by using the determined consistency check algorithm at each migration stage of the migration task, wherein the migration stage includes a migration preparation stage, a double-write stage, and a migration end stage.

[0012] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory connected to the at least one processor in communication; wherein

[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the database migration verification method according to any one of the embodiments of the present application.

[0016] According to another aspect of the present application, a computer readable storage medium is provided, the computer readable storage medium stores computer instructions for enabling a processor to implement the database migration verification method according to any one of the embodiments of the present application when executed by the processor.

[0017] According to another aspect of the present application, a computer program product is provided, the computer program product comprises a computer program, and the computer program implements the database migration verification method according to any one of the embodiments of the present application when executed by a processor.

[0018] The technical solution of the embodiments of the present application determines the importance score of the database table to be migrated in the migration task; at each migration stage of the migration task, a corresponding consistency check algorithm is determined according to the current migration stage, the importance score of the database table, and the data volume of the database table, and consistency check is performed by using the determined consistency check algorithm, wherein the migration stage includes a migration preparation stage, a double-write stage, and a migration end stage, which realizes flexible selection of a corresponding data consistency check algorithm according to the migration stage of the database table to be migrated, the importance of the database table, and the data volume of the database table in the process of non-stop database migration, and improves the data consistency verification speed and accuracy.

[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to make the technical solution in the embodiments of the present application clearer, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0021] Figure 1 is a flow chart of a database migration verification method according to an embodiment of the present application;

[0022] Figure 2 is a flow chart of a database migration verification method according to an embodiment of the present application;

[0023] Figure 3 is a structural schematic diagram of a database migration verification device according to an embodiment of the present application;

[0024] Figure 4 is a structural schematic diagram of an electronic device implementing the database migration verification method according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the technical solution in the embodiments of the present application clearer, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0026] It should be noted that the terms "first", "second", and the like in the description of the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0027] Embodiment one

[0028] Figure 1A flowchart of a database migration verification method is provided for Embodiment One of the present application. The embodiment can be applied to consistent verification of data during database migration. The method can be executed by a database migration verification device, which can be implemented in the form of hardware and / or software and can be configured in an electronic device. As shown in FIG. 6, the method comprises the following steps. Figure 1

[0029] S110, determining the importance score of a database table to be migrated in the migration task.

[0030] In this embodiment, the migration task can be understood as a process of transferring data from one storage system or database to another storage system or database, for example, transferring data from the database of an old version of a business system to the database of a new version of a business system. The database table to be migrated can be understood as a data object that needs to be transferred in the migration task. Database tables are generally used as the basic structure for storing data. Different database tables generally store different data information, for example, a transaction log table stores transaction log related information, and an order table stores business order related information. The importance score of a database table can represent the importance of the database table. The importance score of a database table can be determined according to the change frequency of data in the database table and / or the importance of data. The importance score can also be determined according to the table type of the database table, and the specific determination method is not limited.

[0031] For example, the importance score of a database table can be determined according to the change frequency of data in the database table, the importance of data, and the corresponding weight coefficient. The change frequency of data in a database table can be determined according to the number of increased or modified entries per minute of the database table. The importance of data can be determined according to a pre-set importance coefficient (which can be set as a percentage). For example, the change frequency of data in a database table to be migrated is 20, the importance coefficient of data is 80, the weight corresponding to the change frequency of data is 0.4, and the weight corresponding to the importance coefficient of data is 0.6. Then, the importance score of the database table is 20*0.4+80*0.6=56.

[0032] S120, in each migration stage of the migration task, determining a corresponding consistency check algorithm according to the current migration stage, the importance score of the database table, and the data volume of the database table, and performing consistency check using the determined consistency check algorithm, wherein the migration stage includes a migration preparation stage, a double-write stage, and a migration end stage.

[0033] ​In the embodiment, the data volume of the database table can include the total data volume of the table and / or the modified data volume of the table. The consistency checking algorithm can include at least one of a full data comparison, a sample data comparison, a checksum function comparison, an incremental data comparison, and a business rule check. The appropriate consistency checking algorithm is selected according to the migration phase of the database table to be migrated, the importance of the database table, and the data volume of the database table. The migration preparation phase can be understood as a phase of completing data synchronization of the source database and the target database before the switching time node. For example, the system performs full synchronization on the source database from T0, reads the source database data from T0, and writes the target database. The full synchronization is completed at T1. Therefore, the period from T0 to T1 is the migration preparation phase. The double-write phase can be understood as a phase of gradually completing dynamic alignment of the source database and the target database by synchronously or asynchronously writing the same data to the source database and the target database without stopping. For example, the system enters the double-write phase from T2 (T2 can be the same as T1 or can be after T1). Since the migration process does not stop, the source database writes new data in the period from T0 to T2. Therefore, the double-write phase not only needs to write the same data to the source database and the target database, but also needs to write the newly added data of the source database in the period from T0 to T2 to the target database, gradually completing the dynamic alignment of the source database and the target database. The corresponding double-write method can be dynamically determined according to the database characteristics and the non-stop business demand, for example, using an asynchronous thread, intercepting from the transaction flow entrance, executing transactions on the source database and the target database respectively, capturing change events through message queue comparison kafka middleware, recording the transaction site, thereby achieving the purpose of double writing and supporting transaction playback. The migration end phase can be understood as a phase of verifying the consistency of the migrated data. If the data is inconsistent, the related data needs to be rolled back.

[0034] For example, a decision tree for selecting a data consistency checking algorithm can be constructed according to the migration phase of the database table, the importance of the database table, and the data volume of the database table. First, the migration phase of the database table to be migrated is selected. Then, the type of the database table is determined according to the importance score of the database table (such as a key table, an important table, a general table, etc.). Finally, the data volume is classified, such as small data volume (less than 10 GB), medium data volume (10 GB to 100 GB), and large data volume (more than 100 GB). The corresponding data consistency checking algorithm is determined according to the constructed decision tree. For example, the database table to be migrated is currently in the double-write phase, is determined as a key table according to the importance score, and the data volume classification is small data volume. Therefore, the decision tree determines that the full data comparison is used for consistency checking of the database table.

[0035] The embodiment of the present application provides a database migration verification method, solves the problem of low data consistency verification efficiency in the process of non-stop database migration, determines the importance score of the database table to be migrated in the migration task; in each migration stage of the migration task, a corresponding consistency check algorithm is determined according to the current migration stage, the importance score of the database table and the data volume of the database table, and the determined consistency check algorithm is used for consistency check, wherein the migration stage includes a migration preparation stage, a double-write stage and a migration end stage, so that in the process of non-stop database migration, the corresponding data consistency check algorithm is flexibly selected according to the migration stage of the database table to be migrated, the importance of the database table and the data volume of the database table, and the data consistency verification speed and accuracy are improved.

[0036] Embodiment two

[0037] Figure 2 A flowchart of a database migration verification method provided by the second embodiment of the present application is provided, and the embodiment is refined on the basis of the above-mentioned embodiment. As shown in the figure, the method comprises: Figure 2

[0038] S210, determining the importance score of the database table according to the historical data sampling result, the preset important database table list and the data volume variation of the database table to be migrated in each migration stage of the migration task.

[0039] The historical data sampling result is a result of data sampling on the database table in the source database of the migration task in a preset historical sampling period.

[0040] In the embodiment, the historical sampling period can be understood as a continuous or discontinuous time interval before the start of the migration task; the historical data sampling result can include the data change of the database table to be migrated obtained by interface burying or sampling of log information in the preset historical sampling period; the preset important database table list can be understood as an important database table list determined in advance according to the importance of the record data in the database table; the data volume variation can include the data increase and change of the database table, since the data variation of the database table after the start of the migration task can be inconsistent with the data variation in the historical sampling period, and the data variation can also have great difference in different stages of the migration task, therefore, the importance of the database table needs to be determined in combination with the data volume variation of the table in each migration stage of the migration task.

[0041] ​Optionally, the historical data sampling result includes whether each type of business transaction causes data increase or modification of the database table in the source database and corresponding data increase or modification amount in the preset historical sampling period; wherein the historical data sampling result is used to determine the table type of the database table, and different table types have different influence degrees on the importance score of the database table; the table type includes a static parameter table, a transaction log table, a common business data table and an important business data table. The advantage of this setting is that by recording the data increase or modification and the data increase or modification amount of the database table in the historical sampling period, the identification accuracy of the high-frequency variable database table can be improved; according to the historical data sampling result, the table type of the database table is divided, and by differentiating the importance score of the table type, the database table that has a greater impact on the business can have a higher importance score.

[0042] For example, according to the sampling result, it is found that the database table A has no change in the historical sampling period, so it can be initially considered that the database table A is a static parameter table; according to the sampling result, it is found that the database table B has a high data increase or modification frequency in the historical sampling period, and each transaction increases a record, and the importance level of the database table in the preset important database table list is low, so it can be initially considered that the database table B is a transaction log table; according to the sampling result, it is found that the database table C has a medium data increase or modification frequency in the historical sampling period, and the importance level of the database table in the preset important database table list is high, so it can be initially considered that the database table C is an important business data table, and the importance scores of the database tables of different types are different; after the type of the database table is initially determined, the data amount change of the database table in the migration stage is combined, and the importance score of the database table in the current migration stage is obtained according to the preset weight value.

[0043] S220, in each migration stage of the migration task, according to the current migration stage, the importance score of the database table and the data amount of the database table, a corresponding consistency checking algorithm is matched from a preset consistency checking algorithm library, and consistency checking is performed by using the determined consistency checking algorithm.

[0044] In the embodiment, the preset consistency check algorithm library includes, but is not limited to, full data comparison, sample data comparison (randomly extracting data of the database table for comparison), checksum function comparison (such as calculating MD5 value or CRC32 value of the database table), incremental data comparison (only comparing newly added or modified data), and business rule check (verifying data correctness based on business logic, such as verifying whether the total amount in the order table is equal to the product of unit price and quantity), and the like. The consistency check algorithm can be matched through multiple dimensions of the current migration stage of the database table, the importance score of the database table, and the data volume of the database table.

[0045] For example, first, the stage in which the database table to be migrated is determined. The requirements for the check target are different in different stages. For example, the end stage of migration needs to ensure complete consistency of data, the double-write stage needs to balance migration speed and migration accuracy, and the pre-migration stage needs to ensure that the data of the source database and the target database are synchronized before the switching time node. The database table can be classified according to the importance score, such as dividing the importance score in the percentage system into three levels: important (70-100 points), general (40-70 points), and unimportant (less than 40 points). The database table can be divided into three levels according to the data volume: large (more than 100 GB), medium (10-100 GB), and small (less than 10 GB). The matching rules can be as shown in the following table:

[0046] Table 1 Consistency check algorithm matching rules

[0047]

[0048] The matching rules can be constructed by a decision tree. For example, the root node is the migration stage, the second layer of child nodes is the importance score level of the database table, the third layer of child nodes is the data volume of the database table, and the leaf node is the consistency check algorithm. The corresponding consistency check algorithm is obtained by layer-by-layer judgment.

[0049] S230, for the double-write stage, in the case where the consistency check result is abnormal, abnormal rollback processing is performed.

[0050] In the embodiment, the abnormal rollback processing can be understood as follows: after the target database and the source database become inconsistent, the abnormal data in the source database and the target database are rolled back to the state at the key rollback time node T_Roll by a rollback operation, wherein the key rollback time node T_Roll can be determined according to the data inconsistency condition; the rollback mode can include table dimension rollback and transaction dimension rollback; the table dimension rollback can determine the operation record of the database table during the abnormal period by comparing the database log information, and the corresponding reverse operation instruction (for example, if the operation record shows that new data is added, the new data can be changed to deleted data) can be generated according to the operation record; according to the importance and dependency relationship of the database table, the reverse operation instruction is executed in sequence to complete the rollback of the table data; the transaction dimension rollback can take each transaction as an independent rollback unit by using the transaction flow interception and message queue technology, and the data related to the abnormal transaction is rolled back to the state at the T_Roll time point by intercepting the transaction flow and analyzing the transaction information. In addition, in each stage of the migration process, risk warning needs to be performed according to the importance of the database table and the result of the data consistency check, to determine the risk condition of the current migration state, and to assist the migration staff to make decisions whether to enter the next migration stage.

[0051] The embodiment of the application determines the importance score of the database table according to the historical data sampling result, the preset important database table list, and the data amount variation of the database table to be migrated in each migration stage of the migration task, so that the historical data, the data in the current stage, and the importance level in the preset important database table list are comprehensively considered when determining the importance of the database table to be migrated, and the accuracy of the importance score of the database table is improved; in each migration stage of the migration task, the corresponding consistency check algorithm is matched from the preset consistency check algorithm library according to the current migration stage, the importance score of the database table, and the data amount of the database table, and the determined consistency check algorithm is used for consistency check, so that the consistency check algorithm is flexibly matched according to the importance and the data amount of the database table in different migration stages, and the data consistency verification efficiency is improved; in the double-write stage, the abnormal rollback processing is performed when the consistency check result is determined to be abnormal, so that the data consistency in the data migration process is ensured.

[0052] On the basis of any of the above embodiments, further comprising: after the end of the migration end phase, performing secondary consistency check on the changed data involved in the double-write phase;According to the consistency check result corresponding to each migration phase, generate a data migration report. The advantage of this setting is that, by performing secondary consistency check on the changed data involved in the double-write phase after the end of the migration end phase, the accuracy of the data check result is further improved;By generating a data migration report according to the consistency check result corresponding to each migration phase, the migration staff can make decision and judgment, and ensure the data consistency of the source database and the target database after data migration.

[0053] Embodiment three

[0054] Figure 3 A structure diagram of a database migration verification device provided by the third embodiment of the application is shown in the figure. Figure 3 As shown in the figure, the device comprises a database table importance determination module 301 and a consistency check module 302.

[0055] The database table importance determination module is configured to determine the importance score of the database table to be migrated in the migration task.

[0056] The consistency check module is configured to, in each migration phase of the migration task, determine a corresponding consistency check algorithm according to the current migration phase, the importance score of the database table, and the data volume of the database table, and perform consistency check by using the determined consistency check algorithm, wherein the migration phase comprises a migration preparation phase, a double-write phase, and a migration end phase.

[0057] The database migration verification device provided by the embodiment of the application solves the problem of low data consistency verification efficiency in the process of non-stop database migration, by determining the importance score of the database table to be migrated in the migration task, in each migration phase of the migration task, determining a corresponding consistency check algorithm according to the current migration phase, the importance score of the database table, and the data volume of the database table, and performing consistency check by using the determined consistency check algorithm, wherein the migration phase comprises a migration preparation phase, a double-write phase, and a migration end phase, so that in the process of non-stop database migration, the corresponding data consistency check algorithm is flexibly selected according to the migration phase of the database table to be migrated, the importance of the database table, and the data volume of the database table, and the data consistency verification speed and accuracy are improved.

[0058] Optionally, the database table importance determination module is specifically configured to:

[0059] According to historical data sampling results, a preset important database table list, and data volume variation of a database table to be migrated in each migration stage of a migration task, an importance score of the database table is determined, wherein the historical data sampling results are results of data sampling on the database table in a source database of the migration task in a preset historical sampling period.

[0060] Optionally, the historical data sampling results include whether each type of business transaction causes data increment or modification of the database table in the source database and corresponding data increment or modification volume in the preset historical sampling period; wherein the historical data sampling results are used to determine a table type of the database table, and different table types have different influence degrees on the importance score of the database table; and the table type includes a static parameter table, a transaction log table, a common business data table and an important business data table.

[0061] Optionally, the determining of the corresponding consistency check algorithm according to the current migration stage, the importance score of the database table and the data volume of the database table includes: matching the corresponding consistency check algorithm from a preset consistency check algorithm library according to the current migration stage, the importance score of the database table and the data volume of the database table.

[0062] Optionally, the apparatus further comprises:

[0063] The abnormal rollback module is configured to, in the double-writing stage, perform abnormal rollback processing when it is determined that the check result of the consistency check is abnormal.

[0064] Optionally, the apparatus further comprises:

[0065] The secondary consistency check module is configured to, after the end of the end migration stage, perform secondary consistency check on the changed data involved in the double-writing stage.

[0066] The data migration report generation module is configured to generate a data migration report according to the consistency check result corresponding to each migration stage.

[0067] The database migration verification apparatus provided in the embodiments of the present application can perform the database migration verification method provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0068] Embodiment Four

[0069] Figure 4A structural diagram of an electronic device 400 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present application described and / or claimed in this document.

[0070] As shown in Figure 4 The electronic device 400 includes at least one processor 401, and memory, such as read-only memory (ROM) 402, random access memory (RAM) 403, etc., communicatively connected to the at least one processor 401, where the memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 402 or loaded into the random access memory (RAM) 403 from the storage unit 408. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0071] Various components in the electronic device 400 are connected to the I / O interface 405, including an input unit 406, such as a keyboard, a mouse, etc., an output unit 407, such as various types of displays, speakers, etc., a storage unit 408, such as a magnetic disk, an optical disk, etc., and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0072] The processor 401 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 401 performs various methods and processes described above, such as the database migration verification method.

[0073] In some embodiments, the database migration verification method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 408. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 400 via, e.g., ROM 402 and / or communication unit 409. When the computer program is loaded onto RAM 403 and executed by processor 401, one or more steps of the above-described database migration verification method can be performed. Alternatively, in other embodiments, processor 401 can be configured to perform the database migration verification method by other means, e.g., with the aid of firmware.

[0074] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0075] Computer programs implementing methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0076] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0077] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0078] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0079] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0080] The embodiment of the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the database migration verification method provided by the above-mentioned embodiment.

[0081] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be executed in parallel, in sequence, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, and the present application is not limited herein.

[0082] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A database migration verification method, characterized by, The method comprises: determining an importance score of a database table to be migrated in a migration task; in each migration phase of the migration task, determining a corresponding consistency check algorithm according to the current migration phase, the importance score of the database table, and the data volume of the database table, and performing consistency check by using the determined consistency check algorithm, wherein the migration phase comprises a migration preparation phase, a double-write phase, and a migration end phase.

2. The method of claim 1, wherein, The method of determining the importance score of the database table to be migrated in the migration task comprises: determining the importance score of the database table according to historical data sampling results, a preset important database table list, and a data volume variation of the database table to be migrated in each migration phase of the migration task, wherein the historical data sampling results are results of data sampling on the database table in a source database of the migration task within a preset historical sampling period.

3. The method of claim 2, wherein, The historical data sampling results comprise whether each type of business transaction causes data increase or modification of the database table in the source database and the corresponding data increase or modification volume within the preset historical sampling period; wherein the historical data sampling results are used to determine a table type of the database table, and different table types have different influence degrees on the importance score of the database table; the table type comprises a static parameter table, a transaction log table, a common business data table, and an important business data table.

4. The method of claim 1, wherein, The method of determining the corresponding consistency check algorithm according to the current migration phase, the importance score of the database table, and the data volume of the database table comprises: determining the corresponding consistency check algorithm from a preset consistency check algorithm library according to the current migration phase, the importance score of the database table, and the data volume of the database table.

5. The method according to any of claims 1 to 4, characterized in that, The method further comprises: for the double-write phase, performing abnormal rollback processing when the check result of the consistency check is abnormal.

6. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: after the migration end phase ends, performing secondary consistency check on the changed data involved in the double-write phase; generating a data migration report according to the consistency check results corresponding to each migration phase.

7. A database migration verification apparatus characterized by comprising: The method comprises: a database table importance determination module configured to determine an importance score of a database table to be migrated in a migration task; a consistency check module configured to, in each migration phase of the migration task, determine a corresponding consistency check algorithm according to the current migration phase, the importance score of the database table, and the data volume of the database table, and perform consistency check by using the determined consistency check algorithm, wherein the migration phase comprises a migration preparation phase, a double-write phase, and a migration end phase.

8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the database migration verification method in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the database migration verification method according to any one of claims 1-6 when executed.

10. A computer program product, characterised in that, The computer program product comprises a computer program which, when executed by the processor, implements the database migration verification method according to any one of claims 1-6.