Database synchronization method and device, equipment, medium and program product

By automatically synchronizing databases through the construction of database synchronization configuration files, the problem of complex operation of existing tools is solved, synchronization efficiency and security are improved, and the portability and scalability of synchronization are enhanced.

CN121560992APending Publication Date: 2026-02-24CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511758160.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing database synchronization tools are complex to operate, resulting in high complexity in database synchronization operations.

Method used

By responding to database synchronization commands, the system extracts synchronization objects from the commands, obtains information from the first and second databases, constructs a database synchronization configuration file, and synchronizes the content to the second database according to the configuration file, thus achieving database synchronization automatically without relying on user operations.

Benefits of technology

It reduces the operational complexity of database synchronization, improves the efficiency and security of database synchronization, and enhances the portability and scalability of database synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121560992A_ABST
    Figure CN121560992A_ABST
Patent Text Reader

Abstract

The invention relates to a database synchronization method and device, equipment, a medium and a program product. The method comprises the steps that in response to a database synchronization instruction, a synchronization object is extracted from the database synchronization instruction, and the synchronization object is used for identifying a first database and a second database for database synchronization; acquiring first information of the first database, and acquiring second information of the second database; constructing a database synchronization configuration file according to the first information and the second information; and synchronizing the content in the first database to the second database according to the database synchronization configuration file. By adopting the method, the operation complexity of database synchronization can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a database synchronization method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] With the development of the times, the demand for data reports from enterprises is becoming increasingly diverse. Therefore, data from multiple databases is often required to meet the needs of generating enterprise data reports. As a result, database synchronization technology has emerged.

[0003] Currently, the common database synchronization technology uses data synchronization tools, but existing database synchronization tools have the problem of being complex to use, resulting in a high level of complexity in database synchronization operations. Summary of the Invention

[0004] Therefore, it is necessary to provide a database synchronization method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce the operational complexity of database synchronization in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a database synchronization method, the method comprising:

[0006] In response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0007] Obtain first information from the first database, and obtain second information from the second database;

[0008] Based on the first information and the second information, construct a database synchronization configuration file;

[0009] According to the database synchronization configuration file, the content in the first database is synchronized to the second database.

[0010] As one embodiment, constructing a database synchronization configuration file based on the first information and the second information includes:

[0011] Extract the first database identifier of the first database and the database connection information from the first information;

[0012] Extract the second database identifier of the second database from the second information;

[0013] A database synchronization configuration file is constructed based on the first database identifier, the database connection information, and the second database identifier.

[0014] As one embodiment, the step of constructing a database synchronization configuration file based on the first database identifier, the database connection information, and the second database identifier includes:

[0015] Extract the synchronization content from the database synchronization command;

[0016] A database synchronization configuration file is constructed based on the synchronization content, the first database identifier, the database connection information, and the second database identifier.

[0017] As one embodiment, the step of constructing a database synchronization configuration file based on the synchronization content, the first database identifier, the database connection information, and the second database identifier includes:

[0018] Based on the synchronization content, the corresponding synchronized table entries in the first database are located to obtain location data information;

[0019] A database synchronization configuration file is constructed based on the location data, the first database identifier, the database connection information, and the second database identifier.

[0020] As one embodiment, the step of constructing a database synchronization configuration file based on the location data information, the first database identifier, the database connection information, and the second database identifier includes:

[0021] The database connection information is encrypted to obtain encrypted database connection information;

[0022] A database synchronization configuration file is constructed based on the database connection encryption information, the location data information, the first database identifier, and the second database identifier.

[0023] As one embodiment, after synchronizing the content of the first database to the second database according to the database synchronization configuration file, the method further includes:

[0024] If the database synchronization between the first database and the second database is completed, the table entry features of the second database and the first database are compared to obtain the comparison result.

[0025] If the comparison result indicates a failure, database synchronization error information will be output.

[0026] Secondly, this application also provides a database synchronization device, comprising:

[0027] An information extraction module is used to extract a synchronization object from a database synchronization command in response to the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0028] The information acquisition module is used to acquire first information from the first database and second information from the second database.

[0029] A configuration building module is used to build a database synchronization configuration file based on the first information and the second information;

[0030] The data synchronization module is used to synchronize the content of the first database to the second database according to the database synchronization configuration file.

[0031] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the processor performs the following steps when executing the computer program:

[0032] In response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0033] Obtain first information from the first database, and obtain second information from the second database;

[0034] Based on the first information and the second information, construct a database synchronization configuration file;

[0035] According to the database synchronization configuration file, the content in the first database is synchronized to the second database.

[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0037] In response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0038] Obtain first information from the first database, and obtain second information from the second database;

[0039] Based on the first information and the second information, construct a database synchronization configuration file;

[0040] According to the database synchronization configuration file, the content in the first database is synchronized to the second database.

[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0042] In response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0043] Obtain first information from the first database, and obtain second information from the second database;

[0044] Based on the first information and the second information, construct a database synchronization configuration file;

[0045] According to the database synchronization configuration file, the content in the first database is synchronized to the second database.

[0046] The aforementioned database synchronization method, apparatus, computer device, computer-readable storage medium, and computer program product, in response to a database synchronization instruction, extract a synchronization object from the database synchronization instruction, wherein the synchronization object is used to identify a first database and a second database for database synchronization; obtain first information of the first database and second information of the second database; construct a database synchronization configuration file based on the first information and the second information; and synchronize the content of the first database to the second database according to the database synchronization configuration file.

[0047] Thus, upon receiving a database synchronization command, the synchronization object can be extracted from the command, enabling the identification of the database requiring data synchronization. This allows for the acquisition of first information from the first database and second information from the second database. Based on this first and second information, a database synchronization configuration file is constructed. Subsequently, the data synchronization process between the first and second databases can be implemented using this configuration file. These steps are independent of user-controlled operations and can automatically perform the database synchronization process according to the command, reducing the operational complexity of database synchronization. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a diagram illustrating the application environment of a database synchronization method in one embodiment.

[0050] Figure 2 This is a flowchart illustrating a database synchronization method in one embodiment;

[0051] Figure 3 This is a flowchart illustrating the steps of constructing a database synchronization configuration file based on the first information and the second information in one embodiment.

[0052] Figure 4 This is a flowchart illustrating the steps of a database synchronization anomaly detection method in one embodiment;

[0053] Figure 5 This is a structural block diagram of a database synchronization device in one embodiment;

[0054] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0056] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0057] The database synchronization method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. In response to a database synchronization command, server 104 extracts a synchronization object from the command, wherein the synchronization object identifies the first and second databases to be synchronized; obtains first information about the first database and second information about the second database, wherein the first information characterizes the database type of the first database and the second information characterizes the database type of the second database; constructs a database synchronization configuration file based on the first and second information; and synchronizes the content of the first database to the second database according to the database synchronization configuration file. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Terminal 102 can be a device with a target application deployed on it.

[0058] In one exemplary embodiment, such as Figure 2 As shown, a database synchronization method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:

[0059] Step 202: In response to the database synchronization command, extract the synchronization object from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0060] In step 202, the database synchronization command can be used to indicate the synchronization object to be synchronized, or it can be used to indicate the data content that needs to be synchronized.

[0061] In step 202, the first database is the source of the data to be synchronized. The number of first databases can be single or multiple, without limitation. The second database is the destination of the data to be synchronized. The second database can be a Hive database (a data warehouse infrastructure based on Hadoop (an open-source distributed computing framework for processing large-scale datasets). It uses simple SQL (Structured Query Language) statements to query and analyze data stored in HDFS (Hadoop Distributed File System) and converts the SQL statements into MapReduce (a programming model for parallel computing of large-scale datasets (greater than 1TB)) programs for data processing). The number of second databases can be single or multiple, without limitation.

[0062] For example, the first database may include database A, and the second database may include database B. A database synchronization command can be used to instruct data in database A to be synchronized to database B. The first database may also include database C. A database synchronization command can be used to instruct data in databases A and C to be synchronized to database B. The second database may also include database D. A database synchronization command can be used to instruct data in database A to be synchronized to databases B and D, and a database synchronization command can also be used to instruct data in database C to be synchronized to databases B and D.

[0063] This enables diverse database synchronization processes and improves the portability of database synchronization.

[0064] Optionally, before step 202, the above method further includes at least one of the following: if a user's database synchronization operation is detected, a database synchronization instruction is generated based on the database synchronization operation; if a periodic synchronization time condition is detected, a database synchronization instruction is generated based on the periodic synchronization time condition.

[0065] Database synchronization operations include, but are not limited to, selecting the database type, selecting data content, entering the database type, and entering data content.

[0066] In this way, database synchronization commands are automatically generated through user database synchronization operations, providing users with a convenient and efficient user experience and greatly reducing the technical threshold. Furthermore, the database synchronization operation also has a certain degree of scalability, easily meeting diverse database synchronization needs, thereby easily fulfilling diverse enterprise reporting requirements and improving the portability of database synchronization.

[0067] The periodic synchronization time can be set by the user as needed, or it can correspond to the historical update frequency of each database.

[0068] In this way, independent configuration of each database can be achieved through database synchronization commands, thereby matching the update frequency of different databases under different business scenarios and ensuring timely database synchronization when databases are updated.

[0069] As one embodiment, extracting the synchronization object from the database synchronization instruction includes: performing semantic recognition on the database synchronization instruction to obtain recognition information, and extracting the synchronization object from the recognition information.

[0070] Step 204: Obtain first information of the first database and second information of the second database, wherein the first information is used to characterize the database type of the first database and the second information is used to characterize the database type of the second database.

[0071] In step 204, the first information includes at least one of a first database identifier and database connection information, and the second information includes a second database identifier. The first database identifier is used to identify the database type, which includes, but is not limited to, MySQL (a relational database management system developed by Oracle Corporation), Oracle (a relational database management system developed by Oracle Corporation), and SQL Server (a relational database management system developed by Microsoft Corporation). The database connection information includes at least one of the database address, port, username, and password of the first database.

[0072] Step 206: Construct a database synchronization configuration file based on the first information and the second information.

[0073] For example, step 206 includes: concatenating the first information and the second information to obtain a database synchronization configuration file.

[0074] Step 208: According to the database synchronization configuration file, synchronize the content of the first database to the second database.

[0075] For example, step 208 includes: synchronizing the contents of the first database to the second database by executing a database synchronization configuration file.

[0076] The process of executing the database synchronization configuration file can be implemented using Spark (an open-source distributed computing system that supports large-scale data processing. It provides efficient in-memory computing capabilities and enables distributed data processing on a cluster. Spark is commonly used to handle big data tasks, especially large-scale batch and stream processing tasks).

[0077] Thus, parallel database synchronization can be achieved through Spark tools, which improves the concurrency of database synchronization, and in other words, improves the efficiency of database synchronization.

[0078] In the above database synchronization method, in response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized; first information of the first database and second information of the second database are obtained; a database synchronization configuration file is constructed based on the first information and the second information; and the content of the first database is synchronized to the second database according to the database synchronization configuration file. By extracting the synchronization object from the database synchronization command in response to the database synchronization command, the database requiring data synchronization can be identified, thereby obtaining the first information of the first database and the second information of the second database respectively. Based on the first and second information, a database synchronization configuration file is constructed, and the data synchronization process between the first database and the second database is realized based on the database synchronization configuration file. The above steps are independent of user operation control and can automatically realize the database synchronization process according to the database synchronization command, reducing the operational complexity of database synchronization.

[0079] In one exemplary embodiment, such as Figure 3 As shown, step 206 includes steps 302 to 306. Wherein:

[0080] Step 302: Extract the first database identifier of the first database and the database connection information from the first information.

[0081] Step 304: Extract the second database identifier of the second database from the second information.

[0082] Step 306: Construct a database synchronization configuration file based on the first database identifier, the database connection information, and the second database identifier.

[0083] For example, step 306 includes: concatenating the first database identifier, the database connection information, and the second database identifier to obtain a database synchronization configuration file.

[0084] It is understandable that the following situations may exist:

[0085] Scenario 1: A synchronization process between the first and second databases has already been performed, but the first database has been updated, so another data synchronization is required.

[0086] Scenario 2: Some sensitive content exists in the first database and cannot be synchronized to the second database.

[0087] In the above scenario, it is only necessary to synchronize a portion of the data from the first database to the second database. If all the data from the first database is directly synchronized to the second database, there may be duplicate data in the second database, resulting in unnecessary resource consumption in the second database; sensitive content from the first database may be synchronized to the second database, leading to data leakage; and a small portion of the data in the first database may be updated, but all the data in the first database is still synchronized, resulting in too much unnecessary data consuming synchronization time and leading to low data synchronization efficiency.

[0088] To overcome the above-mentioned technical defects, in one embodiment, a database synchronization configuration file is constructed based on the first database identifier, the database connection information, and the second database identifier, including: extracting synchronization content from the database synchronization instruction; and constructing a database synchronization configuration file based on the synchronization content, the first database identifier, the database connection information, and the second database identifier.

[0089] In this way, by synchronizing content, the data to be synchronized in the first database can be specified, thereby avoiding unnecessary resource consumption in the second database; by synchronizing content, the updated and non-sensitive data in the first database can be synchronized, thereby avoiding data leakage in the first database and excessive unnecessary data consuming synchronization time, thus improving the efficiency and security of data synchronization.

[0090] Further, based on the synchronization content, the first database identifier, the database connection information, and the second database identifier, a database synchronization configuration file is constructed, including: locating the corresponding synchronized table entries in the first database according to the synchronization content to obtain location data information; and constructing a database synchronization configuration file based on the location data information, the first database identifier, the database connection information, and the second database identifier.

[0091] As one embodiment, a database synchronization configuration file is constructed based on the location data information, the first database identifier, the database connection information, and the second database identifier, including: concatenating the location data information, the first database identifier, the database connection information, and the second database identifier to obtain the database synchronization configuration file.

[0092] It is understandable that during the process of synchronizing sensitive data from the first database to the second database, there may be a situation where sensitive data is leaked, or there may be sensitive data in the database connection information. When constructing the database synchronization configuration file based on the database connection information, there may be a situation where sensitive data in the database connection information is leaked, resulting in low data security of the first database during the database synchronization process.

[0093] To overcome the technical deficiency of low data security in the first database during the database synchronization process, as an embodiment, the step of constructing a database synchronization configuration file based on the location data information, the first database identifier, the database connection information, and the second database identifier includes: encrypting the database connection information to obtain encrypted database connection information; and constructing a database synchronization configuration file based on the encrypted database connection information, the location data information, the first database identifier, and the second database identifier.

[0094] In this way, when constructing the database synchronization configuration file, the database connection information is encrypted to prevent the leakage of sensitive information in the constructed database synchronization configuration file, thus ensuring the information security of the primary database.

[0095] Optionally, synchronizing the content of the first database to the second database according to the database synchronization configuration file includes: decrypting the database connection encryption information in the database synchronization configuration file to obtain database connection information; and synchronizing the content of the first database to the second database according to the database connection information and the database synchronization configuration file.

[0096] Therefore, to avoid the failure of database synchronization due to the encrypted database connection information in the database synchronization configuration file, the database connection information is restored by decrypting the encrypted database connection information, thus ensuring that database synchronization can be achieved.

[0097] In this embodiment, the first database identifier and database connection information of the first database are extracted from the first information; the second database identifier of the second database is extracted from the second information; and a database synchronization configuration file is constructed based on the first database identifier, the database connection information and the second database identifier. The first database identifier and the second database identifier can be used to mark the types of the first database and the second database, and the database connection information can ensure the connection between the first database and the second database, thus ensuring the synchronization between the first database and the second database.

[0098] It is understandable that various problems may occur during database synchronization, leading to synchronization anomalies. If these problems are not checked, they will affect the generation of subsequent data reports.

[0099] To overcome the above-mentioned shortcomings, a database synchronization anomaly detection method is provided. In an exemplary embodiment, such as... Figure 4 As shown, after step 208, the above method further includes:

[0100] Step 402: If the database synchronization between the first database and the second database is completed, the table entry features of the second database and the first database are compared to obtain the comparison result.

[0101] As one embodiment, comparing the table entry features of the second database with those of the first database to obtain a comparison result includes: comparing the number of second table entries in the second database with the number of first table entries in the first database to obtain a comparison result.

[0102] Step 404: If the comparison result indicates a comparison failure, output database synchronization error information.

[0103] Optionally, the above method further includes: obtaining the number of third entries corresponding to the synchronized content; if the sum of the number of first entries and the number of third entries is consistent with the number of second entries, the comparison result is determined to indicate that the comparison is successful; if the sum of the number of first entries and the number of third entries is inconsistent with the number of second entries, the comparison result is determined to indicate that the comparison is unsuccessful.

[0104] In this embodiment, if database synchronization between the first database and the second database is detected to be complete, the table entry features of the second database and the first database are compared to obtain a comparison result. If the comparison result indicates that the comparison has failed, database synchronization anomaly information is output. Database synchronization is detected by comparing table entry features, ensuring that database synchronization anomalies can be detected in a timely manner.

[0105] As a detailed embodiment, in response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify a first database and a second database to be synchronized; first information of the first database is obtained, and second information of the second database is obtained; a first database identifier of the first database and database connection information are extracted from the first information; a second database identifier of the second database is extracted from the second information; synchronization content is extracted from the database synchronization command; and according to the synchronization content, the corresponding table entry data to be synchronized in the first database is located to obtain location data information.

[0106] Further, the database connection information is encrypted to obtain encrypted database connection information; a database synchronization configuration file is constructed based on the encrypted database connection information, the location data information, the first database identifier, and the second database identifier; the encrypted database connection information in the database synchronization configuration file is decrypted to obtain the database connection information; the content of the first database is synchronized to the second database based on the database connection information and the database synchronization configuration file; if the database synchronization between the first database and the second database is detected to be complete, the table entry features of the second database and the first database are compared to obtain a comparison result; if the comparison result indicates a comparison failure, database synchronization error information is output.

[0107] Thus, by responding to a database synchronization command, a synchronization object is extracted from the command, wherein the synchronization object is used to identify the first and second databases to be synchronized; first information of the first database and second information of the second database are obtained; a database synchronization configuration file is constructed based on the first and second information; and the content of the first database is synchronized to the second database according to the configuration file. By extracting the synchronization object from the database synchronization command upon response, the database requiring data synchronization can be identified, thereby allowing the acquisition of the first information of the first database and the second information of the second database. Based on the first and second information, a database synchronization configuration file is constructed, and the data synchronization process between the first and second databases can be implemented based on the configuration file. These steps are independent of user-operated control and can automatically implement the database synchronization process according to the command, reducing the operational complexity of database synchronization.

[0108] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0109] Based on the same inventive concept, this application also provides a database synchronization apparatus for implementing the database synchronization method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more database synchronization apparatus embodiments provided below can be found in the limitations of the database synchronization method described above, and will not be repeated here.

[0110] In one exemplary embodiment, such as Figure 5 As shown, a database synchronization device is provided, including: an information extraction module, an information acquisition module, a configuration construction module, and a data synchronization module, wherein:

[0111] An information extraction module is used to extract a synchronization object from a database synchronization command in response to the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized.

[0112] The information acquisition module is used to acquire first information from the first database and second information from the second database.

[0113] A configuration building module is used to build a database synchronization configuration file based on the first information and the second information.

[0114] The data synchronization module is used to synchronize the content of the first database to the second database according to the database synchronization configuration file.

[0115] In one embodiment, the configuration building module is further configured to: extract a first database identifier of the first database and database connection information from the first information; extract a second database identifier of the second database from the second information; and build a database synchronization configuration file based on the first database identifier, the database connection information and the second database identifier.

[0116] In one embodiment, the configuration building module is further configured to: extract synchronization content from the database synchronization instruction; and construct a database synchronization configuration file based on the synchronization content, the first database identifier, the database connection information, and the second database identifier.

[0117] In one embodiment, the configuration building module is further configured to: locate the corresponding synchronized table entries in the first database according to the synchronization content to obtain location data information; and construct a database synchronization configuration file according to the location data information, the first database identifier, the database connection information, and the second database identifier.

[0118] In one embodiment, the configuration building module is further configured to: encrypt the database connection information to obtain encrypted database connection information; and construct a database synchronization configuration file based on the encrypted database connection information, the location data information, the first database identifier, and the second database identifier.

[0119] In one embodiment, after synchronizing the content of the first database to the second database according to the database synchronization configuration file, the database synchronization device further includes: an anomaly detection module, used to compare the table entry features of the second database and the first database to obtain a comparison result if the database synchronization between the first database and the second database is detected to be completed; and to output database synchronization anomaly information if the comparison result indicates that the comparison failed.

[0120] Each module in the aforementioned database synchronization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0121] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a database synchronization method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0122] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0123] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0124] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0125] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0127] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0128] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0129] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A database synchronization method, characterized in that, The method includes: In response to a database synchronization command, a synchronization object is extracted from the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized. Obtain first information from the first database, and obtain second information from the second database, wherein the first information is used to characterize the database type of the first database, and the second information is used to characterize the database type of the second database; Based on the first information and the second information, construct a database synchronization configuration file; According to the database synchronization configuration file, the content in the first database is synchronized to the second database.

2. The method according to claim 1, characterized in that, The step of constructing a database synchronization configuration file based on the first information and the second information includes: Extract the first database identifier of the first database and the database connection information from the first information; Extract the second database identifier of the second database from the second information; A database synchronization configuration file is constructed based on the first database identifier, the database connection information, and the second database identifier.

3. The method according to claim 2, characterized in that, The step of constructing a database synchronization configuration file based on the first database identifier, the database connection information, and the second database identifier includes: Extract the synchronization content from the database synchronization command; A database synchronization configuration file is constructed based on the synchronization content, the first database identifier, the database connection information, and the second database identifier.

4. The method according to claim 3, characterized in that, The step of constructing a database synchronization configuration file based on the synchronization content, the first database identifier, the database connection information, and the second database identifier includes: Based on the synchronization content, the corresponding synchronized table entries in the first database are located to obtain location data information; A database synchronization configuration file is constructed based on the location data, the first database identifier, the database connection information, and the second database identifier.

5. The method according to claim 4, characterized in that, The step of constructing a database synchronization configuration file based on the location data information, the first database identifier, the database connection information, and the second database identifier includes: The database connection information is encrypted to obtain encrypted database connection information; A database synchronization configuration file is constructed based on the database connection encryption information, the location data information, the first database identifier, and the second database identifier.

6. The method according to claim 1, characterized in that, After synchronizing the content of the first database to the second database according to the database synchronization configuration file, the method further includes: If the database synchronization between the first database and the second database is completed, the table entry features of the second database and the first database are compared to obtain the comparison result. If the comparison result indicates a failure, database synchronization error information will be output.

7. A database synchronization device, characterized in that, The device includes: An information extraction module is used to extract a synchronization object from a database synchronization command in response to the database synchronization command, wherein the synchronization object is used to identify the first database and the second database to be synchronized. The information acquisition module is used to acquire first information from the first database and second information from the second database. A configuration building module is used to build a database synchronization configuration file based on the first information and the second information; The data synchronization module is used to synchronize the content of the first database to the second database according to the database synchronization configuration file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.