File transmission method and device, computer device and storage medium
By splitting files into blocks for parallel transmission and optimizing the data link using multi-threading and framework structures, the problem of limited transmission speed for large-volume files in blockchain systems is solved, achieving fast and efficient file transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2026-03-27
AI Technical Summary
How to quickly transfer large amounts of data to the distributed storage space of the blockchain within a limited time, thus solving the problem of limited file transfer speed in the blockchain operating system.
The file is divided into information blocks, and sent and received in parallel through multi-threading. By utilizing parallel sending and receiving threads, main frame and sub-frame structure, data link selection is optimized, acknowledgment protocols are reduced, and concurrent file transmission is achieved.
It improves the speed of large file transfer, ensuring that files can be transferred within a limited time in the blockchain operating system, thereby increasing the success rate and efficiency of the transfer.
Smart Images

Figure CN115695408B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchain, in particular to a file transmission method and device, computer equipment and storage medium. BACKGROUND
[0002] With the wide application of blockchain to enterprise software systems, the unalterable characteristics of information stored on the blockchain are used in the information permanent storage mechanism. The blockchain operating system has the characteristics of decentralization, and relies on fast and efficient network data transmission technology to realize the distributed storage of large data files.
[0003] Limited by the block chain system generation speed of the blockchain, large data files must be transmitted to the distributed file storage space of the blockchain within a limited and determined time, and a unique identifier (digital fingerprint) is recorded on the block.
[0004] How to realize the fast transmission of large data files within a limited time has become a prerequisite for the application of the blockchain operating system in enterprise software systems. SUMMARY
[0005] Therefore, it is necessary to provide a file transmission method, device, computer equipment and storage medium capable of realizing the fast transmission of large data files within a limited time.
[0006] A file transmission method applied to a sending end, the method comprising:
[0007] sending a transmission space establishment request to a receiving end, the transmission space establishment request carrying at least a block assembly time period and a file size;
[0008] receiving a transmission space establishment response corresponding to the transmission space establishment request sent by the receiving end, the transmission space establishment response carrying at least an information block size and an information block identifier, the information block size and the information block identifier being generated according to the block assembly time period and the file size;
[0009] dividing the file into at least one information block according to the information block size and the file size;
[0010] allocating the information block identifier to the information block, and each information block corresponding to one information block identifier;
[0011] sending the information block to the receiving end through at least two parallel sending threads.
[0012] In one embodiment, before the information block is sent to the receiving end through the at least two parallel threads, the method further comprises:
[0013] constructing a sending main frame with the information block identifier as a key value, and generating a frame identifier of the sending main frame;
[0014] filling the information block into the sending main frame based on the information block identifier, and binding the frame identifier of the sending main frame to the information block;
[0015] copying at least one sending sub-frame from the main frame and changing the frame identifier to a frame identifier of the sending sub-frame; the number of the sending sub-frames is consistent with the number of receiving sub-frames;
[0016] allocating different parallel data links to corresponding information blocks; the corresponding information blocks refer to information blocks with the same information block identifier and different frame identifiers;
[0017] the sending of the information blocks to the receiving end through at least two parallel threads includes:
[0018] sending the information blocks in parallel through the data links to which the information blocks are allocated.
[0019] In one embodiment, the method further includes:
[0020] receiving a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least information block information on the receiving main frame;
[0021] when the information block information indicates that the information blocks on the receiving main frame come from the sending sub-frames, adjusting the data links to which the information blocks on the sending main frame are allocated to data links to which corresponding information blocks on the sending sub-frames are allocated.
[0022] In one embodiment, the method further includes:
[0023] receiving a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least a receiving end digital fingerprint of the file calculated by the receiving end;
[0024] calculating a sending end digital fingerprint of the file;
[0025] when the receiving end digital fingerprint and the sending end digital fingerprint are consistent, updating a transmission log to be successful and recording all the information block identifiers;
[0026] clearing the parallel threads, the main frame and the sub-frames;
[0027] sending a closing success confirmation message to the receiving end.
[0028] A file transmission method applied to a receiving end, the method comprising:
[0029] receiving a transmission space establishment request sent by a sending end, the transmission space establishment request carrying at least a block assembly time period and a size of a file;
[0030] calculating a size of an information block and an information block identifier based on the transmission space establishment request;
[0031] sending a transmission space establishment response to the sending end, the transmission space establishment response carrying at least the size of the information block and the information block identifier;
[0032] receiving the information block sent by the sending end through at least two parallel receiving threads;
[0033] synthesizing the information block into the file.
[0034] In one of the embodiments, the size of the information block is equal to the block assembly time period multiplied by a data transmission rate between the receiving end and the sending end.
[0035] In one of the embodiments, before the receiving the information block sent by the sending end through at least two parallel threads, the method further comprises:
[0036] constructing a receiving end main frame with the information block identifier as a key value;
[0037] copying at least one receiving end sub-frame according to the receiving end main frame; the number of the receiving end sub-frames is consistent with the number of sending end sub-frames;
[0038] The receiving the information block sent by the sending end through at least two parallel threads comprises:
[0039] filling the information block into the receiving end main frame based on the information block identifier;
[0040] when the position corresponding to the information block identifier on the receiving end main frame has been filled, filling the information block received later into the position corresponding to the information block identifier on the receiving end sub-frame.
[0041] In one of the embodiments, after the filling the information block into the receiving end main frame based on the information block identifier, the method further comprises:
[0042] sending a transmission space closing request to the sending end, the transmission space closing request carrying at least information block information on the receiving end main frame, the information block information being used to instruct the sending end to adjust a data link on which the information block is allocated on a sending end main frame.
[0043] In one of the embodiments, the method further comprises:
[0044] calculating a digital fingerprint of the file;
[0045] sending a transmission space closing request to the sending end, the transmission space closing request carrying at least the digital fingerprint;
[0046] receiving a message of transmission space closing success sent by the sending end;
[0047] updating a transmission log and recording all the information blocks;
[0048] clearing the parallel threads and the main frame and the secondary frame.
[0049] A file transmission device applied to a sending end, the device comprising:
[0050] a transmission space establishing request module for sending a transmission space establishing request to a receiving end, the transmission space establishing request carrying at least a block assembling time period and a file size;
[0051] a transmission space establishing response receiving module for receiving a transmission space establishing response corresponding to the transmission space establishing request sent by the receiving end, the transmission space establishing response carrying at least an information block size and an information block identification, the information block size and the information block identification being generated according to the block assembling time period and the file size;
[0052] a file cutting module for cutting the file into at least one information block according to the information block size and the file size;
[0053] an information block identification allocating module for allocating the information block identification to the information block, and each information block corresponding to one information block identification;
[0054] an information block sending module for sending the information block to the receiving end through at least two parallel sending threads.
[0055] A file transmission device applied to a receiving end, the device comprising:
[0056] a transmission space establishing request receiving module for receiving a transmission space establishing request sent by a sending end, the transmission space establishing request carrying at least a block assembling time period and a file size;
[0057] an information block calculating module for calculating an information block size and an information block identification based on the transmission space establishing request;
[0058] a transmission space establishing response module for sending a transmission space establishing response to the sending end, the transmission space establishing response carrying at least the information block size and the information block identification;
[0059] an information block receiving module, configured to receive the information blocks sent by the sending end through at least two parallel receiving threads;
[0060] an information block synthesizing module, configured to synthesize the information blocks into the file.
[0061] A computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in any of the above embodiments when executing the computer program.
[0062] A computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method in any of the above embodiments when executed by a processor.
[0063] The file transmission method, device, computer device and storage medium described above maximize the utilization of network transmission line concurrency, processor concurrency and program concurrency by dividing a file into information blocks, realize concurrent file sending, transmission and acceptance, and convert large data volume file transmission into small information block transmission. Meanwhile, the confirmation protocol is eliminated, and the transmission speed of large files is greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0064] Figure 1 a file transmission method in an embodiment;
[0065] Figure 2 a flowchart of a file transmission method on the sending end side in an embodiment;
[0066] Figure 3 a message structure diagram of a transmission space establishment request in an embodiment;
[0067] Figure 4 a message structure diagram of a transmission space establishment response in an embodiment;
[0068] Figure 5 a structure diagram of an information block in an embodiment;
[0069] Figure 6 a flowchart of constructing a sending end framework in an embodiment;
[0070] Figure 7 a structure diagram of a main framework in an embodiment;
[0071] Figure 8 a message structure diagram of a transmission space closing request in an embodiment;
[0072] Figure 9 a message structure diagram of a closing success confirmation in an embodiment;
[0073] Figure 10 Flowchart of a file transmission method on the receiving end side in one embodiment;
[0074] Figure 11 Schematic diagram of a main frame and a secondary frame on the receiving end side in one embodiment;
[0075] Figure 12 Block diagram of a file transmission device structure on the sending end side in one embodiment;
[0076] Figure 13 Block diagram of a file transmission device structure on the receiving end side in one embodiment;
[0077] Figure 14 Internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0078] To make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0079] The file transmission method provided by the present application can be applied in an application environment as shown in Figure 1 . In the application environment, a sender and a receiver are connected through a network. A data file is divided into different information blocks and filled into a main frame and a secondary frame. Figure 1 In the application environment, the sender sends information blocks to the receiver through multiple threads, and the receiver receives the information blocks through multiple threads and fills the information blocks into corresponding main frames and secondary frames. Figure 1 In the application environment, the corresponding sending threads are SP1, SP2, SP3, SP4, SP5, SP6, SP7 and SP8, and the corresponding receiving threads are RP1, RP2, RP3, RP4, RP5, RP6, RP7 and RP8.
[0080] In one embodiment, as shown in Figure 2 , a file transmission method is provided. The method is described below by taking the sender in Figure 1 as an example, which includes the following steps.
[0081] In step S202, a transmission space establishment request is sent to the receiver, and the transmission space establishment request carries at least a block assembly time period and a file size.
[0082] Specifically, the message structure of the transmission space establishment request includes a message head and a message body as shown in the following table. Figure 3 The message head includes but is not limited to a message sequence number (Message SeqNo.), a sender account, a message type, and a check sum. The message body includes but is not limited to a sender time zone, a sender timestamp, a file type (for example, text and binary type), a file size, and a block assembly time period. Among them, the file size and the block assembly time period are necessary in the transmission space establishment request.
[0083] The sender records at least two of the message sequence number, the sender account, the message type, the check sum, the sender time zone, the sending timestamp, the file type, the file size, and the block assembly time period (wherein the file size and the block assembly time period are necessary) in the transmission space establishment request, and encrypts the transmission space establishment request with a private key. Then the sender sends the encrypted transmission space establishment request to the receiver.
[0084] The block assembly time period and the life cycle of the block chain are consistent, both referring to a time period. Generally, this value is uniformly set on the block chain, for example, the whole network realizes consensus every 3 minutes, all information within 3 minutes is written into a block, and the block is linked to the target block chain. The file size is the size of the file to be sent, which can be obtained by viewing the file attribute.
[0085] Step S204, receiving the transmission space establishment response corresponding to the transmission space establishment request sent by the receiver, the transmission space establishment response carrying at least the information block size and the information block identifier, the information block size and the information block identifier being generated according to the block assembly time period and the size of the file.
[0086] Specifically, the message structure of the transmission space establishment response includes a message head and a message body as shown in the following table. Figure 4As shown, including Message Head and Message Body. Message Head includes but not limited to: Message SeqNo., Receiver Account, Message Type, CheckSum, AckMessage SeqNo., Info Block Size and Frame Size. Message Body includes Info Block ID (e.g. Block1) and corresponding Receiver Port No. (e.g. Port15).
[0087] Wherein the message block ID is randomly selected by the receiver starting number, and each to be received information block is assigned in ascending order, the receiver port is used to receive information block, the maximum port number can be configured according to the hardware performance of computer, theoretically each IP address can be configured 0-65535 ports. For ordinary computer, the default configuration is 15 ports / IP, for example, a computer has double network card and double IP, the default maximum port number of the computer is 30, the port number corresponds to the port number.
[0088] The sending end receives the message of transmission space establishment response, and the message of transmission space establishment response is encrypted by the public key and the private key of the receiving end. The sending end decrypts the transmission space establishment response by using the public key of the receiving end, and determines that the message is sent by the receiving end. The sending end decrypts the content of the transmission space establishment response by using the private key, and determines that the receiving end has agreed and created the receiving end frame and is waiting for receiving the message block of the file in the specified port.
[0089] Step S206, according to the information block size and the file size, the file is divided into at least one information block.
[0090] Wherein, the information block size is equal to the block assembly time period multiplied by the data transmission rate, and the data transmission rate is equal to the size of the transmission space establishment request message divided by the delay time. For example: the file size is 18G, the size of the transmission space establishment request message is 100K, the delay time is 100ms, and the block assembly time period is 3min. Data transmission rate = 100K / 100ms = 0.1M / 0.1s = 1M / s, information block size = 3*60*1M / s = 180M = 0.18G.
[0091] Specifically, the sending end sequentially calculates the start and end of each file chunk from the beginning and copies the file chunk to the information block, ensuring that the information block is greater than the calculated standard size and closest to the standard size. The sending end performs edge processing on the last file chunk, and when the last file chunk is less than the set range, the last file chunk and the previous file chunk are combined and copied to the last tail information block. When the last file chunk is greater than the set range, the last file chunk is copied to the last tail information block alone.
[0092] In step S208, an information block identifier is assigned to the information block, and each information block corresponds to an information block identifier.
[0093] The structure of the information block is as shown in Figure 5 The information block includes a block head and a block body. The block head includes a block identifier, a frame identifier, a creation timestamp, and a checksum. The block body includes file chunk content.
[0094] Specifically, the sending end extracts the information block identifier in the transmission space establishment response message. The information block identifier is randomly selected by the receiving end from the start number and assigned to each information block to be received in ascending order. The sending end adds the information block identifier to the information head of the information block.
[0095] Preferably, the information blocks are arranged in ascending order of information block identifiers. For example, the sending end divides the data file into 8 blocks, and assigns different information block identifiers 1, 2, 3, 4, 5, 6, 7, and 8 to different information blocks in the order of division. Each information block records its own hash identifier, and from the second information block to the last information block, the hash identifier of the previous information block is also recorded, which is used to verify whether the information blocks are arranged in the set order.
[0096] In step S210, the information blocks are sent to the receiving end through at least two parallel sending threads.
[0097] Specifically, when the number of information blocks is less than the number of threads, the sending end processes one information block with one thread. When the number of information blocks is greater than the number of threads, the sending end processes multiple information blocks with one thread. The sending end sends the information blocks to the sending end according to the information block identifier and the port number. For example, the default number of threads is 15, including 14 sending threads and 1 instruction thread, and the specific number of threads can be configured according to the hardware performance (memory, number of processor cores) of the sending end. When the total number of information blocks is 8 and the number of threads is 30, one thread processes one information block. When the total number of information blocks is 60 and the number of threads is 30, one thread processes the two information blocks in order according to the information block identifier and the corresponding frame identifier.
[0098] In the above file transmission method, the sending end divides the data file into information blocks that can be transmitted within the block assembly time period through multi-thread mode, realizes concurrent file sending, transmission and acceptance, converts large data volume file transmission into small information block transmission, and eliminates excessive confirmation protocols, thereby greatly improving the transmission speed of large files.
[0099] In one embodiment, as shown in the flowchart of Figure 6 Before sending the information blocks to the receiving end through at least two parallel threads, the following steps are further included:
[0100] Step S602: constructing a sending end master frame with the information block identifier as the key value, and generating a frame identifier of the sending end master frame.
[0101] Specifically, as shown in the master frame structure diagram of Figure 7 The sending end constructs an empty sending end master frame with the information block identifier (Block ID) as the key value (key), and generates the corresponding master frame identifier. The frame identifier is set by the sending end and the receiving end according to the same preset rule. After generating the master frame identifier, all secondary frame identifiers are generated in ascending order. For example, if the master frame identifier is 1, the secondary frame identifier is 2. The empty sending end master frame includes the key value (key) and the information block (Info Block) slot. The information block slot includes the information block identifier (Block ID), the sequence number (SeqNo.), the master frame identifier (Master Frame (1)), and the file block content (Content).
[0102] Step S604: filling the information block into the sending end master frame based on the information block identifier, and binding the frame identifier of the sending end master frame to the information block.
[0103] Specifically, the sending end finds the information block slot where the same information block identifier is located from the master frame according to the information block identifier on the information block, and fills the information block into the corresponding slot. At the same time, the sending end adds the master frame identifier to the information block header.
[0104] Step S606, copying at least one sending-end sub-frame according to the main frame and changing the frame identification to the frame identification of the sending-end sub-frame; the number of the sending-end sub-frames is consistent with the number of the receiving-end sub-frames.
[0105] Specifically, the sending end copies a sub-frame identical to the main frame according to the structure of the main frame and the information blocks on the main frame, and changes the frame identification on the sub-frame from the main frame identification to the sub-frame identification. For example, the main frame identification generated by the sending end is 1, and after copying the sub-frame, the sending end changes the frame identification of the sub-frame to 2 in ascending order, so that the frame identification of the sub-frame is 2. Meanwhile, the sending end ensures that the number of the sending-end sub-frames is consistent with the number of the receiving-end sub-frames according to the pre-set regulations. In this way, whether all the information blocks are successfully sent from the sending end to the receiving end can be accurately determined by comparing the receiving status of the information blocks of the receiving end. Generally, during the process of file transmission, the sending end and the receiving end create two frames, a main frame and a sub-frame. On the one hand, the sending end can determine the number of frames to be created according to the current hardware status of the sending end, for example, the sending end can determine the number of frames to be created according to the available memory, processor performance, network status and the like. On the other hand, the sending end needs to determine the number of frames to be created according to the properties of the file to be sent. For example, when the security of the file to be sent is the most optimal consideration, the sending end can establish three frames, a main frame and two sub-frames. After the sending end determines the number of frames to be created, the sending end sends the number of frames to be created to the receiving end through a transmission space establishment request, and waits for the confirmation of the receiving end.
[0106] Step S608, assigning different parallel data links to corresponding information blocks; the corresponding information blocks refer to information blocks with the same information block identification and different frame identifications.
[0107] Specifically, the transmission space has a three-layer structure: the first layer is the bottom physical communication link, the second layer is the data link composed of threads and ports, and the third layer is the transmission space layer established on the second layer. The sending end requests to establish the transmission space every time when transmitting a file, and the transmission space is established on multiple data links. When the sending end transmits multiple information blocks with the same information block identification and different frame identifications, the sending end selects different data links for transmission, which can improve the transmission success rate of the same information blocks in the transmission process.
[0108] For example, there are three physical communication links between the sending end and the receiving end, and the data link for thread 1 to send information block data to port 1 corresponds to two links, one of which is established on the first physical communication link, and the other is established on the second physical communication link, and the remaining one physical communication link is left as a standby and not used. The transmission space established by the sending end and the receiving end is established on the former two data links.
[0109] Step S610, sending the information blocks to the receiving end through at least two parallel threads, including: sending the information blocks in parallel through the data links to which the information blocks are assigned.
[0110] Specifically, the sending end selects a corresponding number of threads from the thread pool according to the number of information blocks and sends the information blocks in parallel. The data links through which the sending end sends the information blocks are determined in step S608. The sending end can assign the data links with high transmission success rate and fast transmission rate to the information blocks on the main framework according to the previous transmission records.
[0111] For example, according to the previous records, among the two data links through which thread 1 sends information blocks to port 1, the success rate and speed of the second data link are much higher than those of the first data link. Therefore, the next time the sending end selects the second data link as the data link for sending the information blocks on the main framework, removes the first data link, and selects the third data link (established on the third physical communication link) as the data link for sending the information blocks on the secondary framework. After testing all the data links, the sending end can find the data link with the highest success rate and speed.
[0112] In this embodiment, the sending end sends the information blocks through the creation of multiple frameworks. As long as one information block is sent to the receiving end, it can be confirmed that the information block is correctly received, ensuring the success rate in the file transmission process. At the same time, because the sending end and the receiving end both create the same structure of sending framework and receiving framework, the excessive confirmation messages are eliminated, greatly improving the speed of file transmission.
[0113] In one embodiment, the method further includes: receiving a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least information block information on the main framework of the receiving end; and adjusting the data link to which the information block on the main framework of the sending end is assigned to the data link to which the corresponding information block on the secondary framework of the sending end is assigned, when the information block information indicates that the information block on the main framework of the receiving end comes from the secondary framework of the sending end.
[0114] The message structure of the transmission space closing request is as follows: Figure 8As shown, the message includes a message head and a message body. The message head includes a message sequence number (Msg SeqNo.), a receiver account, a message type, a timezone, a message sending timestamp, a file digital fingerprinting, and a checksum. The message body includes a key and info block acknowledges. The key includes all block IDs, and the info block acknowledges include a master frame ID and a secondary frame ID. Figure 8 When the master frame column and the secondary frame column are both 1, it means that two information blocks with the same block ID are simultaneously received by the receiver from the master frame and the secondary frame of the sender. When the master frame column is 1 and the secondary frame column is 0, it means that, among two information blocks with the same block ID, the receiver only receives the information block on the master frame of the sender. When the master frame column is 0 and the secondary frame column is 1, it means that, among two information blocks with the same block ID, the receiver only receives the information block on the secondary frame of the sender. When the master frame column is 1 and the secondary frame column is 0, it means that two information blocks with the same block ID are simultaneously received by the receiver from the master frame and the secondary frame of the sender.
[0115] Specifically, after the sender receives the transmission space closing request sent by the receiver, the sender extracts the block information from the request, which records the block ID, frame ID, and timestamp of the information block on the master frame of the receiver. The sender compares the block ID, frame ID, and timestamp in the block information with the corresponding information block on the master frame. When the block ID, frame ID, and timestamp in the block information are the same as those of the corresponding information block on the secondary frame, it means that the information block on the master frame of the receiver comes from the corresponding information block on the secondary frame of the sender. The sender adjusts the data link assigned to the corresponding information block on the secondary frame to the corresponding information block on the master frame. The sender can establish transmission spaces on different data links, and after multiple file transmissions, the data link with the highest transmission success rate and transmission rate is selected.
[0116] In the embodiment, the sending end can find the data link with the highest transmission success rate and transmission rate in the current data link by comparing the information block information representing the main frame information block source of the receiving end, so as to dynamically plan the data link for sending the file next time.
[0117] In one of the embodiments, the method further comprises: receiving a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least a receiving end digital fingerprint of the file calculated by the receiving end; calculating a sending end digital fingerprint of the file; updating the transmission log as successful and recording all information block identifiers when the receiving end digital fingerprint and the sending end digital fingerprint are consistent; clearing the parallel threads, the main frame and the sub-frame; and sending a closing success confirmation message to the receiving end.
[0118] Specifically, the sending end decrypts the transmission space closing request with the public key of the receiving end and determines that the transmission space closing request is sent by the receiving end. The sending end decrypts the transmission space closing request with the private key and obtains the digital fingerprint information calculated by the receiving end in the request. The sending end calculates the digital fingerprint of the file and compares the sending end digital fingerprint with the receiving end digital fingerprint. When the receiving end digital fingerprint and the sending end digital fingerprint are consistent, the transmission log is updated as successful and all information block identifiers are recorded. At the same time, the sending end clears the thread pool for transmitting the information blocks and empties all the established main frame and sub-frame, and recycles the corresponding memory resources. Finally, the sending end sends a closing success confirmation message to the receiving end, and the structure of the closing success confirmation message is as shown in Figure 9 The closing success confirmation message includes a message head (Message Head) and a message body (Message Body). The message head (Message Head) includes a message sequence number (Msg SeqNo.), a sender account (Sender Account), a message type (Message Type), a sender time zone (Timezone), a sender timestamp (Timestamp) and a check sum (CheckSum). The message body (Message Body) includes a sending end digital fingerprint ((Sender) File Digital Fingerprinting) and a related message sequence number (Linked Msg SeqNo.).
[0119] In the embodiment, the sending end decrypts the transmission space closing request by the private key and the public key and the like to ensure the security in the data transmission process, and verifies whether the digital fingerprints of the transmission file calculated by the sending end and the receiving end are consistent to ensure the accuracy of the file transmission result.
[0120] In one of the embodiments, as shown in Figure 10 A file transmission method is provided, and the method is applied to Figure 1The receiving end in the transmission space is taken as an example to illustrate the method, including the following steps:
[0121] In step S1002, the receiving end receives the transmission space establishment request sent by the sending end, and the transmission space establishment request carries at least a block assembly time period and a file size.
[0122] The transmission space establishment request includes a message head and a message body, as shown in Figure 3 The message head includes but is not limited to a message sequence number (Message SeqNo.), a sender account (SenderAccount), a message type (MessageType), and a check sum (CheckSum). The message body includes but is not limited to a sender time zone (Sender timezone), a sender sending time stamp (Sender timestamp), a file type (File type, such as a text (Text) and a binary type (binary)), a file size (File Size), and a block assembly time period (Blockchain Lifecycle). Among them, the file size and the block assembly time period are necessary in the transmission space establishment request.
[0123] In one embodiment, the transmission space establishment request is encrypted by the public key and the private key of the sending end, the receiving end decrypts the transmission space establishment request by the public key to ensure that the request is sent by the sending end. Then the receiving end decrypts the content of the transmission space establishment request by the private key, and obtains the block assembly time period, the size of the file to be transmitted, the sending time stamp of the sending end, and other key information from the content.
[0124] In step S1004, the size of the information block and the information block identifier are calculated based on the transmission space establishment request.
[0125] Specifically, the receiving end obtains the parameter information carried in the transmission space establishment request message, calculates the size of the information block to be divided according to the pre-set calculation rule and the parameter information, and the size of the information block can make the sending end send all the information blocks to the receiving end within a specified time.
[0126] After the receiving end calculates the required information block size, it randomly selects the starting information block identifier, and then sequentially assigns each to-be-received information block.
[0127] In step S1006, the transmission space establishment response is sent to the sending end, and the transmission space establishment response carries at least the size of the information block and the information block identifier.
[0128] The message structure of the transmission space establishment response is as shown in Figure 10The message includes a message head and a message body. The message head includes a message sequence number, a receiver account, a message type, a check sum, an acknowledgement message sequence number, an information block size, a frame size, an information block identifier, and a port number.
[0129] Specifically, the receiver assembles the message sequence number, the receiver account, the message type, the check sum, the acknowledgement message sequence number, the information block size, the frame size, the information block identifier, and the corresponding port number into a transmission space establishment response message, and encrypts the transmission space establishment response message using the public key and the private key. The receiver then sends the encrypted transmission space establishment response message to the sender.
[0130] At step S1008, the information blocks sent by the sender are received through at least two parallel receiving threads.
[0131] Specifically, when the number of information blocks is less than the number of threads, the receiver processes one information block using one thread. When the number of information blocks is greater than the number of threads, the receiver processes multiple information blocks using one thread. The receiving thread of each port of the receiver checks whether the information block received by the port matches according to the correspondence between the port number and the information block identifier. If the port number and the information block identifier match, the information block is received. If the port number and the information block identifier do not match, the information block received by the port is discarded. For example, the default number of threads is 15, including 14 receiving threads and 1 instruction thread. The specific number of threads can be configured according to the hardware performance (memory, number of processor cores) of the receiver. When the total number of information blocks is 8 and the number of threads is 30, one thread processes one information block. When the total number of information blocks is 60 and the number of threads is 30, one thread processes two information blocks in order according to the information block identifier and the corresponding frame identifier of the information block.
[0132] At step S1010, the information blocks are combined into a file.
[0133] Specifically, when the receiver receives more than one information block with the same information block identifier, the first received information block is used preferentially for combining the target file. When at least one information block with the same information block identifier for composing the file is received, the receiver combines the information blocks in order according to the information block identifier to generate the final target file.
[0134] The receiving end decrypts the file with the public key of the sending end, and uses the data in the checksum to confirm that the information has not been tampered with during transmission.
[0135] In the above file transmission method, the receiving end can ensure that the data file can be transmitted within the block assembly time period after being divided into information blocks by the sending end by calculating the size of the information block required for the data file to complete transmission within the block assembly time period. The receiving end can improve the efficiency of receiving information blocks by receiving information blocks through multiple threads. In addition, the receiving end ensures the accuracy and success rate of information block transmission by constructing the same main framework and secondary framework as the sending end, eliminates excessive confirmation protocols, and greatly improves the transmission speed of large files.
[0136] In one embodiment, the size of the information block is equal to the block assembly time period multiplied by the data transmission rate between the receiving end and the sending end.
[0137] Specifically, the receiving end obtains the size of the transmission space establishment request message, and extracts the block assembly time period and the sending end sending timestamp from the transmission space establishment request message. The delay time is calculated according to the difference between the receiving time and the sending time. The size of the information block is equal to the block assembly time period multiplied by the data transmission rate, and the data transmission rate is equal to the size of the transmission space establishment request message divided by the delay time. For example, the file size is 18G, the size of the transmission space establishment request message is 100K, the delay time is 100ms, and the block assembly time period is 3min. Data transmission rate = 100K / 100ms = 0.1M / 0.1s = 1M / s, information block size = 3*60*1M / s = 180M = 0.18G.
[0138] In this embodiment, the receiving end calculates the required information block size according to the block assembly time period and the data transmission rate. By dividing the data file into the above information block size, the receiving end can receive all information blocks of the data file within one block assembly time period, thereby greatly improving the transmission speed of the data file and making the file transmission method applicable to the block chain operating system.
[0139] In one embodiment, before receiving the information blocks sent by the sending end through at least two parallel threads, it further includes: constructing a receiving end main framework with the information block identifier as the key value. According to the receiving end main framework, at least one receiving end secondary framework is copied; the number of receiving end secondary frameworks is consistent with the number of sending end secondary frameworks. Receiving the information blocks sent by the sending end through at least two parallel threads includes: filling the information blocks into the receiving end main framework based on the information block identifier. When the position corresponding to the information block identifier on the receiving end main framework has been filled, the last received information block is filled into the position corresponding to the information block identifier on the receiving end secondary framework.
[0140] Specifically, as shown in Figure 11 the receiving end constructs a receiving end master frame with empty slots for receiving the information blocks sent by the sending end, using the calculated information block identifiers (Block IDs) as key values. After the master frame is constructed, the receiving end copies at least one secondary frame identical to the master frame according to the structure of the master frame, and ensures that the number of secondary frames of the receiving end is consistent with the number of secondary frames of the sending end.
[0141] The receiving end selects at least two threads from the thread pool to receive the information blocks sent by the sending end. The receiving end fills the information blocks into the master frame according to the information block identifiers on the information blocks. When the slots corresponding to the information block identifiers on the master frame are filled, the receiving end fills the received information blocks into the secondary frame at the slots corresponding to the information block identifiers.
[0142] After the master frame is filled, the receiving end splices the information blocks into a complete file and decrypts the file using the public key of the sending end, and uses the data in the checksum to confirm that the information has not been tampered with during transmission.
[0143] In this embodiment, the receiving end receives the information blocks by creating multiple frames, and as long as one information block is received, it can be confirmed that the information block is correctly received, thereby ensuring the success rate during file transmission. At the same time, because the sending end and the receiving end both create sending frames and receiving frames of the same structure, excessive confirmation messages are eliminated, greatly improving the speed of file transmission.
[0144] In one embodiment, after the information blocks are filled into the master frame of the receiving end based on the information block identifiers, the method further includes: sending a transmission space closing request to the sending end, the transmission space closing request carrying at least information block information on the master frame of the receiving end, the information block information being used to instruct the sending end to adjust the data links on which the information blocks on the master frame of the sending end are allocated.
[0145] Specifically, after the master frame of the receiving end is filled with information blocks, the receiving end records the information block identifiers of all the information blocks on the master frame and the frame identifiers on the information blocks to generate information block information, the frame identifiers indicating that the information blocks on the master frame of the receiving end come from a specific frame of the sending end. The information block information indicates that the information blocks on the master frame of the receiving end come from the secondary frame of the sending end, so that the sending end can adjust the data links used to send the information blocks on the master frame next time according to the information block information. The receiving end assembles the information block information into the message structure of the transmission space closing request, as shown in Figure 8 .
[0146] In the embodiment, the receiving end sends the information block information to the sending end by assembling the information block information into the transmission space closing request, so that the sending end can optimize the data link for sending the information block according to the specific situation of the receiving end receiving the information block, and the efficiency of sending the information block is improved.
[0147] In one of the embodiments, the method further comprises: calculating a digital fingerprint of the file. The transmission space closing request is sent to the sending end, and the transmission space closing request carries at least the digital fingerprint. A message of transmission space closing success sent by the sending end is received. The transmission log is updated and all the information blocks are recorded. The parallel threads and the main frame and the auxiliary frame are cleared.
[0148] Specifically, the sending end calculates a digital fingerprint of the synthesized target file, and assembles the digital fingerprint into a message structure of the transmission space closing request, as shown in Figure 8 After the receiving end receives the message of transmission space closing success sent by the sending end, the receiving end records all the received information block information into the transmission log, so as to facilitate subsequent tracking and inquiry. Finally, the receiving end clears all the parallel threads for receiving the information block in the thread pool, and clears the main frame and the auxiliary frame for receiving the information block, so as to recycle the memory resources.
[0149] In the embodiment, the receiving end sends the digital fingerprint of the target file to the sending end through the transmission space closing request, so as to ensure that the data files transmitted by the sending end and the receiving end are consistent and complete, and no change occurs.
[0150] In order to enable those skilled in the art to fully understand the file storage and reading method based on the blockchain in the present application, a specific embodiment is given below.
[0151] In the embodiment, the sending end has a large data file and is ready to transmit the large data file to the receiving end through a wide area network. The entire file transmission process is divided into three stages: an initialization stage, a transmission stage, and a closing stage.
[0152] In the initialization phase, the sending end sends a transmission space establishment request to the receiving end, which contains the size of the file to be transmitted, the file type, the block assembly time period, and the data transmission rate, etc. After receiving the request information, the receiving end obtains the required information block size by multiplying the block assembly time by the data transmission rate. The receiving end randomly generates an information block identifier and assigns it to different information blocks in ascending order. Then the receiving end selects the port corresponding to the different information blocks for receiving the information blocks sent by the sending end, and assembles the port number, the corresponding information block identifier, the information block size, and the frame size, etc. into a transmission space establishment response message and sends it to the sending end. At the same time, the receiving end locally constructs a main frame with empty slots for receiving information blocks. Then the receiving end copies a secondary frame with the same structure according to the empty main frame. The receiving end continues to construct multiple threads, each thread listening to a port, waiting for the sending end to send information blocks. After receiving the transmission space establishment response, the sending end extracts the information block size, the frame size, all information block identifiers, and the corresponding port information. The sending end divides the large data file into information blocks according to the information block size. The sending end constructs a main frame according to the frame size, information block identifier, etc. and splices the information blocks onto the main frame. The sending end assigns a frame identifier to the main frame during the construction of the main frame. Then the sending end copies a secondary frame that is exactly the same as the main frame according to the structure of the main frame and the information blocks on the main frame, and changes the frame identifier to the secondary frame identifier. The sending end constructs multiple threads, and prepares to send information blocks to the ports listened to by the receiving end.
[0153] In the transmission phase, the sending end sends information blocks to the receiving end through multi-threading. The receiving end receives information blocks through multi-threading. Due to network reasons, the information blocks received by the receiving end do not arrive in order. The receiving end fills the main frame of the receiving end according to the information block identifier. When the receiving end finds that the slot corresponding to a certain information block identifier in the main frame has been filled, it assembles the received information block into the secondary frame according to the information block identifier and the slot corresponding to the information block identifier. After the main frame is filled, the receiving end splices the information blocks on the main frame into a complete target file, decrypts the file using the public key of the sending end, and uses the data in the checksum to confirm that the information blocks have not been tampered with during transmission. After obtaining the correct and complete file, the receiving end calculates the digital fingerprint of the file, assembles the digital fingerprint together with the identifier of all information blocks on the main frame and the frame identifier into a transmission space closing request message, and sends the request to the sending end.
[0154] In the closing stage, the sending end takes out the digital fingerprint calculated by the receiving end and compares it with the digital fingerprint calculated by the sending end after receiving the transmission space closing request. When the digital fingerprints are consistent, all the information blocks that have been successfully transmitted are recorded on the transmission log. Then the sending end clears all the sending threads, the main frame and the auxiliary frame. Finally, the sending end sends a transmission space closing success message to the receiving end. After receiving the transmission space closing success message, the receiving end records the successfully transmitted information blocks on the transmission log, clears the multiple receiving threads and clears the main frame and the auxiliary frame.
[0155] In this embodiment, the entire transmission process maximally utilizes network transmission line concurrency, processor concurrency and program concurrency. By constructing two identical frames at the sending end and the receiving end, the transmission of large data files is simplified into parallel transmission of information blocks and end-point splicing, the file sending, transmission and receiving are concurrent, the large data file transmission is converted into small information block transmission, unnecessary acknowledgement protocols are eliminated, and the transmission speed of large data files is greatly improved.
[0156] It should be understood that, although Figure 2 , Figure 6 and Figure 10 the flowcharts show the steps in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps has no strict order limitation, and the steps can be executed in other orders. Moreover, Figure 2 , Figure 6 and Figure 10 at least some of the steps can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately executed with other steps or steps or stages in other steps.
[0157] In one embodiment, as shown in Figure 12 , a file transmission device is provided, applied to a sending end, comprising a transmission space establishment request module 100, a transmission space establishment response receiving module 200, a file cutting module 300, an information block identification allocation module 400 and an information block sending module 500, wherein:
[0158] The transmission space establishment request module 100 is configured to send a transmission space establishment request to the receiving end, and the transmission space establishment request carries at least a block assembly time period and a size of the file.
[0159] The transmission space establishment response receiving module 200 is configured to receive a transmission space establishment response corresponding to the transmission space establishment request sent by the receiving end, and the transmission space establishment response carries at least a block size and a block identifier, which are generated according to the block assembly time period and the size of the file.
[0160] The file cutting module 300 is configured to cut the file into at least one block according to the block size and the size of the file.
[0161] The block identifier assigning module 400 is configured to assign a block identifier to each block, and each block corresponds to one block identifier.
[0162] The block sending module 500 is configured to send the blocks to the receiving end through at least two parallel sending threads.
[0163] In one of the embodiments, the method further includes: constructing a sending end main frame by taking the block identifier as a key value, and generating a frame identifier of the sending end main frame; filling the blocks into the sending end main frame based on the block identifier, and binding the frame identifier of the sending end main frame to the blocks; copying at least one sending end sub-frame from the main frame according to the main frame, and changing the frame identifier to a frame identifier of the sending end sub-frame, the number of the sending end sub-frames being consistent with the number of the receiving end sub-frames; assigning different parallel data links to the corresponding blocks, the corresponding blocks referring to the blocks with the same block identifier and different frame identifiers; and sending the blocks through the data links to which the blocks are assigned in parallel.
[0164] In one of the embodiments, the method further includes: receiving a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least block information on the receiving end main frame; and adjusting the data link to which the blocks on the sending end main frame are assigned to the data link to which the corresponding blocks on the sending end sub-frame are assigned, when the block information on the receiving end main frame indicates that the blocks on the receiving end main frame come from the sending end sub-frame.
[0165] In one of the embodiments, further comprising: a digital fingerprint receiving module, configured to receive a transmission space closing request sent by the receiving end, the transmission space closing request carrying at least a receiving-end digital fingerprint of the file calculated by the receiving end; a sending-end digital fingerprint calculating module, configured to calculate a sending-end digital fingerprint of the file; a sending-end transmission log updating module, configured to update the transmission log as successful and record all information block identifiers when the receiving-end digital fingerprint and the sending-end digital fingerprint are consistent; a sending-end clearing module, configured to clear the parallel threads, the main framework and the sub-framework; and a closing success confirmation message sending module, configured to send a closing success confirmation message to the receiving end.
[0166] In one of the embodiments, as shown in Figure 13 FIG. 1, a file transmission device is provided, applied to a receiving end, comprising: a transmission space establishment request receiving module 100, an information block calculating module 200, a transmission space establishment response module 300, an information block receiving module 400 and an information block synthesizing module 500, wherein:
[0167] The transmission space establishment request receiving module 100 is configured to receive a transmission space establishment request sent by the sending end, the transmission space establishment request carrying at least a block assembly time period and a size of the file.
[0168] The information block calculating module 200 is configured to calculate a size of the information block and an information block identifier based on the transmission space establishment request.
[0169] The transmission space establishment response module 300 is configured to send a transmission space establishment response to the sending end, the transmission space establishment response carrying at least the size of the information block and the information block identifier.
[0170] The information block receiving module 400 is configured to receive the information block sent by the sending end through at least two parallel receiving threads.
[0171] The information block synthesizing module 500 is configured to synthesize the information block into the file.
[0172] In one of the embodiments, the size of the information block is equal to the block assembly time period multiplied by a data transmission rate between the receiving end and the sending end.
[0173] In one of the embodiments, further comprising: a receiving-end main framework building module, configured to build a receiving-end main framework with the information block identifier as a key value; a receiving-end framework copying module, configured to copy at least one receiving-end sub-framework according to the receiving-end main framework; the number of the receiving-end sub-frameworks is consistent with the number of the sending-end sub-frameworks; a receiving-end information block filling module, configured to fill the information block into the receiving-end main framework based on the information block identifier; and an information block adjusting module, configured to fill the information block received later into a position corresponding to the information block identifier on the receiving-end sub-framework when the position corresponding to the information block identifier on the receiving-end main framework has been filled.
[0174] In one of the embodiments, further comprising a transmission space closing request sending module, configured to send a transmission space closing request to the sender after filling the main frame of the receiver with the information blocks based on the information block identification, wherein the transmission space closing request carries at least information block information on the main frame of the receiver, and the information block information is used to instruct the sender to adjust the data link on which the information blocks on the main frame of the sender are allocated.
[0175] In one of the embodiments, further comprising a receiver digital fingerprint calculation module, configured to calculate a digital fingerprint of the file. The transmission space closing request sending module is configured to send a transmission space closing request to the sender, wherein the transmission space closing request carries at least the digital fingerprint. The transmission space closing success message receiving module is configured to receive a transmission space closing success message sent by the sender. The receiver log updating module is configured to update the transmission log and record all the information blocks. The receiver clearing module is configured to clear the parallel threads and the main frame and the sub-frame.
[0176] The specific limitations of the file transmission device can be referred to the limitations of the file transmission method in the foregoing, which will not be repeated here. Each module in the file transmission device described above can be realized by software, hardware and combination thereof in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0177] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in Figure 14 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store big data file data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a file transmission method.
[0178] Those skilled in the art can understand that Figure 14 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0179] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory has stored therein a computer program, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0180] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program, and the computer program, when executed by a processor, implements the steps in the above-mentioned method embodiments.
[0181] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0182] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0183] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.
Claims
1. A file transfer method, characterized in that, Applied to the sending end, the method includes: Send a transmission space establishment request to the receiving end, the transmission space establishment request carrying at least the block assembly time period and the file size; The receiver receives a transmission space establishment response corresponding to the transmission space establishment request sent by the receiving end. The transmission space establishment response carries at least the information block size and the information block identifier. The information block size and the information block identifier are generated based on the block assembly time period and the file size. The file is divided into at least one information block according to the information block size and the file size; The information block identifier is assigned to the information block, and each information block corresponds to one information block identifier; The information block is sent to the receiving end through at least two parallel sending threads; Before sending the information block to the receiving end via at least two parallel threads, the method further includes: The main frame of the sending end is constructed using the information block identifier as the key value, and the frame identifier of the main frame of the sending end is generated. Based on the information block identifier, the information block is filled into the main frame of the sending end, and the frame identifier of the main frame of the sending end is bound to the information block; At least one transmitting sub-frame is copied from the main frame, and the frame identifier is changed to the frame identifier of the transmitting sub-frame; the number of transmitting sub-frames is the same as the number of receiving sub-frames; Different parallel data links are allocated to corresponding information blocks; the corresponding information blocks refer to information blocks that have the same information block identifier but different frame identifiers. The step of sending the information block to the receiving end via at least two parallel threads includes: The information block is transmitted in parallel through the data link to which it is allocated.
2. The method according to claim 1, characterized in that, The method further includes: Receive a transmission space closure request sent by the receiving end, wherein the transmission space closure request carries at least information block information on the main frame of the receiving end; When the information block information indicates that the information block on the receiving end main frame comes from the sending end sub-frame, the data link allocated to the information block on the sending end main frame is adjusted to the data link allocated to the corresponding information block on the sending end sub-frame.
3. The method according to claim 1, characterized in that, The method further includes: The receiving end receives a transmission space closure request, which carries at least the receiving end's digital fingerprint of the file calculated by the receiving end. Calculate the sender's digital fingerprint of the file; When the digital fingerprints of the receiving end and the sending end match, update the transmission log to success and record all the information block identifiers; Clear the parallel thread, the main frame, and the sub-frame; Send a confirmation message to the receiving end confirming successful closure.
4. A file transfer method, characterized in that, Applied to the receiving end, the method includes: Receive a transmission space establishment request sent by the sending end, the transmission space establishment request carrying at least the block assembly time period and the file size; Based on the transmission space establishment request, calculate the size of the information block and the information block identifier; Send a transmission space establishment response to the sending end, the transmission space establishment response carrying at least the size of the information block and the information block identifier; The information block sent by the sending end is received by at least two parallel receiving threads; Combine the information blocks into the file; Before receiving the information block sent by the sender through at least two parallel threads, the method further includes: The main frame of the receiving end is constructed using the information block identifier as the key value; At least one receiver sub-frame is copied from the receiver main frame; the number of receiver sub-frames is the same as the number of transmitter sub-frames. The process of receiving the information block sent by the sending end through at least two parallel threads includes: The information block is used to fill the main frame of the receiving end based on the information block identifier; When the position on the main frame of the receiving end corresponding to the information block identifier has been filled, the subsequently received information block will be filled into the position on the secondary frame of the receiving end corresponding to the information block identifier.
5. The method according to claim 4, characterized in that, The size of the information block is equal to the block assembly time period multiplied by the data transmission rate between the receiving end and the sending end.
6. The method according to claim 4, characterized in that, After filling the receiver's main frame with the information block based on the information block identifier, the method further includes: Send a transmission space closure request to the sending end. The transmission space closure request carries at least the information block information on the receiving end's main frame. The information block information is used to instruct the sending end to adjust the data link on the sending end's main frame where the information block is allocated.
7. The method according to claim 4 or 5, characterized in that, The method further includes: Calculate the digital fingerprint of the file; Send a transmission space close request to the sending end, the transmission space close request carrying at least the digital fingerprint; Receive the message from the sending end indicating that the transmission space has been successfully closed; Update the transport log and record all the aforementioned information blocks; Clear the parallel threads, the main frame, and the sub-frame.
8. A file transfer device, characterized in that, Applied to the transmitting end, the device includes: The transmission space establishment request module is used to send a transmission space establishment request to the receiving end. The transmission space establishment request carries at least the block assembly time period and the file size. A transmission space establishment response receiving module is used to receive a transmission space establishment response sent by the receiving end corresponding to the transmission space establishment request. The transmission space establishment response carries at least an information block size and an information block identifier. The information block size and the information block identifier are generated based on the block assembly time period and the file size. The file splitting module is used to split the file into at least one information block according to the information block size and the file size; The information block identifier allocation module is used to allocate the information block identifier to the information block, and each information block corresponds to one information block identifier; An information block sending module is used to send the information block to the receiving end through at least two parallel sending threads; The sending end main frame construction module is used to construct the sending end main frame using the information block identifier as the key value, and generate the frame identifier of the sending end main frame; The sending end information block filling module is used to fill the information block into the sending end main frame based on the information block identifier and bind the frame identifier of the sending end main frame to the information block; The transmitting end frame replication module is used to replicate at least one transmitting end sub-frame according to the main frame and change the frame identifier to the frame identifier of the transmitting end sub-frame; the number of transmitting end sub-frames is the same as the number of receiving end sub-frames; A data link allocation module is used to allocate different parallel data links to corresponding information blocks; the corresponding information block refers to an information block that has the same information block identifier but different frame identifiers. A multi-link transmission module is used to transmit the information block in parallel through the data link allocated to the information block.
9. A file transfer device, characterized in that, Application and receiving end, the device includes: The transmission space establishment request receiving module is used to receive the transmission space establishment request sent by the sending end. The transmission space establishment request carries at least the block assembly time period and the file size. The information block calculation module is used to establish a request based on the transmission space, and to calculate the size and identifier of the information block; A transmission space establishment response module is used to send a transmission space establishment response to the sending end. The transmission space establishment response carries at least the size of the information block and the information block identifier. An information block receiving module is used to receive the information block sent by the sending end through at least two parallel receiving threads; An information block synthesis module is used to synthesize the information blocks into the file. The receiver main frame construction module is used to construct the receiver main frame using the information block identifier as a key value. The receiver frame replication module is used to replicate at least one receiver sub-frame according to the receiver main frame; the number of receiver sub-frames is the same as the number of transmitter sub-frames. A receiving end information block filling module is used to fill the receiving end main frame with the information block based on the information block identifier; The information block adjustment module is used to fill the subsequently received information block into the position corresponding to the information block identifier on the sub-frame of the receiving end when the position on the main frame of the receiving end is already filled.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
File uploading method and system
CN104426942A
Handling method and device for file transmission
CN106790653A