WO2020173381A1 - Data interworking method and device, terminal and storage medium - Google Patents

Data interworking method and device, terminal and storage medium Download PDF

Info

Publication number
WO2020173381A1
WO2020173381A1 PCT/CN2020/076050 CN2020076050W WO2020173381A1 WO 2020173381 A1 WO2020173381 A1 WO 2020173381A1 CN 2020076050 W CN2020076050 W CN 2020076050W WO 2020173381 A1 WO2020173381 A1 WO 2020173381A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
database
component
synchronized
tpipe
Prior art date
Application number
PCT/CN2020/076050
Other languages
French (fr)
Chinese (zh)
Inventor
Weijie SONG (宋维捷)
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2020173381A1 publication Critical patent/WO2020173381A1/en

Links

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

Definitions

  • the embodiments of the present disclosure relate to the field of computer application technology, for example, to a data intercommunication method, device, terminal, and storage medium. Background technique
  • Remote Dictionary Server (Redis) is a non-relational memory database that is widely used in Nosql databases. Inside Redis is a key-value storage system. Because Redis has the advantages of easy expansion, large data volume to improve performance, and diverse and flexible data models, it is widely used.
  • Multi-activity in different places generally refers to the establishment of independent data centers in different cities. These computer rooms also need to carry traffic in daily business to provide business support. That is, data exchange is performed between the databases of two computer rooms in different cities, so that users can access data in one place in different cities.
  • the Redis database data intercommunication method of related technologies usually directly transfers the data between the two Redis databases. Because the Redis database may include historical data and write in real time Incremental data makes it extremely prone to errors during data transmission, and it is often difficult to achieve data intercommunication without affecting the data, and the user experience is poor. Summary of the invention
  • the embodiments of the present disclosure provide a data intercommunication method, device, terminal, and storage medium to solve technical problems such as error-proneness and poor user experience when directly transmitting data between a database and a database in related technologies, and can achieve data intercommunication simply and effectively.
  • the embodiment of the present disclosure provides a data intercommunication method, which includes:
  • the data to be synchronized includes historical data of the first database and first incremental data in the first database
  • the full amount of data includes the data to be synchronized transmitted by the first database and the second
  • the local end writes data in the database
  • the first data pipe TPIPE component is used to orderly transmit the data to be synchronized
  • the second data pipe TPIPE component is used to orderly transmit the full amount of data.
  • the embodiment of the present disclosure also provides a data intercommunication method, which includes:
  • the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the first data pipeline TPIPE component is used for orderly transmitting the data to be synchronized.
  • the embodiment of the present disclosure also provides a data intercommunication device, which includes:
  • a data receiving module configured to receive, through the second database, the data to be synchronized that the first database transmits in real time through the TPIPE component of the first data pipeline;
  • a full data transmission module configured to control the second database to transmit the full data in the second database to the second database through the second data pipeline TPIPE component;
  • the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the second database
  • the local end writes data in, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
  • the embodiment of the present disclosure also provides a data intercommunication device, which includes:
  • the first data transmission module is configured to control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
  • the second data transmission module is configured to control the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the second database in real time;
  • the data to be synchronized includes historical data of the first database and first incremental data in the first database.
  • the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
  • the embodiments of the present disclosure also provide an electronic device, which includes:
  • One or more processing devices are One or more processing devices;
  • Memory set to store one or more programs; When the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses implement the data intercommunication method according to any embodiment of the present disclosure.
  • the embodiments of the present disclosure also provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the data intercommunication method as described in any embodiment of the present disclosure is implemented. Description of the drawings
  • Fig. 1 is a schematic flowchart of a data interworking method provided in the first embodiment of the present disclosure
  • Fig. 2 is a schematic flowchart of a data interworking method provided in the second embodiment of the present disclosure
  • Fig. 4 is a schematic flowchart of a data intercommunication method provided by Embodiment 4 of the present disclosure
  • Fig. 5a is a schematic flowchart of a data intercommunication system provided by Embodiment 5 of the present disclosure
  • 5b is a schematic diagram of one-way data synchronization provided in the fifth embodiment of the present disclosure
  • Figure 5c is a schematic diagram of the interaction of two-way data synchronization provided in the fifth embodiment of the present disclosure
  • Figure 5d is another schematic diagram of the interaction of two-way data synchronization provided in the fifth embodiment of the present disclosure
  • Figure 5e is another schematic diagram of the two-way data synchronization provided in the fifth embodiment of the present disclosure
  • Figure 5f is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure
  • Figure 5g is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure
  • 5h is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure
  • FIG. 5i is a schematic diagram of the data interaction for data intercommunication provided by the fifth embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of the data interaction provided by the sixth embodiment of the present disclosure
  • Fig. 7 is a schematic structural diagram of a data intercommunication device provided in the seventh embodiment of the present disclosure
  • Fig. 8 is a schematic structural diagram of an electronic device provided in the eighth embodiment of the present disclosure.
  • FIG. 1 is a schematic flowchart of a data intercommunication method provided in Embodiment 1 of the present disclosure.
  • This example is suitable for data intercommunication between two independent databases, which can be used to realize multiple activities in different places.
  • This method can be executed by a data intercommunication device, and the device can be configured in a terminal or a server to execute the data intercommunication method of this embodiment.
  • whether the two databases are in different places can be determined according to the round-trip time (Round-Trip Time, RTT) between the two databases. That is, according to the total time delay experienced from the sending end of the data transmission until the sending end receives the confirmation from the receiving end, the receiving end generally sends the confirmation immediately after receiving the data.
  • RTT Round-trip Time
  • the method of this embodiment may include the following steps:
  • S110 Receive, through the second database, the data to be synchronized that is transmitted in real time by the first database through the TPIPE component of the first data pipeline.
  • the data to be synchronized includes historical data in the first database and first incremental data in the first database.
  • the first data pipeline TPIPE component is used to orderly transmit the to-be-synchronized data of the first database.
  • the historical data and the first incremental data can be divided according to actual needs.
  • the historical data may be data stored at the current time in the first database; the first incremental data may be data written after the current time.
  • the current moment may be the moment when the first database starts to transmit the data to be synchronized in real time through the first data pipeline TPIPE component.
  • a large amount of to-be-synchronized data transmitted in real time by the first database through the TPIPE component of the first data pipeline is received through the second database, that is, one-way synchronization between the second database and the first database is established through the TPIPE component of the first data pipeline.
  • the first database and the second database may include non-relational memory databases.
  • the first database and the second database may both be Redis databases.
  • the full amount of data includes the data to be synchronized transmitted by the first database and the local write data in the second database.
  • the second database has received the data to be synchronized from the first database.
  • the second database includes both the to-be-synchronized data transmitted by the first database and the locally written data in the second database.
  • the first data pipe TPIPE component and the second data pipe TPIPE component may be message queues for orderly transmission of data.
  • the second data pipe TPIPE component can be used to orderly transmit the full amount of data.
  • the method before the second database transmits the full amount of data to the secondary database of the second database through the second data pipeline TPIPE component, the method includes: establishing the secondary database of the second database.
  • the slave database can replace the data access of the first database, and provide data in the first database and the second database at the same time, so as to realize the The data of the first database and the second database are interconnected.
  • the first database may also be called the first main database
  • the second database may also be called the second main database
  • the second database includes the data written by the local end and the data to be synchronized transmitted by the first database received through the first data pipeline TPIPE component, so that users of the second database can access the first database at the same time And the data of the second database; and then transfer the full amount of data in the second database to the secondary database of the second database, so that users who originally accessed the first database can simultaneously access the first database and the second database through the secondary database of the second database Database data realizes data intercommunication.
  • the orderly transmission of data can be realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component, which can ensure the integrity and real-time performance of data transmission, and solve the removal of data intercommunication methods.
  • the technical problems of storage and poor user experience can neither affect the transmission of historical data nor the transmission of incremental data without stopping the machine, and truly realize the data intercommunication of the database.
  • FIG. 2 is a schematic flowchart of a data intercommunication method provided in Embodiment 2 of the present disclosure. This embodiment is described on the basis of the foregoing embodiment.
  • receiving, through the second database, the data to be synchronized that is transmitted in real time by the first database through the first data pipeline TPIPE component includes: receiving through the first dual-write component of the second database when the first synchronization condition is satisfied
  • the first database transmits the data to be synchronized in real time through the first data pipeline TPIPE component, and controls the second database to receive the data to be synchronized in real time transmitted by the first database written by the first dual-write component of the second database.
  • the data intercommunication method of this embodiment may further include: in a case where a second synchronization condition is met, controlling the second database to write the slave database to the slave database through the first dual-write component The second incremental data in the second database.
  • the data intercommunication method of this embodiment may further include: controlling the second database to receive the third increment of the slave database written by the slave database through the second double-write component of the slave database data.
  • the method of this embodiment may include the following steps:
  • the first dual-write component may be a dual-write capable group suitable for the second database. Pieces.
  • the first dual-write component can act as an upper-level agent of the second database to receive data transmission and data access requirements.
  • the advantage of this setting is that data transmission and data access with the second database can be realized through the first dual-write component, which can avoid directly affecting the second database when there are problems with data transmission and data access.
  • the first dual-write component can also serve as an upper-level agent for multiple candidate databases, simplifying data transmission and data access procedures. It can be understood that the candidate database includes a second database.
  • the second database may be a Redis database
  • the first dual-write component is twemproxy
  • the first synchronization condition can be set according to user requirements, which is not limited here.
  • the first synchronization condition may include, but is not limited to, at least one of the following: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; the first database real time has been received All the historical data of the first database is transmitted, that is, the historical data of the first database has been completely synchronized to the first dual-write component; the to-be-synchronized data to be received in the second database meets a preset condition, where the preset condition includes The amount of received data to be synchronized is within a preset threshold range, etc.
  • the second synchronization condition can be set according to user requirements, which is not limited here.
  • the second synchronization condition may be the same as the first synchronization condition, or may be different from the first synchronization condition.
  • the first synchronization condition includes that the current data synchronization time reaches a preset first synchronization duration threshold
  • the second synchronization condition includes that the current data synchronization time reaches a preset second synchronization duration threshold, and the like.
  • S240 Control the second database to receive the third incremental data of the slave database written by the slave database through the second dual-write component of the slave database.
  • the second dual-write component may be a component with dual-write capability applicable to the slave database.
  • the second dual-write component can act as the upper-level agent of the slave database to receive data transmission and data access requirements.
  • the advantage of this setting is that data transmission and data access with the slave database can be realized through the second double-write component, which can avoid directly affecting the slave database when there are problems with data transmission and data access.
  • the second dual-write component can also serve as an upper-level agent for multiple candidate databases, simplifying data transmission and data access processes. It can be understood that the candidate database includes the secondary database.
  • the slave database may be a Redis database
  • the second double write component may be twemproxy
  • the third incremental data includes data written into the slave database through the second double-write component of the slave database. Controlling the second database to receive the third incremental data of the secondary database can synchronize the third incremental data of the secondary database to the second database when the third incremental data exists in the secondary database, so that The second incremental data included in the second database is consistent with the data in the slave database.
  • the slave database receives incremental data at the same time, or the data switching from the first database to the slave database has been completed, that is, when the user data is all supported by the slave database, then the slave database
  • the third incremental data includes incremental data originally input into the first database.
  • the first dual-write component set in the second database can provide the second database with dual-write capability, and the method of directly writing data through the first dual-write component and the second dual-write component is suitable for
  • the historical data in the first database and the second database have been synchronized, only the subsequent incremental data needs to be synchronized; moreover, the first database and the second database are realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component
  • the data transmission can not only realize the orderly transmission of data in batches, but also ensure the real-time performance of data intercommunication, save the time of data synchronization, and improve the efficiency of data synchronization.
  • the data intercommunication method of the embodiment of the present disclosure may further include: receiving the user's access request from the database In the case of determining the access authority of the user according to the attribute information of the user.
  • the user's attribute information may include the user's name, gender, age, position, ID number, login account information, and so on.
  • determining the user's access authority according to the user's attribute information may include: pre-establishing a user whitelist according to the user's attribute information, and if the user's to-be-matched information corresponding to the access request is If the information in the user whitelist matches, the user is allowed to access the slave database.
  • the whitelisted user may be a user who manages or views the database, such as a database tester, a database maintainer, and so on.
  • the user may be regarded as an ordinary user, and the access request may be switched to A database access request.
  • the advantage of this setting is that it can ensure that during the database synchronization process, the staff can access the new library and the ordinary users access the old library. In this way, even if the data needs to be maintained during the data synchronization process, it is ensured that the user has no perception during the test process, does not affect the online, and does not affect the user's access, thereby improving the user experience.
  • the access requests of all users can be switched to the slave database, so that users who access the first database can simultaneously access the first database and the second database.
  • Database data to realize real-time data intercommunication Example three
  • FIG. 3 is a schematic flow chart of a data intercommunication method provided by Embodiment 3 of the present disclosure.
  • This embodiment is suitable for data intercommunication between two independent databases and can be used to realize multiple activities in different places.
  • the method can be implemented by a data intercommunication device.
  • the device may be configured in a terminal or a server to execute the data intercommunication method of this embodiment.
  • the method of this embodiment may include the following steps:
  • the data to be synchronized includes historical data in the first database and first incremental data in the first database.
  • historical data and first incremental data can be divided according to actual needs.
  • historical data may be data stored at the current moment in the first database; and the first incremental data may be data written after the current moment.
  • the current time may be the time when the first database starts to transmit the data to be synchronized in real time through the first data pipeline TPIPE component.
  • controlling the first database to transmit the data to be synchronized of the first database to the first data pipeline TPIPE component may include: controlling the first database to the first data pipeline TPIPE component Transmit the historical data of the first database in real time; in the case that the first database receives the first incremental data written by the third double-write component to the first database, control the first database to send The first data pipeline TPIPE component transmits the first incremental data in real time.
  • the historical data and the first incremental data can be synchronized in real time to the first data pipeline TPIPE component, so as to import all the data to be synchronized in the first database through the first data pipeline TPIPE component into the second database.
  • the method further includes: Data conflict detection is performed on the data of the database.
  • the first database may be controlled to transmit the data to be synchronized of the first database to the first data pipeline TPIPE component.
  • a data conflict prompt message can be generated to remind the user to handle the data conflict.
  • S320 Control the TPIPE component of the first data pipeline to transmit the to-be-synchronized data of the first database to the second database in real time.
  • the first data pipe TPIPE component is used to orderly transmit the data to be synchronized.
  • the first data pipe TPIPE component complies with the communication protocol of the first database and the second database.
  • the first data pipeline TPIPE component receives the data to be synchronized in the first database, and then transmits the data to be synchronized in the first database to the second database in real time, so that the data in the first database
  • the data to be synchronized is imported into the second database in a pipe manner, so that one-way synchronization from the first database to the second database is realized.
  • the data to be synchronized in the first database is transmitted to the first data pipe TPIPE component in an orderly manner, and the data to be synchronized is transmitted to the second database by the first data pipe TPIPE component in an orderly manner. That is, the historical data and the first incremental data of the first database are accurately and completely synchronized to the second database through the first data pipeline TPIPE component, so that the second data includes both the data to be synchronized in the first data and Including the local write data of the second database, which realizes data synchronization, solves the technical problems such as error-proneness and poor user experience when the database directly transmits data. It can be in a state of non-stop without affecting the transmission of historical data. It does not affect incremental data and lays a solid foundation for rapid and accurate data exchange.
  • FIG. 4 is a schematic flowchart of a data intercommunication method provided by Embodiment 4 of the disclosure. This embodiment is described on the basis of the foregoing embodiment.
  • controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component may include: in the case that there is no data conflict between the data in the first database and the second database, Control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component.
  • controlling the first data pipeline TPIPE component to transmit the data to be synchronized of the first database to the second database in real time includes: controlling the first data pipeline when a third synchronization condition is satisfied
  • the TPIPE component transmits the to-be-synchronized data of the first database to the first double write component of the second database in real time, and controls the first double write component of the second database to write the first database to the second database in real time Transfer data to be synchronized.
  • the method of this embodiment may include the following steps:
  • the data conflict detection may be performed through the log files of the first database and the second database that record the full amount of data.
  • the full file Append Only File, AOF
  • A0F is equivalent to a log of recording operations, and each data change will be additionally recorded in the A0F log.
  • the service starts, it will read these operation logs and re Perform the recorded operation once to restore the original data. Therefore, data conflicts can be detected by combining the data in the first database AOF and the second database AOF.
  • the third synchronization condition may be the same as the first synchronization condition or the second condition, or may be different from the first synchronization condition and the second synchronization condition.
  • the third synchronization condition may also include, but is not limited to, at least one of the following: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; the first synchronization time threshold has been received
  • a database transmits all the historical data of the first database in real time, that is, the historical data of the first database has been completely synchronized to the second data; the data to be synchronized to be received by the second database meets preset conditions, where the preset conditions include waiting The amount of received data to be synchronized is within a preset threshold range, etc.
  • the technical solution of this embodiment can perform data detection on the first database and the second database before the first database and the second database are interoperable, so as to eliminate the impact of data conflicts on data interoperability, and provide a basis for the feasibility of data interoperability Moreover, when the third synchronization condition is met, the first database is controlled to write to the second database the data to be synchronized transmitted in real time by the first database through the first double write component of the superior agent of the second database, which further ensures The security of data intercommunication.
  • FIG. 5a is a data interworking system further provided by an embodiment of the present disclosure.
  • the data interworking system includes: a first database 510, a second database 520, and a secondary database 530 of the second database 520.
  • the first database 510 transmits the data to be synchronized of the first database 510 to the first data pipe TPIPE component, and the first data pipe TPIPE component transmits the data to be synchronized of the first database 510 to the second database 520 in real time;
  • the second database 520 receives the to-be-synchronized data transmitted in real time by the first database 510 through the first data pipeline TPIPE component, and transmits all the data in the second database 520 to the secondary database 530 of the second database 520 through the second data pipeline TPIPE component.
  • the data to be synchronized includes the historical data of the first database and the first incremental data in the first database, and the full amount of data includes the data to be synchronized and all the data transmitted by the first database.
  • the local write data in the second database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipeline TPIPE component is used to orderly transmit the full amount of data.
  • the first database As an optional example of the data intercommunication system in the embodiment of the present disclosure, the first database, the second As an example, the data exchange between the database and the secondary database of the second database is the Redis database, as shown in Figures 5b-5i, the implementation is as follows:
  • the first database T Redis and the second database M Redis are two relatively independent databases, and the first database T Redis and the second database M Redis are respectively set with their respective upper-layer agents twemproxy.
  • the first database T Redis transmits the to-be-synchronized data of the first database T Redis to the first data pipeline TPIPE component, and the first data pipeline TPIPE component transmits the first database T Redis to the second database in real time.
  • the second database M Redis receives the data to be synchronized transmitted in real time by the first database T Redis through the first data pipeline TPIPE component, and establishes a one-way synchronization from the first database T Redis to the second database M Redis.
  • the second database M Redis since the second database M Redis includes the data to be synchronized transmitted by the first database T Redis, the second database M Redis is represented by the second database M+T Redis at this time.
  • the local end of the database T Redis establishes the slave database M+T Redis of the second database M+T Redis, and then the second database M+T Redis sends the slave database M of the second database M+T Redis through the second data pipeline TPIPE component +T Redis transmits the full amount of data in the second database M+T Redis to achieve two-way data synchronization.
  • the first database T Redis is established through the first data pipeline TPIPE component with the first dual-write component twemproxy of the second database M+T Redis to establish a communication connection, so that the first data pipeline
  • the TPIPE component writes the received data to be synchronized in the first database T Redis into the second database M+T Redis through the first dual-write component twemproxy, and the second database M+T Redis receives the waiting data written by the first dual-write component twemproxy. Synchronous Data.
  • the second database M+T Redis writes the second database M+T to the slave database M+T Redis through the first double write component twemproxy of the second database M+T Redis
  • the second incremental data in Redis that is, when the second incremental data is generated, it can be directly written into the second database M+T Redis and from the database M+T Redis through the first dual write component twemproxy of the second database M+T Redis T Redis.
  • the second incremental data from the database M+T Redis will be written from the database M+T Redis to the second database M+T Redis through the second double write component twemproxy from the database M+T Redis, the second database M+T Redis receives the second incremental data sent from the database M+T Redis.
  • a user whitelist can be pre-established according to the user's attribute information; further, when the user's access request is received, it belongs to the whitelist
  • the user accesses from the database M+T Redis, among which whitelist users can be users who have the ability to manage or view the database, such as database testers and database Maintenance personnel, etc., ordinary users who are not in the whitelist temporarily access the local data of the first database T Redis;
  • the access requests of all users can be switched to the slave database M+T Redis, so that users who access the first database T Redis can simultaneously access the first database.
  • the data of the database T Redis and the second database M+T Redis are used to realize real-time data intercommunication.
  • the technical solution of this embodiment can realize data intercommunication without stopping the machine, and has no influence on the historical data and incremental data in multiple databases, and can also ensure that the test process does not affect the online, thus realizing no Perceived data intercommunication greatly improves user experience.
  • the data interworking device of this embodiment includes a data receiving module 610 and a full data transmission module 620.
  • the data receiving module 610 is configured to receive, through the second database, the data to be synchronized transmitted in real time by the first database through the first data pipeline TPIPE component;
  • the full data transmission module 620 is configured to control the second database through the second data pipeline
  • the TPIPE component transmits the full amount of data in the second database to the slave database of the second database.
  • the data to be synchronized includes the historical data of the first database and the first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the The local end writes data in the second database, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
  • the second database includes the data written by the local end and the data to be synchronized transmitted by the first database received through the first data pipeline TPIPE component, so that users of the second database can access the first database at the same time And the data of the second database; and then transfer the full amount of data in the second database to the secondary database of the second database, so that users who originally accessed the first database can simultaneously access the first database and the second database through the secondary database of the second database Database data realizes data intercommunication.
  • the orderly transmission of data can be realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component, which can ensure the integrity and real-time performance of data transmission, and solve the removal of data intercommunication methods.
  • the technical problems of storage and poor user experience can neither affect the transmission of historical data nor the transmission of incremental data without stopping the machine, and truly realize the data intercommunication of the database.
  • the data receiving module 610 receives the data to be synchronized that is transmitted in real time by the first database through the first data pipeline TPIPE component through the second database in the following manner:
  • the The first dual-write component of the second database receives the first database communication
  • the data to be synchronized transmitted in real time via the first data pipeline TPIPE component is controlled to receive the data to be synchronized in real time transmitted by the first database written by the first double-write component of the second database by the second database.
  • the first synchronization condition may include but is not limited to at least one of the following conditions: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; Real-time transmission of all historical data of the first database to the first database; the data to be synchronized to be received in the second database satisfies a preset condition, where the preset condition includes the value of the data to be synchronized to be received The amount of data is within the preset threshold range.
  • the data intercommunication device may further include: a first writing module, configured to control the second database to write data to the second database through the first dual writing component when the second synchronization condition is satisfied The second incremental data written in the second database is written from the database.
  • a first writing module configured to control the second database to write data to the second database through the first dual writing component when the second synchronization condition is satisfied The second incremental data written in the second database is written from the database.
  • the data intercommunication device may further include: a second writing module configured to control the second database to receive the data written by the slave database through the second dual-write component of the slave database The third incremental data of the slave database.
  • the data intercommunication device may further include: an authority management module configured to determine the user's access request based on the user's attribute information in the case that the user's access request is received from the database access permission.
  • the above-mentioned data intercommunication device can execute the data intercommunication method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
  • FIG. 7 is a schematic structural diagram of a data intercommunication device provided in Embodiment 7 of the present disclosure.
  • the data intercommunication device includes: a first data transmission module 710 and a second data transmission module 720.
  • the first data transmission module 710 is configured to control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
  • the second data transmission module 720 is configured to control the first data pipeline TPIPE
  • the component transmits the to-be-synchronized data of the first database to the second database in real time; wherein, the to-be-synchronized data includes historical data of the first database and first incremental data in the first database.
  • the data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
  • the data to be synchronized in the first database is transmitted to the first data pipe TPIPE component in an orderly manner, and the data to be synchronized is transmitted to the second database by the first data pipe TPIPE component in an orderly manner. That is, the historical data and the first incremental data of the first main database are accurately and completely synchronized to the second database through the first data pipeline TPIPE component, so that the second database includes the data to be synchronized in the first database. It also includes the local write data of the second database, which realizes data synchronization and solves the technical problems such as error-proneness and poor user experience when the database directly transmits data. It can be in a non-stop state without affecting the transmission of historical data. Does not affect incremental data, for The rapid and accurate realization of data interchange lays a solid foundation.
  • the first data transmission module 710 is configured to: control the first database to transmit the historical data of the first database to the first data pipeline TPIPE component in real time; and receive the historical data in the first database
  • control the first database to transmit the first incremental data to the first data pipeline TPIPE component in real time.
  • the second data transmission module 720 is configured to: in a case where the third synchronization condition is satisfied, control the first database to write to the second database through the first dual-write component of the second database The second database writes the to-be-synchronized data transmitted in real time from the first database.
  • the first data transmission module 710 is configured to: control the first database to pass through the first data pipeline when there is no data conflict between the data in the first database and the second database
  • the TPIPE component transmits the data to be synchronized to the second database in real time.
  • the above-mentioned data intercommunication device can perform the data intercommunication method provided by any embodiment of the present disclosure.
  • FIG. 8 shows a schematic structural diagram of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiments of the present disclosure.
  • the terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablets (Portable Android Device, PAD), portable multimedia players ( Portable Media Player (PMP) mobile terminals such as vehicle-mounted terminals (for example, vehicle navigation terminals) and fixed terminals such as digital television (television, TV) desktop computers and the like.
  • PDA Personal Digital Assistant
  • PDA Personal Digital Assistant
  • PAD Portable Multimedia Player
  • PMP Portable Media Player
  • vehicle-mounted terminals for example, vehicle navigation terminals
  • fixed terminals such as digital television (television, TV) desktop computers and the like.
  • the electronic device shown in FIG. 8 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 800 may include a processing device (such as a central processing unit, a graphics processor, etc.) 801, and FIG. 8 may be based on a program stored in a read-only memory (Read-Only Memory, ROM) 802 or from a storage
  • the device 808 loads a program in a random access memory (Random Access Memory, RAM) 803 to perform various appropriate actions and processes.
  • RAM Random Access Memory
  • various programs and data required for the operation of the electronic device 800 are also stored.
  • the processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804.
  • An input/output (I/O) interface 805 is also connected to the bus 804.
  • the following devices can be connected to the I/O interface 805: including input devices 806 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD)
  • input devices 806 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.
  • LCD liquid crystal display
  • a storage device 808 such as a magnetic tape, a hard disk, etc.
  • the communication device 809 may allow the electronic device 800 to perform wireless or wired communication with other devices to exchange data.
  • Figure 8 shows The electronic device 800 has multiple devices, but it should be understood that it is not required to implement or have all the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product.
  • the computer program product includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802.
  • the computer program is executed by the processing device 801, it executes the above-mentioned functions defined in the method of the embodiment of the present disclosure.
  • the aforementioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory, EPROM or flash memory), optical fiber, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in the baseband or as a part of a carrier wave, and the computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the first database through the second database and transmits it in real time through the first data pipeline TPIPE component Data to be synchronized; controlling the second database to transmit data in the second database to the second database through the second data pipeline TPIPE component Full data; wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full data includes the data to be synchronized and all data transmitted by the first database
  • the local write data in the second database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipeline TPIPE component is used to orderly transmit the full amount of data.
  • the aforementioned computer-readable medium carries one or more programs, and when the aforementioned one or more programs are executed by the electronic device, the electronic device is caused to: control the first database to transmit the first data pipeline TPIPE component.
  • the data to be synchronized in the database controlling the first data pipeline TPIPE component to transmit the data to be synchronized in the first database in real time to the second database; wherein the data to be synchronized includes the historical data of the first database and the The first incremental data in the first database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
  • the computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof.
  • the above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code may be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can pass through any kind of network-including a local area network ((Local Area Network,
  • LAN Local Area Network
  • WAN Wide Area Network
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code includes one or more for realizing prescribed logical functions Executable instructions.
  • the functions marked in the blocks may also occur in a different order from the order marked in the drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or operation Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • modules and units involved in the described embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the module or unit does not constitute a limitation on the module or unit itself under certain circumstances.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed in embodiments of the present disclosure are a data interworking method and device, a terminal and a storage medium. The data interworking method comprises: a second database receiving synchronization data transmitted in real time by a first database by means of a first data pipe (TPIPE) assembly; and controlling the second database to transmit, to a slave database of the second database, and by means of a second data pipe (TPIPE) assembly, full data in the second database, wherein the first data pipe (TPIPE) assembly is used to orderly transmit the synchronization data, and the second data pipe (TPIPE) assembly is used to orderly transmit the full data.

Description

数据互通方法、 装置、 终端及存储介质 Data intercommunication method, device, terminal and storage medium
本申请要求在 2019年 02月 27日提交中国专利局、申请号为 201910146908.6 的中国专利申请的优先权, 该申请的全部内容通过引用结合在本申请中。 技术领域 This application claims the priority of the Chinese patent application filed with the Chinese Patent Office with application number 201910146908.6 on February 27, 2019. The entire content of this application is incorporated into this application by reference. Technical field
本公开实施例涉及计算机应用技术领域, 例如涉及一种数据互通方法、 装 置、 终端及存储介质。 背景技术 The embodiments of the present disclosure relate to the field of computer application technology, for example, to a data intercommunication method, device, terminal, and storage medium. Background technique
远程字典服务 ( Remote Dictionary Server, Redis )是 Nosql数据库中使用较 为广泛的非关系型内存数据库。 Redis 内部是一个键值 ( key-value ) 存储系统。 由于 Redis具有易扩展、 大数据量提高性能以及多样灵活的数据模型等优点, 被 广泛应用。 Remote Dictionary Server (Redis) is a non-relational memory database that is widely used in Nosql databases. Inside Redis is a key-value storage system. Because Redis has the advantages of easy expansion, large data volume to improve performance, and diverse and flexible data models, it is widely used.
异地多活成为越来越多大型互联网公司采用的数据管理方案, 几乎也是大 型应用发展到一定阶段的必然选择。 异地多活一般是指在不同城市建立独立的 数据中心, 这些机房在日常的业务中也需要走流量, 做业务支撑。 即在不同城 市的两个机房的数据库之间进行数据互通, 使得用户在不同城市中一个地点访 问另一个地点的数据。 Living in different places has become a data management solution adopted by more and more large Internet companies, and it is almost an inevitable choice for large-scale applications to develop to a certain stage. Multi-activity in different places generally refers to the establishment of independent data centers in different cities. These computer rooms also need to carry traffic in daily business to provide business support. That is, data exchange is performed between the databases of two computer rooms in different cities, so that users can access data in one place in different cities.
以两个 Redis数据库之间的数据互通为例, 相关技术的 Redis数据库数据互 通方法, 通常是直接将两个 Redis数据库之间的数据进行传输, 由于 Redis数据 库可能包括历史数据又有实时写入的增量数据, 使得数据传输的过程中极易出 错, 往往很难在不影响数据的情况下实现数据互通, 用户体验较差。 发明内容 Take the data intercommunication between two Redis databases as an example. The Redis database data intercommunication method of related technologies usually directly transfers the data between the two Redis databases. Because the Redis database may include historical data and write in real time Incremental data makes it extremely prone to errors during data transmission, and it is often difficult to achieve data intercommunication without affecting the data, and the user experience is poor. Summary of the invention
本公开实施例提供了一种数据互通方法、 装置、 终端及存储介质, 解决相 关技术中数据库与数据库直接进行数据传输时易出错, 用户体验差等技术问题, 能够简单有效地实现数据互通。 The embodiments of the present disclosure provide a data intercommunication method, device, terminal, and storage medium to solve technical problems such as error-proneness and poor user experience when directly transmitting data between a database and a database in related technologies, and can achieve data intercommunication simply and effectively.
本公开实施例提供了一种数据互通方法, 该方法包括: The embodiment of the present disclosure provides a data intercommunication method, which includes:
通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时传输的 待同步数据; Receiving, through the second database, the data to be synchronized that the first database transmits in real time through the first data pipeline TPIPE component;
控制所述第二数据库通过第二数据管道 TPIPE组件向所述第二数据库的从 数据库传输所述第二数据库中的全量数据; 其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数据和所 述第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有序传输 所述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量数据。 Controlling the second database to transmit the full amount of data in the second database to the secondary database of the second database through the second data pipeline TPIPE component; Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the second The local end writes data in the database, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
本公开实施例还提供了一种数据互通方法, 该方法包括: The embodiment of the present disclosure also provides a data intercommunication method, which includes:
控制第一数据库向第一数据管道 TPIPE组件传输所述第一数据库的待同步 数据; Controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
控制所述第一数据管道 TPIPE组件向第二数据库实时传输所述第一数据库 的待同步数据; Controlling the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the second database in real time;
其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据, 所述第一数据管道 TPIPE组件用于有序传输所述待同步数 据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the first data pipeline TPIPE component is used for orderly transmitting the data to be synchronized.
本公开实施例还提供了一种数据互通装置, 该装置包括: The embodiment of the present disclosure also provides a data intercommunication device, which includes:
数据接收模块, 设置为通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时传输的待同步数据; A data receiving module, configured to receive, through the second database, the data to be synchronized that the first database transmits in real time through the TPIPE component of the first data pipeline;
全量数据传输模块, 设置为控制所述第二数据库通过第二数据管道 TPIPE 组件向所述第二数据库的从数据库传输所述第二数据库中的全量数据; A full data transmission module, configured to control the second database to transmit the full data in the second database to the second database through the second data pipeline TPIPE component;
其中, 所述待同步数据包括所述第一数据库历史数据和所述第一数据库中 的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数据和所述 第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有序传输所 述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量数据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the second database The local end writes data in, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
本公开实施例还提供了一种数据互通装置, 该装置包括: The embodiment of the present disclosure also provides a data intercommunication device, which includes:
第一数据传输模块, 设置为控制第一数据库向第一数据管道 TPIPE组件传 输所述第一数据库的待同步数据; The first data transmission module is configured to control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
第二数据传输模块, 设置为控制所述第一数据管道 TPIPE组件向第二数据 库实时传输所述第一数据库的待同步数据; The second data transmission module is configured to control the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the second database in real time;
其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据所述第一数据管道 TPIPE组件用于有序传输所述待同步数据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database. The first data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
本公开实施例还提供了一种电子设备, 该电子设备包括: The embodiments of the present disclosure also provide an electronic device, which includes:
一个或多个处理装置; One or more processing devices;
存储器, 设置为存储一个或多个程序; 当所述一个或多个程序被所述一个或多个处理装置执行, 使得所述一个或 多个处理装置实现如本公开任一实施例所述的数据互通方法。 Memory, set to store one or more programs; When the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses implement the data intercommunication method according to any embodiment of the present disclosure.
本公开实施例还提供了一种计算机可读存储介质, 计算机可读存储介质上 存储有计算机程序, 所述计算机程序被处理器执行时实现如本公开任一实施例 所述的数据互通方法。 附图说明 The embodiments of the present disclosure also provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the data intercommunication method as described in any embodiment of the present disclosure is implemented. Description of the drawings
图 1是本公开实施例一所提供的一种数据互通方法的流程示意图; 图 2是本公开实施例二所提供的一种数据互通方法的流程示意图; 图 3是本公开实施例三所提供的一种数据互通方法的流程示意图; 图 4是本公开实施例四所提供的一种数据互通方法的流程示意图; 图 5a是本公开实施例五所提供的一种数据互通系统的流程示意图; 图 5b是本公开实施例五所提供的一种数据单向同步的示意图; Fig. 1 is a schematic flowchart of a data interworking method provided in the first embodiment of the present disclosure; Fig. 2 is a schematic flowchart of a data interworking method provided in the second embodiment of the present disclosure; Fig. 4 is a schematic flowchart of a data intercommunication method provided by Embodiment 4 of the present disclosure; Fig. 5a is a schematic flowchart of a data intercommunication system provided by Embodiment 5 of the present disclosure; 5b is a schematic diagram of one-way data synchronization provided in the fifth embodiment of the present disclosure;
图 5c是本公开实施例五所提供的一种数据双向同步的交互示意图; 图 5d是本公开实施例五所提供的另一种数据双向同步的交互示意图; 图 5e是本公开实施例五所提供的另一种数据双向同步的交互示意图; 图 5f是本公开实施例五所提供的另一种数据双向同步的交互示意图; 图 5g是本公开实施例五所提供的另一种数据双向同步的交互示意图; 图 5h是本公开实施例五所提供的另一种数据双向同步的交互示意图; 图 5i是本公开实施例五所提供的一种数据互通的数据交互示意图; 图 6是本公开实施例六所提供的一种数据互通装置的结构示意图; 图 7是本公开实施例七所提供的一种数据互通装置的结构示意图; 图 8是本公开实施例八所提供的一种电子设备的结构示意图。 具体实施方式 下面结合附图和实施例对本公开进行说明。 可以理解的是, 此处所描述的 具体实施例仅仅用于解释本公开, 而非对本公开的限定。另外还需要说明的是, 为了便于描述, 附图中仅示出了与本公开相关的部分而非全部结构。 Figure 5c is a schematic diagram of the interaction of two-way data synchronization provided in the fifth embodiment of the present disclosure; Figure 5d is another schematic diagram of the interaction of two-way data synchronization provided in the fifth embodiment of the present disclosure; Figure 5e is another schematic diagram of the two-way data synchronization provided in the fifth embodiment of the present disclosure; A schematic diagram of the interaction of two-way data synchronization; Figure 5f is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure; Figure 5g is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure; 5h is another schematic diagram of the interaction of two-way data synchronization provided by the fifth embodiment of the present disclosure; FIG. 5i is a schematic diagram of the data interaction for data intercommunication provided by the fifth embodiment of the present disclosure; FIG. 6 is a schematic diagram of the data interaction provided by the sixth embodiment of the present disclosure Fig. 7 is a schematic structural diagram of a data intercommunication device provided in the seventh embodiment of the present disclosure; Fig. 8 is a schematic structural diagram of an electronic device provided in the eighth embodiment of the present disclosure. DETAILED DESCRIPTION The present disclosure will be described below with reference to the drawings and embodiments. It can be understood that the specific embodiments described here are only used to explain the present disclosure, but not to limit the present disclosure. In addition, it should be noted that, for ease of description, the drawings only show a part of the structure related to the present disclosure, but not all of the structure.
实施例一 Example one
图 1 为本公开实施例一所提供的一种数据互通方法的流程示意图, 本实施 例适用于两个独立数据库的数据互通, 可用于实现异地多活, 该方法可以由数 据互通装置来执行, 所述装置可以配置在终端或服务器中用于执行本实施例的 数据互通方法。 本实施例中, 两个数据库是不是异地可以根据两个数据库之间 的往返时延 (Round-Trip Time, RTT)确定。 即, 根据从发送端发送数据开始, 到 发送端收到来自接收端的确认, 总共经历的时延, 一般接收端收到数据后便立 即发送确认。 FIG. 1 is a schematic flowchart of a data intercommunication method provided in Embodiment 1 of the present disclosure. This example is suitable for data intercommunication between two independent databases, which can be used to realize multiple activities in different places. This method can be executed by a data intercommunication device, and the device can be configured in a terminal or a server to execute the data intercommunication method of this embodiment. In this embodiment, whether the two databases are in different places can be determined according to the round-trip time (Round-Trip Time, RTT) between the two databases. That is, according to the total time delay experienced from the sending end of the data transmission until the sending end receives the confirmation from the receiving end, the receiving end generally sends the confirmation immediately after receiving the data.
如图 1所示, 本实施例的方法可包括如下步骤: As shown in FIG. 1, the method of this embodiment may include the following steps:
S110、 通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时 传输的待同步数据。 S110: Receive, through the second database, the data to be synchronized that is transmitted in real time by the first database through the TPIPE component of the first data pipeline.
本实施例中, 所述待同步数据包括所述第一数据库的历史数据和所述第一 数据库中的第一增量数据。 所述第一数据管道 TPIPE组件用于有序传输所述第 一数据库的待同步数据。 In this embodiment, the data to be synchronized includes historical data in the first database and first incremental data in the first database. The first data pipeline TPIPE component is used to orderly transmit the to-be-synchronized data of the first database.
本实施例中,历史数据和第一增量数据可以根据实际需求进行划分。比如, 历史数据可以是所述第一数据库中当前时刻下已存储的数据; 第一增量数据可 以是在所述当前时刻以后写入的数据。 当前时刻, 可以是第一数据库开始通过 第一数据管道 TPIPE组件实时传输待同步数据的时刻。 In this embodiment, the historical data and the first incremental data can be divided according to actual needs. For example, the historical data may be data stored at the current time in the first database; the first incremental data may be data written after the current time. The current moment may be the moment when the first database starts to transmit the data to be synchronized in real time through the first data pipeline TPIPE component.
通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时传输的 大量待同步数据, 即, 通过第一数据管道 TPIPE组件搭建起了第二数据库与第 一数据库的单向同步。 A large amount of to-be-synchronized data transmitted in real time by the first database through the TPIPE component of the first data pipeline is received through the second database, that is, one-way synchronization between the second database and the first database is established through the TPIPE component of the first data pipeline.
在本公开实施例中, 所述第一数据库和所述第二数据库可包括非关系型内 存数据库。 示例性地, 所述第一数据库和所述第二数据库可均为 Redis数据库。 In the embodiment of the present disclosure, the first database and the second database may include non-relational memory databases. Exemplarily, the first database and the second database may both be Redis databases.
S120、 控制所述第二数据库通过第二数据管道 TPIPE组件向所述第二数据 库的从数据库传输所述第二数据库中的全量数据。 S120. Control the second database to transmit the full amount of data in the second database to the secondary database of the second database through the second data pipeline TPIPE component.
本实施例中, 所述全量数据包括所述第一数据库传输的待同步数据和所述 第二数据库中的本端写入数据, 如上所述, 第二数据库接收到了第一数据库的 待同步数据, 则第二数据库中既包括所述第一数据库传输的待同步数据和所述 第二数据库中的本端写入数据。 In this embodiment, the full amount of data includes the data to be synchronized transmitted by the first database and the local write data in the second database. As described above, the second database has received the data to be synchronized from the first database. , The second database includes both the to-be-synchronized data transmitted by the first database and the locally written data in the second database.
在本公开实施例中, 所述第一数据管道 TPIPE组件和所述第二数据管道 TPIPE组件可以是用于有序传输数据的消息队列。 所述第二数据管道 TPIPE组 件可用于有序传输所述全量数据。 在一实施例中, 在所述第二数据库通过所述 第二数据管道 TPIPE组件向所述第二数据库的从数据库传输所述全量数据之前, 包括: 建立所述第二数据库的从数据库。 在本实施例中, 该从数据库可以替代 第一数据库的数据访问, 同时提供第一数据库和第二数据库中的数据, 实现第 一数据库和第二数据库这两个数据库的数据互通。 In the embodiment of the present disclosure, the first data pipe TPIPE component and the second data pipe TPIPE component may be message queues for orderly transmission of data. The second data pipe TPIPE component can be used to orderly transmit the full amount of data. In an embodiment, before the second database transmits the full amount of data to the secondary database of the second database through the second data pipeline TPIPE component, the method includes: establishing the secondary database of the second database. In this embodiment, the slave database can replace the data access of the first database, and provide data in the first database and the second database at the same time, so as to realize the The data of the first database and the second database are interconnected.
在本实施例中, 第一数据库也可称为第一主数据库, 第二数据库也可称为 第二主数据库。 In this embodiment, the first database may also be called the first main database, and the second database may also be called the second main database.
本实施例的技术方案, 第二数据库中包括本端写入数据以及通过第一数据 管道 TPIPE组件接收到的第一数据库传输的待同步数据, 使得第二数据库的用 户能够同时访问到第一数据库和第二数据库的数据; 进而将第二数据库中的全 量数据传输到第二数据库的从数据库, 使得原本访问第一数据库的用户可以通 过第二数据库的从数据库同时访问到第一数据库和第二数据库数据, 实现了数 据互通,而且,通过能够通过第一数据管道 TPIPE组件以及第二数据管道 TPIPE 组件实现数据的有序传输, 能够保证数据传输的完整性和实时性, 解决数据互 通方法移除存以及用户体验差的技术问题, 能够在不停机的状态下, 既不影响 历史数据的传输也不影响增量数据的传输, 真正实现了数据库的数据互通。 In the technical solution of this embodiment, the second database includes the data written by the local end and the data to be synchronized transmitted by the first database received through the first data pipeline TPIPE component, so that users of the second database can access the first database at the same time And the data of the second database; and then transfer the full amount of data in the second database to the secondary database of the second database, so that users who originally accessed the first database can simultaneously access the first database and the second database through the secondary database of the second database Database data realizes data intercommunication. Moreover, the orderly transmission of data can be realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component, which can ensure the integrity and real-time performance of data transmission, and solve the removal of data intercommunication methods. The technical problems of storage and poor user experience can neither affect the transmission of historical data nor the transmission of incremental data without stopping the machine, and truly realize the data intercommunication of the database.
实施例二 Example two
图 2为本公开实施例二所提供的一种数据互通方法的流程示意图, 本实施 例以上述实施例中为基础进行说明。 在本实施例中, 通过第二数据库接收第一 数据库通过第一数据管道 TPIPE组件实时传输的待同步数据包括: 在满足第一 同步条件的情况下, 通过第二数据库的第一双写组件接收第一数据库通过第一 数据管道 TPIPE组件实时传输的待同步数据, 控制所述第二数据库接收所述第 二数据库的第一双写组件写入的所述第一数据库实时传输的待同步数据。 FIG. 2 is a schematic flowchart of a data intercommunication method provided in Embodiment 2 of the present disclosure. This embodiment is described on the basis of the foregoing embodiment. In this embodiment, receiving, through the second database, the data to be synchronized that is transmitted in real time by the first database through the first data pipeline TPIPE component includes: receiving through the first dual-write component of the second database when the first synchronization condition is satisfied The first database transmits the data to be synchronized in real time through the first data pipeline TPIPE component, and controls the second database to receive the data to be synchronized in real time transmitted by the first database written by the first dual-write component of the second database.
在一实施例中, 本实施例数据互通方法还可包括: 在满足第二同步条件的 情况下, 控制所述第二数据库通过所述第一双写组件向所述从数据库中写入所 述第二数据库中的第二增量数据。 In an embodiment, the data intercommunication method of this embodiment may further include: in a case where a second synchronization condition is met, controlling the second database to write the slave database to the slave database through the first dual-write component The second incremental data in the second database.
在此基础上, 本实施例的数据互通方法还可包括: 控制所述第二数据库接 收所述从数据库通过所述从数据库的第二双写组件写入的所述从数据库的第三 增量数据。 On this basis, the data intercommunication method of this embodiment may further include: controlling the second database to receive the third increment of the slave database written by the slave database through the second double-write component of the slave database data.
如图 2所示, 本实施例的方法可以包括如下步骤: As shown in FIG. 2, the method of this embodiment may include the following steps:
S210、 在满足第一同步条件的情况下, 通过第二数据库的第一双写组件接 收第一数据库通过第一数据管道 TPIPE组件实时传输的待同步数据, 控制所述 第二数据库接收所述第二数据库的第一双写组件写入的所述第一数据库实时传 输的待同步数据。 S210: When the first synchronization condition is met, receive the data to be synchronized that the first database transmits in real time through the first data pipeline TPIPE component through the first dual-write component of the second database, and control the second database to receive the second database. The data to be synchronized for real-time transmission of the first database written by the first dual-write component of the second database.
S220、 控制第二数据库通过第二数据管道 TPIPE组件向第二数据库的从数 据库传输第二数据库中的全量数据。 本实施例中, 第一双写组件可以是适用于第二数据库的具有双写能力的组 件。 第一双写组件可以作为第二数据库的上级代理, 接收数据传输以及数据访 问需求。 这样设置的好处在于, 可以通过第一双写组件实现与第二数据库的数 据传输以及数据访问, 可以避免数据传输以及数据访问有问题时, 直接影响第 二数据库。 在存在多个待选数据库的情况下, 第一双写组件还可以作为多个待 选数据库的上级代理, 简化数据传输以及数据访问流程。 可以理解的是, 所述 待选数据库包括第二数据库。 S220: Control the second database to transmit all the data in the second database to the second database through the second data pipeline TPIPE component. In this embodiment, the first dual-write component may be a dual-write capable group suitable for the second database. Pieces. The first dual-write component can act as an upper-level agent of the second database to receive data transmission and data access requirements. The advantage of this setting is that data transmission and data access with the second database can be realized through the first dual-write component, which can avoid directly affecting the second database when there are problems with data transmission and data access. In the case that there are multiple candidate databases, the first dual-write component can also serve as an upper-level agent for multiple candidate databases, simplifying data transmission and data access procedures. It can be understood that the candidate database includes a second database.
在一实施例中, 所述第二数据库可以是 Redis数据库, 所述第一双写组件为 twemproxy。 In an embodiment, the second database may be a Redis database, and the first dual-write component is twemproxy.
在一实施例中,第一同步条件可以根据用户需求进行设置,在此不做限定。 在一实施例中, 第一同步条件可以包括但不仅限于下述至少一个: 接收到 第一切换指令; 当前数据同步时间达到预设的第一同步时长阈值; 已接收到所 述第一数据库实时传输所述第一数据库的所有历史数据, 即第一数据库的历史 数据已经完全同步到第一双写组件; 第二数据库待接收的待同步数据满足预设 条件, 其中, 预设条件包括的待接收的待同步数据的数据量处于预设的阈值范 围内等。 In an embodiment, the first synchronization condition can be set according to user requirements, which is not limited here. In an embodiment, the first synchronization condition may include, but is not limited to, at least one of the following: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; the first database real time has been received All the historical data of the first database is transmitted, that is, the historical data of the first database has been completely synchronized to the first dual-write component; the to-be-synchronized data to be received in the second database meets a preset condition, where the preset condition includes The amount of received data to be synchronized is within a preset threshold range, etc.
S230、 在满足第二同步条件的情况下, 控制所述第二数据库通过所述第一 双写组件向所述从数据库中写入所述第二数据库中的第二增量数据。 S230: When the second synchronization condition is met, control the second database to write the second incremental data in the second database into the slave database through the first double-write component.
类似地, 第二同步条件可以根据用户需求进行设置, 在此不做限定。 在一 实施例中, 第二同步条件可以和第一同步不条件相同, 也可以和第一同步条件 不相同。 例如, 所述第一同步条件包括当前数据同步时间达到预设的第一同步 时长阈值, 所述第二同步条件包括当前数据同步时间达到预设的第二同步时长 阈值等。 Similarly, the second synchronization condition can be set according to user requirements, which is not limited here. In an embodiment, the second synchronization condition may be the same as the first synchronization condition, or may be different from the first synchronization condition. For example, the first synchronization condition includes that the current data synchronization time reaches a preset first synchronization duration threshold, and the second synchronization condition includes that the current data synchronization time reaches a preset second synchronization duration threshold, and the like.
S240、 控制所述第二数据库接收所述从数据库通过所述从数据库的第二双 写组件写入的所述从数据库的第三增量数据。 S240: Control the second database to receive the third incremental data of the slave database written by the slave database through the second dual-write component of the slave database.
类似地, 第二双写组件可以是适用于所述从数据库的具有双写能力的组件。 第二双写组件可以作为所述从数据库的上级代理, 接收数据传输以及数据访问 需求。 这样设置的好处在于, 可以通过第二双写组件实现与所述从数据库的数 据传输以及数据访问, 可以避免数据传输以及数据访问有问题时, 直接影响所 述从数据库。 在存在多个待选数据库的情况下, 第二双写组件还可以作为多个 待选数据库的上级代理, 简化数据传输以及数据访问流程。 可以理解的是, 所 述待选数据库包括所述从数据库。 Similarly, the second dual-write component may be a component with dual-write capability applicable to the slave database. The second dual-write component can act as the upper-level agent of the slave database to receive data transmission and data access requirements. The advantage of this setting is that data transmission and data access with the slave database can be realized through the second double-write component, which can avoid directly affecting the slave database when there are problems with data transmission and data access. In the case that there are multiple candidate databases, the second dual-write component can also serve as an upper-level agent for multiple candidate databases, simplifying data transmission and data access processes. It can be understood that the candidate database includes the secondary database.
在一实施例中, 所述从数据库可以是 Redis数据库, 所述第二双写组件可以 为 twemproxy。 在一实施例中, 所述第三增量数据包括通过所述从数据库的第二双写组件 写入所述从数据库中的数据。 控制所述第二数据库接收所述从数据库的第三增 量数据, 能够将在从数据库存在第三增量数据时, 将所述从数据库的第三增量 数据同步到第二数据库中, 使得第二数据库包括的第二增量数据, 与从数据库 中的数据保持一致。 In an embodiment, the slave database may be a Redis database, and the second double write component may be twemproxy. In an embodiment, the third incremental data includes data written into the slave database through the second double-write component of the slave database. Controlling the second database to receive the third incremental data of the secondary database can synchronize the third incremental data of the secondary database to the second database when the third incremental data exists in the secondary database, so that The second incremental data included in the second database is consistent with the data in the slave database.
在一实施例中, 如果第一数据库和从数据库同时接收到增量数据, 或者已 完成从第一数据库到从数据库的数据切换, 即用户数据全部由从数据库支撑时, 则所述从数据库的所述第三增量数据包括原本输入所述第一数据库的增量数据。 In an embodiment, if the first database and the slave database receive incremental data at the same time, or the data switching from the first database to the slave database has been completed, that is, when the user data is all supported by the slave database, then the slave database The third incremental data includes incremental data originally input into the first database.
本实施例的技术方案, 通过第二数据库设置的第一双写组件, 能够为第二 数据库提供双写能力, 直接通过第一双写组件和第二双写组件将数据写入的方 式适用于当第一数据库和第二数据库中的历史数据已经同步, 只需要同步后续 的增量数据的情况; 而且, 通过第一数据管道 TPIPE组件以及第二数据管道 TPIPE组件实现第一数据库和第二数据库的数据传输,不仅能够实现数据批量地 有序地传输, 还能够保证数据互通的实时性, 节省数据同步的时间, 提高数据 同步的效率。 In the technical solution of this embodiment, the first dual-write component set in the second database can provide the second database with dual-write capability, and the method of directly writing data through the first dual-write component and the second dual-write component is suitable for When the historical data in the first database and the second database have been synchronized, only the subsequent incremental data needs to be synchronized; moreover, the first database and the second database are realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component The data transmission can not only realize the orderly transmission of data in batches, but also ensure the real-time performance of data intercommunication, save the time of data synchronization, and improve the efficiency of data synchronization.
在上述技术方案的技术上, 为了真正实现用户对数据切换无感知, 而且完 全不影响用户的正常使用, 本公开实施例的数据互通方法还可包括: 在所述从 数据库接收到用户的访问请求的情况下, 根据所述用户的属性信息确定所述用 户的访问权限。 在一实施例中, 用户的属性信息可以包括用户的姓名、 性别、 年龄、 职位、 身份证号以及登录账户信息等等。 In terms of the above technical solutions, in order to truly realize that the user is unaware of data switching and does not affect the normal use of the user at all, the data intercommunication method of the embodiment of the present disclosure may further include: receiving the user's access request from the database In the case of determining the access authority of the user according to the attribute information of the user. In an embodiment, the user's attribute information may include the user's name, gender, age, position, ID number, login account information, and so on.
在一实施例中, 根据所述用户的属性信息确定所述用户的访问权限可以包 括: 根据用户的属性信息预先建立用户白名单, 如果与所述访问请求对应的用 户的待匹配信息与所述用户白名单中的信息匹配, 则允许所述用户访问所述从 数据库。 在一实施例中, 白名单用户可以是具有对数据库进行管理或查看的用 户, 如数据库测试人员、 数据库维护人员等。 In an embodiment, determining the user's access authority according to the user's attribute information may include: pre-establishing a user whitelist according to the user's attribute information, and if the user's to-be-matched information corresponding to the access request is If the information in the user whitelist matches, the user is allowed to access the slave database. In an embodiment, the whitelisted user may be a user who manages or views the database, such as a database tester, a database maintainer, and so on.
为了保证普通用户的正常访问, 如果与所述访问请求对应的用户的待匹配 信息与所述用户白名单中的信息匹配, 可以将所述用户作为普通用户, 将所述 访问请求切换为对第一数据库的访问请求。 这样设置的好处在于, 能够保证在 数据库同步的过程中, 工作人员访问新库, 普通用户访问老库。 这样即使数据 同步的过程中需要对数据进行维护, 保证测试过程用户无感知, 不对线上产生 影响, 也不会影响用户的访问, 提升用户体验。 In order to ensure normal access of ordinary users, if the to-be-matched information of the user corresponding to the access request matches the information in the user whitelist, the user may be regarded as an ordinary user, and the access request may be switched to A database access request. The advantage of this setting is that it can ensure that during the database synchronization process, the staff can access the new library and the ordinary users access the old library. In this way, even if the data needs to be maintained during the data synchronization process, it is ensured that the user has no perception during the test process, does not affect the online, and does not affect the user's access, thereby improving the user experience.
在一实施例中, 当所述从数据库满足接收所有用户访问的条件时, 可以将 所有用户的访问请求切换至从数据库, 以使访问第一数据库的用户能够同时访 问到第一数据库和第二数据库的数据, 以实现数据实时互通。 实施例三 In an embodiment, when the slave database satisfies the conditions for receiving all user accesses, the access requests of all users can be switched to the slave database, so that users who access the first database can simultaneously access the first database and the second database. Database data to realize real-time data intercommunication. Example three
图 3 为本公开实施例三所提供的一种数据互通方法的流程示意图, 本实施 例适用于两个独立数据库之间的数据互通, 可用于实现异地多活, 该方法可以 由数据互通装置来执行, 所述装置可以配置在终端或服务器中用于执行本实施 例的数据互通方法。 FIG. 3 is a schematic flow chart of a data intercommunication method provided by Embodiment 3 of the present disclosure. This embodiment is suitable for data intercommunication between two independent databases and can be used to realize multiple activities in different places. The method can be implemented by a data intercommunication device. To execute, the device may be configured in a terminal or a server to execute the data intercommunication method of this embodiment.
如图 3所示, 本实施例的方法可包括如下步骤: As shown in FIG. 3, the method of this embodiment may include the following steps:
S310、 控制第一数据库向第一数据管道 TPIPE组件传输所述第一数据库的 待同步数据。 S310. Control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component.
本实施例中, 所述待同步数据包括所述第一数据库的历史数据和所述第一 数据库中的第一增量数据。 如前所述, 历史数据和第一增量数据可以根据实际 需求进行划分。 比如, 历史数据可以是所述第一数据库中当前时刻下已存储的 数据; 第一增量数据可以是在所述当前时刻以后写入的数据。 当前时刻, 可以 是第一数据库开始通过第一数据管道 TPIPE组件实时传输待同步数据的时刻。 In this embodiment, the data to be synchronized includes historical data in the first database and first incremental data in the first database. As mentioned earlier, historical data and first incremental data can be divided according to actual needs. For example, historical data may be data stored at the current moment in the first database; and the first incremental data may be data written after the current moment. The current time may be the time when the first database starts to transmit the data to be synchronized in real time through the first data pipeline TPIPE component.
在本公开实施例中的一个实施方式中, 所述控制第一数据库向第一数据管 道 TPIPE组件传输所述第一数据库的待同步数据, 可包括: 控制第一数据库向 第一数据管道 TPIPE组件实时传输所述第一数据库的历史数据; 在所述第一数 据库接收到第三双写组件写入所述第一数据库的第一增量数据的情况下, 控制 所述第一数据库向所述第一数据管道 TPIPE组件实时传输所述第一增量数据。 能够将历史数据和第一增量数据的实时同步给所述第一数据管道 TPIPE组件, 以将通过第一数据管道 TPIPE组件将第一数据库的待同步数据全量导入第二数 据库。 In one implementation of the embodiment of the present disclosure, the controlling the first database to transmit the data to be synchronized of the first database to the first data pipeline TPIPE component may include: controlling the first database to the first data pipeline TPIPE component Transmit the historical data of the first database in real time; in the case that the first database receives the first incremental data written by the third double-write component to the first database, control the first database to send The first data pipeline TPIPE component transmits the first incremental data in real time. The historical data and the first incremental data can be synchronized in real time to the first data pipeline TPIPE component, so as to import all the data to be synchronized in the first database through the first data pipeline TPIPE component into the second database.
在一实施例中, 为了保证数据互通的安全性, 在控制第一数据库向第一数 据管道 TPIPE组件传输所述第一数据库的待同步数据之前, 还包括: 对第一数 据库的数据与第二数据库的数据进行数据冲突检测。 在一实施例中, 如果第一 数据库的数据与第二数据库的数据不存在数据冲突, 则可以控制第一数据库向 第一数据管道 TPIPE组件传输所述第一数据库的待同步数据。 另外, 如果第一 数据库的数据与第二数据库的数据存在数据冲突, 则可以生成数据冲突提示信 息, 以提醒用户对所述数据冲突进行处理。 In an embodiment, in order to ensure the security of data intercommunication, before controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component, the method further includes: Data conflict detection is performed on the data of the database. In an embodiment, if there is no data conflict between the data of the first database and the data of the second database, the first database may be controlled to transmit the data to be synchronized of the first database to the first data pipeline TPIPE component. In addition, if there is a data conflict between the data in the first database and the data in the second database, a data conflict prompt message can be generated to remind the user to handle the data conflict.
S320、 控制所述第一数据管道 TPIPE组件向第二数据库实时传输所述第一 数据库的待同步数据。 S320: Control the TPIPE component of the first data pipeline to transmit the to-be-synchronized data of the first database to the second database in real time.
在本实施例中, 所述第一数据管道 TPIPE组件用于有序传输所述待同步数 据。 在本实施例中, 所述第一数据管道 TPIPE组件符合所述第一数据库和所述 第二数据库的通信协议。 在本公开实施例中, 所述第一数据管道 TPIPE组件接收到所述第一数据库 的待同步数据, 则向第二数据库实时传输所述第一数据库的待同步数据, 以将 第一数据库的待同步数据以管道 ( pipe )的方式导入第二数据库, 从而实现第一 数据库到第二数据库的单向同步。 In this embodiment, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized. In this embodiment, the first data pipe TPIPE component complies with the communication protocol of the first database and the second database. In the embodiment of the present disclosure, the first data pipeline TPIPE component receives the data to be synchronized in the first database, and then transmits the data to be synchronized in the first database to the second database in real time, so that the data in the first database The data to be synchronized is imported into the second database in a pipe manner, so that one-way synchronization from the first database to the second database is realized.
本实施例的技术方案, 通过将第一数据库的待同步数据有序地传输到第一 数据管道 TPIPE组件, 进而由第一数据管道 TPIPE组件有序地将待同步数据传 输到第二数据库中, 即, 通过第一数据管道 TPIPE组件将第一数据库的历史数 据和第一增量数据准确地、 完整地同步至第二数据库中, 使得第二数据中既包 括第一数据中的待同步数据又包括第二数据库的本端写入数据, 实现了数据同 步, 解决了数据库直接进行数据传输时易出错以及用户体验差等技术问题, 能 够在不停机的状态下, 既不影响历史数据的传输也不影响增量数据, 为快速准 确地实现数据互通打下坚实的基础。 In the technical solution of this embodiment, the data to be synchronized in the first database is transmitted to the first data pipe TPIPE component in an orderly manner, and the data to be synchronized is transmitted to the second database by the first data pipe TPIPE component in an orderly manner. That is, the historical data and the first incremental data of the first database are accurately and completely synchronized to the second database through the first data pipeline TPIPE component, so that the second data includes both the data to be synchronized in the first data and Including the local write data of the second database, which realizes data synchronization, solves the technical problems such as error-proneness and poor user experience when the database directly transmits data. It can be in a state of non-stop without affecting the transmission of historical data. It does not affect incremental data and lays a solid foundation for rapid and accurate data exchange.
实施例四 Example four
图 4为本公开实施例四所提供的一种数据互通方法的流程示意图, 本实施 例以上述实施例为基础进行说明。 为了充分保证数据互通的可行性, 在启动数 据传输之前, 还可以先检测互通的数据库的数据之间是不是存在数据冲突。 在 一实施例中, 控制第一数据库向第一数据管道 TPIPE组件传输所述第一数据库 的待同步数据, 可包括: 在第一数据库和第二数据库中的数据不存在数据冲突 的情况下, 控制所述第一数据库向第一数据管道 TPIPE组件传输第一数据库的 待同步数据。 FIG. 4 is a schematic flowchart of a data intercommunication method provided by Embodiment 4 of the disclosure. This embodiment is described on the basis of the foregoing embodiment. In order to fully ensure the feasibility of data intercommunication, before starting data transmission, it is also possible to detect whether there is a data conflict between the data of the intercommunication database. In an embodiment, controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component may include: in the case that there is no data conflict between the data in the first database and the second database, Control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component.
在本公开实施例中, 控制所述第一数据管道 TPIPE组件向第二数据库实时 传输所述第一数据库的待同步数据包括: 在满足第三同步条件的情况下, 控制 所述第一数据管道 TPIPE组件向第二数据库的第一双写组件实时传输所述第一 数据库的待同步数据, 控制所述第二数据库的第一双写组件向所述第二数据库 写入所述第一数据库实时传输待同步数据。 In the embodiment of the present disclosure, controlling the first data pipeline TPIPE component to transmit the data to be synchronized of the first database to the second database in real time includes: controlling the first data pipeline when a third synchronization condition is satisfied The TPIPE component transmits the to-be-synchronized data of the first database to the first double write component of the second database in real time, and controls the first double write component of the second database to write the first database to the second database in real time Transfer data to be synchronized.
如图 4所示, 本实施例的方法可包括如下步骤: As shown in FIG. 4, the method of this embodiment may include the following steps:
S410、 在第一数据库和第二数据库中的数据不存在数据冲突的情况下, 控 制所述第一数据库向第一数据管道 TPIPE组件传输第一数据库的待同步数据。 S410: When there is no data conflict between the data in the first database and the second database, control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component.
在一实施例中, 可以通过第一数据库和第二数据库的记录有全量数据的日 志文件进行数据冲突的检测。 以 Redis数据库为例, 可根据第一数据库和第二数 据库备份的全量文件 ( Append Only File, AOF )检测第一数据库和第二数据库 中是否在数据冲突。 其中, A0F相当于一个记录操作的日志, 对于数据的每次 变更都会追加记录到 A0F日志。 当服务启动的时候就会读这些操作日志, 重新 执行一次所记录操作, 从而恢复原始数据。 因此, 可以通过将第一数据库 AOF 和第二数据库 AOF中的数据进行数据冲突的检测。 In an embodiment, the data conflict detection may be performed through the log files of the first database and the second database that record the full amount of data. Taking the Redis database as an example, whether there is a data conflict between the first database and the second database can be detected according to the full file (Append Only File, AOF) backed up by the first database and the second database. Among them, A0F is equivalent to a log of recording operations, and each data change will be additionally recorded in the A0F log. When the service starts, it will read these operation logs and re Perform the recorded operation once to restore the original data. Therefore, data conflicts can be detected by combining the data in the first database AOF and the second database AOF.
S420、 在满足第三同步条件的情况下, 控制所述第一数据管道 TPIPE组件 向第二数据库的第一双写组件实时传输所述第一数据库的待同步数据, 控制所 述第二数据库的第一双写组件向所述第二数据库写入所述第一数据库实时传输 的待同步数据。 S420: When the third synchronization condition is met, control the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the first double-write component of the second database in real time, and control the data of the second database The first dual-write component writes the data to be synchronized that is transmitted in real time by the first database to the second database.
在本实施例中, 第三同步条件可以与所述第一同步条件或第二条件相同, 也可以与第一同步条件第二同步条件不同。 In this embodiment, the third synchronization condition may be the same as the first synchronization condition or the second condition, or may be different from the first synchronization condition and the second synchronization condition.
在一实施例中, 所述第三同步条件也可以包括但不仅限于下述至少一个: 接收到第一切换指令; 当前数据同步时间达到预设的第一同步时长阈值; 已接 收到所述第一数据库实时传输所述第一数据库的所有历史数据, 即第一数据库 的历史数据已经完全同步到第二数据; 第二数据库待接收的待同步数据满足预 设条件, 其中, 预设条件包括待接收的待同步数据的数据量处于预设的阈值范 围内等。 In an embodiment, the third synchronization condition may also include, but is not limited to, at least one of the following: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; the first synchronization time threshold has been received A database transmits all the historical data of the first database in real time, that is, the historical data of the first database has been completely synchronized to the second data; the data to be synchronized to be received by the second database meets preset conditions, where the preset conditions include waiting The amount of received data to be synchronized is within a preset threshold range, etc.
本实施例的技术方案, 能够在第一数据库和第二数据库互通之前, 对第一 数据库和第二数据库的进行数据检测, 以排除数据冲突对数据互通的影响, 为 数据互通的可行性提供依据, 而且, 在满足第三同步条件的情况下, 控制第一 数据库通过第二数据库的上级代理第一双写组件向所述第二数据库写入第一数 据库实时传输的待同步数据, 进一步保证了数据互通的安全性。 The technical solution of this embodiment can perform data detection on the first database and the second database before the first database and the second database are interoperable, so as to eliminate the impact of data conflicts on data interoperability, and provide a basis for the feasibility of data interoperability Moreover, when the third synchronization condition is met, the first database is controlled to write to the second database the data to be synchronized transmitted in real time by the first database through the first double write component of the superior agent of the second database, which further ensures The security of data intercommunication.
实施例五 Example five
图 5a 为本公开实施例还提供的一种数据互通系统, 该数据互通系统包括: 第一数据库 510、第二数据库 520和所述第二数据库 520的从数据库 530。其中, 第一数据库 510向第一数据管道 TPIPE组件传输第一数据库 510的待同步数据, 所述第一数据管道 TPIPE组件向第二数据库 520实时传输第一数据库 510的待 同步数据; 第二数据库 520接收第一数据库 510通过第一数据管道 TPIPE组件 实时传输的待同步数据, 并通过第二数据管道 TPIPE组件向第二数据库 520的 从数据库 530传输所述第二数据库 520中的全量数据。 FIG. 5a is a data interworking system further provided by an embodiment of the present disclosure. The data interworking system includes: a first database 510, a second database 520, and a secondary database 530 of the second database 520. The first database 510 transmits the data to be synchronized of the first database 510 to the first data pipe TPIPE component, and the first data pipe TPIPE component transmits the data to be synchronized of the first database 510 to the second database 520 in real time; the second database 520 receives the to-be-synchronized data transmitted in real time by the first database 510 through the first data pipeline TPIPE component, and transmits all the data in the second database 520 to the secondary database 530 of the second database 520 through the second data pipeline TPIPE component.
本实施例中, 所述待同步数据包括所述第一数据库的历史数据和所述第一 数据库中的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数 据和所述第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有 序传输所述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量 数据。 In this embodiment, the data to be synchronized includes the historical data of the first database and the first incremental data in the first database, and the full amount of data includes the data to be synchronized and all the data transmitted by the first database. The local write data in the second database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipeline TPIPE component is used to orderly transmit the full amount of data.
作为本公开实施例的一个数据互通系统的可选实例, 以第一数据库、 第二 数据库和所述第二数据库的从数据库为 Redis 数据库时的数据互通为例, 如图 5b-5i所示, 实现方式如下: As an optional example of the data intercommunication system in the embodiment of the present disclosure, the first database, the second As an example, the data exchange between the database and the secondary database of the second database is the Redis database, as shown in Figures 5b-5i, the implementation is as follows:
参见图 5b,第一数据库 T Redis和第二数据库 M Redis为两个数据相对独立 的数据库, 且第一数据库 T Redis和第二数据库 M Redis都分别设置有各自的上 层代理 twemproxy。 Referring to Figure 5b, the first database T Redis and the second database M Redis are two relatively independent databases, and the first database T Redis and the second database M Redis are respectively set with their respective upper-layer agents twemproxy.
参见图 5c , 第一数据库 T Redis向第一数据管道 TPIPE组件传输所述第一 数据库 T Redis的待同步数据,所述第一数据管道 TPIPE组件向第二数据库实时 传输所述第一数据库 T Redis的待同步数据, 第二数据库 M Redis接收第一数据 库 T Redis通过第一数据管道 TPIPE组件实时传输的待同步数据,搭建了从第一 数据库 T Redis到第二数据库 M Redis的单向同步。 Referring to FIG. 5c, the first database T Redis transmits the to-be-synchronized data of the first database T Redis to the first data pipeline TPIPE component, and the first data pipeline TPIPE component transmits the first database T Redis to the second database in real time. The second database M Redis receives the data to be synchronized transmitted in real time by the first database T Redis through the first data pipeline TPIPE component, and establishes a one-way synchronization from the first database T Redis to the second database M Redis.
参见图 5d, 需要说明的是, 由于第二数据库 M Redis中包括第一数据库 T Redis传输的待同步数据, 此时将第二数据库 M Redis用第二数据库 M+T Redis 来表示,在第一数据库 T Redis的本地端建立第二数据库 M+T Redis的从数据库 M+T Redis, 然后, 第二数据库 M+T Redis通过第二数据管道 TPIPE组件向第二 数据库 M+T Redis的从数据库 M+T Redis传输第二数据库 M+T Redis中的全量 数据, 实现双向数据同步。 Referring to Figure 5d, it should be noted that, since the second database M Redis includes the data to be synchronized transmitted by the first database T Redis, the second database M Redis is represented by the second database M+T Redis at this time. The local end of the database T Redis establishes the slave database M+T Redis of the second database M+T Redis, and then the second database M+T Redis sends the slave database M of the second database M+T Redis through the second data pipeline TPIPE component +T Redis transmits the full amount of data in the second database M+T Redis to achieve two-way data synchronization.
参见图 5e, 当接收到第一切换指令时, 将第一数据库 T Redis通过第一数据 管道 TPIPE组件与第二数据库 M+T Redis的第一双写组件 twemproxy建立通讯 连接,使得第一数据管道 TPIPE组件将接收到的第一数据库 T Redis的待同步数 据通过第一双写组件 twemproxy写入第二数据库 M+T Redis, 第二数据库 M+T Redis接收第一双写组件 twemproxy写入的待同步数据。 Referring to Figure 5e, when the first switching instruction is received, the first database T Redis is established through the first data pipeline TPIPE component with the first dual-write component twemproxy of the second database M+T Redis to establish a communication connection, so that the first data pipeline The TPIPE component writes the received data to be synchronized in the first database T Redis into the second database M+T Redis through the first dual-write component twemproxy, and the second database M+T Redis receives the waiting data written by the first dual-write component twemproxy. Synchronous Data.
参见图 5f, 当接收到第二切换指令时, 第二数据库 M+T Redis通过第二数 据库 M+T Redis的第一双写组件 twemproxy向从数据库 M+T Redis写入第二数 据库 M+T Redis中的第二增量数据, 即, 产生第二增量数据时, 可以直接通过 二数据库 M+T Redis的第一双写组件 twemproxy写入第二数据库 M+T Redis以 及从数据库中 M+T Redis中。 Referring to FIG. 5f, when the second switching instruction is received, the second database M+T Redis writes the second database M+T to the slave database M+T Redis through the first double write component twemproxy of the second database M+T Redis The second incremental data in Redis, that is, when the second incremental data is generated, it can be directly written into the second database M+T Redis and from the database M+T Redis through the first dual write component twemproxy of the second database M+T Redis T Redis.
参见图 5g, 从数据库 M+T Redis通过从数据库 M+T Redis的第二双写组件 twemproxy将从数据库 M+T Redis的第二增量数据写入第二数据库 M+T Redis , 第二数据库 M+T Redis接收从数据库 M+T Redis发送的第二增量数据。 Referring to Figure 5g, the second incremental data from the database M+T Redis will be written from the database M+T Redis to the second database M+T Redis through the second double write component twemproxy from the database M+T Redis, the second database M+T Redis receives the second incremental data sent from the database M+T Redis.
参见图 5h, 考虑到同步过程中的数据安全问题以及用户体验问题, 可以将 用户分流, 根据用户的属性信息预先建立用户白名单; 进而, 当接收到用户的 访问请求时, 属于所述白名单的用户访问从数据库 M+T Redis, 其中, 白名单用 户可以是具有对数据库进行管理或查看的用户, 如数据库测试人员以及数据库 维护人员等, 不属于白名单的普通用户暂时访问第一数据库 T Redis的本地端数 据; Referring to Figure 5h, considering the data security issues and user experience issues in the synchronization process, users can be diverted, and a user whitelist can be pre-established according to the user's attribute information; further, when the user's access request is received, it belongs to the whitelist The user accesses from the database M+T Redis, among which whitelist users can be users who have the ability to manage or view the database, such as database testers and database Maintenance personnel, etc., ordinary users who are not in the whitelist temporarily access the local data of the first database T Redis;
参见图 5i, 当所述从数据库满足接收所有用户访问的条件时, 可以将所有 用户的访问请求切换至从数据库 M+T Redis , 以使访问第一数据库 T Redis的用 户能够同时访问到第一数据库 T Redis和第二数据库 M+T Redis的数据, 以实现 数据实时互通。 Referring to Figure 5i, when the slave database meets the conditions for receiving all user accesses, the access requests of all users can be switched to the slave database M+T Redis, so that users who access the first database T Redis can simultaneously access the first database. The data of the database T Redis and the second database M+T Redis are used to realize real-time data intercommunication.
本实施例的技术方案, 能够在不停机的状态下实现数据互通, 而且对多个 数据库中的历史数据和增量数据均不造成影响, 还能够保证测试过程不对线上 产生影响, 实现了无感知的数据互通, 极大地提升了用户体验。 The technical solution of this embodiment can realize data intercommunication without stopping the machine, and has no influence on the historical data and incremental data in multiple databases, and can also ensure that the test process does not affect the online, thus realizing no Perceived data intercommunication greatly improves user experience.
实施例六 Example Six
图 6为本公开实施例所提供的一种数据互通装置的结构示意图, 如图 6所 示,本实施例的数据互通装置包括:数据接收模块 610和全量数据传输模块 620。 其中, 数据接收模块 610, 设置为通过第二数据库接收第一数据库通过第一数据 管道 TPIPE组件实时传输的待同步数据; 全量数据传输模块 620,设置为控制所 述第二数据库通过第二数据管道 TPIPE组件向所述第二数据库的从数据库传输 所述第二数据库中的全量数据。 本实施例中, 所述待同步数据包括所述第一数据库历史数据和所述第一数 据库中的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数据 和所述第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有序 传输所述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量数 据。 6 is a schematic structural diagram of a data interworking device provided by an embodiment of the disclosure. As shown in FIG. 6, the data interworking device of this embodiment includes a data receiving module 610 and a full data transmission module 620. The data receiving module 610 is configured to receive, through the second database, the data to be synchronized transmitted in real time by the first database through the first data pipeline TPIPE component; the full data transmission module 620 is configured to control the second database through the second data pipeline The TPIPE component transmits the full amount of data in the second database to the slave database of the second database. In this embodiment, the data to be synchronized includes the historical data of the first database and the first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the The local end writes data in the second database, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
本实施例的技术方案, 第二数据库中包括本端写入数据以及通过第一数据 管道 TPIPE组件接收到的第一数据库传输的待同步数据, 使得第二数据库的用 户能够同时访问到第一数据库和第二数据库的数据; 进而将第二数据库中的全 量数据传输到第二数据库的从数据库, 使得原本访问第一数据库的用户可以通 过第二数据库的从数据库同时访问到第一数据库和第二数据库数据, 实现了数 据互通,而且,通过能够通过第一数据管道 TPIPE组件以及第二数据管道 TPIPE 组件实现数据的有序传输, 能够保证数据传输的完整性和实时性, 解决数据互 通方法移除存以及用户体验差的技术问题, 能够在不停机的状态下, 既不影响 历史数据的传输也不影响增量数据的传输, 真正实现了数据库的数据互通。 In the technical solution of this embodiment, the second database includes the data written by the local end and the data to be synchronized transmitted by the first database received through the first data pipeline TPIPE component, so that users of the second database can access the first database at the same time And the data of the second database; and then transfer the full amount of data in the second database to the secondary database of the second database, so that users who originally accessed the first database can simultaneously access the first database and the second database through the secondary database of the second database Database data realizes data intercommunication. Moreover, the orderly transmission of data can be realized through the first data pipeline TPIPE component and the second data pipeline TPIPE component, which can ensure the integrity and real-time performance of data transmission, and solve the removal of data intercommunication methods. The technical problems of storage and poor user experience can neither affect the transmission of historical data nor the transmission of incremental data without stopping the machine, and truly realize the data intercommunication of the database.
在上述实施例的基础上, 数据接收模块 610是通过如下方式通过第二数据 库接收第一数据库通过第一数据管道 TPIPE组件实时传输的待同步数据: 在满 足第一同步条件的情况下, 通过第二数据库的第一双写组件接收第一数据库通 过第一数据管道 TPIPE组件实时传输的待同步数据, 控制所述第二数据库接收 所述第二数据库的第一双写组件写入的所述第一数据库实时传输的待同步数据。 On the basis of the foregoing embodiment, the data receiving module 610 receives the data to be synchronized that is transmitted in real time by the first database through the first data pipeline TPIPE component through the second database in the following manner: When the first synchronization condition is met, the The first dual-write component of the second database receives the first database communication The data to be synchronized transmitted in real time via the first data pipeline TPIPE component is controlled to receive the data to be synchronized in real time transmitted by the first database written by the first double-write component of the second database by the second database.
在上述实施例的基础上, 所述第一同步条件可以包括但不仅限于下述条件 中的至少一个: 接收到第一切换指令; 当前数据同步时间达到预设的第一同步 时长阈值; 已接收到所述第一数据库实时传输所述第一数据库的所有的历史数 据; 第二数据库待接收的待同步数据满足预设条件, 其中, 所述预设条件包括 所述待接收的待同步数据的数据量处于预设的阈值范围内。 On the basis of the foregoing embodiment, the first synchronization condition may include but is not limited to at least one of the following conditions: the first switching instruction is received; the current data synchronization time reaches the preset first synchronization duration threshold; Real-time transmission of all historical data of the first database to the first database; the data to be synchronized to be received in the second database satisfies a preset condition, where the preset condition includes the value of the data to be synchronized to be received The amount of data is within the preset threshold range.
在上述实施例的基础上, 所述数据互通装置还可以包括: 第一写入模块, 设置为在满足第二同步条件的情况下, 控制所述第二数据库通过所述第一双写 组件向所述从数据库中写入所述第二数据库中的第二增量数据。 On the basis of the foregoing embodiment, the data intercommunication device may further include: a first writing module, configured to control the second database to write data to the second database through the first dual writing component when the second synchronization condition is satisfied The second incremental data written in the second database is written from the database.
在上述实施例的基础上, 所述数据互通装置还可以包括: 第二写入模块, 设置为控制所述第二数据库接收所述从数据库通过所述从数据库的第二双写组 件写入的所述从数据库的所述第三增量数据。 On the basis of the foregoing embodiment, the data intercommunication device may further include: a second writing module configured to control the second database to receive the data written by the slave database through the second dual-write component of the slave database The third incremental data of the slave database.
在上述实施例的基础上, 所述数据互通装置还可以包括: 权限管理模块, 设置为在所述从数据库接收到用户的访问请求的情况下, 根据所述用户的属性 信息确定所述用户的访问权限。 On the basis of the foregoing embodiment, the data intercommunication device may further include: an authority management module configured to determine the user's access request based on the user's attribute information in the case that the user's access request is received from the database access permission.
上述数据互通装置可执行本公开任意实施例所提供的数据互通方法, 具备 执行方法相应的功能模块和有益效果。 The above-mentioned data intercommunication device can execute the data intercommunication method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
实施例七 Example Seven
图 7 为本公开实施例七所提供的一种数据互通装置的结构示意图, 如图 7 所示, 该数据互通装置包括: 第一数据传输模块 710和第二数据传输模块 720。 其中, 第一数据传输模块 710, 设置为控制第一数据库向第一数据管道 TPIPE 组件传输所述第一数据库的待同步数据; 第二数据传输模块 720,设置为控制所 述第一数据管道 TPIPE组件向第二数据库实时传输所述第一数据库的待同步数 据; 其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据所述第一数据管道 TPIPE组件用于有序传输所述待同步数据。 FIG. 7 is a schematic structural diagram of a data intercommunication device provided in Embodiment 7 of the present disclosure. As shown in FIG. 7, the data intercommunication device includes: a first data transmission module 710 and a second data transmission module 720. Wherein, the first data transmission module 710 is configured to control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component; the second data transmission module 720 is configured to control the first data pipeline TPIPE The component transmits the to-be-synchronized data of the first database to the second database in real time; wherein, the to-be-synchronized data includes historical data of the first database and first incremental data in the first database. The data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
本实施例的技术方案, 通过将第一数据库的待同步数据有序地传输到第一 数据管道 TPIPE组件, 进而由第一数据管道 TPIPE组件有序地将待同步数据传 输到第二数据库中, 即, 通过第一数据管道 TPIPE组件将第一主数据库的历史 数据和第一增量数据准确地、 完整地同步至第二数据库中, 使得第二数据库中 既包括第一数据库中的待同步数据又包括第二数据库的本端写入数据, 实现了 数据同步, 解决了数据库直接进行数据传输时易出错以及用户体验差等技术问 题, 能够在不停机的状态下, 既不影响历史数据的传输也不影响增量数据, 为 快速准确地实现数据互通打下坚实的基础。 In the technical solution of this embodiment, the data to be synchronized in the first database is transmitted to the first data pipe TPIPE component in an orderly manner, and the data to be synchronized is transmitted to the second database by the first data pipe TPIPE component in an orderly manner. That is, the historical data and the first incremental data of the first main database are accurately and completely synchronized to the second database through the first data pipeline TPIPE component, so that the second database includes the data to be synchronized in the first database. It also includes the local write data of the second database, which realizes data synchronization and solves the technical problems such as error-proneness and poor user experience when the database directly transmits data. It can be in a non-stop state without affecting the transmission of historical data. Does not affect incremental data, for The rapid and accurate realization of data interchange lays a solid foundation.
在上述实施例的基础上, 所述第一数据传输模块 710是设置为: 控制第一 数据库向第一数据管道 TPIPE组件实时传输所述第一数据库的历史数据; 在所 述第一数据库接收到第三双写组件写入所述第一数据库的第一增量数据的情况 下, 控制所述第一数据库向所述第一数据管道 TPIPE组件实时传输所述第一增 量数据。 On the basis of the foregoing embodiment, the first data transmission module 710 is configured to: control the first database to transmit the historical data of the first database to the first data pipeline TPIPE component in real time; and receive the historical data in the first database When the third dual-write component writes the first incremental data of the first database, control the first database to transmit the first incremental data to the first data pipeline TPIPE component in real time.
在上述实施例的基础上, 第二数据传输模块 720是设置为: 在满足第三同 步条件的情况下, 控制所述第一数据库通过所述第二数据库的第一双写组件向 所述第二数据库写入所述第一数据库实时传输的待同步数据。 On the basis of the foregoing embodiment, the second data transmission module 720 is configured to: in a case where the third synchronization condition is satisfied, control the first database to write to the second database through the first dual-write component of the second database The second database writes the to-be-synchronized data transmitted in real time from the first database.
在上述实施例的基础上, 所述第一数据传输模块 710是设置为: 在第一数 据库和第二数据库中的数据不存在数据冲突的情况下, 控制所述第一数据库通 过第一数据管道 TPIPE组件向第二数据库实时传输待同步数据。 On the basis of the foregoing embodiment, the first data transmission module 710 is configured to: control the first database to pass through the first data pipeline when there is no data conflict between the data in the first database and the second database The TPIPE component transmits the data to be synchronized to the second database in real time.
上述数据互通装置可执行本公开任意实施例所提供的数据互通方法。 The above-mentioned data intercommunication device can perform the data intercommunication method provided by any embodiment of the present disclosure.
实施例八 Example eight
下面参考图 8, 图 8示出了适于用来实现本公开实施例的电子设备 (例如终 端设备或服务器 ) 800的结构示意图。 本公开实施例中的终端设备可以包括但不 限于诸如移动电话、 笔记本电脑、 数字广播接收器、 个人数字助理 ( Personal Digital Assistant, , PDA ) 平板电脑 ( Portable Android Device, PAD ) 便携 式多媒体播放器 ( Portable Media Player, PMP ) 车载终端 (例如车载导航终 端 ) 等等的移动终端以及诸如数字电视 ( television, TV ) 台式计算机等等的 固定终端。 图 8 示出的电子设备仅仅是一个示例, 不应对本公开实施例的功能 和使用范围带来任何限制。 Next, referring to FIG. 8, FIG. 8 shows a schematic structural diagram of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablets (Portable Android Device, PAD), portable multimedia players ( Portable Media Player (PMP) mobile terminals such as vehicle-mounted terminals (for example, vehicle navigation terminals) and fixed terminals such as digital television (television, TV) desktop computers and the like. The electronic device shown in FIG. 8 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
如图 8所示, 电子设备 800可以包括处理装置 (例如中央处理器、 图形处 理器等 ) 801 , 图 8可以根据存储在只读存储器 ( Read-Only Memory, ROM ) 802 中的程序或者从存储装置 808加载到随机访问存储器( Random Access Memory, RAM ) 803中的程序而执行多种适当的动作和处理。 在 RAM 803中, 还存储有 电子设备 800操作所需的多种程序和数据。 处理装置 801、 ROM 802以及 RAM 803通过总线 804彼此相连。 输入 /输出 ( I/O )接口 805也连接至总线 804。 As shown in FIG. 8, the electronic device 800 may include a processing device (such as a central processing unit, a graphics processor, etc.) 801, and FIG. 8 may be based on a program stored in a read-only memory (Read-Only Memory, ROM) 802 or from a storage The device 808 loads a program in a random access memory (Random Access Memory, RAM) 803 to perform various appropriate actions and processes. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
通常, 以下装置可以连接至 I/O接口 805: 包括例如触摸屏、触摸板、键盘、 鼠标、 摄像头、 麦克风、 加速度计、 陀螺仪等的输入装置 806; 包括例如液晶显 示器 ( Liquid Crystal Display, LCD ) 扬声器、 振动器等的输出装置 807; 包括 例如磁带、 硬盘等的存储装置 808; 以及通信装置 809。 通信装置 809可以允许 电子设备 800与其他设备进行无线或有线通信以交换数据。 虽然图 8示出了具 有多种装置的电子设备 800, 但是应理解的是, 并不要求实施或具备所有示出的 装置。 可以替代地实施或具备更多或更少的装置。 Generally, the following devices can be connected to the I/O interface 805: including input devices 806 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD) The output device 807 of a speaker, a vibrator, etc.; a storage device 808 such as a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to perform wireless or wired communication with other devices to exchange data. Although Figure 8 shows The electronic device 800 has multiple devices, but it should be understood that it is not required to implement or have all the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
根据本公开的实施例, 上文参考流程图描述的过程可以被实现为计算机软 件程序。 例如, 本公开的实施例包括一种计算机程序产品, 计算机程序产品包 括承载在计算机可读介质上的计算机程序, 该计算机程序包含用于执行流程图 所示的方法的程序代码。 在这样的实施例中, 该计算机程序可以通过通信装置 809从网络上被下载和安装, 或者从存储装置 808被安装, 或者从 ROM 802被 安装。 在该计算机程序被处理装置 801 执行时, 执行本公开实施例的方法中限 定的上述功能。 According to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product. The computer program product includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, it executes the above-mentioned functions defined in the method of the embodiment of the present disclosure.
实施例九 Example 9
本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读 存储介质或者是上述两者的任意组合。 计算机可读存储介质例如可以是 -但 不限于—电、 磁、 光、 电磁、 红外线、 或半导体的系统、 装置或器件, 或者 任意以上的组合。 计算机可读存储介质的更具体的例子可以包括但不限于: 具 有一个或多个导线的电连接、 便携式计算机磁盘、 硬盘、 RAM、 ROM、 可擦式 可编程只读存储器( Erasable Programmable Read-Only Memory, EPROM或闪存)、 光纤、便携式紧凑磁盘只读存储器 ( Compact Disc Read-Only Memory, CD-ROM )、 光存储器件、 磁存储器件、 或者上述的任意合适的组合。 在本公开中, 计算机 可读存储介质可以是任何包含或存储程序的有形介质, 该程序可以被指令执行 系统、 装置或者器件使用或者与其结合使用。 而在本公开中, 计算机可读信号 介质可以包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计算 机可读的程序代码。 这种传播的数据信号可以采用多种形式, 包括但不限于电 磁信号、 光信号或上述的任意合适的组合。 计算机可读信号介质还可以是计算 机可读存储介质以外的任何计算机可读介质, 该计算机可读信号介质可以发送、 传播或者传输用于由指令执行系统、 装置或者器件使用或者与其结合使用的程 序。 计算机可读介质上包含的程序代码可以用任何适当的介质传输, 包括但不 限于: 电线、 光缆、 射频 ( Radio Frequency, RF )等等, 或者上述的任意合适 的组合。 The aforementioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory, EPROM or flash memory), optical fiber, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium may include a data signal propagated in the baseband or as a part of a carrier wave, and the computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
上述计算机可读介质可以是上述电子设备中所包含的; 也可以是单独存在, 而未装配入该电子设备中。 The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多个程序 被该电子设备执行时, 使得该电子设备: 通过第二数据库接收第一数据库通过 第一数据管道 TPIPE组件实时传输的待同步数据; 控制所述第二数据库通过第 二数据管道 TPIPE组件向所述第二数据库的从数据库传输所述第二数据库中的 全量数据; 其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一 数据库中的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数 据和所述第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有 序传输所述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量 数据。 The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the first database through the second database and transmits it in real time through the first data pipeline TPIPE component Data to be synchronized; controlling the second database to transmit data in the second database to the second database through the second data pipeline TPIPE component Full data; wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full data includes the data to be synchronized and all data transmitted by the first database The local write data in the second database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipeline TPIPE component is used to orderly transmit the full amount of data.
或者, 上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多 个程序被该电子设备执行时, 使得该电子设备: 控制第一数据库向第一数据管 道 TPIPE组件传输所述第一数据库的待同步数据;控制所述第一数据管道 TPIPE 组件向第二数据库实时传输所述第一数据库的待同步数据; 其中, 所述待同步 数据包括所述第一数据库的历史数据和所述第一数据库中的第一增量数据所述 第一数据管道 TPIPE组件用于有序传输所述待同步数据。 Alternatively, the aforementioned computer-readable medium carries one or more programs, and when the aforementioned one or more programs are executed by the electronic device, the electronic device is caused to: control the first database to transmit the first data pipeline TPIPE component. The data to be synchronized in the database; controlling the first data pipeline TPIPE component to transmit the data to be synchronized in the first database in real time to the second database; wherein the data to be synchronized includes the historical data of the first database and the The first incremental data in the first database, the first data pipeline TPIPE component is used to orderly transmit the data to be synchronized.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的 计算机程序代码,上述程序设计语言包括面向对象的程序设计语言一诸如 Java、 Smalltalk、 C++, 还包括常规的过程式程序设计语言一诸如“C”语言或类似的程 序设计语言。 程序代码可以完全地在用户计算机上执行、 部分地在用户计算机 上执行、 作为一个独立的软件包执行、 部分在用户计算机上部分在远程计算机 上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中, 远程计算机可以通过任意种类的网络 -包括局域网 ( ( Local Area Network, The computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language. The program code may be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server. In the case of a remote computer, the remote computer can pass through any kind of network-including a local area network ((Local Area Network,
LAN )或广域网 ( Wide Area Network, WAN )—连接到用户计算机, 或者, 可 以连接到外部计算机 (例如利用因特网服务提供商来通过因特网连接) 。 LAN) or Wide Area Network (Wide Area Network, WAN)—Connect to a user's computer, or, alternatively, it can be connected to an external computer (for example, using an Internet service provider to connect via the Internet).
附图中的流程图和框图, 图示了按照本公开多种实施例的方法和计算机程 序产品的可能实现的体系架构、 功能和操作。 在这点上, 流程图或框图中的每 个方框可以代表一个模块、 程序段、 或代码的一部分, 该模块、 程序段、 或代 码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。 也应当注 意, 在有些作为替换的实现中, 方框中所标注的功能也可以以不同于附图中所 标注的顺序发生。 例如, 两个接连地表示的方框实际上可以基本并行地执行, 它们有时也可以按相反的顺序执行, 这依所涉及的功能而定。 也要注意的是, 框图和 /或流程图中的每个方框、 以及框图和 /或流程图中的方框的组合, 可以用 执行规定的功能或操作的专用的基于硬件的系统来实现, 或者可以用专用硬件 与计算机指令的组合来实现。 The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation of the system architecture, functions, and operations of the method and computer program product according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code includes one or more for realizing prescribed logical functions Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the blocks may also occur in a different order from the order marked in the drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation Or it can be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块、 单元可以通过软件的方式实现, 也可以通过硬件的方式来实现。 其中, 模块、 单元的名称在某种情况下并不构 成对该模块或单元本身的限定。 The modules and units involved in the described embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the module or unit does not constitute a limitation on the module or unit itself under certain circumstances.

Claims

权 利 要 求 书 Claims
1、 一种数据互通方法, 包括: 1. A data intercommunication method, including:
通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时传输的 待同步数据; Receiving, through the second database, the data to be synchronized that the first database transmits in real time through the first data pipeline TPIPE component;
控制所述第二数据库通过第二数据管道 TPIPE组件向所述第二数据库的从 数据库传输所述第二数据库中的全量数据; Controlling the second database to transmit the full amount of data in the second database to the secondary database of the second database through the second data pipeline TPIPE component;
其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数据和所 述第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有序传输 所述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量数据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the second The local end writes data in the database, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
2、 根据权利要求 1所述的方法, 其中, 所述通过第二数据库接收第一数据 库通过第一数据管道 TPIPE组件实时传输的待同步数据, 包括: 2. The method according to claim 1, wherein the receiving, through the second database, the data to be synchronized which is transmitted in real time by the first database through the TPIPE component of the first data pipeline comprises:
在满足第一同步条件的情况下, 通过第二数据库的第一双写组件接收第一 数据库通过第一数据管道 TPIPE组件实时传输的待同步数据, 控制所述第二数 据库接收所述第二数据库的第一双写组件写入的所述第一数据库实时传输的待 同步数据。 In the case that the first synchronization condition is met, the first dual-write component of the second database receives the data to be synchronized that the first database transmits in real time through the first data pipeline TPIPE component, and controls the second database to receive the second database The data to be synchronized for real-time transmission of the first database written by the first dual-write component.
3、 根据权利要求 2所述的方法, 其中, 所述第一同步条件包括下述条件中 的至少一个: 3. The method according to claim 2, wherein the first synchronization condition includes at least one of the following conditions:
接收到第一切换指令; Receiving the first switching instruction;
当前数据同步时间达到预设的第一同步时长阈值; The current data synchronization time reaches the preset first synchronization duration threshold;
已接收到所述第一数据库实时传输所述第一数据库的所有的历史数据; 第二数据库待接收的待同步数据满足预设条件, 其中, 所述预设条件包括 所述待接收的待同步数据的数据量处于预设的阈值范围内。 The first database has been received to transmit all the historical data of the first database in real time; the to-be-synchronized data to be received by the second database satisfies a preset condition, where the preset condition includes the to-be-synchronized to be received The amount of data is within a preset threshold range.
4、 根据权利要求 2或 3所述的方法, 还包括: 4. The method according to claim 2 or 3, further comprising:
在满足第二同步条件的情况下, 控制所述第二数据库通过所述第一双写组 件向所述第二数据库的从数据库中写入所述第二数据库中的第二增量数据。 When the second synchronization condition is satisfied, the second database is controlled to write the second incremental data in the second database into the secondary database of the second database through the first dual-write component.
5、 根据权利要求 4所述的方法, 还包括: 5. The method according to claim 4, further comprising:
控制所述第二数据库接收所述第二数据库的从数据库通过所述第二数据库 的从数据库的第二双写组件写入的所述从数据库的第三增量数据。 The second database is controlled to receive the third incremental data of the slave database written by the slave database of the second database through the second double-write component of the slave database of the second database.
6、 根据权利要求 1-5任一项所述的方法, 还包括: 6. The method according to any one of claims 1-5, further comprising:
在所述从数据库接收到用户的访问请求的情况下, 根据所述用户的属性信 息确定所述用户的访问权限。 In a case where the user's access request is received from the database, the user's access authority is determined according to the attribute information of the user.
7、 一种数据互通方法, 包括: 7. A data intercommunication method, including:
控制第一数据库向第一数据管道 TPIPE组件传输所述第一数据库的待同步 数据; Controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
控制所述第一数据管道 TPIPE组件向第二数据库实时传输所述第一数据库 的待同步数据; Controlling the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the second database in real time;
其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据, 所述第一数据管道 TPIPE组件用于有序传输所述待同步数 据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the first data pipeline TPIPE component is used for orderly transmitting the data to be synchronized.
8、 根据权利要求 7所述的方法, 其中, 所述控制第一数据库向第一数据管 道 TPIPE组件传输所述第一数据库的待同步数据, 包括: 8. The method according to claim 7, wherein the controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component comprises:
控制第一数据库向第一数据管道 TPIPE组件实时传输所述第一数据库的历 史数据; Controlling the first database to transmit the historical data of the first database to the first data pipeline TPIPE component in real time;
在所述第一数据库接收到双写组件写入所述第一数据库的第一增量数据的 情况下, 控制所述第一数据库向所述第一数据管道 TPIPE组件实时传输所述第 一增量数据。 When the first database receives the first incremental data written by the dual-write component to the first database, control the first database to transmit the first incremental data to the first data pipeline TPIPE component in real time量数据。 Volume data.
9、 根据权利要求 7所述的方法, 其中, 控制所述第一数据管道 TPIPE组件 向第二数据库实时传输所述第一数据库的待同步数据, 包括: 9. The method according to claim 7, wherein the controlling the TPIPE component of the first data pipeline to transmit the data to be synchronized of the first database to the second database in real time comprises:
在满足同步条件的情况下, 控制所述第一数据管道 TPIPE组件向第二数据 库的第一双写组件实时传输所述第一数据库的待同步数据, 控制所述第二数据 库的第一双写组件向所述第二数据库写入所述第一数据库实时传输的待同步数 据。 When the synchronization condition is met, control the first data pipeline TPIPE component to transmit the data to be synchronized in the first database in real time to the first double write component of the second database, and control the first double write of the second database The component writes to the second database the data to be synchronized transmitted in real time by the first database.
10、 根据权利要求 7 所述的方法, 其中, 所述控制第一数据库向第一数据 管道 TPIPE组件传输所述第一数据库的待同步数据, 包括: 10. The method according to claim 7, wherein the controlling the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component comprises:
在第一数据库和第二数据库中的数据不存在数据冲突的情况下, 控制所述 第一数据库向第一数据管道 TPIPE组件传输所述第一数据库的待同步数据。 If there is no data conflict between the data in the first database and the second database, control the first database to transmit the data to be synchronized of the first database to the first data pipeline TPIPE component.
11、 一种数据互通装置, 包括: 11. A data intercommunication device, including:
数据接收模块, 设置为通过第二数据库接收第一数据库通过第一数据管道 TPIPE组件实时传输的待同步数据; A data receiving module, configured to receive, through the second database, the data to be synchronized that the first database transmits in real time through the TPIPE component of the first data pipeline;
全量数据传输模块, 设置为控制所述第二数据库通过第二数据管道 TPIPE 组件向所述第二数据库的从数据库传输所述第二数据库中的全量数据; A full data transmission module, configured to control the second database to transmit the full data in the second database to the second database through the second data pipeline TPIPE component;
其中, 所述待同步数据包括所述第一数据库历史数据和所述第一数据库中 的第一增量数据, 所述全量数据包括所述第一数据库传输的待同步数据和所述 第二数据库中的本端写入数据, 所述第一数据管道 TPIPE组件用于有序传输所 述待同步数据, 所述第二数据管道 TPIPE组件用于有序传输所述全量数据。 Wherein, the data to be synchronized includes the historical data of the first database and the first incremental data in the first database, and the full amount of data includes the data to be synchronized transmitted by the first database and the The local end writes data in the second database, the first data pipe TPIPE component is used to orderly transmit the data to be synchronized, and the second data pipe TPIPE component is used to orderly transmit the full amount of data.
12、 一种数据互通装置, 包括: 12. A data intercommunication device, including:
第一数据传输模块, 设置为控制第一数据库向第一数据管道 TPIPE组件传 输所述第一数据库的待同步数据; The first data transmission module is configured to control the first database to transmit the to-be-synchronized data of the first database to the first data pipeline TPIPE component;
第二数据传输模块, 设置为控制所述第一数据管道 TPIPE组件向第二数据 库实时传输所述第一数据库的待同步数据; The second data transmission module is configured to control the first data pipeline TPIPE component to transmit the to-be-synchronized data of the first database to the second database in real time;
其中, 所述待同步数据包括所述第一数据库的历史数据和所述第一数据库 中的第一增量数据, 所述第一数据管道 TPIPE组件用于有序传输所述待同步数 据。 Wherein, the data to be synchronized includes historical data of the first database and first incremental data in the first database, and the first data pipeline TPIPE component is used for orderly transmitting the data to be synchronized.
13、 一种电子设备, 包括: 13. An electronic device, including:
至少一个处理装置; 存储器, 设置为存储至少一个程序; At least one processing device; a memory, configured to store at least one program;
当所述至少一个程序被所述至少一个处理装置执行, 使得所述至少一个处 理装置实现如权利要求 1-9中任一所述的数据互通方法。 When the at least one program is executed by the at least one processing device, the at least one processing device realizes the data intercommunication method according to any one of claims 1-9.
14、 一种计算机可读存储介质, 存储有计算机程序, 所述计算机程序被处 理器执行时实现如权利要求 1-9中任一所述的数据互通方法。 14. A computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, realizes the data intercommunication method according to any one of claims 1-9.
PCT/CN2020/076050 2019-02-27 2020-02-20 Data interworking method and device, terminal and storage medium WO2020173381A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910146908.6 2019-02-27
CN201910146908.6A CN110083657A (en) 2019-02-27 2019-02-27 Data interchange method, apparatus, terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2020173381A1 true WO2020173381A1 (en) 2020-09-03

Family

ID=67413063

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/076050 WO2020173381A1 (en) 2019-02-27 2020-02-20 Data interworking method and device, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN110083657A (en)
WO (1) WO2020173381A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083657A (en) * 2019-02-27 2019-08-02 北京字节跳动网络技术有限公司 Data interchange method, apparatus, terminal and storage medium
CN111858762A (en) * 2020-07-21 2020-10-30 中冶南方工程技术有限公司 Data storage method and system of full-process quality management system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760552A (en) * 2016-03-25 2016-07-13 北京奇虎科技有限公司 Data management method and device
CN107734017A (en) * 2017-09-30 2018-02-23 平安科技(深圳)有限公司 Data service method and system
EP3312743A1 (en) * 2016-10-24 2018-04-25 Samsung SDS Co., Ltd. Method and system for storing query result in distributed server
CN109325072A (en) * 2018-07-12 2019-02-12 浪潮软件集团有限公司 Method and device for realizing cross-gatekeeper Oracle database synchronization based on CMSP
CN110083657A (en) * 2019-02-27 2019-08-02 北京字节跳动网络技术有限公司 Data interchange method, apparatus, terminal and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10509801B2 (en) * 2013-01-28 2019-12-17 Arris Enterprises Llc Selective data synchronization and transfer to remote distributed database servers
CN105635074A (en) * 2014-11-06 2016-06-01 中兴通讯股份有限公司 Method, server, client and system for realizing data synchronization
CN105574109A (en) * 2015-12-10 2016-05-11 青岛海信传媒网络技术有限公司 Database synchronizing method and equipment and system
CN107391628B (en) * 2017-06-30 2021-04-09 北京奇虎科技有限公司 Data synchronization method and device
CN109299088A (en) * 2018-08-22 2019-02-01 中国平安人寿保险股份有限公司 Mass data storage means, device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760552A (en) * 2016-03-25 2016-07-13 北京奇虎科技有限公司 Data management method and device
EP3312743A1 (en) * 2016-10-24 2018-04-25 Samsung SDS Co., Ltd. Method and system for storing query result in distributed server
CN107734017A (en) * 2017-09-30 2018-02-23 平安科技(深圳)有限公司 Data service method and system
CN109325072A (en) * 2018-07-12 2019-02-12 浪潮软件集团有限公司 Method and device for realizing cross-gatekeeper Oracle database synchronization based on CMSP
CN110083657A (en) * 2019-02-27 2019-08-02 北京字节跳动网络技术有限公司 Data interchange method, apparatus, terminal and storage medium

Also Published As

Publication number Publication date
CN110083657A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
WO2020173248A1 (en) Data synchronization method and device, terminal, and storage medium
WO2020221190A1 (en) Applet state synchronization method, device and computer storage medium
WO2021013242A1 (en) Method for starting mini program, device and computer storage medium
WO2023273725A1 (en) File downloading method and apparatus, storage medium and electronic device
WO2020020202A1 (en) Account management method and apparatus of application program, and device and medium
US9342388B1 (en) Dynamic queue alias
WO2021190557A1 (en) Interaction method and apparatus, and electronic device
WO2021013247A1 (en) Method and device for running applet, and computer storage medium
WO2021169863A1 (en) Multimedia conference data processing method and apparatus, and electronic device
WO2020168878A1 (en) Data caching method and device, terminal, and storage medium
WO2021190129A1 (en) Method and device for page processing, electronic device, and computer-readable storage medium
WO2021073205A1 (en) Video processing method and apparatus, storage medium, and electronic device
WO2023284387A1 (en) Model training method, apparatus, and system based on federated learning, and device and medium
WO2020173381A1 (en) Data interworking method and device, terminal and storage medium
CN109471647B (en) Data updating method and device, electronic equipment and readable medium
WO2021088671A1 (en) Method for calling terminal capability, device, and computer storage medium
US20240126417A1 (en) Method, form data processing method, apparatus, and electronic device for form generation
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
CN111163336B (en) Video resource pushing method and device, electronic equipment and computer readable medium
CN107817962B (en) Remote control method, device, control server and storage medium
US20240146978A1 (en) Functional component loading method and data processing method for video live-streaming, and device
WO2021147466A1 (en) Message processing method and apparatus, and electronic device
WO2021218646A1 (en) Interaction method and apparatus, and electronic device
WO2023124910A1 (en) Data processing method and apparatus, and electronic device and storage medium
WO2023061137A1 (en) Multimedia data processing method and system, and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20762724

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21/01/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20762724

Country of ref document: EP

Kind code of ref document: A1