[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2021174537A1 - Data transmission method and apparatus - Google Patents

Data transmission method and apparatus Download PDF

Info

Publication number
WO2021174537A1
WO2021174537A1 PCT/CN2020/078243 CN2020078243W WO2021174537A1 WO 2021174537 A1 WO2021174537 A1 WO 2021174537A1 CN 2020078243 W CN2020078243 W CN 2020078243W WO 2021174537 A1 WO2021174537 A1 WO 2021174537A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronized
group
wal
data set
Prior art date
Application number
PCT/CN2020/078243
Other languages
French (fr)
Chinese (zh)
Inventor
劳志毅
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2020/078243 priority Critical patent/WO2021174537A1/en
Priority to CN202080097945.3A priority patent/CN115210694A/en
Publication of WO2021174537A1 publication Critical patent/WO2021174537A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Definitions

  • This application relates to the field of electronic technology, in particular to a data transmission method and device.
  • the existing data synchronization technology relies on storage services, such as the structured query language (my structured query language, mysql) itself to ensure the orderliness of the data synchronization process.
  • MySQL is a relational database management system. The database stores data in different tables.
  • the structured query language (SQL) used by mysql is the most commonly used standardized language for accessing the database.
  • the order of data synchronization is achieved by giving a globally unique order mark.
  • the data transmission process relies on the globally unique order mark, so that the input and output of the data are synchronized in a single thread, which affects the efficiency of the data transmission process.
  • the embodiments of the present application provide a data transmission method and device, which can ensure that data is not lost during the synchronization transmission of data and improve the efficiency of data transmission.
  • an embodiment of the present application provides a data transmission method, which is applied to a subscriber device in a data transmission system, the data transmission system further includes a source device, a consumer device, and a target device, and the method includes:
  • the data set to be synchronized is transmitted to the consumer device in a two-phase commit method, and the consumer device is instructed to hash the data set to be synchronized into multiple files in the WAL, and the multiple A file is transferred to the target device.
  • an embodiment of the present application provides a data transmission method, which is applied to a consumer device in a data transmission system.
  • the data transmission system further includes a source device, a subscriber device, and a target device.
  • the method includes:
  • an embodiment of the present application provides a data transmission device, which is applied to a subscribing device in a data transmission system.
  • the data transmission system further includes a source device, a consumer device, and a target device.
  • the data transmission The device includes:
  • the first obtaining unit is configured to obtain a data set to be synchronized from the source device
  • the first transmission unit is configured to transmit the to-be-synchronized data set to the consumer device in a two-phase commit method, and instruct the consumer-end device to hash the to-be-synchronized data set to multiple files of WAL And transfer the multiple files to the target device.
  • an embodiment of the present application provides a data transmission device, which is applied to a consumer device in a data transmission system.
  • the data transmission system further includes a source device, a subscriber device, and a target device.
  • the data transmission The device includes:
  • a receiving unit configured to receive a data set to be synchronized transmitted by the subscribing end device in a two-phase commit manner, where the data set to be synchronized is data obtained by the subscribing end device from the source device;
  • the hash unit is used to hash the data set to be synchronized into multiple files of the WAL;
  • the second transmission unit is configured to transmit the multiple files to the target device.
  • an embodiment of the present application provides a subscription terminal device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by
  • the foregoing processor executes, and the foregoing program includes instructions for executing the steps in the first aspect of the embodiments of the present application.
  • embodiments of the present application provide a consumer device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by The foregoing processor executes, and the foregoing program includes instructions for executing the steps in the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute Some or all of the steps described in one aspect.
  • the embodiments of the present application provide a computer program product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to cause a computer to execute as implemented in this application.
  • the computer program product may be a software installation package.
  • FIG. 1A is a schematic structural diagram of a data transmission system for implementing a data transmission method according to an embodiment of the present application
  • FIG. 1B is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of another data transmission method disclosed in an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of another data transmission method disclosed in an embodiment of the present application.
  • Fig. 4A is a schematic structural diagram of another subscriber device disclosed in an embodiment of the present application.
  • FIG. 4B is a schematic structural diagram of another consumer device disclosed in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application.
  • FIG. 6A is a schematic structural diagram of another data transmission device disclosed in an embodiment of the present application.
  • FIG. 6B is a modified structure of the data transmission device shown in FIG. 6A disclosed in an embodiment of the present application.
  • mysql is a relational database management system. Relational databases store data in different tables.
  • Two-phase commit An algorithm for maintaining consistency when committing transactions to all nodes based on a distributed system architecture.
  • WAL Write-Ahead Logging
  • the data transmission method provided in the embodiment of the present application is suitable for the scenario of synchronous data transmission across computer rooms.
  • FIG. 1A is a schematic structural diagram of a data transmission system for implementing a data transmission method according to an embodiment of the present invention.
  • the data transmission system may include a source device 1001, a subscriber device 1002, a consumer device 1003, and a target device 1004.
  • the source device is the device of the data publisher, the subscriber device is the device of the data subscriber, and the consumer device is The device is the device of the data consumer, the target device is the device of the data synchronization storage side, the source device is connected to the subscribing device, the subscribing device is also connected to the consumer device, and the consumer device is also connected to the target device.
  • the end device 1001, the subscribing end device 1002, the consumer end device 1003, and the target end device 1004 respectively correspond to different computer rooms.
  • the remote device can transmit the data to be synchronized to the subscribing device, and the subscribing device will transmit the data to be synchronized to the consumer device in a two-phase commit method.
  • the consumer device hashes the set of data to be synchronized into multiple files in the WAL, and transmits the multiple files to the target device, thereby realizing synchronized data transmission across computer rooms and ensuring multiple locations Data can be synchronized between different computer rooms.
  • the to-be-synchronized data set may include at least one to-be-synchronized data.
  • FIG. 1B is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application.
  • Terminal device the data transmission method includes the following steps:
  • the remote device when there is data to be synchronized that needs to be synchronously transmitted in the remote device, can transmit the to-be-synchronized data set including at least one data to be synchronized to the subscribing device, so that the subscribing device can download from the source The device obtains the data collection to be synchronized.
  • the obtaining the data set to be synchronized from the source device may include the following steps:
  • each to-be-synchronized data in the to-be-synchronized data set carries a sequence identifier used to characterize the transmission sequence, so that the sequence identifier corresponding to each to-be-synchronized data in the to-be-synchronized data set can be identified
  • the data set to be synchronized transmitted by the source device can be obtained through a single thread, and the data to be synchronized can be obtained in a time sequence represented by the sequence identifier.
  • both the subscribing device and the consumer device can determine whether their operations are successful, but they cannot determine whether the operations of other devices are successful.
  • the subscribing device can send to the consumer device in the first stage whether it is OK Execute the query message for sending the data set to be synchronized. If the subscribing device receives the feedback message from the consumer device within the preset time, it enters the second stage.
  • the subscribing device transmits the data set to be synchronized to the consumer If the subscribing device does not receive a feedback message from the consumer device within a preset time, the subscribing device sends a rollback message to the consumer device, thereby ensuring that the data set to be synchronized is successfully transmitted to Consumer equipment.
  • the subscribing device can instruct the consumer device to hash the data set to be synchronized into multiple files in the WAL, and transfer the multiple files to the target device, so that multiple files can be transferred to the WAL The way of data collection to be synchronized improves the efficiency of synchronized data transmission.
  • the data transmission method described in the embodiments of this application obtains the data set to be synchronized from the source device; transmits the data set to be synchronized to the consumer device in a two-phase commit method, and instructs the consumer device to
  • the data set to be synchronized is hashed to multiple files in the WAL, and the multiple files are transferred to the target device.
  • the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the data to be synchronized
  • the collection is successfully transmitted, and the data collection to be synchronized is transmitted through multiple files of WAL, thereby improving the efficiency of data synchronization transmission.
  • FIG. 2 is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application.
  • the data transmission method is applied to a consumer device in a data transmission system.
  • the data transmission system further includes a source device, a subscriber device, and a target device.
  • the data transmission method includes the following steps:
  • both the subscribing device and the consumer device can determine whether their operations are successful, but they cannot determine whether the operations of other devices are successful.
  • the subscribing device can send to the consumer device in the first stage whether it is OK Execute the query message for sending the data set to be synchronized. If the subscribing device receives the feedback message from the consumer device within the preset time, it enters the second stage.
  • the subscribing device transmits the data set to be synchronized to the consumer If the subscribing device does not receive the feedback message from the consumer device within a preset time, the subscribing device sends a rollback message to the consumer device, thereby ensuring that the consumer device successfully receives the pending synchronization Data collection.
  • WAL can improve the efficiency of non-memory data and ensure data integrity. Therefore, by using WAL to store the to-be-synchronized data in the to-be-synchronized data set, hash the to-be-synchronized data set into multiple files in the WAL, and then transfer the multiple files in the WAL to the target device, the synchronization data transmission can be improved efficient. Specifically, the data in the data set to be synchronized can be written into multiple files through multiple data transmission channels, so that the disk input and output usage rate can be increased, and the file writing rate can be increased.
  • the to-be-synchronized data set includes multiple to-be-synchronized data, and each of the to-be-synchronized data corresponds to one piece of routing information.
  • the to-be-synchronized data set is hashed into multiple files of WAL , Can include the following steps:
  • the above-mentioned routing information may be the device identification of the routing device corresponding to the data to be synchronized.
  • the data to be synchronized with the same routing information can be divided into one group, and then the to-be-synchronized data of each group
  • the data is written into a file corresponding to the group, and further, the to-be-synchronized data of multiple groups can be written into multiple files, and the multiple groups correspond to the multiple files one-to-one.
  • the number of multiple files can be dynamically adjusted according to the routing information, and the number of files is different, the transmission rate of the data to be synchronized is also different, so that the transmission rate of the data set to be synchronized can be dynamically adjusted.
  • writing the to-be-synchronized data of each of the multiple groups into the file corresponding to the group in the WAL to obtain multiple files may include the following steps:
  • all the data to be synchronized in the group i can be divided into multiple sub-groups according to the data type. Specifically, the data to be synchronized with the same data type in the group i are divided into the same sub-group, and further, each The to-be-synchronized data of a sub-group is written into the file corresponding to the sub-group, so that the to-be-synchronized data of the same sub-group can be written into one file.
  • the number of multiple files can be dynamically adjusted according to the data type.
  • the synchronization can be adjusted dynamically.
  • the transmission rate of the data collection is adjusted dynamically.
  • the group i includes m pieces of data to be synchronized.
  • the following steps may be further included:
  • the m type identifiers are counted to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
  • the number n of data types of all data to be synchronized in group i can also be determined. Specifically, the type identifiers of m data to be synchronized in group i can be obtained, and m type identifiers can be obtained. Synchronized data corresponds to a type identifier, and different data to be synchronized may correspond to the same type identifier, or may correspond to different type identifiers, and further, the number n of type identifiers can be counted.
  • the data to be synchronized of each sub-group of the multiple sub-groups of the group i is written into the file corresponding to the sub-group in the WAL to obtain multiple files, which may include the following step:
  • the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
  • the file when the data to be synchronized is written into the file, the file is written sequentially, which can avoid a large amount of disk addressing time, thereby increasing the file writing rate.
  • the consumer device can transfer multiple files to the target device, and through a two-phase submission, it is ensured that the data set to be synchronized at the data source end is consistent with the data transferred to the target device, thereby ensuring that the data set to be synchronized is not lost during the transmission process.
  • transferring the multiple files to the target device may include the following steps:
  • the multiple files are transferred to the target device through multiple asynchronous threads.
  • multiple asynchronous threads are used to transfer multiple files to the target device, which can increase the CPU usage of the consumer device and increase the transfer rate of multiple files.
  • the data transmission method described in the embodiment of the present application receives the data set to be synchronized transmitted by the subscribing device through a two-phase submission method, where the data set to be synchronized is obtained by the subscribing device from the source.
  • Data acquired by the device hash the data set to be synchronized into multiple files in WAL; transfer multiple files to the target device, so that the data set to be synchronized is transmitted to the consumer device through a two-phase commit method, Therefore, it is ensured that the data set to be synchronized is successfully transmitted, and the data set to be synchronized is transmitted through multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
  • FIG. 3 is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application.
  • the data transmission system may include a source device, a subscription device, a consumer device, and a target device.
  • the data transmission method includes the following steps:
  • a source device sends a data set to be synchronized to a subscriber device through a single thread, where the data set to be synchronized includes a plurality of data to be synchronized, and each data to be synchronized corresponds to one piece of routing information.
  • the subscribing device transmits the to-be-synchronized data set to the consumer device in a two-phase commit manner.
  • the consumer device divides the multiple data to be synchronized into multiple groups according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the groups corresponds to the same routing information.
  • the consumer device writes the to-be-synchronized data of each group in the plurality of groups into the file corresponding to the group in the WAL in a manner of sequentially writing files to obtain a plurality of files.
  • the consumer device transmits the multiple files to the target device through multiple asynchronous threads.
  • step 301 to step 305 For the specific description of the above step 301 to step 305, reference may be made to the corresponding description of the data transmission method described in FIG. 1B and FIG. 2, which will not be repeated here.
  • the data transmission method described in the embodiment of this application sends a data set to be synchronized to the subscriber device through a single thread through the source device.
  • the data set to be synchronized includes multiple data to be synchronized, and each data to be synchronized corresponds to
  • the subscribing device transmits the data set to be synchronized to the consumer device in a two-phase commit method, and the consumer device divides the multiple data to be synchronized into multiple groups according to multiple routing information corresponding to the multiple data to be synchronized,
  • the data to be synchronized in each group corresponds to the same routing information.
  • the consumer device writes the data to be synchronized in each group in the multiple groups into the file corresponding to the group in the WAL by writing files in order to obtain multiple File, the consumer device transfers multiple files to the target device through multiple asynchronous threads.
  • the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the successful transmission of the data set to be synchronized.
  • the data set to be synchronized is transmitted to multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
  • FIG. 4A is a schematic structural diagram of a subscribing device disclosed in an embodiment of the present application.
  • the subscribing device includes a processor, a memory, a communication interface, and one or more programs.
  • the above-mentioned one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, and the above-mentioned programs include instructions for executing the following steps:
  • the data set to be synchronized is transmitted to the consumer device through a two-phase commit method, and the consumer device is instructed to hash the data set to be synchronized into multiple files of the pre-write log WAL, and Transferring the multiple files to the target device.
  • the above program is specifically used to execute the instructions of the following steps:
  • FIG. 4B is a schematic structural diagram of a consumer device disclosed in an embodiment of the present application.
  • the consumer device includes a processor, a memory, a communication interface, and one or more programs.
  • the above-mentioned one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, and the above-mentioned programs include instructions for executing the following steps:
  • the to-be-synchronized data set includes a plurality of to-be-synchronized data, and each of the to-be-synchronized data corresponds to a piece of routing information, and in the step of hashing the to-be-synchronized data set to multiple files of WAL
  • the above program includes instructions for performing the following steps:
  • the above-mentioned program includes a method for executing Instructions for the following steps:
  • the packet i includes m data to be synchronized
  • the above program further includes instructions for executing the following steps:
  • the m type identifiers are counted to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
  • the above-mentioned program includes: Step instructions:
  • the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
  • an electronic device includes hardware structures and/or software modules corresponding to each function.
  • this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the electronic device into functional units according to the foregoing method examples.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 5 is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application.
  • Terminal equipment the data transmission apparatus includes a first acquisition unit 501 and a first transmission unit 502, wherein,
  • the first obtaining unit 501 is configured to obtain a data set to be synchronized from the source device;
  • the first transmission unit 502 is configured to transmit the data set to be synchronized to the consumer device in a two-phase commit method, and instruct the consumer device to hash the data set to be synchronized to the WAL Multiple files, and transfer the multiple files to the target device.
  • the first acquiring unit 501 is specifically configured to:
  • the data transmission device described in the embodiment of this application obtains the data set to be synchronized from the source device; transmits the data set to be synchronized to the consumer device in a two-phase commit method, and instructs the consumer device to
  • the data set to be synchronized is hashed to multiple files in the WAL, and the multiple files are transferred to the target device.
  • the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the data to be synchronized
  • the collection is successfully transmitted, and the data collection to be synchronized is transmitted through multiple files of WAL, thereby improving the efficiency of data synchronization transmission.
  • each “unit” may be, for example, an integrated circuit ASIC, a single circuit, used to execute one or more software or firmware.
  • Program processor shared, dedicated or chipset
  • memory combinatorial logic circuit, and/or provide other suitable components for realizing the above-mentioned functions.
  • the first acquisition unit 501 and the first transmission unit 502 may be a control circuit or a processor.
  • FIG. 6A is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application, which is applied to a consumer device in a data transmission system.
  • the data transmission system also includes a source device, a subscriber device, and a target.
  • a terminal device, the data transmission apparatus includes a receiving unit 601, a hashing unit 602, and a second transmission unit 603, where:
  • the receiving unit 601 is configured to receive the to-be-synchronized data set transmitted by the subscribing end device in a two-phase commit method, where the to-be-synchronized data set is obtained by the subscribing end device from the source end device The data;
  • the hashing unit 602 is configured to hash the to-be-synchronized data set into multiple files of WAL;
  • the second transmission unit 603 is configured to transmit the multiple files to the target device.
  • the to-be-synchronized data set includes a plurality of to-be-synchronized data, and each of the to-be-synchronized data corresponds to one piece of routing information.
  • the hash unit 602 is specifically configured to:
  • the hashing unit is specifically used for:
  • the packet i includes m data to be synchronized, as shown in FIG. 6B.
  • FIG. 6B is a modified structure of the data transmission device shown in FIG. 6A. Compared with FIG. 6A, it may further include: a second acquiring unit 604 and statistical unit 605, of which,
  • the second obtaining unit 604 is configured to obtain the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
  • the statistics unit 605 is configured to count the m type identifiers to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
  • the hash unit is specifically used for:
  • the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
  • the second transmission unit is specifically configured to:
  • the multiple files are transferred to the target device through multiple asynchronous threads.
  • the data transmission device described in the embodiment of the present application receives the data set to be synchronized transmitted by the subscribing end device in a two-phase submission manner, where the data set to be synchronized is obtained by the subscribing device from the source end.
  • the data acquired by the device hash the data set to be synchronized into multiple files in the WAL; transfer multiple files to the target device, so that the data set to be synchronized is transmitted to the consumer device through a two-phase commit method, Therefore, it is ensured that the data set to be synchronized is successfully transmitted, and the data set to be synchronized is transmitted through multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
  • each "unit” may be, for example, an integrated circuit ASIC, a single circuit, used to execute one or more software or firmware.
  • Program processor shared, dedicated or chipset
  • memory combinatorial logic circuit, and/or provide other suitable components for realizing the above-mentioned functions.
  • the receiving unit 601, the hashing unit 602, the second transmission unit 603, the second acquisition unit 604, and the statistics unit 605 may be a control circuit or a processor.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute a part of any data transmission method as described in the above method embodiment. Or all steps.
  • the embodiments of the present application also provide a computer program product.
  • the computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the computer program is operable to cause a computer to execute the method described in the foregoing method embodiment. Part or all of the steps of any data transmission method.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program modules.
  • the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory.
  • a number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned memory includes: U disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), mobile hard disk, magnetic disk, or optical disk and other media that can store program codes.
  • the program can be stored in a computer-readable memory, and the memory can include: a flash disk , ROM, RAM, magnetic disk or CD, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed are a data transmission method and apparatus, which are applied to a subscriber device in a data transmission system. The data transmission system further comprises a source device, a consumer device and a target device. The method comprises: acquiring, from a source device, a data set to be synchronized; and transmitting said data set to a consumer device by means of two-phase commit, and instructing the consumer device to hash said data set into multiple files of a WAL and transmitting the multiple files to a target device. Therefore, a data set to be synchronized is transmitted to a consumer device by means of two-phase commit, thereby ensuring the successful transmission of the data set to be synchronized. Moreover, a data set to be synchronized is transmitted to multiple files of a WAL, thereby improving the synchronous transmission efficiency of data.

Description

数据传输方法及装置Data transmission method and device 技术领域Technical field
本申请涉及电子技术领域,具体涉及一种数据传输方法及装置。This application relates to the field of electronic technology, in particular to a data transmission method and device.
背景技术Background technique
现有数据同步技术中,依赖于存储服务,如结构化查询语言(my structured query language,mysql)自身机制,来保证数据同步过程中的有序性,mysql是一种关系型数据库管理系统,关系数据库将数据保存在不同的表中,mysql所使用的结构化查询语言(structured query language,SQL)是用于访问数据库的最常用标准化语言。在同步过程中,通过给予一个全局唯一的有序标记,来达到数据同步的有序性。The existing data synchronization technology relies on storage services, such as the structured query language (my structured query language, mysql) itself to ensure the orderliness of the data synchronization process. MySQL is a relational database management system. The database stores data in different tables. The structured query language (SQL) used by mysql is the most commonly used standardized language for accessing the database. In the synchronization process, the order of data synchronization is achieved by giving a globally unique order mark.
但是,由于过于依赖存储服务自身特点,数据传输过程中依赖全局唯一有序标记,从而数据的输入、输出均为单线程同步,影响数据传输过程中的效率。However, due to the excessive reliance on the characteristics of the storage service itself, the data transmission process relies on the globally unique order mark, so that the input and output of the data are synchronized in a single thread, which affects the efficiency of the data transmission process.
发明内容Summary of the invention
本申请实施例提供了一种数据传输方法及装置,能够在数据同步传输的过程中,保证数据不丢失,以及提高数据传输效率。The embodiments of the present application provide a data transmission method and device, which can ensure that data is not lost during the synchronization transmission of data and improve the efficiency of data transmission.
第一方面,本申请实施例提供一种数据传输方法,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,所述方法包括:In the first aspect, an embodiment of the present application provides a data transmission method, which is applied to a subscriber device in a data transmission system, the data transmission system further includes a source device, a consumer device, and a target device, and the method includes:
从所述源端设备获取待同步数据集合;Acquiring a data set to be synchronized from the source device;
通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The data set to be synchronized is transmitted to the consumer device in a two-phase commit method, and the consumer device is instructed to hash the data set to be synchronized into multiple files in the WAL, and the multiple A file is transferred to the target device.
第二方面,本申请实施例提供一种数据传输方法,应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备, 所述方法包括:In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a consumer device in a data transmission system. The data transmission system further includes a source device, a subscriber device, and a target device. The method includes:
通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;Receiving the to-be-synchronized data set transmitted by the subscribing end device in a two-phase commit method, where the to-be-synchronized data set is data obtained by the subscribing end device from the source end device;
将所述待同步数据集合散列至WAL的多个文件中;Hash the to-be-synchronized data set into multiple files of WAL;
将所述多个文件传输至所述目标端设备中。Transferring the multiple files to the target device.
第三方面,本申请实施例提供了一种数据传输装置,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,所述数据传输装置包括:In a third aspect, an embodiment of the present application provides a data transmission device, which is applied to a subscribing device in a data transmission system. The data transmission system further includes a source device, a consumer device, and a target device. The data transmission The device includes:
第一获取单元,用于从所述源端设备获取待同步数据集合;The first obtaining unit is configured to obtain a data set to be synchronized from the source device;
第一传输单元,用于通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The first transmission unit is configured to transmit the to-be-synchronized data set to the consumer device in a two-phase commit method, and instruct the consumer-end device to hash the to-be-synchronized data set to multiple files of WAL And transfer the multiple files to the target device.
第四方面,本申请实施例提供了一种数据传输装置,应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备,所述数据传输装置包括:In a fourth aspect, an embodiment of the present application provides a data transmission device, which is applied to a consumer device in a data transmission system. The data transmission system further includes a source device, a subscriber device, and a target device. The data transmission The device includes:
接收单元,用于通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;A receiving unit, configured to receive a data set to be synchronized transmitted by the subscribing end device in a two-phase commit manner, where the data set to be synchronized is data obtained by the subscribing end device from the source device;
散列单元,用于将所述待同步数据集合散列至WAL的多个文件中;The hash unit is used to hash the data set to be synchronized into multiple files of the WAL;
第二传输单元,用于将所述多个文件传输至所述目标端设备中。The second transmission unit is configured to transmit the multiple files to the target device.
第五方面,本申请实施例提供一种订阅端设备,包括处理器、存储器、通信接口,以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面中的步骤的指令。In a fifth aspect, an embodiment of the present application provides a subscription terminal device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by The foregoing processor executes, and the foregoing program includes instructions for executing the steps in the first aspect of the embodiments of the present application.
第六方面,本申请实施例提供一种消费端设备,包括处理器、存储器、通信接口,以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面中的步骤的指令。In a sixth aspect, embodiments of the present application provide a consumer device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by The foregoing processor executes, and the foregoing program includes instructions for executing the steps in the first aspect of the embodiments of the present application.
第七方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面中所描述的部分或全部步骤。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute Some or all of the steps described in one aspect.
第八方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。In an eighth aspect, the embodiments of the present application provide a computer program product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to cause a computer to execute as implemented in this application. Example part or all of the steps described in the first aspect. The computer program product may be a software installation package.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1A是本申请实施例提供的一种用于实现数据传输方法的数据传输系统的架构示意图;FIG. 1A is a schematic structural diagram of a data transmission system for implementing a data transmission method according to an embodiment of the present application;
图1B是本申请实施例公开的一种数据传输方法的流程示意图;FIG. 1B is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application;
图2是本申请实施例公开的另一种数据传输方法的流程示意图;FIG. 2 is a schematic flowchart of another data transmission method disclosed in an embodiment of the present application;
图3是本申请实施例公开的另一种数据传输方法的流程示意图;FIG. 3 is a schematic flowchart of another data transmission method disclosed in an embodiment of the present application;
图4A是本申请实施例公开的另一种订阅端设备的结构示意图;Fig. 4A is a schematic structural diagram of another subscriber device disclosed in an embodiment of the present application;
图4B是本申请实施例公开的另一种消费端设备的结构示意图;4B is a schematic structural diagram of another consumer device disclosed in an embodiment of the present application;
图5是本申请实施例公开的一种数据传输装置的结构示意图;FIG. 5 is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application;
图6A是本申请实施例公开的另一种数据传输装置的结构示意图;6A is a schematic structural diagram of another data transmission device disclosed in an embodiment of the present application;
图6B是本申请实施例公开的图6A所示的数据传输装置的变型结构。FIG. 6B is a modified structure of the data transmission device shown in FIG. 6A disclosed in an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请 中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific sequence. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent to these processes, methods, products or equipment.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。The reference to "embodiments" herein means that a specific feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art clearly and implicitly understand that the embodiments described herein can be combined with other embodiments.
为了便于更好的理解本发明所描述的技术方案,下面对本发明实施例所涉及的技术术语进行解释:In order to facilitate a better understanding of the technical solutions described in the present invention, the technical terms involved in the embodiments of the present invention are explained below:
mysql:是一种关系数据库管理系统,关系数据库将数据保存在不同的表中。mysql: is a relational database management system. Relational databases store data in different tables.
两阶段提交(two phase commit,2PC):为了使基于分布式系统架构下的所有节点在进行事务提交时保持一致性的一种算法。Two-phase commit (2PC): An algorithm for maintaining consistency when committing transactions to all nodes based on a distributed system architecture.
预写式日志(Write-Ahead Logging,WAL):一种高效的日志算法,对于非内存数据库而言,磁盘I/O操作是数据库效率的一大瓶颈。在相同的数据量下,采用WAL的数据库系统在事务提交时,磁盘写操作只有传统的回滚日志的一半左右,大大提高了数据库磁盘I/O操作的效率,从而提高了数据库的性能。Write-Ahead Logging (WAL): An efficient logging algorithm. For non-memory databases, disk I/O operations are a major bottleneck for database efficiency. Under the same amount of data, when a transaction is committed in a database system using WAL, disk write operations are only about half of the traditional rollback log, which greatly improves the efficiency of database disk I/O operations, thereby improving database performance.
下面对本申请实施例进行详细介绍。The following describes the embodiments of the application in detail.
本申请实施例提供的数据传输方法适用于跨机房数据同步传输的场景。请参见图1A,是本发明实施例提供的一种用于实现数据传输方法的数据传输系统的架构示意图。该数据传输系统可以包括源端设备1001、订阅端设备1002、 消费端设备1003和目标端设备1004,其中,源端设备是数据发布方的设备,订阅端设备是数据订阅方的设备,消费端设备是数据消费方的设备,目标端设备是数据同步存储方的设备,源端设备与订阅端设备连接,订阅端设备还与消费端设备连接,消费端设备还与目标端设备连接,上述源端设备1001、订阅端设备1002、消费端设备1003和目标端设备1004分别对应不同的机房。在源端设备有需要同步传输的待同步数据集合时,远端设备可将待同步数据传输集合至订阅端设备,订阅端设备通过两阶段提交的方式将待同步数据集合同步传输至消费端设备,进而,消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将多个文件传输至目标端设备中,从而,可实现跨机房的同步数据传输,保证多个地方的不同机房之间数据能够同步。其中,待同步数据集合中可包括至少一个待同步数据。The data transmission method provided in the embodiment of the present application is suitable for the scenario of synchronous data transmission across computer rooms. Please refer to FIG. 1A, which is a schematic structural diagram of a data transmission system for implementing a data transmission method according to an embodiment of the present invention. The data transmission system may include a source device 1001, a subscriber device 1002, a consumer device 1003, and a target device 1004. The source device is the device of the data publisher, the subscriber device is the device of the data subscriber, and the consumer device is The device is the device of the data consumer, the target device is the device of the data synchronization storage side, the source device is connected to the subscribing device, the subscribing device is also connected to the consumer device, and the consumer device is also connected to the target device. The end device 1001, the subscribing end device 1002, the consumer end device 1003, and the target end device 1004 respectively correspond to different computer rooms. When the source device has a set of data to be synchronized that needs to be transmitted synchronously, the remote device can transmit the data to be synchronized to the subscribing device, and the subscribing device will transmit the data to be synchronized to the consumer device in a two-phase commit method. , And then, the consumer device hashes the set of data to be synchronized into multiple files in the WAL, and transmits the multiple files to the target device, thereby realizing synchronized data transmission across computer rooms and ensuring multiple locations Data can be synchronized between different computer rooms. Wherein, the to-be-synchronized data set may include at least one to-be-synchronized data.
请参阅图1B,图1B是本申请实施例公开的一种数据传输方法的流程示意图,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,该数据传输方法包括如下步骤:Please refer to FIG. 1B. FIG. 1B is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application. Terminal device, the data transmission method includes the following steps:
101、从源端设备获取待同步数据集合。101. Obtain a data set to be synchronized from the source device.
本申请实施例中,远端设备中存在需要进行同步传输的待同步数据时,远端设备可将包括至少一个待同步数据的待同步数据集合传输至订阅设备,从而,订阅设备可从源端设备获取待同步数据集合。In the embodiment of the present application, when there is data to be synchronized that needs to be synchronously transmitted in the remote device, the remote device can transmit the to-be-synchronized data set including at least one data to be synchronized to the subscribing device, so that the subscribing device can download from the source The device obtains the data collection to be synchronized.
可选地,上述步骤101中,所述从所述源端设备获取待同步数据集合,可包括如下步骤:Optionally, in the above step 101, the obtaining the data set to be synchronized from the source device may include the following steps:
通过单线程获取所述源端设备传输的所述待同步数据集合。Acquire the to-be-synchronized data set transmitted by the source device through a single thread.
其中,在进行数据同步传输时,待同步数据集合中的每一个待同步数据都携带一个用于表征传输顺序的顺序标识,从而,可按照待同步数据集合中每一个待同步数据对应的顺序标识有序地通过单线程获取源端设备传输的每一个待同步数据。具体地,通过单线程获取源端设备传输的待同步数据集合,可按照顺序标识表征的时间顺序获取待同步数据。Wherein, during data synchronization transmission, each to-be-synchronized data in the to-be-synchronized data set carries a sequence identifier used to characterize the transmission sequence, so that the sequence identifier corresponding to each to-be-synchronized data in the to-be-synchronized data set can be identified Obtain each data to be synchronized transmitted by the source device in an orderly manner through a single thread. Specifically, the data set to be synchronized transmitted by the source device can be obtained through a single thread, and the data to be synchronized can be obtained in a time sequence represented by the sequence identifier.
102、通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设 备,并指示所述消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。102. Transmit the to-be-synchronized data set to the consumer device in a two-phase commit method, and instruct the consumer-end device to hash the to-be-synchronized data set into multiple files in the WAL, and combine all The multiple files are transferred to the target device.
其中,订阅端设备和消费端设备都可以确定自身的操作是否成功,但无法确定其他设备的操作是否成功,通过两阶段提交的方式,订阅端设备可在第一阶段向消费端设备发送是否可以执行发送待同步数据集合的询问消息,若订阅端设备在预设时间内接收到来自消费端设备的反馈消息,进入第二阶段,在第二阶段,订阅端设备将待同步数据集合传输到消费端设备,若订阅端设备在预设时间内未接收到来自消费端设备的反馈消息,则订阅端设备向消费端设备发送回滚(rollback)消息,从而,可保证待同步数据集合成功传输至消费端设备。订阅端设备可指示消费端设备将待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中,从而,可通过对WAL的多个文件传输待同步数据集合的方式提高同步数据传输效率。Among them, both the subscribing device and the consumer device can determine whether their operations are successful, but they cannot determine whether the operations of other devices are successful. Through the two-phase submission method, the subscribing device can send to the consumer device in the first stage whether it is OK Execute the query message for sending the data set to be synchronized. If the subscribing device receives the feedback message from the consumer device within the preset time, it enters the second stage. In the second stage, the subscribing device transmits the data set to be synchronized to the consumer If the subscribing device does not receive a feedback message from the consumer device within a preset time, the subscribing device sends a rollback message to the consumer device, thereby ensuring that the data set to be synchronized is successfully transmitted to Consumer equipment. The subscribing device can instruct the consumer device to hash the data set to be synchronized into multiple files in the WAL, and transfer the multiple files to the target device, so that multiple files can be transferred to the WAL The way of data collection to be synchronized improves the efficiency of synchronized data transmission.
可以看出,本申请实施例中所描述的数据传输方法,通过从源端设备获取待同步数据集合;通过两阶段提交的方式将待同步数据集合传输到消费端设备,并指示消费端设备将待同步数据集合散列至WAL的多个文件中,并将多个文件传输至目标端设备中,如此,通过两阶段提交的方式将待同步数据集合传输到消费端设备,从而保证待同步数据集合成功传输,以及,通过对WAL的多个文件传输待同步数据集合,从而提高数据同步传输效率。It can be seen that the data transmission method described in the embodiments of this application obtains the data set to be synchronized from the source device; transmits the data set to be synchronized to the consumer device in a two-phase commit method, and instructs the consumer device to The data set to be synchronized is hashed to multiple files in the WAL, and the multiple files are transferred to the target device. In this way, the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the data to be synchronized The collection is successfully transmitted, and the data collection to be synchronized is transmitted through multiple files of WAL, thereby improving the efficiency of data synchronization transmission.
与上述一致地,图2是本申请实施例公开的一种数据传输方法的流程示意图。数据传输方法应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备,该数据传输方法包括如下步骤:Consistent with the above, FIG. 2 is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application. The data transmission method is applied to a consumer device in a data transmission system. The data transmission system further includes a source device, a subscriber device, and a target device. The data transmission method includes the following steps:
201、通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据。201. Receive a data set to be synchronized transmitted by the subscribing end device in a two-phase commit method, where the data set to be synchronized is data obtained by the subscribing end device from the source device.
其中,订阅端设备和消费端设备都可以确定自身的操作是否成功,但无法确定其他设备的操作是否成功,通过两阶段提交的方式,订阅端设备可在第一阶段向消费端设备发送是否可以执行发送待同步数据集合的询问消息,若订阅 端设备在预设时间内接收到来自消费端设备的反馈消息,进入第二阶段,在第二阶段,订阅端设备将待同步数据集合传输到消费端设备,若订阅端设备在预设时间内未接收到来自消费端设备的反馈消息,则订阅端设备向消费端设备发送回滚(rollback)消息,从而,可保证消费端设备成功接收待同步数据集合。Among them, both the subscribing device and the consumer device can determine whether their operations are successful, but they cannot determine whether the operations of other devices are successful. Through the two-phase submission method, the subscribing device can send to the consumer device in the first stage whether it is OK Execute the query message for sending the data set to be synchronized. If the subscribing device receives the feedback message from the consumer device within the preset time, it enters the second stage. In the second stage, the subscribing device transmits the data set to be synchronized to the consumer If the subscribing device does not receive the feedback message from the consumer device within a preset time, the subscribing device sends a rollback message to the consumer device, thereby ensuring that the consumer device successfully receives the pending synchronization Data collection.
202、将所述待同步数据集合散列至WAL的多个文件中。202. Hash the to-be-synchronized data set into multiple files in the WAL.
其中,WAL可以为非内存型数据提升极高的效率,而且保证数据完整性。因此,通过使用WAL存储待同步数据集合中的待同步数据,将待同步数据集合散列至WAL的多个文件中,然后将WAL中的多个文件传输至目标端设备,可提高同步数据传输效率。具体地,可将待同步数据集合中的数据通过多个数据传输通道写入多个文件中,从而,可加大磁盘输入输出使用率,提高写文件的速率。Among them, WAL can improve the efficiency of non-memory data and ensure data integrity. Therefore, by using WAL to store the to-be-synchronized data in the to-be-synchronized data set, hash the to-be-synchronized data set into multiple files in the WAL, and then transfer the multiple files in the WAL to the target device, the synchronization data transmission can be improved efficient. Specifically, the data in the data set to be synchronized can be written into multiple files through multiple data transmission channels, so that the disk input and output usage rate can be increased, and the file writing rate can be increased.
可选地,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息,上述步骤202中,将所述待同步数据集合散列至WAL的多个文件中,可包括如下步骤:Optionally, the to-be-synchronized data set includes multiple to-be-synchronized data, and each of the to-be-synchronized data corresponds to one piece of routing information. In the above step 202, the to-be-synchronized data set is hashed into multiple files of WAL , Can include the following steps:
21、根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息;21. Divide the multiple data to be synchronized into multiple groups according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the groups corresponds to the same routing information;
22、将所述多个分组中每一分组的待同步数据写入所述WAL中与该分组对应的文件,得到多个文件。22. Write the to-be-synchronized data of each group in the plurality of groups into the file corresponding to the group in the WAL to obtain a plurality of files.
其中,上述路由信息可以是待同步数据对应的路由设备的设备标识,根据待同步数据的路由信息,可将具有相同路由信息的待同步数据划分至一个分组,然后,将每一分组的待同步数据写入与该分组对应的一个文件,进而,多个分组的待同步数据可写入多个文件中,多个分组与多个文件一一对应。如此,可根据路由信息对多个文件的数量进行动态调整,文件数量不同,待同步数据的传输速率也不同,从而,可动态调整调整待同步数据集合的传输速率。Wherein, the above-mentioned routing information may be the device identification of the routing device corresponding to the data to be synchronized. According to the routing information of the data to be synchronized, the data to be synchronized with the same routing information can be divided into one group, and then the to-be-synchronized data of each group The data is written into a file corresponding to the group, and further, the to-be-synchronized data of multiple groups can be written into multiple files, and the multiple groups correspond to the multiple files one-to-one. In this way, the number of multiple files can be dynamically adjusted according to the routing information, and the number of files is different, the transmission rate of the data to be synchronized is also different, so that the transmission rate of the data set to be synchronized can be dynamically adjusted.
可选地,上述步骤22中,将所述多个分组中每一分组的待同步数据写入所述WAL中与该分组对应的文件,得到多个文件,可包括如下步骤:Optionally, in the above step 22, writing the to-be-synchronized data of each of the multiple groups into the file corresponding to the group in the WAL to obtain multiple files may include the following steps:
2201、若分组i中所有待同步数据的数据类型的数量大于预设数值,将所述分组i中所述所有待同步数据划分为多个子分组,每一所述子分组中的所述 待同步数据对应相同的数据类型,其中,所述分组i为所述多个分组中的任一分组;2201. If the number of data types of all to-be-synchronized data in group i is greater than a preset value, divide all the to-be-synchronized data in group i into multiple sub-groups, and the to-be-synchronized data in each sub-group The data corresponds to the same data type, where the group i is any group of the plurality of groups;
2202、将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件。2202. Write the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i into the file corresponding to the sub-group in the WAL to obtain multiple files.
其中,针对多个分组中的任一分组i,若该分组i中所有待同步数据的数据类型的数量大于预设数值,表明分组i中数据类型的数量较多,且分组i中数据的数量较多,进而,可将分组i中的所有待同步数据根据数据类型划分至不同的多个子分组,具体地,将分组i中数据类型相同的待同步数据划分至同一子分组,进而,将每一子分组的待同步数据写入与该子分组对应的的文件,从而,可使相同子分组的待同步数据写入一个文件。如此,可根据数据类型对多个文件的数量进行动态调整,当分组i内的数据类型较多时,对应的文件数量越多,待同步数据的传输速率也不同,从而,可动态调整调整待同步数据集合的传输速率。Among them, for any group i among multiple groups, if the number of data types of all the data to be synchronized in the group i is greater than the preset value, it indicates that the number of data types in group i is larger, and the number of data in group i Furthermore, all the data to be synchronized in the group i can be divided into multiple sub-groups according to the data type. Specifically, the data to be synchronized with the same data type in the group i are divided into the same sub-group, and further, each The to-be-synchronized data of a sub-group is written into the file corresponding to the sub-group, so that the to-be-synchronized data of the same sub-group can be written into one file. In this way, the number of multiple files can be dynamically adjusted according to the data type. When there are more data types in the group i, the more the number of corresponding files, the different transmission rate of the data to be synchronized. Therefore, the synchronization can be adjusted dynamically. The transmission rate of the data collection.
可选地,所述分组i中包括m个待同步数据,本申请实施例中,还可包括如下步骤:Optionally, the group i includes m pieces of data to be synchronized. In the embodiment of the present application, the following steps may be further included:
获取所述分组i中所述m个待同步数据的类型标识,得到m个类型标识;Acquiring the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
统计所述m个类型标识,得到所述分组i中所有待同步数据的数据类型的数量n,n小于等于m。The m type identifiers are counted to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
其中,在步骤2201之前,还可确定分组i中所有待同步数据的数据类型的数量n,具体地,可获取分组i中m个待同步数据的类型标识,得到m个类型标识,每一待同步数据对应一个类型标识,不同的待同步数据之间,可能对应相同的类型标识,也可能对应不同的类型标识,进而,可统计类型标识的数量n。Wherein, before step 2201, the number n of data types of all data to be synchronized in group i can also be determined. Specifically, the type identifiers of m data to be synchronized in group i can be obtained, and m type identifiers can be obtained. Synchronized data corresponds to a type identifier, and different data to be synchronized may correspond to the same type identifier, or may correspond to different type identifiers, and further, the number n of type identifiers can be counted.
可选地,上述步骤2202中,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件,可包括如下步骤:Optionally, in the above step 2202, the data to be synchronized of each sub-group of the multiple sub-groups of the group i is written into the file corresponding to the sub-group in the WAL to obtain multiple files, which may include the following step:
按照顺序写文件的方式,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件。In the manner of writing files in sequence, the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
本申请实施例中,在将待同步数据写入文件中时,按照顺序写文件的方式,可避免大量的磁盘寻址时间,从而可提高写文件的速率。In the embodiment of the present application, when the data to be synchronized is written into the file, the file is written sequentially, which can avoid a large amount of disk addressing time, thereby increasing the file writing rate.
203、将所述多个文件传输至所述目标端设备中。203. Transmit the multiple files to the target device.
消费端设备可将多个文件传输至目标端设备中,通过两阶段提交,保证在数据源端的待同步数据集合与传输至目标端设备一致,从而保证待同步数据集合在传输过程中不丢失。The consumer device can transfer multiple files to the target device, and through a two-phase submission, it is ensured that the data set to be synchronized at the data source end is consistent with the data transferred to the target device, thereby ensuring that the data set to be synchronized is not lost during the transmission process.
可选地,上述步骤203中,将所述多个文件传输至所述目标端设备中,可包括如下步骤:Optionally, in the above step 203, transferring the multiple files to the target device may include the following steps:
通过异步的多个线程将所述多个文件传输至所述目标端设备中。The multiple files are transferred to the target device through multiple asynchronous threads.
其中,通过异步的多个线程将多个文件传输至目标端设备中,可提高消费端设备的CPU使用率,以及提高多个文件的传输速率。Among them, multiple asynchronous threads are used to transfer multiple files to the target device, which can increase the CPU usage of the consumer device and increase the transfer rate of multiple files.
可以看出,本申请实施例中所描述的数据传输方法,通过两阶段提交的方式接收订阅端设备传输的待同步数据集合集,其中,待同步数据集合是由所述订阅端设备从源端设备获取的数据;将待同步数据集合散列至WAL的多个文件中;将多个文件传输至目标端设备中,如此,通过两阶段提交的方式将待同步数据集合传输到消费端设备,从而保证待同步数据集合成功传输,以及,通过对WAL的多个文件传输待同步数据集合,从而提高数据同步传输效率。It can be seen that the data transmission method described in the embodiment of the present application receives the data set to be synchronized transmitted by the subscribing device through a two-phase submission method, where the data set to be synchronized is obtained by the subscribing device from the source. Data acquired by the device; hash the data set to be synchronized into multiple files in WAL; transfer multiple files to the target device, so that the data set to be synchronized is transmitted to the consumer device through a two-phase commit method, Therefore, it is ensured that the data set to be synchronized is successfully transmitted, and the data set to be synchronized is transmitted through multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
与上述一致地,图3是本申请实施例公开的一种数据传输方法的流程示意图。应用于图1A所示的数据传输系统,该数据传输系统可以包括源端设备、订阅端设备、消费端设备和目标端设备,该数据传输方法包括如下步骤:Consistent with the above, FIG. 3 is a schematic flowchart of a data transmission method disclosed in an embodiment of the present application. Applied to the data transmission system shown in FIG. 1A, the data transmission system may include a source device, a subscription device, a consumer device, and a target device. The data transmission method includes the following steps:
301、源端设备通过单线程向订阅端设备发送待同步数据集合,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息。301. A source device sends a data set to be synchronized to a subscriber device through a single thread, where the data set to be synchronized includes a plurality of data to be synchronized, and each data to be synchronized corresponds to one piece of routing information.
302、订阅端设备通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备。302. The subscribing device transmits the to-be-synchronized data set to the consumer device in a two-phase commit manner.
303、消费端设备根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息。303. The consumer device divides the multiple data to be synchronized into multiple groups according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the groups corresponds to the same routing information.
304、消费端设备按照顺序写文件的方式,将所述多个分组中每一分组的 待同步数据写入所述WAL中与该分组对应的文件,得到多个文件。304. The consumer device writes the to-be-synchronized data of each group in the plurality of groups into the file corresponding to the group in the WAL in a manner of sequentially writing files to obtain a plurality of files.
305、消费端设备通过异步的多个线程将所述多个文件传输至目标端设备中。305. The consumer device transmits the multiple files to the target device through multiple asynchronous threads.
其中,上述步骤301-步骤305的具体描述可以参照图1B和图2所描述的数据传输方法的相应描述,在此不再赘述。For the specific description of the above step 301 to step 305, reference may be made to the corresponding description of the data transmission method described in FIG. 1B and FIG. 2, which will not be repeated here.
可以看出,本申请实施例中所描述的数据传输方法,通过源端设备通过单线程向订阅端设备发送待同步数据集合,待同步数据集合包括多个待同步数据,每一待同步数据对应一个路由信息,订阅端设备通过两阶段提交的方式将待同步数据集合传输到消费端设备,消费端设备根据多个待同步数据对应的多个路由信息将多个待同步数据划分至多个分组,每一分组中的待同步数据对应相同的路由信息,消费端设备按照顺序写文件的方式,将多个分组中每一分组的待同步数据写入WAL中与该分组对应的文件,得到多个文件,消费端设备通过异步的多个线程将多个文件传输至目标端设备中,如此,通过两阶段提交的方式将待同步数据集合传输到消费端设备,从而保证待同步数据集合成功传输,以及,通过对WAL的多个文件传输待同步数据集合,从而提高数据同步传输效率。It can be seen that the data transmission method described in the embodiment of this application sends a data set to be synchronized to the subscriber device through a single thread through the source device. The data set to be synchronized includes multiple data to be synchronized, and each data to be synchronized corresponds to For a piece of routing information, the subscribing device transmits the data set to be synchronized to the consumer device in a two-phase commit method, and the consumer device divides the multiple data to be synchronized into multiple groups according to multiple routing information corresponding to the multiple data to be synchronized, The data to be synchronized in each group corresponds to the same routing information. The consumer device writes the data to be synchronized in each group in the multiple groups into the file corresponding to the group in the WAL by writing files in order to obtain multiple File, the consumer device transfers multiple files to the target device through multiple asynchronous threads. In this way, the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the successful transmission of the data set to be synchronized. In addition, the data set to be synchronized is transmitted to multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
请参阅图4A,图4A是本申请实施例公开的一种订阅端设备的结构示意图,如图所示,该订阅端设备包括处理器、存储器、通信接口,以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令:Please refer to FIG. 4A. FIG. 4A is a schematic structural diagram of a subscribing device disclosed in an embodiment of the present application. As shown in the figure, the subscribing device includes a processor, a memory, a communication interface, and one or more programs. The above-mentioned one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, and the above-mentioned programs include instructions for executing the following steps:
从所述源端设备获取待同步数据集合;Acquiring a data set to be synchronized from the source device;
通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至预写式日志WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The data set to be synchronized is transmitted to the consumer device through a two-phase commit method, and the consumer device is instructed to hash the data set to be synchronized into multiple files of the pre-write log WAL, and Transferring the multiple files to the target device.
在一个可能的示例中,在所述从所述源端设备获取待同步数据集合方面,上述程序具体用于执行以下步骤的指令:In a possible example, in the aspect of obtaining the data set to be synchronized from the source device, the above program is specifically used to execute the instructions of the following steps:
通过单线程获取所述源端设备传输的所述待同步数据集合。Acquire the to-be-synchronized data set transmitted by the source device through a single thread.
请参阅图4B,图4B是本申请实施例公开的一种消费端设备的结构示意图,如图所示,该消费端设备包括处理器、存储器、通信接口,以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令:Please refer to FIG. 4B. FIG. 4B is a schematic structural diagram of a consumer device disclosed in an embodiment of the present application. As shown in the figure, the consumer device includes a processor, a memory, a communication interface, and one or more programs. The above-mentioned one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, and the above-mentioned programs include instructions for executing the following steps:
通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;Receiving the to-be-synchronized data set transmitted by the subscribing end device in a two-phase commit method, where the to-be-synchronized data set is data obtained by the subscribing end device from the source end device;
将所述待同步数据集合散列至WAL的多个文件中;Hash the to-be-synchronized data set into multiple files of WAL;
将所述多个文件传输至所述目标端设备中。Transferring the multiple files to the target device.
在一个可能的示例中,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息,在所述将所述待同步数据集合散列至WAL的多个文件中方面,上述程序包括用于执行以下步骤的指令:In a possible example, the to-be-synchronized data set includes a plurality of to-be-synchronized data, and each of the to-be-synchronized data corresponds to a piece of routing information, and in the step of hashing the to-be-synchronized data set to multiple files of WAL On the other hand, the above program includes instructions for performing the following steps:
根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息;Dividing the multiple data to be synchronized into multiple packets according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the packets corresponds to the same routing information;
将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件。Write the to-be-synchronized data of each of the multiple groups into the file corresponding to the group in the write-ahead log WAL to obtain multiple files.
在一个可能的示例中,在所述将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件方面,上述程序包括用于执行以下步骤的指令:In a possible example, in the aspect of writing the to-be-synchronized data of each group in the plurality of groups into the file corresponding to the group in the write-ahead log WAL to obtain a plurality of files, the above-mentioned program includes a method for executing Instructions for the following steps:
若分组i中所有待同步数据的数据类型的数量大于预设数值,将所述分组i中所述所有待同步数据划分为多个子分组,每一所述子分组中的所述待同步数据对应相同的数据类型,其中,所述分组i为所述多个分组中的任一分组;If the number of data types of all to-be-synchronized data in group i is greater than the preset value, divide all the to-be-synchronized data in said group i into multiple sub-groups, each of said sub-groups corresponding to said data to be synchronized The same data type, wherein the group i is any group of the plurality of groups;
将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件。Write the to-be-synchronized data of each sub-group in the multiple sub-groups of the group i into the file corresponding to the sub-group in the WAL to obtain multiple files.
在一个可能的示例中,所述分组i中包括m个待同步数据,上述程序还包括用于执行以下步骤的指令:In a possible example, the packet i includes m data to be synchronized, and the above program further includes instructions for executing the following steps:
获取所述分组i中所述m个待同步数据的类型标识,得到m个类型标识;Acquiring the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
统计所述m个类型标识,得到所述分组i中所有待同步数据的数据类型的数量n,n小于等于m。The m type identifiers are counted to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
在一个可能的示例中,在所述将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件方面,上述程序包括用于执行以下步骤的指令:In a possible example, in the aspect of writing the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i into the file in the WAL to obtain multiple files, the above-mentioned program includes: Step instructions:
按照顺序写文件的方式,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件。In the manner of writing files in sequence, the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所提供的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that, in order to implement the above-mentioned functions, an electronic device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments provided herein, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the electronic device into functional units according to the foregoing method examples. For example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
请参阅图5,图5是本申请实施例公开的一种数据传输装置的结构示意图,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,所述数据传输装置包括第一获取单元501和第一传输单元502,其中,Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application. Terminal equipment, the data transmission apparatus includes a first acquisition unit 501 and a first transmission unit 502, wherein,
所述第一获取单元501,用于从所述源端设备获取待同步数据集合;The first obtaining unit 501 is configured to obtain a data set to be synchronized from the source device;
所述第一传输单元502,用于通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The first transmission unit 502 is configured to transmit the data set to be synchronized to the consumer device in a two-phase commit method, and instruct the consumer device to hash the data set to be synchronized to the WAL Multiple files, and transfer the multiple files to the target device.
可选地,在所述从所述源端设备获取待同步数据集合方面,所述第一获取单元501具体用于:Optionally, in the aspect of acquiring the data set to be synchronized from the source device, the first acquiring unit 501 is specifically configured to:
通过单线程获取所述源端设备传输的所述待同步数据集合。Acquire the to-be-synchronized data set transmitted by the source device through a single thread.
可以看出,本申请实施例中所描述的数据传输装置,通过从源端设备获取待同步数据集合;通过两阶段提交的方式将待同步数据集合传输到消费端设备,并指示消费端设备将待同步数据集合散列至WAL的多个文件中,并将多个文件传输至目标端设备中,如此,通过两阶段提交的方式将待同步数据集合传输到消费端设备,从而保证待同步数据集合成功传输,以及,通过对WAL的多个文件传输待同步数据集合,从而提高数据同步传输效率。It can be seen that the data transmission device described in the embodiment of this application obtains the data set to be synchronized from the source device; transmits the data set to be synchronized to the consumer device in a two-phase commit method, and instructs the consumer device to The data set to be synchronized is hashed to multiple files in the WAL, and the multiple files are transferred to the target device. In this way, the data set to be synchronized is transmitted to the consumer device through a two-phase commit method to ensure the data to be synchronized The collection is successfully transmitted, and the data collection to be synchronized is transmitted through multiple files of WAL, thereby improving the efficiency of data synchronization transmission.
需要注意的是,本申请实施例所描述的订阅端设备是以功能单元的形式呈现。这里所使用的术语“单元”应当理解为尽可能最宽的含义,用于实现各个“单元”所描述功能的对象例如可以是集成电路ASIC,单个电路,用于执行一个或多个软件或固件程序的处理器(共享的、专用的或芯片组)和存储器,组合逻辑电路,和/或提供实现上述功能的其他合适的组件。It should be noted that the subscriber device described in the embodiment of the present application is presented in the form of a functional unit. The term "unit" used here should be understood as the broadest possible meaning. The object used to realize the functions described by each "unit" may be, for example, an integrated circuit ASIC, a single circuit, used to execute one or more software or firmware. Program processor (shared, dedicated or chipset) and memory, combinatorial logic circuit, and/or provide other suitable components for realizing the above-mentioned functions.
其中,第一获取单元501和第一传输单元502可以是控制电路或处理器。Wherein, the first acquisition unit 501 and the first transmission unit 502 may be a control circuit or a processor.
请参阅图6A,图6A是本申请实施例公开的一种数据传输装置的结构示意图,应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备,所述数据传输装置包括接收单元601、散列单元602和第二传输单元603,其中,Please refer to FIG. 6A. FIG. 6A is a schematic structural diagram of a data transmission device disclosed in an embodiment of the present application, which is applied to a consumer device in a data transmission system. The data transmission system also includes a source device, a subscriber device, and a target. A terminal device, the data transmission apparatus includes a receiving unit 601, a hashing unit 602, and a second transmission unit 603, where:
所述接收单元601,用于通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;The receiving unit 601 is configured to receive the to-be-synchronized data set transmitted by the subscribing end device in a two-phase commit method, where the to-be-synchronized data set is obtained by the subscribing end device from the source end device The data;
所述散列单元602,用于将所述待同步数据集合散列至WAL的多个文件中;The hashing unit 602 is configured to hash the to-be-synchronized data set into multiple files of WAL;
所述第二传输单元603,用于将所述多个文件传输至所述目标端设备中。The second transmission unit 603 is configured to transmit the multiple files to the target device.
可选地,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息,在所述将所述待同步数据集合散列至WAL的多个文件中方面,所述散列单元602具体用于:Optionally, the to-be-synchronized data set includes a plurality of to-be-synchronized data, and each of the to-be-synchronized data corresponds to one piece of routing information. In the aspect of hashing the to-be-synchronized data set into multiple files of WAL, The hash unit 602 is specifically configured to:
根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息;Dividing the multiple data to be synchronized into multiple packets according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the packets corresponds to the same routing information;
将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件。Write the to-be-synchronized data of each of the multiple groups into the file corresponding to the group in the write-ahead log WAL to obtain multiple files.
可选地,在所述将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件方面,所述散列单元具体用于:Optionally, in the aspect of writing the to-be-synchronized data of each of the multiple packets into the file corresponding to the packet in the write-ahead log WAL to obtain multiple files, the hashing unit is specifically used for:
若分组i中所有待同步数据的数据类型的数量大于预设数值,将所述分组i中所述所有待同步数据划分为多个子分组,每一所述子分组中的所述待同步数据对应相同的数据类型,其中,所述分组i为所述多个分组中的任一分组;If the number of data types of all to-be-synchronized data in group i is greater than the preset value, divide all the to-be-synchronized data in said group i into multiple sub-groups, each of said sub-groups corresponding to said data to be synchronized The same data type, wherein the group i is any group of the plurality of groups;
将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件。Write the to-be-synchronized data of each sub-group in the multiple sub-groups of the group i into the file corresponding to the sub-group in the WAL to obtain multiple files.
可选地,所述分组i中包括m个待同步数据,如图6B,图6B为图6A所示的数据传输装置的变型结构,其与图6A相比较,还可以包括:第二获取单元604和统计单元605,其中,Optionally, the packet i includes m data to be synchronized, as shown in FIG. 6B. FIG. 6B is a modified structure of the data transmission device shown in FIG. 6A. Compared with FIG. 6A, it may further include: a second acquiring unit 604 and statistical unit 605, of which,
所述第二获取单元604,用于获取所述分组i中所述m个待同步数据的类型标识,得到m个类型标识;The second obtaining unit 604 is configured to obtain the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
所述统计单元605,用于统计所述m个类型标识,得到所述分组i中所有待同步数据的数据类型的数量n,n小于等于m。The statistics unit 605 is configured to count the m type identifiers to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
可选地,在所述将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件方面,所述散列单元具体用于:Optionally, in the aspect of writing the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i into the file in the WAL to obtain multiple files, the hash unit is specifically used for:
按照顺序写文件的方式,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件。In the manner of writing files in sequence, the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
可选地,在所述将所述多个文件传输至所述目标端设备中方面,所述第二传输单元具体用于:Optionally, in the aspect of transmitting the multiple files to the target device, the second transmission unit is specifically configured to:
通过异步的多个线程将所述多个文件传输至所述目标端设备中。The multiple files are transferred to the target device through multiple asynchronous threads.
可以看出,本申请实施例中所描述的数据传输装置,通过两阶段提交的方式接收订阅端设备传输的待同步数据集合集,其中,待同步数据集合是由所述订阅端设备从源端设备获取的数据;将待同步数据集合散列至WAL的多个文件中;将多个文件传输至目标端设备中,如此,通过两阶段提交的方式将待同步数据集合传输到消费端设备,从而保证待同步数据集合成功传输,以及,通 过对WAL的多个文件传输待同步数据集合,从而提高数据同步传输效率。It can be seen that the data transmission device described in the embodiment of the present application receives the data set to be synchronized transmitted by the subscribing end device in a two-phase submission manner, where the data set to be synchronized is obtained by the subscribing device from the source end. The data acquired by the device; hash the data set to be synchronized into multiple files in the WAL; transfer multiple files to the target device, so that the data set to be synchronized is transmitted to the consumer device through a two-phase commit method, Therefore, it is ensured that the data set to be synchronized is successfully transmitted, and the data set to be synchronized is transmitted through multiple files of the WAL, thereby improving the efficiency of data synchronization transmission.
需要注意的是,本申请实施例所描述的消费端设备是以功能单元的形式呈现。这里所使用的术语“单元”应当理解为尽可能最宽的含义,用于实现各个“单元”所描述功能的对象例如可以是集成电路ASIC,单个电路,用于执行一个或多个软件或固件程序的处理器(共享的、专用的或芯片组)和存储器,组合逻辑电路,和/或提供实现上述功能的其他合适的组件。It should be noted that the consumer devices described in the embodiments of the present application are presented in the form of functional units. The term "unit" used here should be understood as the broadest possible meaning. The object used to realize the functions described by each "unit" may be, for example, an integrated circuit ASIC, a single circuit, used to execute one or more software or firmware. Program processor (shared, dedicated or chipset) and memory, combinatorial logic circuit, and/or provide other suitable components for realizing the above-mentioned functions.
其中,接收单元601、散列单元602、第二传输单元603、第二获取单元604和统计单元605可以是控制电路或处理器。Among them, the receiving unit 601, the hashing unit 602, the second transmission unit 603, the second acquisition unit 604, and the statistics unit 605 may be a control circuit or a processor.
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任何一种数据传输方法的部分或全部步骤。An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute a part of any data transmission method as described in the above method embodiment. Or all steps.
本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如上述方法实施例中记载的任何一种数据传输方法的部分或全部步骤。The embodiments of the present application also provide a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute the method described in the foregoing method embodiment. Part or all of the steps of any data transmission method.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions. Because according to this application, some steps can be performed in other order or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的 形式。In the several embodiments provided in this application, it should be understood that the disclosed device may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program modules.
所述集成的单元如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer readable memory. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory. A number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), mobile hard disk, magnetic disk, or optical disk and other media that can store program codes.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、ROM、RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable memory, and the memory can include: a flash disk , ROM, RAM, magnetic disk or CD, etc.
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the application are described in detail above, and specific examples are used in this article to illustrate the principles and implementation of the application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the application; at the same time, for Those of ordinary skill in the art, based on the idea of the application, will have changes in the specific implementation and the scope of application. In summary, the content of this specification should not be construed as a limitation to the application.

Claims (20)

  1. 一种数据传输方法,其特征在于,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,所述方法包括:A data transmission method, characterized in that it is applied to a subscriber device in a data transmission system, the data transmission system further includes a source device, a consumer device, and a target device, and the method includes:
    从所述源端设备获取待同步数据集合;Acquiring a data set to be synchronized from the source device;
    通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至预写式日志WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The data set to be synchronized is transmitted to the consumer device through a two-phase commit method, and the consumer device is instructed to hash the data set to be synchronized into multiple files of the pre-write log WAL, and Transferring the multiple files to the target device.
  2. 根据权利要求1所述方法,其特征在于,所述从所述源端设备获取待同步数据集合,包括:The method according to claim 1, wherein the obtaining a data set to be synchronized from the source device comprises:
    通过单线程获取所述源端设备传输的所述待同步数据集合。Acquire the to-be-synchronized data set transmitted by the source device through a single thread.
  3. 一种数据传输方法,其特征在于,应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备,所述方法包括:A data transmission method, characterized in that it is applied to a consumer device in a data transmission system. The data transmission system further includes a source device, a subscriber device, and a target device. The method includes:
    通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;Receiving the to-be-synchronized data set transmitted by the subscribing end device in a two-phase commit method, where the to-be-synchronized data set is data obtained by the subscribing end device from the source end device;
    将所述待同步数据集合散列至WAL的多个文件中;Hash the to-be-synchronized data set into multiple files of WAL;
    将所述多个文件传输至所述目标端设备中。Transferring the multiple files to the target device.
  4. 根据权利要求3所述方法,其特征在于,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息,所述将所述待同步数据集合散列至WAL的多个文件中,包括:The method according to claim 3, wherein the data set to be synchronized includes a plurality of data to be synchronized, each of the data to be synchronized corresponds to one piece of routing information, and the data set to be synchronized is hashed to WAL Among the multiple files, including:
    根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息;Dividing the multiple data to be synchronized into multiple packets according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the packets corresponds to the same routing information;
    将所述多个分组中每一分组的待同步数据写入所述WAL中与该分组对应的文件,得到多个文件。Write the to-be-synchronized data of each group in the plurality of groups into the file corresponding to the group in the WAL to obtain a plurality of files.
  5. 根据权利要求4所述方法,其特征在于,所述将所述多个分组中每一分组的待同步数据写入所述WAL中与该分组对应的文件,得到多个文件,包 括:The method according to claim 4, wherein the writing the to-be-synchronized data of each of the plurality of groups into the file corresponding to the group in the WAL to obtain a plurality of files includes:
    若分组i中所有待同步数据的数据类型的数量大于预设数值,将所述分组i中所述所有待同步数据划分为多个子分组,每一所述子分组中的所述待同步数据对应相同的数据类型,其中,所述分组i为所述多个分组中的任一分组;If the number of data types of all to-be-synchronized data in group i is greater than the preset value, divide all the to-be-synchronized data in said group i into multiple sub-groups, each of said sub-groups corresponding to said data to be synchronized The same data type, wherein the group i is any group of the plurality of groups;
    将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件。Write the to-be-synchronized data of each sub-group in the multiple sub-groups of the group i into the file corresponding to the sub-group in the WAL to obtain multiple files.
  6. 根据权利要求5所述方法,其特征在于,所述分组i中包括m个待同步数据,所述方法还包括:The method according to claim 5, wherein the packet i includes m data to be synchronized, and the method further comprises:
    获取所述分组i中所述m个待同步数据的类型标识,得到m个类型标识;Acquiring the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
    统计所述m个类型标识,得到所述分组i中所有待同步数据的数据类型的数量n,n小于等于m。The m type identifiers are counted to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
  7. 根据权利要求5或6所述方法,其特征在于,所述将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件,包括:The method according to claim 5 or 6, wherein the writing the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i into the file in the WAL to obtain multiple files comprises:
    按照顺序写文件的方式,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件。In the manner of writing files in sequence, the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
  8. 根据权利要求7所述方法,其特征在于,所述将所述多个文件传输至所述目标端设备中,包括:The method according to claim 7, wherein the transferring the multiple files to the target device comprises:
    通过异步的多个线程将所述多个文件传输至所述目标端设备中。The multiple files are transferred to the target device through multiple asynchronous threads.
  9. 一种数据传输装置,其特征在于,应用于数据传输系统中的订阅端设备,所述数据传输系统还包括源端设备、消费端设备和目标端设备,所述数据传输装置包括:A data transmission device, characterized in that it is applied to a subscribing device in a data transmission system, the data transmission system further includes a source device, a consumer device, and a target device, and the data transmission device includes:
    第一获取单元,用于从所述源端设备获取待同步数据集合;The first obtaining unit is configured to obtain a data set to be synchronized from the source device;
    第一传输单元,用于通过两阶段提交的方式将所述待同步数据集合传输到所述消费端设备,并指示所述消费端设备将所述待同步数据集合散列至WAL的多个文件中,并将所述多个文件传输至所述目标端设备中。The first transmission unit is configured to transmit the to-be-synchronized data set to the consumer device in a two-phase commit method, and instruct the consumer-end device to hash the to-be-synchronized data set to multiple files of WAL And transfer the multiple files to the target device.
  10. 根据权利要求9所述的数据传输装置,其特征在于,在所述从所述源端设备获取待同步数据集合方面,所述第一获取单元具体用于:The data transmission device according to claim 9, wherein in the aspect of obtaining the data set to be synchronized from the source device, the first obtaining unit is specifically configured to:
    通过单线程获取所述源端设备传输的所述待同步数据集合。Acquire the to-be-synchronized data set transmitted by the source device through a single thread.
  11. 一种数据传输装置,其特征在于,应用于数据传输系统中的消费端设备,所述数据传输系统还包括源端设备、订阅端设备和目标端设备,所述数据传输装置包括:A data transmission device, characterized in that it is applied to a consumer device in a data transmission system, the data transmission system further includes a source device, a subscriber device, and a target device, and the data transmission device includes:
    接收单元,用于通过两阶段提交的方式接收所述订阅端设备传输的待同步数据集合集,其中,所述待同步数据集合是由所述订阅端设备从所述源端设备获取的数据;A receiving unit, configured to receive a data set to be synchronized transmitted by the subscribing end device in a two-phase commit manner, where the data set to be synchronized is data obtained by the subscribing end device from the source device;
    散列单元,用于将所述待同步数据集合散列至WAL的多个文件中;The hash unit is used to hash the data set to be synchronized into multiple files of the WAL;
    第二传输单元,用于将所述多个文件传输至所述目标端设备中。The second transmission unit is configured to transmit the multiple files to the target device.
  12. 根据权利要求7-9任一项所述的数据传输装置,其特征在于,所述待同步数据集合包括多个待同步数据,每一所述待同步数据对应一个路由信息,在所述将所述待同步数据集合散列至WAL的多个文件中方面,所述散列单元具体用于:The data transmission device according to any one of claims 7-9, wherein the set of to-be-synchronized data includes a plurality of to-be-synchronized data, and each of the to-be-synchronized data corresponds to one piece of routing information, and the set of data to be synchronized In terms of hashing the to-be-synchronized data set into multiple files of the WAL, the hash unit is specifically used for:
    根据所述多个待同步数据对应的多个路由信息将所述多个待同步数据划分至多个分组,每一所述分组中的待同步数据对应相同的路由信息;Dividing the multiple data to be synchronized into multiple packets according to multiple routing information corresponding to the multiple data to be synchronized, and the data to be synchronized in each of the packets corresponds to the same routing information;
    将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件。Write the to-be-synchronized data of each of the multiple groups into the file corresponding to the group in the write-ahead log WAL to obtain multiple files.
  13. 根据权利要求7-9任一项所述的数据传输装置,其特征在于,在所述将所述多个分组中每一分组的待同步数据写入预写日志WAL中与该分组对应的文件,得到多个文件方面,所述散列单元具体用于:The data transmission device according to any one of claims 7-9, wherein the data to be synchronized in each of the plurality of groups is written into the file corresponding to the group in the write-ahead log WAL , In terms of obtaining multiple files, the hash unit is specifically used for:
    若分组i中所有待同步数据的数据类型的数量大于预设数值,将所述分组i中所述所有待同步数据划分为多个子分组,每一所述子分组中的所述待同步数据对应相同的数据类型,其中,所述分组i为所述多个分组中的任一分组;If the number of data types of all to-be-synchronized data in group i is greater than the preset value, divide all the to-be-synchronized data in said group i into multiple sub-groups, each of said sub-groups corresponding to said data to be synchronized The same data type, wherein the group i is any group of the plurality of groups;
    将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中与该子分组对应的的文件,得到多个文件。Write the to-be-synchronized data of each sub-group in the multiple sub-groups of the group i into the file corresponding to the sub-group in the WAL to obtain multiple files.
  14. 根据权利要求11所述的数据传输装置,其特征在于,所述分组i中包括m个待同步数据,所述装置还包括第二获取单元和统计单元,其中,The data transmission device according to claim 11, wherein the packet i includes m data to be synchronized, and the device further includes a second acquisition unit and a statistics unit, wherein,
    所述第二获取单元,用于获取所述分组i中所述m个待同步数据的类型标 识,得到m个类型标识;The second acquiring unit is configured to acquire the type identifiers of the m to-be-synchronized data in the group i to obtain m type identifiers;
    所述统计单元,用于统计所述m个类型标识,得到所述分组i中所有待同步数据的数据类型的数量n,n小于等于m。The statistics unit is configured to count the m type identifiers to obtain the number n of data types of all data to be synchronized in the group i, where n is less than or equal to m.
  15. 根据权利要求11所述的数据传输装置,其特征在于,在所述将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件方面,所述散列单元具体用于:The data transmission device according to claim 11, wherein in the aspect of writing the to-be-synchronized data of each sub-group of the plurality of sub-groups of the group i into the file in the WAL, a plurality of files are obtained , The hash unit is specifically used for:
    按照顺序写文件的方式,将所述分组i的多个子分组中每一子分组的待同步数据写入所述WAL中的文件,得到多个文件。In the manner of writing files in sequence, the to-be-synchronized data of each sub-group of the multiple sub-groups of the group i is written into the file in the WAL to obtain multiple files.
  16. 根据权利要求11所述的数据传输装置,其特征在于,在所述将所述多个文件传输至所述目标端设备中方面,所述第二传输单元具体用于:The data transmission device according to claim 11, wherein in the aspect of transmitting the multiple files to the target device, the second transmission unit is specifically configured to:
    通过异步的多个线程将所述多个文件传输至所述目标端设备中。The multiple files are transferred to the target device through multiple asynchronous threads.
  17. 一种订阅端设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1或2所述的方法中的步骤的指令。A subscription terminal device, characterized by comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the processor The program includes instructions for executing the steps in the method according to claim 1 or 2.
  18. 一种消费端设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求3-8任一项所述的方法中的步骤的指令。A consumer device, characterized by comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the processor The program includes instructions for executing the steps in the method according to any one of claims 3-8.
  19. 一种计算机可读存储介质,其特征在于,存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-8任一项所述的方法。A computer-readable storage medium, characterized by storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the method according to any one of claims 1-8.
  20. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储计算机程序的非瞬时性计算机可读存储介质,所述计算机程序使得计算机执行如权利要求1-8任一项所述的方法。A computer program product, characterized in that the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, and the computer program causes a computer to execute the method according to any one of claims 1-8.
PCT/CN2020/078243 2020-03-06 2020-03-06 Data transmission method and apparatus WO2021174537A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/078243 WO2021174537A1 (en) 2020-03-06 2020-03-06 Data transmission method and apparatus
CN202080097945.3A CN115210694A (en) 2020-03-06 2020-03-06 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/078243 WO2021174537A1 (en) 2020-03-06 2020-03-06 Data transmission method and apparatus

Publications (1)

Publication Number Publication Date
WO2021174537A1 true WO2021174537A1 (en) 2021-09-10

Family

ID=77612818

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078243 WO2021174537A1 (en) 2020-03-06 2020-03-06 Data transmission method and apparatus

Country Status (2)

Country Link
CN (1) CN115210694A (en)
WO (1) WO2021174537A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194605A (en) * 2023-11-08 2023-12-08 中南大学 Hash encoding method, terminal and medium for multi-mode medical data deletion

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105262831A (en) * 2015-10-30 2016-01-20 北京奇艺世纪科技有限公司 Method, device, and synchronizing system for synchronizing data among memory systems
CN106878473A (en) * 2017-04-20 2017-06-20 腾讯科技(深圳)有限公司 A kind of message treatment method, server cluster and system
CN107145499A (en) * 2016-03-01 2017-09-08 阿里巴巴集团控股有限公司 The method and apparatus filed for ahead daily record
CN109815028A (en) * 2018-12-27 2019-05-28 北京摩拜科技有限公司 Data synchronous system, method, apparatus and computer storage medium
US20190171650A1 (en) * 2017-12-01 2019-06-06 Chavdar Botev System and method to improve data synchronization and integration of heterogeneous databases distributed across enterprise and cloud using bi-directional transactional bus of asynchronous change data system
CN110232097A (en) * 2019-06-21 2019-09-13 北京奇艺世纪科技有限公司 A kind of method of data synchronization and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105262831A (en) * 2015-10-30 2016-01-20 北京奇艺世纪科技有限公司 Method, device, and synchronizing system for synchronizing data among memory systems
CN107145499A (en) * 2016-03-01 2017-09-08 阿里巴巴集团控股有限公司 The method and apparatus filed for ahead daily record
CN106878473A (en) * 2017-04-20 2017-06-20 腾讯科技(深圳)有限公司 A kind of message treatment method, server cluster and system
US20190171650A1 (en) * 2017-12-01 2019-06-06 Chavdar Botev System and method to improve data synchronization and integration of heterogeneous databases distributed across enterprise and cloud using bi-directional transactional bus of asynchronous change data system
CN109815028A (en) * 2018-12-27 2019-05-28 北京摩拜科技有限公司 Data synchronous system, method, apparatus and computer storage medium
CN110232097A (en) * 2019-06-21 2019-09-13 北京奇艺世纪科技有限公司 A kind of method of data synchronization and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194605A (en) * 2023-11-08 2023-12-08 中南大学 Hash encoding method, terminal and medium for multi-mode medical data deletion
CN117194605B (en) * 2023-11-08 2024-01-19 中南大学 Hash encoding method, terminal and medium for multi-mode medical data deletion

Also Published As

Publication number Publication date
CN115210694A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN108431804B (en) Ability to group multiple container databases into a single container database cluster
US10628449B2 (en) Method and apparatus for processing database data in distributed database system
US8738568B2 (en) User-defined parallelization in transactional replication of in-memory database
US20210382899A1 (en) Dual-stack architecture that integrates relational database with blockchain
US11068499B2 (en) Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching
KR102448787B1 (en) System for providing retrieval service based on blockchain and method of the same
US8478803B2 (en) Management of logical statements in a distributed database environment
US20100030824A1 (en) Statement logging in databases
US10452655B2 (en) In-memory cursor duration temp tables
CN110045912A (en) Data processing method and device
EP2171614A2 (en) Transporting table valued parameter over tabular data stream protocol
US10127281B2 (en) Dynamic hash table size estimation during database aggregation processing
US8417669B2 (en) Auto-correction in database replication
WO2017113962A1 (en) Method of accessing distributed database and device providing distributed data service
US10474185B2 (en) Timestamp alignment across a plurality of computing devices
WO2017092384A1 (en) Clustered database distributed storage method and device
WO2024060934A1 (en) Data processing method and apparatus
US9047354B2 (en) Statement categorization and normalization
WO2021174537A1 (en) Data transmission method and apparatus
WO2022252322A1 (en) Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system
CN112527900A (en) Method, device, equipment and medium for database multi-copy reading consistency
WO2023246236A1 (en) Node configuration method, transaction log synchronization method and node for distributed database
WO2023061180A1 (en) Multi frequency-based data sending method and apparatus, multi frequency-based data receiving method and apparatus, and device
US20200026789A1 (en) Generating a single transactional data stream from multiple database logs
CN115129779A (en) Database synchronization method, device and readable medium

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: 20923206

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 16.02.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20923206

Country of ref document: EP

Kind code of ref document: A1