Database migration verification method and device, equipment and storage medium

By comparing the response messages of old and new systems and sampling comparison of new and old database data tables, the problems of difficulty in database migration verification and high business risks in the existing technology are solved, and a comprehensive database migration verification is achieved, ensuring the migration Completeness and accuracy.

CN119396797APending Publication Date: 2025-02-07CHINA MERCHANTS BANK
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411403613.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

Existing database migration verification technology has shortcomings in ensuring data consistency and system functional integrity. Especially in heterogeneous database migration and complex business systems, it is difficult to fully reveal potential data inconsistencies and evaluate its business logic and system performance. Influence.

Method used

By comparing the old system with the response packets of the new system for the same request packets, and combining sampling comparisons of the old and new database data tables, verification results are obtained to ensure the accuracy and completeness of the migration.

Benefits of technology

It realizes all-round verification from the data level to the functional level, ensures the integrity and accuracy of database migration, reduces business risks, and improves the reliability and efficiency of migration work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396797A_ABST
    Figure CN119396797A_ABST
Patent Text Reader

Abstract

The invention discloses a database migration verification method and device, equipment and a storage medium. The method comprises the steps that data stored in an old database of an old system is migrated into a new database of a new system; obtaining a first response message obtained based on the request message of the old system and a second response message obtained based on the request message of the new system; comparing the first response message with the second response message to obtain a first comparison result; performing sampling comparison on the data tables of the new database and the old database to obtain a second comparison result; and evaluating difference data of the first comparison result and the second comparison result to obtain a verification result. According to the technical scheme, comprehensive verification from the data level to the function level is achieved, and the integrity and accuracy of database migration are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a database migration verification method, device, equipment and storage medium. Background Art

[0002] In the field of information technology, database migration is a key link in the process of IT system upgrade, optimization and cloud transformation, and its importance is self-evident. However, database migration is complex and challenging, especially in ensuring data consistency and system functional integrity. At present, mainstream database migration verification technology mainly focuses on data comparison at the database level, verifying the accuracy of migration by comparing the data in the database table before and after migration. This method shows high efficiency and reliability in the migration of isomorphic databases with similar structures and consistent data types.

[0003] However, when faced with heterogeneous database migration scenarios (such as migrating from Oracle to MySQL), due to differences in data type definition, data precision processing, etc. between different database systems, simple data comparison is difficult to fully reveal potential data inconsistency problems, and it is even more difficult to effectively evaluate the far-reaching impact that such inconsistencies may have on business logic and system performance.

[0004] In addition, database migration is often accompanied by the adaptation and modification of application layer codes, which may directly or indirectly affect the business functions of the system. Unfortunately, most of the current verification technologies do not take code-level verification into consideration, resulting in blind spots in the integrity verification of system functions after migration. Although the testing department has taken on the responsibility of system function verification, it is limited by the limitations of testing methods (such as black box testing), making it difficult to fully cover all business logic paths, and unable to gain in-depth insight into changes in the system's internal data processing flow, thereby increasing the possibility of inconsistent business functions and potential system risks after migration.

[0005] In summary, the existing database migration verification technology has obvious shortcomings in ensuring data consistency and system functional integrity, especially when dealing with heterogeneous database migration and complex business systems, its limitations are particularly prominent. Summary of the invention

[0006] The main purpose of this application is to provide a database migration verification method, device, equipment and storage medium, aiming to solve the technical problems of difficult database migration verification and high business risks.

[0007] To achieve the above object, the present application provides a database migration verification method, which comprises the following steps:

[0008] Migrate the data stored in the old database of the old system to the new database of the new system;

[0009] Obtain a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message;

[0010] Compare the first response message with the second response message to obtain a first comparison result;

[0011] Perform sampling comparison on the data tables of the new and old databases to obtain a second comparison result;

[0012] The difference data between the first comparison result and the second comparison result is evaluated to obtain a verification result.

[0013] In one embodiment, the step of migrating the data stored in the old database of the old system to the new database of the new system includes:

[0014] Determine a mapping relationship between the new and old databases, and convert the data stored in the old database into compatible data of the new database according to the mapping relationship;

[0015] Execute data migration and verify the migrated data according to the preset verification rules. Correct the migration process based on the verification results until all data passes the verification.

[0016] In one embodiment, before the step of obtaining a first response message obtained based on the request message of the old system and a second response message obtained by the new system based on the request message, the step further includes:

[0017] Receive requests from the old system front-end and distribute the requests to the old system back-end service for processing.

[0018] In one embodiment, the step of comparing the first response message with the second response message to obtain a first comparison result includes:

[0019] Use a regular expression to match the first response message and the second response message and obtain a matching result;

[0020] The difference data in the matching result is extracted and a first comparison result is generated.

[0021] In one embodiment, the step of performing sampling comparison on the data tables of the new and old databases to obtain the second comparison result includes:

[0022] At preset time intervals, sample data is extracted from the designated data tables of the new and old databases according to preset sampling rules;

[0023] A consistency check is performed on the sample data of the data tables in the new and old databases to obtain a second comparison result.

[0024] In one embodiment, after the step of evaluating the difference data between the first comparison result and the second comparison result to obtain a verification result, the step further includes:

[0025] If the verification result determines that the migration has failed, the problem is checked based on the difference data of the first comparison result and / or the second comparison result, and corresponding corrective measures are taken according to the difference processing logic.

[0026] In one embodiment, the steps of troubleshooting the problem based on the difference data of the first comparison result and / or the second comparison result and taking corresponding corrective measures based on the difference processing logic include:

[0027] Troubleshoot the difference data and formulate difference processing logic according to the result of the troubleshooting;

[0028] The difference data is corrected according to the difference processing logic and the correction result is fed back.

[0029] In addition, to achieve the above-mentioned purpose, the present application also provides a database migration verification device, the database migration verification device comprising:

[0030] The data migration module is used to migrate the data stored in the old database of the old system to the new database of the new system;

[0031] A forwarding receiving module, used to obtain a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message;

[0032] A message comparison module, used to compare the first response message with the second response message to obtain a first comparison result;

[0033] The data comparison module is used to perform sampling comparison on the data tables of the new and old databases to obtain a second comparison result;

[0034] An evaluation module is used to evaluate the difference data between the first comparison result and the second comparison result to obtain a verification result.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a terminal device, which includes a memory, a processor, and a database migration verification program stored on the memory and executable on the processor, and the database migration verification program, when executed by the processor, implements the steps of the database migration verification method as described above.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a database migration verification program is stored, and when the database migration verification program is executed by a processor, the steps of the database migration verification method described above are implemented.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] This application can directly capture the changes in system behavior caused by database migration and potential code adjustments by directly comparing the response messages of the old system and the new system to the same request message, thereby ensuring the correctness of the system functions after migration. This verification method based on actual business requests can better reflect the performance of the system in actual operation compared to traditional static data comparison, and effectively solves the defect of ignoring system function verification in the prior art.

[0039] At the same time, combined with the sampling comparison of the data tables of the new and old databases, this application not only verifies the basic consistency of the migrated data, but also covers the diversity of the data set through the sampling strategy, improving the comprehensiveness and efficiency of the verification. This step supplements the data level issues that may be missed by relying solely on the response message comparison, further ensuring the reliability of the migration.

[0040] Compared with the existing technology, this technical solution realizes all-round verification from the data level to the functional level, ensuring the integrity and accuracy of database migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flowchart of a first exemplary embodiment of a database migration verification method of the present application;

[0042] Figure 2 This is a flow chart of a second exemplary embodiment of the database migration verification method of the present application;

[0043] Figure 3 This is a flowchart of a third exemplary embodiment of the database migration verification method of the present application;

[0044] Figure 4 This is a schematic diagram of the module structure of the database migration verification device according to an embodiment of the present application;

[0045] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the database migration verification method in the embodiment of the present application.

[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The main solution of the embodiment of the present application is: migrate the data stored in the old database of the old system to the new database in the new system; obtain a first response message based on the request message of the old system, and a second response message obtained by the new system based on the request message; compare the first response message with the second response message to obtain a first comparison result; perform a sampling comparison on the data tables of the new and old databases to obtain a second comparison result; evaluate the difference data between the first comparison result and the second comparison result to obtain a verification result.

[0049] Compared with the limitations of the existing technology that only focuses on database table data consistency and ignores the system function verification, this technical solution realizes all-round verification from the data level to the functional level by combining the dual verification methods of request message response comparison and data table sampling comparison, ensuring the integrity and accuracy of database migration, reducing business risks, and improving the reliability and efficiency of migration work.

[0050] The executor of the method of this embodiment can be a database migration verification device, or a database migration verification terminal device or server. This embodiment takes a database migration verification device as an example. The database migration verification device can be integrated in a terminal device such as a smart phone, a tablet computer, etc. with data processing functions.

[0051] Specifically, the following are the detailed steps of an exemplary embodiment of the database migration verification method:

[0052] Reference Figure 1 , Figure 1 This is a flowchart of the first exemplary embodiment of the database migration verification method of the present application. In this embodiment, the database migration verification method includes steps S10 to S50:

[0053] Step S10, migrating the data stored in the old database of the old system to the new database of the new system;

[0054] In a feasible implementation, step S10 may include steps S11 to S12:

[0055] Step S11, determining a mapping relationship between the new and old databases, and converting the data stored in the old database into compatible data of the new database according to the mapping relationship;

[0056] First, analyze the differences between the old database (such as DB2) and the new database (such as Oracle) in terms of data type, precision, storage format, etc. Through comparative analysis, develop a mapping table that clearly defines how each field in the old database corresponds to the corresponding field in the new database, including data type conversion rules, precision adjustment strategies, etc.

[0057] For example, a CHAR field in DB2 may need to be converted to Oracle's VARCHAR2 type, and character encoding conversion may also be required to take into account character set differences. For date and time types, DB2's DATE may need to be converted to Oracle's DATE or TIMESTAMP type and handle time zone differences.

[0058] After determining the mapping relationship, write a data conversion script or use a data migration tool to convert the data in the old database into a format compatible with the new database according to the mapping relationship table. These scripts or tools will traverse all tables in the old database, apply the corresponding conversion rules to each field, and temporarily store the converted data in an intermediate storage medium (such as a file, temporary database, etc.) for subsequent migration.

[0059] Step S12, execute data migration and verify the migrated data according to preset verification rules, and correct the migration process according to the verification result until all data pass the verification.

[0060] After the data conversion is completed, the converted data is migrated from the intermediate storage medium to the new database system using the migration platform or manual operation. During the migration process, it is necessary to ensure the integrity and consistency of the data to avoid data loss or damage.

[0061] After the migration is completed, the preset verification rules are executed to verify the migrated data. These verification rules can include data type consistency verification, data accuracy verification, data integrity verification, etc.

[0062] The verification process is usually completed by writing SQL query statements or using data verification tools. For example, you can write SQL statements to compare the number of records in the same table in the new and old databases, the aggregate value of a specific field, etc. to verify the integrity of the data migration. At the same time, you can also use data verification tools to automatically execute complex verification logic and generate detailed verification reports.

[0063] If data inconsistencies or errors are found during the verification process, the migration process needs to be corrected based on the verification results. Correction methods may include re-executing data conversion scripts, adjusting mapping relationships, fixing data errors, etc. The correction process may need to be repeated until all data passes the verification to ensure that the migrated data is fully compatible with the new database system and is accurate.

[0064] Step S20, obtaining a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message;

[0065] Specifically, first, the backend of the old system and the new system are appropriately adapted. The purpose of this modification is to enable the system backend to forward the received request messages and generated response messages to the message comparison tool. For example, suppose the old system is a traditional e-commerce platform, and the new system is a modern e-commerce platform based on cloud computing. During the modification process, it is necessary to add logging or message sending functions to the backend code of the old system and the new system respectively, so that relevant information can be automatically sent to the message comparison tool when request processing and response generation.

[0066] Next, when the request from the system front-end reaches the old system back-end, the old system will process the request according to its normal business process. For example, a user submits a request to purchase a product on the front-end. The old system back-end will receive the request and generate a response message based on the product inventory, user account information and other data, such as confirmation of order success or insufficient inventory. At the same time, the request message and the response message generated by the old system will be automatically forwarded to the message comparison tool.

[0067] After receiving this information, the message comparison tool immediately parses the content of the request message, reconstructs the request, and sends it to the new system backend. During this process, the message comparison tool needs to simulate the actual application scenario to ensure that the new system backend can receive the same request message as the old system and trigger its processing logic. For example, in this case, the message comparison tool will resend the user's purchase request to the new system backend, and the new system backend will generate a response message based on its business logic, such as confirmation that the order is successful or that the user needs to perform additional verification.

[0068] Finally, the message comparison tool will receive the response message generated by the new system backend and compare it with the response message of the old system. This comparison process may involve many aspects, such as the format, content, status code, etc. of the response message. Through the comparison, the differences between the new system and the old system when processing the same request can be found, so as to conduct further debugging and optimization.

[0069] Step S30, comparing the first response message and the second response message to obtain a first comparison result;

[0070] In a feasible implementation, step S30 may include steps S31 to S32:

[0071] Step S31, using a regular expression to match the first response message and the second response message and obtain a matching result;

[0072] Specifically, suppose an online shopping platform is undergoing a system upgrade. The old system uses a traditional database and server architecture, while the new system uses a microservice architecture and cloud database. During a system upgrade test, a user submits a request to purchase a product through the front end. This request is first received and processed by the back end of the old system, which generates a first response message containing fields such as order details, payment status, and product information. At the same time, this request is also forwarded to the message comparison tool.

[0073] After receiving the response message from the old system, the message comparison tool immediately forwards the same request to the new system backend. After receiving the request, the new system backend generates a second response message based on its internal logic and database status. This message also contains fields such as order details, payment status, and product information. However, due to differences in system architecture and data processing methods, the values ​​or formats of some fields may be different from those of the old system.

[0074] In order to compare the consistency of the two response messages, the message comparison tool began to use pre-defined regular expressions for matching. These regular expressions are written according to the pre-agreed protocol and data format between the old system and the new system, and can accurately locate and match the key fields and data content in the response messages.

[0075] For example, for the order details field, you can define a regular expression to match subfields such as order number, product name, and purchase quantity. For the payment status field, you can define a simple regular expression to match status values ​​such as "paid" and "unpaid". For the product information field, you can define a more complex regular expression to match detailed information such as product ID, price, and inventory.

[0076] Use the corresponding regular expression to match each field of the first response message and the second response message one by one. If the values ​​of the two fields meet the matching rules of the regular expression, the two fields are considered to be matched; if the value of one field does not meet the matching rules, the two fields are considered to be unmatched.

[0077] During the comparison process, all matching successes and failures are recorded and a preliminary matching result is generated. This matching result will show which fields are consistent in the two response messages, which fields are inconsistent, and the specific reasons for the inconsistency (such as different values, different formats, etc.).

[0078] In this way, the differences between the new system and the old system in processing the same request can be quickly and accurately discovered, allowing for further debugging and optimization.

[0079] Step S32, extracting the difference data in the matching result and generating a first comparison result.

[0080] After obtaining the matching results, the message comparison tool will further process the data and extract all inconsistent parts, that is, the difference data. The difference data may include changes in field values, missing fields, or the appearance of additional fields. For example, there is a response message for querying an order, and the order status field returned by the old and new systems is inconsistent (the old system is "shipped", and the new system is "out of stock"). The message comparison tool will identify this difference and record it. At the same time, for other fully matched fields, such as order number, customer name, etc., their consistency will also be confirmed.

[0081] A first comparison result report is generated based on these difference data. The report lists all inconsistent fields and their positions, old values, and new values ​​in the original message. For example, the report may show: "The order status field is 'shipped' in the old system and 'out of stock' in the new system, position: row 3, column 5."

[0082] Step S40, performing sampling comparison on the data tables of the new database and the old database to obtain a second comparison result;

[0083] In a feasible implementation, step S40 may include steps S41 to S42:

[0084] Step S41, extracting sample data from designated data tables of the new and old databases according to preset sampling rules at preset time intervals;

[0085] Specifically, after the data migration is completed, in order to continuously monitor and verify the consistency of the migrated data, it is necessary to regularly extract sample data from the new and old databases for comparison. This step first determines an appropriate time interval, such as once every 5 minutes, which depends on the business needs of the system and the frequency of data updates. Then, define the sampling rules, such as extracting the latest first 1,000 records in each table as samples each time.

[0086] Assume that there are two databases: the old database DB_Old and the new database DB_New, both of which contain the user information table User_Info. According to the preset sampling rules, the system automatically performs a data extraction task every 5 minutes. Extract the latest first 1000 user records from the User_Info table of DB_Old, and similarly, extract the latest first 1000 records from the User_Info table of DB_New. These records will be used as sample data for this comparison.

[0087] Step S42: Perform consistency check on sample data in the data tables in the new and old databases to obtain a second comparison result.

[0088] After obtaining sample data from the new and old databases, the data is checked for consistency. This step usually involves comparing the records in the sample data field by field to check whether there are any differences, such as inconsistent data content, mismatched data volume, etc. Once an inconsistency is found, a comparison report is generated to record the details of the difference for further investigation and repair by developers.

[0089] According to the user information table User_Info in the above example, compare the sample data extracted from DB_Old and DB_New field by field. For example, check whether the ID, name, age, email and other fields of each user are consistent. If it is found that the age of a user is inconsistent in the two databases (such as 25 in DB_Old and 26 in DB_New), record this difference as part of the second comparison result. After the comparison is completed, generate a comparison report, listing all the inconsistencies found, so that the development team can deal with them in a timely manner.

[0090] Step S50: evaluating the difference data between the first comparison result and the second comparison result to obtain a verification result.

[0091] Specifically, review the first comparison result report, which lists in detail all the difference data found through message comparison. These difference data may involve changes in field values, missing or added fields, etc., such as the inconsistency of the order status field mentioned earlier between the old and new systems. Analyze these differences one by one to determine whether they are expected changes (such as normal changes caused by business logic adjustments) or caused by errors in the migration process (such as data conversion errors, code logic errors). For unexpected differences, mark them as pending items and prepare for further troubleshooting and correction work.

[0092] Next, evaluate the second comparison result. This step is achieved through data comparison. Sample comparison is performed on key tables in the two databases at regular intervals (such as every 5 minutes) to check data consistency. If there are data inconsistencies, such as data volume differences, field value mismatches, etc., it is also necessary to determine its nature, distinguish whether it is a normal business change or a migration error, and take corresponding measures.

[0093] After combining the first and second comparison results, an overall assessment is conducted. The distribution and type of the difference data and its impact on system functions and business logic are analyzed to evaluate the overall quality of the migration work. If the difference data is small and most of the changes are expected, then the migration work can be considered to be relatively successful; if the difference data is large or there are serious unexpected errors, further in-depth investigation of the causes is required and appropriate remedial measures should be taken.

[0094] Finally, an assessment report is written based on the assessment results, summarizing the achievements and problems found in the migration verification work, and proposing follow-up recommendations and action plans.

[0095] Further, refer to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the database migration verification method of this application. Figure 1 In the embodiment shown, in this embodiment, step S20 may include step S60:

[0096] Step S60, receiving a request from the old system front end, and distributing the request to the old system back end service for processing.

[0097] It should be noted that the old system receives requests from the front end. These requests can be initiated by users and submitted to the system through the web interface, API interface or other means. These requests contain the information required to perform specific operations, such as querying orders, updating user information, etc.

[0098] After receiving the request, according to the preset rules or configuration, these requests are distributed to the backend service of the old system for processing. The so-called backend service of the old system refers to the backend logic processing part of the application system that has been deployed and running stably before the database migration.

[0099] The process of distributing requests to the backend service of the old system usually involves network communication and data transmission. The system can communicate with the backend of the old system through protocols such as HTTP, HTTPS, and TCP, and send the request data to the backend service in the form of a message. After receiving the request message, the backend of the old system will process it according to its own business logic and generate a corresponding response message to return to the message comparison module.

[0100] Further, refer to Figure 3 , Figure 3 This is a flow chart of the third embodiment of the database migration verification method of this application. Figure 1 In the embodiment shown, in this embodiment, step S50 may include step S70:

[0101] Step S70: If the verification result determines that the migration has failed, troubleshooting is performed based on the difference data of the first comparison result and / or the second comparison result, and corresponding corrective measures are taken based on the difference processing logic.

[0102] In a feasible implementation, step S70 may include steps S71 to S72:

[0103] Step S71, troubleshooting the difference data and formulating difference processing logic according to the troubleshooting results;

[0104] Specifically, first review the difference data identified in step S50. The difference data may be caused by a variety of reasons, including but not limited to processing inconsistencies caused by database syntax differences, errors introduced by application logic modification, or data corruption during data migration. Use logs, error reports, system monitoring and other tools to check the difference data one by one and locate the root cause of the problem.

[0105] Based on the above analysis, formulate the difference processing logic. This includes determining which differences are caused by technical problems in the database migration process, which are caused by improper code modification of the application system, and the specific corrective measures to be taken for each type of difference. For example, for the problem of inconsistent data types, it may be necessary to adjust the type conversion rules in the data migration script; for application logic errors, it is necessary to modify the corresponding code logic.

[0106] Step S72, correcting the difference data according to the difference processing logic and feeding back the correction result.

[0107] Specifically, according to the difference processing logic formulated in step S71, the system is modified accordingly. This may include modifying the structure or data of the database table, adjusting the code logic of the application system, or updating the configuration file. After the modification is completed, the relevant message comparison and data comparison processes are re-executed to verify whether the modification effectively solves the previous problem. Once all the difference data are successfully corrected and the verification results show that the system functions and data are in line with expectations, the correction process and results are recorded.

[0108] For example, suppose that during the message comparison process, it is found that in the response message of a transaction request, the amount field returned by the new system has two fewer decimal places than the old system. Through troubleshooting, it is found that this is caused by improper setting of the precision of the amount field in the new database. Based on this discovery, the following difference processing logic is formulated: first, adjust the precision setting of the corresponding amount field in the new database to keep it consistent with the old database; then, re-execute the migration script to migrate the adjusted data to the new database; finally, perform message comparison again to confirm whether the problem has been resolved. If the comparison result shows that the difference has been eliminated, it means that the difference processing logic is valid and the correction is successful.

[0109] In addition, the present application also proposes a database migration verification device, the database migration verification device comprising:

[0110] A data migration module 10 is used to migrate the data stored in the old database of the old system to the new database of the new system;

[0111] The forwarding receiving module 20 is used to obtain a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message;

[0112] A message comparison module 30, used to compare the first response message with the second response message to obtain a first comparison result;

[0113] The data comparison module 40 is used to perform sampling comparison on the data tables of the new and old databases to obtain a second comparison result;

[0114] The evaluation module 50 is used to evaluate the difference data between the first comparison result and the second comparison result to obtain a verification result.

[0115] The database migration verification device provided by the present application adopts the database migration verification method in the above embodiment, aiming to solve the technical problems of difficult database migration verification and high business risk. Compared with the prior art, the beneficial effects of the database migration verification device provided by the present application are the same as the beneficial effects of the database migration verification method provided by the above embodiment, and the other technical features in the database migration verification device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0116] The present application provides a database migration verification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the database migration verification method in the above-mentioned embodiment one.

[0117] Reference below Figure 5 , which shows a schematic diagram of the structure of a database migration verification device for implementing an embodiment of the present application. The database migration verification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The database migration verification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0118] like Figure 5As shown, the database migration verification device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the database migration verification device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the database migration verification device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a database migration verification device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0120] The database migration verification device provided by the present application adopts the database migration verification method in the above embodiment, aiming to solve the technical problems of difficult database migration verification and high business risk. Compared with the prior art, the beneficial effects of the database migration verification device provided by the present application are the same as the beneficial effects of the database migration verification method provided by the above embodiment, and the other technical features in the database migration verification device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0123] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the database migration verification method in the above-mentioned embodiment.

[0124] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0125] The computer-readable storage medium may be included in the database migration verification device; or may exist independently without being assembled into the database migration verification device.

[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0128] The modules involved in the embodiments described in the present application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0129] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned database migration verification method, aiming to solve the technical problems of difficult database migration verification and high business risks. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the database migration verification method provided in the above-mentioned embodiment, and will not be repeated here.

[0130] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned database migration verification method when executed by a processor.

[0131] The computer program product provided in this application is intended to solve the technical problems of difficult database migration verification and high business risk. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the database migration verification method provided in the above embodiment, which will not be repeated here.

[0132] Compared with the prior art, the database migration verification method, device, equipment, medium and computer product proposed in the embodiment of the present application extract the business feature information of the target business, perform data standardization processing on the business feature information, obtain standard feature data, perform hash processing on the standard feature data, obtain unique feature data, perform numerical processing and splicing processing on the unique feature data, obtain the first business feature value, accumulate the first business feature value of the target business, obtain the target business feature value, and finally compare the target business feature value with the feature value set to obtain the database migration verification result. Compared with the traditional method of identifying duplicate businesses by generating a unique key value or a continuous serial number for each business, it is more efficient, flexible and reliable. Based on the solution of the present application, by subjecting the business of complex scenarios to a series of simple transformations and finally converting it into a comparison of two numbers, the comparison process is very intuitive and efficient. The system only needs to simply compare whether the two values ​​are equal to quickly determine whether the two businesses are exactly the same.

[0133] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0134] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.

[0136] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A database migration verification method, characterized in that: The database migration verification method comprises: Migrate the data stored in the old database of the old system to the new database of the new system; Obtain a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message; Compare the first response message with the second response message to obtain a first comparison result; Perform sampling comparison on the data tables of the new and old databases to obtain a second comparison result; The difference data between the first comparison result and the second comparison result is evaluated to obtain a verification result.

2. The database migration verification method according to claim 1, characterized in that: The step of migrating the data stored in the old database of the old system to the new database of the new system includes: Determine a mapping relationship between the new and old databases, and convert the data stored in the old database into compatible data of the new database according to the mapping relationship; Execute data migration and verify the migrated data according to the preset verification rules. Correct the migration process based on the verification results until all data passes the verification.

3. The database migration verification method according to claim 2, characterized in that: Before the step of obtaining a first response message obtained based on the request message of the old system and a second response message obtained by the new system based on the request message, the step also includes: Receive requests from the old system front-end and distribute the requests to the old system back-end service for processing.

4. The database migration verification method according to claim 1, characterized in that: The step of comparing the first response message with the second response message to obtain a first comparison result includes: Use a regular expression to match the first response message and the second response message and obtain a matching result; The difference data in the matching result is extracted and a first comparison result is generated.

5. The database migration verification method according to claim 1, characterized in that: The step of performing sampling comparison on the data tables of the new and old databases to obtain the second comparison result comprises: At preset time intervals, sample data is extracted from the designated data tables of the new and old databases according to preset sampling rules; A consistency check is performed on the sample data of the data tables in the new and old databases to obtain a second comparison result.

6. The database migration verification method according to claim 1, characterized in that: After the step of evaluating the difference data between the first comparison result and the second comparison result to obtain a verification result, the following step further includes: If the verification result determines that the migration has failed, the problem is checked based on the difference data of the first comparison result and / or the second comparison result, and corresponding corrective measures are taken according to the difference processing logic.

7. The database migration verification method according to claim 6, characterized in that: The steps of troubleshooting the problem based on the difference data of the first comparison result and / or the second comparison result and taking corresponding corrective measures based on the difference processing logic include: Troubleshoot the difference data and formulate difference processing logic according to the result of the troubleshooting; The difference data is corrected according to the difference processing logic and the correction result is fed back.

8. A database migration verification device, characterized in that: The device comprises: The data migration module is used to migrate the data stored in the old database of the old system to the new database of the new system; A forwarding receiving module, used to obtain a first response message obtained based on the request message of the old system, and a second response message obtained by the new system based on the request message; A message comparison module, used to compare the first response message with the second response message to obtain a first comparison result; The data comparison module is used to perform sampling comparison on the data tables of the new and old databases to obtain a second comparison result; An evaluation module is used to evaluate the difference data between the first comparison result and the second comparison result to obtain a verification result.

9. A database migration verification device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the database migration verification method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the database migration verification method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Feature automatic migration method and device

    CN119782288A

  • Checking system for train control engineering data table and message data

    CN120492450A