CN111741038B - Data transmission method and data transmission device - Google Patents

Data transmission method and data transmission device Download PDF

Info

Publication number
CN111741038B
CN111741038B CN201910228420.8A CN201910228420A CN111741038B CN 111741038 B CN111741038 B CN 111741038B CN 201910228420 A CN201910228420 A CN 201910228420A CN 111741038 B CN111741038 B CN 111741038B
Authority
CN
China
Prior art keywords
data
summary information
changed
change
data source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910228420.8A
Other languages
Chinese (zh)
Other versions
CN111741038A (en
Inventor
钟培楠
李可
袁起会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910228420.8A priority Critical patent/CN111741038B/en
Publication of CN111741038A publication Critical patent/CN111741038A/en
Application granted granted Critical
Publication of CN111741038B publication Critical patent/CN111741038B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data transmission method and a data transmission device, which are used for reducing the overhead of network resources for sending data during data synchronization. The method in the embodiment of the application comprises the following steps: the method comprises the steps that data source equipment receives a data synchronization request message sent by data application equipment, wherein the data synchronization request message carries first summary information of changed data stored by the data application equipment; the data source equipment determines difference data between the data source equipment and the data application equipment according to the first summary information and second summary information of the changed data stored in the data source equipment; and the data source equipment sends the difference data to the data application equipment, and the difference data is used for data synchronization of the data application equipment.

Description

Data transmission method and data transmission device
Technical Field
The present application relates to database technologies, and in particular, to a data transmission method and a data transmission apparatus.
Background
In the network operation process, when data is changed, the data source device sends a change event notification message to the data application device, and then the data application device can update the data according to the change event notification message to realize data synchronization. However, under abnormal conditions such as a network failure and a network system downtime, the change event notification message sent by the data source device may be lost, so that the data of the data application device cannot be synchronized with the data of the data source device, and the data application device needs to periodically and actively perform data synchronization, thereby ensuring the consistency of the data. With the continuous expansion of network scale, how to efficiently carry out data synchronization is a hot concern of the current network system.
At present, data application equipment sends a data synchronization request message to data source equipment, then the data source equipment queries all locally stored data, and then sends the all data to the data application equipment, so that the data application equipment compares the all data with the local data, identifies difference data, and updates a data state.
According to the scheme, after receiving the data synchronization request message sent by the data application device, the data source device needs to send all locally stored data to the data application device, so that the network resource overhead is high.
Disclosure of Invention
The embodiment of the application provides a data transmission method and a data transmission device, which are used for reducing the overhead of network resources for sending data during data synchronization.
A first aspect of an embodiment of the present application provides a data transmission method, including:
in the data synchronization process, the data source device may receive a data synchronization request message sent by the data application device, and the message carries first summary information of changed data stored in the data application device; then, the data source device may determine difference data between the data source device and the data application device according to the first summary information and second summary information of the change data stored by the data source device, and transmit the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data.
In this embodiment, the data source device may determine the difference data by comparing the first digest information carried in the data synchronization request message sent by the data application device with the second digest information stored in the data source device, and then send the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data. The data source device can send the difference data instead of sending all data at each data synchronization, thereby reducing the network resource overhead for sending data at the data synchronization. And secondly, the data source equipment determines the difference data by comparing the first abstract information with the second abstract information, and compared with the prior art that all data are compared, the efficiency of determining the difference data is improved, so that the efficiency of data synchronization is improved.
In a possible implementation manner, the first summary information may include a first identifier and a first version number, where the first identifier is used to identify the changed data of the data application device, and the first version number is used to identify the version of the changed data corresponding to the first identifier; the second summary information may include a second identifier and a second version number, the second identifier is used for identifying the changed data of the data source device, and the second version number is used for identifying the version of the changed data corresponding to the second identifier; the determining, by the data source device, the difference data according to the first summary information and the second summary information of the change data stored by the data source device may include: first, the data source device may determine an identifier of the difference data according to a first identifier and a first version number of the first digest information and a second identifier and a second version number of the second digest information; the data source device may then determine the difference data from the identifier of the difference data. In this possible implementation, the identifier and version number of the changed data are set as summary information of the changed data, thereby implementing a temporal state that uniquely identifies the changed data. And secondly, the data source equipment determines the difference data by comparing the first abstract information with the second abstract information, and compared with the prior art that all data are compared, the efficiency of determining the difference data is improved, so that the efficiency of data synchronization is improved.
In another possible implementation manner, before the data source device receives the data synchronization request message sent by the data application device, the method may further include: first, the data source device may obtain a first change event notification message; then, the data source device may change data in the database according to the first change event notification message to obtain first change data; and the data source equipment updates the initial summary information stored in the data source equipment according to the first change event notification message so as to generate the second summary information. In this possible implementation, the data source device may update the database by changing the event notification message and update the initial summary information to generate the second summary information.
In another possible implementation manner, before the data source device updates the initial summary information stored by the data source device according to the first change event notification message to generate the second summary information, the method may further include: the data source device may determine to write the summary information of the first changed data into the initial summary information according to a first change time, where the first change time is used to identify a time when the data source device changes the data in the database to obtain the first changed data, and the determination is based on that a first change event falls within a preset time range of the initial summary information. In this possible implementation manner, the initial summary information is summary information of the changed data that is recorded by the data source device and changed within a preset time range, and the data source device may determine to write the summary information of the first changed data into the initial summary information according to the change time of the first changed data obtained by changing the data of the database by the data source device. Then, when the subsequent data source equipment compares the first abstract information with the second abstract information, the data source equipment compares the first abstract information with the second abstract information, and the data source equipment compares the first abstract information with the second abstract information, so that compared with the prior art that all data are compared, the comparison workload is greatly reduced, and the data synchronization efficiency is improved. Compared with the summary information of all data, the comparison efficiency is improved, and therefore high-efficiency data synchronization is achieved.
In another possible implementation manner, the updating, by the data source device, the initial summary information stored in the data source device according to the first change event notification message to generate the second summary information may specifically include: first, the data source device may determine an identifier of the first change data according to the first change event notification message; then, the data source device may determine, according to an identifier of the first changed data, an initial version number of the first changed data from an initial summary information list stored in the data source device, where the initial version number is a version number corresponding to changed data in the initial summary information, where the first changed data is changed at the latest time from a current time, and the current time is a time when the data source device receives the first change event notification message; the data source equipment increases the initial version number by a preset number to obtain the latest version number of the first changed data, and takes the identifier of the first changed data and the latest version number of the first changed data as abstract information of the first changed data; finally, the data source equipment updates the initial summary information so as to generate second summary information. In this possible implementation, a specific implementation is provided in which the data source device generates summary information of the first changed data, and then updates the initial summary information to generate the second summary information.
In another possible implementation manner, the updating, by the data source device, the initial summary information so as to generate the second summary information may specifically include: first, the data source device encodes the digest information of the first changed data to obtain the encoded digest information of the first changed data, where the encoding mode may include at least one of: a hash operation or an exclusive or operation; then, the data source device takes the digest information of the encoded first changed data and the initial digest information as second digest information. In this possible implementation manner, the data source device may encode the first change data by an encoding manner, and then use the digest information and the initial digest information of the encoded first change data as the second digest information.
In another possible implementation manner, after the data source device determines difference data according to the first summary information and second summary information of the change data stored by the data source device, the method may further include: the data source device may transmit summary information of the difference data to the data application device. In this possible implementation manner, the data source device sends the summary information of the difference data to the data application device, so that the data application device can update the first summary information according to the summary information of the difference data, and the summary information stored in the two node devices is consistent.
In another possible implementation manner, before the data source device receives the data synchronization request message sent by the data application device, the method may further include: the data source device may send a second change event notification message to the data application device, where the second change event notification message carries second change data and summary information of the second change data, and the summary information of the second change data is used for the data application device to generate the first summary information. In this possible implementation manner, the data source device may send a second change event notification message to the data application device, so that the data application device updates its database according to the second change data and generates the first summary information, thereby implementing data synchronization.
A second aspect of the embodiments of the present application provides a data transmission method, including:
the data application equipment can send a data synchronization request message to the data source equipment, wherein the data synchronization request message carries first summary information of the changed data stored by the data application equipment; then, the data application device may receive the difference data transmitted by the data source device, and perform data synchronization based on the difference data.
In this embodiment, the data application device requests the data source device for data synchronization, the data source device may directly return the difference data, and then the data application device updates the local database according to the difference data to implement data synchronization. Therefore, compared with the traditional scheme that all data are sent and all data need to be compared by the data application equipment, the data application equipment can directly perform data synchronization according to the difference data without comparison, and the data synchronization efficiency is high.
In one possible implementation manner, after the data application device sends the data synchronization request message to the data source device, the method may further include: firstly, the data application device can receive abstract information of difference data sent by the data source device; then, the data application apparatus may update the first summary information according to the summary information of the difference data. In this possible implementation manner, the data application device may update the first summary information through the summary information of the difference data sent by the data source device.
In another possible implementation manner, before the data application device sends the data synchronization request message to the data source device, the method may further include: firstly, the data application equipment can receive a change event notification message sent by the data source equipment, wherein the change event notification message carries change data and summary information of the change data; then, the data application device can change the data in the database according to the change event notification message so as to obtain the changed data; and the data application equipment updates the initial summary information stored by the data application equipment according to the summary information of the changed data so as to generate first summary information. In this possible implementation manner, the data application device may update the initial summary information by using the summary information of the changed data carried in the change event notification message sent by the data source device, so as to generate the first summary information.
In another possible implementation manner, before the data application device updates the initial summary information stored by the data application device according to the summary information of the changed data to generate the first summary information, the method may further include: the data application device may determine to write summary information of the changed data into the initial summary information according to a change time, where the change time identifies a time at which the data application device changes data in the database to obtain the changed data, and the determination is based on the change time falling within a preset time range of the initial summary information. In this possible implementation manner, the initial summary information stored by the data application device is summary information of changed data that is recorded by the data application device and changed within a preset time range, and the data application device may determine to write the summary information of the changed data into the initial summary information according to a change time of the changed data obtained by changing data of the database by the data application device. Then, when the subsequent data source equipment compares the first abstract information with the second abstract information, the data source equipment compares the first abstract information with the second abstract information, and the data source equipment compares the first abstract information with the second abstract information, so that compared with the prior art that all data are compared, the comparison workload is greatly reduced, and the data synchronization efficiency is improved.
In another possible implementation manner, the updating, by the data application device, the initial summary information so as to generate the first summary information may specifically include: firstly, the data application device encodes the summary information of the changed data to obtain the encoded summary information of the changed data, wherein the encoding mode comprises at least one of the following modes: a hash operation or an exclusive or operation; then, the data application apparatus may use the encoded digest information of the changed data and the initial digest information as the first digest information.
In another possible implementation manner, the sending, by the data application device, the data synchronization request message to the data source device may include: and the data application equipment sends a data synchronization request message to the data source equipment according to a preset period. In this possible implementation manner, the data application device may periodically send a data synchronization request message to the data source device, and actively and periodically request data synchronization from the data source device.
A third aspect of the embodiments of the present application provides a data transmission apparatus, where the data transmission apparatus has a function of implementing a behavior of the data source device in the first aspect, and the function may be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions.
A fourth aspect of the embodiments of the present application provides another data transmission apparatus, where the data transmission apparatus has a function of implementing a behavior of the data application device in the second aspect, and the function may be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions.
A fifth aspect of the embodiments of the present application provides a data transmission apparatus, including: a processor, a memory, an input-output device, and a bus; the memory having stored therein computer instructions; when the processor executes the computer instructions in the memory, the memory stores the computer instructions; the processor, when executing the computer instructions in the memory, is adapted to implement any of the implementations of the first aspect.
In one possible implementation, the processor, the memory, and the input/output device are respectively connected to the bus.
A sixth aspect in an embodiment of the present application provides another data transmission apparatus, including: a processor, a memory, an input-output device, and a bus; the memory having stored therein computer instructions; when the processor executes the computer instructions in the memory, the memory stores the computer instructions; the processor, when executing the computer instructions in the memory, is adapted to implement an implementation as in any of the second aspects.
In one possible implementation, the processor, the memory, and the input/output device are respectively connected to the bus.
A seventh aspect of embodiments of the present application provides a computer program product including instructions, which when run on a computer, cause the computer to perform the implementation manner as in any one of the first aspect or the second aspect.
An eighth aspect of embodiments of the present application provides a computer-readable storage medium, which is characterized by instructions that, when executed on a computer, cause the computer to perform the implementation manner as in any one of the first aspect or the second aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
according to the technical scheme, the data source equipment can receive a data synchronization request message sent by the data application equipment, and the message carries first summary information of changed data stored by the data application equipment; then, the data source device may determine difference data between the data source device and the data application device according to the first summary information and second summary information of the change data stored by the data source device, and transmit the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data. Therefore, the data source device may determine difference data by comparing the first summary information carried in the data synchronization request message sent by the data application device with the second summary information stored by the data source device, and then send the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data. Therefore, in the scheme, the data source device can send the difference data instead of sending all data every time of data synchronization, and the network resource overhead for sending data during data synchronization is reduced.
Drawings
FIG. 1 is a schematic diagram of an application scenario framework according to an embodiment of the present application;
fig. 2 is a schematic diagram of an embodiment of a data transmission method according to an embodiment of the present application;
fig. 3A is a schematic diagram of another embodiment of a data transmission method according to an embodiment of the present application;
fig. 3B is a schematic diagram of another embodiment of a data transmission method according to an embodiment of the present application;
fig. 3C is a schematic view of a scene of a data transmission method according to an embodiment of the present application;
fig. 4A is a schematic diagram of another embodiment of a data transmission method according to an embodiment of the present application;
fig. 4B is a schematic diagram of another embodiment of a data transmission method according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 6 is another schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 7 is another schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 8 is another schematic structural diagram of a data transmission device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a data transmission method and a data transmission device, which are used for reducing the overhead of network resources for sending data during data synchronization.
The distributed database system includes a distributed database management system and a distributed database. In a distributed database system, an application program can transparently operate a database, data in the database are respectively stored in different local databases, different database management systems are used for management, run on different machines, are supported by different operating systems and are connected together by different communication networks.
In the network operation process, when the data of the distributed database system is changed, the data source equipment sends a change event notification message to the data application equipment, and then the data application equipment can update the data according to the change event notification message to realize data synchronization. For example, as shown in fig. 1, the central node device may receive a change event notification message sent by the area node device 1, and then update the database of the central node device according to the change event notification message, so as to implement data synchronization.
It should be noted that fig. 1 only illustrates an application scenario of performing data synchronization between a central node device and a regional node device, and in practical application, the data transmission method in the embodiment of the present application is also applicable to a data synchronization process between any two node devices in a distributed database system, and the present application is not limited specifically.
However, under abnormal conditions such as a network failure and a network system downtime, the change event notification message sent by the data source device may be lost, so that the data of the data application device cannot be synchronized with the data of the data source device, and the data application device needs to periodically and actively perform data synchronization, thereby ensuring the consistency of the data. At present, data application equipment sends a data synchronization request message to data source equipment, then the data source equipment queries all locally stored data, and then sends the all data to the data application equipment, so that the data application equipment compares the all data with the local data, identifies difference data, and updates a data state. However, after receiving the data synchronization request message sent by the data application device, the data source device needs to send all locally stored data to the data application device, which results in a large network resource overhead.
In view of this, embodiments of the present application provide a data transmission method and a data transmission apparatus, which are used to reduce overhead of network resources for sending data during data synchronization. In the embodiment of the application, the data source device may receive a data synchronization request message sent by the data application device, and the message carries first summary information of changed data stored in the data application device; then, the data source device may determine difference data according to the first summary information and second summary information of the changed data stored by the data source device, and transmit the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data. Therefore, the data source device may determine difference data by comparing the first summary information carried in the data synchronization request message sent by the data application device with the second summary information stored by the data source device, and then send the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data. Therefore, in the scheme, the data source device can send the difference data instead of sending all data every time of data synchronization, and the network resource overhead for sending data during data synchronization is reduced. Wherein the data source device is a node device that generates data in the distributed database system, and the data application device is a node device that uses data in the distributed database system. Secondly, the data source device and the data application device are a relative concept, and for the same node device, when the node device provides data to other node devices, the node device is the data source device; when the node device requests data from other node devices, the node device is a data application device.
Please refer to fig. 2, which is a diagram illustrating a data transmission method according to an embodiment of the present application. As shown in fig. 2, an embodiment of a data transmission method in the embodiment of the present application includes:
201. and the data source equipment receives the data synchronization request message sent by the data application equipment.
In the network operation process, under abnormal conditions such as a network fault or a network system downtime, a change event notification message sent by a data source device may be lost, so that data of a data application device cannot be synchronized with data of the data source device, the data application device needs to periodically and actively perform data synchronization, and the consistency of the data is ensured. The data source device may receive a data synchronization request message sent by the data application device, where the data synchronization request message carries first digest information of data stored by the data application device, and the first digest information may include a first identifier and a first version number, where the first identifier is used to identify modified data of the data application device, and the first version number is used to identify a version of the modified data corresponding to the first identifier.
It should be noted that the data application device may periodically send a data synchronization request message to the data source device, so as to implement that the data application device actively and periodically performs data synchronization. Second, the summary information of the changed data may be stored in a list form or a queue form, and the present application is not limited in this respect.
202. The data source device determines difference data between the data source device and the data application device according to the first summary information and the second summary information stored by the data source device.
The data source device may compare the first summary information with second summary information stored by the data source device, and determine difference data between the data source device and the data application device. The second summary information includes a second identifier and a second version number, where the second identifier is used to identify the changed data of the data source device, and the second version number is used to identify the version of the changed data corresponding to the second identifier.
The data source device compares the first summary information with the second summary information, and the specific comparison manner may be various, which is exemplified below:
1. the data source device may determine whether the data of the data application device is synchronized with the data in the data source device directly by comparing whether the first version number of the changed data corresponding to the first identifier is consistent with the second version number of the changed data corresponding to the second identifier.
Specifically, in the case where the first identifier and the second identifier are the same, if the corresponding first version number and the second version number are different, it indicates that the changed data corresponding to the first identifier stored in the data application device is not in the latest state, and there is a difference between the changed data corresponding to the second identifier stored in the data source device, and then the data source device may determine that the difference data is the changed data corresponding to the second identifier with the second version number. For example, in the second digest information, the second version number of the data with the second identifier 00 is version2, while in the first digest information, the first version number of the data with the first identifier 00 is version1, and there is no version number of version2, the data source device may determine that the first version number and the second version number do not match, that is, may determine that the second identifier is an identifier of difference data.
If the corresponding first version number and the second version number are also the same, it indicates that the data in the data application device and the data in the data source device are synchronized. The data source device may return a message to the data application device that the data is synchronized.
For the case that the second identifier does not exist in the first summary information, that is, the first identifier identical to the second identifier does not exist in the first summary information, it indicates that the changed data corresponding to the second identifier in the data application device has not been changed, or the changed data corresponding to the second identifier does not exist in the data application device, and the data source device has difference data, so that the data source device may determine that the difference data is the changed data corresponding to the second identifier with the second version number. For example, in the second digest information, the second version number of the data with the second identifier of 00 is version2, and in the first digest information, the second identifier of 00 does not exist, that is, there is no record in the data application apparatus for changing the data with the identifier of 00, and the data source apparatus may determine that the second identifier is an identifier of difference data.
2. The second summary information is summary information of the modified data obtained by the data source device through encoding, and the first summary information is summary information of the modified data obtained by the data application device through encoding, wherein the encoding mode includes at least one of the following: a hash operation or an exclusive or operation. Then, the data source device may decode and determine the difference data by a corresponding decoding manner, and a specific process of the data source device by the comparison manner is described in detail in step 305 in fig. 3A.
It should be noted that the second summary information stored by the data source device may be cached in the memory. In an optional implementation manner, the data source device may further store the second summary information in a local disk, so as to avoid a problem that the second summary information is lost when a network failure or downtime occurs. Similarly, the data application device may further store the first summary information in its local disk.
203. The data source device sends the difference data to the data application device.
The data source device determines difference data between the data source device and the data application device, and specifically, may obtain the difference data according to the identifier of the difference data in step 202. Then, the data source device may send the difference data to the data application device, so that the data application device may perform data synchronization according to the difference data, where the difference data may be change data corresponding to the first identifier of the first version number. Therefore, when the data application equipment requests the data synchronization to the data source equipment, the data source equipment can directly return the difference data, and then the data application equipment updates the local database according to the difference data to realize the data synchronization. Therefore, compared with the traditional scheme, the data synchronization efficiency of the technical scheme is high.
In the embodiment of the application, the data source device may receive a data synchronization request message sent by the data application device, where the data synchronization request message carries first summary information of data stored in the data application device; then, the data source device may determine difference data according to the first summary information and second summary information of the data stored by the data source device, and transmit the difference data in a latest state to the data application device. Therefore, the data source equipment can send the difference data without sending all data during each data synchronization, thereby reducing the network resource overhead for sending the data during the data synchronization; and secondly, the data source equipment determines the difference data by comparing the first abstract information with the second abstract information, and compared with the prior art that all data are compared, the efficiency of determining the difference data is improved, so that the efficiency of data synchronization is improved.
In the embodiment of the present application, summary information of the changed data may be stored in a list form or a queue form, and in the following embodiments, the summary information in the list form is taken as an example for description.
The second summary information may be summary information of the changed data that is changed within a preset time length range recorded by the data source device, and the first summary information may be summary information of the changed data that is changed within the preset time length range recorded by the data application device. The preset time length (time T) may be a change period preset by the system, may also be set manually, or may also be adaptively adjusted according to the data change situation, for example, when the data change frequency is high, the time T is reduced, and when the data change frequency is low, the time T is increased.
Optionally, in step 201, the data application device periodically sends a data synchronization request message to the data source device, and a period for the data application device to send the message for data synchronization may also be set to be time T, which is the same as the preset duration of the summary information.
Optionally, the data source device may write the summary information in an encoding manner, and the specific encoding manner may include at least one of the following: a hash operation or an xor operation, which is not limited herein. Similarly, the summary information of the changed data after the data application device is changed within the preset time range can be written in by the data application device in a coding manner. In the following embodiments, the data source device performs hash operation on the digest information of the changed data in the data source device within the preset time range, then performs xor operation on the digest information, and writes the hash operation into the list of the stored initial digest information in the data source device, so as to obtain the second digest information.
In the embodiment of the application, the data source device may update data in the database according to the first change event notification message to obtain first change data; and then generating summary information of the first changed data according to the first change event notification message, and encoding the summary information of the first changed data and writing the encoded summary information of the first changed data into the initial summary information stored in the data source device to obtain second summary information. Referring to fig. 3A, another embodiment of a data transmission method in the embodiment of the present application includes:
301. the data source device obtains a first change event notification message.
In the network operation process, when data is changed, the data source device may obtain a first change event notification message, where the first change event notification message carries the data to be changed. Optionally, the first change event notification message carries an identifier of the data to be changed, a method for changing the data, or directly carries first change data that should be obtained after the data is changed.
302. And the data source equipment updates the database of the data source equipment according to the first change event notification message so as to obtain the first change data.
The data source device may update the local database according to the first change event notification message. The data source device may determine the data to be changed by using the identifier of the data to be changed, and change the data by using a method of changing the data to obtain the first changed data. The data source device may also determine the data to be changed by using the identifier of the data to be changed, and directly replace the data with the first changed data.
303. And the data source equipment updates the initial summary information stored by the data source equipment according to the first change event notification message to generate second summary information.
After the data source device determines the first changed data, first, summary information of the first changed data can be generated; and then, updating the initial summary information stored in the data source equipment according to the summary information of the first change data to generate second summary information. The process of generating the second summary information by the data source device is described in detail below with reference to fig. 3B, where:
3031. the data source device determines an identifier of the first change data from the first change event notification message.
The first change event notification message carries an identifier of the first change data, which the data source device may determine. For example, if the identifiers of data a and data B stored by the data source device are 1 and 2, respectively, and the first change event notification message carries the identifier of data a, that is, the identifier is 1, the data source device may determine that the first change data is data a.
3032. The data source device determines an initial version number of the first changed data from initial digest information stored by the data source device according to the identifier of the first changed data.
The data source device may determine an initial version number of the first changed data from the initial summary information stored in the data source device, where the initial version number may be understood as a version number corresponding to changed data in which the first changed data is changed the last time from a current time in the initial summary information stored in the data source device, and the current time may be understood as a time when the data source device receives the first change event notification message. For example, as shown in table 1, table 1 shows that, when data a and data B extracted from the initial digest information stored in the data source device are changed within a preset time period, if data a is the first change data, table 1 shows that the version number of the change data of data a that has been changed the last time from the current time is version2, that is, the initial version number of data a is version 2.
TABLE 1
Identifier Version number version
Data A 1 version1
Data A 1 version2
Data B 2 version1
Data B 2 version2
It should be noted that, when the initial version number of the first modified data does not exist in the initial summary information stored in the data source device, the data source device may determine that the time of the previous modification of the modified data is not within the preset time length range of the initial summary information. The data source device may determine the initial version number of the changed data by searching the digest information of the changed data stored before the preset time range, or may set the initial version number to a preset value, for example, version 0.
3033. And the data source equipment increases the initial version number by a preset number to obtain the latest version number of the first change data.
For example, the version number is increased by one every time data a is changed, and as shown in table 1, the version number of data a is version2, and the version number is version 3.
3034. The data source device takes the identifier of the first changed data and the latest version number of the first changed data as the digest information of the first changed data.
3035. And the data source equipment determines that the first change time falls within the preset time range of the initial summary information.
The data source device updates the database of the data source device according to the first change event notification message to obtain the first change data, and then the first change time may be understood as a time when the data source device updates its database to obtain the first change data. Then, the data source device may determine that the first change time falls within a preset time range of the initial summary information, so that the data source device determines to write the summary information of the first change data into the initial summary information stored in the data source device; the initial summary information stored by the data source equipment is summary information of changed data which is recorded by the data source equipment and is changed from the starting time within the preset time range to the current time.
Specifically, the initial summary information includes a summary information establishment time, which may be a time corresponding to a first change event recorded when the initial summary information is established. And the data source equipment judges whether the difference between the first change time and the summary information establishing time is greater than a preset time length, if the difference is greater than the preset time length, the data source equipment indicates that the first change time is out of the preset time length range of the initial summary information, the data source equipment reestablishes second summary information, and the summary information of the first change data is written into the newly-established summary information. If the difference is smaller than or equal to the preset time length, the first change time is within the preset time length range of the initial summary information, and the data source equipment writes the summary information of the first change data into the initial summary information and updates the initial summary information.
3036. And the data source equipment updates the initial summary information stored by the data source equipment according to the summary information of the first change data so as to generate second summary information.
The data source device may update the initial summary information according to the summary information of the first changed data, thereby obtaining second summary information. The specific generation process is as follows: firstly, the data source equipment encodes the first change data; then, the summary information of the encoded first changed data is written into a list storing the initial summary information so as to obtain the second summary information.
The generation process is described below with reference to specific examples: first, initial summary information stored in a data source device is introduced, and a storage structure of the initial summary information stored in a list form is provided in the embodiment of the present application. As will be described below with reference to fig. 3C, in fig. 3C, the initial digest information is composed of a plurality of units, each unit stores three fields, and the three fields are three variables, including keySum, keyHashSum, and count. The key sum is equal to key sum or equal to xor sign, and the upper bit of the key stores the identifier of the changed data and the lower bit stores the hash value of the sum of the identifier of the changed data and the version number of the changed data. hashk (x) is a hash function, keyHashSum ≧ hashk (keysum), and count is the number of summary information of the change data stored in the corresponding unit.
If the length of the list storing the initial digest information is m, where m may be understood as the number of units included In the list, and the inserted data element is n, and the data element may be understood as the digest information of the modified data corresponding to the n different identifiers included In the list, and the number of the inserted functions hashk (x) is k, when k is m In2/n, the error rate of decoding the digest information by the data source device is the lowest.
By way of specific example, please refer to table 2, where table 2 is a list of initial digest information stored in the data source device, the list includes 4 units, that is, length m is 4, and four inserted data elements, which are digest information of data A, B, C and D, respectively.
TABLE 2
Figure BDA0002005945250000111
Data a is first change data, and data a is encoded and written in table 2. The specific process is as follows: first, the data source device determines to which specific units in table 2 the summary information of data a may be allocated, and determines, according to a formula hashk (id + version)% m, that the summary information of data a is allocated to k units, and if k is 3, allocates the summary information of data a to three of the units, where: if hash1(a) is 4, i1 is 4% 0,% being the remainder symbol, i.e. assigned to the first cell in the list, L Δ [0 ]; if hash2(a) is 6, i2 is 6% 4 is 2, i.e. assigned to the third cell in the list, i.e. L Δ 2; hash3(a) 10, i3 11% 4 3, assigned to the fourth cell in the list, L Δ 3; therefore, it can be determined that the digest information of the data a is respectively allocated to the first unit, the third unit, and the fourth unit in table 2. The data source equipment writes the summary information of the data A into a first unit, a third unit and a fourth unit in the table 2 respectively; and performing an exclusive-or operation with the initial summary information stored in the first field of each unit in table 2, respectively, to obtain, as shown in table 3, the first field of the first unit is a ≧ C, the first field of the third unit is a ≦ B ≦ D, the first field of the fourth unit is a ≦ B ≦ C ≦ D, where ≦ is an exclusive-or operation symbol.
And for the second field, the same is also applied, the hash operation is firstly performed on the data A, and then the XOR operation is performed on the data A and the original abstract information of the field of the corresponding unit. Specifically, as shown in table 3, the second field of the first unit is hash (a) × (c), the second field of the third unit is hash (a) × (b) × (d), and the second field of the fourth unit is hash (a) × (b) × (c).
And the third field of the unit is used for recording the number of the summary information of the changed data stored by the unit. Since the data source device writes the summary information of the data a into the corresponding three units, 1 is added to the third fields in the three units, and if the third field in the first unit is changed to 2, the data source device indicates that the summary information of the changed data of the data a and the data C is stored. Specifically, after the summary information of the first changed data is encoded, the first changed data is written into the list storing the initial summary information, so as to obtain table 3, as shown in table 3:
TABLE 3
Figure BDA0002005945250000121
304. And the data source equipment receives the data synchronization request message sent by the data application equipment.
The data source device may receive a data synchronization request message sent by the data application device, where the data synchronization request message carries first digest information stored in the data application device. Wherein, the data application device may periodically send a data synchronization request message to the data source device. For example, the list storing the first summary information is as shown in table 4.
TABLE 4
Figure BDA0002005945250000122
305. And the data source equipment executes exclusive-OR operation on the list for storing the second abstract information and the list for storing the first abstract information according to the unit of the unit to obtain the abstract information of the difference data.
The data source device may perform an exclusive or operation on the list storing the second digest information and the list storing the first digest information in units of cells to obtain the digest information of the difference data. The following are given by way of specific examples: table 3 and table 4 are exclusive-ored in units of cells, table 3 is denoted as List3, table 4 is denoted as List4, and table 5 is a List storing summary information of disparity data, and is denoted as L Δ, which is equivalent to List3 and List 4. The data source device may identify the unit of the list L Δ where the summary information of the difference data is located, that is, the unit of the list L Δ where the summary information of the difference data is located, where the difference data is C and D, in the L Δ, or the unit of the list L Δ where the count is 1 or the count is 1 and the hash (keysum) is located, as can be seen from table 5. The data source device may intercept the high order bits of the digest information keySum of the difference data to restore the identifier of the difference data. In the present example, L.DELTA.0 and L.DELTA.2 are summary information of the difference data, and the identifiers of the difference data C and D can be determined.
TABLE 5
Figure BDA0002005945250000123
Then, the data source apparatus removes the summary information of the difference data C and D identified in L Δ from L Δ, i.e., L Δ 1, as shown in table 5:
TABLE 6
Figure BDA0002005945250000131
Then, exclusive or operation is performed on L Δ [0] and L Δ 1 for each unit, and L Δ 2 ═ L Δ 1 ≦ L Δ [0], as shown in table 7:
TABLE 7
Figure BDA0002005945250000132
Then, exclusive or operation is performed on L Δ 2 and L Δ 2 for each unit, and L Δ 3 ≧ L Δ 2 ≦ L Δ 2, as shown in table 8:
TABLE 8
Figure BDA0002005945250000133
As can be seen from table 8, if the value of each cell in the table is 0, it can be said that the comparison process of the difference data is finished, i.e. the difference data can be determined as C and D. For another example: the list L1 storing the second digest information is shown in table 9 below:
TABLE 9
Figure BDA0002005945250000134
And the list L2 storing the first digest information is shown in table 10:
watch 10
Figure BDA0002005945250000141
The data source apparatus exclusive-ors L1 and L2 in units of cells, that is, L Δ ═ L1 ≦ L2, which results in table 11:
TABLE 11
Figure BDA0002005945250000142
As can be seen from Table 11, A and E are difference data. A and E were then removed from L Δ, respectively, to yield table 12, i.e., L Δ 1:
TABLE 12
Figure BDA0002005945250000143
Then, exclusive or operation is performed on a and L Δ 1 to obtain table 13, that is, L Δ 2 ═ L Δ 1 · a:
watch 13
Figure BDA0002005945250000151
Then as can be seen from table 13, if the difference data is A, E and C, then C is removed from table 13 to give table 14, i.e., L Δ 3:
TABLE 14
Figure BDA0002005945250000152
Then, exclusive or operation is performed on L Δ 3 and E to obtain table 15, that is, L Δ 4 ═ L Δ 3 ≦ E:
watch 15
Figure BDA0002005945250000153
Then, exclusive or operation is performed on L Δ 4 and C to obtain table 16, that is, L Δ 5 ═ L Δ 4 ≦ C:
TABLE 16
Figure BDA0002005945250000154
Then it can be seen that the value of each cell in table 16 is 0, which can indicate that the alignment process of the difference data is finished, i.e. the difference data can be determined to be A, E and C. According to the comparison process, the list storing the second abstract information is compared with the list storing the first abstract information to obtain the list storing the abstract information of the difference data, namely, the difference data is determined preliminarily. And performing exclusive-OR operation on the determined difference data and the identified list for storing the summary information of the difference data respectively to further identify the summary information of all the difference data.
In this embodiment, the data application device performs data synchronization on the changed data that is changed within the preset time length range, that is, the list storing the second summary information records summary information of the changed data that is changed within the preset time length range in the data source device, and the list storing the first summary information records summary information of the changed data that is changed within the preset time length range in the data application device. Therefore, in step 305, when the data source device performs comparison, the summary information of the changed change data stored in the data source device in the preset time length range is compared with the summary information of the changed change data stored in the data application device in the preset time length range, which greatly reduces the comparison workload compared with the prior art for comparing all data, thereby improving the data synchronization efficiency. Compared with the summary information of all data, the comparison efficiency is improved, and the high-efficiency data synchronization is realized.
306. The data source device obtains the difference data from a database of the data source device according to the identifier of the difference data.
After the data source device determines the difference data in step 305, an identifier of the difference data may be determined and the difference data may be stored from the data source device database. For example, in step 305, the data source device may determine identifiers of the difference data C and the difference data D by the upper bits of KeySum in the summary information of the difference data, and acquire the data C and the data D in the latest state from the local database.
307. The data source device transmits the difference data and the summary information of the difference data to the data application device.
The data source device may acquire the summary information of the difference data from the local database and then transmit the difference data and the summary information of the difference data to the data application device.
308. The data application device updates the database of the data application device based on the difference data.
When the data application device receives the difference data, the data application device may update the local database. For example, if the difference data is determined to be C and D in step 305, the data application device may update the locally stored C and D.
309. The data application device updates the first summary information according to the summary information of the difference data.
After the data application device obtains the summary information of the difference data, the summary information of the difference data may be written into the list for storing the first summary information, where a specific process of writing the summary information of the difference data into the list for storing the first summary information by the data application device is similar to a process of encoding the summary information of the first changed data by the data source device and writing the summary information of the first changed data into the list for storing the initial summary information by the data source device in step 3036 in fig. 3B, and details are not repeated here.
It should be noted that the data application device may periodically send the data synchronization request message described in the embodiment in fig. 3A to the data source device to actively and periodically perform data synchronization. In the network operation process, when data is changed, the data source device may send a second change event notification message to the data application device, so that the data application device updates the local database according to the second change event notification message, thereby implementing data synchronization, which is described in detail in fig. 4A below, where the process includes:
401. the data source device transmits a second change event notification message to the data application device.
In the network operation process, when data is changed, the data source device may send a second change event notification message to the data application device, where the second change event notification message carries the data to be changed. Optionally, the second change event notification message carries an identifier of the data to be changed, a method for changing the data, or directly carries second change data that should be obtained after the data is changed.
402. And the data application device updates the database of the data application device according to the second change event notification message so as to obtain second change data.
The data application device may update the local database in accordance with the second change event notification message. The data application device may determine the data to be changed through the identifier of the data to be changed carried in the second change event notification message, and then change the data by using the method for changing the data to obtain the second changed data. The data application device can also determine the data to be changed through the identifier of the data to be changed, and directly replace the data with the second changed data.
403. And the data application equipment updates the initial summary information stored by the data source equipment according to the first change event notification message to generate first summary information.
The second change event notification message carries summary information of the second change data, and the data application device may determine the summary information of the second change data from the second change event notification message. Then, the data application apparatus may update the initial summary information stored by the data application apparatus according to the summary information of the second change data to generate the first summary information. The process of generating the first summary information by the data application apparatus is described in detail below with reference to fig. 4B, and the request is shown in fig. 4B:
4031. and the data application equipment determines that the second change time falls within the preset time range of the initial summary information stored by the data application equipment.
Step 4031 is similar to step 3035 in fig. 3B, please refer to the description of step 3035 in fig. 3B in detail, and details thereof are not repeated herein.
4032. The data application device encodes the summary information of the second changed data and writes the encoded summary information into a list of initial summary information stored in the data application device, so as to obtain the first summary information.
The process of encoding the summary information of the second changed data and the process of writing the stored list of the initial summary information by the specific data application apparatus are similar to the foregoing step 3036 in fig. 3B, and please refer to the detailed description of the foregoing step 3036 in fig. 3B, which is not described herein again.
In the embodiment of the application, the data source device may receive a data synchronization request message sent by the data application device, and the message carries first summary information of changed data stored in the data application device; then, the data source device may determine difference data from the first summary information and second summary information of the change data stored by the data source device, and transmit the difference data in a latest state to the data application device. Therefore, the data source device can transmit the difference data without transmitting all data at each data synchronization, thereby reducing the network resource overhead for transmitting data at the data synchronization. And secondly, the data source equipment determines the difference data by comparing the first abstract information with the second abstract information, and compared with the prior art that all data are compared, the efficiency of determining the difference data is improved, so that the efficiency of data synchronization is improved.
With reference to fig. 5, the data transmission method in the embodiment of the present application is described above, and the following describes the data transmission device 500 in the embodiment of the present application, where an embodiment of the data transmission device 500 in the embodiment of the present application includes:
a transceiver module 501, configured to receive a data synchronization request message sent by a data application device, where the data synchronization request message carries first summary information of change data stored in the data application device; specific methods are shown in 201 and 202 in the embodiment shown in fig. 2, 301, 304 and 307 in the embodiment shown in fig. 3A, 401 in the embodiment shown in fig. 4A, and the like;
a processing module 502, configured to determine difference data between the data source device and the data application device according to the first summary information and second summary information of the change data stored by the data transmission apparatus; specific methods refer to 202 in the embodiment shown in fig. 2, 302, 303, 305 and 306 in the embodiment shown in fig. 3A, 3031, 3032, 3033, 3034, 3035 and 3036 in the embodiment shown in fig. 3B, and the like.
The transceiver module 501 is configured to send the difference data to the data application device, where the difference data is used for data synchronization of the data application device.
In this embodiment of the present application, the transceiver module 501 may receive a data synchronization request message sent by a data application device, where the data synchronization request message carries first summary information of changed data stored in the data application device; then, the processing module 502 may determine difference data according to the first summary information and second summary information of the change data stored by the data transmission apparatus; then, the transceiving module 501 transmits the difference data of the latest state to the data application apparatus. Therefore, the transceiver module 501 can transmit the differential data instead of transmitting all data every time of data synchronization, thereby reducing the network resource overhead for transmitting data during data synchronization; secondly, the processing module 502 determines the difference data by comparing the first summary information and the second summary information, which improves the efficiency of determining the difference data and thus improves the efficiency of data synchronization compared with the prior art in which all data are compared.
With reference to fig. 6, the data transmission method in the embodiment of the present application is described above, and the following describes the data transmission device 600 in the embodiment of the present application, where an embodiment of the data transmission device 600 in the embodiment of the present application includes:
a transceiver module 601, configured to send a data synchronization request message to a data source device, where the data synchronization request message carries first summary information of changed data stored in the data transmission apparatus;
the transceiver module 601 is configured to receive difference data sent by the data source device, where the difference data is difference data between the data source device and the data application device; specific methods are seen in 201 and 203 of the embodiment shown in fig. 2, 304 and 307 of the embodiment shown in fig. 3A, 401 of the embodiment shown in fig. 4A, and so on.
A processing module 602, configured to perform data synchronization according to the difference data; specific methods are described with reference to 308 and 309 of the embodiment shown in fig. 3A, 402 and 403 of the embodiment shown in fig. 4A, 4031 and 4032 of the embodiment shown in fig. 4B, and the like.
In this embodiment of the application, the transceiver module 601 requests data synchronization to the data source device, the transceiver module 601 may receive difference data between the data source device and the data application device, which is sent by the data source device, and then the processing module 602 updates the local database according to the difference data to implement data synchronization. Therefore, compared with the conventional scheme that all data are sent and the processing module 602 needs to compare all data, the technical scheme of the application does not need to compare, the processing module 602 can directly perform data synchronization according to the difference data, and the data synchronization efficiency is high.
Referring to fig. 7, an embodiment of a data transmission apparatus 700 is provided, where the data transmission apparatus in the embodiment of the present application includes:
a processor 701, a memory 702, an input-output device 703, and a bus 704;
in one possible implementation, the processor 701, the memory 702, and the input/output device 703 are respectively connected to a bus 704, and the memory stores computer instructions.
The processing module 502 in the foregoing embodiment may be specifically the processor 701 in this embodiment, and therefore details of the specific implementation of the processor 701 are not described again. The transceiver module 501 in the foregoing embodiment may specifically be the input/output device 703 in this embodiment.
Referring to fig. 8, another data transmission apparatus 800 is provided, in which an embodiment of the data transmission apparatus in the embodiment of the present application includes:
a processor 801, a memory 802, an input-output device 803, and a bus 804;
in one possible implementation, the processor 801, the memory 802, and the input/output device 803 are each coupled to a bus 804, and the memory stores computer instructions.
The processing module 602 in the foregoing embodiment may be specifically the processor 801 in this embodiment, and therefore details of the specific implementation of the processor 801 are not described again. The transceiver module 601 in the foregoing embodiment may specifically be the input/output device 803 in this embodiment.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (21)

1. A method of data transmission, the method comprising:
the data source equipment acquires a first change event notification message;
the data source equipment changes data in a database according to the first change event notification message so as to obtain first change data;
the data source equipment determines to write summary information of the first changed data into initial summary information stored by the data source equipment according to first change time, wherein the first change time is used for identifying the time for the data source equipment to change data in the database to obtain the first changed data, and the determination is based on the fact that the first change time falls within a preset duration range of the initial summary information;
the data source equipment updates the initial summary information stored in the data source equipment according to the first change event notification message to generate second summary information;
the data source equipment receives a data synchronization request message sent by data application equipment, wherein the data synchronization request message carries first summary information of changed data stored by the data application equipment;
the data source equipment determines difference data between the data source equipment and data application equipment according to the first summary information and the second summary information of the change data stored in the data source equipment;
and the data source equipment sends the difference data to the data application equipment, and the difference data is used for data synchronization of the data application equipment.
2. The method according to claim 1, wherein the first summary information includes a first identifier and a first version number, the first identifier is used for identifying changed data of the data application device, the first version number is used for identifying a version of the changed data corresponding to the first identifier, the second summary information includes a second identifier and a second version number, the second identifier is used for identifying changed data of the data source device, the second version number is used for identifying a version of the changed data corresponding to the second identifier, and the data source device determines difference data between the data source device and the data application device according to the first summary information and second summary information of the changed data stored by the data source device, and specifically includes:
the data source equipment determines the identifier of the difference data according to a first identifier and a first version number of first summary information and a second identifier and a second version number of second summary information;
the data source device determines the difference data from an identifier of the difference data.
3. The method according to claim 1, wherein the data source device updates initial summary information stored in the data source device according to the first change event notification message to generate the second summary information, specifically including:
the data source device determines an identifier of the first change data according to the first change event notification message;
the data source equipment determines an initial version number of the first changed data from the initial summary information according to the identifier of the first changed data, wherein the initial version number is a version number corresponding to the changed data, changed for the first time, of the first changed data in the initial summary information, and the current time is the time when the data source equipment receives the first change event notification message;
the data source equipment increases the initial version number by a preset amount to obtain the latest version number of the first change data;
and the data source equipment takes the identifier of the first change data and the latest version number of the first change data as summary information of the first change data, and updates the initial summary information so as to generate the second summary information.
4. The method according to claim 3, wherein the data source device updates the initial summary information to generate the second summary information, specifically comprising:
the data source equipment encodes the summary information of the first changed data to obtain the encoded summary information of the first changed data, wherein the encoding mode comprises at least one of the following modes: a hash operation or an exclusive or operation;
and the data source equipment takes the coded summary information and the initial summary information as the second summary information.
5. The method according to claim 1 or 2, wherein after the data source device determines difference data according to the first summary information and second summary information of the change data stored by the data source device, the method further comprises:
and the data source equipment sends the summary information of the difference data to the data application equipment.
6. The method according to claim 1 or 2, wherein before the data source device receives the data synchronization request message sent by the data application device, the method further comprises:
and the data source equipment sends a second change event notification message to the data application equipment, wherein the second change event notification message carries second change data and summary information of the second change data, and the summary information of the second change data is used for the data application equipment to generate the first summary information.
7. A method of data transmission, the method comprising:
the data application equipment receives a change event notification message sent by data source equipment, wherein the change event notification message carries change data and summary information of the change data;
the data application equipment changes data in a database according to the change event notification message so as to obtain the changed data;
the data application equipment determines that summary information of the changed data is written into initial summary information stored by the data application equipment according to change time, the change time marks the time when the data application equipment changes data in the database to obtain the changed data, and the determination is based on the fact that the change time falls within a preset duration range of the initial summary information;
the data application equipment updates the initial summary information stored by the data application equipment according to the summary information of the changed data to generate first summary information;
the data application equipment sends a data synchronization request message to the data source equipment, wherein the data synchronization request message carries the first summary information of the changed data stored by the data application equipment;
the data application equipment receives difference data sent by the data source equipment, wherein the difference data is difference data between the data source equipment and the data application equipment;
the data application device performs data synchronization based on the difference data.
8. The method of claim 7, wherein after the data application device sends the data synchronization request message to the data source device, the method further comprises:
the data application equipment receives abstract information of the difference data sent by the data source equipment;
and the data application equipment updates the first summary information according to the summary information of the difference data.
9. The method according to claim 7, wherein the data application device updates the initial summary information to generate the first summary information, and specifically includes:
the data application equipment encodes the summary information of the changed data to obtain the encoded summary information of the changed data, wherein the encoding mode comprises at least one of the following modes: a hash operation or an exclusive or operation;
and the data application equipment takes the coded summary information of the changed data and the initial summary information as the first summary information.
10. The method according to any one of claims 7 to 9, wherein the data application device sending a data synchronization request message to a data source device comprises:
and the data application equipment sends a data synchronization request message to the data source equipment according to a preset period.
11. A data transmission apparatus, characterized in that the data transmission apparatus comprises:
a transceiver module, configured to acquire a first change event notification message;
the processing module is used for determining to write summary information of first changed data into initial summary information stored by the data transmission device according to first change time, wherein the first change time is used for identifying the time for the data transmission device to change data in a database so as to obtain the first changed data, and the determination is based on the fact that the first change time falls within a preset duration range of the initial summary information; changing data in a database according to the first change event notification message so as to obtain first change data; updating the initial summary information stored by the data transmission device according to the first change event notification message to generate second summary information;
the receiving and sending module is further configured to receive a data synchronization request message sent by a data application device, where the data synchronization request message carries first summary information of changed data stored in the data application device;
the processing module is used for determining difference data between the data transmission device and the data application equipment according to the first summary information and the second summary information of the changed data stored in the data source equipment;
the transceiver module is further configured to send the difference data to the data application device, where the difference data is used for data synchronization of the data application device.
12. The data transmission apparatus according to claim 11, wherein the first summary information includes a first identifier and a first version number, the first identifier is used to identify the changed data of the data application device, the first version number is used to identify a version of the changed data corresponding to the first identifier, the second summary information includes a second identifier and a second version number, the second identifier is used to identify the changed data of the data transmission apparatus, the second version number is used to identify a version of the changed data corresponding to the second identifier, and the processing module is specifically configured to:
determining an identifier of the difference data according to a first identifier and a first version number of first summary information and a second identifier and a second version number of second summary information;
determining the difference data from an identifier of the difference data.
13. The data transmission apparatus according to claim 11, wherein the processing module is specifically configured to:
determining an identifier of the first change data from the first change event notification message;
determining an initial version number of the first changed data from the initial summary information according to an identifier of the first changed data, wherein the initial version number is a version number corresponding to changed data, changed for the first time, of the first changed data in the initial summary information, and the current time is the time when the data transmission device receives the first change event notification message;
increasing the initial version number by a preset number to obtain the latest version number of the first change data;
and updating the initial summary information by taking the identifier of the first change data and the latest version number of the first change data as summary information of the first change data so as to generate the second summary information.
14. The data transmission apparatus according to claim 13, wherein the processing module is specifically configured to:
encoding the summary information of the first changed data to obtain the encoded summary information of the first changed data, wherein the encoding mode comprises at least one of the following modes: a hash operation or an exclusive or operation;
and taking the coded summary information and the initial summary information as the second summary information.
15. The data transmission apparatus according to any one of claims 11 to 14, wherein the transceiver module is further configured to:
and sending the summary information of the difference data to the data application equipment.
16. The data transmission apparatus according to any one of claims 12 to 14, wherein the transceiver module is further configured to:
and sending a second change event notification message to the data application device, wherein the second change event notification message carries second change data and summary information of the second change data, and the summary information of the second change data is used for the data application device to generate the first summary information.
17. A data transmission apparatus, characterized in that the data transmission apparatus comprises:
the receiving and sending module is used for receiving a change event notification message sent by the data source equipment, wherein the change event notification message carries change data and summary information of the change data;
the processing module is used for determining to write the summary information of the changed data into the initial summary information stored by the data transmission device according to the change time, wherein the change time marks the time for changing the data in the database by the data transmission device to obtain the changed data, and the determination is based on the change time falling into the preset duration range of the initial summary information; changing data in a database according to the change event notification message so as to obtain the changed data; updating the initial summary information stored by the data transmission device according to the summary information of the changed data to generate first summary information;
the transceiver module is further configured to send a data synchronization request message to a data source device, where the data synchronization request message carries the first summary information of the changed data stored in the data transmission apparatus; the data transmission device is used for receiving difference data sent by the data source equipment, wherein the difference data is difference data between the data source equipment and the data transmission device;
the processing module is further configured to perform data synchronization according to the difference data.
18. The data transmission apparatus of claim 17, wherein the transceiver module is further configured to:
receiving abstract information of the difference data sent by the data source equipment;
the processing module is further configured to:
and updating the first summary information according to the summary information of the difference data.
19. The data transmission apparatus according to claim 17, wherein the processing module is specifically configured to:
coding the summary information of the changed data to obtain the coded summary information of the changed data, wherein the coding mode comprises at least one of the following modes: a hash operation or an exclusive or operation;
and taking the coded summary information of the changed data and the initial summary information as the first summary information.
20. The data transmission apparatus according to any one of claims 17 to 19, wherein the transceiver module is specifically configured to:
and sending the data synchronization request message to the data source equipment according to a preset period.
21. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 10.
CN201910228420.8A 2019-03-25 2019-03-25 Data transmission method and data transmission device Active CN111741038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910228420.8A CN111741038B (en) 2019-03-25 2019-03-25 Data transmission method and data transmission device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910228420.8A CN111741038B (en) 2019-03-25 2019-03-25 Data transmission method and data transmission device

Publications (2)

Publication Number Publication Date
CN111741038A CN111741038A (en) 2020-10-02
CN111741038B true CN111741038B (en) 2022-02-25

Family

ID=72646256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910228420.8A Active CN111741038B (en) 2019-03-25 2019-03-25 Data transmission method and data transmission device

Country Status (1)

Country Link
CN (1) CN111741038B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672682B (en) * 2021-08-18 2022-04-01 广州有信科技有限公司 Synchronous frame based quantity synchronization method and synchronization device
CN117424893A (en) * 2023-12-19 2024-01-19 深圳竹云科技股份有限公司 Data transmission method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095226A (en) * 2014-04-25 2015-11-25 广州市动景计算机科技有限公司 Method and apparatus for loading webpage resource
CN105187475A (en) * 2015-06-09 2015-12-23 深圳市金蝶友商电子商务服务有限公司 Method and system for data synchronization

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109786A (en) * 1999-10-12 2001-04-20 Babcock Hitachi Kk System for supporting design
US20100293538A1 (en) * 2009-05-15 2010-11-18 Microsoft Corporation Dynamic program updating in a continuation based runtime
CN102098342B (en) * 2011-01-31 2013-08-28 华为技术有限公司 Transaction level-based data synchronizing method, device thereof and system thereof
US8510267B2 (en) * 2011-03-08 2013-08-13 Rackspace Us, Inc. Synchronization of structured information repositories
CN105743970A (en) * 2015-12-31 2016-07-06 武汉传神信息技术有限公司 Asynchronous data synchronization method for distributed systems
CN107103041A (en) * 2017-03-28 2017-08-29 广东网金控股股份有限公司 A kind of storage method and storage system of SQL SERVER database updates
CN109218418A (en) * 2018-09-04 2019-01-15 北京粉笔未来科技有限公司 Method of data synchronization and device calculate equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095226A (en) * 2014-04-25 2015-11-25 广州市动景计算机科技有限公司 Method and apparatus for loading webpage resource
CN105187475A (en) * 2015-06-09 2015-12-23 深圳市金蝶友商电子商务服务有限公司 Method and system for data synchronization

Also Published As

Publication number Publication date
CN111741038A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
US11632441B2 (en) Methods, systems, and devices for electronic note identifier allocation and electronic note generation
EP3208714A1 (en) Data reconstruction method, apparatus and system in distributed storage system
US10620830B2 (en) Reconciling volumelets in volume cohorts
EP1266309A2 (en) Method for optimization of synchronization between a client's database and a server database
CN112835738B (en) Method for constructing strip data storage structure
CN111741038B (en) Data transmission method and data transmission device
CN105512283A (en) Data quality management and control method and device
CN111147392B (en) Data synchronization method, device and equipment based on block chain and readable storage medium
US20200293220A1 (en) Log processing method, and related device and system
CN106993022B (en) Identification management method for cluster, identification server and corresponding system
CN116303789A (en) Parallel synchronization method and device for multi-fragment multi-copy database and readable medium
CN115686382B (en) Data storage and reading method
CN115982133A (en) Data processing method and device
CN116107801A (en) Transaction processing method and related product
CN105830063B (en) Coordinating small volumes in volume groups
CN112947847B (en) Method, apparatus and computer program product for storing data
CN113228595B (en) Method and device for transmitting records
CN103593369B (en) Inquiry and update method and processing system of HSS (home subscriber server) data
CN111427965A (en) Management method and management system for water affair data
CN107844259B (en) Data access method, routing device and storage system
CN113111086B (en) Data storage and query response method and block execution method
CN115168366B (en) Data processing method, data processing device, electronic equipment and storage medium
US20240104069A1 (en) Systems and methods of managing state machine systems with compacting distributed log storage
CN116915510B (en) Distributed storage system based on high-speed encryption algorithm
CN111796768B (en) Distributed service coordination method, device and system

Legal Events

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