CN111352993A - Cross-platform data synchronization method and device and electronic equipment - Google Patents

Cross-platform data synchronization method and device and electronic equipment Download PDF

Info

Publication number
CN111352993A
CN111352993A CN201910211874.4A CN201910211874A CN111352993A CN 111352993 A CN111352993 A CN 111352993A CN 201910211874 A CN201910211874 A CN 201910211874A CN 111352993 A CN111352993 A CN 111352993A
Authority
CN
China
Prior art keywords
database
data
common data
information
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910211874.4A
Other languages
Chinese (zh)
Inventor
顾俊同
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Honghe Innovation Information Technology Co Ltd
Original Assignee
Shenzhen Honghe Innovation Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Honghe Innovation Information Technology Co Ltd filed Critical Shenzhen Honghe Innovation Information Technology Co Ltd
Priority to CN201910211874.4A priority Critical patent/CN111352993A/en
Publication of CN111352993A publication Critical patent/CN111352993A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Abstract

The invention discloses a cross-platform data synchronization method, a cross-platform data synchronization device and electronic equipment, wherein a first database is configured on a first platform, first common data are stored in the first database, a second database is configured on a second platform, and second common data are stored in the second database, and the method comprises the following steps: configuring second database information; establishing data connection between the first database and the second database according to the second database information; and acquiring the first shared data from the first database, acquiring the second shared data from the second database, and synchronously updating the first shared data and the second shared data. The invention can realize the synchronous update of the common data among a plurality of platforms, saves time and labor and is convenient to operate.

Description

Cross-platform data synchronization method and device and electronic equipment
Technical Field
The invention relates to the technical field of databases, in particular to a cross-platform data synchronization method and device and electronic equipment.
Background
At present, a plurality of platform software may be installed on the same terminal, especially two or more series platform software of the same manufacturer are installed on the same server, and the same common data exists among the plurality of platform software, for example, recording and broadcasting platform software and resource platform software of great science and technology are installed on the same server at the same time, and the recording and broadcasting platform software and the resource platform software have the same user data, course data and the like, and when the update of the common data is executed, data can only be added and stored on respective platforms respectively, so that the operation is cumbersome, and especially under the condition of large data volume, the tedious data entry and addition operation needs to be repeated, which consumes time and labor.
Disclosure of Invention
In view of this, the present invention provides a cross-platform data synchronization method and apparatus, and an electronic device, which can implement synchronous update of cross-platform common data, and are convenient to operate, time-saving and labor-saving.
In view of the above, the present invention provides a cross-platform data synchronization method, where a first platform is configured with a first database, the first database stores first common data, a second platform is configured with a second database, and the second database stores second common data, the method including:
configuring second database information;
establishing data connection between the first database and the second database according to the second database information;
and acquiring the first common data from the first database, acquiring the second common data from the second database according to second database information, and synchronously updating the first common data and the second common data.
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 a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the second database includes a data table name, a data table unique identifier, and a data table sync field name.
Optionally, the first platform is configured with a configuration file for storing first database information, where the first database information includes connection information of the first database and common data information of the first database, the connection information of the first database includes a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the first database includes a data table name, a data table unique identifier, and a data table sync field name.
Optionally, the connection information of the first database is obtained from the configuration file, the first database is connected according to the connection information of the first database, the second database is connected according to the connection information of the second database, and the data connection between the first database and the second database is established.
Optionally, the method further includes:
and configuring a third database for storing the second database information, acquiring the second database information from the third database, and establishing data connection between the first database and the second database.
Optionally, the method for synchronously updating the first common data and the second common data includes: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table with the second common data as a new data item of the second common data, and adding a synchronous tag to the new data item in the second data table; the data items of the first common data which do not exist and the data items of the second common data which exist are inserted into a first data table where the first common data exist as new data items of the first common data, and a synchronous label is added to the new data items in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists; and deleting the data item with the synchronization label existing in the second common data, wherein the data item with the synchronization label existing in the second common data does not already exist in the first common data.
Optionally, the second database information includes a synchronization time parameter, and the first common data and the second common data are updated synchronously according to the synchronization time parameter.
An embodiment of the present invention further provides a cross-platform data synchronization apparatus, where a first platform is configured with a first database, the first database stores first common data, a second platform is configured with a second database, and the second database stores second common data, the apparatus including:
the configuration module is used for configuring the second database information;
the database connection module is used for establishing data connection between the first database and the second database according to the second database information;
and the data synchronization module is used for acquiring the first common data from the first database, acquiring the second common data from the second database according to second database information, and synchronously updating the first common data and the second common data.
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 a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the second database includes a data table name, a data table unique identifier, and a data table sync field name.
Optionally, the first platform is configured with a configuration file for storing first database information, where the first database information includes connection information of the first database and common data information of the first database, the connection information of the first database includes a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the first database includes a data table name, a data table unique identifier, and a data table sync field name.
Optionally, the connection information of the first database is obtained from the configuration file, the first database is connected according to the connection information of the first database, the second database is connected according to the connection information of the second database, and the data connection between the first database and the second database is established.
Optionally, the apparatus further comprises:
the third database is used for storing the information of the second database; and reading the connection information of the second database from the third database, and connecting the second database according to the connection information of the second database.
Optionally, the method for synchronously updating the first common data and the second common data includes: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table with the second common data as a new data item of the second common data, and adding a synchronous tag to the new data item in the second data table; the data items of the first common data which do not exist and the data items of the second common data which exist are inserted into a first data table where the first common data exist as new data items of the first common data, and a synchronous label is added to the new data items in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists; and deleting the data item with the synchronization label existing in the second common data, wherein the data item with the synchronization label existing in the second common data does not already exist in the first common data.
Optionally, the second database information includes a synchronization time parameter, and the apparatus further includes:
and the timing synchronization module is used for synchronously updating the first common data and the second common data according to the synchronization time parameter.
The embodiment of the invention also provides electronic equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the cross-platform data synchronization method when executing the program.
As can be seen from the above, according to the cross-platform data synchronization method and apparatus, and the electronic device provided by the invention, the second database information is configured, the data connection between the first database and the second database is established according to the second database information, the first common data is obtained from the first database, the second common data is obtained from the second database, and the first common data and the second common data are updated synchronously. The invention can realize the automatic synchronous update of the common data among a plurality of platforms, saves time and labor and is convenient to operate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
FIG. 3 is a platform architecture diagram according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
The cross-platform data synchronization method provided by the embodiment of the present invention is configured to synchronously update first common data of a first platform and second common data of a second platform, where the first platform is configured with a first database, the first database stores the first common data, the second platform is configured with a second database, and the second database stores the second common data, and the cross-platform data synchronization method includes:
configuring second database information;
establishing data connection between the first database and the second database according to the second database information;
and acquiring the first common data from the first database, acquiring 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.
Fig. 1 is a schematic flowchart of a method according to an embodiment of the present invention, and fig. 3 is a schematic diagram of a platform architecture according to 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:
s10: configuring second database information;
and inputting second database information into a synchronous configuration page of the first platform, wherein the configured second database information comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port, a database name, a data table unique identifier, a data table synchronous field name, a synchronous time parameter and the like.
Database types are, for example, mysql, sqlserver, access, foxbase, oracle, db2, sybase, etc.
S11: establishing data connection between the first database and the second database according to the second database information;
the method specifically comprises the following steps:
s110: connecting a first database according to the first database information;
and acquiring the connection information of the first database on the first platform, and connecting the first database. The connection information of the first database includes: the database type, the database connection address, the database connection user name, the database connection password, the database connection port and the database name are connected with the first database according to the connection information of the first database. In an embodiment, the connection information of the first database is stored in the configuration file, and when the first database is connected, the connection information of the first database is read from the configuration file.
S111: connecting a second database according to the second database information;
and determining the connection information of the second database according to the configured second database information on the first platform, and connecting the second database according to the connection information of the second database. The connection information of the second database includes: the database type, the database connection address, the database connection user name, the database connection password, the database connection port and the database name are connected with the second database according to the connection information of the second database.
In the embodiment of the present invention, a third database for storing information of the second database is configured, 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, and the sqlite database has the characteristics of light weight, independence, isolation, cross-platform and the like, occupies less resources and is convenient to operate.
S112: and establishing data connection between the first database and the second database.
The connection method between the databases may be selected according to the platform architecture, the database types, and the like, for example, for a platform with JAVA architecture, the first database and the second database may be connected by using the JBDC database connection method. The database connection method belongs to the prior art, and the detailed description is not provided in the present application.
S12: and acquiring the first common data from the first database, acquiring 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.
The method specifically comprises the following steps:
s120: acquiring a first data table for storing first common data from a first database;
and acquiring the common data information of the first database on the first platform, and acquiring the first common data from the first database according to the common data information of the first database. The common data information of the first database includes: the method comprises the steps of obtaining a first data table for storing first common data from a first database according to common data information of the first database, wherein the first data table comprises data items such as a data table name, a data table unique identifier and a data table synchronous field name. In an embodiment, the common data information of the first database is stored in a configuration file, and the common data information of the first database is read from the configuration file.
S121: acquiring a second data table for storing second common data from a second database;
and determining the shared data information of the second database according to the configured second database information, and acquiring second shared data from the second database according to the shared data information of the second database. The common data information of the second database includes: and the second data table is provided with data items such as the data table name, the data table unique identifier, the data table synchronization field name and the like.
S122: and synchronously updating the first common data and the second common data according to the first data table and the second data table.
And acquiring all the first common data according to the data table synchronization field names of the first data table, acquiring all the second common data according to the data table synchronization field names of the second data table, comparing the first common data with the second common data one by one, and executing a data synchronization process. The data synchronization process comprises the following steps: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table to serve as a newly added data item of the second common data, and adding a synchronous label to the newly added data item in the second data table; inserting the data item with the second common data into a first data table to serve as a newly added data item of the first common data, and adding a synchronous label to the newly added data item in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists, and the data item with the synchronous label in the second common data does not exist; and deleting the data item with the synchronization label in the second common data, wherein the data item with the synchronization label in the second common data does not exist in the first common data.
In one embodiment, the first data table is a first user data table, the data table synchronization field name of the first data table is a user name, and all first common data corresponding to the user name, including the data item A, B, is obtained. The second data table is a second user data table, the data table synchronization field name of the second data table is a user name, and all second common data corresponding to the user name are obtained and comprise data items A, D and the like. Comparing the first common data with the second common data one by one, and executing a data synchronization process, including: searching second common data according to the data item A of the first common data, determining that the second common data has the data item A, and not processing the second common data; according to the data item B of the first common data, searching second common data, determining that the second common data does not have the data item B, inserting the data item B into a second data table, and adding a synchronous tag to the data item B in the second data table; and searching the first common data according to the data item D of the second common data, determining that the first common data does not have the data item D, inserting the data item D into the first data table, and adding a synchronization tag to the data item D in the first data table. Subsequently, in the data maintenance process, if the data item B is deleted in the first platform configuration, in the data synchronization process, according to the data item B of the second common data having the synchronization tag, the first common data is searched, and it is determined that the first common data does not have the data item B, the data item B of the second common data is deleted, so that the synchronous update of the first common data and the second common data is realized.
In the embodiment of the present invention, the data synchronization update process of the common data may be periodically performed according to the configured synchronization time parameter and according to the steps S11-S12.
Fig. 2 is a block diagram of an apparatus according to an embodiment of the present invention. As shown in fig. 2 and 3, a cross-platform data synchronization apparatus disclosed in the embodiment of the present invention is configured to synchronously update first common data of a first platform and second common data of a second platform, where the first platform is configured with a first database, the first database stores the first common data, the second platform is configured with a second database, and the second database stores the second common data, and the cross-platform data synchronization apparatus includes:
the configuration module is used for configuring the second database information;
and inputting second database information into a synchronous configuration page of the first platform, wherein the configured second database information comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port, a database name, a data table unique identifier, a data table synchronous field name, a synchronous time parameter and the like.
The database connection module is used for establishing data connection between the first database and the second database according to the second database information;
and the data synchronization module is used for acquiring the first common data from the first database, acquiring 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.
In an embodiment of the present invention, the database connection module includes:
the first database connection module is used for connecting a first database according to the first database information;
and acquiring the connection information of the first database on the first platform, and connecting the first database. The connection information of the first database includes: the database type, the database connection address, the database connection user name, the database connection password, the database connection port and the database name are connected with the first database according to the connection information of the first database. In an embodiment, the connection information of the first database is stored in the configuration file, and when the first database is connected, the connection information of the first database is read from the configuration file.
The second database connection module is used for connecting a second database according to the second database information;
and determining the connection information of the second database according to the configured second database information on the first platform, and connecting the second database according to the connection information of the second database. The connection information of the second database includes: the database type, the database connection address, the database connection user name, the database connection password, the database connection port and the database name are connected with the second database according to the connection information of the second database.
In the embodiment of the present invention, a third database for storing information of the second database is configured, 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, and the sqlite database has the characteristics of light weight, independence, isolation, cross-platform and the like, occupies less resources and is convenient to operate.
And the connection module is used for establishing data connection between the first database and the second database.
In the embodiment of the present invention, the data synchronization module includes:
the first data acquisition module is used for acquiring a first data table for storing first common data from a first database;
and acquiring the common data information of the first database on the first platform, and acquiring the first common data from the first database according to the common data information of the first database. The common data information of the first database includes: the method comprises the steps of obtaining a first data table for storing first common data from a first database according to common data information of the first database, wherein the first data table comprises data items such as a data table name, a data table unique identifier and a data table synchronous field name. In an embodiment, the common data information of the first database is stored in a configuration file, and the common data information of the first database is read from the configuration file.
The second data acquisition module is used for acquiring a second data table for storing second common data from a second database according to the second database information;
and determining the shared data information of the second database according to the configured second database information, and acquiring second shared data from the second database according to the shared data information of the second database. The common data information of the second database includes: and the second data table is provided with data items such as the data table name, the data table unique identifier, the data table synchronization field name and the like.
And the synchronization module is used for synchronously updating the first common data and the second common data according to the first data table and the second data table.
And acquiring all the first common data according to the data table synchronization field names of the first data table, acquiring all the second common data according to the data table synchronization field names of the second data table, comparing the first common data with the second common data one by one, and executing a data synchronization process. The data synchronization process comprises the following steps: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table to serve as a newly added data item of the second common data, and adding a synchronous label to the newly added data item in the second data table; inserting the data item with the second common data into a first data table to serve as a newly added data item of the first common data, and adding a synchronous label to the newly added data item in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists, and the data item with the synchronous label in the second common data does not exist; and deleting the data item with the synchronization label in the second common data, wherein the data item with the synchronization label in the second common data does not exist in the first common data.
In one embodiment, the first data table is a first user data table, the data table synchronization field name of the first data table is a user name, and all first common data corresponding to the user name, including the data item A, B, is obtained. The second data table is a second user data table, the data table synchronization field name of the second data table is a user name, and all second common data corresponding to the user name are obtained and comprise data items A, D and the like. Comparing the first common data with the second common data one by one, and executing a data synchronization process, including: searching second common data according to the data item A of the first common data, determining that the second common data has the data item A, and not processing the second common data; according to the data item B of the first common data, searching second common data, determining that the second common data does not have the data item B, inserting the data item B into a second data table, and adding a synchronous tag to the data item B in the second data table; and searching the first common data according to the data item D of the second common data, determining that the first common data does not have the data item D, inserting the data item D into the first data table, and adding a synchronization tag to the data item D in the first data table. Subsequently, in the data maintenance process, if the data item B is deleted in the first platform configuration, in the data synchronization process, according to the data item B of the second common data having the synchronization tag, the first common data is searched, and it is determined that the first common data does not have the data item B, the data item B of the second common data is deleted, so that the synchronous update of the first common data and the second common data is realized.
In this embodiment of the present invention, the cross-platform data synchronization apparatus further includes:
and the timing synchronization module is used for synchronously updating the first common data and the second common data according to the configured synchronization time parameter.
According to the cross-platform data synchronization method and device provided by the embodiment of the invention, the first database of the first platform and the second database of the second platform are connected, so that the timing and synchronous updating of the first common data in the first database and the second common data in the second database can be realized. It should be noted that the embodiment of the present invention is not limited to synchronous update of common data of two platforms, and may be configured to perform synchronous update of common data at regular time between a plurality of platforms having common data installed on the same system. By using the cross-platform data synchronization method and device provided by the embodiment of the invention, common data do not need to be repeatedly input into each platform, the synchronous update of the common data among a plurality of platforms can be realized, and the method and device are time-saving, labor-saving and convenient to operate.
Based on the above purpose, an embodiment of an apparatus for executing the cross-platform data synchronization method is further provided in the embodiments of the present invention. The device comprises:
one or more processors, and a memory.
The apparatus for performing the cross-platform data synchronization method may further include: an input device and an output device.
The processor, memory, input device, and output device may be connected by a bus or other means.
The memory, which is a non-volatile computer-readable storage medium, may 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 embodiments of the present invention. The processor executes various functional applications and data processing of the server by running nonvolatile software programs, instructions and modules stored in the memory, that is, the cross-platform data synchronization method of the above method embodiments is implemented.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of an apparatus performing the cross-platform data synchronization method, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory remotely located from the processor, and these remote memories may be connected to the member user behavior monitoring device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device may receive input numeric or character information and generate key signal inputs related to user settings and function control of the device performing the cross-platform data synchronization method. The output device may include a display device such as a display screen.
The one or more modules are stored in the memory and, when executed by the one or more processors, perform a cross-platform data synchronization method in any of the method embodiments described above. The technical effect of the embodiment of the device for executing the cross-platform data synchronization method is the same as or similar to that of any method embodiment.
The embodiment of the invention also 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 method embodiment. Embodiments of the non-transitory computer storage medium may be the same or similar in technical effect to any of the method embodiments described above.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by a computer program that can be stored in a computer-readable storage medium and that, when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The technical effect of the embodiment of the computer program is the same as or similar to that of any of the method embodiments described above.
Furthermore, the apparatuses, devices, etc. described in the present disclosure may be various electronic terminal devices, such as a mobile phone, a Personal Digital Assistant (PDA), a tablet computer (PAD), a smart television, etc., and may also be large terminal devices, such as a server, etc., and therefore the scope of protection of the present disclosure should not be limited to a specific type of apparatus, device. The client disclosed by the present disclosure may be applied to any one of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of both.
Furthermore, the method according to the present disclosure may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method of the present disclosure.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) described herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available 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 comprise, without being limited to, these and other suitable types of memory.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the invention, also features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
In addition, well known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures for simplicity of illustration and discussion, and so as not to obscure the invention. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the invention, and also in view of the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the present invention is to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the invention, it should be apparent to one skilled in the art that the invention can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
The embodiments of the invention are intended to embrace all such alternatives, modifications and variances that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (15)

1. A cross-platform data synchronization method is provided, wherein a first platform is configured with a first database, the first database stores first common data, a second platform is configured with a second database, and the second database stores second common data, and the method comprises the following steps:
configuring second database information;
establishing data connection between the first database and the second database according to the second database information;
and acquiring the first common data from the first database, acquiring the second common data from the second database according to second database information, and synchronously updating the first common data and the second common data.
2. The method according to claim 1, wherein the second database information comprises connection information of the second database and common data information of the second database, the connection information of the second database comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port and a database name, and the common data information of the second database comprises a data table name, a data table unique identifier and a data table sync field name.
3. The method of claim 2, wherein the first platform is configured with a configuration file for storing first database information, the first database information comprises connection information of the first database and common data information of the first database, the connection information of the first database comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port and a database name, and the common data information of the first database comprises a data table name, a data table unique identifier and a data table synchronization field name.
4. The method according to claim 3, wherein the connection information of the first database is obtained from the configuration file, the first database is connected according to the connection information of the first database, the second database is connected according to the connection information of the second database, and the data connection between the first database and the second database is established.
5. The method of claim 1, further comprising:
and configuring a third database for storing the second database information, acquiring the second database information from the third database, and establishing data connection between the first database and the second database.
6. The method according to claim 1, wherein the synchronous update method of the first common data and the second common data is: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table with the second common data as a new data item of the second common data, and adding a synchronous tag to the new data item in the second data table; the data items of the first common data which do not exist and the data items of the second common data which exist are inserted into a first data table where the first common data exist as new data items of the first common data, and a synchronous label is added to the new data items in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists; and deleting the data item with the synchronization label existing in the second common data, wherein the data item with the synchronization label existing in the second common data does not already exist in the first common data.
7. The method of claim 1, wherein the second database information comprises a synchronization time parameter, and wherein the first common data and the second common data are updated synchronously according to the synchronization time parameter.
8. A cross-platform data synchronization device, a first platform is configured with a first database, the first database stores first common data, a second platform is configured with a second database, the second database stores second common data, the device comprises:
the configuration module is used for configuring the second database information;
the database connection module is used for establishing data connection between the first database and the second database according to the second database information;
and the data synchronization module is used for acquiring the first common data from the first database, acquiring the second common data from the second database according to second database information, and synchronously updating the first common data and the second common data.
9. The apparatus of claim 8, wherein the second database information comprises connection information of a second database and common data information of the second database, the connection information of the second database comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the second database comprises a data table name, a data table unique identifier, and a data table sync field name.
10. The apparatus of claim 9, wherein the first platform is configured with a configuration file for storing first database information, the first database information comprises connection information of the first database and common data information of the first database, the connection information of the first database comprises a database type, a database connection address, a database connection user name, a database connection password, a database connection port, and a database name, and the common data information of the first database comprises a database name, a unique identifier of the database, and a field name of the database sync.
11. The apparatus according to claim 10, wherein the connection information of the first database is obtained from the configuration file, the first database is connected according to the connection information of the first database, the second database is connected according to the connection information of the second database, and the data connection between the first database and the second database is established.
12. The apparatus of claim 9, further comprising:
the third database is used for storing the information of the second database; and reading the connection information of the second database from the third database, and connecting the second database according to the connection information of the second database.
13. The apparatus according to claim 8, wherein the synchronous update method of the first common data and the second common data is: data items common to the first common data and the second common data are not processed; inserting the data item with the first common data into a second data table with the second common data as a new data item of the second common data, and adding a synchronous tag to the new data item in the second data table; the data items of the first common data which do not exist and the data items of the second common data which exist are inserted into a first data table where the first common data exist as new data items of the first common data, and a synchronous label is added to the new data items in the first data table; deleting the data item with the synchronous label in the first common data, wherein the data item with the synchronous label in the first common data exists; and deleting the data item with the synchronization label existing in the second common data, wherein the data item with the synchronization label existing in the second common data does not already exist in the first common data.
14. The apparatus of claim 8, wherein the second database information comprises a synchronization time parameter, the apparatus further comprising:
and the timing synchronization module is used for synchronously updating the first common data and the second common data according to the synchronization time parameter.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the program.
CN201910211874.4A 2019-03-20 2019-03-20 Cross-platform data synchronization method and device and electronic equipment Pending CN111352993A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910211874.4A CN111352993A (en) 2019-03-20 2019-03-20 Cross-platform data synchronization method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910211874.4A CN111352993A (en) 2019-03-20 2019-03-20 Cross-platform data synchronization method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111352993A true CN111352993A (en) 2020-06-30

Family

ID=71193879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910211874.4A Pending CN111352993A (en) 2019-03-20 2019-03-20 Cross-platform data synchronization method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111352993A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527765A (en) * 2020-12-01 2021-03-19 银联智策顾问(上海)有限公司 Data migration method and device
CN113283999A (en) * 2021-04-07 2021-08-20 南方电网数字电网研究院有限公司 Grid-province two-stage data synchronization method and device for power monitoring system and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527765A (en) * 2020-12-01 2021-03-19 银联智策顾问(上海)有限公司 Data migration method and device
CN113283999A (en) * 2021-04-07 2021-08-20 南方电网数字电网研究院有限公司 Grid-province two-stage data synchronization method and device for power monitoring system and computer equipment
CN113283999B (en) * 2021-04-07 2024-01-23 南方电网数字平台科技(广东)有限公司 Power monitoring system network province two-stage data synchronization method, device and computer equipment

Similar Documents

Publication Publication Date Title
CN109815261B (en) Global search function implementation and data real-time synchronization method and device and electronic equipment
CN111859470B (en) Business data chaining method and device
CN109391673B (en) Method, system and terminal equipment for managing update file
CN109829287A (en) Api interface permission access method, equipment, storage medium and device
US20150373150A1 (en) Server, client, system and method for preloading browsed page in browser
CN111062189A (en) Data analysis method and device and electronic equipment
CN107844488B (en) Data query method and device
CN111352993A (en) Cross-platform data synchronization method and device and electronic equipment
CN107784073B (en) Data query method for local cache, storage medium and server
CN110990008B (en) Page updating method and device, storage medium and electronic equipment
CN110012049B (en) Information push method, system, server and computer readable storage medium
CN105187562A (en) System and method for operating remote file
CN110659165A (en) Multi-node server automatic testing method and device
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN112508720A (en) Insurance client identity attribute screening method and screening device and electronic equipment
CN110781139A (en) Teaching plan resource management system and method and electronic equipment
CN110875895A (en) Method, system, equipment and vehicle for realizing intelligent terminal software login
US9665605B2 (en) Methods and apparatus for building a search index for a database
CN111143293B (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN104407846B (en) Information processing method and device
CN110119337B (en) Data analysis method and device and server
CN111190529A (en) Keyboard input method and device and electronic equipment
CN112068899A (en) Plug-in loading method and device, electronic equipment and storage medium
CN111381849A (en) Software updating method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination