Cross-platform data synchronization method and device, and electronic device

By establishing data connections between multiple platforms, synchronous updates of cross-platform data are solved, and the problem of cumbersome data update operations of multiple platform software on the same server is solved, and automatic synchronous updates are realized, improving efficiency.

CN111352993BActive Publication Date: 2025-01-07SHENZHEN HONGHE INNOVATION INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910211874.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-03-20
Publication Date
2025-01-07
Estimated Expiration
2039-03-20

AI Technical Summary

Technical Problem

When installing multiple platform software on the same server, the same shared data needs to be added and updated on their respective platforms, which is cumbersome and time-consuming, especially when the data volume is large, it requires repeated cumbersome data entry operations.

Method used

By configuring the second database information, a data connection between the first database and the second database is established, the first shared data is obtained from the first database and the second shared data is obtained from the first database, and the two are updated simultaneously to achieve cross-border Automatic synchronous update of platform data.

Benefits of technology

It realizes automatic synchronous update of shared data across platforms, saving time and effort, and convenient operation, avoiding the need to repeatedly enter data on each platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111352993B_ABST
    Figure CN111352993B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-platform data synchronization method and device, and electronic equipment. A first platform is configured with a first database, and first common data is stored in the first database. A second platform is configured with a second database, and second common data is stored in the second database. The method includes: configuring the second database information; establishing a data connection between the first database and the second database according to the second database information; obtaining the first common data from the first database, obtaining the second common data from the second database, and synchronously updating the first common data and the second common data. The present invention can realize the synchronous update of common data between multiple platforms, saving time and labor, and convenient operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a cross-platform data synchronization method and device, and electronic equipment. Background Art

[0002] At present, multiple platform software may be installed on the same terminal, especially two or more series of platform software from the same manufacturer may be installed on the same server. The same shared data may exist between the multiple platform software. For example, the recording and broadcasting platform software and the resource platform software of Honghe Technology are installed on the same server at the same time. The recording and broadcasting platform software and the resource platform software have the same user data, course data, etc. When updating the shared data, data can only be added and saved on their respective platforms respectively, which is a cumbersome operation. Especially when the amount of data is large, it is necessary to repeat the cumbersome data entry and addition operations, which is time-consuming and labor-intensive. Summary of the invention

[0003] In view of this, the purpose of the present invention is to propose a cross-platform data synchronization method and device, and electronic equipment, which can realize the synchronous update of shared data across platforms, is easy to operate, and saves time and effort.

[0004] Based on the above purpose, the present invention provides a cross-platform data synchronization method, wherein the first platform is configured with a first database, the first database stores first common data, and the second platform is configured with a second database, the second database stores second common data, and the method comprises:

[0005] Configure the second database information;

[0006] Establishing a data connection between the first database and the second database according to the second database information;

[0007] The first shared data is acquired from the first database, the second shared data is acquired from the second database according to the second database information, and the first shared data and the second shared data are synchronously updated.

[0008] Optionally, the second database information includes connection information of the second database and common data information of the second database, the connection information of the second database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name, and the common data information of the second database includes data table name, data table unique identifier, and data table synchronization field name.

[0009] Optionally, the first platform is configured with a configuration file for saving the first database information, the first database information includes the connection information of the first database and the common data information of the first database, the connection information of the first database includes the database type, database connection address, database connection user name, database connection password, database connection port, and database name, and the common data information of the first database includes the data table name, data table unique identifier, and data table synchronization field name.

[0010] Optionally, connection information of the first database is obtained from the configuration file, and the first database is connected according to the connection information of the first database, and the second database is connected according to the connection information of the second database, so as to establish a data connection between the first database and the second database.

[0011] Optionally, the method further includes:

[0012] A third database is configured to store the second database information, the second database information is obtained from the third database, and a data connection is established between the first database and the second database.

[0013] Optionally, the synchronization update method of the first shared data and the second shared data is: the data items shared by the first shared data and the second shared data are not processed; for the data items that exist in the first shared data and the data items that do not exist in the second shared data, the data items that exist in the first shared data are inserted into the second data table where the second shared data is located, as new data items of the second shared data, and synchronization tags are added to the new data items in the second data table; for the data items that do not exist in the first shared data and the data items that exist in the second shared data, the data items that exist in the second shared data are inserted into the first data table where the first shared data is located, as new data items of the first shared data, and synchronization tags are added to the new data items in the first data table; for the data items with synchronization tags that exist in the first shared data and the data items that no longer exist in the second shared data, the data items with synchronization tags that exist in the first shared data are deleted; for the data items with synchronization tags that exist in the second shared data and the data items that no longer exist in the first shared data, the data items with synchronization tags that exist in the second shared data are deleted.

[0014] Optionally, the second database information includes a synchronization time parameter, and the first common data and the second common data are synchronously updated according to the synchronization time parameter.

[0015] The embodiment of the present invention further provides a cross-platform data synchronization device, wherein a first platform is configured with a first database, and first common data is stored in the first database; a second platform is configured with a second database, and second common data is stored in the second database; the device comprises:

[0016] A configuration module, used for configuring the second database information;

[0017] A database connection module, used to establish a data connection between the first database and the second database according to the second database information;

[0018] A data synchronization module is used to obtain the first common data from the first database, obtain the second common data from the second database according to the second database information, and synchronously update the first common data and the second common data.

[0019] Optionally, the second database information includes connection information of the second database and common data information of the second database, the connection information of the second database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name, and the common data information of the second database includes data table name, data table unique identifier, and data table synchronization field name.

[0020] Optionally, the first platform is configured with a configuration file for saving the first database information, the first database information includes the connection information of the first database and the common data information of the first database, the connection information of the first database includes the database type, database connection address, database connection user name, database connection password, database connection port, and database name, and the common data information of the first database includes the data table name, data table unique identifier, and data table synchronization field name.

[0021] Optionally, connection information of the first database is obtained from the configuration file, and the first database is connected according to the connection information of the first database, and the second database is connected according to the connection information of the second database, so as to establish a data connection between the first database and the second database.

[0022] Optionally, the device further comprises:

[0023] The third database is used to store the second database information; read the connection information of the second database from the third database, and connect to the second database according to the connection information of the second database.

[0024] Optionally, the synchronization update method of the first shared data and the second shared data is: the data items shared by the first shared data and the second shared data are not processed; for the data items that exist in the first shared data and the data items that do not exist in the second shared data, the data items that exist in the first shared data are inserted into the second data table where the second shared data is located, as new data items of the second shared data, and synchronization tags are added to the new data items in the second data table; for the data items that do not exist in the first shared data and the data items that exist in the second shared data, the data items that exist in the second shared data are inserted into the first data table where the first shared data is located, as new data items of the first shared data, and synchronization tags are added to the new data items in the first data table; for the data items with synchronization tags that exist in the first shared data and the data items that no longer exist in the second shared data, the data items with synchronization tags that exist in the first shared data are deleted; for the data items with synchronization tags that exist in the second shared data and the data items that no longer exist in the first shared data, the data items with synchronization tags that exist in the second shared data are deleted.

[0025] Optionally, the second database information includes a synchronization time parameter, and the device further includes:

[0026] A timing synchronization module is used to synchronously update the first shared data and the second shared data according to the synchronization time parameter.

[0027] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the cross-platform data synchronization method is implemented when the processor executes the program.

[0028] From the above, it can be seen that the cross-platform data synchronization method and device, and electronic device provided by the present invention configure the second database information, establish a data connection between the first database and the second database according to the second database information, obtain the first common data from the first database, obtain the second common data from the second database, and synchronously update the first common data and the second common data. The present invention can realize the automatic synchronous update of common data between multiple platforms, saving time and effort, and is easy to operate. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A schematic diagram of a method flow chart of an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of the structure of a device according to an embodiment of the present invention;

[0032] Figure 3 Schematic diagram of the platform architecture of an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0034] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0035] The cross-platform data synchronization method provided by the embodiment of the present invention is used to synchronize and update first common data of a first platform with second common data of a second platform, wherein the first platform is configured with a first database, the first database stores the first common data, and the second platform is configured with a second database, the second database stores the second common data, and the cross-platform data synchronization method includes:

[0036] Configure the second database information;

[0037] Establishing a data connection between the first database and the second database according to the second database information;

[0038] The first common data is obtained from the first database, the second common data is obtained from the second database according to the second database information, and the first common data and the second common data are synchronously updated.

[0039] Figure 1 is a schematic diagram of a method flow of an embodiment of the present invention, Figure 3 Schematic diagram of the platform architecture of an embodiment of the present invention. As shown in the figure, the cross-platform data synchronization method provided by the embodiment of the present invention includes:

[0040] S10: configure the second database information;

[0041] On the synchronization configuration page of the first platform, enter the second database information. The configured second database information includes database type, database connection address, database connection user name, database connection password, database connection port, database name, data table name, data table unique identifier, data table synchronization field name, synchronization time parameters, etc.

[0042] Database types include mysql, sqlserver, access, foxbase, oracle, db2, sybase, etc.

[0043] S11: establishing a data connection between the first database and the second database according to the second database information;

[0044] Specifically include:

[0045] S110: Connecting to the first database according to the first database information;

[0046] On the first platform, connection information of the first database is obtained, and the first database is connected. The connection information of the first database includes: database type, database connection address, database connection user name, database connection password, database connection port, and database name. The first database is connected according to the connection information of the first database. In one embodiment, the connection information of the first database is saved in a configuration file. When connecting to the first database, the connection information of the first database is obtained by reading from the configuration file.

[0047] S111: connecting to the second database according to the second database information;

[0048] On the first platform, according to the configured second database information, the connection information of the second database is determined, and the second database is connected according to the connection information of the second database. The connection information of the second database includes: database type, database connection address, database connection user name, database connection password, database connection port, database name, and the second database is connected according to the connection information of the second database.

[0049] In an embodiment of the present invention, a third database is configured to store the information of the second database, the connection information of the second database is read from the third database, and the second database is connected according to the connection information of the second database. The third database can use a sqlite database, which has the characteristics of being lightweight, independent, isolated, cross-platform, etc., occupies less resources, and is easy to operate.

[0050] S112: Establishing a data connection between the first database and the second database.

[0051] The connection method between databases can be selected according to the platform architecture, database type, etc. For example, for a JAVA architecture platform, the JBDC database connection method can be used to connect the first database and the second database. The database connection method is already in the prior art and is not described in detail in this application.

[0052] S12: Acquire first common data from the first database, acquire second common data from the second database according to the second database information, and synchronously update the first common data and the second common data.

[0053] Specifically include:

[0054] S120: Acquire a first data table storing first common data from a first database;

[0055] On the first platform, the shared data information of the first database is obtained, and the first shared data is obtained from the first database according to the shared data information of the first database. The shared data information of the first database includes: a data table name, a data table unique identifier, and a data table synchronization field name. According to the shared data information of the first database, a first data table storing the first shared data is obtained from the first database, and the first data table has data items such as a data table name, a data table unique identifier, and a data table synchronization field name. In one embodiment, the shared data information of the first database is saved in a configuration file, and the shared data information of the first database is obtained by reading from the configuration file.

[0056] S121: Acquire a second data table storing second common data from a second database;

[0057] According to the configured second database information, the common data information of the second database is determined, and according to the common data information of the second database, the second common data is obtained from the second database. The common data information of the second database includes: a data table name, a data table unique identifier, and a data table synchronization field name. According to the common data information of the second database, a second data table storing the second common data is obtained from the second database, and the second data table has data items such as the data table name, the data table unique identifier, and the data table synchronization field name.

[0058] S122: Synchronously update the first common data and the second common data according to the first data table and the second data table.

[0059] According to the data table synchronization field name of the first data table, all the first common data are obtained, according to the data table synchronization field name of the second data table, all the second common data are obtained, and the first common data and the second common data are compared one by one to execute the data synchronization process. The data synchronization process includes: the common data items in the first common data and the second common data are not processed; the data items that exist in the first common data and the data items that do not exist in the second common data are inserted into the second data table as the newly added data items of the second common data, and synchronization tags are added to the newly added data items in the second data table; the data items that do not exist in the first common data and the data items that exist in the second common data are inserted into the first data table as the newly added data items of the first common data, and synchronization tags are added to the newly added data items in the first data table; the data items with synchronization tags that exist in the first common data and the data items that no longer exist in the second common data are deleted; the data items with synchronization tags that exist in the second common data and the data items that no longer exist in the first common data are deleted.

[0060] In a specific embodiment, the first data table is a first user data table, and the synchronization field name of the data table is user name, and all first common data corresponding to the user name are obtained, including data items A, B, etc. The second data table is a second user data table, and the synchronization field name of the data table is user name, and all second common data corresponding to the user name are obtained, including data items A, D, etc. The first common data and the second common data are compared one by one, and a data synchronization process is performed, including: according to data item A of the first common data, the second common data is searched, and it is determined that data item A exists in the second common data, and no processing is performed; according to data item B of the first common data, the second common data is searched, and it is determined that data item B does not exist in the second common data, and data item B is inserted into the second data table, and a synchronization tag is added to data item B in the second data table; according to data item D of the second common data, the first common data is searched, and it is determined that data item D does not exist in the first common data, and data item D is inserted into the first data table, and a synchronization tag is added to data item D in the first data table. Subsequently, during the data maintenance process, if data item B is deleted in the first platform configuration, then during the data synchronization process, the first shared data is searched based on the data item B with a synchronization tag in the second shared data, and it is determined that data item B no longer exists in the first shared data, then data item B of the second shared data is deleted, thereby achieving synchronous update of the first shared data and the second shared data.

[0061] In the embodiment of the present invention, the data synchronization update process of the shared data may be performed regularly according to the above steps S11-S12 according to the configured synchronization time parameters.

[0062] Figure 2 FIG. 1 is a block diagram of the device structure of an embodiment of the present invention. Figure 2 , 3 As shown, a cross-platform data synchronization device disclosed in an embodiment of the present invention is used to synchronize and update first common data of a first platform with second common data of a second platform, wherein the first platform is configured with a first database, the first database stores the first common data, and the second platform is configured with a second database, the second database stores the second common data, and the cross-platform data synchronization device includes:

[0063] A configuration module, used for configuring the second database information;

[0064] On the synchronization configuration page of the first platform, enter the second database information. The configured second database information includes database type, database connection address, database connection user name, database connection password, database connection port, database name, data table name, data table unique identifier, data table synchronization field name, synchronization time parameters, etc.

[0065] A database connection module, used to establish a data connection between the first database and the second database according to the second database information;

[0066] The data synchronization module is used to obtain the first common data from the first database, obtain the second common data from the second database according to the second database information, and synchronously update the first common data and the second common data.

[0067] In the embodiment of the present invention, the database connection module includes:

[0068] A first database connection module, used to connect to the first database according to the first database information;

[0069] On the first platform, connection information of the first database is obtained, and the first database is connected. The connection information of the first database includes: database type, database connection address, database connection user name, database connection password, database connection port, and database name. The first database is connected according to the connection information of the first database. In one embodiment, the connection information of the first database is saved in a configuration file. When connecting to the first database, the connection information of the first database is obtained by reading from the configuration file.

[0070] A second database connection module, used to connect to the second database according to the second database information;

[0071] On the first platform, according to the configured second database information, the connection information of the second database is determined, and the second database is connected according to the connection information of the second database. The connection information of the second database includes: database type, database connection address, database connection user name, database connection password, database connection port, database name, and the second database is connected according to the connection information of the second database.

[0072] In an embodiment of the present invention, a third database is configured to store the information of the second database, the connection information of the second database is read from the third database, and the second database is connected according to the connection information of the second database. The third database can use a sqlite database, which has the characteristics of being lightweight, independent, isolated, cross-platform, etc., occupies less resources, and is easy to operate.

[0073] The connection module is used to establish a data connection between the first database and the second database.

[0074] In an embodiment of the present invention, the data synchronization module includes:

[0075] A first data acquisition module, used for acquiring a first data table storing first common data from a first database;

[0076] On the first platform, the shared data information of the first database is obtained, and the first shared data is obtained from the first database according to the shared data information of the first database. The shared data information of the first database includes: a data table name, a data table unique identifier, and a data table synchronization field name. According to the shared data information of the first database, a first data table storing the first shared data is obtained from the first database, and the first data table has data items such as a data table name, a data table unique identifier, and a data table synchronization field name. In one embodiment, the shared data information of the first database is saved in a configuration file, and the shared data information of the first database is obtained by reading from the configuration file.

[0077] A second data acquisition module, used for acquiring a second data table storing second common data from the second database according to the second database information;

[0078] According to the configured second database information, the common data information of the second database is determined, and according to the common data information of the second database, the second common data is obtained from the second database. The common data information of the second database includes: a data table name, a data table unique identifier, and a data table synchronization field name. According to the common data information of the second database, a second data table storing the second common data is obtained from the second database, and the second data table has data items such as the data table name, the data table unique identifier, and the data table synchronization field name.

[0079] The synchronization module is used to synchronously update the first common data and the second common data according to the first data table and the second data table.

[0080] According to the data table synchronization field name of the first data table, all the first common data are obtained, according to the data table synchronization field name of the second data table, all the second common data are obtained, and the first common data and the second common data are compared one by one to execute the data synchronization process. The data synchronization process includes: the common data items in the first common data and the second common data are not processed; the data items that exist in the first common data and the data items that do not exist in the second common data are inserted into the second data table as the newly added data items of the second common data, and synchronization tags are added to the newly added data items in the second data table; the data items that do not exist in the first common data and the data items that exist in the second common data are inserted into the first data table as the newly added data items of the first common data, and synchronization tags are added to the newly added data items in the first data table; the data items with synchronization tags that exist in the first common data and the data items that no longer exist in the second common data are deleted; the data items with synchronization tags that exist in the second common data and the data items that no longer exist in the first common data are deleted.

[0081] In a specific embodiment, the first data table is a first user data table, and the synchronization field name of the data table is user name, and all first common data corresponding to the user name are obtained, including data items A, B, etc. The second data table is a second user data table, and the synchronization field name of the data table is user name, and all second common data corresponding to the user name are obtained, including data items A, D, etc. The first common data and the second common data are compared one by one, and a data synchronization process is performed, including: according to data item A of the first common data, the second common data is searched, and it is determined that data item A exists in the second common data, and no processing is performed; according to data item B of the first common data, the second common data is searched, and it is determined that data item B does not exist in the second common data, and data item B is inserted into the second data table, and a synchronization tag is added to data item B in the second data table; according to data item D of the second common data, the first common data is searched, and it is determined that data item D does not exist in the first common data, and data item D is inserted into the first data table, and a synchronization tag is added to data item D in the first data table. Subsequently, during the data maintenance process, if data item B is deleted in the first platform configuration, then during the data synchronization process, the first shared data is searched based on the data item B with a synchronization tag in the second shared data, and it is determined that data item B no longer exists in the first shared data, then data item B of the second shared data is deleted, thereby achieving synchronous update of the first shared data and the second shared data.

[0082] In the embodiment of the present invention, the cross-platform data synchronization device further includes:

[0083] The timing synchronization module is used to synchronously update the first common data and the second common data according to the configured synchronization time parameters.

[0084] The cross-platform data synchronization method and device of the embodiment of the present invention can realize the timed and synchronous update of the first common data in the first database and the second common data in the second database by connecting the first database of the first platform with the second database of the second platform. It should be noted that the embodiment of the present invention is not limited to the synchronous update of the common data of two platforms, and can be the timed synchronous update of the common data between multiple platforms with common data installed on the same system. By using the cross-platform data synchronization method and device of the embodiment of the present invention, there is no need to repeatedly enter the common data on each platform, and the synchronous update of the common data between multiple platforms can be realized, which saves time and effort and is easy to operate.

[0085] Based on the above purpose, the embodiment of the present invention also proposes an embodiment of a device for executing the cross-platform data synchronization method. The device includes:

[0086] One or more processors and memory.

[0087] The device for executing the cross-platform data synchronization method may further include: an input device and an output device.

[0088] The processor, memory, input device and output device may be connected via a bus or other means.

[0089] As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the cross-platform data synchronization method in the embodiment of the present invention. The processor executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory, that is, the cross-platform data synchronization method of the above method embodiment is implemented.

[0090] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the device for executing the cross-platform data synchronization method, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the member user behavior monitoring device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0091] The input device can receive input digital or character information and generate key signal input related to user settings and function control of the device for executing the cross-platform data synchronization method. The output device can include display devices such as display screens.

[0092] The one or more modules are stored in the memory, and when executed by the one or more processors, the cross-platform data synchronization method in any of the above method embodiments is executed. The embodiment of the device for executing the cross-platform data synchronization method has the same or similar technical effect as any of the above method embodiments.

[0093] The embodiment of the present invention further provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the processing method of the list item operation in any of the above method embodiments. The embodiment of the non-transitory computer storage medium has the same or similar technical effect as any of the above method embodiments.

[0094] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The technical effect of the embodiment of the computer program is the same or similar to that of any of the above-mentioned method embodiments.

[0095] In addition, typically, the devices and equipment described in the present disclosure may be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., or large terminal devices, such as servers, etc. Therefore, the protection scope of the present disclosure should not be limited to a specific type of device or equipment. The client described in the present disclosure may be applied to any of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.

[0096] In addition, the method according to the present disclosure may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method of the present disclosure are performed.

[0097] In addition, the above method steps and system units may also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.

[0098] In addition, it should be understood that the computer-readable storage medium (e.g., memory) described herein can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. As an example and not by way of limitation, a non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory can include a random access memory (RAM), which can act as an external cache memory. As an example and not by way of limitation, RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.

[0099] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0100] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present invention, the above embodiments or technical features in different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.

[0101] In addition, to simplify the description and discussion, and in order not to obscure the present invention, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the devices may be shown in the form of block diagrams to avoid obscuring the present invention, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present invention will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present invention, it will be apparent to those skilled in the art that the present invention may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0102] Although the invention has been described in conjunction with specific embodiments of the invention, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0103] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A cross-platform data synchronization method, wherein a first platform is configured with a first database, in which first common data is stored, and a second platform is configured with a second database, in which second common data is stored, characterized in that: The first platform is configured with a configuration file for storing first database information, the first database information includes connection information of the first database and common data information of the first database, and the method includes: Configure the second database information; wherein the second database information includes the connection information of the second database and the common data information of the second database; Establishing a data connection between the first database and the second database according to the second database information, including: acquiring the connection information of the first database from the configuration file, connecting to the first database according to the connection information of the first database, connecting to the second database according to the connection information of the second database, and establishing a data connection between the first database and the second database; The first shared data is obtained from the first database, and the second shared data is obtained from the second database according to the second database information, and the first shared data and the second shared data are synchronously updated, including: the data items shared by the first shared data and the second shared data are not processed; the data items that exist in the first shared data and do not exist in the second shared data are inserted into the second data table where the second shared data is located as a newly added data item of the second shared data, and a synchronization tag is added to the newly added data item in the second data table; the data items that do not exist in the first shared data and the data items that exist in the second shared data are inserted into the first data table where the first shared data is located as a newly added data item of the first shared data, and a synchronization tag is added to the newly added data item in the first data table; the data items with synchronization tags that exist in the first shared data and do not exist in the second shared data are deleted; the data items with synchronization tags that exist in the second shared data and do not exist in the first shared data are deleted.

2. The method according to claim 1, characterized in that The connection information of the second database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name. The common data information of the second database includes data table name, data table unique identifier, and data table synchronization field name.

3. The method according to claim 2, characterized in that The connection information of the first database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name. The common data information of the first database includes data table name, data table unique identifier, and data table synchronization field name.

4. The method according to claim 1, characterized in that: Also includes: A third database is configured to store the second database information, the second database information is obtained from the third database, and a data connection is established between the first database and the second database.

5. The method according to claim 1, characterized in that The second database information includes a synchronization time parameter, and the first common data and the second common data are synchronously updated according to the synchronization time parameter.

6. A cross-platform data synchronization device, wherein a first platform is configured with a first database, in which first common data is stored, and a second platform is configured with a second database, in which second common data is stored, characterized in that: The first platform is configured with a configuration file for storing first database information, the first database information includes connection information of the first database and common data information of the first database, and the device includes: A configuration module, used to configure the second database information; wherein the second database information includes the connection information of the second database and the common data information of the second database; A database connection module, used to establish a data connection between the first database and the second database according to the second database information, including: obtaining the connection information of the first database from the configuration file, connecting to the first database according to the connection information of the first database, connecting to the second database according to the connection information of the second database, and establishing a data connection between the first database and the second database; A data synchronization module, used for obtaining the first common data from the first database, obtaining the second common data from the second database according to the second database information, and synchronously updating the first common data and the second common data, including: the data items common to the first common data and the second common data are not processed; for the data items existing in the first common data and not existing in the second common data, the data items existing in the first common data are inserted into the second data table where the second common data is located as the newly added data items of the second common data, and synchronization tags are added to the newly added data items in the second data table; for the data items not existing in the first common data and existing in the second common data, the data items existing in the second common data are inserted into the first data table where the first common data is located as the newly added data items of the first common data, and synchronization tags are added to the newly added data items in the first data table; for the data items with synchronization tags existing in the first common data and not existing in the second common data, the data items with synchronization tags existing in the first common data are deleted; for the data items with synchronization tags existing in the second common data and not existing in the first common data, the data items with synchronization tags existing in the second common data are deleted.

7. The device according to claim 6, characterized in that The connection information of the second database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name. The common data information of the second database includes data table name, data table unique identifier, and data table synchronization field name.

8. The device according to claim 7, characterized in that The connection information of the first database includes database type, database connection address, database connection user name, database connection password, database connection port, and database name. The common data information of the first database includes data table name, data table unique identifier, and data table synchronization field name.

9. The device according to claim 7, characterized in that Also includes: A third database, used to store the second database information; The connection information of the second database is read from the third database, and the second database is connected according to the connection information of the second database.

10. The device according to claim 6, characterized in that The second database information includes a synchronization time parameter, and the device further includes: A timing synchronization module is used to synchronously update the first shared data and the second shared data according to the synchronization time parameter.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Database expansion method and device

    CN106897332A

  • Data synchronization method and device

    CN108228814A