AI-based intelligent database synchronous migration method and device
Through the intelligent database synchronization migration method based on AI, migration scripts are automatically generated and knowledge graphs are built to monitor and repair abnormal data in real time, solving the problems of low database migration efficiency and poor consistency in the existing technology, and an efficient and reliable data migration process is achieved.
Patent Information
- Application Number
- CN202510565311.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-11
AI Technical Summary
The existing database migration technology is inefficient, poor data consistency and weak error processing capabilities, especially in large-scale data migration, heterogeneous database migration and high-concurrency environments, it is difficult to meet the needs of different industries and application scenarios.
Using the intelligent database synchronization migration method based on AI, we automatically identify and repair abnormal data by generating migration scripts, building knowledge graphs, and real-time monitoring of data feature correlation and integrity, so as to realize real-time monitoring and repair during data migration.
It significantly reduces the risk of data loss or inconsistency, reduces the need for manual intervention, improves migration efficiency and accuracy, reduces migration failure rate, and improves the stability and economic benefits of the information system.
Smart Images

Figure CN120295996A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of databases, and particularly relates to an AI-based intelligent database synchronization and migration method and device. Background Art
[0002] In today's information age, databases are the core tools for enterprises and organizations to store, manage, and analyze data. With the changes in business requirements and the continuous progress of technology, database migration has become an essential part of the enterprise information system upgrade, integration, and optimization process. However, existing database migration technologies face many challenges in practical applications, mainly focusing on aspects such as data consistency, migration efficiency, and error handling capabilities.
[0003] Traditional database migration usually relies on manually writing scripts and manually validating data. This method is not only time-consuming and laborious but also prone to data loss or inconsistency due to human errors, especially in scenarios such as large-scale data migration, heterogeneous database migration, and real-time migration in a high-concurrency environment. These problems are particularly prominent. Existing technologies often lack sufficient flexibility and adaptability when dealing with complex data structures and diverse data types, and it is difficult to meet the needs of different industries and application scenarios. Summary of the Invention
[0004] The purpose of the present invention is to provide an AI-based intelligent database synchronization and migration method and device to solve the technical problems of low efficiency, poor data consistency, and weak error handling capabilities in traditional manual database migration technologies in the prior art.
[0005] To solve the above problems, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides an AI-based intelligent database synchronization and migration method, including:
[0007] Generating a migration script according to the similarities and differences between the data and structures of the source database and the target database;
[0008] Obtaining the data characteristics in the source database, and constructing a knowledge graph based on the initial data characteristic correlation according to the business logic;
[0009] During the process of migrating the data in the source database to the target database according to the migration script, determining whether the correlation of the real-time data characteristics and the data integrity meet the knowledge graph and the initial data characteristics;
[0010] If not, repairing the real-time data characteristics according to the correlation between the knowledge graph and the initial data characteristics.
[0011] In some possible embodiments, generating a migration script according to the similarities and differences in data and structure between the source database and the target database includes:
[0012] Comparing the data and structure of the source database and the target database;
[0013] If the source database and the target database are homogeneous databases, generating a first migration script;
[0014] If the source database and the target database are heterogeneous databases, generating a second migration script, where the second migration script includes data structure conversion, field mapping, or data conversion rule generation.
[0015] In some possible embodiments, the data features include field type, data distribution feature, numerical feature, time feature, structure feature, and text feature; the data feature relevance includes field relevance, entity relevance, and event relevance mapped based on predefined business rules.
[0016] In some possible embodiments, determining whether the relevance and data integrity of real-time data features conform to the knowledge graph and initial data features includes:
[0017] Determining whether the combination of real-time data features and the relevance of real-time data features conforms to the initial data features. If not, marking the abnormal data, determining the reason for the abnormality, and generating an abnormal data report;
[0018] Determining whether the relevance and integrity of real-time data features conform to the knowledge graph. If not, marking the abnormal data and recording the reason for the abnormality in the abnormal data report.
[0019] In some possible embodiments, after migrating the data in the source database to the target database according to the migration script, it further includes:
[0020] Comparing whether the number of data records in the target database is the same as that in the source database. If not, marking the situation of inconsistent number of data records, determining the reason for the inconsistent number of data records, and recording the situation of inconsistent number of data records and the reason for the inconsistent number of data records in the abnormal data report;
[0021] Detecting one by one whether each field in the target database exists and is not empty. If a field is missing or empty, marking the situation of incomplete fields, determining the reason for the incomplete fields, and recording the situation of incomplete fields and the reason for the incomplete fields in the abnormal data report;
[0022] Compare whether the data content in the target database is consistent with the data content in the source database. If not, mark the data content inconsistency and determine the cause of the data content inconsistency, and record the data content inconsistency and the cause of the data content inconsistency in the abnormal data report.
[0023] In some possible embodiments, after repairing the real-time data features according to the correlation between the knowledge graph and the initial data features, the method further includes:
[0024] Extracting features from the modified data to obtain modified data features, and associating the modified data features with the initial data features to determine whether the data format and structure of the modified data features are consistent with those of the initial data features;
[0025] Update the knowledge graph based on the modified data feature to obtain a second knowledge graph;
[0026] Based on the second knowledge graph, the modification requirements are predicted according to the preset natural language processing model and machine learning model;
[0027] According to the predicted modification requirements, a repair form for the abnormal data is determined, and data repair is performed according to the repair form.
[0028] In some possible embodiments, migrating the data in the source database to the target database according to the migration script includes:
[0029] A trigger condition is set for a migration task of migrating data from a source database to a target database according to a migration script. The trigger condition includes a timing trigger, an event trigger, and a user trigger.
[0030] In some possible embodiments, it further includes:
[0031] Use a well-trained machine learning model to obtain the data transfer rate, error rate, and resource utilization during the migration of data from the source database to the target database;
[0032] Based on the data transmission rate, error rate and resource usage rate, it is determined whether there is a risk in data transmission. If there is a risk, an early warning prompt is issued.
[0033] In some possible embodiments, a migration task of migrating data from a source database to a target database is backed up in real time to obtain backup information.
[0034] In a second aspect, the present invention further provides an AI-based intelligent database synchronization migration device, comprising:
[0035] Migration script generation module, used to generate migration scripts based on the similarities and differences between the data and structures of the source database and the target database;
[0036] A knowledge graph construction module, configured to obtain data features in a source database, and construct a knowledge graph based on the relevance of initial data features according to business logic;
[0037] A data verification module, configured to determine whether the relevance of real-time data features and data integrity meet the knowledge graph and initial data features during the process of migrating the data in the source database to the target database according to the migration script;
[0038] A repair module, configured to, if not meeting the requirements, repair the real-time data features according to the relevance between the knowledge graph and the initial data features.
[0039] As can be seen from the above technical solutions, the present invention has the following beneficial effects: First, according to the similarities and differences between the data and structures of the source database and the target database, a migration script is automatically generated; the need for manual intervention is reduced, and the migration cost and event input are lowered. Moreover, the data features in the source database are obtained, and a knowledge graph is constructed based on the relevance of the initial data features according to business logic, so as to present the relevance of the data features in an interpretable manner. During the process of migrating the data in the source database to the target database according to the migration script, it is determined whether the relevance of the real-time data features and the data integrity meet the knowledge graph and the initial data features; if not meeting the requirements, the real-time data features are repaired according to the relevance between the knowledge graph and the initial data features, realizing real-time monitoring and repair during the data migration process, significantly reducing the risk of data loss or inconsistency, and thus reducing the migration failure rate. Description of the Drawings
[0040] In order to more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0041] Figure 1 It is a schematic flowchart of an embodiment of an AI-based intelligent database synchronization and migration method proposed by the present invention;
[0042] Figure 2 For Figure 1 It is a schematic flowchart of an embodiment of step S101 in
[0043] Figure 3 It is a schematic flowchart of another embodiment of an AI-based intelligent database synchronization and migration method proposed by the present invention;
[0044] Figure 4In the intelligent database synchronization and migration method based on AI proposed by the present invention, it is a schematic flowchart of an embodiment of risk monitoring;
[0045] Figure 5 It is a schematic diagram of an embodiment of the intelligent database synchronization and migration device based on AI provided by the present invention;
[0046] Figure 6 It is a schematic diagram of the operating environment of an embodiment of the electronic device provided by the present invention. Detailed implementation manners
[0047] The present invention will be described in detail below with reference to the accompanying drawings. When describing the embodiments of the present invention in detail, for the convenience of explanation, the drawings showing the device structure will be enlarged locally in a non-general proportion, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention here. It should be noted that the drawings are in a simplified form and use non-precise proportions, only for the purpose of facilitating and clearly assisting in explaining the embodiments of the present invention. At the same time, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing descriptions, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features; the terms "front", "back", "bottom", "top", "bottom", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention.
[0048] In the description of the present invention, it should be noted that unless otherwise clearly defined and limited, the terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, and can also be the communication inside two elements. It can be a wireless connection or a wired connection. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0049] Figure 1 Disclosed is an intelligent database synchronization and migration method based on AI, including:
[0050] S101. Generate a migration script according to the similarities and differences in data and structure between the source database and the target database;
[0051] It should be noted that the source database is the original database that stores data before migration, and the target database is the new database into which the data is migrated. The types and structures of the source data and the target database are not limited. Data migration includes overall migration and incremental migration. During incremental migration, it is only necessary to compare and analyze the source database and the target database to identify data differences, including newly added data, deleted data, modified data, etc.
[0052] The source database and the target database can be homogeneous databases or heterogeneous databases. A homogeneous database is a database system in which the source database and the target database are exactly the same in terms of technical architecture, data model, and storage engine. A heterogeneous database refers to a database system in which there are differences in technical architecture, data model, or storage engine between the source database and the target database. In some embodiments of the present invention, please refer to Figure 2 , generating a migration script according to the similarities and differences between the data and structures of the source database and the target database, including:
[0053] S201. Compare the data and structures of the source database and the target database;
[0054] S202. If the source database and the target database are homogeneous databases, generate a first migration script;
[0055] S203. If the source database and the target database are heterogeneous databases, generate a second migration script, where the second migration script includes data structure conversion, field mapping, or data conversion rule generation.
[0056] It should be noted that both the first migration script and the second migration script are a set of program codes or instructions, including operations for adding, modifying, or deleting data. The AI system compares whether the types, structures, fields, etc. of the source database and the target database are exactly the same. If they are the same, directly generate the first migration script to execute the operations of adding, modifying, or deleting data, without making any changes to the data structure, fields, etc. of the source database or the target data. If they are not the same, generate an optimized second migration script to trigger heterogeneous conversion. Before data migration, convert the source database and the target database into homogeneous databases through operations such as data structure conversion, field mapping, or data conversion rules, and then perform data migration to execute the operations of adding, modifying, or deleting data.
[0057] Thus, the automatic identification of data differences and the automatic generation of migration scripts are realized, significantly reducing the need for manual intervention and improving the migration efficiency.
[0058] S102. Obtain the data characteristics in the source database, and construct a knowledge graph based on the initial data characteristic relevance according to the business logic;
[0059] It should be noted that the data features are the form in which the original data is converted into analyzable data. The data features include, but are not limited to, field types, data distribution features, numerical features, time features, structural features, and text features; they may also include relational features, metadata features, pattern features, etc. In this embodiment, the numerical features are obtained by extracting the statistical features of numerical fields, such as mean, variance, maximum value, minimum value, etc., and are used to identify numerical anomalies; the data distribution features are obtained by extracting the category frequencies, rare categories, etc. of categorical fields, and are used to identify category anomalies; the time features are obtained by extracting the time patterns of time fields, such as time intervals, periodicity, etc., and are used to identify time series anomalies; the text features are obtained by extracting keywords, semantic features, etc. of text fields, and are used to identify text anomalies; the structural features are obtained by extracting the structural features of the data, such as field lengths, relationships between fields, etc., and are used to identify structural anomalies. Through these feature extraction methods, the system can comprehensively capture the internal laws and potential anomalies of the data, and thus obtain the data features.
[0060] Furthermore, the table structure, field constraints, and association relationships in the database directly reflect the business logic, and the data feature relevance can also be obtained through the mapping of the business logic. In this embodiment, the association analysis is achieved by analyzing the relationships between data, constructing an association network of the data, and is realized in the following ways:
[0061] Field association analysis: Analyze the association relationships between fields, such as the association between "order ID" in the order table and "product ID" in the product table.
[0062] Entity association analysis: Analyze the association relationships between entities, such as the association between users, orders, and products.
[0063] Event association analysis: Analyze the association relationships between events, such as the association between user login, placing an order, and payment.
[0064] Based on the results of the above field association analysis, entity association analysis, and event association analysis, construct a knowledge graph to represent the relationships between data in the form of a graph structure. The knowledge graph can not only help the system understand the semantics of the data but also provide context support for subsequent anomaly detection.
[0065] It should be noted that the technical implementation means for constructing the knowledge graph are the commonly used means in the prior art, and the structure of the knowledge graph is also the structure in the prior art, which is not limited herein.
[0066] S103. During the process of migrating the data in the source database to the target database according to the migration script, determine whether the relevance of the real-time data features and the data integrity meet the knowledge graph and the initial data features;
[0067] It should be noted that the unsupervised learning model (such as clustering algorithm) is used to monitor data in real time and extract real-time data features, and through the knowledge graph and association analysis technology, the association relationships between data are identified.
[0068] Specifically, by analyzing the combination of features and association relationships, patterns that do not meet expectations are identified. For example, the order amount increases abnormally and does not match the commodity price. And through knowledge graph reasoning, it is found that the association relationships between data are broken or inconsistent. For example, the user ID of a certain order has no association relationship in the knowledge graph. Thus, intelligent data verification is realized through real-time monitoring, ensuring the consistency and integrity of the data migration process.
[0069] Furthermore, abnormal data is marked through real-time monitoring, and the reasons for the anomalies are recorded, such as data format errors, field missing, broken association relationships, etc.
[0070] S104. If not, repair the real-time data features according to the relevance between the knowledge graph and the initial data features.
[0071] Based on the abnormal data marked during the real-time analysis process, list the IDs, field names, specific values before and after migration, etc. of the different data, and count the quantity and proportion of various differences, such as numerical differences, field missing, broken association relationships, etc. Then, based on the recorded reasons for the anomalies, and on the basis of the knowledge graph and migration rules, speculate on the possible reasons for the differences, such as field mapping errors, data conversion failures, etc., and generate repair suggestions. Among them, the repair suggestions may include the following:
[0072] Data completion: For missing data, provide data completion suggestions according to the knowledge graph and context relationships. For example, if a certain field is missing, speculate on the missing value based on the values of other fields.
[0073] Field adjustment: For the situation where field values are inconsistent, provide field adjustment suggestions. For example, if the value of a certain field is wrongly converted during migration, restore it to the original value.
[0074] Association relationship repair: For the situation where association relationships are broken, provide association relationship repair suggestions based on the knowledge graph. For example, if the "user ID" of a certain order does not exist in the target database, repair the association relationship or supplement the missing user data.
[0075] Data cleaning: For data that does not conform to business rules, perform data cleaning. For example, if the value of a certain field is negative, adjust it to a reasonable range.
[0076] In a more preferred solution, the repairs are prioritized according to the severity of the differences between the data content of the target database and the source database and the difficulty of repair. For example, critical data that may cause the system to crash is processed first, while secondary data that does not affect the business logic is processed secondarily.
[0077] In this embodiment, first, migration scripts are automatically generated based on the similarities and differences in data and structure between the source database and the target database; the need for manual intervention is reduced, and the migration cost and event input are lowered. Also, the data characteristics in the source database are obtained, and based on the business logic, a knowledge graph is constructed according to the relevance of the initial data characteristics, so as to present the relevance of the data characteristics in an interpretable manner. During the process of migrating the data in the source database to the target database according to the migration script, it is judged whether the relevance of the real-time data characteristics and the data integrity conform to the knowledge graph and the initial data characteristics; if not, the real-time data characteristics are repaired according to the relevance between the knowledge graph and the initial data characteristics, realizing real-time monitoring during the data migration process and significantly reducing the risk of data loss or inconsistency.
[0078] In some embodiments of the present invention, after migrating the data in the source database to the target database according to the migration script, it further includes:
[0079] Perform a comprehensive integrity check on the migrated data to ensure that all data has been successfully migrated and the data content is complete and intact.
[0080] In a specific embodiment, compare the number of data rows in each table in the source database and the target database to ensure that the number of data rows after migration is the same as the source data. If it is found that the number of data rows is inconsistent, the corresponding data is marked as abnormal, and the reason is further analyzed (such as data loss during migration or new data not being migrated). Check one by one whether each field in the target database exists and is not empty. If it is found that some fields are missing or empty, the system will record the specific location and speculate on the possible reasons (such as field mapping errors or data conversion failures). Ensure that the data content after migration is the same as the source data through a checksum (such as MD5 checksum) or other integrity verification methods. If integrity problems are found, the system will mark them as abnormal and provide repair suggestions.
[0081] And perform consistency verification on the data before and after migration to ensure that the data content is consistent. Specifically, by means of hash verification, field comparison, etc., check whether the data is damaged or tampered with during the migration process. Calculate the hash values of the data blocks or records before and after migration and compare them. If the hash values are inconsistent, it indicates that the data may be damaged or tampered with during the migration process. Compare the field values before and after migration field by field to ensure that the content of each field is exactly the same. If inconsistent field values are found, the system will record the specific differences and speculate on possible reasons (such as data conversion errors or field mapping errors). Verify whether the association relationships between the migrated data are consistent with the source data. For example, check whether the "user ID" in the order table is correctly associated with the "user ID" in the user table. If a broken or inconsistent association relationship is found, the system will mark it as abnormal. According to predefined business rules, verify whether the migrated data conforms to the business logic. For example, check whether the order amount is a positive number and whether the user age is within a reasonable range, etc. If data that does not conform to the business rules is found, the system will mark it as abnormal.
[0082] In some embodiments of the present invention, please refer to Figure 3 , after repairing the real-time data features according to the relevance between the knowledge graph and the initial data features, it further includes:
[0083] S301. Extract features from the modified data to obtain modified data features, and associate the modified data features with the initial data features to determine that the data formats and structures of the modified data features and the initial data features are consistent;
[0084] S302. Update the knowledge graph based on the modified data features to obtain a second knowledge graph;
[0085] S303. Based on the second knowledge graph, predict modification requirements according to a preset natural language processing model and machine learning model;
[0086] S304. According to the predicted modification requirements, determine the repair form of the abnormal data, and perform data repair according to the repair form.
[0087] In this embodiment, in addition to automatic repair, it also includes manual modification by the administrator, such as adjusting field values, adding new data, etc. The modified data features are of the same type as the initial data features. To avoid changes in the format and structure of the modified feature data, after verifying the format and structure of the modified data features with the initial data features, the knowledge graph is updated based on the modified features to ensure the accuracy and timeliness of the graph, and the modification behavior is analyzed based on the knowledge graph, such as the modified fields, modification frequency, etc., to infer the modification intention. And through semantic analysis technology, understand the semantic meaning behind the modification operation. And refer to the historical operation records to infer the intention of the current operation. According to the inferred intention, relevant data content is intelligently completed, such as updating associated fields, supplementing missing data, etc. According to the predicted modification requirements, the data content to be completed is generated. The completed content includes:
[0088] Update of associated fields: For example, when the administrator modifies the order status, the associated payment status, logistics status, etc. are automatically updated.
[0089] Supplement of missing data: For example, when the administrator adds a new order, according to the knowledge graph, the missing associated data, such as user information, product information, etc., is supplemented.
[0090] Adjustment of data format: For example, when the administrator modifies the value of a certain field, the format of the relevant fields is automatically adjusted to ensure the consistency of the data format.
[0091] In a more preferred solution, it also includes pushing the generated completed content to the administrator in the form of a report for review. Among them, the report content includes all the data to be completed and their specific locations; the reasons for each completion operation, such as due to the modification of the order status, the payment status needs to be updated; the suggestions for the completion operation, such as it is recommended to update the logistics status at the same time to ensure data consistency.
[0092] Thus, through data association analysis and user intention guessing, the intelligent completion of data is realized, significantly reducing the omission of manual operations and improving the accuracy and efficiency of data completion.
[0093] In some embodiments of the present invention, migrating the data in the source database to the target database according to the migration script includes:
[0094] Setting a trigger condition for the migration task of migrating the data in the source database to the target database according to the migration script, and the trigger condition includes timed trigger, event trigger, and user trigger.
[0095] In this embodiment, by setting a trigger condition for the migration task, the efficiency and automation of the data migration task can be further improved.
[0096] In some embodiments of the present invention, please refer toFigure 4 , further comprising:
[0097] S401. Obtain the data transfer rate, error rate, and resource utilization rate during the process of migrating data from the source database to the target database by using a trained machine learning model;
[0098] S402. Determine whether there is a risk in data transfer according to the data transfer rate, error rate, and resource utilization rate. If there is a risk, issue a warning prompt.
[0099] In this embodiment, key indicators (such as data transfer rate, error rate, resource utilization rate, etc.) during the migration process are analyzed by a machine learning model to identify potential risks. Among them, risks include but are not limited to data loss, migration delay, resource shortage, etc. And push risk warning information to the administrator to explain potential problems and their possible impacts. The present invention realizes intelligent monitoring and warning of the migration process through a machine learning model, significantly improving the reliability and success rate of migration.
[0100] In some embodiments of the present invention, further comprising:
[0101] Perform real-time backup on the migration task of migrating data from the source database to the target database to obtain backup information.
[0102] In this embodiment, the backup record includes operator information, operation data information, and timestamp.
[0103] Embodiments of the present invention realize efficient migration of large-scale databases through parallel processing and distributed computing technologies. And by improving the accuracy and efficiency of database migration, the risk of data loss or inconsistency is significantly reduced, ensuring the security and reliability of data. This can not only reduce business interruptions caused by data problems for enterprises, but also improve the overall stability of the information system, providing more reliable technical support for the development of social informatization. Further, the need for manual intervention is greatly reduced, reducing the migration cost and time investment of enterprises. At the same time, due to the improvement of migration efficiency and the reduction of error rate, enterprises can complete database migration faster, improving operation efficiency, thus bringing significant economic benefits.
[0104] Based on the above AI-based intelligent database synchronization and migration method, embodiments of the present invention further provide an AI-based intelligent database synchronization and migration device 500. Please refer to Figure 5 , comprising:
[0105] A migration script generation module 510, configured to generate a migration script according to the similarities and differences between the data and structures of the source database and the target database;
[0106] The knowledge graph construction module 520 is used to obtain the data features in the source database and construct a knowledge graph based on the relevance of the initial data features according to the business logic;
[0107] The data verification module 530 is used to judge whether the relevance and data integrity of the real-time data features conform to the knowledge graph and the initial data features during the process of migrating the data in the source database to the target database according to the migration script;
[0108] The repair module 540 is used to repair the real-time data features according to the relevance between the knowledge graph and the initial data features if they do not conform.
[0109] As Figure 6 shown, based on the above AI-based intelligent database synchronization and migration method, the present invention also correspondingly provides an electronic device, which can be a computing electronic device such as a mobile terminal, a desktop computer, a notebook, a palm computer, and a server. The electronic device includes a processor 610, a memory 620, and a display 630. Figure 6 Only some components of the electronic device are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively.
[0110] The memory 620 can be an internal storage unit of the electronic device in some embodiments, such as the hard disk or memory of the electronic device. The memory 620 can also be an external storage electronic device of the electronic device in other embodiments, such as a plug-in hard disk equipped on the electronic device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 620 can also include both the internal storage unit of the electronic device and the external storage electronic device. The memory 620 is used to store the application software installed on the electronic device and various types of data, such as the program code installed on the electronic device. The memory 620 can also be used to temporarily store the data that has been output or will be output. In one embodiment, an AI-based intelligent database synchronization and migration program 640 is stored on the memory 620, and the AI-based intelligent database synchronization and migration program 640 can be executed by the processor 610, so as to implement the AI-based intelligent database synchronization and migration method of each embodiment of the present application.
[0111] The processor 610 can be a central processing unit (CPU), a microprocessor, or other data processing chips in some embodiments, and is used to run the program code stored in the memory 620 or process data, such as executing the AI-based intelligent database synchronization and migration method, etc.
[0112] The display 630 may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light - Emitting Diode) toucher, etc. in some embodiments. The display 630 is used to display the information of the AI - based intelligent database synchronous migration electronic device and to display a visual user interface. The components 610 - 630 of the electronic device communicate with each other through a system bus.
[0113] Those skilled in the art can understand that all or part of the processes of implementing the above - described embodiment methods can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer - readable storage medium. Among them, the computer - readable storage medium is a disk, an optical disk, a read - only memory, or a random access memory, etc.
[0114] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An AI-based intelligent database synchronization and migration method, characterized in that, Including: Generating a migration script according to the similarities and differences in data and structure between the source database and the target database; Obtaining the data characteristics in the source database, and constructing a knowledge graph based on the business logic according to the relevance of the initial data characteristics; During the process of migrating the data in the source database to the target database according to the migration script, determining whether the relevance of the real-time data characteristics and the data integrity conform to the knowledge graph and the initial data characteristics; If not, repairing the real-time data characteristics according to the relevance between the knowledge graph and the initial data characteristics.
2. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, The generating of the migration script according to the similarities and differences in data and structure between the source database and the target database includes: Comparing the data and structure of the source database and the target database; If the source database and the target database are isomorphic databases, generating a first migration script; If the source database and the target database are heterogeneous databases, generating a second migration script, where the second migration script includes data structure conversion, field mapping, or data conversion rule generation.
3. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, The data characteristics include field type, data distribution characteristics, numerical characteristics, time characteristics, structure characteristics, and text characteristics; the relevance of the data characteristics includes field relevance, entity relevance, and event relevance mapped based on predefined business rules.
4. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, The determining whether the relevance of the real-time data characteristics and the data integrity conform to the knowledge graph and the initial data characteristics includes: Determining whether the combination of the real-time data characteristics and the relevance of the real-time data characteristics conforms to the initial data characteristics. If not, marking the abnormal data, determining the reason for the abnormality, and generating an abnormal data report; Determining whether the relevance and integrity of the real-time data characteristics conform to the knowledge graph. If not, marking the abnormal data and recording the reason for the abnormality in the abnormal data report.
5. The AI-based intelligent database synchronization and migration method provided according to claim 4, characterized in that, After migrating the data in the source database to the target database according to the migration script, it further includes: Comparing whether the number of data in the target database is the same as that in the source database. If not, marking the situation of inconsistent number of data and determining the reason for the inconsistent number of data, and recording the situation of inconsistent number of data and the reason for the inconsistent number of data in the abnormal data report; Detecting one by one whether each field in the target database exists and is not empty. If a field is missing or empty, marking the situation of incomplete field and determining the reason for the incomplete field, and recording the situation of incomplete field and the reason for the incomplete field in the abnormal data report; Comparing whether the data content in the target database is the same as that in the source database. If not, marking the situation of inconsistent data content and determining the reason for the inconsistent data content, and recording the situation of inconsistent data content and the reason for the inconsistent data content in the abnormal data report.
6. The AI-based intelligent database synchronization and migration method provided according to claim 1, wherein After repairing the real-time data characteristics according to the relevance between the knowledge graph and the initial data characteristics, it further includes: Extracting the characteristics of the modified data to obtain the modified data characteristics, associating the modified data characteristics with the initial data characteristics, and determining that the data format and structure of the modified data characteristics are consistent with the initial data characteristics. Update the knowledge graph based on the modified data feature to obtain a second knowledge graph; Based on the second knowledge graph, the modification requirements are predicted according to the preset natural language processing model and machine learning model; According to the predicted modification requirements, a repair form for the abnormal data is determined, and data repair is performed according to the repair form.
7. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, Migrating the data in the source database to the target database according to the migration script includes: A trigger condition is set for a migration task of migrating data from a source database to a target database according to a migration script. The trigger condition includes a timing trigger, an event trigger, and a user trigger.
8. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, Also includes: Use a well-trained machine learning model to obtain the data transfer rate, error rate, and resource utilization during the migration of data from the source database to the target database; Based on the data transmission rate, error rate and resource usage rate, it is determined whether there is a risk in data transmission. If there is a risk, an early warning prompt is issued.
9. The AI-based intelligent database synchronization and migration method provided according to claim 1, characterized in that, Also includes: A migration task for migrating data from a source database to a target database is backed up in real time to obtain backup information.
10. An AI-based intelligent database synchronization and migration device, characterized in that, include: Migration script generation module, used to generate migration scripts based on the similarities and differences between the data and structures of the source database and the target database; The knowledge graph construction module is used to obtain data features in the source database and build a knowledge graph based on the correlation of initial data features based on business logic; A data verification module, used to determine whether the relevance and data integrity of real-time data features conform to the knowledge graph and initial data features during the process of migrating data in the source database to the target database according to the migration script; The repair module is used to repair the real-time data features according to the correlation between the knowledge graph and the initial data features if they do not meet the requirements.