CN110083614B - Data processing method and server - Google Patents

Data processing method and server Download PDF

Info

Publication number
CN110083614B
CN110083614B CN201910272205.8A CN201910272205A CN110083614B CN 110083614 B CN110083614 B CN 110083614B CN 201910272205 A CN201910272205 A CN 201910272205A CN 110083614 B CN110083614 B CN 110083614B
Authority
CN
China
Prior art keywords
data
data set
information
server
check
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
CN201910272205.8A
Other languages
Chinese (zh)
Other versions
CN110083614A (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201910272205.8A priority Critical patent/CN110083614B/en
Publication of CN110083614A publication Critical patent/CN110083614A/en
Priority to PCT/CN2020/072336 priority patent/WO2020199724A1/en
Application granted granted Critical
Publication of CN110083614B publication Critical patent/CN110083614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a data processing method and a server, wherein the method comprises the following steps: after obtaining first information sent by a client device, a server divides N first data blocks to obtain M groups of data, and determines verification information corresponding to each group of data; further, the server determines difference information according to the verification information and the second data packet corresponding to the M groups of data, and sends the difference information to the client device, so that the client device updates the first data packet according to the difference information. In the embodiment of the invention, the server can transmit the difference information to the client device without transmitting the whole first data packet to the client device, thereby avoiding the transmission of repeated data information, reducing the loss of network traffic and improving the efficiency of data synchronization; in addition, in the implementation of the invention, the communication interaction process between the client device and the server can be executed only once, thereby reducing the pressure of network communication and reducing the network transmission flow.

Description

Data processing method and server
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and a server.
Background
Data synchronization is a common method of data processing, where the integrity and uniformity of data on different devices (e.g., client device and server, client device and storage device, or server and storage device) can be maintained by synchronizing the data on the different devices. Taking the example of synchronizing the resource data packet data between the client device and the server, in a common data synchronization manner, if the server detects that the resource data packet installed on the server is updated from the resource data packet 1 to the resource data packet 2, the resource data packet 2 may be sent to the client device, so that the client device updates the resource data packet installed on the client device from the resource data packet 1 to the resource data packet 2, thereby maintaining the consistency of the resource data packets on the server and the client device.
However, in actual operation, there may be only a partial difference between the resource data packet 2 and the resource data packet 1, and most of the data is the same; for example, the total data amount of the resource data packet 1 and the resource data packet 2 is 50M, only 5M data exists in the resource data packet 2 and is different from the resource data packet 1, and other 45M data in the resource data packet 2 and the resource data packet 1 are the same. In this way, the client device sends 50M data included in the resource data packet 2 to the server, where the 50M data may include 45M data that is the same as the resource data packet 1 and 5M data that is different from the resource data packet 1. Therefore, the server may transmit repeated data in the above manner, so that more network traffic is lost, and the efficiency of data synchronization is low.
In summary, a data processing method is needed to improve the data synchronization efficiency.
Disclosure of Invention
The embodiment of the invention provides a data processing method which is used for improving the efficiency of data synchronization.
In a first aspect, an embodiment of the present invention provides a data processing method, where the method includes:
the method comprises the steps that a server obtains first information sent by a client device, wherein the first information comprises check values of N first data blocks corresponding to first data packets, the server divides the N first data blocks for the first time to obtain M groups of data, and the check information corresponding to each group of data is generated according to the check value corresponding to at least one first data block included in each group of data and a second data packet corresponding to the first data packet; further, the server determines difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and sends the difference information to the client device, so that the client device updates the first data packet according to the difference information.
According to the technical scheme, the first data packet is used for checking the second data packet, so that the server can transmit the difference information to the client device without transmitting the whole first data packet to the client device, repeated data information transmission can be avoided, loss of network traffic is reduced, and data synchronization efficiency is improved; in addition, in the embodiment of the invention, the verification value of the data block is adopted to determine the verification value of the data group, so that the synchronization process can be completed by only executing one communication interaction between the client device and the server without executing multiple communication interactions, thereby reducing the pressure of network communication and reducing the network transmission flow. That is, the data processing method in the embodiment of the present invention can be adapted to a network environment with low bandwidth and traffic sensitivity.
Optionally, before generating the check information corresponding to each set of data according to the check value corresponding to at least one first data block included in each set of data and the second data packet corresponding to the first data packet, the method further includes: the server determines that a maximum data amount in the M sets of data is greater than or equal to a minimum data amount in the data amounts of the N first data blocks.
Optionally, the first information further includes data amounts of the N first data blocks, and the check values respectively corresponding to the N first data blocks included in the first information are first check values respectively corresponding to the N first data blocks; the generating the check information corresponding to each group of data according to the check value corresponding to at least one first data block included in each group of data and the second data packet corresponding to the first data packet includes: the M groups of data comprise a Y-th data group, the Y-th data group comprises T first data blocks, and the Y-th data group in the M groups of data is executed: the server determines a second check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set; the server acquires a first target data group with the same data quantity as the Y-1 data group from the ith data in a second data packet corresponding to the Y-1 data group, and divides the first target data group to obtain T second data blocks, wherein the data quantity of the T second data blocks is the same as the data quantity of the T first data blocks; determining a second check value corresponding to the first target data set according to the first check values of the T second data blocks; generating verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set; and the server updates the second data packet corresponding to the Y-1 group of data to obtain the second data packet corresponding to the Y group of data.
In the technical scheme, the first check value can be a strong check value, the second check value can be a weak check value, and the data information which is obviously the same as the Y-th data set in the target data set can be filtered through the weak check value by adopting a mode of comparing the weak check value with the strong check value, so that the workload is reduced, and the data processing efficiency is improved; on the other hand, by adopting the strong check value and the weak check value to jointly determine the check information corresponding to the Y-th data set, the accuracy of the check information corresponding to the Y-th data set can be improved.
Optionally, the generating the verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set includes: if the server determines that the second check value corresponding to the Y-th data set is the same as the second check value corresponding to the first target data set, determining the first check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set, and determining the first check value corresponding to the first target data set according to the first check values of the T second data blocks; if the first check value corresponding to the Y-th data set is different from the first check value corresponding to the first target data set, generating first check information of the Y-th data set; and if the server determines that the second check value corresponding to the Y-th data set is different from the second check value corresponding to the first target data set, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
In the technical scheme, the data processing process can be simplified and the data processing efficiency can be improved by comparing the weak check value with the strong check value.
Optionally, the method further comprises: when the server determines that the first check value corresponding to the Y-th data set is the same as the first check value corresponding to the first target data set, if the data volume of the Y-th data set is determined to be equal to the minimum data volume in the N first data blocks, generating second check information of the Y-th data set; and if the data quantity of the Y-th data set is determined to be larger than the minimum data quantity in the N first data blocks, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
In the above technical solution, the check information may include first check information and second check information, where the first check information is check information corresponding to data information identical to the Y-th data set in the target data set, and the second check information may be check information corresponding to data information different from the Y-th data set in the target data set. By acquiring the first check information and the second check information, the server can acquire more complete check information, so that the difference information synchronized by the server to the client device is more accurate.
Optionally, the method further comprises: and if the server determines that the data volume of the second data packet corresponding to the Mth group of data is greater than or equal to a preset data volume threshold, performing second division on the N first data blocks.
According to the technical scheme, the verification information is acquired in a multi-round verification mode, so that the accuracy of the verification information acquired by the server can be improved, and the data synchronization process between the client equipment and the server is more accurate; further, the data volume of each group of data corresponding to the second round of verification can be smaller than the data volume of each group of data corresponding to the first round of verification, that is, the technical scheme can avoid the technical problem of repeated transmission of data information caused by only adopting one round of verification in a multi-round verification mode, thereby saving network traffic and improving the efficiency of data synchronization.
Optionally, the server performs second division on the N first data blocks to obtain P groups of data; and if the server determines that the maximum data volume in the P groups of data is smaller than the minimum data volume in the data volumes of the N first data blocks, sending the verification information of the first to M groups of data to the client equipment.
In a second aspect, an embodiment of the present invention provides a server, where the server includes:
the acquisition module is used for acquiring first information sent by the client device, wherein the first information comprises check values of N first data blocks corresponding to the first data packet;
the processing module is used for carrying out first division on the N first data blocks to obtain M groups of data, and generating verification information corresponding to each group of data according to a verification value corresponding to at least one first data block included in each group of data and a second data packet corresponding to the first data packet;
and the receiving and transmitting module is used for determining the difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and transmitting the difference information to the client device so that the client device updates the first data packet according to the difference information.
Optionally, before generating the check information corresponding to each set of data, the processing module is further configured to: and determining that the maximum data amount in the M groups of data is greater than or equal to the minimum data amount in the data amounts of the N first data blocks.
Optionally, the first information further includes data amounts of the N first data blocks, and the check values respectively corresponding to the N first data blocks included in the first information are first check values respectively corresponding to the N first data blocks; the processing module is used for: the M groups of data comprise a Y-th data group, the Y-th data group comprises T first data blocks, and the Y-th data group in the M groups of data is executed: determining a second check value corresponding to the Y-th data set according to first check values of T first data blocks included in the Y-th data set; starting from the ith data in a second data packet corresponding to the Y-1 data set, acquiring a first target data set with the same data quantity as the Y data set, and dividing the first target data set to obtain T second data blocks, wherein the data quantity of the T second data blocks is the same as the data quantity of the T first data blocks; determining a second check value corresponding to the first target data set according to the first check values of the T second data blocks; generating verification information of the Y-th data set according to a first verification value corresponding to the Y-th data set and a second verification value corresponding to the first target data set; updating the second data packet corresponding to the Y-1 group data to obtain a second data packet corresponding to the Y group data;
Optionally, the processing module is configured to: if the second check value corresponding to the Y-th data set is the same as the second check value corresponding to the first target data set, determining the first check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set, and determining the first check value corresponding to the first target data set according to the first check values of the T second data blocks; if the first check value corresponding to the Y-th data set is different from the first check value corresponding to the first target data set, generating first check information of the Y-th data set; and if the second check value corresponding to the Y-th data set is different from the second check value corresponding to the first target data set, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
Optionally, the processing module is further configured to: when the first check value corresponding to the Y-th data set is identical to the first check value corresponding to the first target data set, if the data amount of the Y-th data set is determined to be equal to the minimum data amount in the N first data blocks, generating second check information of the Y-th data set; and if the data quantity of the Y-th data set is determined to be larger than the minimum data quantity in the N first data blocks, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a third target data set with the same data quantity as the Y-th data set.
Optionally, the processing module is further configured to: and if the data volume of the second data packet corresponding to the Mth group of data is determined to be greater than or equal to a preset data volume threshold value, performing second division on the N first data blocks.
Optionally, the processing module is configured to: performing second division on the N first data blocks to obtain P groups of data; and if the maximum data volume in the P groups of data is smaller than the minimum data volume in the N first data blocks, sending the verification information of the first to M groups of data to the client equipment.
An embodiment of the invention provides a computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform a data processing method as described in the first aspect or any of the first aspects.
Embodiments of the present invention provide a computer program product which, when run on a computer, causes the computer to perform a data processing method as described in the first aspect or any of the first aspects.
These and other implementations of the invention will be more readily understood from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart corresponding to a data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of interaction between a client device and a server according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of an embodiment of the present invention;
FIG. 3b is a schematic diagram of an embodiment provided in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the process of data synchronization between the client device and the server, in order to avoid transmitting repeated data information, one possible implementation manner is as follows: comparing the resource data packet 2 installed in the server with the resource data packet 1 installed in the client device, determining check information between the resource data packet 2 and the resource data packet 1, wherein the check information can be used for identifying difference information between the file a2 and the file a1, so that the server can send the difference information to the client device, and the client device can update the resource data packet 1. In this implementation manner, the execution entity for determining the verification information may be a client device or may be a server, which is not particularly limited.
Taking the execution main body of the verification information as the server as an example, according to the above description, if the verification information determined by the server is more accurate, the server can obtain accurate difference information according to the accurate verification information, so that the server can send the accurate difference information to the client device, and the efficiency of data synchronization is improved. That is, the accuracy of the verification information may affect the accuracy of the difference information, and if the accuracy of the difference information is to be ensured, the server is required to obtain the accurate verification information. However, there is no way to accurately obtain the verification information at the present stage, so when the data synchronization is performed between the client device and the server at the present stage, there are technical problems of repeated data information transmission, large loss of network traffic and low efficiency of data synchronization.
In summary, a data processing method is needed to improve the data synchronization efficiency.
Fig. 1 is a schematic flow diagram corresponding to a data processing method according to an embodiment of the present invention, where the method includes:
in step 101, the server obtains first information sent by the client device.
In the embodiment of the invention, the client device can store the first data packet, and the server can store the second data packet. The second data packet in the server may be a data packet obtained by updating a third data packet stored in the server, and the third data packet may be the same as the first data packet or may be different from the first data packet, and is not specifically limited. For example, the same resource data packet may be installed on both the server and the client device, where the resource data packet installed on the client device is a resource data packet corresponding to version V1.1 (i.e., the first data packet), and the resource data packet installed on the server is a resource data packet corresponding to version V1.3 (i.e., the second data packet); in an example, if the resource data packet corresponding to the version V1.3 installed on the server is obtained by upgrading the resource data packet corresponding to the version V1.1 (i.e., the third data packet) originally installed on the server, that is, the version V1.3 is obtained by upgrading the version V1.1, in this example, the first data packet and the third data packet may be the same (both are resource data packets corresponding to the version V1.1); in another example, if the resource data packet corresponding to the version V1.3 installed on the server is obtained by upgrading the resource data packet corresponding to the version V1.2 (i.e., the third data packet) originally installed on the server, that is, the version V1.3 is obtained by upgrading the version V1.2, and the version V1.2 is obtained by upgrading the version V1.1, in this example, the first data packet and the third data packet may be different, the first data packet may be the resource data packet corresponding to the version V1.1, and the third data packet may be the resource data packet corresponding to the version V1.2.
The following embodiments of the present invention take a process of performing data synchronization on a first data packet in a client device by using a second data packet in a server as an example, and it can be understood that a process of performing data synchronization between other devices may be implemented by referring to a data synchronization process in the embodiments of the present invention, which is not particularly limited.
In the embodiment of the present invention, the first information may include data amounts of N first data blocks corresponding to the first data packet and check values corresponding to the N first data blocks respectively. In a specific implementation, the client device may divide the first data packet into N first data blocks according to the data amount of the first data packet. The first data packet may be divided into N first data blocks according to a preset data amount, and the data amount of each first data block may be the same. For example, the data size of the first data packet is 905M, and the first data packet is divided to obtain a first data block b1 to a first data block b10; the data amount of each of the first data blocks b1 to b9 may be 100M, and the data amount of the first data block b10 may be 5M.
Further, for each of the first data blocks b1 to b10, a check value corresponding to each of the first data blocks may be determined. The check value corresponding to each first data block may be the first check value (strong check value) of each first data block or may be the second check value (strong check value) of each data block. Accordingly, the check value of the first data block b1 to the first data block b10 included in the first information may be the first check value of the first data block b1 to the first data block b10, or may also be the second check value of the first data block b1 to the first data block b10, or may also be the first check value of the first data block b1 to the first data block b10 and the second check value of the first data block b1 to the first data block b10, which is not particularly limited.
The first check value may be a strong check value, such as an MD5 check value. The MD5 check value may be a key obtained by using a salted MD5 hash method or a non-salted MD5 hash method, and the obtaining process is an irreversible encryption process, that is, the information of the data cannot be obtained by using the MD5 check value corresponding to the data. Accordingly, if the first data and the second data of the file are encrypted by the same encryption method (for example, MD5 hash method with salt), and then the key corresponding to the first data is the same as the key corresponding to the second data, it can be stated that the first data is the same as the second data. Taking the first check value of the first data block b1 as an example, in a specific implementation, the first data block b1 may be divided into 512 first packets in advance, and each first packet may be divided into 32 first sub-packets. Further, by encrypting 512 first packets by using MD5 hash, four second sub-packets with 32 bits can be obtained, and after concatenating the four second sub-packets with 32 bits, a 128-bit hash value can be obtained. The hash value may be a first check value corresponding to the first data block b 1. The reliability of the first check value is strong, and if the first check values corresponding to the N first data blocks are adopted to obtain the check information, the accuracy of the check information can be submitted.
The second check value may be a weak check value, such as a check value determined based on a checksum algorithm (i.e., the aller 32 algorithm). Specifically, the weak checksum of the first data block may be obtained by summing the fields included in the first data group, and the obtained checksum may be used as the first checksum; accordingly, the sum of the phase values of each step in determining the first checksum value may be taken as the second checksum value. The first checksum value and the second checksum value may be 16-bit values, and further, the first checksum value of 16 bits and the second checksum value of 16 bits may be spliced into a 32-bit integer, that is, the second checksum value of the first data block.
Step 102, the server divides the N first data blocks to obtain M groups of data.
In a specific implementation, there may be multiple manners of dividing the N first data blocks, and in a possible implementation, the server may divide the N first data blocks into M groups of data according to a preset number of data blocks, where the number of data blocks included in each group of data may be the same. For example, the server may divide the first data blocks b1 to b10 into first to fourth data groups, wherein each of the first to third data groups may include 3 data blocks, and the fourth data group may include 1 data block. For example, the first data group includes first data blocks b1 to b3, the second data group includes first data blocks b4 to b6, the third data group includes first data blocks b7 to b9, and the fourth data group includes first data blocks b10. That is, the data amount of each of the first to third data groups may be 300M, and the data amount of the fourth data group may be 5M.
Step 103, the server determines the verification information of each group of data in the M groups of data.
In one possible implementation manner, if the server determines that the maximum data size in the M sets of data is greater than or equal to the minimum data size in the data sizes of the N first data blocks, it indicates that the process of checking the second data packet by the server is not finished, and the subsequent steps may be continuously performed. Here, the smallest data amount among the data amounts of the N first data blocks may refer to the data amount of the first data block having the smallest data amount among the N first data blocks. For example, the smallest data amount among the data amounts of the first data block b1 to the first data block b10 may refer to the data amount of the first data block b10, that is, 5M.
It should be noted that the foregoing implementation is merely an exemplary simple illustration, and the listed conditions for determining that the process of checking the second data packet by the server is not ended are merely for convenience of description of the solution, and do not constitute limitation of the solution. In a specific implementation, the condition for determining that the process of checking the second data packet by the server is not ended may be set by a person skilled in the art according to practical situations, for example, a preset data amount threshold may be set, and if it is determined that the maximum data amount in the M groups of data is greater than or equal to the preset data amount threshold, it may be determined that the process of checking the second data packet by the server is not ended; the preset data amount threshold may be a fixed value, or may also be a value obtained by determining the minimum data amount in the first data block, for example, may be 3/4 of the minimum data amount in the first data block, which is not limited in detail.
Taking the second data set as an example, the second data set may include the first data block b4 to the first data block b6, and in a specific implementation, the check value corresponding to the second data set may be determined according to the check values respectively corresponding to the first data block b4 to the first data block b6 included in the second data set. Several possible cases of determining the corresponding check value of the second data set are described below, respectively.
First case of
In the first case, the check value of the first data block included in the first information may be the first check value of the first data block, that is, the first check values corresponding to the first data blocks b4 to b6, respectively, are transmitted in step 101. In the first case, the first check value corresponding to the second data set may be determined according to the first check values corresponding to the first data block b4 to the first data block b6, or the second check value corresponding to the second data set may be determined according to the first check values corresponding to the first data block b4 to the first data block b6, or the first check value and the second check value corresponding to the second data set may be determined according to the first check values corresponding to the first data block b4 to the first data block b6, which is not particularly limited. The following describes the three sub-cases, respectively.
First sub-scenario
If the first check value corresponding to the second data group is determined according to the first check values corresponding to the first data block b4 to the first data block b6, the first check values corresponding to the first data block b4 to the first data block b6 may be divided into 3 packets, and each packet may be divided into 32 sub-packets. Further, by encrypting the 3 packets by using MD5 hash, a plurality of 32-bit sub-packets can be obtained, and after concatenating the plurality of 32-bit sub-packets, a 128-bit hash value can be obtained. The hash value may be the first check value corresponding to the second data set.
Second sub-scenario
If the second check value corresponding to the second data set is determined according to the first check values respectively corresponding to the first data block b4 to the first data block b6, the first check values of the first data block b4 to the first data block b6 can be added, and the obtained sum value can be used as a first check sum value; accordingly, the sum of the phase values of each step in determining the first checksum value may be taken as the second checksum value. Further, the first checksum value and the second checksum value may be concatenated into an integer, which may be the second checksum value corresponding to the second data set.
For example, if the first check values corresponding to the first data blocks b4 to b6 are R1, R2 and R3, respectively, then the sum of each byte in R1, R2 and R3 may be added, and the obtained sum value is taken as the first checksum value; accordingly, the sum of the phase values of each step in determining the first checksum value may be taken as the second checksum value. The first checksum value and the second checksum value may be 16-bit values, and further, the first checksum value of 16 bits and the second checksum value of 16 bits may be spliced into a 32-bit integer, that is, the second checksum value corresponding to the second data set.
Third sub-scenario
If the first check value and the second check value corresponding to the second data set are determined according to the first check values respectively corresponding to the first data block b4 to the first data block b6, the first check value and the second check value corresponding to the second data set may be determined according to the above manner, which is not described herein.
Second case
In the second case, the check value of the first data block included in the first information may be the second check value of the first data block, that is, the second check values corresponding to the first data block b4 to the first data block b6, respectively, are transmitted in step 101. In the second case, the first check value corresponding to the second data group may be determined according to the second check value corresponding to each of the first data block b4 to the first data block b6, or the second check value corresponding to the second data group may be determined according to the second check value corresponding to each of the first data block b4 to the first data block b6, or the first check value and the second check value corresponding to the second data group may be determined according to the second check value corresponding to each of the first data block b4 to the first data block b6, which is not particularly limited. The following describes the three sub-cases, respectively.
Fourth sub-scenario
If the first check value corresponding to the second data group is determined according to the second check values corresponding to the first data block b4 to the first data block b6, respectively, the second check values corresponding to the first data block b4 to the first data block b6 may be divided into 3 packets, and each packet may be divided into 32 sub-packets. Further, by encrypting the 3 packets by using MD5 hash, a plurality of 32-bit sub-packets can be obtained, and after concatenating the plurality of 32-bit sub-packets, a 128-bit hash value can be obtained. The hash value may be a second check value corresponding to the second data set.
Fifth sub-scenario
If the second check value corresponding to the second data group is determined according to the second check values respectively corresponding to the first data block b4 to the first data block b6, the second check values of the first data block b4 to the first data block b6 can be added, and the obtained sum value can be used as a first check sum value; accordingly, the sum of the phase values of each step in determining the first checksum value may be taken as the second checksum value. Further, the first checksum value and the second checksum value may be concatenated into an integer, which may be the second checksum value corresponding to the second data set.
Sixth sub-scenario
If the first check value and the second check value corresponding to the second data set are determined according to the second check values respectively corresponding to the first data block b4 to the first data block b6, the first check value and the second check value corresponding to the second data set may be determined according to the above manner, which is not described herein.
Further, the server may verify the second data packet corresponding to the first data set according to the verification value of the second data set. The second data packet corresponding to the first data set may be a data packet obtained by executing step 103 with respect to the first data set. Specifically, after the second data packet is checked according to the check value of the first data set, the second data packet can be updated to obtain a second data packet corresponding to the first data set; correspondingly, after the second data packet corresponding to the first data set is verified according to the verification value of the second data set, the second data packet corresponding to the first data set can be updated to obtain the second data packet corresponding to the second data set. It should be noted that, the process of obtaining the second data packet corresponding to the third data set and the second data packet corresponding to the fourth data set may be performed with reference to the first data set and the second data set, which is not described herein.
In specific implementation, after obtaining a second data packet corresponding to a first data set stored in the server, the server may obtain a target data set with the same data amount as the first data set from the ith bit data in the second data packet corresponding to the first data set, and may divide the target data set to obtain T second data blocks; the data amount of the T second data blocks may be the same as the data amount of the T first data blocks. Further, the server may determine a check value corresponding to the target data set according to the check values of the T second data blocks, for example, in the first sub-case, the server may determine a first check value corresponding to the target data set according to the first check values of the T second data blocks, and may check the second data packet according to the first check value of the second data set and the first check value corresponding to the target data set, so as to generate check information corresponding to the second data set; in the second sub-case, the server may determine a second check value corresponding to the target data set according to the first check values of the T second data blocks, and may check the second data packet according to the second check value of the second data set and the second check value corresponding to the target data set, to generate check information corresponding to the second data set; in the third sub-case, the server may determine a first check value and a second check value corresponding to the target data set according to the first check values of the T second data blocks, and may check the second data packet according to the first check value of the second data set, the first check value corresponding to the target data set, the second check value of the second data set, and the second check value corresponding to the target data set, so as to generate check information corresponding to the second data set. Correspondingly, in the fourth sub-case, the server may determine a first check value corresponding to the target data set according to the second check values of the T second data blocks, and may check the second data packet according to the first check value of the second data set and the first check value corresponding to the target data set, so as to generate check information corresponding to the second data set; in the fifth sub-case, the server may determine a second check value corresponding to the target data set according to the second check values of the T second data blocks, and may check the second data packet according to the second check value of the second data set and the second check value corresponding to the target data set, to generate check information corresponding to the second data set; in the sixth sub-case, the server may determine a first check value and a second check value corresponding to the target data set according to the second check values of the T second data blocks, and may check the second data packet according to the first check value of the second data set, the first check value corresponding to the target data set, the second check value of the second data set, and the second check value corresponding to the target data set, so as to generate check information corresponding to the second data set.
In the following embodiments of the present invention, a second sub-scenario is taken as an example to specifically describe a process of performing verification on a second data packet and generating verification information corresponding to a second data set.
In a specific implementation, taking a first execution process (starting from the 1 st data in the second data packet corresponding to the first data set), if the second data set includes the first data block b4 to the first data block b6, and the data amount of each of the first data blocks b4 to b6 is 100M, in the first execution process, the server may sequentially acquire 300M data as a target data set from the first data in the second data packet corresponding to the first data set, and divide the target data set into the second data blocks c4 to c6; the data amount of each of the second data blocks c4 to c6 may be 100M. Further, the server may determine the first check values of the second data blocks c4 to c6, and may determine the second check value of the target data set according to the first check values of the second data blocks c4 to c6 (the process of determining the second check value of the second data set may be performed, and will not be described in detail).
Further, the server may compare the second check value corresponding to the second data set with the second check value corresponding to the target data set, and if it is determined that the second check value corresponding to the second data set is the same as the second check value corresponding to the target data set, the first check value corresponding to the second data set may be determined according to the first check values corresponding to the T first data blocks included in the second data set, and the first check value corresponding to the target data set may be determined according to the first check values of the T second data blocks. Taking the process of determining the first check value corresponding to the second data set as an example, specifically, if the first check values corresponding to the first data block b4 to the first data block b6 included in the second data set are R1, R2 and R3, respectively, the HD5 hash value, that is, the first check value corresponding to the second data set, can be obtained by combining R1, R2 and R3 into a value.
If the first check value corresponding to the second data set is the same as the first check value corresponding to the target data set, the server may generate first check information of the second data set. The first check information of the second data set may include bit information (i.e., identification information) corresponding to the same target data set as the first data packet in the second data packet. In one example, if the second data packet corresponding to the first data set is the second data packet, the first check information of the second data set may be: the data from 1M to 300M in the second data packet is identical to the second data set (data from 301M to 601M) in the first data packet.
In the embodiment of the invention, after the first verification information of the second data set is generated, the second data packet corresponding to the first data set can be updated. For example, the target data group (i.e., the data from 1M to 300M) in the second data packet corresponding to the first data group may be replaced with a hole, or the data from 1M to 300M may be modified into special characters, or the data from 1M to 300M may be labeled, which is not particularly limited.
Further, the server may perform the steps described above starting with the next bit of the target data set. It should be noted that, if the target data set is the same as the second data set, in the second execution process, the server may start from the 1 st bit data of the second data packet after dividing the target data set, and execute the above process. After the second data set is used for executing each data in the second data packet corresponding to the first data set, the server can update the second data packet corresponding to the first data set in sequence through the executing steps to obtain the second data packet corresponding to the second data set.
In one possible implementation, if it is determined that the second check value corresponding to the second data set is different from the second check value corresponding to the target data set, it is indicated that the target data set is different from the second data set, at this time, the server may determine whether the partitioning process is finished (all bit data in the second data packet becomes empty and/or all bit data have been marked, or the data amount of the second data set is equal to the minimum data amount in the N first data blocks, and it is determined that the partitioning process is finished). If the server determines that the dividing process is not finished, the third data set may be used to start from the first bit data corresponding to the second data set, and the above-mentioned checking process may be performed. If the server determines that the partitioning process has ended (i.e., the data amount of the second data set is equal to the minimum data amount of the N first data blocks), the server may generate second parity information of the second data set, and may perform the above-described parity process using the third data set from the first data corresponding to the second data set. The second check information may include bit information (i.e., identification information) corresponding to a target data group in the second data packet that is different from the first data packet. In one example, if the second data packet corresponding to the first data set is the second data packet, the second check information of the second data set may be: the data from 1M to 300M in the second data packet is different from the first data packet.
In the embodiment of the invention, the first check value can be a strong check value, the second check value can be a weak check value, and the data information which is obviously the same as the Y-th data set in the target data set can be filtered through the weak check value by adopting a mode of comparing the weak check value with the strong check value, so that the workload is reduced, and the data processing efficiency is improved; on the other hand, by adopting the strong check value and the weak check value to jointly determine the check information corresponding to the Y-th data set, the accuracy of the check information corresponding to the Y-th data set can be improved. Further, the check information may include first check information and second check information, the first check information is check information corresponding to data information identical to the Y-th data set in the target data set, and the second check information may be check information corresponding to data information different from the Y-th data set in the target data set. By acquiring the first check information and the second check information, the server can acquire more complete check information, so that the data synchronized by the client device to the server is more accurate.
Step 104, if the server determines that the data size of the second data packet corresponding to the mth data set is smaller than the preset data size threshold, step 105 is executed; if it is determined that the data size of the second data packet corresponding to the mth data set is greater than or equal to the preset data size threshold, step 102 is performed.
In the embodiment of the invention, after the server uses the third data group to verify the second data packet corresponding to the second data group, the server may update the second data packet corresponding to the second data group to generate the second data packet corresponding to the third data group. Further, if the server determines that the data amount of the second data packet corresponding to the third data set is smaller than the preset data amount threshold, it indicates that all data in the second data packet is the same as the data in the first data packet (i.e., all data in the second data packet becomes empty and/or all data in the second data packet are marked, and the verification process is ended); at this point, the server may perform step 105. The preset data amount threshold may be set by a person skilled in the art according to experience, and is not particularly limited.
Correspondingly, if the server determines that the data amount of the second data packet corresponding to the third data set is greater than or equal to the preset data amount threshold, it indicates that data different from the data in the first data packet exists in the second data packet (i.e. the verification process is not finished); at this point, the server may again perform step 102. In a specific implementation, the server may divide the N first data blocks for the second time, and if the N first data blocks are divided into P data groups, the number of data blocks included in each of the P data groups may be less than or equal to the number of data blocks included in each of the M data groups obtained by the first division. That is, P may be greater than or equal to M.
Further, if the server determines that the data size of each group of data in the P groups of data is smaller than the minimum data size of the data sizes of the N first data blocks, it indicates that the process of checking the second data packet by the server is finished, and at this time, the server may send the check information corresponding to the M groups of data to the client device. Accordingly, if the server determines that the maximum data size in the P sets of data is greater than or equal to the minimum data size in the N first data blocks, it indicates that the process of checking the second data packet by the server is not finished, and at this time, the server may execute steps 103 to 105 (or 102) for each of the P sets of data.
In the embodiment of the invention, the accuracy of the verification information acquired by the server can be improved by adopting a multi-round verification mode to acquire the verification information, so that the data synchronization process between the client equipment and the server is more accurate; further, the data volume of each group of data corresponding to the second round of verification can be smaller than the data volume of each group of data corresponding to the first round of verification, that is, the technical problem of repeated transmission of data information caused by only adopting one round of verification can be avoided by adopting a multi-round verification mode in the embodiment of the invention, so that network traffic can be saved, and the efficiency of data synchronization can be improved.
Step 105, the server determines difference information according to the verification information of the M groups of data and the second data packet, and sends the difference information to the client device.
Here, if the server finishes the verification process of the second data packet after the first division, the verification information of the M groups of data may include only the first verification information, or may include only the second verification information, or may include both the first verification information and the second verification information. If the check information of the M groups of data only comprises the first check information, the data in the second data packet is the same as the data in the first data packet; if the check information of the M groups of data only comprises second check information, the data in the second data packet is completely different from the data in the first data packet; if the check information of the M sets of data includes the first check information and the second check information, it is indicated that a part of data in the second data packet is the same as the data in the first data packet, and another part of data is different from the data in the first data packet.
Taking the second data set as an example, if the check information of the second data set is: if the data from 1M to 300M in the second data packet is different from the first data packet, the server may obtain the data from 1M to 300M in the second data packet (i.e. the difference information), generate second information according to the difference information, and send the second information to the client device. Accordingly, the client device may parse the second information after receiving the second information to obtain difference information, and update the second data packet according to the difference information. For example, if the difference information obtained by parsing by the client device is the 1 st to 300 th data in the second data packet, the client device may update the 1 st to 300 th data in the first data packet to the 1 st to 300 th data in the second data packet.
The above step numbers are only an example of the execution flow, and do not limit the execution sequence of each step.
In the embodiment of the invention, the first data packet is used for checking the second data packet, so that the server can transmit the difference information to the client device without transmitting the whole first data packet to the client device, thereby avoiding the transmission of repeated data information, reducing the loss of network traffic and improving the efficiency of data synchronization; in addition, in the embodiment of the invention, the verification value of the data block is adopted to determine the verification value of the data group, so that the synchronization process can be completed by only executing one communication interaction between the client device and the server without executing multiple communication interactions, thereby reducing the pressure of network communication and reducing the network transmission flow. That is, or alternatively, the data processing method in the embodiment of the present invention may be adapted to a network environment with low bandwidth and traffic sensitivity.
The following describes a scheme in an embodiment of the present invention from the point of view of data interaction between a client device and a server, which corresponds to the data processing method illustrated in fig. 1.
Fig. 2 is a schematic flow chart of interaction between a client device and a server according to an embodiment of the present invention, where the method includes:
in step 201, the client device sends first information to a server.
Here, the first information may include data amounts of N data blocks and first check values corresponding to the N data blocks, where the N data blocks may be obtained by dividing the first data packet by the client device.
In one example, the first information may further include other information related to the first data packet, such as identification information of the first data packet, bit information of the N data blocks, update time of the N data blocks, and the like, which is not specifically limited.
Step 202, the server determines the verification information according to the first information, and determines the difference information according to the verification information and the second data packet.
In one possible implementation manner, after receiving the first information sent by the client device, the server may parse the first information to obtain identification information of the first data packet included in the first information. Further, the server may obtain a second data packet corresponding to the first data packet stored in the server according to the identification information of the first data packet, and may determine the verification information according to the first information and the second data packet. Specific implementation procedures may refer to the procedures illustrated in steps 102 to 105 (or step 102), and are not specifically limited.
If the check information is that the third to ninth data in the second data packet are different from the first data packet, the server may determine that the third to ninth data in the second data packet are difference information. The bit refers to bit data in serial communication, and may include 6 bits or may include 9 bits, which is not particularly limited.
The server sends the difference information to the client device, step 203.
Here, the server may send the difference information to the client device through a wired manner (such as a network cable, an optical fiber), or may send the difference information to the client device through a wireless manner (such as bluetooth, electromagnetic wave), which is not limited in particular.
In step 204, the client device updates the first data packet stored in the client device according to the difference information.
In one possible implementation, the difference information may include difference data and identification information, and the client device may update the data in the first data packet to the difference data according to the identification information.
It should be noted that fig. 2 is only an exemplary simple illustration, and the server is adopted as an execution body for determining the verification information for convenience of illustration, and is not limited to the scheme. In a specific implementation, the client device may also be used as an execution body for determining the verification information, which is not limited by the embodiment of the present invention.
The following describes the scheme in the embodiment of the present invention in detail with examples one and two.
Example one
Fig. 3a is a schematic diagram of an embodiment of a data processing method according to an embodiment of the present invention, as shown in fig. 3a, an old resource data packet a (abbreviated as data a) is stored on a client device, and a new resource data packet b (abbreviated as data b) corresponding to the data a is stored on a server. As shown in fig. 3a, both data a and data b may be 48-bit data. Here, 1 bit may be a smaller data amount such as 1 byte or 1 bit, or may be a larger data amount such as 1M or 1G, and this is not limited.
It should be noted that the following examples (i.e., example one and example two) of the present invention are only two exemplary simple descriptions, and the data a and the data b are listed only for illustrating the scheme, and do not limit the scheme, and in a specific implementation, the data amount of the data a and the data b may be far greater than 48 bits, for example, may be 100G or 10T.
The specific implementation process is as follows:
in the first stage, the client sends first information to the server.
In a specific implementation, the client device may divide the data a to obtain the data block S 1 Data block S 8 Wherein the data block S 1 Data block S 8 May comprise 6 bits of data. As shown in fig. 3a, data block S 1 The data includes first to sixth data, namely data ABCD12; data block S 2 The data comprises seventh bit data to tenth bit data, namely data ACDE23; data block S 3 The data comprises thirteenth to eighteenth bit data, namely data ABDE34; data block S 4 Includes nineteenth to twenty-fourth bits of data, namely data ADEF45; data block S 5 Includes twenty-fifth bit data to thirty-first bit data, namely data BDEF56; data block S 6 Including thirty-first to thirty-sixth bits of data, namely data BCEF67; data block S 7 Including thirty-seventh to forty-second bit data, namely data BEDA78; data block S 8 Including forty-two bits of data to forty-eight bits of data, namely data CEDF89.
Further, the client device may calculate the data blocks S respectively 1 Data block S 8 The first detection value may be a strong check value and the second detection value may be a weak check value. In data blocks S 1 For example, in one possible implementation, the client device may determine the data block S by a checksum algorithm 1 And can determine the data block S by MD5 hash algorithm 1 Is a strong check value of (1). It should be noted that, in the embodiment of the present invention, the data included in the data block may be used to calculate the strong check value and the weak check value of the data block, for example, the data block S may be used 1 The included data ABCD12 calculates a data block S 1 Strong and weak check values of (a).
In the embodiment of the present invention, the client device may be configured to execute the data block S 1 Data block S 8 The identification information, the data amount information, the weak check value and the strong check value of the server are generated into first information, and the first information is sent to the server. Wherein, the liquid crystal display device comprises a liquid crystal display device,the identification information of the data block may be an identification of bit data comprised by the data block, such as data block S 3 The identification information of the data is nineteenth bit data to twenty-fourth bit data; the data amount information of the data block may be the amount of bit data included in the data block, such as the data block S 3 The data amount information of (2) is six-bit data.
In one possible implementation, the data block S 1 Data block S 8 The identification information, the data amount information, the weak check value, and the strong check value of (1) may be stored in the first information in the form of a table, table 1 being one example of a table stored in the first information. As shown in Table 1, in data block S 1 For example, data block S 1 The identification information of (a) is first-sixth-bit data, the data quantity information is six-bit data, and the weak check value is H 1 Strong check value U 1
Table 1: an illustration of a table in first information
Figure BDA0002018779190000221
/>
Figure BDA0002018779190000231
The second stage, server pair data block S 1 Data block S 8 The first division is performed.
After receiving the first information sent by the client device, the server may parse the first information to obtain a data block S 1 Data block S 8 Identification information, data amount information, weak check value and strong check value of (c) and can be used for data block S 1 Data block S 8 Performing first division to obtain data group M 11 . Wherein, data set M 11 May include a data block S 1 Data block S 8 I.e. data set M 11 The identification information of the data is first bit data to forty-eight bit data, and the data quantity information is 48 bit data; and, the server can according to the data block S 1 Data block S 8 Is a strong check value (i.e. U 1 ~U 8 ) Determining data set M 11 Is a weak check value of (1).
Further, the server may obtain the data set M starting from the first bit data of the data b 11 The target data set may include 48 bits of data in the data b, as shown in fig. 3a, and the target data set may include 48 bits of data as "ABCD12ACDE23ABDE34ADEF45BDEF56BCEF67BEDA78DECA90". The server may divide the target data group into and data block S 1 Data block S 8 Eight data blocks (such as the eight data blocks illustrated in fig. 3 a) with the same data size, and can determine the weak check value and the strong check value of each data block, and further determine the weak check value of the target data set according to the strong check values of the eight data blocks. The server sets up data M 11 Comparing the weak check value of the target data set with the weak check value of the target data set to determine the data set M 11 Weak check value U of (1) 11 Unlike the weak check value of the target data set. At this time, the server can determine the data group M 11 Unlike the target data set.
Third stage, server sets data block S 1 Data block S 8 A second division is made.
Due to data set M 11 The data quantity is larger than the data block S 1 Data block S 8 The data amount of any one of the data blocks, and therefore, the server can store the data block S 1 Data block S 8 Performing secondary division to obtain data group M 21 And data set M 22 . Wherein, data set M 21 May include a data block S 1 Data block S 4 Data set M 11 The identification information of (a) is first to twenty-fourth bit data, the data amount information is 24 bit data, and the 24 bit data can be 'ABCD 12ACDE23ABDE34ADEF 45'; data set M 22 May include a data block S 5 Data block S 8 I.e. data set M 22 The identification information of (a) is twenty-fifth bit data to forty-eighth bit data, the data amount information is 24-bit data, and the 24-bit data may be "BDEF56BCEF67BEDA78CEDF89".And, the server can according to the data block S 1 Data block S 4 Is a strong check value (i.e. U 1 ~U 4 ) Determining data set M 21 And may be based on the data block S 5 Data block S 8 Is a strong check value (i.e. U 5 ~U 8 ) Determining data set M 22 Is a weak check value of (1).
Further, the server may obtain the data set M starting from the first bit data of the data b 21 Target data set (data set M 'as shown in FIG. 3 a)' 21 ). Wherein, data set M' 21 The first to twenty-fourth bits of data in the data b may be included, the data amount information is 24 bits, and the 24 bits of data may be "ABCD12ACDE23ABDE34ADEF45". The server can group the data M' 21 Divided into and data block S 1 Data block S 4 Four data blocks of the same data volume (i.e. each data block may comprise 6 bits of data), and determining a weak parity value and a strong parity value for each data block, and further determining the data set M 'based on the strong parity values of the four data blocks' 21 Is a weak check value of (1). The server sets up data M 21 Weak checksum data set M' 21 By comparing the weak check values of (2), M can be determined 21 Weak checksum data set M' 21 Is the same as the weak check value of (1); at this time, the server may be based on the data block S 1 Data block S 4 Is a strong check value (i.e. U 1 ~U 4 ) Determining data set M 21 And can be based on the target data set M' 21 Strong check values of four data blocks in the data set determine a target data set M' 21 Is a strong check value of (1); further, the server may group the data M 21 Strong check value and target data set M' 21 Is compared with the strong check value of (1) to determine the data set M 21 Strong check value and target data set M' 21 Is the same, i.e. data set M 21 And data set M' 21 The same; at this time, the server may generate the first check information.
Table 2 is an example of the first check information. As shown in table 2, the first check information may be: the first to twenty-fourth data in the data a are the same as the first to twenty-fourth data in the data b.
Table 2: verification result of the second stage
Data a Data b Checking the result
First bit data to twenty-fourth bit data First bit data to twenty-fourth bit data Identical to
The server may update the data b after generating the first check information, and in one update manner, the server may update the first to twenty-fourth data in the data b into a hole, so as to obtain updated data b. The first to twenty-fourth data in the updated data b may be holes. Further, the server may perform a verification process according to the updated data b, specifically, the server may start from the first non-hole data (i.e. the twenty-fifth data) of the updated data b, and acquire the data set M 21 Target data set (for convenience of description, referred to as data set M' 22 ) Data set M' 22 The twenty-fifth to forty-eighth bits of data b may be included, the data amount information is 24 bits, and the 24 bits of data may be "BDEF56BCEF67BEDA78DECA90". The server can group the data M' 22 Divided into and data block S 1 Data block S 4 Four data blocks of the same data volume, andthe weak check value and the strong check value of each data block can be determined, and then the data group M 'is determined according to the strong check values of the four data blocks' 22 Is a weak check value of (1). The server sets up data M 21 Weak checksum data set M' 22 By comparing the weak check values of (2) to determine the data set M 21 Weak checksum data set M' 22 The server may determine the data set M at this time 21 And data set M' 22 Different.
The server performs this step to complete the use of the data set M 21 The server may further use the data set M for verification of the updated data b 22 The verification of the updated data b may refer to the above, and details are not repeated. Server usage data set M 22 In the process of checking the updated data b, the data b does not contain the data group M 22 The same data, and therefore, the server does not generate the verification information.
Third stage, server sets data block S 1 Data block S 8 A third division is performed.
Due to data set M 21 And data set M 22 The data quantity is larger than the data block S 1 Data block S 8 The data amount of any one of the data blocks, and therefore, the server can store the data block S 1 Data block S 8 Dividing for the third time to obtain a data group M 31 Data set M 32 Data set M 33 And data set M 34 . Wherein, data set M 31 May include a data block S 1 And data block S 2 Data set M 31 The identification information of (a) may be first to tenth bits of data, the data amount information may be 12 bits of data, and the 12 bits of data may be "ABCD12ACDE23"; data set M 32 May include a data block S 3 And data block S 4 Data set M 32 The identification information of (a) may be thirteenth to twenty-fourth bit data, the data amount information may be 12 bit data, and the 12 bit data may be "ABDE34ADEF45"; data set M 33 May includeData block S 5 And data block S 6 Data set M 33 The identification information of (a) may be twenty-fifth to thirty-sixth bits of data, the data amount information may be 12 bits of data, and the 12 bits of data may be "BDEF56BCEF67"; data set M 34 May include a data block S 7 And data block S 8 I.e. data set M 33 The identification information of (a) is thirty-seventh bit data to forty-eighth bit data, the data amount information is 12-bit data, and the 12-bit data may be "BEDA78CEDF89".
Further, the server may be based on the data block S 1 And data block S 2 Is a strong check value (i.e. U 1 And U 2 ) Determining data set M 31 According to the data block S 3 And data block S 4 Is a strong check value (i.e. U 3 And U 4 ) Determining data set M 32 According to the data block S 5 And data block S 6 Is a strong check value (i.e. U 5 And U 6 ) Determining data set M 34 According to the data block S 7 Data block S 8 Is a strong check value (i.e. U 7 ~U 8 ) Determining data set M 34 Is a weak check value of (1).
With data set M 33 For example, the server obtains the data group M starting from the first bit data (i.e., the twenty-fifth bit data) of the updated data b 33 Target data set (M 'as illustrated in FIG. 3 a)' 31 ). Wherein, data set M' 31 The twenty-fifth to thirty-sixth bits of data in the data b may be included, the data amount information is 12 bits, and the 12 bits of data may be "BDEF56BCEF67". The server can group the data M' 31 Divided into and data block S 1 And data block S 2 The data set M 'is determined according to the strong check value of the two data blocks' 31 Is a weak check value of (1). The server sets up data M 33 Weak checksum data set M' 31 By comparing the weak check values of (2) to determine the data set M 33 Weak checksum data set M' 31 Is the same as the weak check value of (1); at this time, the server may be based on the data block S 1 And data block S 2 Is a strong check value (i.e. U 1 And U 2 ) Determining data set M 33 And can be based on the target data set M' 31 The strong check value of two data blocks in the data set determines the target data set M' 31 Is a strong check value of (1); further, the server may group the data M 33 Strong check value and target data set M' 31 Is compared with the strong check value of (1) to determine the data set M 33 Strong check value and target data set M' 31 Is the same, i.e. data set M 33 And data set M' 31 The same; at this time, the server may generate first check information as shown in table 3.
Table 3: verification results of the third stage
Figure BDA0002018779190000271
Further, the server may make the twenty-fifth bit data to thirty-sixth bit data in the data b into a hole, to obtain updated data b. The first to thirty-sixth bits of data in the updated data b may be holes. Further, the server may acquire the data group M starting from the thirty-seventh bit data of the data b 33 Target data group of the same data volume according to data group M 33 The result of the comparison of the weak check value of (1) with the weak check value of the target data set, and the data set M 33 The comparison result of the strong check value of the target data set and the strong check value of the target data set is used for executing the check process, and the specific reference can be made to the above content, and the details are not repeated.
Fourth stage, server sets data block S 1 Data block S 8 The fourth division is performed.
Due to data set M 31 Data set M 32 Data set M 33 And data set M 34 The data quantity is larger than the data block S 1 Data block S 8 The data amount of any one of the data blocks, and therefore, the server can store the data block S 1 Data block S 8 And carrying out fourth division to obtain data blocks S1 to S8. The verification is performed on the data blocks S1 to S8 and the updated data b to obtain a verification result, and the specific implementation process can refer to the above content and is not repeated.
In one example, the verification results of the fourth stage may be as shown in table 4. The thirty-seventh to forty-eighth bit data of the data a are identical to the thirty-seventh to forty-eighth bit data of the data b, and the forty-second to forty-eighth bit data of the data a are different from the forty-second to forty-eighth bit data of the data b.
Table 4: verification results of the fourth stage
Figure BDA0002018779190000281
In the fifth stage, the server transmits the difference information to the client device.
After the server obtains the verification results (i.e., shown in table 2 to table 4) in the first stage to the fourth stage, the server may determine the same data as the data a in the data b according to the verification results, and may obtain the identification information of the same data in the data a and the identification information (i.e., the difference information) in the data b, so that the two identification information may be sent to the client device. For example, as can be seen from the contents of tables 2 to 4, the first to twenty-fourth data in data a are identical to the first to twenty-fifth data in data b, the twenty-fifth to thirty-sixth data in data a are identical to the twenty-fifth to thirty-sixth data in data b, the thirty-seventh to forty-seventh data in data a are identical to the thirty-seventh to forty-eighth data in data b, and the forty-second to forty-eighth data in data a are different from the forty-second to forty-eighth data in data b; at this time, the server may transmit the identification of the same data in data a and the identification in data b to the client device.
Table 5 is a schematic representation of difference information provided in an embodiment of the present invention.
Table 5: indication of difference information
Data a Data b
First bit data to twenty-fourth bit data First bit data to twenty-fourth bit data
Twenty-fifth bit data to thirty-sixth bit data Twenty-fifth bit data to thirty-sixth bit data
Thirty-seventh to forty-second bit data Thirty-seventh to forty-second bit data
After the client device receives the difference information sent by the server, the identification information of the same data in the first data packet and the second data packet can be determined from the difference information, and if the identification information of the same data in the data a and the identification information in the data b are determined to be the same, the data a in the client device can be not required to be updated according to the verification result; if the server determines that the identification information (such as the 4 th bit data) of the same data in the data a is different from the identification information (such as the 12 th bit data) in the data b, the 12 th bit data in the data a can be replaced by the 12 th bit data in the data a. For example, as shown in table 2, the first to twenty-fourth data of the data a are identical to the first to twenty-fourth data of the data b, and the server may not need to update the first to twenty-fourth data of the data a, i.e., the server may not need to perform any operation with respect to the verification result.
Further, for the data different from the data a and the data b, the client device may acquire the different data by using a plurality of methods, for example, the different data may be downloaded through a network, which is not limited in particular. In one possible implementation, the server may obtain data different from the data a in the data b for the data with different verification results, and send the data to the client device. Specifically, the server may determine that forty-two-bit data to forty-eight-bit data of data a is different from forty-two-bit data to forty-eight-bit data of data b according to the contents of table 4, and thus, the server may acquire forty-two-bit data to forty-eight-bit data of data b (i.e., DECA 90) and transmit identification information of DECA90 and data a (forty-two-bit data to forty-eight-bit data) to the client device, so that the client device updates forty-two-bit data to forty-eight-bit data of data a (i.e., CEDF 89) to DECA90.
Example two
Fig. 3b is a schematic diagram of an embodiment of another data processing method according to the embodiment of the present invention, as shown in fig. 3b, an old resource data packet c (abbreviated as "data c") is stored on the client device, and a data d (abbreviated as "data d") of a new resource data packet corresponding to the data c is stored on the server. Wherein, data c may include 60 bits of data, the 60 bits of data being "ABCD12ACDE23ABDE34ADEF45BDEF56BCEF67BEDA78CEDF89CFAD90CDFB01"; data d may include 44 bits of data, the 44 bits of data being "38AFABCD12ACDE23ABDE34ADEF45BDEF5691EBCEDF89". The update of data c using data d is performed as follows:
In the first stage, the client sends first information to the server.
In a specific implementation, the client device may divide the data c to obtain the data block Q 1 Data block Q 10 Wherein, data block Q 1 Data block Q 10 May comprise 6 bits of data. As shown in fig. 3b, data blocksQ 1 The data includes first to sixth data, namely data ABCD12; data block Q 2 The data comprises seventh bit data to tenth bit data, namely data ACDE23; data block Q 3 The data comprises thirteenth to eighteenth bit data, namely data ABDE34; data block Q 4 Includes nineteenth to twenty-fourth bits of data, namely data ADEF45; data block Q 5 Includes twenty-fifth bit data to thirty-first bit data, namely data BDEF56; data block Q 6 Including thirty-first to thirty-sixth bits of data, namely data BCEF67; data block Q 7 Including thirty-seventh to forty-second bit data, namely data BEDA78; data block Q 8 Comprising forty-two bits of data to forty-eight bits of data, namely data CEDF89; data block Q 9 Including forty-ninth to fifty-fourth bits of data, namely data CFAD90; data block Q 10 Includes fifty-fifth bit data to sixty-bit data, namely data CDFB01.
Further, the client devices may calculate the data blocks Q separately 1 Data block Q 10 And may be based on data block Q 1 Data block Q 10 The identification information, the data amount information, the weak check value and the strong check value of the server are used for generating first information, and the first information is sent to the server.
Second stage, server pair data block Q 1 Data block Q 10 The first division is performed.
After receiving the first information sent by the client device, the server may send a data block Q 1 Data block Q 10 Performing first division to obtain data group E 11 Data set E 12 And data set E 13 . Wherein, data group E 11 May include data block Q 1 Data block Q 4 Data set E 11 The identification information of (a) is first to twenty-fourth bit data, the data amount information is 24 bit data, and the 24 bit data is 'ABCD 12ACDE23ABDE34ADEF 45'; data set E 12 May include data block Q 5 Data block Q 8 Data set E 12 The identification information of (2) is twenty-fifth digitAccording to forty-eighth bit data, the data amount information is 24-bit data, and the 24-bit data is BDEF56BCEF67BEDA78CEDF 89; data set E 13 May include data block Q 9 Data block Q 10 Data set E 13 The identification information of (2) is forty-nine-bit data to sixty-bit data, the data amount information is 12-bit data, and the 12-bit data is "CFAD90CDFB01". And, the server may be based on the data block Q 1 Data block Q 4 Strong check value determination data set E of (2) 11 According to the weak check value of data block Q 5 Data block Q 8 Strong check value determination data set E of (2) 12 And may be based on data block Q 9 Data block Q 10 Strong check value determination data set E of (2) 13 Is a weak check value of (1).
Further, the server may obtain the data set E from the first bit data of the data d 11 Target data sets having the same data amount. The target data set may include 24 bits of data in data b, where the 24 bits of data are "38AFABCD12ACDE23ABDE34AD". The server may divide the target data group into and data block Q 1 Data block Q 4 The data quantity of the data blocks is the same, and the weak check value and the strong check value of each data block can be determined, so that the weak check value of the target data set is determined according to the strong check values of the four data blocks. The server sets data group E 11 Comparing the weak check value of the target data set with the weak check value of the target data set to determine the data set E 11 Is different from the weak check value of the target data set. At this time, the server may determine data set E 11 And data set E' 11 There is difference information between them.
The server may obtain the data set E starting from the second bit of data d 11 Target data sets having the same data amount. The target data set may include 24 bits of data in data b, where the 24 bits of data are "8AFABCD12ACDE23ABDE34ADE". The server determines data set E 12 Is different from the weak check value of the target data set, and determines data set E 12 Is different from the strong check value of the target data set; at this timeThe server may determine data set E 11 Unlike the target data set. Further, the server may obtain the data set E from the third bit data of the data d 11 Target data sets having the same data amount. The target data set may include 24 bits of data in data b, where the 24 bits of data are "AFABCD12ACDE23ABDE34ADEF". The server determines data set E 12 The server may determine data set E at this time when the weak check value of (a) is different from the weak check value of the target data set 11 Unlike the target data set.
According to the above procedure, the server can sequentially execute from the first data to the last data of the data d, and when executing to the fifth data, the server can determine the target data group (such as the data group E 'illustrated in FIG. 3 b) acquired from the fifth data of the data d' 11 ) And data set E 11 The same applies, at this time, the server may based on the data block Q 1 Data block Q 4 Strong check value determination data set E of (2) 11 And the strong check values of the four data blocks of the target data set determine the target data set E' 11 Is a strong check value of (1); the server sets data group E 11 Strong check value and target data set E' 11 Is compared with the strong check value of (1) to determine the data set E 11 Strong check value and target data set E' 11 The strong check values of (2) are the same, and thus the server can generate a check result. Wherein, data set E' 11 24 bits of data in data d may be included, the 24 bits of data being "ABCD12ACDE23ABDE34ADEF45". After the server generates the verification result, the fifth bit data to the twenty-ninth bit data in the data d can be updated into holes to obtain updated data d; and may use data set E starting from the thirty-th bit of data d 11 And (5) checking.
If data set E 11 The verification process for data d ends and the server may begin with the first bit of data (i.e., the thirty-th bit of data) of the updated data d, using data set E 12 And data set E 13 And respectively checking the data d. The specific implementation process may refer to the above and will not be described in detail. In using the data set E 12 And data set E 13 In the process of checking the data d, the data d does not exist in the data group E 12 Or data set E 13 The same data, and therefore the server does not generate a verification result in the process.
In one example, the results of the second stage verification may be as shown in table 6. The first to twenty-fourth data of the data c are the same as the fifth to twenty-ninth data of the data d.
Table 6: verification result of the second stage
Data c Data d Checking the result
First bit data to twenty-fourth bit data Fifth bit data to twenty-ninth bit data Identical to
Third stage, server sets data block Q 1 Data block Q 10 A second division is made.
The server may be able to block Q of data 1 Data block Q 10 Performing a second division to obtain a data set E 21 Data set E 22 Data set E 23 Data set E 24 And data set E 25 . In using data set E 21 Data set E 22 Data set E 23 Data set E 24 And data set E 5 During the verification of data d, data d is not present in the data E 21 Data set E 22 Number of timesData set E 23 Data set E 24 Or data set E 25 The same data, and therefore the server does not generate the verification information in the process.
Fourth stage, server sets data block Q 1 Data block Q 10 A third division is performed.
The server may be able to block Q of data 1 Data block Q 10 Dividing for the third time to obtain a data block Q 1 Data block Q 10 . For data block Q 1 Data block Q 10 And checking the updated data d to obtain a checking result.
In one example, the verification results of the fourth stage may be as shown in table 7. The thirty-seventh to forty-eighth bit data of the data a are identical to the thirty-seventh to forty-eighth bit data of the data b, and the forty-second to forty-eighth bit data of the data a are different from the forty-second to forty-eighth bit data of the data b.
Table 7: verification results of the fourth stage
Figure BDA0002018779190000331
In the fifth stage, the server transmits the difference information to the client device.
After the server obtains the verification results (i.e., table 6 and table 7) in the first stage to the fourth stage, for the data with the same verification result, taking the verification result shown in table 6 as an example, the first data to the twenty-fourth data in the data c are the same as the fifth data to the twenty-ninth data in the data d, so that the server can send the identification information (i.e., the first data to the twenty-fourth data) of the data with the same verification result in the data c and the identification information (i.e., the fifth data to the twenty-ninth data) in the data d to the client device, so that the client device updates the fifth data to the twenty-ninth data in the data c according to the first data to the twenty-fourth data in the data c, i.e., updates the fifth data to the twenty-ninth data 12ACDE23ABDE34 adde 34 BDEF 45 in the data c to the first data to the twenty-fourth data ABCD12ACDE23 abdde 34 in the original data c.
In one possible implementation, the server may obtain data different from the data c in the data d for the data with different verification results, and send the data to the client device. As shown in table 7, the server may determine that the first to fourth data, the thirty-fifth to thirty-eighth data, and the data c are different, and thus the server may acquire the first to fourth data (i.e., 38 AF) and the thirty-fifth to thirty-eighth data (i.e., 91 EB) of the data d and transmit identification information (first to fourth data) of the 38AF and the data d, and identification information (thirty-fifth to thirty-eighth data) of the 91EB and the data d to the client device, so that the client device updates the first to fourth data (i.e., ABCD) of the data c to 38AF and updates the thirty-fifth to thirty-eighth data (i.e., 67 BE) of the data c to 91EB.
In the above embodiment of the present invention, after obtaining first information sent by a client device, a server divides N first data blocks for the first time to obtain M groups of data, and generates check information corresponding to each group of data according to a check value corresponding to at least one first data block and a second data packet corresponding to the first data packet included in each group of data, where the first information includes data amounts of the N first data blocks corresponding to the first data packet and check values corresponding to the N first data blocks respectively; further, the server determines difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and sends the difference information to the client device, so that the client device updates the first data packet according to the difference information. In the embodiment of the invention, the first data packet is used for checking the second data packet, so that the server can transmit the difference information to the client device without transmitting the whole first data packet to the client device, thereby avoiding transmission of repeated data information, reducing loss of network flow and improving efficiency of data synchronization; in addition, in the embodiment of the invention, the verification value of the data block is adopted to determine the verification value of the data group, so that the synchronization process can be completed by only executing one communication interaction between the client device and the server without executing multiple communication interactions, thereby reducing the pressure of network communication and reducing the network transmission flow.
For the above method flow, the embodiment of the present invention further provides a server, and specific content of the server may be implemented by referring to the above method.
Fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention, including:
an obtaining module 401, configured to obtain first information sent by a client device, where the first information includes data amounts of N first data blocks corresponding to a first data packet and check values corresponding to the N first data blocks respectively;
the processing module 402 is configured to divide the N first data blocks for the first time to obtain M groups of data, and generate check information corresponding to each group of data according to a check value corresponding to at least one first data block included in each group of data and a second data packet corresponding to the first data packet;
and the transceiver module 403 is configured to determine, according to the check information corresponding to the M groups of data and the second data packet, difference information corresponding to the first data packet, and send the difference information to the client device, so that the client device updates the first data packet according to the difference information.
Optionally, before generating the check information corresponding to each set of data, the processing module 402 is further configured to:
And determining that the maximum data amount in the M groups of data is greater than or equal to the minimum data amount in the data amounts of the N first data blocks.
Optionally, the check values respectively corresponding to the N first data blocks included in the first information are first check values respectively corresponding to the N first data blocks;
the processing module 402 is configured to:
the M groups of data comprise a Y-th data group, the Y-th data group comprises T first data blocks, and the Y-th data group in the M groups of data is executed:
determining a second check value corresponding to the Y-th data set according to first check values respectively corresponding to T first data blocks included in the Y-th data set;
starting from the ith data in a second data packet corresponding to the Y-1 data set, acquiring a first target data set with the same data quantity as the Y data set, and dividing the first target data set to obtain T second data blocks, wherein the data quantity of the T second data blocks is the same as the data quantity of the T first data blocks; determining a second check value corresponding to the first target data set according to the first check values of the T second data blocks; generating verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set;
And updating the second data packet corresponding to the Y-1 group of data to obtain the second data packet corresponding to the Y group of data.
Optionally, the processing module 402 is configured to:
if the second check value corresponding to the Y-th data set is the same as the second check value corresponding to the first target data set, determining the first check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set, and determining the first check value corresponding to the first target data set according to the first check values of the T second data blocks; if the first check value corresponding to the Y-th data set is different from the first check value corresponding to the first target data set, generating first check information of the Y-th data set;
and if the second check value corresponding to the Y-th data set is different from the second check value corresponding to the first target data set, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
Optionally, the processing module 402 is further configured to:
when the first check value corresponding to the Y-th data set is identical to the first check value corresponding to the first target data set, if the data amount of the Y-th data set is determined to be equal to the minimum data amount in the N first data blocks, generating second check information of the Y-th data set; and if the data quantity of the Y-th data set is determined to be larger than the minimum data quantity in the N first data blocks, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a third target data set with the same data quantity as the Y-th data set.
Optionally, the processing module 402 is further configured to:
and if the data volume of the second data packet corresponding to the Mth group of data is determined to be greater than or equal to a preset data volume threshold value, performing second division on the N first data blocks.
Optionally, the processing module 402 is configured to:
performing second division on the N first data blocks to obtain P groups of data;
and if the maximum data volume in the P groups of data is smaller than the minimum data volume in the N first data blocks, sending the verification information of the first to M groups of data to the client equipment.
From the above, it can be seen that: in the above embodiment of the present invention, after obtaining first information sent by a client device, a server divides N first data blocks for the first time to obtain M groups of data, and generates check information corresponding to each group of data according to a check value corresponding to at least one first data block and a second data packet corresponding to the first data packet included in each group of data, where the first information includes data amounts of the N first data blocks corresponding to the first data packet and check values corresponding to the N first data blocks respectively; further, the server determines difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and sends the difference information to the client device, so that the client device updates the first data packet according to the difference information. In the embodiment of the invention, the first data packet is used for checking the second data packet, so that the server can transmit the difference information to the client device without transmitting the whole first data packet to the client device, thereby avoiding transmission of repeated data information, reducing loss of network flow and improving efficiency of data synchronization; in addition, in the embodiment of the invention, the verification value of the data block is adopted to determine the verification value of the data group, so that the synchronization process can be completed by only executing one communication interaction between the client device and the server without executing multiple communication interactions, thereby reducing the pressure of network communication and reducing the network transmission flow.
Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform the data processing method as described in fig. 1 or fig. 2 above.
Based on the same inventive concept, an embodiment of the present invention also provides a computer program product, characterized in that it when run on a computer causes the computer to perform the data processing method as described in fig. 1 or fig. 2 above.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (13)

1. A method of data processing, the method comprising:
the method comprises the steps that a server obtains first information sent by a client device, wherein the first information comprises check values of N first data blocks corresponding to a first data packet;
the server divides the N first data blocks for the first time to obtain M groups of data, and generates verification information corresponding to each group of data according to a verification value of at least one first data block included in each group of data and a second data packet corresponding to the first data packet;
the server determines difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and sends the difference information to the client device so that the client device updates the first data packet according to the difference information;
The first information further includes data amounts of the N first data blocks, and the check values respectively corresponding to the N first data blocks included in the first information are first check values respectively corresponding to the N first data blocks;
generating the verification information corresponding to each group of data according to the verification value of at least one first data block included in each group of data and the second data packet corresponding to the first data packet, including:
the M groups of data comprise a Y-th data group, the Y-th data group comprises T first data blocks, and the Y-th data group in the M groups of data is executed:
the server determines a second check value corresponding to the Y-th data set according to first check values of T first data blocks included in the Y-th data set;
the server acquires a first target data group with the same data quantity as the Y-1 data group from the ith data in a second data packet corresponding to the Y-1 data group, and divides the first target data group to obtain T second data blocks, wherein the data quantity of the T second data blocks is the same as the data quantity of the T first data blocks; determining a second check value corresponding to the first target data set according to the first check values of the T second data blocks; generating verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set;
And the server updates the second data packet corresponding to the Y-1 group of data to obtain the second data packet corresponding to the Y group of data.
2. The method according to claim 1, wherein before generating the check information corresponding to each set of data according to the check value of at least one first data block included in each set of data and the second data packet corresponding to the first data packet, the method further comprises:
the server determines that a maximum data amount in the M sets of data is greater than or equal to a minimum data amount in the data amounts of the N first data blocks.
3. The method of claim 1, wherein generating the verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set comprises:
if the server determines that the second check value corresponding to the Y-th data set is the same as the second check value corresponding to the first target data set, determining the first check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set, and determining the first check value corresponding to the first target data set according to the first check values of the T second data blocks; if the first check value corresponding to the Y-th data set is identical to the first check value corresponding to the first target data set, generating first check information of the Y-th data set;
And if the server determines that the second check value corresponding to the Y-th data set is different from the second check value corresponding to the first target data set, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
4. A method according to claim 3, characterized in that the method further comprises:
when the server determines that the first check value corresponding to the Y-th data set is the same as the first check value corresponding to the first target data set, if the data volume of the Y-th data set is determined to be equal to the minimum data volume in the N first data blocks, generating second check information of the Y-th data set; and if the data quantity of the Y-th data set is determined to be larger than the minimum data quantity in the N first data blocks, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a third target data set with the same data quantity as the Y-th data set.
5. The method according to any one of claims 1 to 4, further comprising:
and if the server determines that the data volume of the second data packet corresponding to the Mth group of data is greater than or equal to a preset data volume threshold, performing second division on the N first data blocks.
6. The method of claim 5, wherein the server performs a second partitioning of the N first data blocks to obtain P sets of data;
and if the server determines that the maximum data volume in the P groups of data is smaller than the minimum data volume in the data volumes of the N first data blocks, sending the verification information of the first to M groups of data to the client equipment.
7. A server, the server comprising:
the acquisition module is used for acquiring first information sent by the client device, wherein the first information comprises check values of N first data blocks corresponding to the first data packet;
the processing module is used for carrying out first division on the N first data blocks to obtain M groups of data, and generating verification information corresponding to each group of data according to a verification value of at least one first data block included in each group of data and a second data packet corresponding to the first data packet;
the receiving and transmitting module is used for determining difference information corresponding to the first data packet according to the verification information corresponding to the M groups of data and the second data packet, and transmitting the difference information to the client device so that the client device updates the first data packet according to the difference information;
The first information further includes data amounts of the N first data blocks, and the check values respectively corresponding to the N first data blocks included in the first information are first check values respectively corresponding to the N first data blocks;
the processing module is used for:
the M groups of data comprise a Y-th data group, the Y-th data group comprises T first data blocks, and the Y-th data group in the M groups of data is executed:
determining a second check value corresponding to the Y-th data set according to first check values of T first data blocks included in the Y-th data set;
starting from the ith data in a second data packet corresponding to the Y-1 data set, acquiring a first target data set with the same data quantity as the Y data set, and dividing the first target data set to obtain T second data blocks, wherein the data quantity of the T second data blocks is the same as the data quantity of the T first data blocks; determining a second check value corresponding to the first target data set according to the first check values of the T second data blocks; generating verification information of the Y-th data set according to the second verification value corresponding to the Y-th data set and the second verification value corresponding to the first target data set;
And updating the second data packet corresponding to the Y-1 group of data to obtain the second data packet corresponding to the Y group of data.
8. The server according to claim 7, wherein the processing module is further configured to, before generating the check information corresponding to each set of data according to the check value of at least one first data block included in each set of data and the second data packet corresponding to the first data packet:
and determining that the maximum data amount in the M groups of data is greater than or equal to the minimum data amount in the data amounts of the N first data blocks.
9. The server of claim 7, wherein the processing module is configured to:
if the second check value corresponding to the Y-th data set is the same as the second check value corresponding to the first target data set, determining the first check value corresponding to the Y-th data set according to the first check values respectively corresponding to the T first data blocks included in the Y-th data set, and determining the first check value corresponding to the first target data set according to the first check values of the T second data blocks; if the first check value corresponding to the Y-th data set is different from the first check value corresponding to the first target data set, generating first check information of the Y-th data set;
And if the second check value corresponding to the Y-th data set is different from the second check value corresponding to the first target data set, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a second target data set with the same data quantity as the Y-th data set.
10. The server of claim 9, wherein the processing module is further configured to:
when the first check value corresponding to the Y-th data set is identical to the first check value corresponding to the first target data set, if the data amount of the Y-th data set is determined to be equal to the minimum data amount in the N first data blocks, generating second check information of the Y-th data set; and if the data quantity of the Y-th data set is determined to be larger than the minimum data quantity in the N first data blocks, starting from the (i+1) -th bit data in the second data packet corresponding to the Y-1-th data set, and acquiring a third target data set with the same data quantity as the Y-th data set.
11. The server according to any one of claims 7 to 10, wherein the processing module is further configured to:
and if the data volume of the second data packet corresponding to the M-th group of data is determined to be greater than or equal to a preset data volume threshold value, performing second division on the N first data blocks.
12. The server of claim 11, wherein the processing module is configured to:
performing second division on the N first data blocks to obtain P groups of data;
and if the maximum data volume in the P groups of data is smaller than the minimum data volume in the N first data blocks, sending the verification information of the first to M groups of data to the client equipment.
13. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 6.
CN201910272205.8A 2019-04-04 2019-04-04 Data processing method and server Active CN110083614B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910272205.8A CN110083614B (en) 2019-04-04 2019-04-04 Data processing method and server
PCT/CN2020/072336 WO2020199724A1 (en) 2019-04-04 2020-01-15 Data processing method, server and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910272205.8A CN110083614B (en) 2019-04-04 2019-04-04 Data processing method and server

Publications (2)

Publication Number Publication Date
CN110083614A CN110083614A (en) 2019-08-02
CN110083614B true CN110083614B (en) 2023-06-06

Family

ID=67414244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910272205.8A Active CN110083614B (en) 2019-04-04 2019-04-04 Data processing method and server

Country Status (2)

Country Link
CN (1) CN110083614B (en)
WO (1) WO2020199724A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083614B (en) * 2019-04-04 2023-06-06 中国银联股份有限公司 Data processing method and server
CN112612852B (en) * 2020-12-29 2024-06-11 中国农业银行股份有限公司 Data synchronization method and device, electronic equipment and storage medium
CN117271655A (en) * 2022-06-14 2023-12-22 华为技术有限公司 Data synchronization method, system, medium, program product and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854241A (en) * 2009-03-30 2010-10-06 上海聚力传媒技术有限公司 Method and device for verifying data block transmitted in network
CN105682183A (en) * 2016-01-14 2016-06-15 美的集团股份有限公司 Method and device for controlling household appliance to access to network
CN108255647A (en) * 2018-01-18 2018-07-06 湖南麒麟信安科技有限公司 A kind of high-speed data backup method under samba server clusters

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297482B (en) * 2012-03-05 2016-12-14 联想(北京)有限公司 Information processing method and equipment
CN104243508A (en) * 2013-06-07 2014-12-24 富鸿康科技(深圳)有限公司 Server, client side and file synchronization method
CN104579605B (en) * 2013-10-23 2018-04-10 华为技术有限公司 A kind of data transmission method and device
CN106528125A (en) * 2016-10-26 2017-03-22 腾讯科技(深圳)有限公司 Data file incremental updating method, server, client and system
CN110083614B (en) * 2019-04-04 2023-06-06 中国银联股份有限公司 Data processing method and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854241A (en) * 2009-03-30 2010-10-06 上海聚力传媒技术有限公司 Method and device for verifying data block transmitted in network
CN105682183A (en) * 2016-01-14 2016-06-15 美的集团股份有限公司 Method and device for controlling household appliance to access to network
CN108255647A (en) * 2018-01-18 2018-07-06 湖南麒麟信安科技有限公司 A kind of high-speed data backup method under samba server clusters

Also Published As

Publication number Publication date
WO2020199724A1 (en) 2020-10-08
CN110083614A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110083614B (en) Data processing method and server
CN108256353B (en) Data integrity checking method and device and client
CN107396360B (en) Block verification method and device
US9705678B1 (en) Fast CAN message authentication for vehicular systems
US20120096564A1 (en) Data integrity protecting and verifying methods, apparatuses and systems
CN106484453B (en) Method and device for realizing system upgrading
CN110134424A (en) Firmware upgrade method and system, server, smart machine, readable storage medium storing program for executing
CN106843957A (en) System firmware upgrade method and device
CN111666564B (en) Application program safe starting method and device, computer equipment and storage medium
CN109862099A (en) A kind of upgrade checkout method, apparatus, terminal and system
CN114661318A (en) Efficient post-quantum security software updates customized for resource constrained devices
US20170302693A1 (en) Rewrite detection system and information processing device
CN115795513A (en) File encryption method, file decryption method, file encryption device, file decryption device and equipment
CN112839003A (en) Data verification method and system
CN111429136B (en) Block chain-based data auditing method and device
CN111191738B (en) Cross-platform data processing method, device, equipment and readable storage medium
CN111937359A (en) Communication address setting method of detection equipment, unmanned aerial vehicle and storage medium
CN104503862B (en) The method and apparatus for obtaining the check value using channel bag
CN111400771A (en) Target partition checking method and device, storage medium and computer equipment
CN111835504B (en) Identification code generation method and server
CN114050972B (en) OTA upgrading method
CN113051585B (en) Data verification method and device, electronic equipment and storage medium
CN115118504A (en) Knowledge base updating method and device, electronic equipment and storage medium
CN110347609B (en) Method and device for testing blockchain software
CN117349867B (en) Intelligent contract deployment method, system, equipment and medium

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