CN112351086A - File transmission method, device, equipment and computer readable storage medium - Google Patents

File transmission method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN112351086A
CN112351086A CN202011178891.1A CN202011178891A CN112351086A CN 112351086 A CN112351086 A CN 112351086A CN 202011178891 A CN202011178891 A CN 202011178891A CN 112351086 A CN112351086 A CN 112351086A
Authority
CN
China
Prior art keywords
file
message
data
data block
data blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011178891.1A
Other languages
Chinese (zh)
Other versions
CN112351086B (en
Inventor
沈传宝
郝伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Huayuan Information Technology Co Ltd
Original Assignee
Beijing Huayuan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Huayuan Information Technology Co Ltd filed Critical Beijing Huayuan Information Technology Co Ltd
Priority to CN202011178891.1A priority Critical patent/CN112351086B/en
Publication of CN112351086A publication Critical patent/CN112351086A/en
Application granted granted Critical
Publication of CN112351086B publication Critical patent/CN112351086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/1085Resource delivery mechanisms involving dynamic management of active down- or uploading connections

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

Embodiments of the present disclosure provide a file transfer method, apparatus, device, and computer-readable storage medium. The method comprises the steps that a sending end obtains a file to be transmitted, and the file is split to obtain a plurality of data blocks; respectively performing message encapsulation on the plurality of data blocks according to a preset transmission protocol; and sending the message to a file receiving end. The receiving end receives the message; acquiring and storing the data block carried in the message according to the preset transmission protocol; and after the data blocks are completely received, combining the data blocks into the file. In this way, the files can be prevented from being eavesdropped in the transmission process, other people are prevented from stealing and recombining the files through analyzing the protocol, the transmission safety of file data on the network is effectively improved, and the data transmission process is privatized.

Description

File transmission method, device, equipment and computer readable storage medium
Technical Field
Embodiments of the present disclosure relate generally to the field of computer technology, and more particularly, to a file transfer method, apparatus, device, and computer-readable storage medium.
Background
A common data transmission application is a network file transmission based on a protocol, and the common data transmission protocol includes: the disclosed transmission modes are transparent due to the protocol disclosure, so that data can be easily stolen and recombined through analysis of the protocol after the network is monitored during transmission. In addition, these file transfers are generally not possible to continue after the transfer is disconnected. Meanwhile, some protocols are limited by platforms, for example, SMB cannot be used on a Linux platform, SSH communication is not easily implemented under Windows, for example, CIFS is used for sharing between Unix and Windows, and NFS is used for sharing between Unix and Unix.
Disclosure of Invention
According to the embodiment of the disclosure, a file transmission scheme is provided, so that data stealing and recombination after the files are monitored in the transmission process are avoided. And the breakpoint continuous transmission of the file is realized, and the file transmission is not limited by a platform.
In a first aspect of the present disclosure, a file transmission method is provided, which is applied to a file sending end, and includes:
acquiring a file to be transmitted, and splitting the file to obtain a plurality of data blocks;
respectively performing message encapsulation on the plurality of data blocks according to a preset transmission protocol;
sending the message to a file receiving end; wherein the content of the first and second substances,
the preset transport protocol defines the following fields including: IP, TaskID, CMD, Parameters, Index, Capacity, Length, Data.
The above-described aspect and any possible implementation manner further provide an implementation manner, where, in a field defined by the preset transport protocol:
the IP field is the IP address of the file sending end;
the task ID field is the transmission number of the message;
the CMD field is a control command and comprises the steps of appointing the information to start transmission, file information, data block information, breakpoint continuous transmission and transmission suspension;
the Parameters field is the transmission parameter of the CMD;
the Index field is the Index of the data block in the file;
the Capacity field is the total block number of the data block;
the Length field is the size of the data block;
and the Data field is a Data block obtained by splitting the file.
In a second aspect of the present disclosure, a file transmission method is provided, which is applied to a file receiving end, and includes:
receiving a message sent by a file sending end;
acquiring and storing the data block carried in the message according to the preset transmission protocol;
and after the data blocks are completely received, combining the data blocks into the file.
As to the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, before the obtaining and storing the data block carried in the message, the method further includes:
classifying the message according to a field in the preset transmission protocol,
if the field is 0, a command message is represented, and the command message contains a control command for the message;
otherwise, the data message is a data message, and the data message contains the data block.
As to the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, where the obtaining and storing the data block carried in the message according to the preset transmission protocol includes:
and establishing a task list according to the control command of the message, and recording the stored data blocks.
As to the above-mentioned aspect and any possible implementation manner, there is further provided an implementation manner, where the obtaining and storing the data block carried in the message according to the preset transmission protocol includes:
and finishing the establishment of the task list when the data block is completely received according to the Index and/or Capacity fields.
In a third aspect of the present disclosure, a file transmission apparatus is provided, which is applied to a file sending end, and includes:
the file splitting module is used for obtaining a file to be transmitted and splitting the file to obtain a plurality of data blocks;
the message encapsulation module is used for respectively encapsulating the messages of the data blocks according to a preset transmission protocol;
and the message sending module is used for sending the message to a file receiving end.
In a fourth aspect of the present disclosure, there is provided a file transmission apparatus applied to a file receiving end, the apparatus including:
the message receiving module is used for receiving a message sent by the file sending end; the message is obtained by respectively carrying out message encapsulation on a plurality of data blocks obtained by splitting a file to be transmitted according to a preset transmission protocol;
a data block obtaining module, configured to obtain and store a data block carried in the message according to the preset transmission protocol;
and the data block merging module is used for merging the data blocks into the file after the data blocks are completely received.
In a fifth aspect of the present disclosure, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor implementing the method as described above when executing the program.
In a sixth aspect of the present disclosure, a computer readable storage medium is provided, on which a computer program is stored, which program, when executed by a processor, performs the method according to the first, second aspect of the present disclosure.
According to the file transmission method, the file transmission device, the electronic equipment and the computer readable storage medium, the data blocks obtained by splitting the file are packaged according to the preset transmission protocol of the invention, after the data blocks are sent and received, the file receiving end integrates the data blocks to obtain the complete original file, the file is prevented from being eavesdropped in the transmission process, other people are prevented from stealing and recombining the file through the analysis protocol, and the transmission safety of the file data on the network is effectively improved. The method comprises the steps of presetting a transmission protocol, defining specific fields required by message transmission, and establishing a private protocol between a file sending end and a file receiving end to privatize the data transmission process.
Meanwhile, the invention supports breakpoint continuous transmission, and the file receiving end continues to receive the data blocks which are not received from the transmission breakpoint position according to the control instruction, and does not receive the received data blocks any more.
Moreover, file transmission is not limited by platforms, and files can be transmitted among platforms such as Linux, Unix, Mac OS and Windows. The file transmission method of the invention divides the file into a plurality of data blocks for transmission in blocks, thereby improving the file transmission efficiency and facilitating the transmission of large files.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:
fig. 1 shows a flowchart of a file transfer method applied to a file sending end according to an embodiment of the present disclosure;
fig. 2 shows a flowchart of a file transmission method applied to a file receiving end according to an embodiment of the present disclosure;
FIG. 3 shows a flowchart of a file transfer method applied to a file receiving end according to an embodiment of the present disclosure;
fig. 4 shows a block diagram of a file transfer apparatus applied to a file transmitting end according to an embodiment of the present disclosure;
fig. 5 shows a block diagram of a file transmitting apparatus applied to a file receiving end according to an embodiment of the present disclosure;
FIG. 6 illustrates a block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 shows a flowchart of a file transmission method applied to a file sending end according to an embodiment of the present disclosure.
The file sending terminal may be a sending device using various platforms, including Linux, Unix, Mac OS, and Windows, and other platforms, and the sending device is not limited to a computer, a notebook computer, a tablet computer, a mobile phone, and the like.
The file transmission method of the embodiment of the disclosure has the following steps at the file sending end:
step S102, a file to be transmitted is obtained, and the file is split to obtain a plurality of data blocks.
Specifically, a file to be transmitted is split to obtain data blocks in which file data are stored, each data block is a storage unit, data stored in a plurality of data blocks can be combined to obtain a complete original file, and each data block is used as a transmission unit to be transmitted.
In this embodiment, the data chunks split in one file may be specified to have a consistent size or may not have a consistent size, and each data chunk has a maximum of 65536 bytes.
And step S104, respectively performing message encapsulation on the plurality of data blocks according to a preset transmission protocol.
In this embodiment, the predetermined transport protocol defines the following fields, including: IP, TaskID, CMD, Parameters, Index, Capacity, Length, Data.
Specifically, the IP field is an IP address of the file sending end, and the file receiving end determines a sender of the file according to the IP address and sets the size of the sender to be 4 bytes; the task id field is a transmission number of the message, in this embodiment, the message containing the data block is numbered according to an index of the data block, in other embodiments, the message not containing data but only containing a command is also numbered, and the size of the message is set to 4 bytes; the CMD field is a control command, which includes specifying information start transmission, file information, data block information, breakpoint resume, transmission abort, and setting the size of the CMD field to be 1 byte, and in some embodiments, the CMD field is a control command for confirming that a file receiving end can stop receiving, and sending a file end symbol to the file receiving end after all data blocks are sent; the Parameters field is a transmission parameter of CMD, and the size of the parameter field is set to be 10 bytes; the Index field is an Index of the data blocks in the file, specifies the sorting mode of each data block in the file, and sets the size of the data block to be 2 bytes; the Capacity field is the total block number of the data blocks, and the size of the Capacity field is set to be 2 bytes according to the number of all the data blocks contained in the split file; the Length field is the size of the data block, and the size of the Length field is set to be 2 bytes; the Data field is a Data block obtained by splitting the file, and the maximum Data block is 65536 bytes.
And respectively carrying out message encapsulation on the plurality of data blocks obtained by splitting according to a preset transmission protocol with the defined field, and encapsulating to obtain a plurality of messages to be sent. The message comprises a Data message, and the Data message is packaged with a Data block storing file Data in a Data field. The message also includes a command message, Data in the command message is null, or information of the file, such as a file name, a number of a plurality of split Data blocks, a file index, and the like, is acquired and stored.
The specified field is identified at the file sending end, and is identified as 0 for command messages and as other characters than 0 for data messages.
In the embodiment, the data block is encrypted, and the encryption type and the key are specified in the Parameters field, so that the data security is further improved. The encryption type may be an existing encryption algorithm such as MD5, DES, 3DES, RC4, RSA, DSA, etc., and is set according to the user's usage. For example, using MD5 encryption method, a command for verifying a data block by MD5 is recorded in the CMD field, and an MD5 value is recorded in the Parameters field.
For example, a 1GB file is split into a fixed size of 64KB, resulting in 16384 data blocks. And then, the message is encapsulated according to the preset transmission protocol, and the file sending end obtains 16386 messages shown in the following table.
TABLE 1
Figure BDA0002749535030000081
As shown in table 1, the TaskID of the file transfer job, i.e., the transfer number 01FE AB 01, is set. The 1 st command message CMD is 0 × 00, indicating that the file receiving end (e.g., server) is notified that a Data block is ready to be received, the flag Capacity is 0, and the Data field is empty.
The messages from 2 to 16385 are Data messages, CMD is 0 × 01, which indicates that Data block transmission is performed, Data fields respectively store Data blocks obtained by splitting, indexes are arranged from 0 to 16383, Capacity stores the total number of the Data blocks as 16384, and Length stores the size of the Data block as 65536 bytes. Paramters stores parameters for data block validation, for example, processing each data message using the MD5 algorithm, producing a 128-bit (16-byte) hash value, stored in the message header or Paramters field, and checking the first 10 bytes of the MD5 value when checking is specified in Paramters. And the data block verification is carried out after the transmission of all the data blocks is finished, and the verification times and the transmission time length are optimized. After receiving the verification result returned by the file receiving end, the file sending end returns a command message if the data block is completely received, wherein the CMD is 0 multiplied by 02, which indicates that the verification is completed and the transmission is finished.
In other embodiments, the encapsulation results in a block of data that is not encrypted.
And step S106, sending the message to a file receiving end.
And the file sending end and the file receiving end are connected, and the message obtained by packaging according to the preset transmission protocol is sent to the file receiving end.
Fig. 2 shows a flowchart of a file transmission method applied to a file receiving end according to an embodiment of the present disclosure.
The file receiving end can use sending equipment of various platforms, including Linux, Unix, Mac OS, Windows and other platforms, and the sending equipment is not limited to computers, laptops, tablet computers and mobile phones.
The file transmission method of the embodiment of the disclosure has the following steps at the file sending end:
step S202, receiving the message sent by the file sending end.
The file receiving end receives the encapsulated message sent by the file sending end and decapsulates the message.
After step S202, the following steps are also included before step S204 is executed:
the messages are classified according to fields in a preset transmission protocol,
if the field is 0, the message is a command message, and the command message contains a control command, namely the Data field is empty or contains information of the file instead of Data of the file; otherwise, the message is a Data message, the Data message comprises a Data block, and the Data field comprises Data of the file.
When the received message is a command message, processing a corresponding Data block according to a control command contained in the command message, wherein the corresponding Data block is an execution object for setting the control command according to the task ID or file information and Data block information in the CMD, the control command of the command message is recorded in a CMD field, and the parameter of the control command is recorded in a Parameters field or the parameter of the control command is recorded in a Data field.
When the received message is a data message, step S204 is performed.
For example, classifying the message according to the Capacity field, wherein if the Capacity is 0, the message is a command message; otherwise the message is a data message.
In some embodiments, if a data message is received first and a command message is not received, a data buffer is established according to a control command, the message is cached until the command message is received, and subsequent storage operation is started
And step S204, acquiring and storing the data block carried in the message according to the preset transmission protocol.
And acquiring the Data block contained in the Data in the received message, processing the Data block according to the control command of the CMD in the message, judging the transmission state of the current Data block to be transmission starting, breakpoint continuous transmission or transmission stopping and the like, and executing a corresponding command.
In this embodiment, the data block is decrypted. And decrypting the data block according to the encryption and decryption mode set by the user.
In other embodiments, the data block is received without encryption.
Further, the obtained information of the data block is stored on the hard disk, and the information comprises IP, TaskID, Index, Capacity and Length. In some embodiments, a data block receiving and storing is completed and then the end of the data block is fed back to the file sender, which confirms that the data block receiving is completed.
Further, a data buffer area is established according to the control command, the stored data block is temporarily stored in the memory or the hard disk, the temporary storage also comprises data messages such as IP, TaskID, Index, Capacity, Length and the like, and the stored data block is buffered. When a file receiving end receives data blocks, the data blocks are generally difficult to receive according to a sending sequence, and the data blocks are firstly completely cached and then subsequently processed, so that ordered combination of files is facilitated. The file with a small storage data amount may be directly output without temporary storage and subjected to step S206.
And after the data blocks are successfully received, continuously searching the data blocks which are not received in the Index according to the Index, and when the total number of the received data blocks is determined to be equal to the set number in the sending process according to the Capacity contained in at least one data message, and when the Index of the data blocks is determined to be complete and/or the task number is determined to be complete according to the Index and/or the task ID, completely receiving all the data blocks in the file. And after all the data blocks under the file are completely received, sending the information to be confirmed which is completely received to a file sending end.
In some embodiments, after the file sending end finishes sending or after the data block is completely received, a file end symbol is sent to the file receiving end to inform the file receiving end that the file transmission is finished.
Step S206, after the data blocks are completely received, merging the data blocks into the file.
In this embodiment, after receiving a plurality of data blocks of a file completely, a storage location of each data block on a memory or a hard disk is searched. And searching the position of the data block in the file according to the Index of the data block in the file specified by the Index, and integrating the data block according to the Index.
Fig. 3 shows a flowchart of a file transmission method applied to a file receiving end according to an embodiment of the present disclosure.
Step S204 further includes the steps of:
step S302, according to the control command of the message, a task list is established, and the stored data blocks are recorded.
And respectively establishing task lists for different files, wherein when one task list is established, all data blocks under the current file are contained under the task list.
The control command for the message may be a CMD in the data message, or may be a control command included in the command message.
If the control command is to start transmission, a task list corresponding to the file is established, the stored data blocks are continuously recorded, the storage positions, the task ids, the indexes and the capacities of the data blocks are recorded, and corresponding tasks of the data blocks, such as transmission start, successful reception, transmission stop, continuous transmission and the like, can also be recorded. In some embodiments, the data blocks are ordered in the task list according to the data block task number represented by the task ID.
And if the control command is transmission stop, stopping recording the stored data blocks in the task list of the corresponding file.
And if the control command is breakpoint continuous transmission, searching a task list of the corresponding file, continuing the stored data block from the breakpoint position, and searching and recording the data block which is not received and the position of the data block in the task list by the file receiving end according to the data block Index represented by the Index.
Step S304, recording the Index field in the preset transport protocol into the task list, for determining whether the data block is completely received.
In the task list, it is determined that the received data blocks are in one-to-one correspondence and complete with the indexes according to the indexes, and the method may further include determining that the total number of the received data blocks is equal to the total number of the predetermined split data blocks when the task list is sent, according to the Capacity included in at least one message, that is, the total number of the predetermined split data blocks when the task list is sent, and then the data blocks are all received and the data block merging may be performed. In some embodiments, the file receiving end sends the information to be confirmed that the data block is received completely to the file sending end, and the file sending end sends the file end symbol to the file receiving end. And the file receiving terminal confirms the completion of the establishment of the task list according to the file end symbol.
It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 4 shows a block diagram of a file apparatus 400 applied to a file sender according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus 400 includes:
a file splitting module 402, configured to obtain a file to be transmitted, split the file, and obtain multiple data blocks;
a message encapsulation module 404, configured to perform message encapsulation on the multiple data blocks according to a preset transmission protocol;
a message sending module 406, configured to send the message to a file receiving end.
Fig. 5 shows a block diagram of a file apparatus 500 applied to a file receiving end according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus 500 includes:
a message receiving module 502, configured to receive a message sent by a file sending end; the message is obtained by respectively carrying out message encapsulation on a plurality of data blocks obtained by splitting a file to be transmitted according to a preset transmission protocol;
a data block obtaining module 504, configured to obtain and store a data block carried in the message according to the preset transmission protocol;
a data block merging module 506, configured to merge the multiple data blocks into the file after the multiple data blocks are completely received.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
FIG. 6 illustrates a schematic block diagram of an electronic device 600 that may be used to implement embodiments of the present disclosure. As shown in fig. 6, device 600 includes a Central Processing Unit (CPU)601 that may perform various appropriate actions and processes in accordance with computer program instructions stored in a Read Only Memory (ROM)602 or loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the device 600 can also be stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processing unit 601 performs the various methods and processes described above, such as the methods. For example, in some embodiments, the file transfer methods described above may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more steps of the method described above may be performed. Alternatively, in other embodiments, CPU 601 may be configured to perform the method by any other suitable means (e.g., by way of firmware).
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a load programmable logic device (CPLD), and the like.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A file transmission method is applied to a file sending end and is characterized by comprising the following steps:
acquiring a file to be transmitted, and splitting the file to obtain a plurality of data blocks;
respectively performing message encapsulation on the plurality of data blocks according to a preset transmission protocol;
sending the message to a file receiving end; wherein the content of the first and second substances,
the preset transport protocol defines the following fields including: IP, TaskID, CMD, Parameters, Index, Capacity, Length, Data.
2. The method of claim 1,
in the fields defined by the preset transmission protocol:
the IP field is the IP address of the file sending end;
the task ID field is the transmission number of the message;
the CMD field is a control command and comprises the steps of appointing the information to start transmission, file information, data block information, breakpoint continuous transmission and transmission suspension;
the Parameters field is the transmission parameter of the CMD;
the Index field is the Index of the data block in the file;
the Capacity field is the total block number of the data block;
the Length field is the size of the data block;
and the Data field is a Data block obtained by splitting the file.
3. A file transmission method is applied to a file receiving end and is characterized in that,
receiving a message sent by a file sending end, wherein the message is obtained by respectively carrying out message encapsulation on a plurality of data blocks obtained by splitting a file to be transmitted according to a preset transmission protocol;
acquiring and storing the data block carried in the message according to the preset transmission protocol;
and after the data blocks are completely received, combining the data blocks into the file.
4. The file transmission method according to claim 3, wherein before the obtaining and storing the data block carried in the message, the method further comprises:
classifying the message according to a field in the preset transmission protocol,
if the field is 0, a command message is represented, and the command message contains a control command for the message;
otherwise, the data message is a data message, and the data message contains the data block.
5. The file transmission method according to claim 3, wherein the acquiring and storing the data block carried in the message according to the preset transmission protocol includes:
and establishing a task list according to the control command of the message, and recording the stored data blocks.
6. The file transmission method according to claim 5, wherein the acquiring and storing the data block carried in the message according to the preset transmission protocol includes:
and recording an Index field in the preset transmission protocol into the task list for judging whether the data block is completely received.
7. A file transmission device is applied to a file sending end and comprises:
the file splitting module is used for obtaining a file to be transmitted and splitting the file to obtain a plurality of data blocks;
the message encapsulation module is used for respectively encapsulating the messages of the data blocks according to a preset transmission protocol;
and the message sending module is used for sending the message to a file receiving end.
8. A file transmission device is applied to a file receiving end and comprises:
the message receiving module is used for receiving a message sent by the file sending end; the message is obtained by respectively carrying out message encapsulation on a plurality of data blocks obtained by splitting a file to be transmitted according to a preset transmission protocol;
a data block obtaining module, configured to obtain and store a data block carried in the message according to the preset transmission protocol;
and the data block merging module is used for merging the data blocks into the file after the data blocks are completely received.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of any one of claims 1 to 6.
CN202011178891.1A 2020-10-29 2020-10-29 File transmission method, apparatus, device and computer readable storage medium Active CN112351086B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011178891.1A CN112351086B (en) 2020-10-29 2020-10-29 File transmission method, apparatus, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011178891.1A CN112351086B (en) 2020-10-29 2020-10-29 File transmission method, apparatus, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112351086A true CN112351086A (en) 2021-02-09
CN112351086B CN112351086B (en) 2023-11-28

Family

ID=74356964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011178891.1A Active CN112351086B (en) 2020-10-29 2020-10-29 File transmission method, apparatus, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112351086B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113472874A (en) * 2021-06-28 2021-10-01 北京明略软件系统有限公司 File concurrent transmission method, system, storage medium and electronic equipment
WO2023273725A1 (en) * 2021-06-30 2023-01-05 北京字节跳动网络技术有限公司 File downloading method and apparatus, storage medium and electronic device
CN115987975A (en) * 2022-12-30 2023-04-18 深圳市章江科技有限公司 File transmission method, system and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109462666A (en) * 2019-01-18 2019-03-12 北京铁道工程机电技术研究所股份有限公司 Remote auto transmission method, device and the storage medium of file
CN111783123A (en) * 2020-07-03 2020-10-16 上海明略人工智能(集团)有限公司 File processing method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109462666A (en) * 2019-01-18 2019-03-12 北京铁道工程机电技术研究所股份有限公司 Remote auto transmission method, device and the storage medium of file
CN111783123A (en) * 2020-07-03 2020-10-16 上海明略人工智能(集团)有限公司 File processing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113472874A (en) * 2021-06-28 2021-10-01 北京明略软件系统有限公司 File concurrent transmission method, system, storage medium and electronic equipment
WO2023273725A1 (en) * 2021-06-30 2023-01-05 北京字节跳动网络技术有限公司 File downloading method and apparatus, storage medium and electronic device
CN115987975A (en) * 2022-12-30 2023-04-18 深圳市章江科技有限公司 File transmission method, system and computer readable storage medium

Also Published As

Publication number Publication date
CN112351086B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
CN112398916B (en) File transmission method and device based on HTTP (hyper text transport protocol)
CN112351086A (en) File transmission method, device, equipment and computer readable storage medium
CN109194625B (en) Client application protection method and device based on cloud server and storage medium
CN107786331B (en) Data processing method, device, system and computer readable storage medium
CN104618498A (en) Data resource synchronizing method and server
EP3819802A1 (en) Data consistency checking method and data uploading/downloading apparatus
CN112912847A (en) Method and related device for over-the-air upgrading
CN107454590A (en) A kind of data ciphering method, decryption method and wireless router
CN108881454B (en) File transmission method, mobile terminal and storage medium
CN109729000B (en) Instant messaging method and device
CN112597337A (en) Method, device, equipment and medium for viewing video monitoring content
US20210099432A1 (en) Data consistency verification method, and data uploading and downloading device
CN107872315B (en) Data processing method and intelligent terminal
CN111737718A (en) Encryption and decryption method and device for jar packet, terminal equipment and storage medium
CN112231765A (en) Data transmission method and device, electronic equipment and storage medium
CN111866864B (en) Method, device and storage medium for realizing encrypted storage and safe use management of cloud platform certificate based on wireless AP
CN112214270A (en) Page redrawing method, device, equipment and storage medium
CN112565288A (en) Method and system for executing internal network acquisition and control instruction on external network
CN111683051A (en) Log processing method and related equipment
CN112771815A (en) Key processing method and device
CN111090616A (en) File management method, corresponding device, equipment and storage medium
CN111651425A (en) Data extraction method and device for data mart, terminal and storage medium
CN113704206B (en) Metadata processing method and device, electronic equipment and storage medium
CN111835613A (en) Data transmission method of VPN server and VPN server
CN102663276B (en) System and method providing uniform interface for user space information abstract, encryption and compression in Linux operation system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant