CN115408473A - Data synchronization method and device, computer equipment and computer readable storage medium - Google Patents
Data synchronization method and device, computer equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN115408473A CN115408473A CN202211353053.2A CN202211353053A CN115408473A CN 115408473 A CN115408473 A CN 115408473A CN 202211353053 A CN202211353053 A CN 202211353053A CN 115408473 A CN115408473 A CN 115408473A
- Authority
- CN
- China
- Prior art keywords
- database
- target
- data
- mapping
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000013507 mapping Methods 0.000 claims abstract description 139
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012217 deletion Methods 0.000 claims description 6
- 230000037430 deletion Effects 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 5
- 238000012986 modification Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims description 4
- 238000007792 addition Methods 0.000 claims description 3
- 230000001360 synchronised effect Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000009795 derivation Methods 0.000 description 2
- 230000036316 preload Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a data synchronization method, a data synchronization device, computer equipment and a computer readable storage medium. The method comprises the steps of establishing a database link between a current database and a target database; detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table. According to the data synchronization method, the data synchronization device, the computer equipment and the computer readable storage medium, the current database is established with the target database mapping table and the database link, so that the target database is read and written through the mapping table and the database link, automatic synchronization and data synchronization of table structures of different databases are achieved, and efficiency and accuracy of data synchronization among different databases are improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data synchronization method, a data synchronization apparatus, a computer device, and a computer-readable storage medium.
Background
With the continued growth of the internet, more and more businesses handle business on various systems, but the databases used by each system may be different. When cross-system processing business is carried out, data needs to be synchronized among different databases, however, the table structures of the different databases are different, and the data cannot be directly synchronized due to the different table structures. The traditional method adopts manual mails to inform the table structures of the databases and manually complete the synchronization of the table structures of different databases, however, when the workload becomes large, the work efficiency and the accuracy of the traditional method for completing the work are difficult to ensure.
Disclosure of Invention
In view of this, embodiments of the present application provide a data synchronization method, a data synchronization apparatus, a computer device, and a computer readable storage medium, which implement automatic synchronization and data synchronization of table structures of different databases, and improve efficiency and accuracy of data synchronization between different databases.
The data synchronization method of the embodiment of the application comprises the steps of establishing a database link between a current database and a target database; detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
The data synchronization device comprises an establishing module, a detection module and a reading and writing module. The establishing module is used for establishing a database link between the current database and the target database; the detection module is used for detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and the read-write module is used for establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
The computer device of the embodiment of the application comprises one or more processors, one or more processors and a database server, wherein the one or more processors are used for establishing a database link between a current database and a target database; detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
The computer-readable storage medium of embodiments of the present application contains a computer program that, when executed by one or more processors, causes the processors to perform a data synchronization method of: the database link is used for establishing a current database and a target database; detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
According to the data synchronization method, the data synchronization device, the computer equipment and the computer readable storage medium, the mapping table and the database link of the current database and the target database are established, so that the target database is read and written through the mapping table and the database link, automatic synchronization and data synchronization of table structures of different databases are achieved, and efficiency and accuracy of data synchronization among different databases are improved.
Additional aspects and advantages of embodiments of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of embodiments of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart diagram of a data synchronization method according to some embodiments of the present application;
FIG. 2 is a schematic flow chart diagram of a data synchronization method according to some embodiments of the present application;
FIG. 3 is a schematic flow chart diagram of a data synchronization method according to some embodiments of the present application;
FIG. 4 is a schematic flow chart diagram of a data synchronization method of certain embodiments of the present application;
FIG. 5 is a schematic flow chart diagram of a data synchronization method in accordance with certain embodiments of the present application;
FIG. 6 is a schematic flow chart diagram of a data synchronization method according to some embodiments of the present application;
FIG. 7 is a schematic flow chart diagram of a data synchronization method according to some embodiments of the present application;
FIG. 8 is a block diagram of a data synchronization apparatus according to some embodiments of the present application;
FIG. 9 is a schematic plan view of a computer device according to some embodiments of the present application; and
FIG. 10 is a diagrammatic representation of the synchronization of a computer-readable storage medium with a processor in accordance with certain implementations of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below by referring to the drawings are exemplary only for explaining the embodiments of the present application, and are not construed as limiting the embodiments of the present application.
The terms appearing in the present application are explained first below:
referring to fig. 1, a data synchronization method according to an embodiment of the present application includes:
step 01: and establishing a database link between the current database and the target database.
Specifically, before data synchronization between the current database and the target database is performed, the data type of the target database, the name of the target table to be synchronized, and the set (schema) of the database object where the target table is located are first clarified. And then, according to the target database, establishing a database link between the current database and the target database so as to facilitate reading and writing of the target database according to the current database.
In particular, in order to enable a current database to be connected with data of a plurality of target databases, the data synchronization method of the present application uses a database synchronization mode with postgresql as a center, the current database is unique in type and is the postgresql database, the target databases are other types of databases, such as mysql database, oracle database or greenplus database, and the number of the target databases may be multiple.
Step 02: and detecting the corresponding table structure of the target database in the current database to generate a mapping relation.
Specifically, the table structure describes a table framework, and the design table structure actually defines the number of fields constituting a table, and information such as the name, data type, and length of each field. The table structures of different databases are different, and the difference of the table structures makes the data synchronization between different databases impossible to realize directly. For example, data of date type in both oracle database and postgresql database includes "date", while "number" in oracle database and "numeric" in postgresql database are both digital type, but obviously, the names of the two are different, and postgresql database cannot directly synchronize data of digital type "number" in oracle database. However, there are alternatives for the fields between different databases, so that the table structures of the target database and the current database can be synchronized by only generating a mapping relationship between the field of the target database and the field of the current database that can replace the field of the target database. It can be understood that, before data synchronization of two different databases, a preset mapping relationship of fields between the two databases is preset according to actual applications of the fields of the two databases, that is, a mapping relationship is generated between fields where both databases exist and information is completely the same, and a mapping relationship is generated between fields where information in the two databases is not completely the same but the actual applications are the same. And then when the table structure of the target database is obtained, detecting the corresponding table structure of the target database in the current database according to the preset mapping relation of the two databases to generate the mapping relation between the fields of the two databases. For example, "date" of oracle database maps "date" of postgresql database, and "number" of oracle database maps "numerical" of postgresql database.
And 03: and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
Specifically, the fields having mapping relationship between the target database and the current database have table structure conversion statements capable of performing data type conversion. After the mapping relation between the target database and the current database is obtained, the current database converts the data type of the data of the target database into the data type of the data of the current database according to the mapping relation and the table structure conversion statement of the target database and the current database, and establishes a mapping table according to the converted data, so that the target database can be read and written through the mapping table. For example, there is a mapping relationship between "number" of the oracle database and "numeric" of the postgresql database, when the mapping table is established, according to the table structure conversion statement between "number" and "numeric", the data with the data type of "number" of the oracle database is converted into the data with the data type of "numeric", and the converted data with the data type of "numeric" is put into the mapping table. After database connection and a mapping table are established between the oracle database and the postgresql database, the oracle database can be read and written according to the mapping table.
Therefore, after the mapping table is established between the target databases and the current database, the current database and the target databases can utilize the mapping table to read and write the databases through the current database, for example, after the oracle database and the mysql database both establish the mapping table with the postgresql database, the corresponding data in the oracle database or the mysql database can be modified through the mapping table in the postgresql database.
Further, in order to facilitate table structure synchronization and data synchronization between the current database and various databases, when the mapping table is established, the mapping tables are respectively established between the current database and different types of databases, that is, the mapping tables are in one-to-one correspondence. For example, the postgresql database generates a mapping table specially for the oracle database, or generates a mapping table specially for the mysql database, so that when the postgresql database reads and writes the target database, the corresponding mapping table is selected to complete reading and writing.
According to the data synchronization method, the mapping table and the database link between the current database and the target database are established, so that the target database is read and written through the mapping table and the database link, automatic synchronization and data synchronization of table structures of different databases are achieved, and efficiency and accuracy of data synchronization between different databases are improved.
Referring to fig. 2, optionally, step 01: establishing a database link between the current database and the target database may include:
step 011: acquiring a link plug-in matched with a target database;
step 012: and establishing a database link between the current database and the target database through the link plug-in.
Specifically, different link plugins matched with different target databases are different, so that when a database link between a current database and the target database is established, the link plugins matched with the target database are required to be acquired according to the types of the target databases, so that the database link between the current database and the target database is established through the appropriate link plugins, and the data synchronization between the current database and the target database is realized through the database link between the current database and the target database.
Particularly, because the current database is a postgresql database, when database links between the current database and target databases are established, plug-ins open in the postgresql database are used for establishing database links with the target databases, and different plug-ins are selected to establish database links according to types of the target databases, if synchronization with an oracle database is required, an oracle _ fdw plug-in is called, and if synchronization with a mysql database is required, a mysql _ fdw plug-in is called.
Referring to fig. 3, optionally, step 02: detecting a table structure corresponding to the table structure of the target database in the current database to generate a mapping relationship may include:
step 021: comparing the structured query language of the current database with the structured query language of the target database to determine a corresponding table structure of the target database in the current database;
step 022: and generating a mapping relation according to the corresponding table structure of the target database in the current database.
Specifically, each database has a metadata table specially storing the table structure of the database, and each database has its own structured query language for querying the metadata table storing the table structure of the database. Before generating the mapping relation, comparing the structured query language of the current database with the structured query language of the target database to obtain the table structure of the current database and the table structure of the target database, determining the corresponding table structure of the target database in the current database by combining the preset mapping relation, and finally generating the mapping relation according to the corresponding table structure of the target database in the current database.
For example, both postgresql and oracle databases have sql statements that are used specifically to query the table structure of the database. Before generating the mapping relationship, an sql statement dedicated to query the table structure of the database in the two databases is executed to obtain the table structures of the two databases, for example, the table structure in the postgresql database includes "date" and "numeric", and the table structure in the oracle database includes "date" and "number". And then determining a table structure corresponding to the table structure of the target database in the current database according to a preset mapping relation, for example, the "date" in the postgresql database corresponds to the "date" in the oracle database, the "numeric" in the postgresql database corresponds to the "number" in the oracle database, and finally generating the mapping relation according to the table structure corresponding to the table structure of the target database in the current database.
Referring to fig. 4, optionally, step 03: establishing a mapping table according to the mapping relationship to read and write the target database through the mapping table, wherein the method comprises the following steps:
step 031: receiving an input operation to determine an operation statement of a mapping table;
step 032: and performing addition, deletion, modification and check operations on the target table of the target database according to the operation statements.
Specifically, the add/delete modify operations include add operations, delete operations, modify operations, and query operations. After the mapping table is established according to the mapping relation, the target table of the target database can be subjected to the operations of increasing, deleting, modifying and checking through the operation of the mapping table.
Further, after receiving the input operation, the mapping table corresponding to the target database in the current database is obtained according to the target database in the input operation, and then the operation statement of the mapping table is determined according to the input operation. After the operation statement of the mapping table is determined, the operation statement of the target table of the target data table is generated according to the corresponding table structure of the target table of the target database in the current database and the corresponding table structure conversion statement so as to carry out the operation of increasing, deleting, modifying and checking the target table of the target database.
For example, after the database connection and the mapping table are established between the oracle database and the postgresql database, when some data with a certain number type of "number" in the oracle database needs to be deleted, only a deletion statement for the data with the data type of "number" that needs to be deleted in the postgresql database needs to be input, a deletion statement for the data with the data type of "number" that needs to be deleted in the oracle database can be automatically generated through the mapping relationship and the table structure conversion statement, and the deletion statement is executed in the oracle database to delete the data that needs to be deleted. Or, when querying the financial statement of the target database in 10 months, first obtaining a mapping table between the financial statement of the target database and the financial statement of the current database according to the financial statement of the target database. And then after a select statement of the financial statement of 10 months for querying the mapping table is determined, automatically generating and executing the select statement of the financial statement of 10 months for querying the target database according to a table structure and a table structure conversion statement of the financial statement of the target database, which correspond to the table structure of the financial statement of 10 months in the financial statement of the current database, so as to obtain the financial statement of 10 months of the target database.
Referring to fig. 5, optionally, the data synchronization method of the present application further includes:
step 04: and displaying the data of the target table subjected to the increasing, deleting, modifying and checking operations in the mapping table.
Specifically, after the target table of the target database is subjected to the operations of increasing, deleting, modifying and checking according to the operation statement, the mapping table acquires the data of the target table subjected to the operations of increasing, deleting, modifying and checking, and displays the data of the target table subjected to the operations of increasing, deleting, modifying and checking in the mapping table, so that the data of the target table subjected to the operations of increasing, deleting, modifying and checking can be visually and clearly checked. For example, after the target table is deleted, all data left after the target table is deleted is obtained from the mapping table and displayed in the mapping table.
Referring to FIG. 6, optionally, the mapping table includes a plurality of pages, step 04: displaying data of a target table for performing the operations of increasing, deleting, modifying and checking in a mapping table, wherein the data comprises the following data:
step 041: and displaying the data of the target table subjected to the increasing, deleting, modifying and checking operation in the current page of the mapping table, and preloading the data of the target table with the preset number of pages behind the current page.
Specifically, the data of the target table after the operations of increasing, deleting, modifying and checking are generally more, and all the data cannot be displayed in one page, so that the mapping table includes a plurality of pages, the mapping table is provided with preset pages, and each page is provided with preset numbers. After the target table of the target database is subjected to the increasing and deleting modifying and checking operation according to the operation statement, the mapping table displays the data of the target table subjected to the increasing and deleting modifying and checking operation in the current page of the mapping table according to the preset number, and the number of the data of the current page is equal to the preset number. The data of the target table after the increasing, deleting, modifying and checking operation is displayed in the current page of the mapping table, and simultaneously, the data of the target table with the preset number of pages behind the current page is also preloaded, so that the time for waiting for loading and displaying the data of the page behind the current page when the mapping table is inquired is reduced. For example, 50 pieces of data of the target table for performing the add/delete and modify operations, 3 pages of preset number of mapping tables, and 10 pieces of preset number of mapping tables are provided, so that after the add/delete and modify operations are performed on the target table, the mapping table will obtain the data of the target table for performing the add/delete and modify operations, display the first 10 pieces of data in the data of the target table for performing the add/delete and modify operations on the current page, and then preload the data of 2 pages after the current page.
Referring to fig. 7, optionally, the data synchronization method of the present application further includes:
step 05: and exporting the data of the target table subjected to the operations of increasing, deleting, modifying and checking to a mapping table, and storing the data to the current database.
Specifically, after the operations of increasing, deleting, modifying and checking the target table are performed, the data of the target table after the operations of increasing, deleting, modifying and checking are also exported to the mapping table and stored in the current database, so that when the data of the target database after the operations of increasing, deleting, modifying and checking are required to be called, the data of the target table after the operations of increasing, deleting, modifying and checking are exported through the current database.
Furthermore, after a mapping table is established between the current database and the plurality of target databases and the target tables of the plurality of target databases are subjected to the operations of increasing, deleting, modifying and checking according to the operation statements, the current database stores the data of the plurality of target databases, so that the current database can derive the data of different target databases according to the needs, the data is prevented from being called in each target database when the data of the plurality of different target databases is called, and the operation steps and time for calling the data of the different target databases are reduced.
Furthermore, after the data of the target table subjected to the increasing, deleting, modifying and checking operation is exported to the mapping table, the data in the mapping table is also checked, whether the data of the target table subjected to the increasing, deleting, modifying and checking operation is consistent with the data exported by the mapping table is compared, and if the data of the target table subjected to the increasing, deleting, modifying and checking operation is consistent with the data exported by the mapping table, the mapping table is stored in the current database; if the data of the target table subjected to the increasing, deleting, modifying and checking is not consistent with the data in the mapping table, an alarm is given, the work of storing the mapping table in the current database is suspended until the reason of errors in the derivation process is found out, and after the data of the target table subjected to the increasing, deleting, modifying and checking operation is derived again to the mapping table, the mapping table is stored in the current database after the verification result is displayed and the derivation is successful, so that the accuracy of the finally obtained data of the target table subjected to the increasing, deleting, modifying and checking is ensured.
In addition, after the data of the target table subjected to the adding, deleting, modifying and checking operations is exported to the mapping table, the synchronous diary of the data is written into the synchronous diary table of the current database, the data in the synchronous diary table comprises the information, the synchronous time and the data synchronous quantity of the synchronous target database, so that each data synchronous process of the target database is recorded, and the data synchronous processes of the current database and all the target databases are ensured to be traceable. For example, a financial statement in month 10 needs to be searched in a greenplus database, after the search is completed, 100 pieces of data are found in the greenplus database, at this time, the 100 pieces of data are exported to a mapping table and stored in a current database, and information of the greenplus database, synchronized time and the number of synchronized data, that is, 100 pieces of data are recorded in a synchronized diary table.
In order to better implement the data synchronization method according to the embodiment of the present application, the embodiment of the present application further provides a data synchronization apparatus 10. Referring to fig. 8, the data synchronization apparatus 10 may include:
the establishing module 11 is used for establishing a database link between a current database and a target database;
the detection module 12 is configured to detect a table structure of a target database corresponding to a table structure in a current database to generate a mapping relationship;
and the read-write module 13 is configured to establish a mapping table according to the mapping relationship, so as to read and write the target database through the mapping table.
The obtaining module 11 is specifically configured to obtain a link plug-in matched with a target database; and establishing a database link between the current database and the target database through the link plug-in.
The detection module 12 is specifically configured to compare the structured query language of the current database with the structured query language of the target database to determine a table structure of the target database corresponding to the current database; and generating a mapping relation according to the corresponding table structure of the target database in the current database.
The read-write module 13 is specifically configured to receive an input operation to determine an operation statement for the mapping table; and performing addition, deletion, modification and check operations on the target table of the target database according to the operation statements.
The data synchronization device 10 of the present application may further include:
and the display module 14 is configured to display the data of the target table after the adding, deleting, modifying and checking operations are performed in the mapping table.
The display module 14 is specifically configured to display the data of the target table after the add-delete-modify-check operation is performed in the current page of the mapping table, and pre-load the data of the target table with a preset number of pages after the current page.
The data synchronization device 10 of the present application may further include:
and the storage module 15 is used for exporting the data of the target table subjected to the operations of increasing, deleting, modifying and checking to the mapping table and storing the data to the current database.
The various modules in the data synchronization apparatus 10 described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules may be embedded in hardware or independent from the processor 20 in the computer device, or may be stored in a memory in the computer device in software, so that the processor 20 can call and execute operations corresponding to the modules.
Referring to fig. 9, a computer device 100 according to an embodiment of the present application includes a processor 20. The processor 20 is configured to execute the data synchronization method according to any of the above embodiments, and for brevity, the description is omitted here.
Referring to fig. 10, the present embodiment further provides a computer-readable storage medium 200, on which a computer program 210 is stored, and steps of the data synchronization method according to any of the above embodiments are implemented when the computer program 210 is executed by the processor 20, which is not described herein again for brevity.
It will be appreciated that the computer program 210 comprises computer program code. The computer program code may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable storage medium can be a computer readable storage medium such as any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a Random Access Memory (RAM), a software distribution medium, and so forth.
In the description of the present specification, reference to the description of "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the various embodiments or examples and features of the various embodiments or examples described in this specification can be combined and combined by those skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Although embodiments of the present application have been shown and described above, it is to be understood that the above embodiments are exemplary and not to be construed as limiting the present application, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (10)
1. A method of data synchronization, comprising:
establishing a database link between a current database and a target database;
detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and
and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
2. The data synchronization method of claim 1, wherein the establishing a database link between the current database and the target database comprises:
acquiring a link plug-in matched with the target database; and
and establishing a database link between the current database and the target database through the link plug-in.
3. The data synchronization method according to claim 1, wherein the detecting a table structure corresponding to the table structure of the target database in the current database to generate a mapping relationship comprises:
comparing the structured query language of the current database with the structured query language of the target database to determine a corresponding table structure of the target database in the current database; and
and generating the mapping relation according to the corresponding table structure of the target database in the current database.
4. The method according to claim 1, wherein the reading and writing the target database through the mapping table includes:
receiving an input operation to determine an operation statement for the mapping table;
and performing addition, deletion, modification and check operation on the target table of the target database according to the operation statement.
5. The data synchronization method of claim 4, further comprising:
and displaying the data of the target table after the increasing, deleting, modifying and checking operations in the mapping table.
6. The data synchronization method according to claim 5, wherein the mapping table includes a plurality of pages, and the displaying the data of the target table for the add/drop and check operations in the mapping table includes:
displaying the data of the target table after the increasing, deleting, modifying and checking operation in the current page of the mapping table, and preloading the data of the target table of a preset page number behind the current page.
7. The data synchronization method of claim 4, further comprising:
and exporting the data of the target table subjected to the operations of increasing, deleting, modifying and checking to the mapping table, and storing the data to the current database.
8. A data synchronization apparatus, comprising:
the establishing module is used for establishing a database link between the current database and the target database;
the detection module is used for detecting a corresponding table structure of the target database in the current database so as to generate a mapping relation; and
and the read-write module is used for establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
9. A computer device comprising a processor configured to establish a database link between a current database and a target database; detecting a corresponding table structure of the target database in the current database to generate a mapping relation; and establishing a mapping table according to the mapping relation so as to read and write the target database through the mapping table.
10. A computer-readable storage medium containing a computer program which, when executed by one or more processors, implements the method of data synchronization of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211353053.2A CN115408473A (en) | 2022-11-01 | 2022-11-01 | Data synchronization method and device, computer equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211353053.2A CN115408473A (en) | 2022-11-01 | 2022-11-01 | Data synchronization method and device, computer equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115408473A true CN115408473A (en) | 2022-11-29 |
Family
ID=84167937
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211353053.2A Pending CN115408473A (en) | 2022-11-01 | 2022-11-01 | Data synchronization method and device, computer equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115408473A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1664816A (en) * | 2005-03-11 | 2005-09-07 | 谢永强 | Method for realizing transplantation between information websites of different platforms |
CN107798069A (en) * | 2017-09-26 | 2018-03-13 | 恒生电子股份有限公司 | Method, apparatus and computer-readable medium for data loading |
US20190050437A1 (en) * | 2017-08-10 | 2019-02-14 | Io-Tahoe Llc | Inclusion Dependency Determination In A Large Database For Establishing Primary Key-Foreign Key Relationships |
CN111241060A (en) * | 2020-01-08 | 2020-06-05 | 苏州科达科技股份有限公司 | Data migration method, system, device and storage medium |
CN113051347A (en) * | 2021-03-25 | 2021-06-29 | 未鲲(上海)科技服务有限公司 | Method, system, equipment and storage medium for data synchronization between heterogeneous databases |
CN113505128A (en) * | 2021-06-30 | 2021-10-15 | 平安科技(深圳)有限公司 | Method, device and equipment for creating data table and storage medium |
CN114546992A (en) * | 2022-03-21 | 2022-05-27 | 连连(杭州)信息技术有限公司 | Database migration method and device, storage medium and electronic equipment |
-
2022
- 2022-11-01 CN CN202211353053.2A patent/CN115408473A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1664816A (en) * | 2005-03-11 | 2005-09-07 | 谢永强 | Method for realizing transplantation between information websites of different platforms |
US20190050437A1 (en) * | 2017-08-10 | 2019-02-14 | Io-Tahoe Llc | Inclusion Dependency Determination In A Large Database For Establishing Primary Key-Foreign Key Relationships |
CN107798069A (en) * | 2017-09-26 | 2018-03-13 | 恒生电子股份有限公司 | Method, apparatus and computer-readable medium for data loading |
CN111241060A (en) * | 2020-01-08 | 2020-06-05 | 苏州科达科技股份有限公司 | Data migration method, system, device and storage medium |
CN113051347A (en) * | 2021-03-25 | 2021-06-29 | 未鲲(上海)科技服务有限公司 | Method, system, equipment and storage medium for data synchronization between heterogeneous databases |
CN113505128A (en) * | 2021-06-30 | 2021-10-15 | 平安科技(深圳)有限公司 | Method, device and equipment for creating data table and storage medium |
CN114546992A (en) * | 2022-03-21 | 2022-05-27 | 连连(杭州)信息技术有限公司 | Database migration method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109388612B (en) | Method, equipment, system and medium for generating data summary document | |
US7337176B1 (en) | Data loading tool for loading a database | |
CN107301214B (en) | Data migration method and device in HIVE and terminal equipment | |
CN107220274B (en) | Visual data interface market realization method | |
CN109063178B (en) | Method and device for automatically expanding self-help analysis report | |
CA3176450A1 (en) | Method and apparatus for implementing incremental data consistency | |
CN111143368A (en) | Relational database data comparison method and system | |
US20220207061A1 (en) | Technique for generating views of archived business data | |
CN114780641A (en) | Multi-library multi-table synchronization method and device, computer equipment and storage medium | |
CN111680030A (en) | Data fusion method and device, and data processing method and device based on meta information | |
CN113094442A (en) | Full data synchronization method, device, equipment and medium | |
CN111061733B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
CN111881660A (en) | Report generation method and device, computer equipment and storage medium | |
EP1591914A1 (en) | Method, computer program product and device for importing a plurality of data sets into a system | |
CN115408473A (en) | Data synchronization method and device, computer equipment and computer readable storage medium | |
CN111259082B (en) | Method for realizing full data synchronization in big data environment | |
CN111143356B (en) | Report retrieval method and device | |
Pröll et al. | Precise Data Identification Services for Long Tail Research Data. | |
CN112540970A (en) | Metadata blood relationship analysis method and system based on version management | |
US8296336B2 (en) | Techniques for efficient dataloads into partitioned tables using swap tables | |
CN115061982B (en) | Case-customization-based relational graph construction method, system, terminal and medium | |
CN115455035B (en) | Data query model construction method and computer-readable storage medium | |
US20210232717A1 (en) | Measurement tables including target identification information indicating a measurement target | |
US10229750B2 (en) | Memory management architecture for use with a diagnostic tool | |
CN114564923A (en) | Dynamic report generation method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221129 |
|
RJ01 | Rejection of invention patent application after publication |