Cross-database intelligent conversion method and system
Through intelligent conversion methods and systems across databases, and using technical means such as intelligent mapping engine and multi-dimensional data model conversion mechanism, the problem of inefficient data migration and conversion between multi-database systems is solved, efficient and automated data conversion and consistency are achieved, and development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202510269983.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-10
AI Technical Summary
The prior art is inefficient in data migration and conversion between multiple database systems, prone to errors, and lacks intelligent processing capabilities, especially in scenarios where database types are diversified and table structures are complex.
It provides an intelligent conversion method and system across databases. Through an intelligent mapping engine, multi-dimensional data model conversion mechanism, transaction and index optimization algorithm and intelligent SQL statement rewriting engine, it realizes all-round automatic conversion from table structure, data type to complex SQL statements, ensuring the efficiency and consistency of data in conversion, storage, synchronization and other links.
It greatly improves the automation and efficiency of database conversion, realizes efficient conversion and consistency of data between different database systems, and reduces development and maintenance costs.
Smart Images

Figure CN120123406A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technology, and particularly to an intelligent conversion method and system across databases. Background Art
[0002] With the rapid development of information technology, database systems play a core role in enterprise applications, data analysis, and information management. Currently, enterprises often need to manage data in multiple database systems, such as MySQL, GBase8s, openGauss, etc. Due to differences in table structures, data type definitions, index management, etc. among databases, the migration and conversion of data between different databases have become a major challenge.
[0003] Traditional database conversion usually relies on manually writing scripts or using third-party tools for data export, conversion, and import. These methods are inefficient and error-prone. Especially when the data volume is large, the conversion performance and data consistency cannot be guaranteed. In addition, some database-specific data types or structures may not be directly mapped or converted, requiring manual intervention or complex custom logic processing, which further increases the complexity of database migration. To solve the interoperability problem between multiple database systems, some data conversion tools and platforms have been developed in the industry, such as ETL (Extract-Transform-Load) tools. These tools can solve the problem of data migration between heterogeneous databases to a certain extent. However, these tools often lack the intelligent processing ability for differences in database table structures and data types. Especially in scenarios where the database types are diverse and the table structures are complex, they still rely on manual configuration and maintenance.
[0004] In view of this, how to achieve an intelligent conversion method and system across databases that can improve the automation degree and efficiency of database conversion while ensuring the high efficiency and consistency of data in various links such as conversion, storage, and synchronization, and greatly reduce the development and maintenance costs is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention
[0005] To solve the above technical problems, the object of the present invention is to provide an intelligent conversion method and system across databases, which greatly improve the automation degree and efficiency of database conversion, and at the same time realize the full-range automation conversion from table structures, data types to complex SQL statements, ensure the high efficiency and consistency of data in various links such as conversion, storage, and synchronization, and greatly reduce the development and maintenance costs.
[0006] The first object of the present invention is to provide an intelligent conversion method across databases; The technical solution provided by the present invention is as follows: An intelligent conversion method across databases, comprising the following steps: Determine the conversion path and conversion mode between the source database and the target database; Obtain the data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; Adjust and optimize the data structure differences according to a preset multi-dimensional data model conversion mechanism; Optimize the transaction and index differences according to a preset transaction and index optimization algorithm; Analyze the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements; Perform consistency verification on the data in the source database and the target database to obtain the conversion result.
[0007] Preferably, the adjusting and optimizing the data structure differences according to a preset multi-dimensional data model conversion mechanism specifically includes: Automatically adjust and optimize the data structure differences according to the characteristics of the target database through a data model analysis algorithm.
[0008] Preferably, the optimizing the transaction and index differences according to a preset transaction and index optimization algorithm specifically includes: Analyze the transaction and index differences according to a preset transaction and index optimization algorithm to obtain the transaction constraints and index structure in the source database; Reconstruct an optimized index structure based on the transaction constraints and the index structure according to the characteristics of the target database.
[0009] Preferably, the analyzing the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements specifically includes: Analyze the syntax differences between the SQL statements in the source database and the target database according to a preset intelligent SQL statement rewriting engine to automatically rewrite the SQL statements; Optimize the SQL statements according to the characteristics of the target database.
[0010] Preferably, the performing consistency verification on the data in the source database and the target database to obtain the conversion result specifically includes: Perform consistency verification on the data in the source database and the target database according to a preset automatic verification mechanism.
[0011] Preferably, the performing consistency verification on the data in the source database and the target database to obtain the conversion result specifically further includes: Efficiently compress multi-dimensional data through a compression algorithm; Losslessly decompress the compressed data to obtain the conversion result.
[0012] Preferably, after performing consistency verification on the data in the source database and the target database, it further includes: Detect data differences between the source database and the target database according to the difference tracking algorithm, and automatically update or repair the data differences.
[0013] The second object of the present invention is to provide an intelligent conversion system across databases; The technical solution provided by the present invention is as follows: An intelligent conversion system across databases, including: a determination module, an acquisition module, a first optimization module, a second optimization module, an analysis module, and a verification module; The determination module is used to determine the conversion path and conversion mode between the source database and the target database; The acquisition module is used to obtain data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; The first optimization module is used to adjust and optimize the data structure differences according to a preset multi-dimensional data model conversion mechanism; The second optimization module is used to optimize the transaction and index differences according to a preset transaction and index optimization algorithm; The analysis module is used to analyze the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements; The verification module is used to perform consistency verification on the data in the source database and the target database to obtain the conversion result.
[0014] The third object of the present invention is to provide an electronic device; The technical solution provided by the present invention is as follows: An electronic device, including: At least one processor; and A memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method steps of any one of the intelligent conversion methods across databases.
[0015] The fourth object of the present invention is to provide a computer-readable storage medium; The technical solution provided by the present invention is as follows: A computer-readable storage medium for storing a computer program for causing a computer to execute any of the method steps of an intelligent conversion method across databases.
[0016] An intelligent conversion method across databases provided by the present invention includes: determining a conversion path and a conversion mode between a source database and a target database; obtaining differences in data structure, transactions and indexes, and syntax between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; adjusting and optimizing the data structure differences according to a preset multi-dimensional data model conversion mechanism; optimizing the differences in transactions and indexes according to a preset transaction and index optimization algorithm; analyzing the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements; performing consistency verification on the data in the source database and the target database to obtain a conversion result; this method greatly improves the automation degree and efficiency of database conversion through the above steps, and realizes a full-range automatic conversion from table structure, data type to complex SQL statements, ensuring the efficiency and consistency of data in various links such as conversion, storage, and synchronization, and at the same time greatly reducing the development and maintenance costs.
[0017] The present invention also provides an intelligent conversion system across databases. Since this system solves the same technical problems as the intelligent conversion method across databases and belongs to the same technical concept, it should have the same beneficial effects, which will not be elaborated here. Brief Description of the Drawings
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 It is a schematic flowchart of an intelligent conversion method across databases in an embodiment of the present invention; Figure 2 It is a schematic structural diagram of an intelligent conversion system across databases in an embodiment of the present invention; Figure 3 It is a schematic structural diagram of an electronic device in an embodiment of the present invention. Detailed Description of the Embodiments
[0020] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by this application.
[0021] It should be noted that when an element is referred to as "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly disposed on the other element; when an element is referred to as "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0022] It should be understood that the orientation or positional relationship indicated by terms such as "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing this application 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 thus cannot be construed as a limitation to this application.
[0023] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, the meaning of "a plurality of" and "several" is two or more, unless otherwise specifically defined.
[0024] It should be noted that the structures, ratios, sizes, etc. shown in the drawings of this specification are only used to cooperate with the content disclosed in the specification for those skilled in this technology to understand and read, and are not used to limit the limiting conditions for the implementation of this application. Therefore, they do not have a substantial technical meaning. Any modification of the structure, change in the ratio relationship, or adjustment of the size, without affecting the efficacy that this application can produce and the purpose that can be achieved, should still fall within the scope covered by the technical content disclosed in this application.
[0025] As Figure 1 shown, the embodiments of the present invention provide an intelligent conversion method across databases, including the following steps: S1. Determine the conversion path and conversion mode between the source database and the target database; S2. Obtain the data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; In steps S1 to S2, first, the conversion path between the source database and the target database is preselected (such as from MySQL to openGauss, from MySQL to GBase8s, etc.), and then the conversion mode of only converting the table structure or converting both the table structure and data simultaneously is selected according to user requirements; during the conversion process, the preset intelligent mapping engine can automatically identify and analyze the differences in table structures and data types between databases such as MySQL, GBase8s, and openGauss, such as data structure differences, transaction and index differences, and syntax differences; then, according to the mapping rules predefined in the intelligent mapping engine, it can identify specific data types (such as BLOB in GBase8s and ARRAY in openGauss), and provide recommended alternative solutions according to the support situation of the target database. Among them, the mapping rules cover the conversion relationships between common database types. For example, the VARCHAR type in MySQL can be mapped to the TEXT type in openGauss; through the intelligent mapping engine, the differences in table structures and data types between different database systems can be identified, which helps to realize the automatic conversion of data between databases in the subsequent process; the intelligent mapping engine in this embodiment presets the data type matching method between different data sources through a program. According to this method, the field types that match from data source A to data source B can be automatically mapped.
[0026] S3. Adjust and optimize the data structure differences according to a preset multi-dimensional data model conversion mechanism; In step S3, for the common data structure difference problems in the cross-database data migration process, an adaptive multi-dimensional data model conversion mechanism is designed. This mechanism can not only identify and process the data structure differences of conventional two-dimensional tables, but also support the conversion of complex multi-dimensional data structures between databases, such as nested data types like ARRAY, JSON, and XML. Therefore, the data structure differences are adjusted and optimized through the preset multi-dimensional data model conversion mechanism to ensure the lossless conversion and efficient storage of complex data types.
[0027] S4. Optimize the transaction and index differences according to a preset transaction and index optimization algorithm; In step S4, it is difficult for the prior art to effectively handle the differences in transaction management and index mechanisms between different databases during database migration. Therefore, a transaction and index optimization algorithm based on logical constraints is provided, and through this algorithm, the differences in transactions and indexes can be optimized. The transaction and index optimization algorithm based on logical constraints in this embodiment mainly refers to obtaining the data source type, determining whether the data source engine supports transactions, and obtaining the indexes of the original fields through a program and converting them into the index rules supported by the corresponding data source.
[0028] S5. Analyze the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements. S6. Perform consistency verification on the data in the source database and the target database to obtain the conversion result.
[0029] In steps S5 to S6, through a preset intelligent SQL statement rewriting engine, the transaction constraints and index structures in the source database can be automatically parsed, the transaction dependency relationships and index types can be identified, and according to the syntax differences of the target database, the SQL queries, views, and other complex operations can be automatically rewritten and optimized to ensure their efficient execution on the target database. For example, it can find equivalent implementation solutions or recommend alternative solutions for specific functions or operators in the source database in the target database to ensure compatibility. Then, consistency verification is performed on the data in the source database and the target database to ensure that it is exactly the same as the source data, which is convenient for conversion, and thus the conversion result will be fed back. Then, according to the conversion result, the operator will be notified through the message center, and the converted data will be packaged into a compressed file for the user to download and use. The intelligent SQL statement rewriting engine in this embodiment mainly refers to converting to SQL statements matching the corresponding data source through a preset SQL statement matching method.
[0030] Preferably, the adjustment and optimization of the data structure differences according to the preset multi-dimensional data model conversion mechanism specifically include: Automatically adjust and optimize the data structure differences according to the characteristics of the target database through a data model analysis algorithm.
[0031] In the actual application process, through an adaptive data model analysis algorithm, the data structure can be automatically adjusted and optimized according to the characteristics of the target database, while ensuring lossless conversion and efficient storage of complex data types during the conversion process, and guaranteeing the integrity and consistency of the data. The data model analysis algorithm in this embodiment is an algorithm that can automatically optimize the data model according to the characteristics of different databases, and it can adaptively adjust the data structure according to the characteristics of the target database to achieve efficient storage and query.
[0032] Preferably, optimizing the transaction and index differences according to a preset transaction and index optimization algorithm specifically includes: Analyzing the transaction and index differences according to a preset transaction and index optimization algorithm to obtain transaction constraints and index structures in the source database; Based on the transaction constraints and the index structures, reconstructing an optimized index structure according to the characteristics of the target database.
[0033] In the actual application process, the transaction and index optimization algorithm can automatically analyze the transaction and index differences, obtain the transaction constraints and index structures in the source database, and reconstruct an optimized index according to the characteristics of the target database. At the same time, the algorithm can also provide an automatic transaction conversion mechanism for the concurrent transaction processing differences of multiple databases to ensure consistent data integrity and concurrent performance in different database systems; in this embodiment, by further analyzing the transaction and index structures, the operation mechanism of the source database can be deeply understood, ensuring that the transaction dependency relationships and index structures can be correctly converted and re-implemented in the target database, improving data consistency and integrity.
[0034] In addition, the transaction in this embodiment refers to an operation unit of the database, usually including multiple steps, and these steps must all succeed or all roll back to ensure data integrity and consistency; an index is a data structure in the database used to accelerate data queries. Common index types include B-tree indexes and hash indexes, etc.; transaction constraints refer to defining logical rules in transaction processing, such as foreign keys, primary keys, etc., to ensure the integrity of data operations; index optimization is to adjust and optimize the index structure according to the characteristics of the target database to maximize the database query efficiency.
[0035] Preferably, analyzing the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize SQL statements specifically includes: Analyzing the syntax differences between the SQL statements of the source database and the target database according to a preset intelligent SQL statement rewriting engine to automatically rewrite the SQL statements; Optimizing the SQL statements according to the characteristics of the target database.
[0036] In the actual application process, most current database conversion tools have deficiencies in the compatibility processing of SQL statements and are unable to handle the automatic conversion of complex queries or stored procedures. Therefore, an intelligent SQL statement rewriting engine is used to analyze the syntax differences between the SQL statements of the source database and the target database, and automatically rewrite and optimize complex operations such as SQL queries and views to ensure their efficient execution on the target database. For example, for specific functions or operators in the source database, equivalent implementations or recommended alternatives in the target database will be found to ensure compatibility. At the same time, the engine also supports performance optimization of SQL statements according to the characteristics of the target database, such as automatically adjusting indexes and query strategies. In this embodiment, the automatic SQL statement rewriting and optimization ensure cross-database compatibility, avoid execution errors caused by database syntax differences, and enable the applications after database migration to run smoothly. At the same time, the optimization and rewriting for database syntax differences not only improve the performance of the converted SQL statements but also reduce the maintenance difficulty.
[0037] Preferably, the consistency check of the data in the source database and the target database to obtain the conversion result specifically includes: Perform a consistency check on the data in the source database and the target database according to a preset automatic check mechanism.
[0038] In the actual application process, during the cross-database table structure and data type conversion, a designed automatic check mechanism is used to perform a consistency check on the data in the source database and the target database to ensure that the data will not be lost or in error during migration and conversion, guaranteeing the integrity and accuracy of the data. In addition, the automatic check mechanism is also equipped with a data type matching detection and automatic repair function, which can automatically handle the situation of incompatible data types during the conversion process and provide data repair solutions, avoiding manual intervention and ensuring the consistency of the data between different database systems.
[0039] Preferably, the consistency check of the data in the source database and the target database to obtain the conversion result specifically further includes: Efficiently compress the multi-dimensional data through a compression algorithm; Perform lossless decompression on the compressed data to obtain the conversion result.
[0040] In the actual application process, traditional database conversion systems often face performance bottlenecks when dealing with large-scale data. Through compression algorithms, multi-dimensional data can be compressed during data conversion. By using compression technology, the data volume during data transmission and storage can be effectively reduced, improving the storage efficiency and transmission speed of the system, and greatly reducing storage and bandwidth consumption. And through lossless decompression algorithms, lossless decompression is performed in the target database, and an asynchronous processing mechanism is adopted to notify the user of the processing result through the message center. The lossless decompression algorithm ensures the data integrity and accuracy during data compression and decompression, avoiding data loss or damage caused by data compression and ensuring the reliability of the data.
[0041] Preferably, after performing consistency verification on the data in the source database and the target database, it further includes: Detecting the data differences between the source database and the target database according to the difference tracking algorithm, and automatically updating or repairing the data differences.
[0042] In the actual application process, through a high-precision difference tracking algorithm, the data differences between the source database and the target database can be detected. Then, by comparing the data in the source database and the target database, any inconsistent parts can be identified, and these data can be automatically updated or repaired without affecting the database performance, thereby ensuring real-time performance and data consistency. The difference tracking algorithm in this embodiment refers to extracting the data of relevant tables from the source database and the target database, preprocessing the data extracted from different databases to ensure the consistency of field names, data types, and date formats, and comparing each row of data in the source database and the target database through the primary key or unique identifier to check whether they are exactly the same.
[0043] In addition, data migration between databases is usually an offline batch process, and this algorithm also supports incremental synchronization, which can maintain real-time data synchronization between the source database and the target database. By using incremental data capture technology (CDC, Change Data Capture), it can automatically identify and only synchronize newly added or changed data. Through incremental synchronization, the performance overhead caused by full synchronization is reduced, the data synchronization efficiency is improved, network bandwidth and storage resources are saved, and the real-time performance and efficiency during cross-database conversion are enhanced.
[0044] As Figure 2 shown, an embodiment of the present invention further provides an intelligent cross-database conversion system, including: a determination module, an acquisition module, a first optimization module, a second optimization module, an analysis module, and a verification module; The determination module is used to determine the conversion path and conversion mode between the source database and the target database; The obtaining module is configured to obtain the data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; The first optimization module is configured to adjust and optimize the data structure differences according to a preset multi-dimensional data model conversion mechanism; The second optimization module is configured to optimize the transaction and index differences according to a preset transaction and index optimization algorithm; The analysis module is configured to analyze the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements; The verification module is configured to perform consistency verification on the data in the source database and the target database to obtain a conversion result.
[0045] In the actual application process, a cross-database intelligent conversion system is provided with a determination module, an obtaining module, a first optimization module, a second optimization module, an analysis module, and a verification module; the obtaining module is respectively connected to the determination module, the first optimization module, the second optimization module, and the analysis module; the verification module is respectively connected to the first optimization module, the second optimization module, and the analysis module; after the determination module determines the conversion path and the conversion mode between the source database and the target database, it transmits the conversion path and the conversion mode to the obtaining module; after the obtaining module obtains the data structure differences, transaction and index differences, and syntax differences between the source database and the target database according to the conversion path and the conversion mode, it transmits the data structure differences, transaction and index differences, and syntax differences to the first optimization module, the second optimization module, and the analysis module respectively; after the first optimization module adjusts and optimizes the data structure differences according to a preset multi-dimensional data model conversion mechanism, it enters the verification module; after the second optimization module optimizes the transaction and index differences according to a preset transaction and index optimization algorithm, it also enters the verification module; after the analysis module analyzes the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statements, it also enters the verification module; the verification module then performs consistency verification on the data in the source database and the target database to obtain a conversion result; through the coordinated work of the determination module, the obtaining module, the first optimization module, the second optimization module, the analysis module, and the verification module, the automation degree and efficiency of database conversion are greatly improved in this system, and the full-range automation conversion from table structure, data type to complex SQL statements is also realized, ensuring the high efficiency and consistency of data in various links such as conversion, storage, and synchronization, and at the same time greatly reducing the development and maintenance costs.
[0046] Furthermore, an embodiment of the present application also discloses an electronic device, Figure 3It is a structural diagram of an electronic device shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation on the scope of use of this application.
[0047] Figure 3 This is a schematic structural diagram of an electronic device provided by an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the intelligent conversion method across databases disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0048] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create an intelligent conversion channel across databases between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitations are made here.
[0049] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, and data 223, etc., and the storage method may be temporary storage or permanent storage.
[0050] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. It may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the intelligent conversion method across databases executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. In addition to the data transmitted from external devices received by the intelligent conversion device across databases, the data 223 may also include data collected by its own input / output interface 25, etc.
[0051] The steps of the methods or algorithms described in combination with the embodiments disclosed in this specification may be implemented directly by hardware, software modules executed by a processor, or a combination of both. The software modules may be disposed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well known in the technical field.
[0052] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned cross-database intelligent conversion method. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0053] It should be understood that in this application, if the terms "method", "device", "unit" and / or "module" are used, they are only a way to distinguish different components, elements, parts, portions or assemblies at different levels. However, if other terms can achieve the same purpose, they can be replaced by other expressions.
[0054] As shown in this application and the claims, unless the context clearly indicates otherwise, the words "a", "an", "one" and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. A method or device may also include other steps or elements. An element defined by the statement "comprising one..." does not exclude the existence of another identical element in the process, method, commodity or device that includes the element.
[0055] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0056] If a flowchart is used in this application, the flowchart is used to illustrate the operations performed by the system according to the embodiments of this application. It should be understood that the operations before or after may not necessarily be executed precisely in sequence. On the contrary, they may be executed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or several operations may be removed from these processes.
[0057] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A cross-database intelligent conversion method, characterized in that: The steps include: Determine the conversion path and mode of the source database and the target database; Acquire data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; Adjusting and optimizing the data structure differences according to a preset multidimensional data model conversion mechanism; Optimizing the transaction and index differences according to a preset transaction and index optimization algorithm; Analyze the grammatical differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize SQL statements; A consistency check is performed on the data in the source database and the target database to obtain a conversion result.
2. The cross-database intelligent conversion method according to claim 1, characterized in that: The adjusting and optimizing the data structure differences according to the preset multidimensional data model conversion mechanism specifically includes: The data structure differences are automatically adjusted and optimized according to the characteristics of the target database through a data model analysis algorithm.
3. The cross-database intelligent conversion method according to claim 1, characterized in that: The optimizing the transaction and index differences according to a preset transaction and index optimization algorithm specifically includes: Analyzing the transaction and index differences according to a preset transaction and index optimization algorithm to obtain transaction constraints and index structures in the source database; An optimized index structure is rebuilt based on the transaction constraints and the index structure according to the characteristics of the target database.
4. The cross-database intelligent conversion method according to claim 1, characterized in that: The analyzing the grammatical differences according to the preset intelligent SQL statement rewriting engine to automatically rewrite and optimize the SQL statement specifically includes: Analyzing the syntax differences between the SQL statements of the source database and the target database according to a preset intelligent SQL statement rewriting engine to automatically rewrite the SQL statements; The SQL statement is optimized according to the characteristics of the target database.
5. The cross-database intelligent conversion method according to claim 1, characterized in that: The performing consistency check on the data in the source database and the target database to obtain the conversion result specifically includes: The data in the source database and the target database are checked for consistency based on the preset automatic verification mechanism.
6. The cross-database intelligent conversion method according to claim 5, characterized in that: The performing consistency check on the data in the source database and the target database to obtain a conversion result specifically includes: Efficiently compress multidimensional data through compression algorithms; Losslessly decompress the compressed data to obtain the conversion result.
7. The cross-database intelligent conversion method according to claim 1, characterized in that: After the consistency check is performed on the data in the source database and the data in the target database, the method further includes: The data differences between the source database and the target database are detected according to a difference tracking algorithm, and the data differences are automatically updated or repaired.
8. A cross-database intelligent conversion system, characterized in that: include: A determination module, an acquisition module, a first optimization module, a second optimization module, an analysis module and a verification module; The determination module is used to determine the conversion path and conversion mode of the source database and the target database; The acquisition module is used to acquire data structure differences, transaction and index differences, and syntax differences between the source database and the target database through a preset intelligent mapping engine according to the conversion path and the conversion mode; The first optimization module is used to adjust and optimize the data structure difference according to a preset multidimensional data model conversion mechanism; The second optimization module is used to optimize the transaction and index differences according to a preset transaction and index optimization algorithm; The analysis module is used to analyze the syntax differences according to a preset intelligent SQL statement rewriting engine to automatically rewrite and optimize SQL statements; The verification module is used to perform consistency verification on the data in the source database and the target database to obtain a conversion result.
9. An electronic device, characterized in that: include: at least one processor; as well as A memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, the computer program being executed by the at least one processor so that the at least one processor can execute the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium is used to store a computer program, and the computer program is used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Cross-database SQL automatic adaptation detection method and system
CN120371683A
