A kind of Xinxing database migration verification method and system

By constructing a migration consistency index and semantic fidelity, and combining the random forest algorithm to optimize the decision tree, the problems of high failure probability and high operation and maintenance risk in the migration process of domestic IT innovation databases are solved, and efficient and reliable database migration verification is achieved.

CN121255775BActive Publication Date: 2026-02-13JIANGSU MOBILE INFORMATION SYST INTEGRATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511802404.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-02-13
Estimated Expiration
2045-12-03

AI Technical Summary

Technical Problem

During the migration of databases for domestic IT innovation, the differences between different databases lead to a high probability of migration failure, high costs, and significant operational risks. Existing tools cannot accurately map and understand complex business syntax, affecting the success rate and continuity of migration.

Method used

By analyzing the syntactic differences, constraint matching degree, and execution path differences between the source and target libraries, a migration consistency index and migration semantic fidelity are constructed. The number of decision trees is optimized by combining the random forest algorithm to achieve intelligent verification of the migration status.

Benefits of technology

It enables accurate assessment of the database migration process, ensuring stable system operation and business correctness after migration, improving migration success rate and continuity, and reducing operational risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121255775B_ABST
    Figure CN121255775B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of migration verification of databases, in particular to a Xinchuang database migration verification method and system, which comprises the following steps: determining a migration consistency index based on constraint matching reliability and syntax difference at each collection time; counting the cost in the migration process of the execution plan data set of a source database to the execution calculation data set of a target database at each collection time, and analyzing the comprehensive difference between the migration consistency index and the path difference at all collection times before each collection time to determine the migration semantic fidelity of the Xinchuang database migration process at each collection time, so as to optimize the number of decision trees in a random forest algorithm and verify the Xinchuang database migration state. The application solves the problem that a traditional migration tool cannot accurately verify the business logic breakage and data semantic distortion caused by the difference between database kernels, and improves the success rate and continuity of Xinchuang database migration.
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 migration verification, in particular to a China-inspired database migration verification method and system. BACKGROUND

[0002] China-inspired migration verification technology has developed from early manual comparison to tool-assisted comparison; from single data consistency verification at the front end to verification of the entire business chain, in order to comprehensively guarantee the migration integrity and consistency of core data, protect the safe and reliable smooth operation of business after migration to domestic databases, and continuously promote and comprehensively avoid technical dependency risks generated by technology stack replacement, and truly realize data and business migration of various industries facing domestic databases.

[0003] The differences between different databases or source databases (Oracle, MySQL) determined by the diversity and complexity of the China-inspired ecosystem are relatively large in the core architecture, syntax characteristics, and even specific internal implementation of the system. After migration, it is impossible to achieve accurate mapping through a set of standards, resulting in the objects of the migrated database being unable to function normally, the data calculation being unequal, and a large amount of time being required for manual calibration or rewriting, thereby causing the migration progress of the entire project to be very slow, the overall cost to be relatively high, and the operation and maintenance risk to be relatively large. The mainstream migration tool replaces static syntax rules based on a certain rule base, does not understand and analyze some complex business syntax, and reduces the success probability and continuity of China-inspired database migration. SUMMARY

[0004] To solve the above technical problems, the purpose of the present application is to provide a China-inspired database migration verification method and system, and the technical solutions adopted are as follows:

[0005] In a first aspect, the present application provides a China-inspired database migration verification method, which comprises the following steps:

[0006] In the China-inspired database migration process, the statement string data set, the constraint information data set, and the execution plan data set of any object at each collection time are extracted from the source database and the target database, respectively;

[0007] By analyzing the differences in the statement string data set of any same-named object between the source database and the target database at each collection time, the syntax difference degree at each collection time is determined; by analyzing the logical consistency of the constraint information data set between the source database and the target database at each collection time, the constraint matching consistency is determined, and the migration consistency index of the China-inspired database migration process at each collection time is determined in combination with the syntax difference degree;

[0008] determine the execution path difference degree of each collection time, determine the comprehensive difference degree of each collection time by analyzing the comprehensive difference between the migration consistency index and the path difference degree at all collection times before each collection time, and determine the migration semantic fidelity of the migration process of the Xinchuang database at each collection time in combination with the execution path difference degree;

[0009] Based on the migration semantic fidelity, the number of decision trees in the random forest algorithm is optimized to verify the migration state of the Xinchuang database.

[0010] Preferably, the syntax difference degree of each collection time is the average of the difference between all same-name object statement string data sets between the source database and the target database at each collection time.

[0011] Preferably, the determination method of the constraint matching confidence degree of each collection time is:

[0012] Taking each same-name constraint between the constraint information data set of the source database and the constraint information data set of the target database at each collection time as the input of the RETE algorithm, outputting the activation state of each same-name constraint, and taking the product of the activation state and the preset weight as the matching degree of each same-name constraint.

[0013] Taking the average of the matching degrees of all same-name constraints between the constraint information data set of the source database and the constraint data set of the target database at each collection time as the constraint matching confidence degree of each collection time.

[0014] Preferably, the migration consistency index of the migration process of the Xinchuang database at each collection time is the result of dividing the normalized value of the constraint matching confidence degree by the normalized value of the syntax difference degree.

[0015] Preferably, the determination method of the execution path difference degree of each collection time is:

[0016] Taking the execution plan data set of the source database and the execution calculation data set of the target database at each collection time as the input of the tree edit distance algorithm, outputting the number of steps required for the migration of the execution plan data set of the source database and the execution calculation data set of the target database, and taking the number of steps as the execution path difference degree of each collection time.

[0017] Preferably, the comprehensive difference degree of each collection time is the KL divergence between the migration consistency index and the path difference degree at all collection times before each collection time.

[0018] Preferably, the expression of the migration semantic fidelity of the migration process of the Xinchuang database at each collection time is: ; in the formula, represents the migration semantic fidelity of the signal creation database migration process at the collection time i; represents the normalized value of the execution path difference degree at the collection time i; represents the normalized value of the comprehensive difference degree at the collection time i; exp[ ] represents an exponential function with a natural constant as the base number.

[0019] Preferably, the number of decision trees in the optimized random forest algorithm comprises:

[0020] The expression of the optimized number of decision trees in the random forest algorithm at the collection time i is: ; in the formula, represents a preset initial decision tree number value; represents the migration semantic fidelity of the signal creation database migration process at the collection time i; represents a preset adjustment parameter; norm( ) represents a normalization function; represents a rounding-up function.

[0021] Preferably, the verification of the signal creation database migration state comprises:

[0022] The migration semantic fidelity of the signal creation database migration process at all collection times before the current time is taken as the input of the optimized random forest algorithm, and the signal creation database migration state detection result is output.

[0023] In a second aspect, the embodiments of the present application further provide a signal creation database migration verification system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the signal creation database migration verification method in any one of the above aspects when executing the computer program.

[0024] The present application has at least the following beneficial effects:

[0025] ​The present application quantifies the syntax difference and constraint matching confidence, constructs a migration consistency index, realizes accurate evaluation of the database migration process from the surface structure to the deep logic, helps to predict the migration failure risk, and provides a key quantitative decision basis for ensuring the stable operation and business correctness of the system after migration; further, the present application fuses the execution path difference and comprehensive difference, constructs a migration semantic fidelity, realizes deep semantic verification of the database migration from the execution behavior logic to the data content distribution, which surpasses the traditional structure and performance checking, can accurately capture and quantify the behavior deviation and content distortion caused by the kernel difference, thereby providing a scientific evaluation method for ensuring the correctness of the business logic and the integrity of the data semantics after migration, and ensuring the success probability and continuity of migration; finally, the present application combines the quantitative evaluation of the migration semantic fidelity and the adaptive optimization of the random forest algorithm, constructs an intelligent and dynamic migration state checking model, which not only can dynamically adjust the computing resources according to the health degree of the migration semantics, realize fine analysis in a stable state and rapid response in an abnormal state, but also can accurately classify the migration state and trigger the corresponding automatic processing process, greatly improving the success probability and continuity of migration. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.

[0027] Figure 1 A step flow chart of a kind of Xinyuan database migration verification method provided by an embodiment of the present application;

[0028] Figure 2 The migration semantic fidelity extraction process schematic diagram of an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the Xinyuan database migration verification method and system according to the present application are described in detail as follows by combining with the drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.

[0031] The specific scheme of the signal creation database migration verification method and system provided in the application will be specifically explained below in combination with the drawings.

[0032] Please refer to Figure 1 which shows the step flow chart of a signal creation database migration verification method provided in an embodiment of the application, and the method comprises the following steps:

[0033] Step S1: In the migration process of the signal creation database, the statement string data set, the constraint information data set and the execution plan data set of any object at each collection time are extracted from the source database and the target database respectively.

[0034] In the migration process of the signal creation database, the original data definition language (DDL) statement string of any object is extracted from the source database and the target database every t seconds by using the method of database system table query and metadata interface access, and the statement string data set of any object in the source database and the target database is formed respectively, which completely retains the original definition text of the object and is used for accurate comparison at the syntax level, wherein the object refers to a table, a view, an index and the like.

[0035] Further, the primary key, the foreign key and the non-empty constraint information in the system metadata table of the source database and the target database are parsed every t seconds by using the constraint information extraction and structuring method, and all the constraint information is uniformly converted into a standardized structured list, and the constraint information data set of the source database and the target database is formed respectively, which eliminates the metadata format difference between different databases and provides a unified data basis for logical consistency verification.

[0036] Further, the execution plan of the key query statement on the source database and the target database is collected every t seconds by using the structured query language (SQL) execution plan parsing and standardization method, and the execution plan data set of the source database and the execution plan data set of the target database are formed respectively.

[0037] Among them, the acquisition method of all data in the above all data sets is a known technology, and will not be described in detail.

[0038] Step S2: The syntax difference degree at each collection time is determined by analyzing the difference between the statement string data sets of any same-named object between the source database and the target database at each collection time, the constraint matching consistency at each collection time is determined by analyzing the logical consistency in the constraint information data set between the source database and the target database at each collection time, and the migration consistency index of the signal creation database migration process at each collection time is determined in combination with the syntax difference degree.

[0039] In the process of the Xinchuang database migration, the inherent syntax difference between the source database and the target domestic database and the object definition analysis are the main reasons for the migration failure. These differences cause problems such as structured query language (SQL) statement syntax errors, object dependency relationship breaks or interface incompatibility, which may cause application function abnormalities or even migration system running interruption, and seriously affect the smooth progress of the database migration process.

[0040] To solve the above problems, the embodiment determines the syntax difference degree at each collection time by analyzing the difference between any same-name object statement string data set between the source database and the target database at each collection time, determines the constraint matching information degree at each collection time by analyzing the logical consistency in the constraint information data set between the source database and the target database at each collection time, and determines the migration consistency index of the Xinchuang database migration process at each collection time in combination with the syntax difference degree. The specific process is as follows:

[0041] In the embodiment, first, the syntax difference degree at each collection time is determined by analyzing the difference between any same-name object statement string data set between the source database and the target database at each collection time. Specifically:

[0042] In the embodiment, the mean of the difference between all same-name object statement string data sets between the source database and the target database at each collection time is taken as the syntax difference degree at each collection time.

[0043] It should be noted that the Levenshtein distance is used to measure the difference between the same-name object statement string data sets between the source database and the target database in the embodiment, that is, the Levenshtein distance between any same-name object statement string data set between the source database and the target database at each collection time is taken as the difference between any same-name object statement string data set between the source database and the target database at each collection time.

[0044] It should be noted that the same-name object between the source database and the target database refers to the same type of object, that is, if the tables are compared, the same-name object type is a table, and if the indexes are compared, the same-name object type is an index.

[0045] According to the syntax difference degree at each collection time, it can be understood that the syntax difference degree is used to represent the surface structure consistency of the migration. If the mean of the difference between all same-name object statement string data sets between the source database and the target database at the current collection time is larger, that is, the syntax difference degree is larger, it means that there are more addition, deletion and modification operations on the character level between the DDL data definition of the target database and the source database, which means that the syntax difference between the source database and the target database is larger, which means that a large number of keywords, data types or function definitions are incompatible, which may cause the migrated objects to be unable to be created or run due to syntax errors, and the risk of migration failure is higher.

[0046] On the contrary, if the syntax difference degree is smaller at the current collection time, it means that the DDL data definition of the target library has fewer addition, deletion and modification operations compared with the source library at the character level, which means that the syntax compatibility between the source library and the target library is higher, and the mapping of object definition is more direct, which indicates that the migrated objects can be successfully created, laying a solid foundation for subsequent deep semantic checking, and the success probability of migration is also correspondingly higher.

[0047] However, relying only on the difference between the syntaxes for object matching between the source library and the target library cannot guarantee the logical correctness. Once there is a defect in the constraint rules of the objects, it is easy to trigger a chain reaction, causing damage to the data integrity of the associated tables, and even causing core logic errors. Therefore, in the embodiment, the logical consistency between the constraint information data sets of the source library and the target library at each collection time is analyzed to determine the constraint matching confidence at each collection time, specifically:

[0048] In the embodiment, each same-name constraint between the constraint information data set of the source library and the constraint information data set of the target library at each collection time is taken as the input of the RETE algorithm, and the activation state of each same-name constraint is output. The product of the activation state and the preset weight is taken as the matching degree of each same-name constraint.

[0049] The average value of the matching degrees of all same-name constraints between the constraint information data set of the source library and the constraint data set of the target library at each collection time is taken as the constraint matching confidence at each collection time.

[0050] It should be noted that the activation state includes two kinds: if the matching between the same-name constraints is successful, the activation state is 1, otherwise, it is 0. The preset weight also varies according to the different types of constraints. For primary key constraints and foreign key constraints, the corresponding preset weights are both 1, and for non-null constraints, the corresponding preset weight is 0.7.

[0051] Among them, the process of determining the activation state between constraints by using the RETE algorithm is a known technology, and will not be described in detail.

[0052] It should be noted that the same-name constraint is a constraint of the same type, such as a primary key constraint or a foreign key constraint.

[0053] According to the constraint matching confidence at each collection time, it can be understood that the constraint matching confidence reflects the fidelity of the business logic rules in the migration process, and is used to represent the logical consistency between the source library and the target library. If the matching degree of all same-name constraints between the constraint information data set of the source library and the constraint data set of the target library at the current collection time is larger, it means that the constraint is perfectly preserved after migration, which will raise the overall average, so the constraint matching confidence is also correspondingly larger, which indicates that the data integrity and association in the migration process are guaranteed.

[0054] On the contrary, if the constraint matching confidence at the current collection time is smaller, it means that the matching degree of the same name constraint between the source library and the target library is generally low, indicating that there are problems such as constraint loss, definition change or rule invalidation in the migration process, which directly threatens the integrity of the data and the relevance of the business logic, and may cause serious consequences such as data pollution and business process interruption, thereby reducing the migration quality.

[0055] Further, the embodiment determines the migration consistency index of the Xinchuang database migration process at each collection time based on the syntax difference degree and the constraint matching confidence at each collection time, specifically:

[0056] In the embodiment, the result of dividing the constraint matching confidence normalization value by the syntax difference normalization value at each collection time is taken as the migration consistency index of the Xinchuang database migration process at each collection time.

[0057] According to the migration consistency index of the Xinchuang database migration process at each collection time, it can be understood that the migration consistency index reflects the overall equivalence degree of the two dimensions from syntax to business logic constraint, and is used to represent the potential probability of the migrated objects in the source library running normally in the target library; if the syntax difference degree at the current collection time is larger, it means that there is a fundamental problem in the basic definition of the migrated object at the current collection time, so the corresponding migration consistency index is lower, indicating that the reliability of the migration is lower; at the same time, if the constraint matching confidence at the current collection time is smaller, it means that the business logic integrity of the migration at the current collection time is low, even if the syntax is correct, it may not be available due to logical errors, so the corresponding migration consistency index is smaller;

[0058] On the contrary, if the syntax difference degree at the current collection time is smaller, and the constraint matching confidence is larger, the corresponding migration consistency index is higher, which means that the migrated object is highly compatible with the source library in the basic definition level, and the business logic rules carried thereby are also completely and accurately preserved. Under this double guarantee, the potential probability of the migrated object successfully creating, stably running and correctly performing business functions in the target library is larger, and the reliability and quality of the entire migration process are higher.

[0059] So far, the embodiment quantifies the syntax difference and the constraint matching confidence, constructs the migration consistency index, realizes the precise evaluation of the database migration process from the surface structure to the deep logic, helps to predict the migration failure risk, and provides a key quantitative decision basis for ensuring the stable operation and business correctness of the system after migration.

[0060] Step S3: statistics of the cost in the migration process of the execution plan data set of the source database to the execution calculation data set of the target database at each collection time, to determine the execution path difference degree at each collection time; through analysis of the comprehensive difference between the migration consistency index and the path difference degree at all collection times before each collection time, determine the comprehensive difference degree at each collection time, and determine the migration semantic fidelity of the migration process of the Xinchuang database at each collection time in combination with the execution path difference degree.

[0061] In the Xinchuang database migration, realizing the equivalence at the structure level is only the foundation, far from enough to guarantee the complete consistency of the business logic and the data syntax. There are essential differences between the source database and the target database in the query optimization mechanism, the transaction processing model, the index strategy and other core implementations. These differences will lead to completely different execution paths of the same SQL statement at both ends, and further cause serious problems such as performance degradation, result set deviation and even business logic rupture. Therefore, it is necessary to go beyond the structure verification and verify in depth at the syntax and execution level.

[0062] Based on the above analysis, the embodiment determines the execution path difference degree at each collection time by statistics of the cost in the migration process of the execution plan data set of the source database to the execution calculation data set of the target database at each collection time; determines the comprehensive difference degree at each collection time by analysis of the comprehensive difference between the migration consistency index and the path difference degree at all collection times before each collection time, and determines the migration semantic fidelity of the migration process of the Xinchuang database at each collection time in combination with the execution path difference degree. The specific process is as follows:

[0063] In this embodiment, first, the execution path difference degree at each collection time is determined by statistics of the cost in the migration process of the execution plan data set of the source database to the execution calculation data set of the target database at each collection time. Specifically:

[0064] In this embodiment, the execution plan data set of the source database and the execution calculation data set of the target database at each collection time are taken as the input of the tree edit distance algorithm, wherein the operator matching threshold is set to 0.8 in this embodiment, and the number of steps required for the migration of the execution plan data set of the source database and the execution calculation data set of the target database is output as the execution path difference degree at each collection time.

[0065] Wherein, the tree edit distance algorithm is a known technology, and the process of using it to obtain the number of steps required for the migration of the execution plan data set of the source database and the execution calculation data set of the target database is a known technology, and will not be described in detail.

[0066] Based on the difference in execution paths at each collection time, it can be understood that the difference in execution paths reflects the fundamental differences between the source and target libraries in kernel implementation, query optimization strategies, and underlying execution mechanisms, and is used to characterize the logical consistency of query behavior. If the difference in execution paths at the current collection time is greater, it indicates that the execution plan of the target library differs significantly from that of the source library in terms of operator selection, join order, access path, etc., which may lead to a decrease in migration performance.

[0067] Conversely, if the difference in execution paths at the current collection time is smaller, it means that the query optimizer of the target database has chosen an execution strategy that is highly similar to that of the source database. The operator selection, join order, and access path are basically the same. This usually means that the SQL statement can run in the target database with an efficiency close to that of the source database, effectively avoiding performance bottlenecks caused by execution path degradation and ensuring the query performance and response speed of the target database after migration.

[0068] However, the consistency of execution plans can only verify the equivalence of query paths, but cannot guarantee the complete consistency of data content. Especially in scenarios involving data sampling, type conversion, or computational distribution bias, even if the execution plans are the same, the resulting sets may differ. This implicit bias will directly lead to anomalies in business calculations.

[0069] Therefore, based on the above problems, this embodiment determines the comprehensive difference degree at each acquisition time by analyzing the comprehensive difference between the migration consistency index and the path difference degree at all acquisition times before each acquisition time. Specifically:

[0070] In this embodiment, the KL divergence between the migration consistency index and the path difference at all acquisition times prior to each acquisition time is taken as the comprehensive difference at each acquisition time.

[0071] The method for calculating KL divergence is a well-known technique, and its specific calculation process will not be elaborated here.

[0072] Based on the comprehensive difference degree at each collection time, it can be understood that the comprehensive difference degree reflects the fidelity of the inherent statistical characteristics and content syntax during the data migration process. It is used to characterize the accuracy of the data migration content. If the KL divergence between the migration consistency index and the path difference degree is larger at all collection times before the current collection time, that is, the comprehensive difference degree is larger, it indicates that the data distribution of the target database deviates significantly from that of the source database. This suggests that problems such as uneven data sampling, type conversion, and precision loss may have occurred during the migration process. As a result, businesses that rely on this data for statistics, analysis, or reporting will draw incorrect conclusions, leading to business decision-making errors.

[0073] Conversely, if the smaller the KL divergence between the migration consistency index and the path difference at all collection time points before the current collection time, that is, the smaller the comprehensive difference, it means that the data distribution of the target library is highly consistent with the source library, and the internal statistical characteristics and content syntax are faithfully preserved, which indicates that the migration process is accurate and error-free, effectively avoiding data sampling, type conversion or precision loss and other problems, thereby ensuring that the upper-level business relying on these data can obtain accurate and reliable input, providing a solid data foundation for correct business decision-making.

[0074] Further, the embodiment determines the migration semantic fidelity of the migration process of the Xinchuang database at each collection time point based on the execution path difference and the comprehensive difference at each collection time point, specifically:

[0075] As an implementation manner, in the embodiment, the expression of the migration semantic fidelity of the migration process of the Xinchuang database at the collection time point i is: ; in the formula, the normalized value of the execution path difference at the collection time point i is denoted as the normalized value of the comprehensive difference at the collection time point i is denoted as exp[ ] represents the exponential function with the natural constant as the base.

[0076] Preferably, the migration semantic fidelity extraction process of the embodiment is as shown in Figure 2 .

[0077] According to the migration semantic fidelity in the migration process of the Xinchuang database at each collection time point, it can be understood that the migration semantic fidelity reflects the overall fidelity degree of the two core dimensions of query execution logic and data content distribution, and is used to represent the correctness of the business behavior and the integrity of the data semantics after migration; if the execution path difference at the current collection time point is larger, and the comprehensive difference is larger, the corresponding migration semantic fidelity is smaller, which indicates that there is a syntax deviation in the behavior or content of the data in the migration process, which indicates that the current business logic may have been broken, and the migration state is seriously abnormal;

[0078] Conversely, if the execution path difference at the current collection time point is smaller, and the comprehensive difference is smaller, the corresponding migration semantic fidelity is higher, which indicates that the query behavior logic and the content distribution of the data in the migration process are faithfully reproduced, the business logic is complete and the data semantics are consistent, which means that the target library after migration can not only correctly execute the business, but also the results generated are completely equivalent in syntax to the source system, the migration state is healthy and reliable, and the expected business goal is achieved.

[0079] ​Thus, this embodiment constructs migration semantic fidelity by integrating execution path difference degree and comprehensive difference degree, realizing deep semantic verification of database migration from execution behavior logic to data content distribution. This method surpasses traditional structure and performance verification, and can accurately capture and quantify behavioral deviations and content distortions caused by kernel differences. This provides a scientific evaluation means to ensure the correctness of business logic and the integrity of data semantics after migration, ensuring the probability and continuity of successful migration.

[0080] Step S4: Based on the migration semantic fidelity, optimize the number of decision trees in the random forest algorithm to verify the migration status of the domestic IT innovation database.

[0081] When migrating a domestically developed database, we have adopted the migration semantic fidelity B approach in terms of both execution plan and data distribution. This approach quantitatively determines syntax consistency based on the execution plan and data distribution. However, since the database environment is dynamic and the business logic is complex, such fixed indicators alone cannot fully cover all error points. In long-term, high-concurrency scenarios, slow detection or misjudgment may occur.

[0082] Therefore, based on the above analysis, this embodiment optimizes the number of decision trees in the random forest algorithm based on the migration semantic fidelity to verify the migration status of the domestic IT innovation database, specifically as follows:

[0083] As one implementation method, in this embodiment, the optimized number of decision trees in the random forest algorithm at time i is... The expression is: In the formula, This indicates the preset initial number of decision trees; This represents the semantic fidelity of the migration process during the migration of the domestic IT innovation database at time i. This indicates the preset adjustment parameters; norm() represents the normalization function; This represents the function for rounding up.

[0084] It should be noted that the preset initial number of decision trees and the preset adjustment parameter are set manually. In this embodiment, the preset initial number of decision trees is 100 and the preset adjustment parameter is 0.6. In actual applications, as other implementation methods, implementers can also set them according to specific circumstances. This embodiment does not impose any special restrictions.

[0085] According to the optimized decision tree quantity value, it can be understood that the greater the migration semantic fidelity at the current collection time, the smoother the migration running process, and the random forest algorithm can invest more computing resources to finely judge, thereby avoiding misjudgment of the migration state; on the contrary, the smaller the migration semantic fidelity at the current collection time, the more abnormal or high-risk the migration running process, and the system needs to respond quickly. The random forest algorithm will invest more computing resources for quickly identifying and positioning the problem, and increase the number of decision trees to improve the capture ability and accuracy of the judgment of the abnormal state, thereby realizing the instant alarm and intervention of the risk.

[0086] Further, the migration semantic fidelity of the signal creation database migration process at all collection times before the current collection time is taken as the input of the random forest (Random Forest) algorithm, the top 30% data in the result is taken as the training set, the bottom 70% data is taken as the test set, the number of decision trees is set to , the maximum depth of the tree is 5, a multi-classification model is established, and which one of the three categories of “normal”, “warning” and “abnormal” the migration state of the signal creation database migration process at the current collection time belongs to is predicted.

[0087] The specific training process of the random forest algorithm is as follows: each decision tree is sampled from the training set with replacement to form a training subset of the tree; when each node of the tree is split, a subset of features is randomly selected from all features, and the Gini impurity corresponding to each feature in the subset is calculated; the feature that can most reduce the impurity is selected as the splitting rule of the node, and the node splitting is recursively performed until the preset maximum depth is reached. After the training is completed, the model predicts the migration state by majority voting on the test set, and classifies the migration state into three categories of “normal”, “warning” and “abnormal”.

[0088] The random forest algorithm is improved and dynamic classification of the migration semantic fidelity sequence is realized. If the migration state of the signal creation database migration process at the current collection time is “normal”, the migration progress is continuously monitored and recorded; if the migration state of the signal creation database migration process at the current collection time is “warning”, the fine-grained difference analysis module is called to find the object or SQL that causes the problem; if the migration state of the signal creation database migration process at the current collection time is “abnormal”, the migration process is stopped, feedback is given to the operation and maintenance personnel for processing, and the system is rolled back to the last stable version, thereby ensuring the normal operation of the business. On this basis, the whole life cycle of the signal creation database migration process is managed by layer-by-layer checking and verification, and the success rate of the signal creation database migration and the system reliability are greatly improved.

[0089] The process of training the random forest algorithm is a known technology, and will not be described in detail.

[0090] So far, the embodiment combines the quantitative evaluation of the migration semantic fidelity with the adaptive optimization of the random forest algorithm, constructs an intelligent and dynamic migration state verification model, can not only dynamically adjust the computing resources according to the health degree of the migration semantics, realize fine analysis in smooth time and rapid response in abnormal time, but also can accurately classify the migration state and trigger the corresponding automatic processing process, greatly improves the probability and continuity of migration success.

[0091] Based on the same inventive concept as the above method, the embodiments of the present application also provide a Xinda database migration verification system, comprising a memory, a processor and a computer program stored in the memory and running on the processor, and the processor executes the steps of the method in any one of the above Xinda database migration verification methods when executing the computer program.

[0092] It should be noted that: the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the above description is made for the specific embodiments of the present application. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or may be advantageous.

[0093] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments.

[0094] The above is only the preferred embodiment of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for verifying the migration of a Xinda database, characterized in that, The method comprises the following steps: In the process of the Xire database migration, statement string data sets, constraint information data sets and execution plan data sets of any object at each collection time are extracted from the source database and the target database respectively; By analyzing the differences between the statement string data sets of any same-named object at each collection time between the source database and the target database, the syntax difference degree at each collection time is determined; by analyzing the logical consistency of the constraint information data sets at each collection time between the source database and the target database, the constraint matching configuration confidence at each collection time is determined, and the migration consistency index of the Xire database migration process at each collection time is determined in combination with the syntax difference degree; The syntax difference degree at each collection time is the average of the differences between all same-named object statement string data sets between the source database and the target database at each collection time; The constraint matching configuration confidence at each collection time is determined by taking each same-named constraint between the constraint information data set of the source database and the constraint information data set of the target database at each collection time as the input of the RETE algorithm, outputting the activation state of each same-named constraint, and taking the product of the activation state and a preset weight as the matching degree of each same-named constraint; the average of the matching degrees of all same-named constraints between the constraint information data set of the source database and the constraint data set of the target database at each collection time is taken as the constraint matching configuration confidence at each collection time; The migration consistency index of the Xire database migration process at each collection time is the result of dividing the normalized value of the constraint matching configuration confidence at each collection time by the normalized value of the syntax difference degree; The cost in the process of migrating the execution plan data set of the source database to the execution calculation data set of the target database at each collection time is counted to determine the execution path difference degree at each collection time; by analyzing the comprehensive difference between the migration consistency index and the path difference degree at all collection times before each collection time, the comprehensive difference degree at each collection time is determined, and the migration semantic fidelity of the Xire database migration process at each collection time is determined in combination with the execution path difference degree; The execution path difference degree at each collection time is determined by taking the execution plan data set of the source database and the execution calculation data set of the target database at each collection time as the input of the tree edit distance algorithm, outputting the number of steps required for the migration of the execution plan data set of the source database and the execution calculation data set of the target database, and taking the number of steps as the execution path difference degree at each collection time; The comprehensive difference degree at each collection time is the KL divergence between the migration consistency index and the path difference degree at all collection times before each collection time; The expression of the migration semantic fidelity of the migration process of the signal creation database at each collection time is: ; in the formula, represents the migration semantic fidelity of the migration process of the signal creation database at the collection time i; represents the normalized value of the execution path difference degree at the collection time i; represents the normalized value of the comprehensive difference degree at the collection time i; exp[ ] represents an exponential function with a natural constant as a base number; Based on the migration semantic fidelity, the number of decision trees in the random forest algorithm is optimized to verify the Xire database migration state.

2. The method of claim 1, wherein, The optimization of the number of decision trees in the random forest algorithm comprises: The number of optimized decision trees in the random forest algorithm at time i. The expression is: In the formula, This indicates the preset initial number of decision trees; This represents the semantic fidelity of the migration process during the migration of the domestic IT innovation database at time i. This indicates the preset adjustment parameters; norm() represents the normalization function; This represents the function for rounding up.

3. The method of claim 1, wherein, The verification of the Xire database migration state comprises: The migration semantic fidelity of the Xire database migration process at all collection times before the current time is taken as the input of the optimized random forest algorithm, and the Xire database migration state detection result is output.

4. A system for verifying database migration of Xincheng, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor implements the steps of the Xire database migration verification method of any one of claims 1-3 when executing the computer program.

Citation Information

Patent Citations

  • Data migration verification method and system for credential and credential platform

    CN119474078A

  • Semantic-based migration and consistency verification method, system and equipment and medium

    CN120723743A