WO2023226717A1 - File transmission method, file transmission apparatus, server and storage medium - Google Patents

File transmission method, file transmission apparatus, server and storage medium Download PDF

Info

Publication number
WO2023226717A1
WO2023226717A1 PCT/CN2023/092344 CN2023092344W WO2023226717A1 WO 2023226717 A1 WO2023226717 A1 WO 2023226717A1 CN 2023092344 W CN2023092344 W CN 2023092344W WO 2023226717 A1 WO2023226717 A1 WO 2023226717A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
information
transferred
transmitted
Prior art date
Application number
PCT/CN2023/092344
Other languages
French (fr)
Chinese (zh)
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 WO2023226717A1 publication Critical patent/WO2023226717A1/en

Links

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]

Definitions

  • the present disclosure relates to the field of data processing technology, and in particular, to a file transmission method, a file transmission device, a server and a storage medium.
  • the present disclosure provides a file transmission method, a file transmission device, a server and a storage medium.
  • a first aspect of an embodiment of the present disclosure provides a file transmission method, including:
  • the file transfer request is used to instruct the data sending end to send the file to be transferred in the to-be-transmitted folder to the data receiving end; in the file transfer request Contains at least the file information of all files to be transferred in the folder to be transferred;
  • the file to be transferred is sent to the data receiving end in the form of a compressed data stream.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
  • each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  • sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
  • the transmission order of each file to be transmitted during file transmission is determined
  • each file to be transmitted is sequentially transmitted to the data receiving end.
  • the file transfer request at least includes data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
  • the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  • sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request includes:
  • the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
  • the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the
  • the file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
  • the file attribute information includes file size, file type, and the location of the file in the folder to be transferred.
  • the second aspect of the embodiment of the present disclosure provides a file transmission method, which is applied to the data receiving end and includes:
  • the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end;
  • the file transfer request at least includes the file information of all files to be transferred in the folder to be transferred;
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • the sequentially receiving each of the files to be transmitted transmitted by the data receiving end based on the sequence information includes:
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred
  • the temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
  • the receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  • a third aspect of the embodiment of the present disclosure provides a file transmission method, including:
  • the data sending end establishes a communication connection with the data receiving end
  • the data sending end prepares and sends the target information of the folder to be transmitted, and establishes a compressed data stream
  • the data receiving end sends a file transfer request to the data sending end and receives the file to be transferred;
  • the file transfer request contains breakpoint information;
  • the data sending end prepares the real files to be transmitted that need to be sent based on the received data breakpoint information, and generates corresponding temporary files;
  • the data sending end sends the temporary file and the real file to the data receiving end;
  • the data receiving end receives the real file, wherein if the data sending end sends the real file from the breakpoint, the data receiving end can receive the transmission at the breakpoint according to the breakpoint information. file to obtain the entire file; if the data sending end sends a complete real file, the transmitted file can be received as a whole.
  • the fourth aspect of the embodiment of the present disclosure provides a file transmission device, which is applied to the data sending end and includes:
  • a first processing unit configured to establish a communication connection with the data receiving end
  • a second processing unit configured to send folder information of the folder to be transferred to the data receiving end, where the folder information at least includes directory information of the folder to be transferred in the storage area;
  • the third processing unit is configured to receive a file transfer request sent by the data receiving end.
  • the file transfer request is used to instruct the data sending end to send the to-be-transmitted file in the folder to be transferred to the data receiving end. Transfer files; the file transfer request includes at least the file information of all files to be transferred in the folder to be transferred;
  • the fourth processing unit is configured to send the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the fourth processing unit is configured to
  • each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  • the file transfer request at least includes data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the fourth processing unit is configured to
  • the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  • the fourth processing unit is configured to
  • the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
  • the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the
  • the file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
  • the fourth aspect of the embodiment of the present disclosure provides a file transmission device, which is applied to the data receiving end and includes:
  • a first processing unit configured to establish a communication connection with the data sending end
  • the second processing unit is configured to receive the folder information of the folder to be transferred sent by the data sending end based on the communication connection, wherein the folder information at least includes the folder information of the folder to be transferred in the storage area. directory information;
  • a third processing unit configured to generate a file transfer request based on the folder information of the folder to be transferred.
  • the file transfer request is used to instruct the data sending end to send the to-be-transmitted folder to the data receiving end.
  • the files to be transferred in the folder; the file transfer request at least contains the file information of all the files to be transferred in the folder to be transferred;
  • the fourth processing unit is configured to send the file transfer request to the data sending end, and receive the file to be transferred transmitted by the data receiving end in the form of a compressed data stream.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the fourth processing unit is configured to sequentially receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information.
  • the fourth processing unit is configured to
  • a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the fourth processing unit is configured to
  • the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred
  • the temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
  • the receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  • a fifth aspect of an embodiment of the present disclosure provides a server, including: a processor and a memory used to store a computer program that can be run on the processor, wherein when the processor is used to run the computer program, execute the first The steps of the method described in the aspect, the second aspect and the third aspect.
  • a sixth aspect of the embodiments of the present disclosure provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the first aspect, the second aspect and the third aspect when executed by a processor. steps of the method described.
  • the file transmission method in the embodiment of the present disclosure includes: establishing a communication connection with the data receiving end; sending folder information of the folder to be transferred to the data receiving end, where the folder information at least includes the location of the folder to be transferred in the storage area Directory information; receive a file transfer request sent by the data receiving end.
  • the file transfer request is used to instruct the data sending end to send the files to be transferred in the folder to be transferred to the data receiving end; the file transfer request contains at least the files in the folder to be transferred.
  • File information of all files to be transferred; based on the file transfer request, the files to be transferred are sent to the data receiving end in the form of a compressed data stream.
  • the data sending end when the data sending end and the data receiving end perform file transmission, the data sending end sends the file to be transferred to the data receiving end in the form of a compressed data stream according to the file transfer request sent by the data receiving end.
  • the file transfer request sent by the data receiving end contains the file information of all files to be transferred, so that the data sending end can directly send the files to be transferred after sending the folder to be transferred to the data receiving end in the form of a compressed data stream.
  • the data receiving end there is no need to receive a file transfer request to send a file, and there is no need to traverse all files to be transferred in the folder, thus effectively reducing file transfer time.
  • Figure 1 is a flowchart 1 of a file transmission method according to an exemplary embodiment.
  • Figure 2 is a flowchart 2 of a file transmission method according to an exemplary embodiment.
  • Figure 3 is a flowchart 3 of a file transmission method according to an exemplary embodiment.
  • Figure 4 is a schematic structural diagram of a file transmission device according to an exemplary embodiment.
  • Figure 5 is a schematic structural diagram 2 of a file transmission device according to an exemplary embodiment.
  • FIG. 6 is a device block diagram of an electronic device according to an exemplary embodiment.
  • FIG. 1 is a flowchart 1 of a file transmission method according to an exemplary embodiment.
  • file transfer methods include:
  • Step 10 Establish a communication connection with the data receiving end
  • Step 11 Send the folder information of the folder to be transferred to the data receiving end, where the folder information at least includes the directory information of the folder to be transferred in the storage area;
  • Step 12 Receive a file transfer request sent by the data receiving end.
  • the file transfer request is used to instruct the data sending end to send the file to be transferred in the to-be-transmitted folder to the data receiving end;
  • the file The transfer request contains at least the file information of all files to be transferred in the folder to be transferred;
  • Step 13 Based on the file transfer request, send the file to be transferred to the data receiving end in the form of a compressed data stream.
  • the compressed data stream can be used for online transmission.
  • the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission.
  • method if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
  • the recipient After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
  • the data sending end before sending a file to the data receiving end, receives a file transfer request sent by the data receiving end.
  • the file transfer request contains the file information of all files to be transferred in the folder to be transferred.
  • the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end without receiving a single file in the process.
  • the file transfer request sends a file and does not need to traverse all the files to be transferred in the folder, thus effectively reducing the file transfer time.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
  • each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  • the file attribute information includes file size, file type, file location in the folder to be transferred, and other information.
  • the files can be transferred based on the order information of the files to be transferred.
  • the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred.
  • the transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred.
  • the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
  • the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted.
  • the transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
  • the step of sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
  • the transmission order of each file to be transmitted during file transmission is determined
  • each file to be transmitted is sequentially transmitted to the data receiving end.
  • the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during the file transfer;
  • the method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
  • the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  • the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
  • sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request includes:
  • the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
  • the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the Descriptor file name determines the received descriptor Whether the file to be transmitted is correct, and the reception progress of the file to be transmitted is determined based on the original length of the file.
  • a temporary file may be generated first.
  • a temporary file can be included.
  • the file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file.
  • the temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
  • the corresponding temporary file may not include data start information.
  • the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
  • FIG. 2 is a flowchart 2 of a file transmission method according to an exemplary embodiment.
  • the file transfer method applied to the data receiving end includes:
  • the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end;
  • the file transfer request at least includes the file information of all files to be transferred in the folder to be transferred;
  • the data sending end when the data sending end sends the folder information to the data receiving end, it can also send the file information of all the files to be transferred in the folder to the data receiving end.
  • the data receiving end determines the files to be transmitted as needed, or can receive all the files to be transmitted. Send a file transfer request containing the file information of all files to be transferred to the data sending end, instructing the data sending end to send the folder and the files to be transferred in the folder in the form of a compressed data stream.
  • the compressed data stream can be used for online transmission.
  • the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission.
  • method if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
  • the recipient After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
  • the data sending end before sending a file to the data receiving end, receives a file transfer request sent by the data receiving end.
  • the file transfer request contains the file information of all files to be transferred in the folder to be transferred. .
  • the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • the file attribute information includes file size, file type, file location in the folder to be transferred, etc. interest.
  • the files can be transferred based on the order information of the files to be transferred.
  • the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred.
  • the transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred.
  • the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
  • the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted.
  • the transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
  • the data sending end determines the transmission order of each file to be transmitted during file transmission according to the transmission conditions
  • the step of sequentially receiving each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information includes:
  • the data sending end sequentially receives the files to be transmitted sequentially according to the determined transmission order.
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
  • the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
  • the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred
  • the temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
  • the receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  • a temporary file may be generated first.
  • a temporary file can be included.
  • the file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file.
  • the temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
  • the corresponding temporary file may not include data start information.
  • the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
  • the data receiving end when the data receiving end receives a file to be transmitted, it will also receive a corresponding temporary file and determine whether the received file to be transmitted is correct based on the file name; and based on the file to be transmitted File of said file original The length determines the reception progress of the file to be transmitted.
  • Figure 3 is a flowchart 3 of a file transmission method according to an exemplary embodiment. As shown in Figure 3, it includes:
  • Step 30 The data sending end establishes a communication connection with the data receiving end
  • Step 31 The data sending end prepares and sends the target information of the folder to be transferred, and establishes a compressed data stream;
  • Step 32 The data receiving end sends a file transfer request to the data sending end and receives the file to be transferred; the file transfer request contains breakpoint information;
  • Step 33 The data sending end prepares the real file to be transmitted that needs to be sent based on the received data breakpoint information, and generates the corresponding temporary file;
  • Step 34 The data sending end sends temporary files and real files to the data receiving end;
  • Step 35 The data receiving end receives the real file. If the data sending end sends the real file from the breakpoint, the data receiving end can receive the transmitted file at the breakpoint according to the breakpoint information and obtain the entire file; if the data sending end If a complete real file is sent, the transferred file can be received as a whole. During the receiving process, if the reception is not completed and is interrupted again, step 32 can be executed again to send a file transfer request to the data sending end.
  • This application only needs to send the information of the folder itself to the data receiving end, without the sub-file information of the folder, and can execute the download request on the data receiving end and start the transmission of the folder.
  • This application can decompress the data in real time at the data receiving end, temporarily store the completed files that have not been transferred, and record the file location.
  • the data receiving end requests the file, it will notify the data sending end of the unfinished file size and location, and the data sending end will notify the data sending end according to the receiving end.
  • To the relative position of the file find the corresponding position of the corresponding file at the data sending end.
  • This application generates a temporary compressed file before sending the compressed stream of the file.
  • the name of this file can be based on the next file name to be sent by adding letter symbols, etc., and characters that cannot be used in the real file are used as prefixes to prevent and folder
  • the real name is repeated, and the temporary file can also be associated with the file to be sent.
  • the data receiving end can determine whether this file is a real file or a temporary file that records the next file information through the same rules.
  • the information of this temporary file includes the location, size of the next file, breakpoint resumption and other related information. When the data receiving end receives this file, it can parse the information, calculate the progress based on the size, and perform a resumable transmission operation on the information that can be resumed at a breakpoint.
  • the file transmission method proposed in this application can effectively reduce network requests, save transmission time, improve transmission speed and transmission success rate, while still supporting breakpoint resumption and progress calculation.
  • FIG. 4 is a schematic structural diagram of a file transmission device according to an exemplary embodiment. As shown in Figure 4, the file transfer device used at the data sending end includes:
  • the first processing unit 41 is used to establish a communication connection with the data receiving end;
  • the second processing unit 42 is configured to send folder information of the folder to be transferred to the data receiving end, where the folder information at least includes directory information of the folder to be transferred in the storage area;
  • the third processing unit 43 is configured to receive a file transfer request sent by the data receiving end.
  • the file transfer request is used to instruct the data sending end to send the to-be-transmitted files in the to-be-transmitted folder to the data receiving end. file; the file transfer request includes at least the file information of all files to be transferred in the folder to be transferred;
  • the fourth processing unit 44 is configured to send the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request.
  • the compressed data stream can be used for online transmission.
  • the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission. way if receiving If the party supports this compressed file transmission method, it first obtains the folder information that the user chooses to send. The folder information does not need to contain the file information to be transferred, and then sends the folder information to the recipient;
  • the recipient After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
  • the data sending end before sending a file to the data receiving end, receives a file transfer request sent by the data receiving end.
  • the file transfer request contains the file information of all files to be transferred in the folder to be transferred. .
  • the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the fourth processing unit is used to calculate the fourth processing unit.
  • each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  • the file attribute information includes file size, file type, file location in the folder to be transferred, and other information.
  • the files can be transferred based on the order information of the files to be transferred.
  • the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred.
  • the transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred.
  • the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
  • the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted.
  • the transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
  • the step of sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
  • the transmission order of each file to be transmitted during file transmission is determined
  • each file to be transmitted is sequentially transmitted to the data receiving end.
  • the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during the file transfer;
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  • the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
  • the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the
  • the file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
  • a temporary file may be generated first.
  • a temporary file can be included.
  • the file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file.
  • the temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
  • the corresponding temporary file may not include data start information.
  • the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
  • a fourth aspect of the embodiments of the present disclosure provides a file transmission device.
  • Figure 5 is a schematic structural diagram 2 of a file transmission device according to an exemplary embodiment.
  • the file transfer device used at the data receiving end includes:
  • the first processing unit 51 is used to establish a communication connection with the data sending end;
  • the second processing unit 52 is configured to receive the folder information of the folder to be transferred sent by the data sending end based on the communication connection, where the folder information at least includes the directory of the folder to be transferred in the storage area. information;
  • the third processing unit 53 is configured to generate a file transfer request based on the folder information of the folder to be transferred.
  • the file transfer request is used to instruct the data sending end to send the file to be transferred to the data receiving end.
  • the files to be transferred in the folder; the file transfer request at least contains the file information of all the files to be transferred in the folder to be transferred;
  • the fourth processing unit 54 is configured to send the file transfer request to the data sending end, and receive the file to be transferred transmitted by the data receiving end in the form of a compressed data stream.
  • the data sending end when the data sending end sends the folder information to the data receiving end, it can also send the file information of all the files to be transferred in the folder to the data receiving end.
  • the data receiving end determines the files to be transmitted as needed, or can receive all the files to be transmitted. Send a file transfer request containing the file information of all files to be transferred to the data sending end, instructing the data sending end to send the folder and the files to be transferred in the folder in the form of a compressed data stream.
  • the compressed data stream can be used for online transmission.
  • the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission.
  • method if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
  • the recipient After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
  • the data sending end before sending a file to the data receiving end, receives a file transfer request sent by the data receiving end.
  • the file transfer request contains the file information of all files to be transferred in the folder to be transferred. .
  • the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
  • the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
  • the fourth processing unit is configured to sequentially receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information.
  • the file attribute information includes file size, file type, file location in the folder to be transferred, and other information.
  • the files can be transferred based on the order information of the files to be transferred.
  • the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred.
  • the transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred.
  • the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
  • the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted.
  • the transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
  • the data sending end determines the transmission order of each file to be transmitted during file transmission according to the transmission conditions
  • the step of sequentially receiving each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information includes:
  • the data sending end sequentially receives the files to be transmitted sequentially according to the determined transmission order.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
  • the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred
  • the temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
  • the receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  • a temporary file may be generated first.
  • a temporary file can be included.
  • the file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file.
  • the temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
  • the corresponding temporary file may not include data start information.
  • the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end interrupts the transmission, the number of untransmitted files to be transferred can be loaded in the file transfer request. Resume file transfer based on breakpoint information.
  • the data receiving end when the data receiving end receives a file to be transmitted, it will also receive a corresponding temporary file and determine whether the received file to be transmitted is correct based on the file name; and based on the file to be transmitted The original file length of the file determines the reception progress of the file to be transmitted.
  • An embodiment of the present disclosure also provides a server, including: a processor and a memory used to store a computer program that can be run on the processor, wherein when the processor is used to run the computer program, the processor executes the steps of the above embodiments. Describe the steps of the method.
  • An embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, which is characterized in that when the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.
  • FIG. 6 is a device block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
  • the electronic device may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input/output (I/O) interface 812 , and a sensor component 814 , and communication component 816.
  • a processing component 802 the electronic device may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input/output (I/O) interface 812 , and a sensor component 814 , and communication component 816.
  • the processing component 802 generally controls the overall operation of the electronic device device, such as operations associated with touch, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operations in the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power component 806 provides power to various components of the electronic device.
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic equipment devices.
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • multimedia component 808 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera can receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 814 includes one or more sensors for providing various aspects of status assessment for the electronic device.
  • the sensor component 814 can detect the open/closed state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, the sensor component 814 can also detect the position change of the electronic device or a component of the electronic device, the user The presence or absence of contact with the electronic device, the orientation or acceleration/deceleration of the electronic device and the temperature changes of the electronic device.
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communications between electronic devices and other devices. Electronic devices can access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communications component 816 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • This application provides a file transmission method, file transmission device, server and storage medium, including: establishing a communication connection with a data receiving end; sending folder information of the folder to be transmitted to the data receiving end, where the folder information At least include the directory information of the folder to be transferred in the storage area; receive a file transfer request sent by the data receiving end, and the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end; file transfer request contains at least the file information of all files to be transferred in the folder to be transferred; based on the file transfer request, the file to be transferred is sent to the data receiving end in the form of a compressed data stream.
  • the data sending end when the data sending end and the data receiving end perform file transmission, the data sending end sends the file to be transferred to the data receiving end in the form of a compressed data stream according to the file transfer request sent by the data receiving end.
  • the file transfer request sent by the data receiving end contains the file information of all files to be transferred, so that the data sending end can directly send the files to be transferred after sending the folder to be transferred to the data receiving end in the form of a compressed data stream.
  • the data receiving end there is no need to receive a file transfer request to send a file, and there is no need to traverse all files to be transferred in the folder, thus effectively reducing file transfer time.
  • the file transmission method, file transmission device, server and storage medium of the present application are reproducible and can be used in a variety of industrial applications.
  • the file transmission method, file transmission device, server and storage medium of this application can be used in the field of data processing technology.

Landscapes

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

Abstract

The present disclosure relates to a file transmission method, a file transmission apparatus, a server and a storage medium. The file transmission method comprises: acquiring target source data; determining a pre-defined data processing protocol, wherein the data processing protocol includes a feature data extraction mode, which is at least used for compiling data in a first data format in the target source data into data in a second data format; on the basis of the feature data extraction mode, extracting, from the target source data, feature data of a target field; and storing extracted feature data on the basis of a predetermined storage format. In the present application, a data processing protocol for processing specific data can be defined in a platform, and a feature data extraction mode is defined by means of the data processing protocol, such that data extraction of the specific data is realized. During the whole process, feature data extraction regarding target source data can be automatically realized without manual intervention, such that errors that may be caused by a manual operation can be reduced, and the automation and streamlining of data processing are realized.

Description

文件传输方法、文件传输装置、服务器及存储介质File transfer method, file transfer device, server and storage medium
相关申请的交叉引用Cross-references to related applications
本公开要求于2022年05月26日提交中国国家知识产权局的申请号为202210584928.3、名称为“文件传输方法、文件传输装置、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This disclosure requests the priority of the Chinese patent application with application number 202210584928.3 and titled "File transmission method, file transmission device, server and storage medium" submitted to the State Intellectual Property Office of China on May 26, 2022. The entire content of it is approved by This reference is incorporated into this application.
技术领域Technical field
本公开涉及数据处理技术领域,尤其涉及一种文件传输方法、文件传输装置、服务器及存储介质。The present disclosure relates to the field of data processing technology, and in particular, to a file transmission method, a file transmission device, a server and a storage medium.
背景技术Background technique
随着信息技术发展,各种终端设备不断涌现。其中在用户使用设备的过程中,会生成和使用各种各样的文件,大量的文件往往会根据文件组织结构,类型,时间等维度组成集合,常见的文件夹结构就是这种形式。通过终端设备进行信息交互时,有时需要在终端设备间进行数据传输,包括各种文件传输。With the development of information technology, various terminal devices continue to emerge. During the user's use of the device, a variety of files will be generated and used. A large number of files are often organized into collections based on file organization structure, type, time and other dimensions. This is the common folder structure. When exchanging information through terminal devices, data transmission, including various file transfers, is sometimes required between terminal devices.
发明内容Contents of the invention
本公开提供一种文件传输方法、文件传输装置、服务器及存储介质。The present disclosure provides a file transmission method, a file transmission device, a server and a storage medium.
本公开实施例的第一方面,提供一种文件传输方法,包括:A first aspect of an embodiment of the present disclosure provides a file transmission method, including:
建立与数据接收端之间的通信连接;Establish a communication connection with the data receiving end;
发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;Send folder information of the folder to be transferred to the data receiving end, wherein the folder information at least includes directory information of the folder to be transferred in the storage area;
接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Receive a file transfer request sent by the data receiving end, the file transfer request is used to instruct the data sending end to send the file to be transferred in the to-be-transmitted folder to the data receiving end; in the file transfer request Contains at least the file information of all files to be transferred in the folder to be transferred;
基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。Based on the file transfer request, the file to be transferred is sent to the data receiving end in the form of a compressed data stream.
在一些可选实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some optional embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括:The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
在一些可选实施例中,所述基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件,包括:In some optional embodiments, sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序,According to the transmission conditions, the transmission order of each file to be transmitted during file transmission is determined,
根据确定的传输次序,依次传输各待传输文件至数据接收端。According to the determined transmission sequence, each file to be transmitted is sequentially transmitted to the data receiving end.
在一些可选实施例中,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;In some optional embodiments, the file transfer request at least includes data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during file transfer;
所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括: The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
在一些可选实施例中,所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,包括:In some optional embodiments, sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request includes:
生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the The file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
在一些可选实施例中,所述文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置。In some optional embodiments, the file attribute information includes file size, file type, and the location of the file in the folder to be transferred.
本公开实施例的第二方面提供一种文件传输方法,应用于数据接收端包括:The second aspect of the embodiment of the present disclosure provides a file transmission method, which is applied to the data receiving end and includes:
建立与数据发送端之间的通信连接;Establish a communication connection with the data sending end;
基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;Based on the communication connection, receive the folder information of the folder to be transferred sent by the data sending end, wherein the folder information at least includes the directory information of the folder to be transferred in the storage area;
基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Generate a file transfer request based on the folder information of the folder to be transferred, the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end; The file transfer request at least includes the file information of all files to be transferred in the folder to be transferred;
向所述数据发送端发送所述文件传输请求;Send the file transfer request to the data sending end;
接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。Receive the file to be transmitted transmitted by the data receiving end in the form of a compressed data stream.
在一些可选实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some optional embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:The data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。Receive each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information in sequence.
在一些可选实施例中,所述依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件,包括:In some optional embodiments, the sequentially receiving each of the files to be transmitted transmitted by the data receiving end based on the sequence information includes:
依次接收所述数据发送端根据确定的传输次序,依次传输的各待传输文件。Receive each file to be transmitted sequentially transmitted by the data sending end according to the determined transmission order.
在一些可选实施例中,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:In some optional embodiments, the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
存储接收的所述待传输文件的数据断点信息;Store the received data breakpoint information of the file to be transferred;
若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
在一些可选实施例中,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:In some optional embodiments, the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定; Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
本公开实施例的第三方面提供一种文件传输方法,包括:A third aspect of the embodiment of the present disclosure provides a file transmission method, including:
数据发送端建立与数据接收端之间的通信连接;The data sending end establishes a communication connection with the data receiving end;
所述数据发送端准备并发送待传输文件夹的目标信息,并建立压缩数据流;The data sending end prepares and sends the target information of the folder to be transmitted, and establishes a compressed data stream;
所述数据接收端向所述数据发送端发送文件传输请求,接收所述待传输文件;所述文件传输请求包含有断点信息;The data receiving end sends a file transfer request to the data sending end and receives the file to be transferred; the file transfer request contains breakpoint information;
所述数据发送端根据接收的数据断点信息准备需要发送的真实的待传输文件,并生成对应的临时文件;The data sending end prepares the real files to be transmitted that need to be sent based on the received data breakpoint information, and generates corresponding temporary files;
所述数据发送端发送所述临时文件及真实文件至数据接收端;The data sending end sends the temporary file and the real file to the data receiving end;
所述数据接收端接收所述真实文件,其中,若所述数据发送端从断点处发送所述真实文件,则所述数据接收端能够根据所述断点信息在所述断点处接收传输的文件,得到整体文件;若所述数据发送端发送的是完整的真实文件,则能够整体接收传输的文件。The data receiving end receives the real file, wherein if the data sending end sends the real file from the breakpoint, the data receiving end can receive the transmission at the breakpoint according to the breakpoint information. file to obtain the entire file; if the data sending end sends a complete real file, the transmitted file can be received as a whole.
本公开实施例的第四方面提供一种文件传输装置,应用于数据发送端包括:The fourth aspect of the embodiment of the present disclosure provides a file transmission device, which is applied to the data sending end and includes:
第一处理单元,被配置用于建立与数据接收端之间的通信连接;A first processing unit configured to establish a communication connection with the data receiving end;
第二处理单元,被配置用于发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;A second processing unit configured to send folder information of the folder to be transferred to the data receiving end, where the folder information at least includes directory information of the folder to be transferred in the storage area;
第三处理单元,被配置用于接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;The third processing unit is configured to receive a file transfer request sent by the data receiving end. The file transfer request is used to instruct the data sending end to send the to-be-transmitted file in the folder to be transferred to the data receiving end. Transfer files; the file transfer request includes at least the file information of all files to be transferred in the folder to be transferred;
第四处理单元,被配置用于基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。The fourth processing unit is configured to send the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request.
在一些实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述第四处理单元,被配置用于The fourth processing unit is configured to
基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
在一些可选实施例中,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;In some optional embodiments, the file transfer request at least includes data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during file transfer;
所述第四处理单元,被配置用于The fourth processing unit is configured to
基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
在一些可选实施例中,所述第四处理单元,被配置用于In some optional embodiments, the fourth processing unit is configured to
生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the The file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
本公开实施例的第四方面提供一种文件传输装置,应用于数据接收端包括:The fourth aspect of the embodiment of the present disclosure provides a file transmission device, which is applied to the data receiving end and includes:
第一处理单元,被配置用于建立与数据发送端之间的通信连接; A first processing unit configured to establish a communication connection with the data sending end;
第二处理单元,被配置用于基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;The second processing unit is configured to receive the folder information of the folder to be transferred sent by the data sending end based on the communication connection, wherein the folder information at least includes the folder information of the folder to be transferred in the storage area. directory information;
第三处理单元,被配置用于基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;A third processing unit configured to generate a file transfer request based on the folder information of the folder to be transferred. The file transfer request is used to instruct the data sending end to send the to-be-transmitted folder to the data receiving end. The files to be transferred in the folder; the file transfer request at least contains the file information of all the files to be transferred in the folder to be transferred;
第四处理单元,被配置用于向所述数据发送端发送所述文件传输请求,及接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。The fourth processing unit is configured to send the file transfer request to the data sending end, and receive the file to be transferred transmitted by the data receiving end in the form of a compressed data stream.
在一些可选实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some optional embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述第四处理单元,被配置用于依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。The fourth processing unit is configured to sequentially receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information.
在一些可选实施例中,所述第四处理单元,被配置用于In some optional embodiments, the fourth processing unit is configured to
存储接收的所述待传输文件的数据断点信息;Store the received data breakpoint information of the file to be transferred;
若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
在一些可选实施例中,所述第四处理单元,被配置用于In some optional embodiments, the fourth processing unit is configured to
接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定;Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
本公开实施例的第五方面提供一种服务器,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行第一方面、第二方面和第三方面所述的方法的步骤。A fifth aspect of an embodiment of the present disclosure provides a server, including: a processor and a memory used to store a computer program that can be run on the processor, wherein when the processor is used to run the computer program, execute the first The steps of the method described in the aspect, the second aspect and the third aspect.
本公开实施例的第六方面提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现第一方面、第二方面和第三方面所述的方法的步骤。A sixth aspect of the embodiments of the present disclosure provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the first aspect, the second aspect and the third aspect when executed by a processor. steps of the method described.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
本公开实施例中的文件传输方法,包括:建立与数据接收端之间的通信连接;发送待传输文件夹的文件夹信息至数据接收端,其中文件夹信息至少包括待传输文件夹在存储区域的目录信息;接收数据接收端发送的文件传输请求,文件传输请求用于指示数据发送端向数据接收端发送待传输文件夹中的待传输文件;文件传输请求中至少包含有待传输文件夹中的所有待传输文件的文件信息;基于文件传输请求,以压缩数据流的形式,向数据接收端发送待传输文件。本申请中在数据发送端与数据接收端进行文件传输时,数据发送端根据数据接收端发送的文件传输请求,以压缩数据流的形式向数据接收端发送待传输文件。其中,数据接收端发送的文件传输请求中包含有所有待传输文件的文件信息,使得数据发送端以压缩数据流的形式将待传输文件夹发送给数据接收端后,可直接将待传输文件发送给数据接收端,不用接收一个文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。 The file transmission method in the embodiment of the present disclosure includes: establishing a communication connection with the data receiving end; sending folder information of the folder to be transferred to the data receiving end, where the folder information at least includes the location of the folder to be transferred in the storage area Directory information; receive a file transfer request sent by the data receiving end. The file transfer request is used to instruct the data sending end to send the files to be transferred in the folder to be transferred to the data receiving end; the file transfer request contains at least the files in the folder to be transferred. File information of all files to be transferred; based on the file transfer request, the files to be transferred are sent to the data receiving end in the form of a compressed data stream. In this application, when the data sending end and the data receiving end perform file transmission, the data sending end sends the file to be transferred to the data receiving end in the form of a compressed data stream according to the file transfer request sent by the data receiving end. Among them, the file transfer request sent by the data receiving end contains the file information of all files to be transferred, so that the data sending end can directly send the files to be transferred after sending the folder to be transferred to the data receiving end in the form of a compressed data stream. To the data receiving end, there is no need to receive a file transfer request to send a file, and there is no need to traverse all files to be transferred in the folder, thus effectively reducing file transfer time.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
图1是根据一示例性实施例示出的一种文件传输方法流程图一。Figure 1 is a flowchart 1 of a file transmission method according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种文件传输方法流程图二。Figure 2 is a flowchart 2 of a file transmission method according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种文件传输方法流程图三。Figure 3 is a flowchart 3 of a file transmission method according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种文件传输装置结构示意图一。Figure 4 is a schematic structural diagram of a file transmission device according to an exemplary embodiment.
图5是根据一示例性实施例示出的一种文件传输装置结构示意图二。Figure 5 is a schematic structural diagram 2 of a file transmission device according to an exemplary embodiment.
图6是根据一示例性实施例示出的一种电子设备的设备框图。FIG. 6 is a device block diagram of an electronic device according to an exemplary embodiment.
图中:41、51-第一处理单元;42、52-第二处理单元;43、53-第三处理单元;44、54-第四处理单元;802-处理组件;804-存储器;806-电力组件;808-多媒体组件;810-音频组件;812-输入/输出接口;814-传感器组件;816-通信组件;820-处理器。In the figure: 41, 51-first processing unit; 42, 52-second processing unit; 43, 53-third processing unit; 44, 54-fourth processing unit; 802-processing component; 804-memory; 806- Power component; 808-multimedia component; 810-audio component; 812-input/output interface; 814-sensor component; 816-communication component; 820-processor.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of means consistent with aspects of the disclosure as detailed in the appended claims.
随着信息技术发展,各种终端设备不断涌现。其中在用户使用设备的过程中,会生成和使用各种各样的文件,大量的文件往往会根据文件组织结构,类型,时间等维度组成集合,常见的文件夹结构就是这种形式。通过终端设备进行信息交互时,有时需要在终端设备间进行数据传输,包括各种文件传输。With the development of information technology, various terminal devices continue to emerge. During the user's use of the device, a variety of files will be generated and used. A large number of files are often organized into collections based on file organization structure, type, time and other dimensions. This is the common folder structure. When exchanging information through terminal devices, data transmission, including various file transfers, is sometimes required between terminal devices.
本公开实施例提供一种文件传输方法。图1是根据一示例性实施例示出的一种文件传输方法流程图一。如图1所示,文件传输方法,包括:Embodiments of the present disclosure provide a file transmission method. Figure 1 is a flowchart 1 of a file transmission method according to an exemplary embodiment. As shown in Figure 1, file transfer methods include:
步骤10、建立与数据接收端之间的通信连接;Step 10. Establish a communication connection with the data receiving end;
步骤11、发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;Step 11: Send the folder information of the folder to be transferred to the data receiving end, where the folder information at least includes the directory information of the folder to be transferred in the storage area;
步骤12、接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Step 12. Receive a file transfer request sent by the data receiving end. The file transfer request is used to instruct the data sending end to send the file to be transferred in the to-be-transmitted folder to the data receiving end; the file The transfer request contains at least the file information of all files to be transferred in the folder to be transferred;
步骤13、基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。Step 13: Based on the file transfer request, send the file to be transferred to the data receiving end in the form of a compressed data stream.
本公开实施例中,在数据发送端和数据接收端进行文件传输时,可采用压缩数据流的形式进行线上传输,在发送方和接收方建立连接后,首先确认双方是否支持此压缩文件传输方式,如果接收方支持此压缩文件传输方式,先获取到用户选择发送的文件夹信息,文件夹信息中可不包含待传输文件信息,将文件夹信息发送给接收方;In this disclosed embodiment, when the data sending end and the data receiving end perform file transmission, the compressed data stream can be used for online transmission. After the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission. method, if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
接收方在接收文件夹信息后,检查本地是否已经传输过此文件夹,并确定文件夹传输的待传输文件的文件信息。本地没有传输过此文件夹时,建立该待传输文件夹,以压缩数据流的形式接收数据发送端发送的待传输文件。After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
本公开实施例中,数据发送端向数据接收端发送文件前,接收到数据接收端发送的文件传输请求,该文件传输请求中包含有所述待传输文件夹中的所有待传输文件的文件信息。数据发送端根据该文件传输请求,可将待传输文件夹中的所有待传输文件发送给数据接收端,过程中不用接收一个 文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。In this disclosed embodiment, before sending a file to the data receiving end, the data sending end receives a file transfer request sent by the data receiving end. The file transfer request contains the file information of all files to be transferred in the folder to be transferred. . According to the file transfer request, the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end without receiving a single file in the process. The file transfer request sends a file and does not need to traverse all the files to be transferred in the folder, thus effectively reducing the file transfer time.
在一些实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括:The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
本公开实施例中,文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置等信息。文件传输时,可根据各待传输文件在传输时的顺序信息,进行文件传输。例如,文件夹中包含有多个待传输文件,包括第一待传输文件、第二待传输文件、第三待传输文件,其中,可确定出文件的传输顺序为,第一待传输文件、第二待传输文件、第三待传输文件,可传输文件时,可由第一待传输文件、第二待传输文件到第三待传输文件依次传输待传输文件。In this disclosed embodiment, the file attribute information includes file size, file type, file location in the folder to be transferred, and other information. When transferring files, the files can be transferred based on the order information of the files to be transferred. For example, the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred. The transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred. When the second file to be transferred and the third file to be transferred can be transferred, the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
本公开实施例中,所述顺序信息还可以包含有用于确定各个待传输文件传输顺序的传输条件。其中所述传输条件可以为按照各个待传输文件的文件大小,从大文件向小文件依次传输,也可以按照文件格式,先传输第一类型文件再传输第二类型文件,例如先传输文本文件,再传视频文件等。In this embodiment of the present disclosure, the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted. The transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
所述基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件,包括:The step of sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序,According to the transmission conditions, the transmission order of each file to be transmitted during file transmission is determined,
根据确定的传输次序,依次传输各待传输文件至数据接收端。According to the determined transmission sequence, each file to be transmitted is sequentially transmitted to the data receiving end.
在一些实施例中,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;In some embodiments, the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during the file transfer;
所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括:The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
本公开实施例中,在文件传输过程中,当出现文件传输中断时,数据接收端可将未传输完成的文件的数据断点信息,通过文件传输请求发送给数据发送端;由于文件传输是基于压缩数据流进行传输,在数据接收端确定的数据中断传输的位置与数据发送端对应的位置可能并不相同,因此,需要数据发送端根据接收到的数据断点信息,确定出向所述数据接收端发送未传输完成文件的数据起始信息;在发送未传输完成文件时起始数据的位置信息向数据接收端重新发送待传输文件。In this disclosed embodiment, during the file transfer process, when a file transfer interruption occurs, the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
在一些实施例中,所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,包括:In some embodiments, sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request includes:
生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述 待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the Descriptor file name determines the received descriptor Whether the file to be transmitted is correct, and the reception progress of the file to be transmitted is determined based on the original length of the file.
本公开实施例中,数据发送端根据接收到的文件传输请求,向数据接收端发送待传输文件时,可先生成一个临时文件。每次发送一个待传输文件时都可以带有一个临时文件。该临时文件的文件格式不同于待传输文件,有利于数据接收端识别出临时文件。临时文件中包含有对应的待传输文件的文件信息,文件信息中至少包含有待传输文件的文件名称、文件原始长度,和/或数据起始信息。In this disclosed embodiment, when the data sending end sends a file to be transferred to the data receiving end according to the received file transfer request, a temporary file may be generated first. Each time a file is sent to be transferred, a temporary file can be included. The file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file. The temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
当文件传输请求中不包含有数据断点信息时,对应的临时文件可不包含有数据起始信息。当文件传输请求中包含有数据断点信息时,说明数据接收端指示数据发送端发送传输中断的文件。如此,当数据接收端接收的文件中断传输时,可通过在文件传输请求中加载未传输完成的待传输文件的数据断点信息,来恢复文件传输。When the file transfer request does not include data breakpoint information, the corresponding temporary file may not include data start information. When the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
本公开实施例提供一种文件传输方法。图2是根据一示例性实施例示出的一种文件传输方法流程图二。如图2所示,文件传输方法,应用于数据接收端包括:Embodiments of the present disclosure provide a file transmission method. Figure 2 is a flowchart 2 of a file transmission method according to an exemplary embodiment. As shown in Figure 2, the file transfer method applied to the data receiving end includes:
建立与数据发送端之间的通信连接;Establish a communication connection with the data sending end;
基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;Based on the communication connection, receive the folder information of the folder to be transferred sent by the data sending end, wherein the folder information at least includes the directory information of the folder to be transferred in the storage area;
基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Generate a file transfer request based on the folder information of the folder to be transferred, the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end; The file transfer request at least includes the file information of all files to be transferred in the folder to be transferred;
向所述数据发送端发送所述文件传输请求;Send the file transfer request to the data sending end;
接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。Receive the file to be transmitted transmitted by the data receiving end in the form of a compressed data stream.
本公开实施例中,数据发送端在向数据接收端发送文件夹信息时,也可以将文件夹中所有的待传输文件的文件信息一同发送给数据接收端。数据接收端根据需要确定需要的待传输文件,也可以全部接收所有的待传输文件。将包含有所有的待传输文件的文件信息的文件传输请求发送给数据发送端,指示数据发送端以压缩数据流的形式发送文件夹及文件夹中的待传输文件。In this disclosed embodiment, when the data sending end sends the folder information to the data receiving end, it can also send the file information of all the files to be transferred in the folder to the data receiving end. The data receiving end determines the files to be transmitted as needed, or can receive all the files to be transmitted. Send a file transfer request containing the file information of all files to be transferred to the data sending end, instructing the data sending end to send the folder and the files to be transferred in the folder in the form of a compressed data stream.
本公开实施例中,在数据发送端和数据接收端进行文件传输时,可采用压缩数据流的形式进行线上传输,在发送方和接收方建立连接后,首先确认双方是否支持此压缩文件传输方式,如果接收方支持此压缩文件传输方式,先获取到用户选择发送的文件夹信息,文件夹信息中可不包含待传输文件信息,将文件夹信息发送给接收方;In this disclosed embodiment, when the data sending end and the data receiving end perform file transmission, the compressed data stream can be used for online transmission. After the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission. method, if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
接收方在接收文件夹信息后,检查本地是否已经传输过此文件夹,并确定文件夹传输的待传输文件的文件信息。本地没有传输过此文件夹时,建立该待传输文件夹,以压缩数据流的形式接收数据发送端发送的待传输文件。After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
本公开实施例中,数据发送端向数据接收端发送文件前,接收到数据接收端发送的文件传输请求,该文件传输请求中包含有所述待传输文件夹中的所有待传输文件的文件信息。数据发送端根据该文件传输请求,可将待传输文件夹中的所有待传输文件发送给数据接收端,过程中不用接收一个文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。In this disclosed embodiment, before sending a file to the data receiving end, the data sending end receives a file transfer request sent by the data receiving end. The file transfer request contains the file information of all files to be transferred in the folder to be transferred. . Based on the file transfer request, the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
在一些实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:The data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。Receive each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information in sequence.
本公开实施例中,文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置等信 息。文件传输时,可根据各待传输文件在传输时的顺序信息,进行文件传输。例如,文件夹中包含有多个待传输文件,包括第一待传输文件、第二待传输文件、第三待传输文件,其中,可确定出文件的传输顺序为,第一待传输文件、第二待传输文件、第三待传输文件,可传输文件时,可由第一待传输文件、第二待传输文件到第三待传输文件依次传输待传输文件。In the embodiment of the present disclosure, the file attribute information includes file size, file type, file location in the folder to be transferred, etc. interest. When transferring files, the files can be transferred based on the order information of the files to be transferred. For example, the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred. The transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred. When the second file to be transferred and the third file to be transferred can be transferred, the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
本公开实施例中,所述顺序信息还可以包含有用于确定各个待传输文件传输顺序的传输条件。其中所述传输条件可以为按照各个待传输文件的文件大小,从大文件向小文件依次传输,也可以按照文件格式,先传输第一类型文件再传输第二类型文件,例如先传输文本文件,再传视频文件等。In this embodiment of the present disclosure, the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted. The transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
数据发送端根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序;The data sending end determines the transmission order of each file to be transmitted during file transmission according to the transmission conditions;
所述依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件,包括:The step of sequentially receiving each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information includes:
依次接收数据发送端根据确定的传输次序,依次传输的各待传输文件。The data sending end sequentially receives the files to be transmitted sequentially according to the determined transmission order.
在一些实施例中,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:In some embodiments, the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
存储接收的所述待传输文件的数据断点信息;Store the received data breakpoint information of the file to be transferred;
若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
本公开实施例中,在文件传输过程中,当出现文件传输中断时,数据接收端可将未传输完成的文件的数据断点信息,通过文件传输请求发送给数据发送端;由于文件传输是基于压缩数据流进行传输,在数据接收端确定的数据中断传输的位置与数据发送端对应的位置可能并不相同,因此,需要数据发送端根据接收到的数据断点信息,确定出向所述数据接收端发送未传输完成文件的数据起始信息;在发送未传输完成文件时起始数据的位置信息向数据接收端重新发送待传输文件。In this disclosed embodiment, during the file transfer process, when a file transfer interruption occurs, the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
在一些实施例中,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:In some embodiments, the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定;Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
本公开实施例中,数据发送端根据接收到的文件传输请求,向数据接收端发送待传输文件时,可先生成一个临时文件。每次发送一个待传输文件时都可以带有一个临时文件。该临时文件的文件格式不同于待传输文件,有利于数据接收端识别出临时文件。临时文件中包含有对应的待传输文件的文件信息,文件信息中至少包含有待传输文件的文件名称、文件原始长度,和/或数据起始信息。In this disclosed embodiment, when the data sending end sends a file to be transferred to the data receiving end according to the received file transfer request, a temporary file may be generated first. Each time a file is sent to be transferred, a temporary file can be included. The file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file. The temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
当文件传输请求中不包含有数据断点信息时,对应的临时文件可不包含有数据起始信息。当文件传输请求中包含有数据断点信息时,说明数据接收端指示数据发送端发送传输中断的文件。如此,当数据接收端接收的文件中断传输时,可通过在文件传输请求中加载未传输完成的待传输文件的数据断点信息,来恢复文件传输。When the file transfer request does not include data breakpoint information, the corresponding temporary file may not include data start information. When the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
本公开实施例中,数据接收端在接收一个待传输文件时,也会接收到一个对应的临时文件,通过根据所述文件名称确定接收的所述待传输文件是否正确;及基于所述待传输文件的所述文件原始 长度确定接收所述待传输文件的接收进度。In this disclosed embodiment, when the data receiving end receives a file to be transmitted, it will also receive a corresponding temporary file and determine whether the received file to be transmitted is correct based on the file name; and based on the file to be transmitted File of said file original The length determines the reception progress of the file to be transmitted.
图3是根据一示例性实施例示出的一种文件传输方法流程图三。如图3所示,包括:Figure 3 is a flowchart 3 of a file transmission method according to an exemplary embodiment. As shown in Figure 3, it includes:
步骤30、数据发送端建立与数据接收端之间的通信连接;Step 30: The data sending end establishes a communication connection with the data receiving end;
步骤31、数据发送端准备并发送待传输文件夹的目标信息,并建立压缩数据流;Step 31: The data sending end prepares and sends the target information of the folder to be transferred, and establishes a compressed data stream;
步骤32、数据接收端向数据发送端发送文件传输请求,接收待传输文件;文件传输请求包含有断点信息;Step 32: The data receiving end sends a file transfer request to the data sending end and receives the file to be transferred; the file transfer request contains breakpoint information;
步骤33、数据发送端根据接收的数据断点信息准备需要发送的真实的待传输文件,并生成对应的临时文件;Step 33: The data sending end prepares the real file to be transmitted that needs to be sent based on the received data breakpoint information, and generates the corresponding temporary file;
步骤34、数据发送端发送临时文件及真实文件至数据接收端;Step 34: The data sending end sends temporary files and real files to the data receiving end;
步骤35、数据接收端接收真实文件,其中,若数据发送端从断点处发送真实文件,则数据接收端可根据断点信息在断点处接收传输的文件,得到整体文件;若数据发送端发送的是完整的真实文件,则可整体接收传输的文件。其中,接收过程中,如果没有接收完成再次中断,则可以再次执行步骤32向数据发送端发送文件传输请求。Step 35: The data receiving end receives the real file. If the data sending end sends the real file from the breakpoint, the data receiving end can receive the transmitted file at the breakpoint according to the breakpoint information and obtain the entire file; if the data sending end If a complete real file is sent, the transferred file can be received as a whole. During the receiving process, if the reception is not completed and is interrupted again, step 32 can be executed again to send a file transfer request to the data sending end.
本申请只需要将文件夹本身的信息发送给数据接收端,不需要文件夹的子文件信息,就可以在数据接收端执行下载请求,开始文件夹的传输。This application only needs to send the information of the folder itself to the data receiving end, without the sub-file information of the folder, and can execute the download request on the data receiving end and start the transmission of the folder.
文件夹中包含多个文件时,可以只需要一次请求数据发送端即可将目录中的所有子文件写入,在数据接收端实时解压,不需要每个文件都执行一次请求,也可以避免类似TCP协议中的慢启动导致传输速度较低的问题。When the folder contains multiple files, you only need to request the data sending end once to write all the sub-files in the directory, and decompress them in real time on the data receiving end. There is no need to perform a request for each file, and you can also avoid similar Slow start in TCP protocol causes the problem of low transmission speed.
本申请可在数据接收端实时解压,将未传输完成的完成的文件临时存储并记录文件位置,在数据接收端请求文件时将未完成的文件大小以及位置通知数据发送端,数据发送端根据接收到的文件相对位置,找到数据发送端的对应文件的对应位置。This application can decompress the data in real time at the data receiving end, temporarily store the completed files that have not been transferred, and record the file location. When the data receiving end requests the file, it will notify the data sending end of the unfinished file size and location, and the data sending end will notify the data sending end according to the receiving end. To the relative position of the file, find the corresponding position of the corresponding file at the data sending end.
本申请在发送文件的压缩流之前先生成一个临时的压缩文件,此文件的命名可根据下一个将发送的文件名添加字母符号等,真实文件中无法使用的字符作为前缀,防止和文件夹中真实名称重复,还可以将临时文件和即将发送的文件关联起来,数据接收端可通过相同的规则确定此文件是否是真实的文件,还是记录下一个文件信息的临时文件。此临时文件的信息包含下一个文件的位置,大小,断点续传等相关信息。数据接收端收到此文件时可解析这些信息,根据大小可以计算进度,断点续传的信息可以执行断点续传操作。This application generates a temporary compressed file before sending the compressed stream of the file. The name of this file can be based on the next file name to be sent by adding letter symbols, etc., and characters that cannot be used in the real file are used as prefixes to prevent and folder The real name is repeated, and the temporary file can also be associated with the file to be sent. The data receiving end can determine whether this file is a real file or a temporary file that records the next file information through the same rules. The information of this temporary file includes the location, size of the next file, breakpoint resumption and other related information. When the data receiving end receives this file, it can parse the information, calculate the progress based on the size, and perform a resumable transmission operation on the information that can be resumed at a breakpoint.
本申请提出的一种文件传输方法,可以有效减少网络请求,节省传输时间,提高传输速度和传输成功率,同时仍然支持断点续传和进度计算。The file transmission method proposed in this application can effectively reduce network requests, save transmission time, improve transmission speed and transmission success rate, while still supporting breakpoint resumption and progress calculation.
本公开实施例提供一种文件传输装置。图4是根据一示例性实施例示出的一种文件传输装置结构示意图一。如图4所示,文件传输装置,应用于数据发送端包括:An embodiment of the present disclosure provides a file transmission device. Figure 4 is a schematic structural diagram of a file transmission device according to an exemplary embodiment. As shown in Figure 4, the file transfer device used at the data sending end includes:
第一处理单元41,用于建立与数据接收端之间的通信连接;The first processing unit 41 is used to establish a communication connection with the data receiving end;
第二处理单元42,用于发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;The second processing unit 42 is configured to send folder information of the folder to be transferred to the data receiving end, where the folder information at least includes directory information of the folder to be transferred in the storage area;
第三处理单元43,用于接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;The third processing unit 43 is configured to receive a file transfer request sent by the data receiving end. The file transfer request is used to instruct the data sending end to send the to-be-transmitted files in the to-be-transmitted folder to the data receiving end. file; the file transfer request includes at least the file information of all files to be transferred in the folder to be transferred;
第四处理单元44,用于基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。The fourth processing unit 44 is configured to send the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request.
本公开实施例中,在数据发送端和数据接收端进行文件传输时,可采用压缩数据流的形式进行线上传输,在发送方和接收方建立连接后,首先确认双方是否支持此压缩文件传输方式,如果接收 方支持此压缩文件传输方式,先获取到用户选择发送的文件夹信息,文件夹信息中可不包含待传输文件信息,将文件夹信息发送给接收方;In this disclosed embodiment, when the data sending end and the data receiving end perform file transmission, the compressed data stream can be used for online transmission. After the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission. way if receiving If the party supports this compressed file transmission method, it first obtains the folder information that the user chooses to send. The folder information does not need to contain the file information to be transferred, and then sends the folder information to the recipient;
接收方在接收文件夹信息后,检查本地是否已经传输过此文件夹,并确定文件夹传输的待传输文件的文件信息。本地没有传输过此文件夹时,建立该待传输文件夹,以压缩数据流的形式接收数据发送端发送的待传输文件。After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
本公开实施例中,数据发送端向数据接收端发送文件前,接收到数据接收端发送的文件传输请求,该文件传输请求中包含有所述待传输文件夹中的所有待传输文件的文件信息。数据发送端根据该文件传输请求,可将待传输文件夹中的所有待传输文件发送给数据接收端,过程中不用接收一个文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。In this disclosed embodiment, before sending a file to the data receiving end, the data sending end receives a file transfer request sent by the data receiving end. The file transfer request contains the file information of all files to be transferred in the folder to be transferred. . Based on the file transfer request, the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
在一些实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述第四处理单元,用于The fourth processing unit is used to
基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
本公开实施例中,文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置等信息。文件传输时,可根据各待传输文件在传输时的顺序信息,进行文件传输。例如,文件夹中包含有多个待传输文件,包括第一待传输文件、第二待传输文件、第三待传输文件,其中,可确定出文件的传输顺序为,第一待传输文件、第二待传输文件、第三待传输文件,可传输文件时,可由第一待传输文件、第二待传输文件到第三待传输文件依次传输待传输文件。In this disclosed embodiment, the file attribute information includes file size, file type, file location in the folder to be transferred, and other information. When transferring files, the files can be transferred based on the order information of the files to be transferred. For example, the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred. The transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred. When the second file to be transferred and the third file to be transferred can be transferred, the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
本公开实施例中,所述顺序信息还可以包含有用于确定各个待传输文件传输顺序的传输条件。其中所述传输条件可以为按照各个待传输文件的文件大小,从大文件向小文件依次传输,也可以按照文件格式,先传输第一类型文件再传输第二类型文件,例如先传输文本文件,再传视频文件等。In this embodiment of the present disclosure, the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted. The transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
所述基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件,包括:The step of sending each of the files to be transmitted to the data receiving end in the form of a compressed data stream based on the sequence information of the files to be transmitted during transmission includes:
根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序,According to the transmission conditions, the transmission order of each file to be transmitted during file transmission is determined,
根据确定的传输次序,依次传输各待传输文件至数据接收端。According to the determined transmission sequence, each file to be transmitted is sequentially transmitted to the data receiving end.
在一些实施例中,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;In some embodiments, the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes location information of the data node interrupted during the file transfer;
所述第四处理单元,用于The fourth processing unit is used to
基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
本公开实施例中,在文件传输过程中,当出现文件传输中断时,数据接收端可将未传输完成的文件的数据断点信息,通过文件传输请求发送给数据发送端;由于文件传输是基于压缩数据流进行传输,在数据接收端确定的数据中断传输的位置与数据发送端对应的位置可能并不相同,因此,需要数据发送端根据接收到的数据断点信息,确定出向所述数据接收端发送未传输完成文件的数据起始信息;在发送未传输完成文件时起始数据的位置信息向数据接收端重新发送待传输文件。In this disclosed embodiment, during the file transfer process, when a file transfer interruption occurs, the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
在一些实施例中,所述第四处理单元,用于 In some embodiments, the fourth processing unit is used to
生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the The file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
本公开实施例中,数据发送端根据接收到的文件传输请求,向数据接收端发送待传输文件时,可先生成一个临时文件。每次发送一个待传输文件时都可以带有一个临时文件。该临时文件的文件格式不同于待传输文件,有利于数据接收端识别出临时文件。临时文件中包含有对应的待传输文件的文件信息,文件信息中至少包含有待传输文件的文件名称、文件原始长度,和/或数据起始信息。In this disclosed embodiment, when the data sending end sends a file to be transferred to the data receiving end according to the received file transfer request, a temporary file may be generated first. Each time a file is sent to be transferred, a temporary file can be included. The file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file. The temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
当文件传输请求中不包含有数据断点信息时,对应的临时文件可不包含有数据起始信息。当文件传输请求中包含有数据断点信息时,说明数据接收端指示数据发送端发送传输中断的文件。如此,当数据接收端接收的文件中断传输时,可通过在文件传输请求中加载未传输完成的待传输文件的数据断点信息,来恢复文件传输。When the file transfer request does not include data breakpoint information, the corresponding temporary file may not include data start information. When the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end is interrupted in transmission, the file transfer can be resumed by loading the data breakpoint information of the untransmitted file to be transferred in the file transfer request.
本公开实施例的第四方面提供一种文件传输装置。A fourth aspect of the embodiments of the present disclosure provides a file transmission device.
图5是根据一示例性实施例示出的一种文件传输装置结构示意图二。如图5所示,文件传输装置,应用于数据接收端包括:Figure 5 is a schematic structural diagram 2 of a file transmission device according to an exemplary embodiment. As shown in Figure 5, the file transfer device used at the data receiving end includes:
第一处理单元51,用于建立与数据发送端之间的通信连接;The first processing unit 51 is used to establish a communication connection with the data sending end;
第二处理单元52,用于基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;The second processing unit 52 is configured to receive the folder information of the folder to be transferred sent by the data sending end based on the communication connection, where the folder information at least includes the directory of the folder to be transferred in the storage area. information;
第三处理单元53,用于基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;The third processing unit 53 is configured to generate a file transfer request based on the folder information of the folder to be transferred. The file transfer request is used to instruct the data sending end to send the file to be transferred to the data receiving end. The files to be transferred in the folder; the file transfer request at least contains the file information of all the files to be transferred in the folder to be transferred;
第四处理单元54,用于向所述数据发送端发送所述文件传输请求,及接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。The fourth processing unit 54 is configured to send the file transfer request to the data sending end, and receive the file to be transferred transmitted by the data receiving end in the form of a compressed data stream.
本公开实施例中,数据发送端在向数据接收端发送文件夹信息时,也可以将文件夹中所有的待传输文件的文件信息一同发送给数据接收端。数据接收端根据需要确定需要的待传输文件,也可以全部接收所有的待传输文件。将包含有所有的待传输文件的文件信息的文件传输请求发送给数据发送端,指示数据发送端以压缩数据流的形式发送文件夹及文件夹中的待传输文件。In this disclosed embodiment, when the data sending end sends the folder information to the data receiving end, it can also send the file information of all the files to be transferred in the folder to the data receiving end. The data receiving end determines the files to be transmitted as needed, or can receive all the files to be transmitted. Send a file transfer request containing the file information of all files to be transferred to the data sending end, instructing the data sending end to send the folder and the files to be transferred in the folder in the form of a compressed data stream.
本公开实施例中,在数据发送端和数据接收端进行文件传输时,可采用压缩数据流的形式进行线上传输,在发送方和接收方建立连接后,首先确认双方是否支持此压缩文件传输方式,如果接收方支持此压缩文件传输方式,先获取到用户选择发送的文件夹信息,文件夹信息中可不包含待传输文件信息,将文件夹信息发送给接收方;In this disclosed embodiment, when the data sending end and the data receiving end perform file transmission, the compressed data stream can be used for online transmission. After the sender and the receiving end establish a connection, first confirm whether both parties support this compressed file transmission. method, if the recipient supports this compressed file transmission method, first obtain the folder information that the user chooses to send, and the folder information does not need to include the file information to be transferred, and then send the folder information to the recipient;
接收方在接收文件夹信息后,检查本地是否已经传输过此文件夹,并确定文件夹传输的待传输文件的文件信息。本地没有传输过此文件夹时,建立该待传输文件夹,以压缩数据流的形式接收数据发送端发送的待传输文件。After receiving the folder information, the recipient checks whether the folder has been transferred locally and determines the file information of the files to be transferred in the folder. When this folder has not been transferred locally, create the folder to be transferred and receive the files to be transferred from the data sending end in the form of a compressed data stream.
本公开实施例中,数据发送端向数据接收端发送文件前,接收到数据接收端发送的文件传输请求,该文件传输请求中包含有所述待传输文件夹中的所有待传输文件的文件信息。数据发送端根据该文件传输请求,可将待传输文件夹中的所有待传输文件发送给数据接收端,过程中不用接收一个文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。 In this disclosed embodiment, before sending a file to the data receiving end, the data sending end receives a file transfer request sent by the data receiving end. The file transfer request contains the file information of all files to be transferred in the folder to be transferred. . Based on the file transfer request, the data sending end can send all the files to be transferred in the folder to be transferred to the data receiving end. In the process, there is no need to receive a file transfer request to send a file, and there is no need to traverse all the files to be transferred in the folder. files, thereby effectively reducing file transfer time.
在一些实施例中,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;In some embodiments, the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
所述第四处理单元,用于依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。The fourth processing unit is configured to sequentially receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information.
本公开实施例中,文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置等信息。文件传输时,可根据各待传输文件在传输时的顺序信息,进行文件传输。例如,文件夹中包含有多个待传输文件,包括第一待传输文件、第二待传输文件、第三待传输文件,其中,可确定出文件的传输顺序为,第一待传输文件、第二待传输文件、第三待传输文件,可传输文件时,可由第一待传输文件、第二待传输文件到第三待传输文件依次传输待传输文件。In this disclosed embodiment, the file attribute information includes file size, file type, file location in the folder to be transferred, and other information. When transferring files, the files can be transferred based on the order information of the files to be transferred. For example, the folder contains multiple files to be transferred, including a first file to be transferred, a second file to be transferred, and a third file to be transferred. The transmission order of the files can be determined as follows: the first file to be transferred, the third file to be transferred, and the first file to be transferred. When the second file to be transferred and the third file to be transferred can be transferred, the files to be transferred can be transferred sequentially from the first file to be transferred, the second file to be transferred to the third file to be transferred.
本公开实施例中,所述顺序信息还可以包含有用于确定各个待传输文件传输顺序的传输条件。其中所述传输条件可以为按照各个待传输文件的文件大小,从大文件向小文件依次传输,也可以按照文件格式,先传输第一类型文件再传输第二类型文件,例如先传输文本文件,再传视频文件等。In this embodiment of the present disclosure, the sequence information may also include transmission conditions for determining the transmission sequence of each file to be transmitted. The transmission conditions may be sequential transmission from large files to small files according to the file size of each file to be transmitted, or the first type of file may be transmitted first and then the second type of file according to the file format, for example, a text file shall be transmitted first, Then upload video files, etc.
数据发送端根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序;The data sending end determines the transmission order of each file to be transmitted during file transmission according to the transmission conditions;
所述依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件,包括:The step of sequentially receiving each of the to-be-transmitted files transmitted by the data receiving end based on the sequence information includes:
依次接收数据发送端根据确定的传输次序,依次传输的各待传输文件。The data sending end sequentially receives the files to be transmitted sequentially according to the determined transmission order.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
存储接收的所述待传输文件的数据断点信息;Store the received data breakpoint information of the file to be transferred;
若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
本公开实施例中,在文件传输过程中,当出现文件传输中断时,数据接收端可将未传输完成的文件的数据断点信息,通过文件传输请求发送给数据发送端;由于文件传输是基于压缩数据流进行传输,在数据接收端确定的数据中断传输的位置与数据发送端对应的位置可能并不相同,因此,需要数据发送端根据接收到的数据断点信息,确定出向所述数据接收端发送未传输完成文件的数据起始信息;在发送未传输完成文件时起始数据的位置信息向数据接收端重新发送待传输文件。In this disclosed embodiment, during the file transfer process, when a file transfer interruption occurs, the data receiving end can send the data breakpoint information of the untransmitted file to the data sending end through a file transfer request; since the file transfer is based on Compressed data stream is transmitted, and the position of data interruption transmission determined at the data receiving end may not be the same as the position corresponding to the data sending end. Therefore, the data sending end needs to determine the location of the data receiving end based on the received data breakpoint information. The end sends the data starting information of the untransmitted file; when sending the untransmitted file, the position information of the starting data resends the file to be transmitted to the data receiving end.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定;Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
本公开实施例中,数据发送端根据接收到的文件传输请求,向数据接收端发送待传输文件时,可先生成一个临时文件。每次发送一个待传输文件时都可以带有一个临时文件。该临时文件的文件格式不同于待传输文件,有利于数据接收端识别出临时文件。临时文件中包含有对应的待传输文件的文件信息,文件信息中至少包含有待传输文件的文件名称、文件原始长度,和/或数据起始信息。In this disclosed embodiment, when the data sending end sends a file to be transferred to the data receiving end according to the received file transfer request, a temporary file may be generated first. Each time a file is sent to be transferred, a temporary file can be included. The file format of the temporary file is different from the file to be transmitted, which is helpful for the data receiving end to identify the temporary file. The temporary file contains file information corresponding to the file to be transferred, and the file information at least includes the file name of the file to be transferred, the original length of the file, and/or data starting information.
当文件传输请求中不包含有数据断点信息时,对应的临时文件可不包含有数据起始信息。当文件传输请求中包含有数据断点信息时,说明数据接收端指示数据发送端发送传输中断的文件。如此,当数据接收端接收的文件中断传输时,可通过在文件传输请求中加载未传输完成的待传输文件的数 据断点信息,来恢复文件传输。When the file transfer request does not include data breakpoint information, the corresponding temporary file may not include data start information. When the file transfer request contains data breakpoint information, it means that the data receiving end instructs the data sending end to send the file whose transmission is interrupted. In this way, when the file received by the data receiving end interrupts the transmission, the number of untransmitted files to be transferred can be loaded in the file transfer request. Resume file transfer based on breakpoint information.
本公开实施例中,数据接收端在接收一个待传输文件时,也会接收到一个对应的临时文件,通过根据所述文件名称确定接收的所述待传输文件是否正确;及基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。In this disclosed embodiment, when the data receiving end receives a file to be transmitted, it will also receive a corresponding temporary file and determine whether the received file to be transmitted is correct based on the file name; and based on the file to be transmitted The original file length of the file determines the reception progress of the file to be transmitted.
本公开实施例还提供一种服务器,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述各实施例所述方法的步骤。An embodiment of the present disclosure also provides a server, including: a processor and a memory used to store a computer program that can be run on the processor, wherein when the processor is used to run the computer program, the processor executes the steps of the above embodiments. Describe the steps of the method.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述各实施例所述方法的步骤。An embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, which is characterized in that when the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.
图6是根据一示例性实施例示出的一种电子设备的设备框图。例如,电子设备可以是移动电话,计算机,数字广播电子设备,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 6 is a device block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
参照图6,电子设备设备可以包括以下一个或多个组件:处理组件802,存储器804,电力组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。Referring to FIG. 6 , the electronic device may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input/output (I/O) interface 812 , and a sensor component 814 , and communication component 816.
处理组件802通常控制电子设备设备的整体操作,诸如与触摸,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device device, such as operations associated with touch, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 804 is configured to store various types of data to support operations in the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
电力组件806为电子设备的各种组件提供电力。电力组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备设备生成、管理和分配电力相关联的组件。Power component 806 provides power to various components of the electronic device. Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic equipment devices.
多媒体组件808包括在电子设备和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 808 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。 The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
传感器组件814包括一个或多个传感器,用于为电子设备提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备的打开/关闭状态,组件的相对定位,例如组件为电子设备的显示器和小键盘,传感器组件814还可以检测电子设备或电子设备一个组件的位置改变,用户与电子设备接触的存在或不存在,电子设备方位或加速/减速和电子设备的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor component 814 includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor component 814 can detect the open/closed state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, the sensor component 814 can also detect the position change of the electronic device or a component of the electronic device, the user The presence or absence of contact with the electronic device, the orientation or acceleration/deceleration of the electronic device and the temperature changes of the electronic device. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备和其他设备之间有线或无线方式的通信。电子设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 816 is configured to facilitate wired or wireless communications between electronic devices and other devices. Electronic devices can access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communications component 816 also includes a near field communications (NFC) module to facilitate short-range communications. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In exemplary embodiments, the electronic device may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common common sense or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.
工业实用性Industrial applicability
本申请提供了一种文件传输方法、文件传输装置、服务器及存储介质,包括:建立与数据接收端之间的通信连接;发送待传输文件夹的文件夹信息至数据接收端,其中文件夹信息至少包括待传输文件夹在存储区域的目录信息;接收数据接收端发送的文件传输请求,文件传输请求用于指示数据发送端向数据接收端发送待传输文件夹中的待传输文件;文件传输请求中至少包含有待传输文件夹中的所有待传输文件的文件信息;基于文件传输请求,以压缩数据流的形式,向数据接收端发送待传输文件。本申请中在数据发送端与数据接收端进行文件传输时,数据发送端根据数据接收端发送的文件传输请求,以压缩数据流的形式向数据接收端发送待传输文件。其中,数据接收端发送的文件传输请求中包含有所有待传输文件的文件信息,使得数据发送端以压缩数据流的形式将待传输文件夹发送给数据接收端后,可直接将待传输文件发送给数据接收端,不用接收一个文件传输请求发送一个文件,也不需要在文件夹中遍历所有待传输文件,从而可有效减少文件传输时间。This application provides a file transmission method, file transmission device, server and storage medium, including: establishing a communication connection with a data receiving end; sending folder information of the folder to be transmitted to the data receiving end, where the folder information At least include the directory information of the folder to be transferred in the storage area; receive a file transfer request sent by the data receiving end, and the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end; file transfer request contains at least the file information of all files to be transferred in the folder to be transferred; based on the file transfer request, the file to be transferred is sent to the data receiving end in the form of a compressed data stream. In this application, when the data sending end and the data receiving end perform file transmission, the data sending end sends the file to be transferred to the data receiving end in the form of a compressed data stream according to the file transfer request sent by the data receiving end. Among them, the file transfer request sent by the data receiving end contains the file information of all files to be transferred, so that the data sending end can directly send the files to be transferred after sending the folder to be transferred to the data receiving end in the form of a compressed data stream. To the data receiving end, there is no need to receive a file transfer request to send a file, and there is no need to traverse all files to be transferred in the folder, thus effectively reducing file transfer time.
此外,可以理解的是,本申请的文件传输方法、文件传输装置、服务器及存储介质是可以重现的,并且可以用在多种工业应用中。例如,本申请的文件传输方法、文件传输装置、服务器及存储介质可以用于数据处理技术领域。 In addition, it can be understood that the file transmission method, file transmission device, server and storage medium of the present application are reproducible and can be used in a variety of industrial applications. For example, the file transmission method, file transmission device, server and storage medium of this application can be used in the field of data processing technology.

Claims (22)

  1. 一种文件传输方法,其特征在于,应用于数据发送端包括:A file transmission method, characterized in that, applied to the data sending end, it includes:
    建立与数据接收端之间的通信连接;Establish a communication connection with the data receiving end;
    发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;Send folder information of the folder to be transferred to the data receiving end, wherein the folder information at least includes directory information of the folder to be transferred in the storage area;
    接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Receive a file transfer request sent by the data receiving end, the file transfer request is used to instruct the data sending end to send the file to be transferred in the to-be-transmitted folder to the data receiving end; in the file transfer request Contains at least the file information of all files to be transferred in the folder to be transferred;
    基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。Based on the file transfer request, the file to be transferred is sent to the data receiving end in the form of a compressed data stream.
  2. 根据权利要求1所述的文件传输方法,其特征在于,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;The file transmission method according to claim 1, wherein the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
    所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括:The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
    基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  3. 根据权利要求2所述的文件传输方法,其特征在于,所述基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件,包括:The file transmission method according to claim 2, characterized in that, based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in the form of a compressed data stream. Transfer files, including:
    根据所述传输条件,确定各待传输文件在进行文件传输时的传输次序,According to the transmission conditions, the transmission order of each file to be transmitted during file transmission is determined,
    根据确定的传输次序,依次传输各待传输文件至数据接收端。According to the determined transmission sequence, each file to be transmitted is sequentially transmitted to the data receiving end.
  4. 根据权利要求1至3中任一项所述的文件传输方法,其特征在于,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;The file transfer method according to any one of claims 1 to 3, characterized in that the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes the file Location information of data nodes interrupted during transmission;
    所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,至少包括:The method of sending the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request at least includes:
    基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
    基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  5. 根据权利要求4所述的文件传输方法,其特征在于,所述基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件,包括:The file transmission method according to claim 4, characterized in that, based on the file transmission request, sending the file to be transmitted to the data receiving end in the form of a compressed data stream includes:
    生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
    基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the The file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
  6. 根据权利要求1至5中任一项所述的文件传输方法,其特征在于,所述文件属性信息包括文件大小、文件类型、文件在待传输文件夹中的位置。The file transmission method according to any one of claims 1 to 5, characterized in that the file attribute information includes file size, file type, and the location of the file in the folder to be transferred.
  7. 一种文件传输方法,其特征在于,应用于数据接收端包括:A file transmission method, characterized in that, applied to the data receiving end, it includes:
    建立与数据发送端之间的通信连接;Establish a communication connection with the data sending end;
    基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹 信息至少包括所述待传输文件夹在存储区域的目录信息;Based on the communication connection, receive the folder information of the folder to be transmitted sent by the data sending end, wherein the folder The information at least includes the directory information of the storage area of the folder to be transferred;
    基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;Generate a file transfer request based on the folder information of the folder to be transferred, the file transfer request is used to instruct the data sending end to send the file to be transferred in the folder to be transferred to the data receiving end; The file transfer request at least includes the file information of all files to be transferred in the folder to be transferred;
    向所述数据发送端发送所述文件传输请求;Send the file transfer request to the data sending end;
    接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。Receive the file to be transmitted transmitted by the data receiving end in the form of a compressed data stream.
  8. 根据权利要求7所述的文件传输方法,其特征在于,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;The file transmission method according to claim 7, wherein the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
    所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:The data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
    依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。Receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information in sequence.
  9. 根据权利要求8所述的文件传输方法,其特征在于,所述依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件,包括:The file transmission method according to claim 8, characterized in that said sequentially receiving each of the files to be transmitted transmitted by the data receiving end based on the sequence information includes:
    依次接收所述数据发送端根据确定的传输次序,依次传输的各待传输文件。Receive each file to be transmitted sequentially transmitted by the data sending end according to the determined transmission order.
  10. 根据权利要求7至9中任一项所述的文件传输方法,其特征在于,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:The file transmission method according to any one of claims 7 to 9, characterized in that the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
    存储接收的所述待传输文件的数据断点信息;Store the received data breakpoint information of the file to be transferred;
    若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
    发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
  11. 根据权利要求10所述的文件传输方法,其特征在于,所述接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件,包括:The file transmission method according to claim 10, wherein the data receiving end transmits the file to be transmitted in the form of a compressed data stream, including:
    接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定;Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
    根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
    基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  12. 一种文件传输方法,其特征在于,包括:A file transfer method, characterized by including:
    数据发送端建立与数据接收端之间的通信连接;The data sending end establishes a communication connection with the data receiving end;
    所述数据发送端准备并发送待传输文件夹的目标信息,并建立压缩数据流;The data sending end prepares and sends the target information of the folder to be transmitted, and establishes a compressed data stream;
    所述数据接收端向所述数据发送端发送文件传输请求,接收所述待传输文件;所述文件传输请求包含有断点信息;The data receiving end sends a file transfer request to the data sending end and receives the file to be transferred; the file transfer request contains breakpoint information;
    所述数据发送端根据接收的数据断点信息准备需要发送的真实的待传输文件,并生成对应的临时文件;The data sending end prepares the real files to be transmitted that need to be sent based on the received data breakpoint information, and generates corresponding temporary files;
    所述数据发送端发送所述临时文件及真实文件至数据接收端;The data sending end sends the temporary file and the real file to the data receiving end;
    所述数据接收端接收所述真实文件,其中,若所述数据发送端从断点处发送所述真实文件,则所述数据接收端能够根据所述断点信息在所述断点处接收传输的文件,得到整体文件;若所述数据发送端发送的是完整的真实文件,则能够整体接收传输的文件。The data receiving end receives the real file, wherein if the data sending end sends the real file from the breakpoint, the data receiving end can receive the transmission at the breakpoint according to the breakpoint information. file to obtain the entire file; if the data sending end sends a complete real file, the transmitted file can be received as a whole.
  13. 一种文件传输装置,其特征在于,应用于数据发送端包括:A file transmission device, characterized in that, applied to the data sending end, it includes:
    第一处理单元,被配置用于建立与数据接收端之间的通信连接;A first processing unit configured to establish a communication connection with the data receiving end;
    第二处理单元,被配置用于发送待传输文件夹的文件夹信息至所述数据接收端,其中所述文件 夹信息至少包括所述待传输文件夹在存储区域的目录信息;The second processing unit is configured to send folder information of the folder to be transferred to the data receiving end, wherein the file The folder information at least includes directory information in the storage area of the folder to be transferred;
    第三处理单元,被配置用于接收所述数据接收端发送的文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;The third processing unit is configured to receive a file transfer request sent by the data receiving end. The file transfer request is used to instruct the data sending end to send the to-be-transmitted file in the folder to be transferred to the data receiving end. Transfer files; the file transfer request includes at least the file information of all files to be transferred in the folder to be transferred;
    第四处理单元,被配置用于基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述待传输文件。The fourth processing unit is configured to send the file to be transferred to the data receiving end in the form of a compressed data stream based on the file transfer request.
  14. 根据权利要求13所述的文件传输装置,其特征在于,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;The file transmission device according to claim 13, wherein the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
    所述第四处理单元,被配置用于The fourth processing unit is configured to
    基于所述各待传输文件在传输时的顺序信息,依次以压缩数据流的形式,向所述数据接收端发送各所述待传输文件。Based on the sequence information of the files to be transmitted during transmission, each of the files to be transmitted is sent to the data receiving end in sequence in the form of a compressed data stream.
  15. 根据权利要求13或14所述的文件传输装置,其特征在于,所述文件传输请求中至少包含有未传输完成的文件的数据断点信息,所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;The file transfer device according to claim 13 or 14, characterized in that the file transfer request contains at least data breakpoint information of the untransmitted file, and the data breakpoint information at least includes the data breakpoint information of the file that is interrupted during the file transfer. Location information of data nodes;
    所述第四处理单元,被配置用于The fourth processing unit is configured to
    基于所述数据断点信息,确定向所述数据接收端发送未传输完成文件的数据起始信息;Based on the data breakpoint information, determine to send the data start information of the untransmitted file to the data receiving end;
    基于所述数据起始信息,向所述数据接收端发送未传输完成的文件;所述数据起始信息至少包含有向所述数据接收端重新发送未传输完成文件时起始数据的位置信息。Based on the data starting information, the untransmitted file is sent to the data receiving end; the data starting information at least includes the position information of the starting data when resending the untransmitted file to the data receiving end.
  16. 根据权利要求13至15中任一项所述的文件传输装置,其特征在于,所述第四处理单元,被配置用于The file transfer device according to any one of claims 13 to 15, wherein the fourth processing unit is configured to
    生成所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或所述数据起始信息;Generate a temporary file of the file to be transferred, the temporary file at least contains file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file information at least Include the file name of the file to be transmitted, the original length of the file, and/or the data starting information;
    基于所述文件传输请求,以压缩数据流的形式,向所述数据接收端发送所述临时文件以及所述待传输文件,其中所述临时文件用于供所述数据接收端接收后,根据所述文件名称确定接收的所述待传输文件是否正确,及根据所述文件原始长度确定接收所述待传输文件的接收进度。Based on the file transfer request, the temporary file and the file to be transferred are sent to the data receiving end in the form of a compressed data stream, where the temporary file is used for the data receiving end to receive, according to the The file name is used to determine whether the received file to be transferred is correct, and the reception progress of the file to be transferred is determined based on the original length of the file.
  17. 一种文件传输装置,其特征在于,应用于数据接收端包括:A file transmission device, characterized in that, applied to the data receiving end, it includes:
    第一处理单元,被配置用于建立与数据发送端之间的通信连接;A first processing unit configured to establish a communication connection with the data sending end;
    第二处理单元,被配置用于基于所述通信连接,接收所述数据发送端发送的待传输文件夹的文件夹信息,其中所述文件夹信息至少包括所述待传输文件夹在存储区域的目录信息;The second processing unit is configured to receive the folder information of the folder to be transferred sent by the data sending end based on the communication connection, wherein the folder information at least includes the folder information of the folder to be transferred in the storage area. directory information;
    第三处理单元,被配置用于基于所述待传输文件夹的文件夹信息,生成文件传输请求,所述文件传输请求用于指示所述数据发送端向所述数据接收端发送所述待传输文件夹中的待传输文件;所述文件传输请求中至少包含有所述待传输文件夹中的所有待传输文件的文件信息;A third processing unit configured to generate a file transfer request based on the folder information of the folder to be transferred. The file transfer request is used to instruct the data sending end to send the to-be-transmitted folder to the data receiving end. The files to be transferred in the folder; the file transfer request at least contains the file information of all the files to be transferred in the folder to be transferred;
    第四处理单元,被配置用于向所述数据发送端发送所述文件传输请求,及接收所述数据接收端,以压缩数据流的形式,传输的所述待传输文件。The fourth processing unit is configured to send the file transfer request to the data sending end, and receive the file to be transferred transmitted by the data receiving end in the form of a compressed data stream.
  18. 根据权利要求17所述的文件传输装置,其特征在于,所述文件信息至少包含有所有待传输文件的文件属性信息及各待传输文件在传输时的顺序信息;The file transmission device according to claim 17, wherein the file information at least includes file attribute information of all files to be transmitted and sequence information of each file to be transmitted during transmission;
    所述第四处理单元,被配置用于依次接收所述数据接收端基于所述顺序信息传输的各所述待传输文件。The fourth processing unit is configured to sequentially receive each of the files to be transmitted transmitted by the data receiving end based on the sequence information.
  19. 根据权利要求17或18所述的文件传输装置,其特征在于,所述第四处理单元,被配置用于The file transmission device according to claim 17 or 18, characterized in that the fourth processing unit is configured to
    存储接收的所述待传输文件的数据断点信息; Store the received data breakpoint information of the file to be transferred;
    若所述待传输文件未接收完成时发生中断,则生成包含有所述数据断点信息的文件传输请求;其中所述数据断点信息至少包括文件传输时中断的数据节点的位置信息;If an interruption occurs when the file to be transferred is not received, a file transfer request containing the data breakpoint information is generated; wherein the data breakpoint information at least includes location information of the data node interrupted during file transfer;
    发送所述包含有所述数据断点信息的文件传输请求至所述数据发送端,供所述数据发送端基于所述数据断点信息,向所述数据接收端发送未传输完成的文件。Send the file transfer request including the data breakpoint information to the data sending end, so that the data sending end sends the untransmitted file to the data receiving end based on the data breakpoint information.
  20. 根据权利要求17至19中任一项所述的文件传输装置,其特征在于,所述第四处理单元,被配置用于The file transfer device according to any one of claims 17 to 19, wherein the fourth processing unit is configured to
    接收所述待传输文件的临时文件,所述临时文件至少包含有所述待传输文件的文件信息;其中所述临时文件的文件格式不同于所述待传输文件的文件格式;所述待传输文件的临时文件由所述数据发送端生成;所述文件信息至少包括有所述待传输文件的文件名称、文件原始长度,和/或数据起始信息;其中,所述数据起始信息由所述数据发送端根据接收的所述数据断点信息确定;Receive a temporary file of the file to be transferred, the temporary file at least contains the file information of the file to be transferred; wherein the file format of the temporary file is different from the file format of the file to be transferred; the file to be transferred The temporary file is generated by the data sending end; the file information at least includes the file name of the file to be transmitted, the original length of the file, and/or data starting information; wherein the data starting information is generated by the The data sending end determines according to the received data breakpoint information;
    根据所述文件名称确定接收的所述待传输文件是否正确;及Determine whether the received file to be transmitted is correct based on the file name; and
    基于所述待传输文件的所述文件原始长度确定接收所述待传输文件的接收进度。The receiving progress of receiving the file to be transmitted is determined based on the original length of the file to be transmitted.
  21. 一种服务器,其特征在于,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行根据权利要求1至12中任一项所述的方法的步骤。A server, characterized in that it includes: a processor and a memory used to store a computer program that can be run on the processor, wherein when the processor is used to run the computer program, it executes the method according to claims 1 to 12 The steps of any of the methods described.
  22. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现根据权利要求1至12中任一项所述的方法的步骤。 A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
PCT/CN2023/092344 2022-05-26 2023-05-05 File transmission method, file transmission apparatus, server and storage medium WO2023226717A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210584928.3A CN115086295A (en) 2022-05-26 2022-05-26 File transmission method, file transmission device, server and storage medium
CN202210584928.3 2022-05-26

Publications (1)

Publication Number Publication Date
WO2023226717A1 true WO2023226717A1 (en) 2023-11-30

Family

ID=83248509

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092344 WO2023226717A1 (en) 2022-05-26 2023-05-05 File transmission method, file transmission apparatus, server and storage medium

Country Status (2)

Country Link
CN (1) CN115086295A (en)
WO (1) WO2023226717A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086295A (en) * 2022-05-26 2022-09-20 北京快乐茄信息技术有限公司 File transmission method, file transmission device, server and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874231A (en) * 2005-05-31 2006-12-06 华为技术有限公司 Method for transmitting files
CN101547161A (en) * 2008-03-28 2009-09-30 阿里巴巴集团控股有限公司 Folder transmission system, folder transmission device and folder transmission method
WO2011088719A1 (en) * 2010-01-21 2011-07-28 腾讯科技(深圳)有限公司 Folder transmission method and device
CN102651716A (en) * 2011-02-24 2012-08-29 阿里巴巴集团控股有限公司 Method and system for file folder transmission in instant communication, and instant receiving client side
CN115086295A (en) * 2022-05-26 2022-09-20 北京快乐茄信息技术有限公司 File transmission method, file transmission device, server and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469038B (en) * 2010-11-15 2014-11-05 阿里巴巴集团控股有限公司 Folder transmission method and device
US9015601B2 (en) * 2011-06-21 2015-04-21 Box, Inc. Batch uploading of content to a web-based collaboration environment
CN103888513B (en) * 2014-02-25 2017-05-31 世纪龙信息网络有限责任公司 Server end multifile method for down loading and system
CN106230817B (en) * 2016-07-29 2019-04-02 中国电子科技集团公司第二十八研究所 Distributed mass data transmission method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874231A (en) * 2005-05-31 2006-12-06 华为技术有限公司 Method for transmitting files
CN101547161A (en) * 2008-03-28 2009-09-30 阿里巴巴集团控股有限公司 Folder transmission system, folder transmission device and folder transmission method
WO2011088719A1 (en) * 2010-01-21 2011-07-28 腾讯科技(深圳)有限公司 Folder transmission method and device
CN102651716A (en) * 2011-02-24 2012-08-29 阿里巴巴集团控股有限公司 Method and system for file folder transmission in instant communication, and instant receiving client side
CN115086295A (en) * 2022-05-26 2022-09-20 北京快乐茄信息技术有限公司 File transmission method, file transmission device, server and storage medium

Also Published As

Publication number Publication date
CN115086295A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
US8583086B2 (en) Mobile terminal and chat method in a mobile terminal using an instant messaging service
WO2016134600A1 (en) Method and apparatus for detecting intelligent device
JP2017504921A (en) Instant messaging method, apparatus, program, and recording medium
US11558494B2 (en) Method and apparatus for processing data, user equipment and computer-readable storage medium
WO2015149524A1 (en) Method, device, and system for handling a busy call line
WO2023226717A1 (en) File transmission method, file transmission apparatus, server and storage medium
US11375403B2 (en) Method and apparatus for detecting maximum transmission unit value
WO2017101345A1 (en) Video playing method and apparatus
CN111654450A (en) Data transmission method and device and storage medium
CN115208810A (en) Forwarding flow table accelerating method and device, electronic equipment and storage medium
TWI735533B (en) Message management method and device, message pre-reading method and device
EP2660680A1 (en) System and method for enabling collaborative gesture-based sharing of ressources between devices
CN109669552A (en) Conversation processing method, device and storage medium
CN104219299B (en) Data transmission method and device
CN105187154A (en) Response packet reception time delay method and response packet reception time delay device
WO2017024739A1 (en) Method of transmitting file and device utilizing same
CN114430410B (en) System access method, device and equipment based on virtual domain name
WO2020015137A1 (en) Short message retransmission method and apparatus, and device and storage medium
WO2020014900A1 (en) Message display method and terminal
WO2017107543A1 (en) Information input method and apparatus
CN113692067A (en) Device connection method, device and readable storage medium
CN107071707A (en) Data transmission method and device
JP6225959B2 (en) Information processing apparatus with communication function, processing method thereof, and program
WO2023221117A1 (en) Message receiving method, apparatus, storage medium and electronic device
CN109587348B (en) Communication information management method, mobile terminal, and computer-readable storage medium

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: 23810790

Country of ref document: EP

Kind code of ref document: A1