CN117411891A - A data transmission method, data transmission device and data transmission system - Google Patents
A data transmission method, data transmission device and data transmission system Download PDFInfo
- Publication number
- CN117411891A CN117411891A CN202210796060.3A CN202210796060A CN117411891A CN 117411891 A CN117411891 A CN 117411891A CN 202210796060 A CN202210796060 A CN 202210796060A CN 117411891 A CN117411891 A CN 117411891A
- Authority
- CN
- China
- Prior art keywords
- data
- processor
- sub
- data transmission
- receiving end
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
- H04L67/1078—Resource delivery mechanisms
- H04L67/108—Resource delivery mechanisms characterised by resources being split in blocks or fragments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/38—Flow control; Congestion control by adapting coding or compression rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域Technical field
本发明涉及数据传输技术领域,尤其涉及一种数据传输方法、数据传输装置和数据传输系统。The present invention relates to the technical field of data transmission, and in particular, to a data transmission method, a data transmission device and a data transmission system.
背景技术Background technique
随着计算机技术的发展,计算机需要处理的数据越来越大。在数据传输过程中,如果计算机传输的数据比较大,数据传输的时间则越长。因此,如何提高计算机的数据传输速度是目前亟需解决的问题。With the development of computer technology, the data that computers need to process is getting larger and larger. During the data transmission process, if the data transmitted by the computer is relatively large, the data transmission time will be longer. Therefore, how to improve the data transmission speed of computers is an urgent problem that needs to be solved.
发明内容Contents of the invention
为了解决上述的问题,本申请的实施例中提供了一种数据传输方法,发送端将目标文件的数据分割成多个数据段。发送端与接收端之间建立多个数据传输链路。发送端与接收端之间进行数据传输时,发送端利用流式压缩技术,每个数据传输链路一边读取数据段,一边对读取的数据实时压缩,得到压缩数据流。发送端实时地发送压缩数据流。接收端利用流式解压技术,一边接收压缩数据流,一边对压缩数据流解压,得到原始数据。接收端根据每个数据传输链路传输的数据段在存储器中的存储位置,实时地将各个数据传输链路中的原始数据写入存储器中。本申请将目标文件的数据分段,各个数据段并行传输,可以提高数据传输效率。另外,各个数据传输链路通过对读取的数据实时压缩并进行传输,不仅降低了数据传输总量,而且不需要额外的存储器存储压缩包,降低了硬件成本。In order to solve the above problems, embodiments of the present application provide a data transmission method. The sending end divides the data of the target file into multiple data segments. Multiple data transmission links are established between the sender and the receiver. When data is transmitted between the sender and the receiver, the sender uses streaming compression technology. Each data transmission link reads the data segment while compressing the read data in real time to obtain a compressed data stream. The sender sends the compressed data stream in real time. The receiving end uses streaming decompression technology to receive the compressed data stream and decompress the compressed data stream to obtain the original data. The receiving end writes the original data in each data transmission link into the memory in real time according to the storage location of the data segment transmitted by each data transmission link in the memory. This application segments the data of the target file and transmits each data segment in parallel, which can improve data transmission efficiency. In addition, each data transmission link compresses and transmits the read data in real time, which not only reduces the total amount of data transmission, but also does not require additional memory to store compressed packages, reducing hardware costs.
为此,本申请的实施例中采用如下技术方案:To this end, the following technical solutions are adopted in the embodiments of this application:
第一方面,本申请提供了一种数据传输方法,方法由发送端执行,包括:接收接收端发送的数据传输请求指令,数据传输请求指令携带有目标文件的标识;根据目标文件的标识,确定目标文件,并将目标文件的数据分割成N个数据段数据段,N为大于1的正整数;向接收端发送分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量,目标文件的数据长度指示接收端确定目标文件的目标存储空间,数据段的数量指示接收端建立N个数据传输链路,各个数据段的数据长度和各个数据段的偏移量指示接收端确定数据段在目标存储空间中的存储位置;接收N个数据传输链路发送的数据段存储请求指令;利用流式压缩算法,读取各个数据段并压缩读取出的数据,得到压缩数据流;通过N个数据传输链路向接收端发送压缩数据流。In the first aspect, this application provides a data transmission method. The method is executed by the sending end, including: receiving a data transmission request instruction sent by the receiving end. The data transmission request instruction carries the identification of the target file; and determining based on the identification of the target file. target file, and divide the data of the target file into N data segments, where N is a positive integer greater than 1; send segmentation information to the receiving end. The segmentation information includes the data length of the target file, the number of data segments, and each The data length of the data segment and the offset of each data segment. The data length of the target file instructs the receiving end to determine the target storage space of the target file. The number of data segments instructs the receiving end to establish N data transmission links. The data of each data segment The length and offset of each data segment instruct the receiving end to determine the storage location of the data segment in the target storage space; receive data segment storage request instructions sent by N data transmission links; use the streaming compression algorithm to read each data segment And compress the read data to obtain a compressed data stream; send the compressed data stream to the receiving end through N data transmission links.
在一种实施方式中,在接收N个数据传输链路发送的数据段存储请求指令之前,还包括:发送端根据数据段的数量,配置N个子处理器,发送端包括处理器,处理器配置N个子处理器,子处理器用于读取数据段的数据,并压缩读取出的数据。In one implementation, before receiving the data segment storage request instructions sent by N data transmission links, it also includes: the sending end configures N sub-processors according to the number of data segments, the sending end includes a processor, and the processor configures N sub-processors, the sub-processors are used to read the data of the data segment and compress the read data.
在一种实施方式中,将目标文件分割成N个数据段,具体包括:确定目标文件的数据长度,将目标文件的数据均分成N个数据段。In one implementation, dividing the target file into N data segments specifically includes: determining the data length of the target file, and dividing the data of the target file into N data segments.
在一种实施方式中,将目标文件分割成N个数据段,具体包括:根据发送端与接收端之间的通信带宽,确定发送端与接收端之间的通信通道的数量;根据通信通道的数量,确定目标文件的数据分割成数据段的数量。In one implementation, dividing the target file into N data segments specifically includes: determining the number of communication channels between the sending end and the receiving end according to the communication bandwidth between the sending end and the receiving end; Quantity, determines the number of data segments that the target file's data is divided into.
在一种实施方式中,利用流式压缩算法,读取各个数据段并压缩读取出的数据,得到压缩数据流,具体包括:第一子处理器接收到第一数据段存储请求指令后,读取出第一数据段的数据,N个子处理器包括第一子处理器,N个数据段包括第一数据段,N个数据传输链路包括第一数据传输链路,第一数据段存储请求指令为第一数据传输链路传输的数据段存储请求指令;当第一子处理器读取出第一数据段的设定长度的数据后,将设定长度的数据进行压缩,得到第一压缩数据流,设定长度小于第一数据段的长度。In one implementation, a streaming compression algorithm is used to read each data segment and compress the read data to obtain a compressed data stream, which specifically includes: after the first sub-processor receives the first data segment storage request instruction, Read the data of the first data segment, the N sub-processors include the first sub-processor, the N data segments include the first data segment, the N data transmission links include the first data transmission link, and the first data segment stores The request instruction is a storage request instruction for the data segment transmitted by the first data transmission link; when the first sub-processor reads out the data of the set length of the first data segment, it compresses the data of the set length to obtain the first To compress the data stream, the set length is smaller than the length of the first data segment.
在一种实施方式中,还包括:检测发送端与接收端之间的通信带宽;当通信带宽小于第一设定阈值时,减少发送端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one implementation, it also includes: detecting the communication bandwidth between the sending end and the receiving end; when the communication bandwidth is less than a first set threshold, reducing the number of sub-processors on the sending end, and the first set threshold is to allocate N The communication bandwidth of a communication channel.
在一种实施方式中,还包括:向接收端发送第一反馈指令,第一反馈指令指示接收端减少建立数据传输链路的数量。In one implementation, the method further includes: sending a first feedback instruction to the receiving end, where the first feedback instruction instructs the receiving end to reduce the number of established data transmission links.
在一种实施方式中,还包括:检测发送端中的处理器的算力;当处理器的算力大于第二设定阈值时,减少发送端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one implementation, the method further includes: detecting the computing power of the processor in the sending end; when the computing power of the processor is greater than a second set threshold, reducing the number of sub-processors at the sending end, and the second set threshold is The computing power of the processor cannot be configured with the minimum computing power of N sub-processors.
在一种实施方式中,还包括:向接收端发送第二反馈指令,第二反馈指令指示接收端减少配置子处理器的数量。In one implementation, the method further includes: sending a second feedback instruction to the receiving end, where the second feedback instruction instructs the receiving end to reduce the number of configured sub-processors.
第二方面,本申请提供了一种数据传输方法,方法由接收端执行,包括:向发送端发送数据传输请求指令,数据传输请求指令指示发送端将目标文件的数据分割成N个数据段,N为大于1的正整数;接收发送端发送的分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量;根据数据段的数量,建立N个数据传输链路;通过N个数据传输链路向发送端发送数据段存储请求指令,数据段存储请求指令指示发送端读取并发送N个数据段;接收发送端通过N个数据传输链路发送的压缩数据流;利用流式解压算法,对压缩数据流进行解压,并将每个数据传输链路传输的数据存储在目标存储空间中的设定存储位置中。In the second aspect, this application provides a data transmission method. The method is executed by the receiving end and includes: sending a data transmission request instruction to the sending end. The data transmission request instruction instructs the sending end to divide the data of the target file into N data segments. N is a positive integer greater than 1; receive the segmentation information sent by the sending end. The segmentation information includes the data length of the target file, the number of data segments, the data length of each data segment and the offset of each data segment; according to the data segment number, establish N data transmission links; send a data segment storage request instruction to the sending end through N data transmission links, and the data segment storage request instruction instructs the sending end to read and send N data segments; the receiving sending end passes N The compressed data stream sent by each data transmission link; the stream decompression algorithm is used to decompress the compressed data stream, and the data transmitted by each data transmission link is stored in the set storage location in the target storage space.
在一种实施方式中,根据数据段的数量,建立N个数据传输链路,具体包括:接收端根据数据段的数量,配置N个子处理器,接收端包括处理器,处理器配置N个子处理器,子处理器用于对压缩数据流进行解压,并将解压后的数据写入目标存储空间中的设定存储位置中。In one implementation, N data transmission links are established according to the number of data segments, which specifically includes: the receiving end configures N sub-processors according to the number of data segments, the receiving end includes a processor, and the processor configures N sub-processors The sub-processor is used to decompress the compressed data stream and write the decompressed data to the set storage location in the target storage space.
在一种实施方式中,利用流式解压算法,对压缩数据流进行解压,并将每个数据传输链路传输的数据存储在设定的存储位置中,具体包括:根据目标文件的数据长度,在存储器中确定存储目标文件的目标存储空间;根据各个数据段的数据长度和各个数据段的偏移量,确定各个数据段在目标存储空间中的存储位置;当第二子处理器通过第二数据传输链路接收到第二数据段的第二压缩数据流后,对第二压缩数据流进行解压,得到原始数据;N个子处理器包括第二子处理器,N个数据传输链路包括第二数据传输链路,N个数据段包括第二数据段,第二压缩数据流为发送端对读取设定长度的第二数据段进行压缩得到的压缩数据流,原始数据为发送端读取设定长度的第二数据段,原始数据的长度小于第二数据段的长度;第二子处理器将原始数据写入第二数据段的存储空间中,目标存储空间包括第二数据段的存储空间。In one implementation, a streaming decompression algorithm is used to decompress the compressed data stream, and the data transmitted by each data transmission link is stored in a set storage location, specifically including: according to the data length of the target file, Determine the target storage space for storing the target file in the memory; determine the storage location of each data segment in the target storage space according to the data length of each data segment and the offset of each data segment; when the second sub-processor passes the second After receiving the second compressed data stream of the second data segment, the data transmission link decompresses the second compressed data stream to obtain the original data; the N sub-processors include the second sub-processor, and the N data transmission links include the Two data transmission links, N data segments include the second data segment, the second compressed data stream is the compressed data stream obtained by the sending end compressing the second data segment of the set length read, and the original data is read by the sending end Set the length of the second data segment, the length of the original data is less than the length of the second data segment; the second sub-processor writes the original data into the storage space of the second data segment, and the target storage space includes the storage of the second data segment space.
在一种实施方式中,还包括:检测接收端与发送端之间的通信带宽;当通信带宽小于第一设定阈值时,减少接收端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one implementation, it also includes: detecting the communication bandwidth between the receiving end and the sending end; when the communication bandwidth is less than a first set threshold, reducing the number of sub-processors on the receiving end, and the first set threshold is to allocate N The communication bandwidth of a communication channel.
在一种实施方式中,还包括:向发送端发送第一反馈指令,第一反馈指令指示发送端减少配置子处理器的数量。In one implementation, the method further includes: sending a first feedback instruction to the sending end, where the first feedback instruction instructs the sending end to reduce the number of configured sub-processors.
在一种实施方式中,还包括:检测接收端中的处理器的算力;当处理器的算力大于第二设定阈值时,减少接收端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one embodiment, the method further includes: detecting the computing power of the processor in the receiving end; when the computing power of the processor is greater than a second set threshold, reducing the number of sub-processors at the receiving end, and the second set threshold is The computing power of the processor cannot be configured with the minimum computing power of N sub-processors.
在一种实施方式中,还包括:向发送端发送第二反馈指令,第二反馈指令指示发送端减少配置子处理器的数量。In one implementation, the method further includes: sending a second feedback instruction to the sending end, where the second feedback instruction instructs the sending end to reduce the number of configured sub-processors.
第三方面,本申请提供了一种数据传输装置,包括:收发器,用于接收接收端发送的数据传输请求指令,数据传输请求指令携带有目标文件的标识;处理器,用于根据目标文件的标识,确定目标文件,并将目标文件的数据分割成N个数据段数据段,N为大于1的正整数;收发器,还用于向接收端发送分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量,目标文件的数据长度指示接收端确定目标文件的目标存储空间,数据段的数量指示接收端建立N个数据传输链路,各个数据段的数据长度和各个数据段的偏移量指示接收端确定数据段在目标存储空间中的存储位置;接收N个数据传输链路发送的数据段存储请求指令;处理器,还用于利用流式压缩算法,读取各个数据段并压缩读取出的数据,得到压缩数据流;收发器,还用于通过N个数据传输链路向接收端发送压缩数据流。In a third aspect, the present application provides a data transmission device, including: a transceiver, configured to receive a data transmission request instruction sent by the receiving end, where the data transmission request instruction carries an identification of the target file; a processor, configured to perform the data transmission according to the target file identification, determine the target file, and divide the data of the target file into N data segments, where N is a positive integer greater than 1; the transceiver is also used to send segmented information to the receiving end, and the segmented information includes the target file. The data length, the number of data segments, the data length of each data segment and the offset of each data segment. The data length of the target file instructs the receiving end to determine the target storage space of the target file. The number of data segments instructs the receiving end to establish N Data transmission link, the data length of each data segment and the offset of each data segment instruct the receiving end to determine the storage location of the data segment in the target storage space; receive data segment storage request instructions sent by N data transmission links; process The transceiver is also used to use the streaming compression algorithm to read each data segment and compress the read data to obtain a compressed data stream; the transceiver is also used to send the compressed data stream to the receiving end through N data transmission links.
在一种实施方式中,处理器,还用于根据数据段的数量,配置N个子处理器,子处理器用于读取数据段的数据,并压缩读取出的数据。In one implementation, the processor is further configured to configure N sub-processors according to the number of data segments, and the sub-processors are configured to read the data of the data segments and compress the read data.
在一种实施方式中,处理器,具体用于确定目标文件的数据长度,将目标文件的数据均分成N个数据段。In one implementation, the processor is specifically configured to determine the data length of the target file, and divide the data of the target file into N data segments.
在一种实施方式中,处理器,具体用于根据发送端与接收端之间的通信带宽,确定发送端与接收端之间的通信通道的数量;以及根据通信通道的数量,确定目标文件的数据分割成数据段的数量。In one implementation, the processor is specifically configured to determine the number of communication channels between the sending end and the receiving end according to the communication bandwidth between the sending end and the receiving end; and determine the number of the target file according to the number of communication channels. The number of data segments the data is divided into.
在一种实施方式中,处理器,具体用于第一子处理器接收到第一数据段存储请求指令后,读取出第一数据段的数据,N个子处理器包括第一子处理器,N个数据段包括第一数据段,N个数据传输链路包括第一数据传输链路,第一数据段存储请求指令为第一数据传输链路传输的数据段存储请求指令;以及当第一子处理器读取出第一数据段的设定长度的数据后,将设定长度的数据进行压缩,得到第一压缩数据流,设定长度小于第一数据段的长度。In one implementation, the processor is specifically configured to read the data of the first data segment after the first sub-processor receives the first data segment storage request instruction. The N sub-processors include the first sub-processor, The N data segments include the first data segment, the N data transmission links include the first data transmission link, the first data segment storage request instruction is a data segment storage request instruction transmitted by the first data transmission link; and when the first After reading the data of the set length of the first data segment, the sub-processor compresses the data of the set length to obtain a first compressed data stream, and the set length is smaller than the length of the first data segment.
在一种实施方式中,处理器,还用于检测发送端与接收端之间的通信带宽;以及当通信带宽小于第一设定阈值时,减少发送端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one embodiment, the processor is also configured to detect the communication bandwidth between the sending end and the receiving end; and when the communication bandwidth is less than a first set threshold, reduce the number of sub-processors on the sending end, the first setting The threshold is the communication bandwidth allocated to N communication channels.
在一种实施方式中,收发器,还用于向接收端发送第一反馈指令,第一反馈指令指示接收端减少建立数据传输链路的数量。In one implementation, the transceiver is further configured to send a first feedback instruction to the receiving end, where the first feedback instruction instructs the receiving end to reduce the number of data transmission links established.
在一种实施方式中,处理器,还用于检测发送端中的处理器的算力;以及当处理器的算力大于第二设定阈值时,减少发送端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one embodiment, the processor is also configured to detect the computing power of the processor in the sending end; and when the computing power of the processor is greater than the second set threshold, reduce the number of sub-processors in the sending end, and the second Set the threshold to the minimum computing power of N sub-processors that cannot be configured by the processor's computing power.
在一种实施方式中,收发器,还用于向接收端发送第二反馈指令,第二反馈指令指示接收端减少配置子处理器的数量。In one implementation, the transceiver is further configured to send a second feedback instruction to the receiving end, and the second feedback instruction instructs the receiving end to reduce the number of configured sub-processors.
第四方面,本申请提供了一种数据传输装置,包括:收发器,用于向发送端发送数据传输请求指令,数据传输请求指令指示发送端将目标文件的数据分割成N个数据段,N为大于1的正整数;接收发送端发送的分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量;处理器,用于根据数据段的数量,建立N个数据传输链路;收发器,还用于通过N个数据传输链路向发送端发送数据段存储请求指令,数据段存储请求指令指示发送端读取并发送N个数据段;接收发送端通过N个数据传输链路发送的压缩数据流;处理器,还用于利用流式解压算法,对压缩数据流进行解压,并将每个数据传输链路传输的数据存储在目标存储空间中的设定存储位置中。In the fourth aspect, the present application provides a data transmission device, including: a transceiver for sending a data transmission request instruction to the sending end. The data transmission request instruction instructs the sending end to divide the data of the target file into N data segments, N is a positive integer greater than 1; receives the segmentation information sent by the sending end. The segmentation information includes the data length of the target file, the number of data segments, the data length of each data segment and the offset of each data segment; the processor uses It is used to establish N data transmission links according to the number of data segments; the transceiver is also used to send data segment storage request instructions to the sending end through N data transmission links, and the data segment storage request instructions instruct the sending end to read and send N data segments; receive the compressed data stream sent by the sending end through N data transmission links; the processor is also used to use the streaming decompression algorithm to decompress the compressed data stream and transfer the data transmitted by each data transmission link. The data is stored in the set storage location in the target storage space.
在一种实施方式中,处理器,还用于根据数据段的数量,配置N个子处理器,子处理器用于对压缩数据流进行解压,并将解压后的数据写入目标存储空间中的设定存储位置中。In one implementation, the processor is further configured to configure N sub-processors according to the number of data segments. The sub-processors are used to decompress the compressed data stream and write the decompressed data into the device in the target storage space. in the specified storage location.
在一种实施方式中,处理器,具体用于根据目标文件的数据长度,在存储器中确定存储目标文件的目标存储空间;根据各个数据段的数据长度和各个数据段的偏移量,确定各个数据段在目标存储空间中的存储位置;当第二子处理器通过第二数据传输链路接收到第二数据段的第二压缩数据流后,对第二压缩数据流进行解压,得到原始数据;N个子处理器包括第二子处理器,N个数据传输链路包括第二数据传输链路,N个数据段包括第二数据段,第二压缩数据流为发送端对读取设定长度的第二数据段进行压缩得到的压缩数据流,原始数据为发送端读取设定长度的第二数据段,原始数据的长度小于第二数据段的长度;第二子处理器将原始数据写入第二数据段的存储空间中,目标存储空间包括第二数据段的存储空间。In one implementation, the processor is specifically configured to determine a target storage space for storing the target file in the memory according to the data length of the target file; and determine each data segment based on the data length of each data segment and the offset of each data segment. The storage location of the data segment in the target storage space; when the second sub-processor receives the second compressed data stream of the second data segment through the second data transmission link, it decompresses the second compressed data stream to obtain the original data ; N sub-processors include second sub-processors, N data transmission links include second data transmission links, N data segments include second data segments, and the second compressed data stream sets a length for the sending end to read The compressed data stream obtained by compressing the second data segment. The original data is the second data segment with a set length read by the sending end. The length of the original data is smaller than the length of the second data segment; the second sub-processor writes the original data. into the storage space of the second data segment, and the target storage space includes the storage space of the second data segment.
在一种实施方式中,处理器,还用于检测接收端与发送端之间的通信带宽;以及当通信带宽小于第一设定阈值时,减少接收端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one embodiment, the processor is also configured to detect the communication bandwidth between the receiving end and the sending end; and when the communication bandwidth is less than a first set threshold, reduce the number of sub-processors on the receiving end, the first setting The threshold is the communication bandwidth allocated to N communication channels.
在一种实施方式中,收发器,还用于向发送端发送第一反馈指令,第一反馈指令指示发送端减少配置子处理器的数量。In one implementation, the transceiver is further configured to send a first feedback instruction to the sending end, where the first feedback instruction instructs the sending end to reduce the number of configured sub-processors.
在一种实施方式中,处理器,还用于检测接收端中的处理器的算力;以及当处理器的算力大于第二设定阈值时,减少接收端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one embodiment, the processor is also configured to detect the computing power of the processor in the receiving end; and when the computing power of the processor is greater than the second set threshold, reduce the number of sub-processors at the receiving end, and the second Set the threshold to the minimum computing power of N sub-processors that cannot be configured by the processor's computing power.
在一种实施方式中,收发器,还用于向发送端发送第二反馈指令,第二反馈指令指示发送端减少配置子处理器的数量。In one implementation, the transceiver is further configured to send a second feedback instruction to the sending end, and the second feedback instruction instructs the sending end to reduce the number of configured sub-processors.
第五方面,本申请提供了一种数据传输系统,包括:至少一个如第一方面各个可能实现的发送端和至少一个如第一方面各个可能实现的接收端;其中,至少一个发送端与至少一个接收端之间建立通信连接。In a fifth aspect, this application provides a data transmission system, including: at least one sending end that may be implemented as in the first aspect and at least one receiving end that may be implemented in the first aspect; wherein, at least one sending end and at least A communication connection is established between receivers.
第六方面,本申请提供了一种计算机可读存储介质,其上存储有计算机程序,当计算机程序在计算机中执行时,令计算机执行如第一方面和第二方面各个可能实现的方法。In a sixth aspect, the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to perform the methods that may be implemented in each of the first and second aspects.
第七方面,本申请提供了一种计算机程序产品,其特征在于,计算机程序产品存储有指令,指令在由计算机执行时,使得计算机实施如第一方面和第二方面各个可能实现的方法。In a seventh aspect, the present application provides a computer program product, which is characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the instructions enable the computer to implement the methods that may be implemented in each of the first and second aspects.
附图说明Description of the drawings
下面对实施例或现有技术描述中所需使用的附图作简单地介绍。The drawings needed to be used in the description of the embodiments or the prior art are briefly introduced below.
图1为本申请实施例中提供的一种数据传输系统的架构示意图;Figure 1 is a schematic architectural diagram of a data transmission system provided in an embodiment of the present application;
图2为本申请实施例中提供的数据传输系统进行数据传输的硬件架构示意图;Figure 2 is a schematic diagram of the hardware architecture of the data transmission system provided in the embodiment of the present application for data transmission;
图3为本申请实施例中提供的发送端与接收端之间进行数据传输的流程示意图Figure 3 is a schematic flow chart of data transmission between the sending end and the receiving end provided in the embodiment of the present application.
图4为本申请实施例中提供的一种数据传输装置的架构示意图;Figure 4 is an architectural schematic diagram of a data transmission device provided in an embodiment of the present application;
图5为本申请实施例中提供的一种数据传输装置的架构示意图。FIG. 5 is an architectural schematic diagram of a data transmission device provided in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
本文中术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本文中符号“/”表示关联对象是或者的关系,例如A/B表示A或者B。The term "and/or" in this article is an association relationship that describes related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. these three situations. The symbol "/" in this article indicates that the associated object is or, for example, A/B means A or B.
本文中的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一响应消息和第二响应消息等是用于区别不同的响应消息,而不是用于描述响应消息的特定顺序。The terms "first", "second", etc. in the description and claims herein are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first response message and the second response message are used to distinguish different response messages, but are not used to describe a specific sequence of response messages.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或者两个以上,例如,多个处理单元是指两个或者两个以上的处理单元等;多个元件是指两个或者两个以上的元件等。In the description of the embodiments of this application, unless otherwise stated, the meaning of “multiple” refers to two or more, for example, multiple processing units refers to two or more processing units, etc.; multiple Component refers to two or more components, etc.
为了提高计算机的数据传输效率,现有技术中提出了一种解决方案,为:计算机可以将待传输的数据分割成多个数据包。计算机调取多个通信通道,分别传输不同的数据包。在数据传输过程中,计算机虽然缩短了数据传输的时间,但是传输的数据的总量是不变的,只是调取了更多的通信通道,并没有提高计算机的数据传输效率。In order to improve the data transmission efficiency of the computer, a solution has been proposed in the prior art: the computer can divide the data to be transmitted into multiple data packets. The computer calls up multiple communication channels and transmits different data packets respectively. During the data transmission process, although the computer shortens the data transmission time, the total amount of data transmitted remains unchanged. It only uses more communication channels and does not improve the computer's data transmission efficiency.
现有技术中提出了第二种解决方案,为:计算机可以将带传输的数据分别成多个数据包。计算机将多个数据包分别进行压缩,得到多个压缩包。计算机调取多个通信通道,分别传输不同的数据包。现有的计算机将分割的多个数据包压缩成多个压缩包后,通过多个通信通道同时进行传输压缩包,可以提高数据的传输效率。但是,计算机将数据包压缩成压缩包后,需要额外的存储器存储压缩包,增加了硬件成本。另外,在数据传输过程中,计算机压缩数据包过程和压缩包解压过程中,都是需要大量的时间。因此,计算机在数据传输过程中,可能耗时更长,并不能提高计算机的数据传输效率。A second solution has been proposed in the prior art, which is: the computer can divide the data transmitted with the belt into multiple data packets. The computer compresses multiple data packets separately to obtain multiple compressed packets. The computer calls up multiple communication channels and transmits different data packets respectively. After existing computers compress multiple divided data packets into multiple compressed packets, they simultaneously transmit the compressed packets through multiple communication channels, which can improve data transmission efficiency. However, after the computer compresses the data packet into a compressed package, it requires additional memory to store the compressed package, which increases the hardware cost. In addition, during the data transmission process, the computer compresses the data package and decompresses the compressed package, which requires a lot of time. Therefore, the data transmission process of the computer may take longer, and the data transmission efficiency of the computer cannot be improved.
为了解决现有技术中的缺陷,本申请提供了一种数据传输方法、装置和系统。本申请实施例中,计算机确定待传输的数据包后,将待传输的数据包分成多个子数据包。计算机根据子数据包的数量,调取相应数量的通信通道。计算机读取子数据包中的数据过程中,当计算机读取出设定大小的数据后,将设定大小的数据传输给流式压缩器中。流式压缩器接收到设定大小的数据后,对设定大小的数据进行压缩,得到压缩包。流式压缩器通过通信通道将压缩包发送给接收端。In order to solve the deficiencies in the existing technology, this application provides a data transmission method, device and system. In this embodiment of the present application, after the computer determines the data packet to be transmitted, it divides the data packet to be transmitted into multiple sub-data packets. The computer calls up a corresponding number of communication channels according to the number of sub-data packets. When the computer reads the data in the sub-packet, after the computer reads out the data of the set size, it transmits the data of the set size to the streaming compressor. After receiving the data of the set size, the streaming compressor compresses the data of the set size to obtain a compressed package. The streaming compressor sends the compressed packet to the receiving end through the communication channel.
接收端接收到压缩包后,将压缩包传输给流式压缩器中。流式压缩器接收到压缩包后,对压缩包进行解压,得到原始数据。流式压缩器将原始数据发送给接收端中的存储器,并存储在存储器中。After receiving the compressed packet, the receiving end transmits the compressed packet to the streaming compressor. After receiving the compressed packet, the streaming compressor decompresses the compressed packet and obtains the original data. The streaming compressor sends the raw data to the memory in the receiving end, where it is stored.
本申请中,计算机在数据传输过程中,采用流式压缩器对待传输的数据一边读取一边压缩。计算机是对设定大小的数据进行压缩,并不需要对数据包进行压缩,可以减少额外内存的使用。另外,本申请在数据传输过程中,计算机不需要对数据包压缩和压缩包解压,可以节省大量的时间,提高了计算机的数据传输效率。In this application, during the data transmission process, the computer uses a streaming compressor to compress the data to be transmitted while reading it. The computer compresses data of a set size and does not need to compress data packets, which can reduce the use of additional memory. In addition, during the data transmission process of this application, the computer does not need to compress and decompress the data packets, which can save a lot of time and improve the data transmission efficiency of the computer.
图1为本申请实施例中提供的一种数据传输系统的架构示意图。如图1所示的数据传输系统中,包括发送端100和接收端200。其中,发送端100和接收端200可以为云服务器、笔记本电脑、平板电脑、智能手机、智能手表、智能手环、音乐播放器、音频播放器、U盘、可移动硬盘、汽车、基站、户外机柜、无人飞机等设备。Figure 1 is a schematic architectural diagram of a data transmission system provided in an embodiment of the present application. The data transmission system shown in Figure 1 includes a sending end 100 and a receiving end 200. Among them, the sending end 100 and the receiving end 200 can be cloud servers, laptops, tablets, smart phones, smart watches, smart bracelets, music players, audio players, U disks, removable hard drives, cars, base stations, outdoor Cabinets, drones and other equipment.
发送端100中包括处理器110、存储器120、收发器130和总线140。其中,处理器110、存储器120和收发器130是通过总线140建立通信连接,实现处理器110、存储器120和收发器130之间的数据传输。The sending end 100 includes a processor 110, a memory 120, a transceiver 130 and a bus 140. Among them, the processor 110, the memory 120 and the transceiver 130 establish communication connections through the bus 140 to realize data transmission between the processor 110, the memory 120 and the transceiver 130.
接收端200中包括处理器210、存储器220、收发器230和总线240。其中,处理器210、存储器220和收发器230是通过总线240建立通信连接,实现处理器210、存储器220和收发器230之间的数据传输。The receiving end 200 includes a processor 210, a memory 220, a transceiver 230 and a bus 240. Among them, the processor 210, the memory 220 and the transceiver 230 establish communication connections through the bus 240 to realize data transmission between the processor 210, the memory 220 and the transceiver 230.
处理器可以是通用处理器或者专用处理器。例如,处理器可以包括中央处理器(central processing unit,CPU)和/或基带处理器。示例性地,发送端100的处理器110可以根据接收到的请求指令,读取发送端100的存储器120中存储的数据。示例性地,接收端200的处理器210可以根据需求,向特定设备发送请求指令,以获取设定的数据。The processor may be a general purpose processor or a special purpose processor. For example, the processor may include a central processing unit (CPU) and/or a baseband processor. For example, the processor 110 of the sending end 100 can read the data stored in the memory 120 of the sending end 100 according to the received request instruction. For example, the processor 210 of the receiving end 200 can send a request instruction to a specific device according to requirements to obtain the set data.
存储器可以存储有程序(也可以是指令或者代码),程序可被处理器运行,使得处理器执行本方案中描述的数据传输方法。可选地,存储器中还可以存储有数据。例如,处理器110可以读取存储器120中存储的数据,该数据可以与程序存储在相同的存储地址,该数据也可以与程序存储在不同的存储地址。本申请中,发送端100中的处理器110和存储器120可以单独设置,也可以集成在一起。例如,集成在单板或者系统级芯片(system on chip,SOC)上。同理,接收端200中的处理器210和存储器220可以单独设置,也可以集成在一起。The memory may store a program (which may also be an instruction or code), and the program may be run by the processor, causing the processor to perform the data transmission method described in this solution. Optionally, data may also be stored in the memory. For example, the processor 110 can read data stored in the memory 120, and the data can be stored at the same storage address as the program, or the data can be stored at a different storage address from the program. In this application, the processor 110 and the memory 120 in the sending end 100 can be set up separately or integrated together. For example, integrated on a single board or system on chip (SOC). Similarly, the processor 210 and the memory 220 in the receiving end 200 can be set separately or integrated together.
收发器可以实现信号的输入(接收)和输出(发送)。例如,收发器可以包括收发器或射频芯片。收发器还可以包括通信接口。示例性地,发送端100可以通过收发器130接收接收端200发送的请求指令。发送端100可以通过收发器130向接收端200发送的存储器120中存储的数据。示例性地,接收端200可以通过收发器230向发送端100发送请求指令。接收端200可以通过收发器230接收发送端100发送的存储器120中存储的数据。The transceiver can realize the input (reception) and output (transmission) of signals. For example, the transceiver may include a transceiver or a radio frequency chip. The transceiver may also include a communication interface. For example, the sending end 100 can receive the request instruction sent by the receiving end 200 through the transceiver 130 . The sending end 100 can send the data stored in the memory 120 to the receiving end 200 through the transceiver 130 . For example, the receiving end 200 may send a request instruction to the sending end 100 through the transceiver 230 . The receiving end 200 can receive the data stored in the memory 120 sent by the transmitting end 100 through the transceiver 230 .
本申请中,发送端100中的收发器130与接收端200中的收发器230之间建立通信连接,实现发送端100与接收端200之间数据传输。其中,收发器130与收发器230之间的通信方式可以为2G/3G/4G/5G、无线保真(wireless fidelity,Wi-Fi)、蓝牙(bluetooth,BT)、紫蜂(ZigBee)等。In this application, a communication connection is established between the transceiver 130 in the sending end 100 and the transceiver 230 in the receiving end 200 to realize data transmission between the sending end 100 and the receiving end 200. The communication method between the transceiver 130 and the transceiver 230 may be 2G/3G/4G/5G, wireless fidelity (Wi-Fi), Bluetooth (bluetooth, BT), ZigBee, etc.
可以理解的是,本申请实施例示意的结构并不构成对发送端100和接收端200的具体结构进行限定。在本申请另一些实施例中,发送端100和接收端200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not limit the specific structures of the sending end 100 and the receiving end 200 . In other embodiments of the present application, the sending end 100 and the receiving end 200 may include more or less components than shown in the figures, or combine some components, or split some components, or arrange different components. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
图2为本申请实施例中提供的数据传输系统进行数据传输的硬件架构示意图。如图2所示的数据传输系统中,包括有发送端100和接收端200。发送端100中的处理器110包括有N个子处理器111。接收端200中的处理器210包括有N个子处理器211。发送端100与接收端200之间建立有N个通信通道。发送端100中的各个子处理器111分别与通信通道连接。接收端200中的各个子处理器211分别与通信通道连接。Figure 2 is a schematic diagram of the hardware architecture of the data transmission system provided in the embodiment of the present application for data transmission. The data transmission system shown in Figure 2 includes a sending end 100 and a receiving end 200. The processor 110 in the sending end 100 includes N sub-processors 111. The processor 210 in the receiving end 200 includes N sub-processors 211. N communication channels are established between the sending end 100 and the receiving end 200. Each sub-processor 111 in the sending end 100 is connected to a communication channel respectively. Each sub-processor 211 in the receiving end 200 is connected to a communication channel respectively.
本申请中,处理器110中的一个子处理器111、处理器110与处理器210之间的一个通信通道和处理器210中的一个子处理器211可以构成一个数据传输链路。数据传输系统中的N个数据传输链路之间相互不影响。其中,子处理器111中存储有流式压缩算法,用于一边读取数据一边压缩数据。子处理器211中存储有流式解压算法,用于一边接收数据一边解压数据。In this application, a sub-processor 111 in the processor 110, a communication channel between the processor 110 and the processor 210, and a sub-processor 211 in the processor 210 may form a data transmission link. The N data transmission links in the data transmission system do not affect each other. Among them, the sub-processor 111 stores a streaming compression algorithm, which is used to compress the data while reading the data. The sub-processor 211 stores a streaming decompression algorithm, which is used to decompress data while receiving data.
发送端100将目标文件的数据分割成N个数据段后,将目标文件的数据长度、数据段的数量、各个数据段的数据长度、各个数据段的偏移量等分段信息发送给接收端200。接收端200根据分段信息,在自身的存储器220中分配出存储空间,并确定出各个数据段的存储位置。After the sending end 100 divides the data of the target file into N data segments, it sends segmentation information such as the data length of the target file, the number of data segments, the data length of each data segment, and the offset of each data segment to the receiving end. 200. The receiving end 200 allocates storage space in its own memory 220 based on the segmentation information, and determines the storage location of each data segment.
在数据传输过程中,发送端100中的子处理器111对存储器130存储的目标文件中的数据段进行读取。一个子处理器111对一个数据段的数据进行读取。子处理器111对数据段的数据读取过程中,利用流式压缩算法实时地对读取的数据进行压缩,得到压缩数据流。子处理器111将压缩数据流通过通信通道发送给接收端200。接收端200中的子处理器211在接收到压缩数据流后,利用流式解压算法实时地对压缩数据流进行解压,得到原始的数据流。子处理器211将原始的数据流写入存储器220中对应数据段的存储空间中。During the data transmission process, the sub-processor 111 in the sending end 100 reads the data segments in the target file stored in the memory 130 . A sub-processor 111 reads the data of a data segment. During the data reading process of the data segment, the sub-processor 111 uses a streaming compression algorithm to compress the read data in real time to obtain a compressed data stream. The sub-processor 111 sends the compressed data stream to the receiving end 200 through the communication channel. After receiving the compressed data stream, the sub-processor 211 in the receiving end 200 decompresses the compressed data stream in real time using a streaming decompression algorithm to obtain the original data stream. The sub-processor 211 writes the original data stream into the storage space of the corresponding data segment in the memory 220.
图3为本申请实施例中提供的发送端与接收端之间进行数据传输的流程示意图。如图3所示,发送端100与接收端200之间进行数据传输的过程具体如下:Figure 3 is a schematic flowchart of data transmission between the sending end and the receiving end provided in the embodiment of the present application. As shown in Figure 3, the data transmission process between the sending end 100 and the receiving end 200 is as follows:
步骤S301,接收端200向发送端100发送数据传输请求指令。其中,数据传输请求指令是用于获取发送端100中存储的目标文件。Step S301, the receiving end 200 sends a data transmission request instruction to the sending end 100. The data transfer request instruction is used to obtain the target file stored in the sending end 100 .
本申请中,接收端200与发送端100进行数据传输的应用场景可以为应用程序(application,APP)下载、数据文件传输、图片传输、交易信息传输等。其中,发送端100可以是云服务器、基站、智能手机等存储有数据的设备。接收端200可以是用户的智能手机、平板电脑、智能手表等终端设备。In this application, the application scenarios for data transmission between the receiving end 200 and the sending end 100 may include application (APP) downloading, data file transmission, picture transmission, transaction information transmission, etc. Among them, the sending end 100 can be a cloud server, a base station, a smartphone, or other device that stores data. The receiving end 200 may be a terminal device such as a user's smartphone, tablet computer, or smart watch.
以数据文件传输为例。当接收端200需要目标文件时,接收端200可以自动地寻找存储有目标文件的设备,并与该设备建立通信连接。接收端200也可以在用户的手动操作下,被动地与存储有目标文件的设备建立通信连接。接收端200与发送端100之间建立通信连接后,向发送端100发送获取目标文件的请求指令,让发送端100确定待发送的目标文件。Take data file transfer as an example. When the receiving end 200 needs a target file, the receiving end 200 can automatically find a device storing the target file and establish a communication connection with the device. The receiving end 200 can also passively establish a communication connection with the device storing the target file under the manual operation of the user. After the communication connection is established between the receiving end 200 and the sending end 100, a request instruction for obtaining the target file is sent to the sending end 100, allowing the sending end 100 to determine the target file to be sent.
步骤S302,发送端100根据数据传输请求指令,确定目标文件,并按照设定规则将目标文件分成N个数据段。其中,N为大于1的正整数。Step S302: The sending end 100 determines the target file according to the data transmission request instruction, and divides the target file into N data segments according to the set rules. Among them, N is a positive integer greater than 1.
具体地,数据传输请求指令中一般携带有目标文件的标识。发送端100在接收到数据传输请求指令后,根据目标文件的标识,检测自身的存储器120中是否存储有目标文件。如果发送端100检测到存储器120中没有目标文件时,发送端100会向接收端200发送终止请求,让接收端200与发送端100之间终止数据传输。如果发送端100检测到存储器120中存储有目标文件时,发送端100会对目标文件进行预处理。本申请中,发送端100在预处理过程中,将目标文件的数据分割成多个数据段。发送端100将目标文件的数据分割成多个数据段后,将多个数据段通过多个通信通道并行传输,实现提高发送端100与接收端200之间的数据传输效率。Specifically, the data transfer request instruction generally carries the identifier of the target file. After receiving the data transmission request instruction, the sending end 100 detects whether the target file is stored in its own memory 120 according to the identification of the target file. If the sending end 100 detects that there is no target file in the memory 120, the sending end 100 will send a termination request to the receiving end 200 to terminate data transmission between the receiving end 200 and the sending end 100. If the sending end 100 detects that the target file is stored in the memory 120, the sending end 100 will preprocess the target file. In this application, the sending end 100 divides the data of the target file into multiple data segments during the preprocessing process. After the sending end 100 divides the data of the target file into multiple data segments, the multiple data segments are transmitted in parallel through multiple communication channels, thereby improving the data transmission efficiency between the sending end 100 and the receiving end 200.
发送端100将目标文件的数据分割成数据段的数量与发送端100和接收端200之间通信带宽有关。其中,发送端100与接收端200之间的通信带宽越大,发送端100将目标文件分割成数据段的数量越多。发送端100与接收端200之间的通信带宽越小,发送端100将目标文件分割成数据段的数量越少。The number of data segments the sending end 100 divides into data segments is related to the communication bandwidth between the sending end 100 and the receiving end 200 . Among them, the greater the communication bandwidth between the sending end 100 and the receiving end 200, the greater the number of data segments the sending end 100 divides the target file into. The smaller the communication bandwidth between the sending end 100 and the receiving end 200, the smaller the number of data segments the sending end 100 divides the target file into.
在一个实施例中,如果目标文件是由N个独立的数据段构成,发送端100可以不需要对目标文件进行分割处理。在数据传输过程中,发送端100可以将N个独立的数据段通过N个通信通道发送给接收端200。在其他实施例中,如果目标文件中的数据段的数量n比设定的数量N小时,发送端100可以对数据长度比较长的数据段进行分割,将目标文件的数据分割出设定数量N的数据段。In one embodiment, if the target file is composed of N independent data segments, the sending end 100 may not need to split the target file. During the data transmission process, the sending end 100 can send N independent data segments to the receiving end 200 through N communication channels. In other embodiments, if the number n of data segments in the target file is smaller than the set number N, the sending end 100 can divide the data segments with relatively long data lengths, and divide the data of the target file into the set number N. data segment.
在一个实施例中,发送端100确定目标文件后,获取目标文件的数据长度。发送端100根据数据段的数量N和目标文件的数据长度,将目标文件的数据分割成N个。例如,目标文件的数据长度为Nx kb。其中,1kb-x kb的数据长度作为第一个数据段,(x+1)kb-2x kb的数据长度作为第二个数据段,(2x+1)kb-3x kb的数据长度作为第二个数据段,其它数据段以此类推。In one embodiment, after determining the target file, the sending end 100 obtains the data length of the target file. The sending end 100 divides the data of the target file into N pieces according to the number N of data segments and the data length of the target file. For example, the data length of the target file is Nx kb. Among them, the data length of 1kb-x kb is used as the first data segment, the data length of (x+1)kb-2x kb is used as the second data segment, and the data length of (2x+1)kb-3x kb is used as the second data segment. data segment, and so on for other data segments.
步骤S303,发送端100向接收端200发送目标文件的分段信息。其中,分段信息携带有目标文件的数据长度、数据段的数量、每个数据段的数据长度、每个数据段的偏移量等信息。Step S303: The sending end 100 sends the segmentation information of the target file to the receiving end 200. Among them, the segmentation information carries information such as the data length of the target file, the number of data segments, the data length of each data segment, and the offset of each data segment.
具体地,发送端100将目标文件的数据分割成N个数据段后,记录下目标文件的数据长度、数据段的数量、各个数据段的内存、各个数据段的偏移量等参数。发送端100将目标文件的数据长度、数据段的数量、各个数据段的数据长度、各个数据段的偏移量等参数作为分段信息,发送给接收端200。Specifically, after the sending end 100 divides the data of the target file into N data segments, it records the data length of the target file, the number of data segments, the memory of each data segment, the offset of each data segment, and other parameters. The sending end 100 sends parameters such as the data length of the target file, the number of data segments, the data length of each data segment, and the offset of each data segment to the receiving end 200 as segmentation information.
数据段的偏移量是指数据段的数据长度在目标文件的数据长度中的位置。例如,目标文件的数据长度为Nx kb。第一个数据段的数据长度为x kb,则第一个数据段的偏移量为1kb。第二个数据段的数据长度为x kb,则第二个数据段的偏移量为(x+1)kb。第三个数据段的数据长度为x kb,则第三个数据段的偏移量为(2x+1)kb。其它数据段的偏移量以此类推。The offset of the data segment refers to the position of the data length of the data segment in the data length of the target file. For example, the data length of the target file is Nx kb. The data length of the first data segment is x kb, then the offset of the first data segment is 1kb. The data length of the second data segment is x kb, then the offset of the second data segment is (x+1)kb. The data length of the third data segment is x kb, then the offset of the third data segment is (2x+1)kb. The offsets of other data segments are similarly deduced.
发送端100可以根据数据段的数量,在处理器110中配置相应数量的子处理器111。子处理器111中存储有流式压缩算法,用于一边读取数据一边压缩数据。一个子处理器111对一个数据段进行读取和压缩数据。The sending end 100 may configure a corresponding number of sub-processors 111 in the processor 110 according to the number of data segments. The sub-processor 111 stores a streaming compression algorithm for compressing data while reading the data. A sub-processor 111 reads and compresses data for a data segment.
步骤S304,接收端200根据分段信息,建立多个数据传输链路。Step S304: The receiving end 200 establishes multiple data transmission links according to the segmentation information.
具体地,接收端200接收到分段信息后,解析出分段信息中的目标文件的数据长度、数据段的数量、各个数据段的数据长度、各个数据段的偏移量等参数。接收端200根据数据段的数量,在处理器210中配置相应数量的子处理器211。子处理器211中存储有流式解压算法,用于一边接收数据一边解压数据。一个子处理器211对一个文件进行解压和写入存储器中。Specifically, after receiving the segmentation information, the receiving end 200 parses out parameters such as the data length of the target file, the number of data segments, the data length of each data segment, and the offset of each data segment in the segmentation information. The receiving end 200 configures a corresponding number of sub-processors 211 in the processor 210 according to the number of data segments. The sub-processor 211 stores a streaming decompression algorithm, which is used to decompress data while receiving data. A sub-processor 211 decompresses a file and writes it to memory.
接收端200根据数据段的数量,以及接收端200与发送端100之间的通信带宽,在接收端200与发送端100之间建立N个通信通道。一个子处理器111、一个通信通道和一个子处理器211构成一个数据传输链路。一个数据传输链路传输一个数据段。可选地,在数据传输过程中,如果发送端100与接收端200之间通信带宽降低,通信通道的数量减少。此时,发送端100可以减少子处理器111的数量,降低处理器110的运行内存。接收端200可以减少子处理器211的数量,降低处理器210的运行内存。其它实施例中,接收端200与发送端100之间可以建立其它通信连接,提高发送端100与接收端200之间通信带宽,保证发送端100与接收端200之间有N个通信通道。The receiving end 200 establishes N communication channels between the receiving end 200 and the sending end 100 according to the number of data segments and the communication bandwidth between the receiving end 200 and the sending end 100. A sub-processor 111, a communication channel and a sub-processor 211 form a data transmission link. A data transmission link transmits one data segment. Optionally, during data transmission, if the communication bandwidth between the sending end 100 and the receiving end 200 is reduced, the number of communication channels is reduced. At this time, the sending end 100 can reduce the number of sub-processors 111 and reduce the running memory of the processor 110. The receiving end 200 can reduce the number of sub-processors 211 and reduce the running memory of the processor 210. In other embodiments, other communication connections can be established between the receiving end 200 and the sending end 100 to increase the communication bandwidth between the sending end 100 and the receiving end 200 and ensure that there are N communication channels between the sending end 100 and the receiving end 200.
接收端200根据目标文件的数据长度,在自身的存储器220中提前占用部分空白内存,作为存储目标文件的目标存储空间。接收端200根据各个数据段的内存和各个数据段的偏移量,确定目标存储空间中各个数据段的存储位置。例如,目标存储空间的内存为Nx kb。当第一个数据段的数据长度为x kb,第一个数据段的偏移量为1kb,第一个数据段的存储位置为1kb-x kb。第二个数据段的数据长度为x kb,第二个数据段的偏移量为(x+1)kb,第二个数据段的存储位置为(x+1)kb-2x kb。第三个数据段的数据长度为x kb,第三个数据段的偏移量为(2x+1)kb,第三个数据段的存储位置为(2x+1)kb-3x kb。其它数据段的存储位置以此类推。According to the data length of the target file, the receiving end 200 occupies part of the blank memory in its own memory 220 in advance as a target storage space for storing the target file. The receiving end 200 determines the storage location of each data segment in the target storage space based on the memory of each data segment and the offset of each data segment. For example, the target storage space has Nx kb of memory. When the data length of the first data segment is x kb, the offset of the first data segment is 1kb, and the storage location of the first data segment is 1kb-x kb. The data length of the second data segment is x kb, the offset of the second data segment is (x+1)kb, and the storage location of the second data segment is (x+1)kb-2x kb. The data length of the third data segment is x kb, the offset of the third data segment is (2x+1)kb, and the storage location of the third data segment is (2x+1)kb-3x kb. The storage locations of other data segments are similarly deduced.
步骤S305,接收端200通过各个数据传输链路向发送端100发送数据段存储请求指令。Step S305: The receiving end 200 sends a data segment storage request instruction to the sending end 100 through each data transmission link.
具体地,发送端100与接收端200之间进行数据传输时,发送端100是通过多个数据传输链路并行传输数据。因此,接收端200请求发送端100发送数据段时,需要通过各个数据传输链路发送数据段存储请求指令,触发各个数据传输链路进行数据传输。Specifically, when data is transmitted between the sending end 100 and the receiving end 200, the sending end 100 transmits data in parallel through multiple data transmission links. Therefore, when the receiving end 200 requests the sending end 100 to send a data segment, it needs to send a data segment storage request instruction through each data transmission link to trigger each data transmission link to perform data transmission.
本申请中,发送端100与接收端200之间的多个数据传输链路可以同时传输数据,可以提高数据传输系统的数据传输效率。发送端100与接收端200进行传输数据时,数据传输链路之间相互不受影响,可以提高发送端100与接收端200之间数据传输的稳定性。可选地,当发送端100并没有从一个数据传输链路中接收到数据段存储请求指令时,该数据传输链路处于断开状态。In this application, multiple data transmission links between the sending end 100 and the receiving end 200 can transmit data simultaneously, which can improve the data transmission efficiency of the data transmission system. When the sending end 100 and the receiving end 200 transmit data, the data transmission links are not affected by each other, which can improve the stability of data transmission between the sending end 100 and the receiving end 200. Optionally, when the sending end 100 does not receive a data segment storage request instruction from a data transmission link, the data transmission link is in a disconnected state.
步骤S306,发送端100根据各个数据段存储请求指令,分别让各个数据传输链路中的子处理器111读取数据段。Step S306: The sending end 100 allows the sub-processors 111 in each data transmission link to read the data segments according to the storage request instructions of each data segment.
具体地,数据段存储请求指令中携带有数据段的标识。当发送端100接收到数据传输链路发送的数据段存储请求指令后,数据传输链路中的子处理器111对数据段存储请求指令进行解析,得到数据段标识。子处理器111根据数据段标识,确定目标文件中的数据段,并对存储器120中的数据段进行读取。发送端100在接收到多个数据传输链路发送的数据段存储请求指令后,每个数据传输链路中的子处理器111都会对存储器120中的对应的数据段进行读取,实现多个数据段并行传输。Specifically, the data segment storage request instruction carries the identifier of the data segment. When the sending end 100 receives the data segment storage request instruction sent by the data transmission link, the sub-processor 111 in the data transmission link parses the data segment storage request instruction to obtain the data segment identification. The sub-processor 111 determines the data segment in the target file according to the data segment identifier, and reads the data segment in the memory 120 . After the sending end 100 receives the data segment storage request instructions sent by multiple data transmission links, the sub-processor 111 in each data transmission link will read the corresponding data segment in the memory 120 to implement multiple Data segments are transferred in parallel.
步骤S307,发送端100中的子处理器利用流式压缩算法,对读取的数据段的数据进行压缩,得到压缩数据流。In step S307, the sub-processor in the sending end 100 uses a streaming compression algorithm to compress the data of the read data segment to obtain a compressed data stream.
流式压缩算法是指对读取的数据进行实时压缩的技术。流式压缩算法将原始数据流处理成压缩流,得到压缩数据流。压缩数据流不同于常见的压缩包。压缩数据流是对子处理器111读取的数据实时压缩,剔除出数据中冗余信息,使用最短的编码保存最完整的数据信息。相比较现有的压缩包,压缩数据流的内存小,且可以在通信通道中进行传输。在其它实施例中,流式压缩技术可以是deflate压缩算法、LZ77压缩算法、huffman压缩算法等,本申请在此不做限定。Streaming compression algorithm refers to the technology of real-time compression of read data. The streaming compression algorithm processes the original data stream into a compressed stream to obtain a compressed data stream. Compressed data streams are different from common compressed packages. The compressed data stream compresses the data read by the sub-processor 111 in real time, removes redundant information in the data, and uses the shortest encoding to save the most complete data information. Compared with existing compressed packets, the compressed data stream has smaller memory and can be transmitted in the communication channel. In other embodiments, the streaming compression technology may be deflate compression algorithm, LZ77 compression algorithm, huffman compression algorithm, etc., which is not limited in this application.
本申请中,子处理器111在读取存储器中的数据段的数据过程中,子处理器111一边读取数据,一边利用流式压缩算法对读取的数据进行压缩,得到压缩数据流。示例性地,以一个子处理器111为例。子处理器111在读取数据段的数据过程中,当子处理器111读取出设定长度的数据后,子处理器111中的流式压缩器对设定长度的数据进行压缩,得到压缩数据流。子处理器111将压缩数据流传输至收发器130,通过通信通道发送给接收端200中。在其它实施例中,设定长度可以为几十kb、几百kb或其它数值,本申请在此不做限定。In this application, when the sub-processor 111 reads the data of the data segment in the memory, the sub-processor 111 reads the data and uses a stream compression algorithm to compress the read data to obtain a compressed data stream. For example, take a sub-processor 111 as an example. When the sub-processor 111 reads the data of the data segment, after the sub-processor 111 reads the data of the set length, the stream compressor in the sub-processor 111 compresses the data of the set length to obtain compression. data flow. The sub-processor 111 transmits the compressed data stream to the transceiver 130 and sends it to the receiving end 200 through the communication channel. In other embodiments, the set length may be tens of kb, hundreds of kb, or other values, which is not limited in this application.
步骤S308,发送端100通过各个数据传输链路向接收端200发送压缩数据流。Step S308: The sending end 100 sends the compressed data stream to the receiving end 200 through each data transmission link.
通常情况下,发送端100与接收端200之间进行数据传输时,是以数据段的数据或数据段压缩包的数据进行传输。本申请中,子处理器111将数据段的数据实时压缩,得到多个压缩数据流。发送端100通过数据传输链路传输数据时,按照时间的顺序将压缩数据流发送给接收端200。多个压缩数据流的数据长度是比数据段的数据长度、数据段压缩包的数据长度都要小。发送端100通过传输压缩数据流时,可以减少传输的数据量,实现提高数据传输效率。Normally, when data is transmitted between the sending end 100 and the receiving end 200, the data of the data segment or the data of the data segment compressed packet are transmitted. In this application, the sub-processor 111 compresses the data of the data segment in real time to obtain multiple compressed data streams. When transmitting data through the data transmission link, the sending end 100 sends the compressed data stream to the receiving end 200 in time sequence. The data length of multiple compressed data streams is smaller than the data length of the data segment and the data length of the data segment compression package. When the sending end 100 transmits a compressed data stream, it can reduce the amount of transmitted data and improve data transmission efficiency.
步骤S309,接收端200通过各个数据传输链路接收数据压缩包后,各个数据传输链路中的子处理器211利用流式解压算法对数据压缩包进行解压,得到原始数据。In step S309, after the receiving end 200 receives the compressed data packet through each data transmission link, the sub-processor 211 in each data transmission link decompresses the compressed data packet using a streaming decompression algorithm to obtain original data.
接收端200是通过各个数据传输链路实时地接收发送端100发送的压缩数据流。压缩数据流是对数据段的数据进行压缩得到的数据包。接收端200无法直接将压缩数据流存储在自身的存储器220中。接收端200中的各个子处理器211中设置有流式解压器。子处理器211中的流式压缩器接收到压缩数据流后,对压缩数据流进行解压,将压缩数据流还原成原始数据。The receiving end 200 receives the compressed data stream sent by the sending end 100 in real time through various data transmission links. Compressed data stream is a data packet obtained by compressing the data of the data segment. The receiving end 200 cannot directly store the compressed data stream in its own memory 220 . Each sub-processor 211 in the receiving end 200 is provided with a streaming decompressor. After receiving the compressed data stream, the stream compressor in the sub-processor 211 decompresses the compressed data stream and restores the compressed data stream to original data.
流式解压算法是指对读取的压缩数据流进行实时解压的技术。流式解压算法将压缩包处理成原始数据流,得到原始数据。在其它实施例中,流式压缩技术可以是deflate解压算法、LZ77解压算法、huffman解压算法等,本申请在此不做限定。The streaming decompression algorithm refers to the technology of real-time decompression of the read compressed data stream. The streaming decompression algorithm processes the compressed packet into the original data stream to obtain the original data. In other embodiments, the streaming compression technology may be deflate decompression algorithm, LZ77 decompression algorithm, huffman decompression algorithm, etc., which is not limited in this application.
步骤S310,接收端200中的各个子处理器211将原始数据写入目标存储空间中对应数据段的存储位置中。In step S310, each sub-processor 211 in the receiving end 200 writes the original data into the storage location of the corresponding data segment in the target storage space.
在接收端200中,各个数据传输链路中的子处理器211实时地解压出原始数据后,每个子处理器211根据数据段的标识,确定数据段在存储器211中存储位置。子处理器211实时地将原始数据存储数据段在存储器211中存储空间中,实现发送端100中的数据转移到接收端200中。In the receiving end 200, after the sub-processors 211 in each data transmission link decompress the original data in real time, each sub-processor 211 determines the storage location of the data segment in the memory 211 according to the identification of the data segment. The sub-processor 211 stores the original data segments in the storage space of the memory 211 in real time, thereby transferring the data in the sending end 100 to the receiving end 200.
本申请实施例中,发送端100将目标文件分割成多个数据段。发送端100与接收端200之间建立多个数据传输链路。发送端100与接收端200之间进行数据传输时,发送端100利用流式压缩技术,每个数据传输链路一边读取数据段,一边对读取的数据实时压缩,得到压缩数据流。发送端100实时地发送压缩数据流。接收端200利用流式解压技术,一边接收压缩数据流,一边对压缩数据流解压,得到原始数据。接收端200根据每个数据传输链路传输的数据段在存储器中的存储位置,实时地将各个数据传输链路中的原始数据写入存储器中。本申请将目标文件的数据分段,各个数据段并行传输,可以提高数据传输效率。另外,各个数据传输链路通过对读取的数据实时压缩并进行传输,不仅降低了数据传输总量,而且不需要额外的存储器存储压缩包,降低了硬件成本。In this embodiment of the present application, the sending end 100 divides the target file into multiple data segments. Multiple data transmission links are established between the sending end 100 and the receiving end 200. When data is transmitted between the sending end 100 and the receiving end 200, the sending end 100 uses streaming compression technology. Each data transmission link reads the data segment while compressing the read data in real time to obtain a compressed data stream. The sending end 100 sends the compressed data stream in real time. The receiving end 200 uses streaming decompression technology to receive the compressed data stream and decompress the compressed data stream to obtain original data. The receiving end 200 writes the original data in each data transmission link into the memory in real time according to the storage location of the data segment transmitted by each data transmission link in the memory. This application segments the data of the target file and transmits each data segment in parallel, which can improve data transmission efficiency. In addition, each data transmission link compresses and transmits the read data in real time, which not only reduces the total amount of data transmission, but also does not require additional memory to store compressed packages, reducing hardware costs.
本申请中,发送端100在数据传输过程中,处理器110会对自身运行环境进行检测,如检测通信带宽、处理器的算力等。在一种情况下,处理器110检测到收发器130与接收端200的收发器230之间的通信带宽降低,通信带宽小于设定阈值,发送端100与接收端200之间的通信通道的数量减少。此时,处理器110可以根据当前通信通道的数量,减少子处理器111的数量,避免处理器110处在高运行内存状态。可选地,处理器110向接收端200发送反馈信息,让接收端200中的处理器210减少子处理器211的数量,避免处理器210处在高算力状态。In this application, during the data transmission process of the sending end 100, the processor 110 will detect its own operating environment, such as detecting the communication bandwidth, the computing power of the processor, etc. In one case, the processor 110 detects that the communication bandwidth between the transceiver 130 and the transceiver 230 of the receiving end 200 is reduced, the communication bandwidth is less than a set threshold, and the number of communication channels between the sending end 100 and the receiving end 200 reduce. At this time, the processor 110 can reduce the number of sub-processors 111 according to the current number of communication channels to prevent the processor 110 from being in a high running memory state. Optionally, the processor 110 sends feedback information to the receiving end 200 to allow the processor 210 in the receiving end 200 to reduce the number of sub-processors 211 to prevent the processor 210 from being in a high computing power state.
在一种情况下,处理器110检测到自身处在高算力状态,处理器的算力大于设定阈值,处理器110无法维持足够数量的子处理器111运行。如果发送端100与接收端200之间的通信通道的数量不变,处理器110可以让一部分数据段通过数据传输链路进行数据传输,让另一部分数据段通过正常数据传输方式发送到接收端200中。可选地,处理器110向接收端200发送反馈信息,让接收端200中的处理器210也维持相同数量的子处理器211运行,避免处理器210的算力浪费。在其它实施例中,处理器110检测到自身的算力降低,处理器的算力小于设定阈值。处理器110增加子处理器111的数量,让每个数据段通过数据传输链路进行数据传输。In one case, the processor 110 detects that it is in a high computing power state, the processor's computing power is greater than a set threshold, and the processor 110 cannot maintain a sufficient number of sub-processors 111 running. If the number of communication channels between the sending end 100 and the receiving end 200 remains unchanged, the processor 110 can allow part of the data segments to be transmitted through the data transmission link, and let the other part of the data segments be sent to the receiving end 200 through normal data transmission. middle. Optionally, the processor 110 sends feedback information to the receiving end 200 so that the processor 210 in the receiving end 200 also maintains the same number of sub-processors 211 running to avoid wasting the computing power of the processor 210. In other embodiments, the processor 110 detects that its own computing power is reduced, and the processor's computing power is less than a set threshold. The processor 110 increases the number of sub-processors 111 to allow each data segment to transmit data through the data transmission link.
本申请中,接收端200在数据传输过程中,处理器210会对自身运行环境进行检测,如检测通信带宽、处理器的算力等。在一种情况下,处理器210检测到收发器230与发送端100的收发器130之间的通信带宽降低,通信带宽小于设定阈值,发送端100与接收端200之间的通信通道的数量减少。此时,处理器110可以根据当前通信通道的数量,减少子处理器111的数量,避免处理器210处在高运行内存状态。可选地,处理器210向发送端100发送反馈信息,让发送端100中的处理器110减少子处理器111的数量,避免处理器110处在高算力状态。In this application, during the data transmission process of the receiving end 200, the processor 210 will detect its own operating environment, such as detecting the communication bandwidth, the computing power of the processor, etc. In one case, the processor 210 detects that the communication bandwidth between the transceiver 230 and the transceiver 130 of the sending end 100 is reduced, the communication bandwidth is less than a set threshold, and the number of communication channels between the sending end 100 and the receiving end 200 reduce. At this time, the processor 110 can reduce the number of sub-processors 111 according to the current number of communication channels to prevent the processor 210 from being in a high running memory state. Optionally, the processor 210 sends feedback information to the sending end 100 to allow the processor 110 in the sending end 100 to reduce the number of sub-processors 111 to prevent the processor 110 from being in a high computing power state.
在一种情况下,处理器210检测到自身处在高算力状态,处理器的算力大于设定阈值,处理器210无法维持足够数量的子处理器211运行。如果发送端100与接收端200之间的通信通道的数量不变,处理器210可以让发送端100中的一部分数据段通过数据传输链路进行数据传输,让另一部分数据段通过正常数据传输方式发送到接收端200中。可选地,处理器210向发送端100发送反馈信息,让发送端100中的处理器110也维持相同数量的子处理器111运行,避免处理器110的算力浪费。在其它实施例中,处理器210检测到自身的算力降低,处理器的算力小于设定阈值。处理器210增加子处理器211的数量,让每个数据段通过数据传输链路进行数据传输。In one case, the processor 210 detects that it is in a high computing power state, the processor's computing power is greater than a set threshold, and the processor 210 cannot maintain a sufficient number of sub-processors 211 running. If the number of communication channels between the sending end 100 and the receiving end 200 remains unchanged, the processor 210 can allow part of the data segments in the sending end 100 to be transmitted through the data transmission link, and allow other part of the data segments to be transmitted through the normal data transmission method. sent to the receiving end 200. Optionally, the processor 210 sends feedback information to the sending end 100 so that the processor 110 in the sending end 100 also maintains the same number of sub-processors 111 running to avoid wasting the computing power of the processor 110. In other embodiments, the processor 210 detects that its own computing power is reduced, and the processor's computing power is less than a set threshold. The processor 210 increases the number of sub-processors 211 to allow each data segment to transmit data through the data transmission link.
本申请实施例中,发送端100与接收端200在数据传输过程中,都会对自身运行环境进行检测,如检测通信带宽、处理器的算力等,根据通信带宽、处理器的算力等因素,实时调整发送端100与接收端200之间的数据传输链路的数量,让发送端100与接收端200之间达到最优的传输效率。In the embodiment of this application, during the data transmission process, the sending end 100 and the receiving end 200 will detect their own operating environments, such as detecting communication bandwidth, processor computing power, etc., based on factors such as communication bandwidth and processor computing power. , adjust the number of data transmission links between the sending end 100 and the receiving end 200 in real time to achieve optimal transmission efficiency between the sending end 100 and the receiving end 200.
图4为本申请实施例中提供的一种数据传输装置的架构示意图。如图4所示的数据传输装置400,包括有处理器401和收发器402。其中,处理器401和收发器402具体工作过程如下:FIG. 4 is a schematic structural diagram of a data transmission device provided in an embodiment of the present application. The data transmission device 400 shown in Figure 4 includes a processor 401 and a transceiver 402. Among them, the specific working processes of the processor 401 and the transceiver 402 are as follows:
在一种实施方式中,收发器402用于接收接收端发送的数据传输请求指令,数据传输请求指令携带有目标文件的标识;处理器401用于根据目标文件的标识,确定目标文件,并将目标文件的数据分割成N个数据段数据段,N为大于1的正整数;收发器401还用于向接收端发送分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量,目标文件的数据长度指示接收端确定目标文件的目标存储空间,数据段的数量指示接收端建立N个数据传输链路,各个数据段的数据长度和各个数据段的偏移量指示接收端确定数据段在目标存储空间中的存储位置;接收N个数据传输链路发送的数据段存储请求指令;处理器401还用于利用流式压缩算法,读取各个数据段并压缩读取出的数据,得到压缩数据流;收发器,还用于通过N个数据传输链路向接收端发送压缩数据流。In one implementation, the transceiver 402 is configured to receive a data transfer request instruction sent by the receiving end, and the data transfer request instruction carries an identifier of the target file; the processor 401 is configured to determine the target file according to the identifier of the target file, and transfer the The data of the target file is divided into N data segments, where N is a positive integer greater than 1; the transceiver 401 is also used to send segmentation information to the receiving end. The segmentation information includes the data length of the target file, the number of data segments, The data length of each data segment and the offset of each data segment. The data length of the target file instructs the receiving end to determine the target storage space of the target file. The number of data segments instructs the receiving end to establish N data transmission links. The data length of each data segment The data length and the offset of each data segment instruct the receiving end to determine the storage location of the data segment in the target storage space; receive data segment storage request instructions sent by N data transmission links; the processor 401 is also used to utilize streaming compression The algorithm reads each data segment and compresses the read data to obtain a compressed data stream; the transceiver is also used to send the compressed data stream to the receiving end through N data transmission links.
在一种实施方式中,处理器401还用于根据数据段的数量,配置N个子处理器,子处理器用于读取数据段的数据,并压缩读取出的数据。In one implementation, the processor 401 is also configured to configure N sub-processors according to the number of data segments, and the sub-processors are configured to read the data of the data segments and compress the read data.
在一种实施方式中,处理器401具体用于确定目标文件的数据长度,将目标文件的数据均分成N个数据段。In one implementation, the processor 401 is specifically configured to determine the data length of the target file and divide the data of the target file into N data segments.
在一种实施方式中,处理器401具体用于根据发送端与接收端之间的通信带宽,确定发送端与接收端之间的通信通道的数量;以及根据通信通道的数量,确定目标文件的数据分割成数据段的数量。In one implementation, the processor 401 is specifically configured to determine the number of communication channels between the sending end and the receiving end according to the communication bandwidth between the sending end and the receiving end; and determine the number of the target file according to the number of communication channels. The number of data segments the data is divided into.
在一种实施方式中,处理器401具体用于第一子处理器接收到第一数据段存储请求指令后,读取出第一数据段的数据,N个子处理器包括第一子处理器,N个数据段包括第一数据段,N个数据传输链路包括第一数据传输链路,第一数据段存储请求指令为第一数据传输链路传输的数据段存储请求指令;以及当第一子处理器读取出第一数据段的设定长度的数据后,将设定长度的数据进行压缩,得到第一压缩数据流,设定长度小于第一数据段的长度。In one implementation, the processor 401 is specifically configured to read the data of the first data segment after the first sub-processor receives the first data segment storage request instruction. The N sub-processors include the first sub-processor, The N data segments include the first data segment, the N data transmission links include the first data transmission link, the first data segment storage request instruction is a data segment storage request instruction transmitted by the first data transmission link; and when the first After reading the data of the set length of the first data segment, the sub-processor compresses the data of the set length to obtain a first compressed data stream, and the set length is smaller than the length of the first data segment.
在一种实施方式中,处理器401还用于检测发送端与接收端之间的通信带宽;以及当通信带宽小于第一设定阈值时,减少发送端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one implementation, the processor 401 is also used to detect the communication bandwidth between the sending end and the receiving end; and when the communication bandwidth is less than a first set threshold, reduce the number of sub-processors on the sending end, the first setting The threshold is the communication bandwidth allocated to N communication channels.
在一种实施方式中,收发器402还用于向接收端发送第一反馈指令,第一反馈指令指示接收端减少建立数据传输链路的数量。In one implementation, the transceiver 402 is also configured to send a first feedback instruction to the receiving end, and the first feedback instruction instructs the receiving end to reduce the number of established data transmission links.
在一种实施方式中,处理器401还用于检测发送端中的处理器的算力;以及当处理器的算力大于第二设定阈值时,减少发送端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one implementation, the processor 401 is also configured to detect the computing power of the processor in the sending end; and when the computing power of the processor is greater than the second set threshold, reduce the number of sub-processors in the sending end, and the second Set the threshold to the minimum computing power of N sub-processors that cannot be configured by the processor's computing power.
在一种实施方式中,收发器402还用于向接收端发送第二反馈指令,第二反馈指令指示接收端减少配置子处理器的数量。In one implementation, the transceiver 402 is also configured to send a second feedback instruction to the receiving end, and the second feedback instruction instructs the receiving end to reduce the number of configured sub-processors.
图5为本申请实施例中提供的一种数据传输装置的架构示意图。如图5所示的数据传输装置500,包括有处理器501和收发器502。其中,处理器501和收发器502具体工作过程如下:FIG. 5 is an architectural schematic diagram of a data transmission device provided in an embodiment of the present application. The data transmission device 500 shown in Figure 5 includes a processor 501 and a transceiver 502. Among them, the specific working processes of the processor 501 and the transceiver 502 are as follows:
在一种实施方式中,收发器502用于向发送端发送数据传输请求指令,数据传输请求指令指示发送端将目标文件的数据分割成N个数据段,N为大于1的正整数;接收发送端发送的分段信息,分段信息包括目标文件的数据长度、数据段的数量、各个数据段的数据长度和各个数据段的偏移量;处理器501用于根据数据段的数量,建立N个数据传输链路;收发器502还用于通过N个数据传输链路向发送端发送数据段存储请求指令,数据段存储请求指令指示发送端读取并发送N个数据段;接收发送端通过N个数据传输链路发送的压缩数据流;处理器501还用于利用流式解压算法,对压缩数据流进行解压,并将每个数据传输链路传输的数据存储在目标存储空间中的设定存储位置中。In one implementation, the transceiver 502 is used to send a data transfer request instruction to the sending end. The data transfer request instruction instructs the sending end to divide the data of the target file into N data segments, where N is a positive integer greater than 1; receive and send The segmentation information sent by the client, the segmentation information includes the data length of the target file, the number of data segments, the data length of each data segment and the offset of each data segment; the processor 501 is used to establish N according to the number of data segments. data transmission links; the transceiver 502 is also used to send a data segment storage request instruction to the sending end through N data transmission links, and the data segment storage request instruction instructs the sending end to read and send N data segments; the receiving sending end passes The compressed data stream sent by N data transmission links; the processor 501 is also used to decompress the compressed data stream using a streaming decompression algorithm, and store the data transmitted by each data transmission link in the device in the target storage space. in the specified storage location.
在一种实施方式中,处理器501还用于根据数据段的数量,配置N个子处理器,子处理器用于对压缩数据流进行解压,并将解压后的数据写入目标存储空间中的设定存储位置中。In one implementation, the processor 501 is also configured to configure N sub-processors according to the number of data segments. The sub-processors are used to decompress the compressed data stream and write the decompressed data into the device in the target storage space. in the specified storage location.
在一种实施方式中,处理器501具体用于根据目标文件的数据长度,在存储器中确定存储目标文件的目标存储空间;根据各个数据段的数据长度和各个数据段的偏移量,确定各个数据段在目标存储空间中的存储位置;当第二子处理器通过第二数据传输链路接收到第二数据段的第二压缩数据流后,对第二压缩数据流进行解压,得到原始数据;N个子处理器包括第二子处理器,N个数据传输链路包括第二数据传输链路,N个数据段包括第二数据段,第二压缩数据流为发送端对读取设定长度的第二数据段进行压缩得到的压缩数据流,原始数据为发送端读取设定长度的第二数据段,原始数据的长度小于第二数据段的长度;第二子处理器将原始数据写入第二数据段的存储空间中,目标存储空间包括第二数据段的存储空间。In one implementation, the processor 501 is specifically configured to determine a target storage space for storing the target file in the memory based on the data length of the target file; determine each data segment based on the data length and offset of each data segment. The storage location of the data segment in the target storage space; when the second sub-processor receives the second compressed data stream of the second data segment through the second data transmission link, it decompresses the second compressed data stream to obtain the original data ; N sub-processors include second sub-processors, N data transmission links include second data transmission links, N data segments include second data segments, and the second compressed data stream sets a length for the sending end to read The compressed data stream obtained by compressing the second data segment. The original data is the second data segment with a set length read by the sending end. The length of the original data is smaller than the length of the second data segment; the second sub-processor writes the original data. into the storage space of the second data segment, and the target storage space includes the storage space of the second data segment.
在一种实施方式中,处理器501还用于检测接收端与发送端之间的通信带宽;以及当通信带宽小于第一设定阈值时,减少接收端的子处理器的数量,第一设定阈值为分配N个通信通道的通信带宽。In one implementation, the processor 501 is also used to detect the communication bandwidth between the receiving end and the sending end; and when the communication bandwidth is less than a first set threshold, reduce the number of sub-processors on the receiving end, the first setting The threshold is the communication bandwidth allocated to N communication channels.
在一种实施方式中,收发器502还用于向发送端发送第一反馈指令,第一反馈指令指示发送端减少配置子处理器的数量。In one implementation, the transceiver 502 is also configured to send a first feedback instruction to the sending end, and the first feedback instruction instructs the sending end to reduce the number of configured sub-processors.
在一种实施方式中,处理器501还用于检测接收端中的处理器的算力;以及当处理器的算力大于第二设定阈值时,减少接收端的子处理器的数量,第二设定阈值为处理器的算力不能配置N个子处理器的最小算力。In one implementation, the processor 501 is also configured to detect the computing power of the processor in the receiving end; and when the computing power of the processor is greater than the second set threshold, reduce the number of sub-processors at the receiving end, and the second Set the threshold to the minimum computing power of N sub-processors that cannot be configured by the processor's computing power.
在一种实施方式中,收发器502还用于向发送端发送第二反馈指令,第二反馈指令指示发送端减少配置子处理器的数量。In one implementation, the transceiver 502 is also configured to send a second feedback instruction to the sending end, and the second feedback instruction instructs the sending end to reduce the number of configured sub-processors.
本申请实施例中还提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述图2-图4和相应描述内容中记载的任一项方法。Embodiments of the present application also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the steps described in the above-mentioned Figures 2 to 4 and corresponding descriptions. Either method.
本申请实施例中还提供了一种计算机程序产品,所述计算机程序产品存储有指令,所述指令在由计算机执行时,使得所述计算机实施上述图2-图4和相应描述内容中记载的任一项方法。The embodiments of the present application also provide a computer program product. The computer program product stores instructions. When the instructions are executed by a computer, the computer implements the instructions described in the above-mentioned Figures 2 to 4 and corresponding descriptions. Either method.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.
此外,本申请实施例的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatiledisc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasableprogrammable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。另外,本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。Additionally, various aspects or features of embodiments of the present application may be implemented as methods, apparatus, or articles of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer-readable device, carrier or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (eg, hard disks, floppy disks, tapes, etc.), optical disks (eg, compact discs (CD), digital versatile discs (DVD), etc. ), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.). Additionally, the various storage media described herein may represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and/or carrying instructions and/or data.
在上述实施例中,图4中的数据传输400和图5中的数据传输500可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above embodiments, the data transmission 400 in Figure 4 and the data transmission 500 in Figure 5 can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, high-density digital video discs (DVD)), or semiconductor media (eg, solid state disks). ,SSD)), etc.
应当理解的是,在本申请实施例的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be The implementation process of the embodiments of this application does not constitute any limitations.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described 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 they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者接入网设备等)执行本申请实施例各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or an access network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. .
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。The above are only specific implementation modes of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person familiar with the technical field can easily implement the implementation within the technical scope disclosed in the embodiments of the present application. Any changes or substitutions that come to mind should be included in the protection scope of the embodiments of this application.
Claims (35)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210796060.3A CN117411891A (en) | 2022-07-07 | 2022-07-07 | A data transmission method, data transmission device and data transmission system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210796060.3A CN117411891A (en) | 2022-07-07 | 2022-07-07 | A data transmission method, data transmission device and data transmission system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117411891A true CN117411891A (en) | 2024-01-16 |
Family
ID=89493088
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210796060.3A Pending CN117411891A (en) | 2022-07-07 | 2022-07-07 | A data transmission method, data transmission device and data transmission system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117411891A (en) |
-
2022
- 2022-07-07 CN CN202210796060.3A patent/CN117411891A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10817460B2 (en) | RDMA data sending and receiving methods, electronic device, and readable storage medium | |
| US8279893B2 (en) | System and method for communicating data utilizing multiple types of data connections | |
| JP7625131B2 (en) | Signal processing method, signal processing device, electronic device, and storage medium | |
| CN109587732B (en) | A kind of transmission method and device of quality of service flow | |
| US9558718B2 (en) | Streaming video data in the graphics domain | |
| US11206574B2 (en) | Method and apparatus for data communication between MU and RU using multi-channel compression algorithm | |
| US20250261111A1 (en) | Link processing method, communication method, electronic device, and storage medium | |
| US11116037B2 (en) | Data transmission method and related product | |
| CN111130711A (en) | A method for determining the length of feedback response information and related products | |
| CN114666776A (en) | Data transmission method, apparatus, device and readable storage medium | |
| CN109644373B (en) | Data transmission method and related products | |
| CN113141520B (en) | Video stream transmission method and device, electronic equipment and storage medium | |
| US20140344486A1 (en) | Methods and apparatus for storing and delivering compressed data | |
| WO2021036189A1 (en) | Rdma data sending and receiving methods, electronic device and readable storage medium | |
| KR20250002572A (en) | Method and device for terminating the establishment of WLAN detection measurement, electronic devices and storage media | |
| CN117411891A (en) | A data transmission method, data transmission device and data transmission system | |
| US20250240705A1 (en) | Communication method and apparatus, and electronic device and storage medium | |
| CN117062034A (en) | Bluetooth data transmission method, device, equipment and storage medium | |
| US20250234378A1 (en) | Processing method for network allocation vector (nav) timer and related apparatus | |
| CN103167345A (en) | System and method for enabling audio and video to be transmitted to mobile phone to conduct real-time output playing based on Bluetooth | |
| US12314495B2 (en) | System and method for wireless input/output (IO) device input data packet payload compression for communication with wireless communication dongle | |
| CN114844607B (en) | Beacon frame transmitting method, device, storage medium and AP | |
| CN115462102B (en) | Data communication method and related device | |
| CN118473603B (en) | Weak network countermeasure method and related device | |
| EP4604433A1 (en) | Communication method, electronic device, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |