Data transmission method, device, equipment and storage medium

By using hash lists and checksum comparisons to generate differential data during data transmission, and only transmitting the differential parts, the problem of low efficiency in transmitting large files in the existing technology is solved, and more efficient data transmission is achieved.

CN118368294BActive Publication Date: 2024-09-10PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410793206.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-10
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

Existing technologies cannot fully utilize network bandwidth when transmitting large files, resulting in low transmission efficiency.

Method used

By obtaining the hash list generated by the receiver based on the initial data, the target data is divided into data fragments, and the checksum comparison is used to generate the difference bits and difference data. Only the difference data is transmitted. The receiver is based on the difference data list, the same The shard list and initial data are used for data reconstruction.

Benefits of technology

It improves the accuracy and efficiency of data transmission, reduces the transmission burden, and improves transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118368294B
    Figure CN118368294B
Patent Text Reader

Abstract

The embodiments of the present application provide a data transmission method, device, equipment and storage medium, and relate to the field of data processing technology. The method obtains a first hash list generated by the receiver according to the first data fragment corresponding to the initial data, divides the target data into the second data fragment, and calculates the second checksum of the second data fragment. If the first checksum consistent with the second checksum is found, the first fragment number, the second fragment number and the first checksum are written into the same fragment list; otherwise, difference bits and difference data are generated, the second fragment number, the difference bits and the difference data are written into the difference data list, and the difference data list and the same fragment list are sent to the receiver. The difference bits and difference data that need to be differentially transmitted are generated using the checksum comparison results of the two files, the same fragment list and the difference-related data are transmitted to the receiver, and the data is reconstructed to obtain the target data, reducing the transmission burden and improving the transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data transmission method, apparatus, device and storage medium. Background Art

[0002] With the rapid development of the Internet in all walks of life and the continuous improvement of the level of informatization, various network applications have emerged in an endless stream, and the amount of data that needs to be transmitted has continued to increase. In particular, the efficient transmission of big data or large files has become increasingly important. In the related technology, when transmitting large files, the problem of bandwidth limitation or network delay is reduced by using the constantly updated DNS domain name for data exchange. However, this transmission process cannot fully utilize the network bandwidth, resulting in low transmission efficiency. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a data transmission method, apparatus, device and storage medium to improve data transmission efficiency.

[0004] To achieve the above object, a first aspect of an embodiment of the present application proposes a data transmission method, including:

[0005] Obtain a first hash list generated by the receiver according to the first data slice corresponding to the initial data, wherein the first hash list includes a first slice number and a corresponding first checksum of at least one of the first data slices;

[0006] Splitting the target data into second data slices, and calculating a second checksum of the second data slices, wherein the target data is data related to the initial data;

[0007] Compare the consistency of the second checksum with the first checksum of the first hash list, and if the first checksum consistent with the second checksum is found, write the corresponding first shard number, the second shard number of the second data shard, and the first checksum into the same shard list; if the first checksum consistent with the second checksum is not found, generate difference bits and difference data, and write the second shard number, the difference bits, and the difference data into the difference data list;

[0008] The difference data list and the same shard list are sent to the receiver, so that the receiver reconstructs data according to the difference data list, the same shard list, the first hash list and the initial data to obtain the target data.

[0009] In some embodiments, if the first checksum consistent with the second checksum is not found, generating difference bits and difference data includes:

[0010] Starting from the first byte of the second data slice, moving backward byte by byte to perform sliding window, to obtain data before sliding window and sliding window data slice, the data size of the sliding window data slice is the same as the data size of the second data slice;

[0011] Calculate the third checksum of the sliding window data segment. If the third checksum is consistent with the first checksum, write the corresponding first segment number, the second segment number and the first checksum into the same segment list, use the corresponding pre-sliding window data as the difference data, and use the sliding window number corresponding to the difference data as the difference bit.

[0012] In some embodiments, sending the difference data list and the same shard list to the receiving party includes:

[0013] Obtain the shard data transmission authentication key and the shard data transmission encryption key;

[0014] Encrypting the difference data list according to the fragmented data transmission encryption key to obtain first encrypted data;

[0015] The first encrypted data and the same shard list are signed according to the shard data transmission authentication key to obtain target data, and the target data is sent to the recipient.

[0016] In some embodiments, obtaining the sliced ​​data transmission authentication key and the sliced ​​data transmission encryption key includes:

[0017] Obtain a first random number and a second random number, and obtain a first parameter, a second parameter, and a third parameter, and calculate a first encryption parameter based on the first random number, the second random number, the first parameter, the second parameter, and the third parameter;

[0018] Obtain an intermediate sending parameter according to the sender identifier, the second random number and the first encryption parameter, and send the intermediate sending parameter to the receiver;

[0019] Acquire an intermediate receiving parameter obtained by the receiver based on the intermediate sending parameter, and calculate the sliced ​​data transmission authentication key and the sliced ​​data transmission encryption key according to the intermediate receiving parameter.

[0020] In some embodiments, the calculating the first encryption parameter based on the first random number, the second random number, the first parameter, the second parameter and the third parameter includes:

[0021] Performing a hash calculation on the plain text password and the second random number using an obfuscation function to obtain a first intermediate value;

[0022] Obtain a second intermediate value according to the first random number, the first parameter, and the second parameter;

[0023] A first key is obtained according to the first intermediate value, a sender identifier, a second random number and the second intermediate value are concatenated to obtain a first concatenated value, and the first concatenated value is encrypting with the first key to obtain the first encryption parameter.

[0024] In some embodiments, the process of the receiver obtaining the intermediate receiving parameter based on the intermediate sending parameter includes:

[0025] Acquire the sender identifier and the second random number from the intermediate sending parameter;

[0026] Verify the sender identifier and the second random number, and after the verification is passed, obtain a third random number and a fourth random number, and calculate a second encryption parameter based on the third random number, the fourth random number, the first parameter, and the second parameter;

[0027] The intermediate receiving parameter is obtained according to the receiver identifier, the fourth random number and the second encryption parameter.

[0028] In some embodiments, calculating the second encryption parameter based on the third random number, the fourth random number, the first parameter, and the second parameter includes:

[0029] Performing a hash calculation on the plain text password and the fourth random number using an obfuscation function to obtain a third intermediate value;

[0030] Obtain a fourth intermediate value according to the third random number, the first parameter, and the second parameter;

[0031] A second key is obtained according to the third intermediate value, the recipient identifier, the fourth random number and the fourth intermediate value are concatenated to obtain a second concatenated value, and the second concatenated value is encrypting with the second key to obtain the second encryption parameter.

[0032] In some embodiments, the calculating the sliced ​​data transmission authentication key and the sliced ​​data transmission encryption key according to the intermediate reception parameter includes:

[0033] Obtaining the recipient identifier and the fourth random number from the intermediate receiving parameter;

[0034] Verify the receiver identifier and the fourth random number. After the verification is passed, obtain a fifth intermediate value according to the first random number and the fourth intermediate value, sequentially concatenate the receiver identifier, the sender identifier and the fifth intermediate value to obtain a third concatenated value, and calculate a target hash value of the third concatenated value;

[0035] The sliced ​​data transmission authentication key is obtained based on the value corresponding to the first position digit of the target hash value, and the sliced ​​data transmission encryption key is obtained based on the value corresponding to the second position digit of the target hash value.

[0036] In some embodiments, the first parameter, the second parameter and the third parameter satisfy the following conditions:

[0037] The values ​​after the modulo operation of the first parameter and the second parameter are not equal to one, and the value after the modulo operation of the product of the first parameter and the third parameter and the second parameter is equal to one, and the third parameter is twice the second parameter plus one.

[0038] In some embodiments, the step of performing a hash calculation on the plaintext password and the second random number using an obfuscation function to obtain a first intermediate value includes:

[0039] Performing an XOR operation on the plain text password and a preset random number to obtain a first operation value;

[0040] An XOR operation is performed on the first operation value and each 256 bits of the second random number, and the first intermediate value is obtained according to the XOR operation result.

[0041] In some embodiments, dividing the target data into second data fragments includes:

[0042] Splitting the target data into data blocks;

[0043] Each of the data blocks is divided into the second data slices of a preset size in sequence.

[0044] To achieve the above object, a second aspect of an embodiment of the present application proposes a data transmission method, which is applied to a receiving party and includes:

[0045] Receiving a plurality of first data fragments corresponding to the initial data;

[0046] Generate a first Hash list according to the first data shard, and transmit the first Hash list to a sender, wherein the first Hash list includes a first shard number and a corresponding first checksum of at least one of the first data shards;

[0047] receiving a difference data list and an identical slice list, the difference data list including a second slice number, a difference bit, and difference data of a second data slice, the second data slice being obtained according to the target data, the sender comparing the second checksum of the second data slice with the first checksum for consistency, and if the first checksum consistent with the second checksum is found, writing the corresponding first slice number, the second slice number of the second data slice, and the first checksum into the identical slice list; if the first checksum consistent with the second checksum is not found, generating the difference bit and the difference data;

[0048] Data is reconstructed according to the difference data list, the same shard list, the first hash list and the initial data to obtain the target data.

[0049] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides a data transmission device, including:

[0050] A receiving module, configured to obtain a first hash list generated by a receiving party according to a first data slice corresponding to the initial data, wherein the first hash list includes a first slice number and a corresponding first checksum of at least one of the first data slices;

[0051] a checksum calculation module, configured to divide the target data into second data slices and calculate a second checksum of the second data slices, wherein the target data is data related to the initial data;

[0052] a checksum comparison module, configured to compare the consistency of the second checksum with the first checksum of the first hash list, and if the first checksum consistent with the second checksum is found, write the corresponding first shard number, the second shard number of the second data shard, and the first checksum into the same shard list; if the first checksum consistent with the second checksum is not found, generate a difference bit and difference data, and write the second shard number, the difference bit, and the difference data into a difference data list;

[0053] A sending module is used to send the difference data list and the same fragment list to the receiving party, so that the receiving party reconstructs data according to the difference data list, the same fragment list, the first hash list and the initial data to obtain the target data.

[0054] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the first aspect or the second aspect when executing the computer program.

[0055] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes a storage medium, which is a storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.

[0056] The data transmission method, apparatus, device and storage medium proposed in the embodiments of the present application first obtain a first hash list generated by a receiver according to a first data slice corresponding to initial data, divide the target data into second data slices, and calculate a second checksum of the second data slice, compare the second checksum with the first checksum of the first hash list for consistency, and if a first checksum consistent with the second checksum is found, write the corresponding first slice number, the second slice number of the second data slice and the first checksum into the same slice list; if the first checksum consistent with the second checksum is not found, generate difference bits and difference data, write the second slice number, the difference bits and the difference data into a difference data list, and finally send the difference data list and the same slice list to the receiver, so that the receiver reconstructs the data according to the difference data list, the same slice list, the first hash list and the initial data to obtain the target data. The embodiment of the present application first transmits the initial data in full, and when the target data related to the initial data is subsequently transmitted, the checksum of the two files is used for comparison, and the difference bits and difference data that need to be differentially transmitted are generated according to the comparison results. During the transmission process, the same fragment list and difference-related data are transmitted to the receiver, and the receiver reconstructs the data to obtain the target data. By means of checksum comparison, the accuracy of differential data is improved, and the transmission of differential data can reduce the transmission burden and improve the transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flowchart of the data transmission method provided in an embodiment of the present application.

[0058] Figure 2 It is a data block schematic diagram provided in an embodiment of the present application.

[0059] Figure 3 It is a schematic diagram of the first hash list provided in an embodiment of the present application.

[0060] Figure 4 This is a flowchart of generating difference bits and difference data if a first checksum consistent with a second checksum is not found, provided in an embodiment of the present application.

[0061] Figure 5 It is a calculation diagram for generating difference bits and difference data provided in an embodiment of the present application.

[0062] Figure 6This is a flowchart of obtaining a slice data transmission authentication key and a slice data transmission encryption key provided in an embodiment of the present application.

[0063] Figure 7 This is a flowchart of calculating a slice data transmission authentication key and a slice data transmission encryption key based on intermediate reception parameters provided by an embodiment of the present application.

[0064] Figure 8 It is a schematic diagram of the overall principle of the data transmission method provided in an embodiment of the present application.

[0065] Fig. 9 It is an optional flowchart of the data transmission method provided in an embodiment of the present application.

[0066] Fig.10 This is a structural block diagram of a data transmission device provided by another embodiment of the present application.

[0067] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0069] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0071] With the rapid development of the Internet in all walks of life and the continuous improvement of the level of informatization, various network applications have emerged in an endless stream, and the amount of data that needs to be transmitted has continued to increase. In particular, the efficient transmission of big data or large files has become increasingly important. In the related technology, when transmitting large files, the problem of bandwidth limitation or network delay is reduced by using the constantly updated DNS domain name for data exchange. However, this transmission process cannot fully utilize the network bandwidth, resulting in low transmission efficiency.

[0072] Based on this, the embodiments of the present application provide a data transmission method, device, equipment and storage medium. First, the initial data is transmitted in full. When the target data related to the initial data is subsequently transmitted, the checksum of the two files is used for comparison. The difference bits and difference data that need to be differentially transmitted are generated according to the comparison results. During the transmission process, the same fragment list and difference-related data are transmitted to the receiver, and the receiver reconstructs the data to obtain the target data. By means of checksum comparison, the accuracy of the differential data is improved, and the transmission of differential data can reduce the transmission burden and improve the transmission efficiency.

[0073] The embodiments of the present application provide a data transmission method, apparatus, device and storage medium, which are specifically illustrated by the following embodiments. First, the data transmission method in the embodiments of the present application is described.

[0074] The data transmission method provided in the embodiment of the present application relates to the field of data processing technology. The data transmission method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be a computer program running in a terminal or a server side. For example, a computer program can be a native program or software module in an operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a client that supports data transmission, or it can be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form. Among them, the terminal communicates with the server through a network. The data transmission method can be executed by a terminal or a server, or by a terminal and a server in collaboration.

[0075] In some embodiments, the terminal may be a smart phone, tablet computer, laptop computer, desktop computer or smart watch, etc. The server may be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; or a service node in a blockchain system, where each service node in the blockchain system forms a peer-to-peer (P2P, PeerTo Peer, P2P) network, and the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. The terminal and the server may be connected via Bluetooth, Universal Serial Bus (USB) or network communication connection methods, which are not limited in this embodiment.

[0076] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0077] The following describes the data transmission method in the embodiment of the present application, taking the sender as an example.

[0078] Figure 1 is an optional flowchart of the data transmission method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps 110 to 140. It can also be understood that this embodiment Figure 1 The order of step 110 to step 140 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0079] Step 110: Obtain a first hash list generated by the receiver according to the first data segment corresponding to the initial data.

[0080] Among them, the purpose of the embodiment of the present application is that after an initial data has been fully transmitted, the initial data is subsequently updated in an incremental manner at the end of the file, or there is a small amount of update in the middle of the file, and the updated data is used as the target data to improve the transmission efficiency of the target data. Therefore, the initial data is first divided into multiple first data fragments, and all the first data fragments are sent to the receiver. The receiver calculates the checksum of each first data fragment by using the binary inverse code sum method as the first checksum, and stores the first fragment number and the first checksum corresponding to the first data fragment in the first hash list, and finally returns the first hash list to the sender.

[0081] In one embodiment, referring to Figure 2 , Figure 2 It is a data block diagram provided by an embodiment of the present application. The sender divides the initial data into multiple data blocks, and then each data block is divided into a first data fragment of a preset size. These data blocks can be distributed and stored on different file servers, such as file servers in a distributed database, and then sent in parallel using different file servers. One file server is responsible for sending one or more data blocks to improve transmission efficiency. These data blocks can also be stored on the same file server and transmitted in parallel using different processes. One process is responsible for sending one or more data blocks. Parallel transmission can reduce waiting time, thereby improving transmission efficiency. It is understandable that data blocks may or may not be repeated. For example, in order to increase data reliability, redundant storage is performed during segmentation. At this time, different data blocks contain a certain amount of repeated data content.

[0082] In one embodiment, referring to Figure 2 , the preset size may be 512 bytes, that is, when transmitting a data block, the data block is segmented into a series of 512-byte first data segments according to the data sequence. The preset size here may be set according to actual transmission requirements.

[0083] Next, the receiver generates a first checksum for each first data shard, and then stores the first shard number and the corresponding first checksum of the first data shard in the first hash table. Figure 3 , Figure 3 It is a schematic diagram of the first hash list provided in an embodiment of the present application. Figure 3The name of the initial file is FILENAME, for example, the file name is: DNS.txt, BLOCK NO. indicates the block number corresponding to the data block obtained by segmentation, FRAGMENT NO. indicates the first fragment number of the first data fragment. HASH index indicates a hash index, and a hash index can index multiple first data fragments, and CHECKSUM indicates the corresponding first checksum.

[0084] For example, FILENAME is DNS.txt, which includes multiple data blocks, namely BLOCK0, BLOCK1, etc. The sender fragments the data blocks into a series of 512-byte first data fragments FRAGMENT in sequence. The first data fragments are associated through hash indexes. Assume that BLOCK0 includes multiple first data fragments, which contain 3 index values ​​in the hash index, namely index0, index1 and index2, and each index value corresponds to multiple first data fragments. Taking the index value index0 as an example, it is associated with 3 first data fragments, and the corresponding first fragment numbers are 1, 10, and 2000. Assume that the fragment data used by the first data fragment is FRAG1, and the sender and the receiver have a shared plaintext password PW, which can be 256 bits. Then use the hash algorithm to calculate SHA256(FRAG1) and SHA256(PW), and then perform XOR on SHA256(PW) and SHA256(FRAG1) to obtain a corresponding first checksum with encryption function, Checksum=SHA256(PW) XORSHA256(FRAG1), and then calculate Checksum mod ( ), obtain the corresponding HASH index, store the first shard number and the corresponding first checksum in the first hash list HASH rcv If there is a conflict, the first shard number and the first checksum are stored in the form of a secondary hash or a linked list.

[0085] Step 120: Split the target data into second data segments, and calculate a second checksum of the second data segments.

[0086] In one embodiment, if target data related to initial data is to be transmitted, the target data may be segmented into data blocks in the same segmentation method as the initial data, and each data block may be segmented into second data segments of a preset size in sequence. Then, a second checksum may be calculated in a manner consistent with the calculation method of the first checksum to obtain a second checksum for each second data segment.

[0087] Step 130: Compare the consistency of the second checksum with the first checksum of the first hash list. If a first checksum consistent with the second checksum is found, write the corresponding first shard number, the second shard number of the second data shard, and the first checksum into the same shard list; if the first checksum consistent with the second checksum is not found, generate difference bits and difference data, and write the second shard number, difference bits, and difference data into the difference data list.

[0088] In one embodiment, when the target data is sent for the second time, since the initial data has been sent to the recipient in full, and there is data overlap between the target data and the initial data, it is not necessary to send all the target data at this time, but differential transmission is performed to save transmission bandwidth and improve transmission efficiency. When differential transmission is performed, it is necessary to distinguish which part is differential data, so the embodiment of the present application uses the first checksum and the second checksum to compare and judge.

[0089] Specifically, for each second data fragment, its second checksum is compared with the first hash list HASH rcv Compare each first checksum saved in the same shard list, and check whether the second checksum can be found in the first hash list. If the second checksum can be found in the first hash list, it means that the second checksum is consistent with a first checksum. It can be considered that the second data shard is the same as a first data shard. At this time, the corresponding first shard number, the second shard number of the second data shard, and the first checksum are written into the same shard list. It can be understood that the second shard number stored in the same shard list can find the first shard number of the first data shard that is consistent with it. Among them. The same shard list can be identified as: {second shard number, first checksum, first shard number}.

[0090] If the first checksum consistent with the second checksum is not found in the first hash list, it means that the second data fragment is different from at least one first data fragment stored by the receiver, and the specific difference information needs to be determined. Figure 4 , Figure 4 This is a flowchart of generating difference bits and difference data if a first checksum consistent with a second checksum is not found provided by an embodiment of the present application, specifically including steps 410 to 420:

[0091] Step 410: Starting from the first byte of the second data slice, move backward byte by byte to perform sliding window to obtain data before sliding window and sliding window data slices.

[0092] The data size of the sliding window data slice is the same as the data size of the second data slice. That is, for the current second data slice, it is determined byte by byte whether it is difference data.

[0093] Reference Figure 5 , Figure 5 It is a calculation diagram for generating difference bits and difference data provided by an embodiment of the present application. Assume that the data block contains multiple second data slices, the first byte of the current second data slice (second slice number bit S1) is "0x00", and the second byte is "0x01". When sliding the window for the first time, starting from the first byte, move backward to slide the window, the sliding window length is 512 bytes, the data before the sliding window is the first byte "0x00", and the sliding window data slice includes the remaining 511 bytes of the current second data slice and the first byte of the next second data slice. When sliding the window for the second time, the sliding window moves backward again by one byte, and the data before the sliding window is the first byte "0x00" and the second byte "0x01", which is expressed as "0x0001". The sliding window data slice includes the remaining 510 bytes of the current second data slice and the first two bytes of the next second data slice. By analogy, the sliding window data slice corresponding to each sliding window and the corresponding sliding window data are obtained.

[0094] Step 420: Calculate the third checksum of the sliding window data segment. If the third checksum is consistent with the first checksum, write the corresponding first segment number, second segment number and first checksum into the same segment list, use the corresponding pre-sliding window data as the difference data, and use the sliding window number corresponding to the difference data as the difference bit.

[0095] Among them, Figure 5 For example, the third checksum corresponding to the sliding window data slice obtained by the first sliding window is calculated, and the third checksum is compared with the first checksum in the first hash list to see if they are consistent. If the third checksum is consistent with a certain first checksum, it means that part of the data of the second data slice is consistent with the data in a certain first data slice. At this time, the first slice number D1, the second slice number S1 and the first checksum corresponding to the first checksum are written into the same slice list, and the same slice list records: {second slice number S1, first checksum, first slice number D1}. At the same time, it is also necessary to inform the receiving party that there is a certain amount of difference data in the second slice number S1, and the corresponding pre-sliding window data "0x00" is used as the difference data, and the sliding window number corresponding to the difference data is used as the difference bit. The sliding window number is the first time, so the difference bit is "1", and the second slice number, the difference bit and the difference data are written into the difference data list, and the difference data list is expressed as: {second slice number S1, "1", "0x00"}.

[0096] If the third checksum of the sliding window data segment obtained by the first sliding window does not find the first checksum that is consistent with it, then continue sliding the window to Figure 5For example, the third checksum corresponding to the sliding window data fragment obtained by the second sliding window is calculated, and the third checksum is compared with the first checksum in the first hash list to see if they are consistent. If the third checksum is consistent with a certain first checksum, the first fragment number D1, the second fragment number S1 and the first checksum corresponding to the first checksum are written into the same fragment list, and the same fragment list records: {second fragment number S1, first checksum, first fragment number D1}. At the same time, the corresponding pre-sliding window data "0x0001" is used as the difference data, and the sliding window number corresponding to the difference data is used as the difference bit. The sliding window number is the second time, so the difference bit is "2", and the second fragment number, the difference bit and the difference data are written into the difference data list, and the difference data list is expressed as: {second fragment number S1, "2", "0x0001"}.

[0097] For the second data shard corresponding to the second shard number S1, the part that overlaps with the first data shard is recorded through the same shard list, and the difference part is recorded through the difference data list. During the transmission process, there is no need to transmit the overlapping part of the data. It is only necessary to use the same shard list to inform the receiving party that the overlapping part of the data is in the first data shard, and transmit the different data to the receiving party using the difference data list.

[0098] The above operation is performed on each second data slice.

[0099] Step 140: Send the difference data list and the same shard list to the receiver, so that the receiver reconstructs the data according to the difference data list, the same shard list, the first hash list and the initial data to obtain the target data.

[0100] In one embodiment, the receiver determines the data that does not need to be changed from the same shard list, and then determines the changed data by combining the same shard list and the difference data list, and reconstructs the initial data based on these two parts of data to obtain the target data.

[0101] In one embodiment, the sender needs to encrypt the data when sending the difference data list and the same fragment list to the receiver. Specifically, the fragment data transmission authentication key SAK and the fragment data transmission encryption key SEK are obtained, and then the difference data list is encrypted according to the fragment data transmission encryption key SEK to obtain the first encrypted data, and then the first encrypted data and the same fragment list are signed according to the fragment data transmission authentication key SAK to obtain the target data, and the target data is sent to the receiver.

[0102] In one embodiment, the difference data list is encrypted using the shard data transmission encryption key SEK to obtain the first encrypted data, thereby ensuring that even if the difference data list is intercepted, the unauthorized recipient cannot understand the data content. The encryption process may use a symmetric encryption algorithm. Next, the encrypted first encrypted data and the same shard list are signed using the shard data transmission authentication key SAK using digital signature technology to ensure the integrity of the data and the verifiability of the source, which can effectively prevent the data from being tampered with during transmission. After receiving the data, the recipient first performs signature verification, and then uses the corresponding shard data transmission encryption key SEK to decrypt the first encrypted data, thereby obtaining the difference data list and the same shard list.

[0103] It is understandable that the sender may not encrypt the same shard list, but only encrypt the difference data list, which can save encryption and decryption time and improve transmission efficiency.

[0104] In one embodiment, referring to Figure 6 , Figure 6 6 is a flowchart of obtaining a slice data transmission authentication key and a slice data transmission encryption key provided by an embodiment of the present application, specifically including steps 610 to 630:

[0105] Step 610: Obtain a first random number and a second random number, and obtain a first parameter, a second parameter, and a third parameter, and calculate a first encryption parameter based on the first random number, the second random number, the first parameter, the second parameter, and the third parameter.

[0106] The sender selects two random numbers, which may be 2048-bit random prime numbers, and are represented as a first random number aA and a second random number tA, respectively. At the same time, a first parameter DH_p, a second parameter DH_g, and a third parameter DH_q are obtained, wherein the first parameter DH_p and the second parameter DH_g may be 2048-bit random prime numbers, and the third parameter DH_q may be a 256-bit random prime number.

[0107] In one embodiment, the first parameter DH_p, the second parameter DH_g, and the third parameter DH_q satisfy the following conditions:

[0108] The value after the modulo operation of the first parameter DH_p and the second parameter DH_g is not equal to 1, which is expressed as: (DH_g modDH_p)!=1.

[0109] Furthermore, the value of the modulo operation of the product of the first parameter DH_p and the third parameter DH_q and the second parameter DH_g is equal to one, which is expressed as: .

[0110] Furthermore, the third parameter DH_q is twice the second parameter DH_g plus one, expressed as: .

[0111] Next, the first encryption parameter is calculated based on the first random number, the second random number, the first parameter, the second parameter and the third parameter. The specific process is: use the obfuscation function to perform hash calculation on the plaintext password and the second random number to obtain a first intermediate value, obtain the second intermediate value according to the first random number, the first parameter and the second parameter, obtain the first key according to the first intermediate value, splice the sender identifier, the second random number and the second intermediate value to obtain a first spliced ​​value, encrypt the first spliced ​​value with the first key, and obtain the first encryption parameter.

[0112] For example, the obfuscation function is represented by f(), and the hash algorithm is SHA256. At this time, the obfuscation function is used to perform hash calculation on the plain text password PW and the second random number tA to obtain the first intermediate value PWt1, wherein the first intermediate value PWt1 is the password after obfuscation, which is represented as:

[0113] PWt1 = SHA256(f(PW,tA))

[0114] In one embodiment, the process of using an obfuscation function to perform a hash calculation on the plaintext password and the second random number to obtain the first intermediate value is specifically: performing an XOR operation on the plaintext password and a preset random number to obtain a first operation value, then performing an XOR operation on the first operation value and each 256 bits of the second random number, and obtaining the first intermediate value based on the XOR operation result.

[0115] The preset random number is a fixed 256-bit random number. The obfuscation function performs an XOR operation on the plaintext password PW and the preset random number to obtain a first operation value as a temporary variable, and then loops through each 256 bits of the second random number, performs an XOR operation on it and the first operation value, stores each 256-bit XOR result, summarizes the obfuscated result, and then performs a hash operation on the obfuscated result to obtain the first intermediate value PWt1.

[0116] It is understandable that the obfuscation function is kept confidential between the sender and the receiver and can be updated at any time according to actual needs.

[0117] Next, the second intermediate value bA is obtained according to the first random number aA, the first parameter DH_p, and the second parameter DH_g, which is expressed as:

[0118]

[0119] Then, the first key Key1 is obtained according to the first intermediate value PWt1, specifically, the high 128 bits of the first intermediate value are taken, so the first key Key1 is expressed as:

[0120] Key1 = MSB128 (PWt1)

[0121] Among them, MSB128 means taking the high 128 bits.

[0122] Then, the sender identifier SNA, the second random number tA and the second intermediate value bA are concatenated to obtain a first concatenated value, expressed as: SNA||tA||bA, and then the first concatenated value is encrypted with the first key Key1 to obtain the first encryption parameter Auth A , expressed as:

[0123] Auth A =AESEnc Key1 (SNA||tA||bA)

[0124] Among them, AESEnc Key1 It represents the AES encryption process with Key1 as the key, and “||” represents a series operation.

[0125] Step 620: Obtain an intermediate sending parameter according to the sender identifier, the second random number and the first encryption parameter, and send the intermediate sending parameter to the receiver.

[0126] Among them, the intermediate sending parameter eA is expressed as:

[0127] eA = SNA||tA||Auth A

[0128] Step 630: Obtain the intermediate receiving parameters obtained by the receiver based on the intermediate sending parameters, and calculate the fragmented data transmission authentication key and the fragmented data transmission encryption key according to the intermediate receiving parameters.

[0129] Among them, after the receiver receives the intermediate sending parameter eA, it needs to perform a verification process. After the verification is passed, the intermediate receiving parameter eB is returned to the sender.

[0130] In one embodiment, the process by which the receiver obtains the intermediate receiving parameter based on the intermediate sending parameter is specifically: obtaining the sender identifier and the second random number from the intermediate sending parameter, verifying the sender identifier and the second random number, and after the verification is passed, obtaining the third random number and the fourth random number, calculating the second encryption parameter based on the third random number, the fourth random number, the first parameter and the second parameter, and obtaining the intermediate receiving parameter according to the receiver identifier, the fourth random number and the second encryption parameter.

[0131] Once the receiver receives the intermediate sending parameter eA, it needs to analyze the intermediate sending parameter eA to obtain the sender identifier, the second random number and the first encryption parameter. Since it is uncertain whether there is a transmission error during the transmission process, in order to make an error judgment, the obtained sender identifier and the second random number are verified. Assume that the obtained sender identifier is SNA', the obtained second random number is tA', and the obtained first encryption parameter is Auth A '.

[0132] At this time, the confusion function and the shared plaintext password PW are used to calculate the first candidate intermediate value PWt1' according to the obtained second random number, which is expressed as:

[0133] PWt1' = SHA256(f(PW,tA'))

[0134] And the first candidate key Key1' is calculated according to the first candidate intermediate value, which is expressed as:

[0135] Key1' = MSB128(PWt1')

[0136] At the same time, decode the first encryption parameter Auth A ', expressed as:

[0137] AESDec Key1’ (Auth A )

[0138] Among them, AESDec Key1’ It represents the AES decryption process with Key1' as the key, from which SNA' is obtained.

[0139] Next, the receiver checks whether the obtained SNA' is consistent with the pre-stored sender identification SNA, and whether the obtained tA' is consistent with the pre-stored second random number tA. The checking process is expressed as:

[0140]

[0141]

[0142] Among them, "?=" means "is it equal to". If the left and right sides are equal, it is considered a match. If either of them does not match, the transmission process is stopped and an error message is sent to the sender. If both match, the verification is passed.

[0143] After the verification is passed, a third random number and a fourth random number are obtained, and a second encryption parameter is calculated based on the third random number, the fourth random number, the first parameter and the second parameter to generate a second encryption parameter.

[0144] The receiver selects two random numbers, which may be 2048-bit random prime numbers, and are represented as the third random number aB and the second random number tB, respectively. Next, the plaintext password and the fourth random number are hashed using an obfuscation function to obtain a third intermediate value, a fourth intermediate value is obtained according to the third random number, the first parameter, and the second parameter, a second key is obtained according to the third intermediate value, the receiver identifier, the fourth random number, and the fourth intermediate value are concatenated to obtain a second concatenated value, and the second concatenated value is encrypted with the second key to obtain a second encryption parameter.

[0145] For example, the obfuscation function is used to perform a hash calculation on the plain text password PW and the fourth random number tB to obtain a third intermediate value PWt2, which is expressed as:

[0146] PWt2 = SHA256(f(PW,tB))

[0147] Next, the fourth intermediate value bB is obtained according to the third random number aB, the first parameter DH_p, and the second parameter DH_g, which is expressed as:

[0148] bB = (DH_g aB ) mod DH_p

[0149] The second key Key2 is obtained according to the third intermediate value PWt2, specifically, the high 128 bits of the third intermediate value are taken, so the second key Key2 is expressed as:

[0150] Key2 = MSB128 (PWt2)

[0151] The receiver identifier SNB, the fourth random number tB and the fourth intermediate value bB are concatenated to obtain a second concatenated value, expressed as: SNB||tB||bB, and the second concatenated value is encrypted with the second key Key2 to obtain a second encryption parameter Auth B , expressed as:

[0152] Auth B =AESEnc Key2 (SNB||tB||bB)

[0153] Among them, AESEnc Key2 It represents the AES encryption process with Key2 as the key, and “||” represents a concatenation operation.

[0154] Then according to the receiver identifier SNB, the fourth random number tB and the second encryption parameter Auth B The intermediate receiving parameter eB is obtained, which is expressed as:

[0155] eB = SNB||tB||Auth B

[0156] After obtaining the intermediate receiving parameter eB, the receiver returns it to the sender.

[0157] In one embodiment, referring to Figure 7 , Figure 7 It is a flowchart of calculating a slice data transmission authentication key and a slice data transmission encryption key according to an intermediate reception parameter provided by an embodiment of the present application, specifically including steps 710 to 730:

[0158] Step 710: Obtain a receiver identifier and a fourth random number from the intermediate reception parameters.

[0159] Step 720: Verify the recipient identifier and the fourth random number. After the verification is passed, obtain the fifth intermediate value according to the first random number and the fourth intermediate value, concatenate the recipient identifier, the sender identifier and the fifth intermediate value in sequence to obtain the third concatenation value, and then calculate the target hash value of the third concatenation value.

[0160] In one embodiment, after the sender receives the intermediate receiving parameter eB, considering possible errors in the transmission process, it is also necessary to verify the receiver identifier and the fourth random number contained therein. The verification process is as follows:

[0161] Assume that the obtained receiver identifier is SNB', the obtained fourth random number is tB', and the obtained second encryption parameter is Auth B '.

[0162] At this time, the confusion function and the shared plaintext password PW are used to calculate the second candidate intermediate value PWt2' according to the fourth random number obtained, which is expressed as:

[0163] PWt2' = SHA256(f(PW,tB'))

[0164] And the second candidate key Key2' is calculated according to the second candidate intermediate value, which is expressed as:

[0165] Key2' = MSB128(PWt2')

[0166] At the same time, decode the second encryption parameter Auth B ', expressed as:

[0167] AESDec Key2’ (Auth B )

[0168] Among them, AESDec Key2’ It represents the AES decryption process with KeyB' as the key, from which SNB' is obtained.

[0169] Next, the sender checks whether the obtained SNB' is consistent with the pre-stored sender identifier SNB, and whether the obtained tB' is consistent with the pre-stored fourth random number tB. The checking process is expressed as:

[0170]

[0171]

[0172] Among them, "?=" means "is it equal to". If the left and right sides are equal, they are considered to match. If either of them does not match, the transmission process is stopped and an error message is sent to the receiver. If both match, the verification is passed.

[0173] After verification, the fifth intermediate value K is obtained according to the first random number aA and the fourth intermediate value bB, which is expressed as:

[0174]

[0175] Then, the receiver identifier SNB, the sender identifier SNA and the fifth intermediate value K are sequentially concatenated to obtain the third concatenated value SNB||SNA||K. Assuming that the hash algorithm is SHA512, the target hash value of the third concatenated value is calculated, which is expressed as:

[0176] SHA512(SNB||SNA||K)

[0177] Step 730: Obtain a slice data transmission authentication key based on the value corresponding to the first position digit of the target hash value, and obtain a slice data transmission encryption key based on the value corresponding to the second position digit of the target hash value.

[0178] In one embodiment, the first position digit refers to the upper 256 bits, and the second position digit refers to the lower 256 bits. Therefore, the slice data transmission authentication key SAK is expressed as:

[0179] SAK=MSB256(SHA512(SNB||SNA||K))

[0180] The shard data transmission encryption key SEK is expressed as:

[0181] SEK=LSB256(SHA512(SNB||SNA||K))

[0182] At this point, the slice data transmission authentication key SAK and the slice data transmission encryption key SEK are obtained.

[0183] It can be seen from the above process that based on the shared plaintext password, the embodiment of the present application performs multiple verifications between the receiver and the sender when generating the key, thereby avoiding transmission errors of key-related parameters during the generation and exchange process, and improving the security and reliability of the key.

[0184] The overall principle of the data transmission method of the embodiment of the present application is described below. Figure 8 , Figure 8 It is a schematic diagram of the overall principle of the data transmission method provided in an embodiment of the present application.

[0185] First, the initial data is divided into multiple data blocks, and each data block is divided into multiple first data fragments, which are stored on different file servers. Before sending, the fragment data transmission authentication key and the fragment data transmission encryption key are obtained by using the obfuscation algorithm. After the data is signed and encrypted according to the two keys, the first data fragments are sent in parallel to the receiving server of the receiving party by using the sending server. The receiving server verifies the signature and decrypts the first data fragments according to the obfuscation algorithm, and then combines the first data fragments and stores them on different file servers.

[0186] Then, in the second transmission process, the target data is divided into multiple data blocks according to the same segmentation method, and the second data fragment corresponding to each data block is obtained. At this time, the differential data judgment process is performed according to the first hash list returned by the receiver to obtain the same fragment list and the differential data list. The data is signed and encrypted based on the fragment data transmission authentication key and the fragment data transmission encryption key and sent to the receiver's receiving server. The receiving server reconstructs the data according to the differential data list, the same fragment list, the first hash list and the initial data to obtain the target data. In addition, the receiver can also re-divide the target data into the required file blocks as needed and store them on different file servers.

[0187] The data transmission method of the embodiment of the present application obtains the first hash list generated by the receiver according to the first data slice corresponding to the initial data, divides the target data into the second data slice, and calculates the second checksum of the second data slice, compares the consistency of the second checksum with the first checksum of the first hash list, and if the first checksum consistent with the second checksum is queried, the corresponding first slice number, the second slice number of the second data slice and the first checksum are written into the same slice list; if the first checksum consistent with the second checksum is not queried, the difference bit and the difference data are generated, the second slice number, the difference bit and the difference data are written into the difference data list, and finally the difference data list and the same slice list are sent to the receiver, so that the receiver reconstructs the data according to the difference data list, the same slice list, the first hash list and the initial data to obtain the target data.

[0188] The embodiment of the present application first transmits the initial data in full. When the target data related to the initial data is subsequently transmitted, the checksum of the two files is used for comparison. The difference bits and difference data that need to be differentially transmitted are generated according to the comparison results. During the transmission process, the same shard list and difference-related data are encrypted using the shard data transmission authentication key and the shard data transmission encryption key. By integrating parallel transmission and differential transmission technology, the encrypted data is transmitted to the recipient, and the recipient reconstructs the data to restore the target data. This process only requires plaintext passwords and obfuscation algorithms, and does not require the deployment of professional PKI security certificates to achieve secure and fast transmission. In addition, both parties can transmit files or data point-to-point at any time and anywhere, which is easy to operate and does not require frequent symmetric encryption operations, thereby reducing the transmission burden while improving transmission efficiency, security and reliability.

[0189] The following describes the data transmission method in the embodiment of the present application, taking the receiving party as an example.

[0190] Fig. 9 is an optional flowchart of the data transmission method provided in an embodiment of the present application. Fig. 9 The method in the embodiment may include but is not limited to steps 910 to 940. Fig. 9 The order of step 910 to step 940 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0191] Step 910: Receive multiple first data fragments corresponding to initial data.

[0192] Step 920: Generate a first hash list according to the first data segment, and transmit the first hash list to the sender.

[0193] The first hash list includes a first shard number and a corresponding first checksum of at least one first data shard.

[0194] Step 930: Receive a difference data list and an identical segment list.

[0195] Among them, the difference data list includes the second slice number, difference bits and difference data of the second data slice. The second data slice is obtained according to the target data. The sender compares the consistency of the second checksum of the second data slice with the first checksum. If the first checksum consistent with the second checksum is queried, the corresponding first slice number, the second slice number of the second data slice and the first checksum are written into the same slice list; if the first checksum consistent with the second checksum is not queried, the difference bits and difference data are generated.

[0196] Step 940: Reconstruct data according to the difference data list, the same shard list, the first hash list and the initial data to obtain target data.

[0197] In one embodiment, the receiver determines the data that does not need to be changed from the same shard list, and then determines the changed data by combining the same shard list and the difference data list, and reconstructs the initial data based on these two parts of data to obtain the target data.

[0198] In one embodiment, the difference data list and the same fragment list obtained by the receiver are signed and encrypted, so signature verification and decryption are required. After the receiver verifies the sender's identity and the second random number, it can also obtain the sixth intermediate value K' according to the third random number aB and the second intermediate value bA, which is expressed as:

[0199]

[0200] The fifth intermediate value K calculated by the sender is expressed as:

[0201]

[0202] It can be seen that the sixth intermediate value K′ is the same as the fifth intermediate value K.

[0203] Next, based on the receiver identifier SNB, the sender identifier SNA and the fifth intermediate value K, a target hash value SHA512(SNB||SNA||K2) is obtained.

[0204] Finally, the shard data transmission authentication key SAK required for signature verification is obtained based on the value corresponding to the high 256 bits of the target hash value, and the shard data transmission encryption key SEK is obtained based on the value corresponding to the low 256 bits of the target hash value, expressed as:

[0205] SAK=MSB256(SHA512(SNB||SNA||K))

[0206] SEK=LSB256(SHA512(SNB||SNA||K))

[0207] The receiver uses the sharded data transmission authentication key SAK to verify the signature and uses the sharded data transmission encryption key SEK to decrypt.

[0208] The technical solution provided by the embodiment of the present application obtains a first hash list generated by a receiver according to a first data slice corresponding to initial data, divides the target data into second data slices, and calculates a second checksum of the second data slice, compares the consistency of the second checksum with the first checksum of the first hash list, and if a first checksum consistent with the second checksum is found, writes the corresponding first slice number, the second slice number of the second data slice, and the first checksum into the same slice list; if the first checksum consistent with the second checksum is not found, generates difference bits and difference data, writes the second slice number, the difference bits and the difference data into a difference data list, and finally sends the difference data list and the same slice list to the receiver, so that the receiver reconstructs the data according to the difference data list, the same slice list, the first hash list, and the initial data to obtain the target data. The embodiment of the present application first transmits the initial data in full, and when the target data related to the initial data is subsequently transmitted, the checksum of the two files is used for comparison, and the difference bits and difference data that need to be differentially transmitted are generated according to the comparison results. During the transmission process, the same fragment list and difference-related data are transmitted to the receiver, and the receiver reconstructs the data to obtain the target data. By means of checksum comparison, the accuracy of differential data is improved, and the transmission of differential data can reduce the transmission burden and improve the transmission efficiency.

[0209] The present application also provides a data transmission device that can implement the above data transmission method. Fig.10 , the device comprises:

[0210] The receiving module 1010 is used to obtain a first hash list generated by a receiving party according to a first data slice corresponding to the initial data, wherein the first hash list includes a first slice number and a corresponding first checksum of at least one first data slice.

[0211] The checksum calculation module 1020 is used to divide the target data into second data slices and calculate the second checksum of the second data slices, where the target data is data related to the initial data.

[0212] The checksum comparison module 1030 is used to compare the consistency of the second checksum with the first checksum of the first hash list. If the first checksum consistent with the second checksum is queried, the corresponding first shard number, the second shard number of the second data shard and the first checksum are written into the same shard list; if the first checksum consistent with the second checksum is not queried, the difference bits and difference data are generated, and the second shard number, the difference bits and the difference data are written into the difference data list.

[0213] The sending module 1040 is used to send the difference data list and the same fragment list to the receiving party, so that the receiving party reconstructs the data according to the difference data list, the same fragment list, the first hash list and the initial data to obtain the target data.

[0214] The specific implementation of the data transmission device of this embodiment is basically the same as the specific implementation of the above-mentioned data transmission method, and will not be repeated here.

[0215] The present application also provides an electronic device, including:

[0216] at least one memory;

[0217] at least one processor;

[0218] at least one program;

[0219] The program is stored in the memory, and the processor executes the at least one program to implement the data transmission method implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.

[0220] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0221] The processor 1101 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0222] The memory 1102 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the data transmission method of the embodiments of this application;

[0223] Input / output interface 1103, used to implement information input and output;

[0224] Communication interface 1104, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and

[0225] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);

[0226] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .

[0227] An embodiment of the present application further provides a storage medium, which is a storage medium storing a computer program, and the computer program implements the above-mentioned data transmission method when executed by a processor.

[0228] As a non-transitory storage medium, the memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0229] The data transmission method, apparatus, device and storage medium proposed in the embodiments of the present application obtain a first hash list generated by the receiver according to the first data slice corresponding to the initial data, divide the target data into second data slices, and calculate the second checksum of the second data slice, compare the consistency of the second checksum with the first checksum of the first hash list, if the first checksum consistent with the second checksum is queried, write the corresponding first slice number, the second slice number of the second data slice and the first checksum into the same slice list; if the first checksum consistent with the second checksum is not queried, generate difference bits and difference data, write the second slice number, the difference bits and the difference data into the difference data list, and finally send the difference data list and the same slice list to the receiver, so that the receiver reconstructs the data according to the difference data list, the same slice list, the first hash list and the initial data to obtain the target data. The embodiment of the present application first transmits the initial data in full, and when the target data related to the initial data is subsequently transmitted, the checksum of the two files is used for comparison, and the difference bits and difference data that need to be differentially transmitted are generated according to the comparison results. During the transmission process, the same fragment list and difference-related data are transmitted to the receiver, and the receiver reconstructs the data to obtain the target data. By means of checksum comparison, the accuracy of differential data is improved, and the transmission of differential data can reduce the transmission burden and improve the transmission efficiency.

[0230] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0231] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0232] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0233] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0234] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0235] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0236] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0237] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0238] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0239] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store programs.

[0240] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data transmission method, characterized in that: Applicable to the sender, including: Obtaining a first hash list generated by the receiver according to the first data slices corresponding to the initial data, the first hash list including a first slice number and a corresponding first checksum of at least one of the first data slices, the first data slices being obtained by the sender by segmenting the initial data according to a preset size, the sender sending the first data slices to the receiver, and the receiver calculating a first checksum of each of the first data slices by using a binary complement sum method; Divide the target data into data blocks, divide each of the data blocks into second data slices of the preset size in sequence, and calculate the second checksum of the second data slice according to the calculation method of the first checksum, the target data is data related to the initial data, the first data slice is consistent with the second data slice in size, and the second data slice has a second slice number; Compare the consistency of the second checksum with the first checksum of the first hash list, and if the first checksum consistent with the second checksum is found, write the corresponding first shard number, the second shard number of the second data shard, and the first checksum into the same shard list; if the first checksum consistent with the second checksum is not found, generate difference bits and difference data, and write the second shard number, the difference bits, and the difference data into the difference data list; The difference data list and the same shard list are sent to the receiver, so that the receiver determines the unchanged data from the same shard list, and then determines the changed data by combining the same shard list and the difference data list, and reconstructs the initial data according to the unchanged data and the changed data to obtain the target data; If the first checksum consistent with the second checksum is not found, generating difference bits and difference data includes: Starting from the first byte of the second data slice, moving backward byte by byte to perform sliding window, to obtain data before sliding window and sliding window data slice, the data size of the sliding window data slice is the same as the data size of the second data slice; Calculate the third checksum of the sliding window data segment. If the third checksum is consistent with the first checksum, write the corresponding first segment number, the second segment number and the first checksum into the same segment list, use the corresponding pre-sliding window data as the difference data, and use the sliding window number corresponding to the difference data as the difference bit.

2. The data transmission method according to claim 1, characterized in that: The sending the difference data list and the same fragment list to the receiving party includes: Obtain the shard data transmission authentication key and the shard data transmission encryption key; Encrypting the difference data list according to the fragmented data transmission encryption key to obtain first encrypted data; The first encrypted data and the same shard list are signed according to the shard data transmission authentication key to obtain target data, and the target data is sent to the recipient.

3. The data transmission method according to claim 2, characterized in that: The obtaining of the slice data transmission authentication key and the slice data transmission encryption key comprises: Obtain a first random number and a second random number, and obtain a first parameter, a second parameter, and a third parameter, and calculate a first encryption parameter based on the first random number, the second random number, the first parameter, the second parameter, and the third parameter; Obtain an intermediate sending parameter according to the sender identifier, the second random number and the first encryption parameter, and send the intermediate sending parameter to the receiver; Acquire an intermediate receiving parameter obtained by the receiver based on the intermediate sending parameter, and calculate the sliced ​​data transmission authentication key and the sliced ​​data transmission encryption key according to the intermediate receiving parameter.

4. The data transmission method according to claim 3, characterized in that: The calculating the first encryption parameter based on the first random number, the second random number, the first parameter, the second parameter and the third parameter includes: Performing a hash calculation on the plain text password and the second random number using an obfuscation function to obtain a first intermediate value; Obtain a second intermediate value according to the first random number, the first parameter, and the second parameter; A first key is obtained according to the first intermediate value, a sender identifier, a second random number and the second intermediate value are concatenated to obtain a first concatenated value, and the first concatenated value is encrypting with the first key to obtain the first encryption parameter.

5. The data transmission method according to claim 4, characterized in that: The process of the receiver obtaining the intermediate receiving parameter based on the intermediate sending parameter includes: Acquire the sender identifier and the second random number from the intermediate sending parameter; Verify the sender identifier and the second random number, and after the verification is passed, obtain a third random number and a fourth random number, and calculate a second encryption parameter based on the third random number, the fourth random number, the first parameter, and the second parameter; The intermediate receiving parameter is obtained according to the receiver identifier, the fourth random number and the second encryption parameter.

6. The data transmission method according to claim 5, characterized in that: Calculating a second encryption parameter based on the third random number, the fourth random number, the first parameter, and the second parameter includes: Performing a hash calculation on the plain text password and the fourth random number using an obfuscation function to obtain a third intermediate value; Obtain a fourth intermediate value according to the third random number, the first parameter, and the second parameter; A second key is obtained according to the third intermediate value, the recipient identifier, the fourth random number and the fourth intermediate value are concatenated to obtain a second concatenated value, and the second concatenated value is encrypting with the second key to obtain the second encryption parameter.

7. The data transmission method according to claim 6, characterized in that: The calculating the sliced ​​data transmission authentication key and the sliced ​​data transmission encryption key according to the intermediate reception parameter comprises: Obtaining the recipient identifier and the fourth random number from the intermediate receiving parameter; Verify the receiver identifier and the fourth random number. After the verification is passed, obtain a fifth intermediate value according to the first random number and the fourth intermediate value, sequentially concatenate the receiver identifier, the sender identifier and the fifth intermediate value to obtain a third concatenated value, and calculate a target hash value of the third concatenated value; The sliced ​​data transmission authentication key is obtained based on the value corresponding to the first position digit of the target hash value, and the sliced ​​data transmission encryption key is obtained based on the value corresponding to the second position digit of the target hash value.

8. The data transmission method according to claim 3, characterized in that: The first parameter, the second parameter and the third parameter satisfy the following conditions: The values ​​after the modulo operation of the first parameter and the second parameter are not equal to one, and the value after the modulo operation of the product of the first parameter and the third parameter and the second parameter is equal to one, and the first parameter is twice the second parameter plus one.

9. The data transmission method according to claim 4, characterized in that: The method of performing a hash calculation on the plain text password and the second random number using an obfuscation function to obtain a first intermediate value includes: Performing an XOR operation on the plain text password and a preset random number to obtain a first operation value; An XOR operation is performed on the first operation value and each 256 bits of the second random number, and the first intermediate value is obtained according to the XOR operation result.

10. A data transmission method, characterized in that: Applied to the receiving side, including: A plurality of first data fragments are obtained by receiving the initial data divided by the sender according to a preset size; Calculate a first checksum of each of the first data slices by using a two's complement sum method, generate a first hash list according to the first checksum, and transmit the first hash list to a sender, wherein the first hash list includes a first slice number of at least one of the first data slices and a corresponding first checksum; Receive a difference data list and an identical slice list, the difference data list including a second slice number, a difference bit, and difference data of a second data slice, the second data slice being obtained by the sender dividing the target data into data blocks and dividing each of the data blocks into a preset size in sequence, the sender comparing the second checksum of the second data slice with the first checksum for consistency, and if the first checksum consistent with the second checksum is found, write the corresponding first slice number, the second slice number of the second data slice, and the first checksum into the identical slice list; if the first checksum consistent with the second checksum is not found, generate the difference bit and the difference data; the calculation method of the first checksum is consistent with that of the second checksum, the first data slice is consistent with that of the second data slice, and the second data slice has a second slice number; Determine the unchanged data from the same shard list, determine the changed data by combining the same shard list and the difference data list, and reconstruct the initial data according to the unchanged data and the changed data to obtain the target data; If the first checksum consistent with the second checksum is not found, generating difference bits and difference data includes: Starting from the first byte of the second data slice, moving backward byte by byte to perform sliding window, to obtain data before sliding window and sliding window data slice, the data size of the sliding window data slice is the same as the data size of the second data slice; Calculate the third checksum of the sliding window data segment. If the third checksum is consistent with the first checksum, write the corresponding first segment number, the second segment number and the first checksum into the same segment list, use the corresponding pre-sliding window data as the difference data, and use the sliding window number corresponding to the difference data as the difference bit.

11. A data transmission device, characterized in that: Applicable to the sender, including: A receiving module, configured to obtain a first hash list generated by a receiving party according to first data slices corresponding to the initial data, wherein the first hash list includes a first slice number and a corresponding first checksum of at least one of the first data slices, wherein the first data slices are obtained by the sending party by segmenting the initial data according to a preset size, and the sending party sends the first data slices to the receiving party, and the receiving party calculates a first checksum of each of the first data slices by using a binary complement sum method; a checksum calculation module, configured to divide the target data into data blocks, divide each of the data blocks into second data slices of the preset size in sequence, and calculate a second checksum of the second data slice according to the calculation method of the first checksum, wherein the target data is data related to the initial data, the first data slice is consistent with the second data slice in size, and the second data slice has a second slice number; a checksum comparison module, configured to compare the consistency of the second checksum with the first checksum of the first hash list, and if the first checksum consistent with the second checksum is found, write the corresponding first shard number, the second shard number of the second data shard, and the first checksum into the same shard list; if the first checksum consistent with the second checksum is not found, generate a difference bit and difference data, and write the second shard number, the difference bit, and the difference data into a difference data list; a sending module, configured to send the difference data list and the same shard list to the receiving party, so that the receiving party determines the unchanged data from the same shard list, and then determines the changed data by combining the same shard list and the difference data list, and reconstructs the initial data according to the unchanged data and the changed data to obtain the target data; If the first checksum consistent with the second checksum is not found, generating difference bits and difference data includes: Starting from the first byte of the second data slice, moving backward byte by byte to perform sliding window, to obtain data before sliding window and sliding window data slice, the data size of the sliding window data slice is the same as the data size of the second data slice; Calculate the third checksum of the sliding window data segment. If the third checksum is consistent with the first checksum, write the corresponding first segment number, the second segment number and the first checksum into the same segment list, use the corresponding pre-sliding window data as the difference data, and use the sliding window number corresponding to the difference data as the difference bit.

12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the data transmission method according to any one of claims 1 to 10 when executing the computer program.

13. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 10 is implemented.