WO2017219557A1 - 数据传输方法及数据传输装置 - Google Patents

数据传输方法及数据传输装置 Download PDF

Info

Publication number
WO2017219557A1
WO2017219557A1 PCT/CN2016/102874 CN2016102874W WO2017219557A1 WO 2017219557 A1 WO2017219557 A1 WO 2017219557A1 CN 2016102874 W CN2016102874 W CN 2016102874W WO 2017219557 A1 WO2017219557 A1 WO 2017219557A1
Authority
WO
WIPO (PCT)
Prior art keywords
data transmission
file
small
transmitted
transmission channel
Prior art date
Application number
PCT/CN2016/102874
Other languages
English (en)
French (fr)
Inventor
魏泽涛
Original Assignee
乐视控股(北京)有限公司
乐视网信息技术(北京)股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视网信息技术(北京)股份有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017219557A1 publication Critical patent/WO2017219557A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/40Near-field transmission systems, e.g. inductive or capacitive transmission systems characterised by components specially adapted for near-field transmission
    • H04B5/48Transceivers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Definitions

  • the invention belongs to the field of communication and electronic technologies, and in particular relates to a data transmission method and a data transmission device.
  • small files are more and more common in practical applications, and files that are less than 1MB in size are usually referred to as small files.
  • files that are less than 1MB in size are usually referred to as small files.
  • small files For example, in the cloud photo album service, millions of images are uploaded to the storage server every day.
  • the thumbnails generated by these images are small files of KB level, in order to consider remote disaster recovery (build one or more in different regions). Set the same application or database, take the role of taking over immediately after the disaster) and the user's proximity to the problem, every day to synchronize millions of small files to the storage nodes of each region.
  • the solution of the prior art is to synchronously transmit small files one by one.
  • the transmission is through the TCP protocol, and a new TCP (Transmission Control Protocol) connection channel is established every synchronization, and is closed after the synchronization is completed. Because of the large number of small files, frequent establishment of closed TCP connections seriously affects transmission efficiency.
  • TCP Transmission Control Protocol
  • the inventor has found that at least the following problems exist in the prior art: the prior art generally adopts combining small files into one large file and then synchronizing to reduce the number of times the TCP connection is established and closed, but large file synchronization. Once it fails, the entire large file needs to be resynchronized, and this solution does not apply to networks with unstable environments.
  • Embodiments of the present invention provide a data transmission method and a data transmission device, which are intended to solve the present problem.
  • the embodiment of the invention provides a data transmission method, including:
  • the small files to be transferred are sequentially numbered;
  • the numbered small files to be transmitted are assembled according to a preset protocol format
  • the unreceived small file number is obtained, and the unreceived small file is retransmitted through the data transmission channel.
  • the assembling the numbered small file to be transmitted according to the preset protocol format includes:
  • the small files to be transmitted after the numbering are dynamically assembled according to the preset protocol format according to the numbering sequence;
  • the preset protocol format includes a protocol header and a protocol body, and the protocol header includes the small file to be transmitted after the numbering Meta-information and file number, the protocol body including all data of the small file to be transmitted.
  • the sending, after the assembly, the generated file by using the data transmission channel includes:
  • the assembled file is sent in a streaming manner through a TCP data transmission channel.
  • the method before the sequential numbering of the small files to be transmitted, the method further includes:
  • a number of TCP data transmission channels for data transmission are established according to the number of small files to be transmitted.
  • the embodiment of the invention further provides a data transmission method, including:
  • the file is split according to the preset protocol format to obtain a small file.
  • the receiving the file sent through the data transmission channel includes:
  • the splitting the file according to the preset protocol format to obtain a small file includes:
  • the protocol header includes meta information and a file number of the small file
  • the protocol body includes all data of the small file.
  • the splitting the file according to the preset protocol format to obtain a small file further includes:
  • the embodiment of the invention further provides a data transmission device, comprising:
  • a numbering unit for sequentially numbering small files to be transmitted
  • An assembly unit configured to assemble the numbered small files to be transmitted according to a preset protocol format
  • a sending unit configured to send the file generated after the assembly through the data transmission channel
  • the renewing unit obtains the unreceived small file number according to the received confirmation information, and resends the unreceived small file through the data transmission channel.
  • the assembly unit is specifically configured to:
  • the small files to be transmitted after the numbering are dynamically assembled according to the preset protocol format according to the numbering sequence;
  • the preset protocol format includes a protocol header and a protocol body, and the protocol header includes the small file to be transmitted after the numbering Meta-information and file number, the protocol body including all data of the small file to be transmitted.
  • the sending unit is specifically configured to:
  • the assembled file is sent in a streaming manner through a TCP data transmission channel.
  • the data transmission device further includes:
  • the establishing unit is configured to establish a plurality of TCP data transmission channels for data transmission according to the number of small files to be transmitted.
  • the embodiment of the invention further provides a data transmission device, comprising:
  • a receiving unit configured to receive a file sent through a data transmission channel
  • a splitting unit configured to split the file according to the preset protocol format to obtain a small file.
  • the receiving unit is specifically configured to:
  • the splitting unit is specifically configured to:
  • the data transmission device further includes:
  • a feedback unit configured to send an acknowledgement message to the sender device, so that the sender device performs a resume of the small file according to the determining message, where the acknowledgement message includes a file number of the split small file.
  • the embodiment of the invention provides a sender device, including:
  • the processor, the memory, and the communication interface complete communication with each other through the bus;
  • the communication interface is used for information transmission between the electronic device and the recipient device;
  • the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the following methods:
  • the small files to be transferred are sequentially numbered;
  • the numbered small files to be transmitted are assembled according to a preset protocol format
  • the unreceived small file number is obtained, and the unreceived small file is retransmitted through the data transmission channel.
  • Embodiments of the present invention provide a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, Cause the computer to perform the following methods:
  • the small files to be transferred are sequentially numbered;
  • the numbered small files to be transmitted are assembled according to a preset protocol format
  • the unreceived small file number is obtained, and the data is transmitted again.
  • the output channel sends a small file that was not received.
  • the small files to be transferred are sequentially numbered;
  • the numbered small files to be transmitted are assembled according to a preset protocol format
  • the unreceived small file number is obtained, and the unreceived small file is retransmitted through the data transmission channel.
  • An embodiment of the present invention provides a receiver device, including:
  • the processor, the memory, and the communication interface complete communication with each other through the bus;
  • the communication interface is used for information transmission between the electronic device and the sender device;
  • the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the following methods:
  • the file is split according to the preset protocol format to obtain a small file.
  • Embodiments of the present invention provide a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer is caused to perform the following method:
  • the file is split according to the preset protocol format to obtain a small file.
  • the file is split according to the preset protocol format to obtain a small file.
  • the small files to be transmitted are numbered, assembled according to a preset protocol format, and then sent to the receiving device, and the receiving device is split according to the received file according to the preset protocol format.
  • the small file solves the problem that the prior art frequently establishes a connection during the file transmission process.
  • the small files are sequentially numbered and then transmitted in a dynamic splicing manner, thereby solving the problem that a single channel is in an unstable network environment.
  • FIG. 1 is a flowchart of a data transmission manner according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic structural diagram of a preset protocol format according to Embodiment 1 of the present invention.
  • FIG. 3 is a flowchart of a data transmission manner according to Embodiment 2 of the present invention.
  • FIG. 4 is a flowchart of a data transmission manner according to Embodiment 3 of the present invention.
  • FIG. 5 is a flowchart of a data transmission manner according to Embodiment 4 of the present invention.
  • FIG. 6 is a schematic structural diagram of a data transmission apparatus according to Embodiment 5 of the present invention.
  • FIG. 7 is a schematic structural diagram of a data transmission apparatus according to Embodiment 6 of the present invention.
  • FIG. 8 is a schematic structural diagram of a data transmission apparatus according to Embodiment 7 of the present invention.
  • FIG. 9 is a schematic structural diagram of a data transmission apparatus according to Embodiment 8 of the present invention.
  • FIG. 10 is a schematic structural diagram of a sender device according to Embodiment 9 of the present invention.
  • FIG. 11 is a schematic structural diagram of a receiving method according to Embodiment 12 of the present invention.
  • FIG. 1 is a diagram showing a data transmission method according to Embodiment 1 of the present invention, which is applicable to file transmission, and includes:
  • the small files to be transmitted are sequentially numbered.
  • the small files to be transmitted are sequentially numbered, and each small file corresponds to a unique file number, and the small files to be transmitted are uniquely numbered, so as to be able to be According to the number, confirm whether the small file to be transmitted is successfully transmitted.
  • the numbered small files to be transmitted are assembled according to a preset protocol format.
  • the small files numbered in step S11 are dynamically assembled in the order of numbering, and the dynamic assembly means that the numbered small files are assembled without interruption according to the numbering order, and the assembled format is preset as shown in FIG. a protocol format, including a protocol header and a protocol body, the protocol header is a fixed length, including the meta information and the file number of the small file to be transmitted after the number, and the protocol body includes all the data of the small file to be transmitted,
  • the preset protocol format in FIG. 2 is assembled in order to enable the receiving device to obtain the information of the file generated after the assembly, and to obtain the small file to be transmitted after being split according to the preset protocol format.
  • the receiving party will feedback the confirmation information according to the received small file number.
  • the confirmation information includes the number of the small file received and saved by the receiving party, and the small file that has been sent. Confirm the small file number that was not successfully transmitted in the number, and then resend the small file that was not received through the data transmission channel.
  • the sender device numbers the 12 small files in order from 1 to 12, and groups them in groups of 3 according to the protocol format shown in FIG. 2.
  • Loading sending the assembled file to the receiving device through the first data transmission channel, and accepting the confirmation message fed back by the receiving device.
  • the first data transmission channel is abnormal, and the sender device receives the acknowledgement information of the small file numbered 1-6 sent by the receiver device through the first data transmission channel, and then from the second data transmission channel.
  • the sender device Upon receipt of the acknowledgment message sent by the recipient device that has received the small file numbered 7-9, the sender device will continue to transmit the small file numbered 10-12 from the second data transmission channel.
  • the data is transmitted to the receiver device via the data transmission channel, because the number uniqueness of the small file to be transmitted appears in the data transmission channel.
  • the small file that has not been successfully transmitted can be obtained from the acknowledgement information fed back by the receiver device, and the small file that has not been successfully transmitted is continuously transmitted through other data transmission channels.
  • This embodiment does not need to retransmit all the data transmission channel when the data transmission channel is abnormal. The small file only needs to resume the small file that has not been successfully transmitted, which avoids the problem of large file resynchronization caused by the abnormality of the data transmission channel in the prior art.
  • FIG. 3 shows a second embodiment provided by the present invention, before the sequential numbering of the small files to be transmitted includes:
  • a plurality of TCP data transmission channels for data transmission may be established according to the number of small files transmitted, and each TCP data transmission channel works independently, and multi-thread streaming can be realized.
  • the small files to be transmitted are assembled and spliced according to the preset protocol format, they are transmitted through the same TCP data transmission channel to form a streaming transmission channel.
  • a channel transmitted therein fails to transmit data, the transmission is small.
  • Files can be transferred over other TCP data transmission channels without affecting the small files that have been transferred. Because a plurality of TCP data transmission channels for data transmission are established, the stability of the data during transmission can be ensured, and the data transmission is not affected when an abnormality occurs.
  • the step S13 in the first embodiment specifically includes: transmitting the file generated after the assembly to the receiver device through the TCP data transmission channel in a streaming manner, and performing data transmission in a streaming manner, so as to ensure the assembled Statistics and save while the file is being transferred to the receiver device
  • the number of the transmitted small file is such that when a subsequent data transmission channel is abnormal, a small file that has not been successfully transmitted is searched from the number of the saved small file that has been transmitted.
  • FIG. 4 is a diagram showing a data transmission method according to a third embodiment of the present invention, which is applicable to file reception, and includes:
  • the receiving device receives the file sent through the TCP data transmission channel in a streaming manner, and the file sent through the data transmission is a file generated by assembling the small file after the numbering according to the preset protocol format.
  • the received file is dynamically split according to the preset protocol format to obtain a small file and saved.
  • Dynamic splitting means that the received file is continuously split, and the preset protocol format includes a protocol header. And a protocol body, the protocol header includes meta information and a file number of the small file, and the protocol body includes all data of the small file.
  • the present invention further provides a fourth embodiment as shown in FIG. 5, wherein the file is split according to the preset protocol format. To get a small file, it also includes:
  • the confirmation message is sent according to the number of the small file obtained by the splitting.
  • the specific operation process may be that each split obtains a small file, and the file number of the small file is followed. Sending an acknowledgment message to the sender device, where the acknowledgment message is used to indicate that the receiver device has successfully received the small file of the number, and the sender device can follow the acknowledgment message, when the original data transmission channel is abnormal and data transmission cannot be performed. , switching Another data transmission channel or when the original data transmission channel returns to normal, the small file is resumed according to the confirmation information. More specifically, in actual operation, the confirmation message may include number information of a single or multiple small files, which is not limited herein.
  • the receiving device receives the file transmitted through the first TCP data transmission channel in a streaming manner, and dynamically extracts the file according to a preset protocol format to obtain a small file, and assumes that the small file numbers that have been split are sequentially 11 12, 13, after the receiver device splits the small file numbered 11, it will send the confirmation message that the small file No. 11 has been received to the sender device, after splitting into the small file numbered 12 A confirmation message that the small file No. 12 has been received will be sent to the sender device.
  • the small file numbered 13 is split, the first TCP data transmission channel is abnormal, and the receiving device will pass the second TCP data transmission channel. Sending a confirmation message that the small file No.
  • the sender device After receiving the confirmation message of the small file number 13, the sender device will continue to transmit the small file number 14 to the receiving device through the second TCP data transmission channel.
  • the initial assembled file according to the preset protocol format.
  • the sender device When the first TCP data transmission channel returns to normal, the sender device will continue to perform file transmission through the first TCP data transmission channel according to the received confirmation information.
  • N TCP data transmission channels are first established, and each data transmission channel can independently perform data transmission according to the following policies:
  • the sender device numbers the small files in order, and dynamically assembles according to the preset protocol format, and writes the files generated by the assembly into the TCP data transmission channel in a streaming manner;
  • the receiving device receives the stream and dynamically splits the small file according to the preset protocol format. Each split successfully returns a small file to the sender device, and the confirmation message includes the file number of the small file. ;
  • the first embodiment presets a small file dynamic splicing stream transmission format as shown in FIG. 2, including a protocol header and a protocol body, wherein the protocol header is a fixed length, and the packet is Meta information and file number with small files; the protocol body includes all data for small files.
  • the problem of frequent connection establishment is solved by using a common TCP channel
  • the problem of easy terminal transmission in a network unstable environment is solved by using dynamic splicing streaming transmission
  • the embodiment supports multiple simultaneous establishments.
  • the channel carries out data transmission, which ensures the timeliness of transmission.
  • FIG. 6 shows a fifth embodiment of the present invention, a data transmission apparatus comprising:
  • the numbering unit 11 is for sequentially numbering small files to be transmitted. Specifically, according to the uniqueness of the number, the numbering unit 11 sequentially numbers the small files to be transmitted, and each small file corresponds to a unique one.
  • the assembling unit 12 is configured to assemble the numbered small files to be transmitted according to a preset protocol format. Specifically, the assembly unit 12 dynamically assembles the numbered small files in the order of numbering, and the assembled format is a preset protocol format as shown in FIG. 2, including a protocol header and a protocol body, and the protocol header is a fixed length, including the number. The meta information and the file number of the small file to be transmitted, the protocol body including all the data of the small file to be transmitted.
  • the sending unit 13 is configured to send the file generated after the assembly through the data transmission channel. Specifically, the sending unit 13 writes the file generated after dynamic assembly according to the preset protocol format into the TCP data transmission channel, and transmits the file to the receiving device through the TCP data transmission protocol in a streaming manner.
  • the resuming unit 14 is configured to obtain the unreceived small file number according to the received confirmation information, and resend the unreceived small file through the data transmission channel.
  • the data transmission is performed via the TCP data transmission channel, and the uniqueness of the small file to be transmitted can ensure that the receiving device confirms the received small file. .
  • FIG. 7 shows a sixth embodiment of the present invention
  • the data transmission apparatus further includes:
  • the establishing unit 15 is configured to establish a plurality of TCP data transmission channels for data transmission according to the number of small files to be transmitted.
  • the establishing unit 15 establishes a plurality of TCP data transmission channels for data transmission before performing data transmission, and each TCP data transmission channel works independently, and can implement multi-threaded streaming work, and at the same time, the small files to be transmitted are pre-processed. After the protocol format is assembled and spliced, The same TCP data transmission channel is transmitted to form a streaming transmission channel. When a channel is transmitted in a problem, the untransferred small file can be transmitted through other TCP data transmission channels without affecting the transmitted small file. . Because a plurality of TCP data transmission channels for data transmission are established, the stability of the data during transmission can be ensured, and the data transmission is not affected when an abnormality occurs.
  • FIG. 8 shows a seventh embodiment of the present invention, a data transmission apparatus comprising:
  • the receiving unit 21 is configured to receive the file sent through the data transmission channel. Specifically, the receiving unit 21 receives the file sent through the TCP data transmission channel in a streaming manner, and the file transmitted through the data transmission is a file generated by assembling the numbered small files according to a preset protocol format.
  • the splitting unit 22 is configured to split the file according to the preset protocol format to obtain a small file. Specifically, the splitting unit 22 dynamically splits the received file according to a preset protocol format to obtain a small file and saves the preset protocol format, including a protocol header and a protocol body, where the protocol header includes the small file. Meta information and file number, the protocol body including all data of the small file.
  • the present invention also provides an eighth embodiment as shown in FIG. 9 in order to avoid a data transmission failure caused by a transmission channel abnormality in the data transmission process.
  • the data transmission apparatus further includes:
  • the feedback unit 23 is configured to send an acknowledgement message to the sender device, so that the sender device performs a resume of the small file according to the determining message, where the acknowledgement message includes the file number of the split small file.
  • the feedback unit 23 sends a confirmation message according to the number of the small file obtained by the splitting.
  • the specific operation process may be to obtain a small file for each split, according to the small
  • the file number of the file sends an acknowledgment message to the sender device, where the acknowledgment message is used to indicate that the receiving unit 21 has successfully received the small file of the number, and simultaneously sends the file.
  • the sending device can follow the confirmation message to switch the another data transmission channel when the original data transmission channel is abnormal and cannot perform data transmission, or to resume the small file according to the confirmation information when the original data transmission channel is restored to normal.
  • the confirmation message may include number information of a single or multiple small files, which is not limited herein.
  • Figure 10 shows a sender device according to Embodiment 9 of the present invention, which includes: a processor 901, a memory 902, a communication interface 903, and a bus 904;
  • the processor 901, the memory 902, and the communication interface 903 complete communication with each other through the bus 904;
  • the communication interface 903 is used for information transmission between the sender device and the receiver device;
  • the processor 901 is configured to invoke the program instructions in the memory 902 to perform the methods provided by the foregoing method embodiments, for example, including: sequentially numbering small files to be transmitted; The small file is assembled according to the preset protocol format; the file generated after the assembly is sent through the data transmission channel; according to the received confirmation information, the unreceived small file number is obtained, and the unreceived small file is retransmitted through the data transmission channel.
  • a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer
  • the computer can perform the methods provided in the foregoing method embodiments, for example, including: sequentially numbering the small files to be transmitted; assembling the numbered small files to be transmitted according to a preset protocol format; Send the file generated after the assembly; according to the received confirmation information, obtain the unreceived small file number, and resend the unreceived small file through the data transmission channel.
  • a non-transitory computer readable storage medium according to Embodiment 11 of the present invention, the non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions cause the computer to execute the method provided by the foregoing method embodiments
  • the small files to be transmitted are sequentially numbered; the small files to be transmitted after being numbered are assembled according to a preset protocol format; The file generated after the assembly is sent through the data transmission channel; according to the received confirmation information, the unreceived small file number is obtained, and the unreceived small file is retransmitted through the data transmission channel.
  • FIG 11 shows a receiver device according to Embodiment 12 of the present invention, which includes: a processor 1201, a memory 1202, a communication interface 1203, and a bus 1204;
  • the processor 1201, the memory 1202, and the communication interface 1203 complete communication with each other through the bus 1204;
  • the communication interface 1203 is used for information transmission between the receiver device and the sender device;
  • the processor 1201 is configured to invoke the program instructions in the memory 1202 to perform the method provided by the foregoing method embodiments, for example, including: receiving a file sent through a data transmission channel; The file is split to get a small file.
  • a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer
  • the computer can perform the method provided by the foregoing method embodiments, for example, including: receiving a file sent through a data transmission channel; and splitting the file according to the preset protocol format to obtain a small file.
  • a non-transitory computer readable storage medium according to Embodiment 14 of the present invention, the non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions cause the computer to execute the method provided by the foregoing method embodiments For example, comprising: receiving a file sent through a data transmission channel; and splitting the file according to the preset protocol format to obtain a small file.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interface, device or module, and may be in an electrical, mechanical or other form.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)
  • Communication Control (AREA)

Abstract

本发明属于通信及电子技术领域,公开了一种数据传输方法及数据传输装置,包括:对待传输的小文件进行顺序编号;将编号后的所述待传输的小文件按照预置协议格式进行组装;通过数据传输通道发送组装后生成的文件;根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。本发明通过将待传输的小文件进行编号,按照预置协议格式进行组装后发送至接收方设备,接收方设备根据接收到的文件按照预置协议格式进行拆分后得到小文件,解决了现有技术在文件传输过程中频繁建立连接的问题,同时将小文件进行顺序编号后用动态拼接方式进行传输,解决了单个通道在网络不稳定环境下的问题。

Description

数据传输方法及数据传输装置
交叉引用
本申请引用于2016年6月24日提交的专利名称为“数据传输方法及数据传输装置”的第201610474349.8号中国专利申请,其通过引用被全部并入本申请。
技术领域
本发明属于通信及电子技术领域,尤其涉及一种数据传输方法和数据传输装置。
背景技术
目前在实际应用中小文件越来越常见,通常将大小在1MB以内的文件称为小文件。例如在云相册服务中,每天都有几百万张图片上传至存储服务器,这些图片生成的缩略图都是KB级别的小文件,为了考虑异地灾备(在不同的地域,构建一套或者多套相同的应用或者数据库,起到灾难后立刻接管的作用)及用户就近访问的问题,每天要将数百万的小文件同步至各个地域的存储节点。
现有技术的解决方案是将小文件逐个进行同步传输,传输是通过TCP协议,每次同步都要建立新TCP(Transmission Control Protocol)连接通道,同步完成后就关闭。因为是大量的小文件,频繁的建立关闭TCP连接严重影响传输效率。
发明人在实现本发明的过程中,发现现有技术至少存在一下问题:现有技术普遍采用将小文件合并成一个大文件后再进行同步,来减少TCP连接建立关闭的次数,但大文件同步一旦失败,整个大文件都需要重新同步,此方案也不适用于网络不稳定的环境。
发明内容
本发明实施例提供了一种数据传输方法和数据传输装置,旨在解决现 有技术将小文件合并成一个大文件后再进行同步,但大文件同步一旦失败,整个大文件都需要重新同步的问题。
本发明实施例提供了一种数据传输方法,包括:
对待传输的小文件进行顺序编号;
将编号后的所述待传输的小文件按照预置协议格式进行组装;
通过数据传输通道发送组装后生成的文件;
根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
可选地,所述将编号后的所述待传输的小文件按照预置协议格式进行组装包括:
根据编号顺序将编号后待传输的小文件按照预置协议格式进行动态组装;所述预置协议格式包括协议头和协议体,所述协议头包括所述编号后的所述待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据。
可选地,所述通过数据传输通道发送组装后生成的文件包括:
通过TCP数据传输通道以流式的方式发送组装后生成的文件。
可选地,所述对待传输的小文件进行顺序编号之前还包括:
根据待传输的小文件数量,建立若干用于数据传输的TCP数据传输通道。
本发明实施例还提供了一种数据传输方法,包括:
接收通过数据传输通道发送的文件;
按照所述预置协议格式对所述文件进行拆分,以得到小文件。
可选地,所述接收通过数据传输通道发送的文件包括:
以流式的方式接收通过TCP数据传输通道发送的文件。
可选地,所述按照所述预置协议格式对所述文件进行拆分,以得到小文件包括:
按照预置协议格式对所述通过数据传输通道发送的文件进行动态拆分,以得到小文件并保存;所述预置协议格式包括协议头和协议体,所述 协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
可选地,所述按照所述预置协议格式对所述文件进行拆分,以得到小文件之后还包括:
向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
本发明实施例还提供了一种数据传输装置,包括:
编号单元,用于对待传输的小文件进行顺序编号;
组装单元,用于将编号后的所述待传输的小文件,按照预置协议格式进行组装;
发送单元,用于通过数据传输通道发送组装后生成的文件;
续传单元,根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
可选地,所述组装单元具体用于:
根据编号顺序将编号后待传输的小文件按照预置协议格式进行动态组装;所述预置协议格式包括协议头和协议体,所述协议头包括所述编号后的所述待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据。
可选地,所述发送单元具体用于:
通过TCP数据传输通道以流式的方式发送组装后生成的文件。
可选地,所述数据传输装置还包括:
建立单元,用于根据待传输的小文件数量,建立若干用于数据传输的TCP数据传输通道。
本发明实施例还提供了一种数据传输装置,包括:
接收单元,用于接收通过数据传输通道发送的文件;
拆分单元,用于按照所述预置协议格式对所述文件进行拆分,以得到小文件。
可选地,所述接收单元具体用于:
以流式的方式接收通过TCP数据传输通道发送的文件。
可选地,所述拆分单元具体用于:
按照预置协议格式对所述通过数据传输通道发送的文件进行动态拆分,以得到小文件并保存;所述预置协议格式包括协议头和协议体,所述协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
可选地,所述数据传输装置还包括:
反馈单元,用于向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
本发明实施例提供一种发送方设备,包括:
处理器、存储器、通信接口和总线;其中,
所述处理器、存储器、通信接口通过所述总线完成相互间的通信;
所述通信接口用于该电子设备与接收方设备之间的信息传输;
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如下方法:
对待传输的小文件进行顺序编号;
将编号后的所述待传输的小文件按照预置协议格式进行组装;
通过数据传输通道发送组装后生成的文件;
根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
本发明实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行以下方法:
对待传输的小文件进行顺序编号;
将编号后的所述待传输的小文件按照预置协议格式进行组装;
通过数据传输通道发送组装后生成的文件;
根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传 输通道发送未接收到的小文件。
本发明实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如下方法:
对待传输的小文件进行顺序编号;
将编号后的所述待传输的小文件按照预置协议格式进行组装;
通过数据传输通道发送组装后生成的文件;
根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
本发明实施例提供一种接收方设备,包括:
处理器、存储器、通信接口和总线;其中,
所述处理器、存储器、通信接口通过所述总线完成相互间的通信;
所述通信接口用于该电子设备与发送方设备之间的信息传输;
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如下方法:
接收通过数据传输通道发送的文件;
按照所述预置协议格式对所述文件进行拆分,以得到小文件。
本发明实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如下方法:
接收通过数据传输通道发送的文件;
按照所述预置协议格式对所述文件进行拆分,以得到小文件。
本发明实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如下方法:
接收通过数据传输通道发送的文件;
按照所述预置协议格式对所述文件进行拆分,以得到小文件。
从上述本发明实施例可知,通过将待传输的小文件进行编号,按照预置协议格式进行组装后发送至接收方设备,接收方设备根据接收到的文件按照预置协议格式进行拆分后得到小文件,解决了现有技术在文件传输过程中频繁建立连接的问题,同时将小文件进行顺序编号后用动态拼接方式进行传输,解决了单个通道在网络不稳定环境下的问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例一提供的一种数据传输方式的流程图。
图2为本发明实施例一提供的预置协议格式的结构示意图。
图3为本发明实施例二提供的一种数据传输方式的流程图。
图4为本发明实施例三提供的一种数据传输方式的流程图。
图5为本发明实施例四提供的一种数据传输方式的流程图。
图6为本发明实施例五提供的一种数据传输装置的结构示意图。
图7为本发明实施例六提供的一种数据传输装置的结构示意图。
图8为本发明实施例七提供的一种数据传输装置的结构示意图。
图9为本发明实施例八提供的一种数据传输装置的结构示意图;
图10为本发明实施例九提供的一种发送方设备的结构示意图;
图11为本发明实施例十二提供的一种接收方法的结构示意图。
具体实施方式
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而非全 部实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1示出了本发明实施例一提供的一种数据传输方法,适用于文件传输,包括:
S11,对待传输的小文件进行顺序编号。
在本步骤中,按照编号的唯一性,对待传输的小文件进行顺序编号,每一小文件对应唯一的一个文件编号,将待传输的小文件进行唯一性的编号,是为了在后续过程中能够根据该编号确认待传输的小文件是否传输成功。
S12,将编号后的所述待传输的小文件,按照预置协议格式进行组装。
本步骤中,将步骤S11中已编号的小文件按照编号顺序进行动态组装,动态组装意为将已编号的小文件按照编号顺序不间断地进行组装,组装的格式如图2所示的预置协议格式,包括协议头和协议体,协议头为固定长度,包括所述编号后待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据,以图2中的预置协议格式进行组装,是为了能够使接收方设备获取组装后生成的文件的信息,并按照预置协议格式进行拆分后获取待传输的小文件。
S13,通过数据传输通道发送组装后生成的文件。
S14,根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件.
接收方会根据接收的小文件编号反馈确认信息,本步骤中,根据接收方反馈的确认信息,所述确认信息会包含有接收方接收并保存起来的小文件的编号,在已发送的小文件编号中确认未传输成功的小文件编号,然后重新通过数据传输通道发送未接收到的小文件。
下面通过一具体使用例来对本实施例进行进一步地阐述:
现需要传输12个小文件,发送方设备将该12个小文件按照顺序,从1至12进行编号,并按照图2所示的协议格式,以3个文件为一组进行组 装,将组装后的文件通过第一数据传输通道发送给接收方设备,并接受接收方设备反馈的确认消息。在传输过程中,第一数据传输通道发生异常,发送方设备通过第一数据传输通道接收到接收方设备发送的已接收到编号1-6的小文件的确认信息后,从第二数据传输通道接收到接收方设备发送的已接受到编号7-9的小文件的确认消息,则发送方设备将从第二数据传输通道开始续传编号10-12的小文件。
在本实施例中,通过将待传输的小文件进行编号并按照预置协议格式进行组装后,经数据传输通道传输给接收方设备,因为待传输小文件的编号唯一性,在数据传输通道出现异常时,能够从接收方设备反馈的确认信息获知未传输成功的小文件,并通过其他数据传输通道续传该未传输成功的小文件,本实施例不需要在数据传输通道异常时重新传输全部的小文件,只需要续传未传输成功的小文件,避免了现有技术中因为数据传输通道异常而导致大文件重新同步的问题。
图3示出了本发明提供给的第二实施例,所述对待传输的小文件进行顺序编号之前还包括:
S01,建立若干个TCP数据传输通道,每一所述TCP数据传输通道用于进行数据传输。
本步骤中,在进行数据传输之前,可以根据传输的小文件的数量,建立若干用于进行数据传输的TCP数据传输通道,每一TCP数据传输通道独立工作,可以实现多线程流式工作,同时,待传输的小文件按照预置协议格式组装拼接后,通过同一TCP数据传输通道进行传输,形成一个流式的传输通道,当其中传输的一个通道出现问题无法进行数据传输时,未传输的小文件可以通过其他TCP数据传输通道进行传输,不会影响已传输的小文件。因为建立了多个用于数据传输的TCP数据传输通道,能够保证数据在传输过程中的稳定性,在出现异常时不影响数据传输。
则第一实施例中的步骤S13具体包括:以流式的方式通过TCP数据传输通道将组装后生成的文件发送给接收方设备,以流式的方式进行数据传输,是为了保证将组装后的文件传输给接收方设备的同时,统计并保存 该已传输的小文件的编号,保证在后续出现数据传输通道异常时,从保存的已传输的小文件的编号中查找未传输成功的小文件。
图4示出了本发明第三实施例提供的一种数据传输方法,适用于文件接收,包括:
S21,接收通过数据传输通道发送的文件。
本步骤中,接收方设备以流式的方式接收通过TCP数据传输通道发送的文件,所述通过数据传输发送的文件为进行编号后的小文件按照预置协议格式进行组装起来生成的文件。
S22,按照所述预置协议格式对所述文件进行拆分,以得到小文件。
本步骤中,按照预置协议格式将接收到的文件进行动态拆分,以得到小文件并保存,动态拆分意为将接收到的文件进行不间断的拆分,预置协议格式包括协议头和协议体,所述协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
通过按照预置协议格式对接收的文件进行动态拆分,不仅能够获得小文件所有的数据,同时还能够根据小文件的编号进行下一步的操作,如根据拆分得到的编号确定未传输的小文件编号等。
为了避免在数据传输过程中出现传输通道异常而导致数据传输失败,本发明还提供了如图5所示的第四实施例,所述按照所述预置协议格式对所述文件进行拆分,以得到小文件之后还包括:
S23,向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
在本步骤中,接收方设备进行拆分得到小文件后,根据拆分得到小文件的编号发送确认消息,具体的操作过程可以是每拆分得到一个小文件,就按照该小文件的文件编号向发送方设备发送确认消息,所述确认消息用以表示接收方设备已成功接收到该编号的小文件,同时发送方设备能够按照所述确认消息,在原数据传输通道出现异常无法进行数据传输时,切换 另一数据传输通道或者在原数据传输通道恢复正常时,按照该确认信息进行小文件的续传。更具体地,在实际操作中,确认消息可以包括单个或者多个小文件的编号信息,此处不做限定。
下面通过一具体使用例进行进一步地阐述:
接收方设备以流式的方式接收经第一TCP数据传输通道传输的文件,按照预置协议格式对所述文件进行动态拆分后获得小文件,假设已经拆分得到的小文件编号依次为11、12、13,则接收方设备在拆分到编号为11的小文件后,将向发送方设备发送已接收到11号小文件的确认信息,在拆分到编号为12号的小文件后将向发送方设备发送已接收到12号小文件的确认消息,在拆分得到编号为13号的小文件时,第一TCP数据传输通道异常,则接收方设备将通过第二TCP数据传输通道向发送方设备发送已接收到13号小文件的确认消息,发送方设备在接收到13号小文件的确认消息后,将通过第二TCP数据传输通道向接收方设备继续传输以14号小文件开始的按照所述预置协议格式组装后的文件。当第一TCP数据传输通道恢复正常时,发送方设备将按照接收到的确认信息继续通过第一TCP数据传输通道进行文件传输。
本发明实施例提供的上述数据传输方法中,首先建立N个TCP数据传输通道,每个数据传输通道均能够独立地按照以下策略进行数据传输:
1:发送方设备按照顺序将小文件进行编号,并按照预置协议格式进行动态组装,将组装生成的文件以流式的方式写入TCP数据传输通道;
2:接收方设备以流式进行接收,并参照预置协议格式进行动态拆分出小文件,每拆分成功一个小文件则向发送方设备回复一个确认信息,确认消息包含小文件的文件编号;
3:如果TCP数据传输通道异常中断,发送方设备根据最近一次收到的文件编号,来进行续传,影响较小。
本实施例在进行数据传输之前,首先预置了如图2所示的小文件动态拼接流式的传输格式,包括协议头和协议体,其中协议头为固定长度,包 含小文件的元信息和文件编号;协议体则包括了小文件的所有数据。本实施例通过公用TCP通道,解决了频繁建立连接的问题,而使用动态拼接流式传输,解决了单个通道在网络不稳定环境下,容易终端传输的问题,同时本实施例支持同时建立多个通道进行数据传输,保证了传输的时效性。
图6示出了本发明提供的第五实施例,一种数据传输装置,包括:
编号单元11,用于对待传输的小文件进行顺序编号。具体地,按照编号的唯一性,编号单元11对待传输的小文件进行顺序编号,每一小文件对应唯一的一个文件编号。
组装单元12,用于将编号后的所述待传输的小文件,按照预置协议格式进行组装。具体地,组装单元12将已编号的小文件按照编号顺序进行动态组装,组装的格式如图2所示的预置协议格式,包括协议头和协议体,协议头为固定长度,包括所述编号后待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据。
发送单元13,用于通过数据传输通道发送组装后生成的文件。具体地,发送单元13将按照预置协议格式进行动态组装后生成的文件写入TCP传数据输通道中,以流式的方式通过TCP数据传输协议传输至接收方设备。
续传单元14,用于根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件
通过将待传输的小文件进行编号并按照预置协议格式进行组装后,经TCP数据传输通道进行数据传输,因为待传输小文件的唯一性,能够保证接收方设备对所接收的小文件进行确认。
图7示出了本发明提供的第六实施例,所述数据传输装置还包括:
建立单元15,用于根据待传输的小文件数量,建立若干用于数据传输的TCP数据传输通道。
具体地,建立单元15在进行数据传输之前建立若干用于进行数据传输的TCP数据传输通道,每一TCP数据传输通道独立工作,可以实现多线程流式工作,同时,待传输的小文件按照预置协议格式组装拼接后,通 过同一TCP数据传输通道进行传输,形成一个流式的传输通道,当其中传输的一个通道出现问题时,未传输的小文件可以通过其他TCP数据传输通道进行传输,不会影响已传输的小文件。因为建立了多个用于数据传输的TCP数据传输通道,能够保证数据在传输过程中的稳定性,在出现异常时不影响数据传输。
图8示出了本发明提供的第七实施例,一种数据传输装置,包括:
接收单元21,用于接收通过数据传输通道发送的文件。具体地,接收单元21以流式的方式接收通过TCP数据传输通道发送的文件,所述通过数据传输发送的文件为进行编号后的小文件按照预置协议格式进行组装起来生成的文件。
拆分单元22,用于按照所述预置协议格式对所述文件进行拆分,以得到小文件。具体地,拆分单元22按照预置协议格式将接收到的文件进行动态拆分,以得到小文件并保存,预置协议格式包括协议头和协议体,所述协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
通过按照预置协议格式对接收的文件进行动态拆分,不仅能够获得小文件所有的数据,同时还能够根据小文件的编号进行下一步的操作,如根据拆分得到的编号确定未传输的小文件编号等。
为了避免在数据传输过程中出现传输通道异常而导致数据传输失败,本发明还提供了如图9所示的第八实施例,所述数据传输装置还包括:
反馈单元23,用于向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
在本步骤中,拆分单元22进行拆分得到小文件后,反馈单元23根据拆分得到小文件的编号发送确认消息,具体的操作过程可以是每拆分得到一个小文件,就按照该小文件的文件编号向发送方设备发送确认消息,所述确认消息用以表示接收单元21已成功接收到该编号的小文件,同时发 送方设备能够按照所述确认消息,在原数据传输通道出现异常无法进行数据传输时,切换另一数据传输通道或者在原数据传输通道恢复正常时,按照该确认信息进行小文件的续传。更具体地,在实际操作中,确认消息可以包括单个或者多个小文件的编号信息,此处不做限定。
图10示出了本发明实施例9提供的发送方设备,其包括:处理器(processor)901、存储器(memory)902、通信接口(Communications Interface)903和总线904;
其中,
所述处理器901、存储器902、通信接口903通过所述总线904完成相互间的通信;
所述通信接口903用于该发送方设备与接收方设备之间的信息传输;
所述处理器901用于调用所述存储器902中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:对待传输的小文件进行顺序编号;将编号后的所述待传输的小文件按照预置协议格式进行组装;通过数据传输通道发送组装后生成的文件;根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
本发明实施例10提供的一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:对待传输的小文件进行顺序编号;将编号后的所述待传输的小文件按照预置协议格式进行组装;通过数据传输通道发送组装后生成的文件;根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
本发明实施例11提供的一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:对待传输的小文件进行顺序编号;将编号后的所述待传输的小文件按照预置协议格式进行组装;通 过数据传输通道发送组装后生成的文件;根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
图11示出了本发明实施例12提供的接收方设备,其包括:处理器(processor)1201、存储器(memory)1202、通信接口(Communications Interface)1203和总线1204;
其中,
所述处理器1201、存储器1202、通信接口1203通过所述总线1204完成相互间的通信;
所述通信接口1203用于该接收方设备与发送方设备之间的信息传输;
所述处理器1201用于调用所述存储器1202中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:接收通过数据传输通道发送的文件;按照所述预置协议格式对所述文件进行拆分,以得到小文件。
本发明实施例13提供的一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:接收通过数据传输通道发送的文件;按照所述预置协议格式对所述文件进行拆分,以得到小文件。
本发明实施例14提供的一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:接收通过数据传输通道发送的文件;按照所述预置协议格式对所述文件进行拆分,以得到小文件。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之 间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本发明所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
以上为对本发明所提供的数据传输方法和数据传输装置的描述,对于 本领域的技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。

Claims (22)

  1. 一种数据传输方法,其特征在于,所述数据传输方法包括:
    对待传输的小文件进行顺序编号;
    将编号后的所述待传输的小文件按照预置协议格式进行组装;
    通过数据传输通道发送组装后生成的文件;
    根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
  2. 如权利要求1所述的数据传输方法,其特征在于,所述将编号后的所述待传输的小文件按照预置协议格式进行组装包括:
    根据编号顺序将编号后待传输的小文件按照预置协议格式进行动态组装;所述预置协议格式包括协议头和协议体,所述协议头包括所述编号后的所述待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据。
  3. 如权利要求1所述的数据传输方法,其特征在于,所述通过数据传输通道发送组装后生成的文件包括:
    通过TCP数据传输通道以流式的方式发送组装后生成的文件。
  4. 如权利要求1所述的数据传输方法,其特征在于,所述对待传输的小文件进行顺序编号之前还包括:
    根据待传输的小文件数量,建立若干用于数据传输的TCP数据传输通道。
  5. 一种数据传输方法,其特征在于,所述数据传输方法包括:
    接收通过数据传输通道发送的文件;
    按照所述预置协议格式对所述文件进行拆分,以得到小文件。
  6. 如权利要求5所述的数据传输方法,其特征在于,所述接收通过数据传输通道发送的文件包括:
    以流式的方式接收通过TCP数据传输通道发送的文件。
  7. 如权利要求5所述的数据传输方法,其特征在于,所述按照所述预置协议格式对所述文件进行拆分,以得到小文件包括:
    按照预置协议格式对所述通过数据传输通道发送的文件进行动态拆分,以得到小文件并保存;所述预置协议格式包括协议头和协议体,所述协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
  8. 如权利要求5所述的数据传输方法,其特征在于,所述按照所述预置协议格式对所述文件进行拆分,以得到小文件之后还包括:
    向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
  9. 一种数据传输装置,其特征在于,所述数据传输装置包括:
    编号单元,用于对待传输的小文件进行顺序编号;
    组装单元,用于将编号后的所述待传输的小文件,按照预置协议格式进行组装;
    发送单元,用于通过数据传输通道发送组装后生成的文件;
    续传单元,用于根据接收的确认信息,获取未接收到的小文件编号,重新通过数据传输通道发送未接收到的小文件。
  10. 如权利要求9所述的数据传输装置,其特征在于,所述组装单元具体用于:
    根据编号顺序将编号后待传输的小文件按照预置协议格式进行动态组装;所述预置协议格式包括协议头和协议体,所述协议头包括所述编号后的所述待传输的小文件的元信息和文件编号,所述协议体包括所述待传输的小文件的所有数据。
  11. 如权利要求9所述的数据传输装置,其特征在于,所述发送单元具体用于:
    通过TCP数据传输通道以流式的方式发送组装后生成的文件。
  12. 如权利要求9所述的数据传输装置,其特征在于,所述数据传输 装置还包括:
    建立单元,用于根据待传输的小文件数量,建立若干用于数据传输的TCP数据传输通道。
  13. 一种数据传输装置,其特征在于,所述数据传输装置包括:
    接收单元,用于接收通过数据传输通道发送的文件;
    拆分单元,用于按照所述预置协议格式对所述文件进行拆分,以得到小文件。
  14. 如权利要求13所述的数据传输装置,其特征在于,所述接收单元具体用于:
    以流式的方式接收通过TCP数据传输通道发送的文件。
  15. 如权利要求13所述的数据传输方法,其特征在于,所述拆分单元具体用于:
    按照预置协议格式对所述通过数据传输通道发送的文件进行动态拆分,以得到小文件并保存;所述预置协议格式包括协议头和协议体,所述协议头包括所述小文件的元信息和文件编号,所述协议体包括所述小文件的所有数据。
  16. 如权利要求13所述的数据传输装置,其特征在于,所述数据传输装置还包括:
    反馈单元,用于向发送方设备发送确认消息,以使所述发送方设备根据所述确定消息进行小文件的续传,所述确认消息包括已拆分得到的小文件的文件编号。
  17. 一种发送方设备,包括:
    处理器、存储器、通信接口和总线;其中,
    所述处理器、存储器、通信接口通过所述总线完成相互间的通信;
    所述通信接口用于该电子设备与接收方设备之间的信息传输;
    所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求1至4任一所述的方法。
  18. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存 储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如权利要求1至4任一所述的方法。
  19. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如权利要求1至4任一所述的方法。
  20. 一种接收方设备,包括:
    处理器、存储器、通信接口和总线;其中,
    所述处理器、存储器、通信接口通过所述总线完成相互间的通信;
    所述通信接口用于该电子设备与发送方设备之间的信息传输;
    所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求5至8任一所述的方法。
  21. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如权利要求5至8任一所述的方法。
  22. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如权利要求5至8任一所述的方法。
PCT/CN2016/102874 2016-06-24 2016-10-21 数据传输方法及数据传输装置 WO2017219557A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610474349.8 2016-06-24
CN201610474349.8A CN105959298A (zh) 2016-06-24 2016-06-24 数据传输方法及数据传输装置

Publications (1)

Publication Number Publication Date
WO2017219557A1 true WO2017219557A1 (zh) 2017-12-28

Family

ID=56904944

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102874 WO2017219557A1 (zh) 2016-06-24 2016-10-21 数据传输方法及数据传输装置

Country Status (2)

Country Link
CN (1) CN105959298A (zh)
WO (1) WO2017219557A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110035016A (zh) * 2019-02-26 2019-07-19 北京钰安信息科技有限公司 一种数据传输方法及装置
CN110224794A (zh) * 2019-06-28 2019-09-10 阳光电源股份有限公司 通信数据传输方法及系统
CN111212136A (zh) * 2019-12-31 2020-05-29 北京力控华康科技有限公司 一种基于Modbus协议的数据缓存方法、装置、系统及存储介质
CN112308824A (zh) * 2020-10-21 2021-02-02 中国铁道科学研究院集团有限公司 基于轨道几何检测数据的曲线半径分类识别方法及装置
CN113364880A (zh) * 2021-06-18 2021-09-07 国家电网有限公司华东分部 信息交换方法、系统、电子设备及存储介质
CN113609070A (zh) * 2021-07-28 2021-11-05 中国铁道科学研究院集团有限公司 铁路线路动态检测数据协同采集方法、装置及系统
CN113795015A (zh) * 2021-08-17 2021-12-14 咪咕文化科技有限公司 数据传输方法、装置、设备及计算可读存储介质
CN113885802A (zh) * 2021-09-30 2022-01-04 杭州贝嘟科技有限公司 数据传输方法、装置、电子装置和存储介质
CN114095492A (zh) * 2021-11-16 2022-02-25 许昌许继软件技术有限公司 一种电力系统主子站数据传输方法、系统及电子设备
CN116405094A (zh) * 2023-04-14 2023-07-07 北京蔚海明祥科技有限公司 一种基于多路天通通信设备的数据传输系统及方法

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959298A (zh) * 2016-06-24 2016-09-21 乐视控股(北京)有限公司 数据传输方法及数据传输装置
CN108322836A (zh) * 2018-01-24 2018-07-24 北京奇艺世纪科技有限公司 一种数据传输的方法及装置
CN108200201B (zh) * 2018-02-06 2023-10-10 中国科学院西安光学精密机械研究所 一种水下设备密封舱数据导出方法及传输系统
CN108804290B (zh) * 2018-06-13 2022-03-18 姜锋 一种用于移动存储设备信息传输安全的方法及系统
CN109167750B (zh) * 2018-07-06 2021-06-18 北京金山安全软件有限公司 一种数据包传输方法、装置、电子设备及存储介质
CN111835712A (zh) * 2020-06-01 2020-10-27 北京百卓网络技术有限公司 一种数据传输方法、装置、系统、设备及存储介质
CN113206852B (zh) * 2021-05-06 2023-03-24 深信服科技股份有限公司 一种安全防护方法、装置、设备及存储介质
CN113934553B (zh) * 2021-10-14 2024-10-01 西安万像电子科技有限公司 一种剪切板重定向传输方法、装置、存储介质及电子设备
CN114172889B (zh) * 2021-10-18 2024-03-22 江苏赞奇科技股份有限公司 一种实时渲染中小文件高效传输方法及系统
CN114629891A (zh) * 2021-12-17 2022-06-14 亚信科技(中国)有限公司 文件传输方法、装置、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660308A (zh) * 2015-01-26 2015-05-27 武汉健坤科技有限公司 基于蓝牙低功耗技术的文件传输方法和系统
CN104753856A (zh) * 2013-12-26 2015-07-01 北京东方通科技股份有限公司 一种文件收发方法与系统
CN104967663A (zh) * 2015-05-12 2015-10-07 无锡天脉聚源传媒科技有限公司 一种文件传输方法及系统、文件发送装置与文件接收装置
CN105959298A (zh) * 2016-06-24 2016-09-21 乐视控股(北京)有限公司 数据传输方法及数据传输装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286976A (zh) * 2008-05-08 2008-10-15 蒋一 一种基于数据拆分技术实现p2p流媒体系统的方法
US20130294299A1 (en) * 2011-01-21 2013-11-07 Pantech Co., Tld Method and apparatus for processing a harq ack/nack signal
CN103873155A (zh) * 2012-12-13 2014-06-18 联想(北京)有限公司 数据传送方法、数据接收方法以及电子设备
CN103916852B (zh) * 2012-12-28 2018-04-27 联想(北京)有限公司 一种数据传输方法以及一种移动终端
CN105245470B (zh) * 2015-11-05 2019-05-17 深圳市网心科技有限公司 一种数据传输方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104753856A (zh) * 2013-12-26 2015-07-01 北京东方通科技股份有限公司 一种文件收发方法与系统
CN104660308A (zh) * 2015-01-26 2015-05-27 武汉健坤科技有限公司 基于蓝牙低功耗技术的文件传输方法和系统
CN104967663A (zh) * 2015-05-12 2015-10-07 无锡天脉聚源传媒科技有限公司 一种文件传输方法及系统、文件发送装置与文件接收装置
CN105959298A (zh) * 2016-06-24 2016-09-21 乐视控股(北京)有限公司 数据传输方法及数据传输装置

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110035016A (zh) * 2019-02-26 2019-07-19 北京钰安信息科技有限公司 一种数据传输方法及装置
CN110035016B (zh) * 2019-02-26 2023-03-10 北京钰安信息科技有限公司 一种数据传输方法及装置
CN110224794A (zh) * 2019-06-28 2019-09-10 阳光电源股份有限公司 通信数据传输方法及系统
CN111212136A (zh) * 2019-12-31 2020-05-29 北京力控华康科技有限公司 一种基于Modbus协议的数据缓存方法、装置、系统及存储介质
CN112308824B (zh) * 2020-10-21 2023-01-20 中国铁道科学研究院集团有限公司 基于轨道几何检测数据的曲线半径分类识别方法及装置
CN112308824A (zh) * 2020-10-21 2021-02-02 中国铁道科学研究院集团有限公司 基于轨道几何检测数据的曲线半径分类识别方法及装置
CN113364880A (zh) * 2021-06-18 2021-09-07 国家电网有限公司华东分部 信息交换方法、系统、电子设备及存储介质
CN113609070A (zh) * 2021-07-28 2021-11-05 中国铁道科学研究院集团有限公司 铁路线路动态检测数据协同采集方法、装置及系统
CN113609070B (zh) * 2021-07-28 2023-01-24 中国国家铁路集团有限公司 铁路线路动态检测数据协同采集方法、装置及系统
CN113795015A (zh) * 2021-08-17 2021-12-14 咪咕文化科技有限公司 数据传输方法、装置、设备及计算可读存储介质
CN113795015B (zh) * 2021-08-17 2023-10-20 咪咕文化科技有限公司 数据传输方法、装置、设备及计算可读存储介质
CN113885802A (zh) * 2021-09-30 2022-01-04 杭州贝嘟科技有限公司 数据传输方法、装置、电子装置和存储介质
CN114095492A (zh) * 2021-11-16 2022-02-25 许昌许继软件技术有限公司 一种电力系统主子站数据传输方法、系统及电子设备
CN116405094A (zh) * 2023-04-14 2023-07-07 北京蔚海明祥科技有限公司 一种基于多路天通通信设备的数据传输系统及方法

Also Published As

Publication number Publication date
CN105959298A (zh) 2016-09-21

Similar Documents

Publication Publication Date Title
WO2017219557A1 (zh) 数据传输方法及数据传输装置
CN106330414B (zh) 一种报文传输方法及装置
EP1562344B1 (en) Data receiving apparatus and data receiving method
CN110032478B (zh) 一种主备中心数据实时同步方法、装置、系统及存储介质
CN111385268B (zh) 一种数据包头压缩确认方法及通信设备
CN102780712B (zh) 会话的切换方法及装置
JP7185054B2 (ja) リソース周期構成方法およびデバイス、リンク処理および確立方法およびデバイス
US6515994B1 (en) Method of communication in a communications network and apparatus therefor
CN107529229B (zh) 数据传输的方法,装置及系统
WO2011015020A1 (zh) 文件传输方法、系统及客户端
CN109842567B (zh) 数据分发方法以及分发服务器
US9936016B2 (en) Synchronized collaborative user interface
CN111385068B (zh) 数据传输方法、装置、电子设备及通信系统
CN111385263B (zh) 一种数据包头压缩信息的维护方法及通信设备
US10680888B2 (en) State synchronization between a controller and a switch in a communications network
CN103607311B (zh) 一种无缝重建tcp连接的系统及方法
US20210029228A1 (en) Point-to-Point Database Synchronization Over a Transport Protocol
CN107786607B (zh) 一种消息重传方法、消息重传服务器及用户设备
CN116599953A (zh) 一种文件上传的方法、装置、系统、设备及可读存储介质
CN105721395B (zh) 数据同步配置方法、设备及系统
US20190200057A1 (en) Streaming system with a backup mechanism and a backup method thereof
CN115277649A (zh) 多媒体会议场景下的文档协同编辑的方法及装置
CN111064674B (zh) 数据的传输方法及装置、系统
CN106911707B (zh) 一种双向解耦的传输控制方法和系统
JP4759418B2 (ja) メッセージ回復システムおよび回復方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16906097

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16906097

Country of ref document: EP

Kind code of ref document: A1