High-capacity reliable file transmission method and computer program product
By introducing file packaging encryption and dynamic port binding technology into the FTP file transfer protocol, the security risks and low efficiency of FTP file transfer are solved, and the secure and efficient transmission of large-capacity file transfer is achieved.
Patent Information
- Application Number
- CN202510170430.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-03-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing FTP file transfer protocol has security risks and low transmission efficiency, especially when large-capacity file transfers.
By establishing an encryption channel between the client and the server, the transmitted files are packaged and encrypted, multiple dynamic ciphertext packets are formed, and transmission security and efficiency are improved through periodic time synchronization and dynamic port binding.
It realizes the security and efficiency of large-capacity file transfer, avoids the security risks of plaintext transmission, and supports breakpoint continuous transmission and error retransmission.
Smart Images

Figure CN119652889A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a large-capacity reliable file transmission method and a computer program product. Background Art
[0002] FTP (File Transfer Protocol) is currently a popular application layer plain text transmission protocol. The transport layer is based on TCP (Transmission Control Protocol). The file transmission is stable and cross-platform.
[0003] FTP file transfer protocol is often used for large-capacity file transfer at work, but FTP file transfer has obvious disadvantages. For example, its username and password are transmitted in plain text, and the transmitted file data is also transmitted without encryption. These can be obtained and analyzed by some packet capture software, which poses a great security risk. In addition, the transmission rate of FTP is relatively slow, especially for large-capacity files, it cannot be efficiently transmitted.
[0004] Based on the above problems, there is an urgent need for a secure and efficient transmission method based on large-capacity files. Summary of the invention
[0005] In order to overcome the above technical problems existing in the prior art, the present invention provides a large-capacity reliable file transmission method and a computer program product. The various technical effects that can be produced by the preferred technical solution among the various technical solutions provided by the present invention are described in detail below. To achieve the above purpose, the present invention provides the following technical solutions: The present invention provides a method for transmitting large-capacity reliable files, which comprises the following steps on the client: Before the transmitted files enter the Ethernet, the transmitted files are packaged and encrypted, so that the transmitted files are converted from plain text data into multiple dynamic ciphertext data packets; Establishing a connection with a data transmission channel periodically opened by the server, wherein the period of opening the data transmission channel is determined according to the transmission time and transmission completion status of multiple dynamic ciphertext data packets; Multiple dynamic ciphertext data packets are transmitted to the server through a data transmission channel connected to the server.
[0006] In some embodiments, before the transmitted file is packaged and encrypted, time synchronization and correction are periodically performed with the server according to the time difference with the server; If the time difference is greater than the set threshold, the PTP time synchronization method is used to periodically synchronize and correct the time with the server.
[0007] In some embodiments, calculating the time difference with the server includes the following steps: After connecting to the server, a time synchronization instruction with a timestamp of T1 is sent to the server at time T1; After receiving the time synchronization instruction at time T2, the receiving server sends a data packet with timestamps T2 and T3 at time T3, and records the current client time T4 after receiving the data packet; Calculate the time difference with the server based on T1, T2, T3, and T4. The calculation formula is: ; Among them, T12 is the time from timestamp T1 to timestamp T2, and T34 is the time from timestamp T3 to timestamp T4.
[0008] In some embodiments, during the transmission of a dynamic ciphertext data packet, the client performs packet subdivision processing when it is a sender, and performs packet assembly processing when it is a receiver; During data transmission, the encryption algorithm interface is registered through the reserved callback method, and the encryption and decryption algorithms of the server and client are consistent.
[0009] In some embodiments, the large-capacity reliable file transmission method also includes generating a temporary file for recording the completion status of the file transmission during the transmission of the dynamic ciphertext data packet. When uploading the file, the temporary file is stored on the server, and when downloading the file, the temporary file is stored on the client.
[0010] Based on the same inventive concept, in a second aspect, the present invention provides a method for transmitting a large-capacity reliable file, which comprises the following steps at the server end: Before the transmitted files enter the Ethernet, the transmitted files are packaged and encrypted, so that the transmitted files are converted from plain text data into multiple dynamic ciphertext data packets; According to the transmission time and transmission completion status of multiple dynamic ciphertext data packets, a data transmission channel is periodically opened to the client; Transmit multiple dynamic ciphertext data packets to the client through the open data transmission channel bound to the client.
[0011] In some embodiments, after the server and the client are time synchronized, the client and the server calculate the same port number of the data transmission channel through the same timestamp and the same algorithm, so that the port of the client's data transmission channel can be dynamically bound to the port of different data transmission channels of the server.
[0012] During the transmission of ciphertext data packets, the number of port numbers of the data transmission channel is consistent with the number of cores on the server. When the server acts as a sender, it performs packet subdivision processing, and when the server acts as a receiver, it performs packet assembly processing.
[0013] In some embodiments, before the transmitted files are packaged and encrypted, time synchronization and correction are periodically performed with the client based on the time difference with the client; If the time difference is greater than the set threshold, the PTP time synchronization method is used to periodically synchronize and correct the time with the client.
[0014] In some embodiments, file information of multiple dynamic ciphertext data packets and port numbers of data transmission channels are added, the port number of the data transmission channel and the timestamp are bound, and the data transmission channel is in a periodically changing state through the timestamp, timer and configuration update cycle.
[0015] Based on the same inventive concept, in a third aspect, the present invention provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of executing a large-capacity reliable file transmission method on a client as described above; And when the computer program or instruction is executed by the processor, the steps of executing a large-capacity reliable file transmission method on the server side as described above are implemented.
[0016] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects: The present invention encrypts the large-capacity file data, converts the plain text into dynamic cipher text, and encapsulates a layer of data structure at the application layer, so that the security of large-capacity file transmission is guaranteed.
[0017] The present invention can transmit files more efficiently by transmitting through an instruction channel plus multiple data channels.
[0018] The present invention records the data transmission process by adding a temporary file, thereby supporting breakpoint resume transmission and error retransmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. It is obvious that the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings: Figure 1 It is a flow chart of a method for transmitting a large-capacity reliable file executed on a client according to an embodiment of the present invention; Figure 2 is a schematic diagram of calculating the time difference between the client and the server according to an embodiment of the present invention; Figure 3 This is a flow chart of breakpoint-resume uploading of a large-capacity file by a client according to an embodiment of the present invention; Figure 4This is a flow chart of breakpoint-resume downloading of a large-capacity file by a client according to an embodiment of the present invention; Figure 5 is a flow chart of a large-capacity reliable file transmission method executed at a server end according to an embodiment of the present invention; Figure 6 A flowchart of user login interaction according to an embodiment of the present invention; Figure 7 A flowchart of a client receiving a file from a server according to an embodiment of the present invention; Figure 8 The client of the embodiment of the present invention completes the flow chart of dynamically monitoring the data channel through the timer. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, wherein various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods, devices, etc. that are consistent with some aspects of the present disclosure as detailed in the attached claims, and other embodiments may also be used, or the embodiments listed herein may be modified in structure and function without departing from the scope and essence of the present invention.
[0021] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The terms "plurality" and "several" mean two or more. The terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0022] In order to illustrate the technical solution of the present invention, a specific embodiment is used below for description, and only the parts related to the embodiment of the present invention are shown.
[0023] Embodiment 1: Figure 1 As shown, a large-capacity reliable file transmission method provided in this embodiment includes the following steps on the client: S100. Before the transmitted file enters the Ethernet, the transmitted file is packaged and encrypted, so that the transmitted file is converted from plain text data into multiple dynamic ciphertext data packets.
[0024] It is understandable that the above client can be a client based on the eFTP (Enhanced File Transfer Protocol) protocol. Among them, eFTP is the Ethernet File Transfer Protocol [protocol], that is, a file transfer protocol based on TCP / IP. Its advantage is that it can provide efficient and secure file transfer services. On the basis of inheriting the advantages of FTP (File Transfer Protocol), eFTP also adds the connection data port number change, data encryption, breakpoint continuation, error retransmission, and multi-core parallel processing mechanism. Through these mechanisms, file transfer can be performed better and faster, and security is also guaranteed.
[0025] The usage scenario of this embodiment is mainly for the client to upload and download files to the server. Furthermore, in the embedded products of the distribution network, devices such as FTU (Feeder Terminal Unit) and DTU (Data Transfer Unit) will generate a large number of log files and recorded files. Among them, the recorded files will generate files of more than 100 megabytes due to the high sampling rate. In many cases, these files need to be copied to the server for data analysis.
[0026] In the above step 100, before the transmitted file is packaged and encrypted, the time is periodically synchronized and corrected with the server according to the time difference with the server, so that the time of the client and the server is aligned. By periodically executing the time synchronization instruction, the time alignment of the client and the server is achieved, ensuring the normal data transmission and avoiding data transmission abnormality.
[0027] Based on the above embodiment, calculating the time difference with the server includes the following steps: After connecting to the server, a time synchronization instruction with timestamp T1 is sent to the server at time T1.
[0028] After receiving the time synchronization instruction at time T2, the receiving server sends a data packet with timestamps T2 and T3 at time T3, and records the current client time T4 after receiving the data packet.
[0029] Calculate the time difference with the server based on T1, T2, T3, and T4. The calculation formula is.
[0030] (1); Among them, T12 is the time from timestamp T1 to timestamp T2, and T34 is the time from timestamp T3 to timestamp T4.
[0031] like Figure 2 As shown, the time difference The calculation formula is as follows: Assumption: The time difference between the client and the server is , the time when timestamp T1 is transmitted to T2 is T12, the time when timestamp T3 is transmitted to T4 is T34, the timestamp when the client sends a data packet to the server is T1, the timestamp when the server receives the data packet is T2, the timestamp when the server responds to the client is T3, and the timestamp when the client receives the response from the server is T4.
[0032] T2 and T3 are server time, T1 and T4 are client time, such as Figure 2 It can be seen that: T2=T1+T12+ , T4=T3+T34- ; T4-T2=T3+T34- -T1-T12- ; 2 =T3+T34-T1-T12–T4+T2=(T2 - T1)+ (T3-T4)+(T34 -T12); =((T2-T1)+(T3-T4)+(T34-T12)) / 2.
[0033] Furthermore, if the network transmission route is relatively stable, T34=T12. It can be further simplified to: (2). It should be noted that if the timestamp error is too large, that is, the time difference is greater than the set threshold, it will cause data transmission abnormalities. The PTP (Precision Time Protocol) timing method is used to periodically synchronize and correct the time with the server to achieve more accurate time synchronization.
[0034] Based on the above embodiment, during the data transmission process, the encryption algorithm interface is registered by callback, so that various encryption algorithms can be adapted on the client and server. After the client and the server synchronize the time, the server calculates the port numbers of different open data transmission channels, and the client obtains the port number of the open transmission channel, thereby ensuring that the port number channel opened by the server is consistent with the transmission channel number connected by the client, and binding the encryption algorithm with the port number and timestamp of the data transmission channel connected to the server, thereby increasing the security of data transmission.
[0035] The same algorithm as above, such as converting the timestamp into a time with minutes as the smallest unit, and then obtaining the open port number through a fixed calculation, if the server is multi-core, the multi-core information is transmitted to the client through the command channel, so that the client can also use multiple port number information for binding and communication.
[0036] It is understandable that different encryption algorithms can be selected as long as the algorithms on both the server and the client are consistent.
[0037] The file transfer of the client is divided into data channel and command channel according to different functions. The command channel includes user name and password login. Based on the PASV mode (Passive Mode) of FTP, the AES (Advanced Encryption Standard) and timestamp moment variable encryption algorithm are added to the data channel and specific command channel (such as user name "USER" and password "PASS" login) to ensure that during the transmission process, key data is transmitted in ciphertext, and the same data plaintext will generate different ciphertexts through algorithm calculation, thereby ensuring the security of data transmission.
[0038] S200: Establish a connection with a data transmission channel that is periodically opened by the server, wherein the period of opening the data transmission channel is determined according to the transmission time and transmission completion status of multiple dynamic ciphertext data packets, as described below.
[0039] S300, transmitting multiple dynamic ciphertext data packets to the server through the data transmission channel connected to the server.
[0040] In order to improve the efficient transmission of large-capacity files, the socket sub-packaging technology is used. When the client is the sender, it performs sub-packaging, and when it is the receiver, it performs package assembly. In this way, different platforms can be supported.
[0041] A large-capacity reliable file transmission method of this embodiment also includes generating a temporary file for recording the completion of file transmission during the transmission of dynamic ciphertext data packets. When the client uploads a file, the temporary file is stored on the server, and when the client downloads a file, the temporary file is stored on the client. When the network is restored after a network interruption, the connection is re-established, and the transmission of the current file is resumed based on the temporary file, and the file transmission is re-requested to start from the frame that has not been transmitted. If an error occurs during the transmission process and the check fails, the error sequence number is recorded and the frame sequence number that needs to be retransmitted is sent. After receiving the information, the transmitting party retransmits the error frame data.
[0042] Figure 3 The diagram shows the process of resuming a large-capacity file upload from a client, which includes the following steps: Establish a connection with the server in PASV mode, obtain breakpoint information and error frame information from a temporary file stored in the server through a query frame, and resend the sub-package file based on the obtained breakpoint information and error frame information.
[0043] Figure 4 The diagram shows the process of resuming a large-capacity file download at the client end. The steps include: Establish a connection with the server in PASV mode, read the breakpoint information and error frame information of the temporary file, send the read breakpoint information and error frame information to the server, receive and store the sub-package files resent by the service client based on the breakpoint information and error frame information.
[0044] like Figure 5 As shown, as another aspect of this embodiment, the server includes the following steps: S400: Before the transmitted file enters the Ethernet, the transmitted file is packaged and encrypted, so that the transmitted file is converted from plain text data into multiple dynamic ciphertext data packets.
[0045] Before the files to be transmitted are packaged and encrypted, the time is periodically synchronized and corrected with the client according to the time difference with the client. The specific time synchronization and correction of the client is consistent with the above, and can be referred to above, so it will not be repeated here.
[0046] Based on the above embodiment, during the data transmission process, the encryption algorithm interface is registered by callback, so that various encryption algorithms can be adapted on the client and server. After the client and the server synchronize the time, the server calculates the port numbers of different open data transmission channels, and the client obtains the port number of the open transmission channel (calculated by the same algorithm as the client, such as converting the timestamp into a time with minutes as the minimum unit and then obtaining the open port number through a fixed calculation. If the server is multi-core, the multi-core information is transmitted to the client through the instruction channel, so that the client can also use multiple port number information for binding and communication), thereby ensuring that the port number channel opened by the server is consistent with the transmission channel number connected by the client, and binding the encryption algorithm to the port number and timestamp of the data transmission channel connected to the server, thereby increasing the security of data transmission. Its encryption algorithm is consistent with that of the client, and will not be repeated here.
[0047] S500: Periodically open a data transmission channel to the client according to the transmission time and transmission completion status of multiple dynamic ciphertext data packets.
[0048] Based on the above embodiment, the file information of multiple dynamic ciphertext data packets and the port number of the data transmission channel can be added through a custom data format, the port number of the data transmission channel and the timestamp can be bound, and the data transmission channel can be in a periodic changing state through the timestamp, timer and configured update cycle. Among them, the update cycle is set through the configuration file to ensure that the port number open to the client is in a periodic changing state.
[0049] The server can be a server based on the eFTP protocol. Through the file information received by the client, it calculates the area of the current file filling in different channels, and binds the port number of the data transmission channel with the number of server cores to realize the function of multi-channel data transmission. In addition, the file information contains the serial number of each channel transmission. The record of these serial numbers can realize the breakpoint resumption and error retransmission mechanism of data. The file information also includes the transmission time and transmission completion status of multiple dynamic ciphertext data packets. Then, the server periodically opens the data transmission channel according to the transmission time and transmission completion status of multiple dynamic ciphertext data packets.
[0050] S600 , transmitting multiple dynamic ciphertext data packets to the client through the open data transmission channel bound to the client.
[0051] Based on the above embodiment, during the transmission of dynamic ciphertext data packets, the port number of the data transmission channel is bound to the number of server cores on the server side, that is, each transmission channel corresponds to a certain amount of memory for storing data. File transmission uses interval filling, and the server side performs subpacket processing when it is the sender, and performs packet assembly processing when it is the receiver.
[0052] As a specific example, Figure 6 As shown in FIG. , the figure illustrates the process of user login interaction. The steps on the user side include: Send the connection command Connect to the server through the command channel, receive the Connect return success and the 220 command code encrypted by the encryption algorithm, and decrypt the 220 command code. It should be noted that the 220 command code indicates that the server is ready and the client can initiate a command.
[0053] The user name is encrypted by the encryption algorithm, the ciphertext is logged in to the server through the USER instruction, the 331 instruction code encrypted by the encryption algorithm of the server is received, and the 331 instruction code is decrypted. It should be noted that the 331 instruction code is used to request the client to send a password.
[0054] Send the encrypted ciphertext password to the server through the PASS command, receive the encrypted 230 command code from the server, decrypt the 230 command code, log in successfully, and send other commands. It should be noted that the 230 command code indicates that the user password verification is correct.
[0055] The server-side steps include: After receiving the Connect command from the client, a connection is established with the client and an Accept return success command and an encrypted 220 command code are sent to it.
[0056] Decode the user name received from the client, and after receiving the user name, encrypt and send the 331 instruction code to the client.
[0057] Decrypt the ciphertext password received from the client, determine whether the username and password are correct after receiving the password, and return the 230 instruction code to the client if the judgment is correct.
[0058] As a specific example, Figure 7 As shown in the figure, the process of receiving files from the server is illustrated. The client steps include: Send the CWD (switch to root directory) command to the server, receive the 250 command code from the server, and get the current directory.
[0059] Send the PWD (current working directory) command to the server, receive the 257 command code replied by the server, and obtain the current working directory.
[0060] Send the TYPEA (transfer file type, A stands for text mode) command to the server and receive the 200 command code from the server, indicating that the setting is successful.
[0061] Send the PASV (enter PASV mode) command to the server, receive the 227 command code encrypted by the server, and decrypt the 227 command code. It should be noted that the content encrypted by the 227 command code includes the plain text IP, ports (multi-ports) of multiple data transmission channels, and file information.
[0062] After establishing a connection with the server through the Connect command, the encrypted file is received from the server. After receiving the file, the encrypted 226 instruction code returned by the server is decrypted and the corresponding port is closed. It should be noted that the 226 instruction code is an instruction to close the data transmission channel, and its encrypted content includes the plain text IP, port, and file information. The port is the specified port, that is, the port where the transmission is completed.
[0063] The server-side steps include: After receiving the CWD command from the client, the system replies with a 250 command code to the client, where the 250 command code includes the current directory.
[0064] After receiving the PWD command from the client, it replies to the client with a 257 command code, which includes the current working directory.
[0065] After receiving the TYPEA command from the client, it replies to the client with a 200 command code, which indicates that the setting is successful.
[0066] After receiving the PASV command from the client, it replies with the 227 command code to the client, opens multiple ports to the client, and adds file information.
[0067] After establishing a connection with the client through the Accept instruction, the transmitted file is encrypted and sent to the client, and after the file transmission is completed on the corresponding port, the instruction code 226 is returned to close the corresponding transmission port.
[0068] As a specific example, Figure 8 As shown in the figure, it illustrates the process of the client completing the dynamic monitoring of the data channel through the timer. The client steps include: In PASV mode, obtain the port of the bindable data transmission channel from the server and return the bound port to the server.
[0069] Receive files transmitted by the server through a single channel and store the file data in a specified location. According to the new bindable port periodically opened by the receiving server, periodically calculate the new binding port number through timestamp and timer, dynamically establish or delete data channels, and return to the server to establish or close multiple data transmission channels. Receive data transmitted by the data transmission channel periodically opened by the server and store it in the specified location of the file until the file transmission is completed.
[0070] It is easy to understand that the instruction channel has a small amount of data transmission and uses a single-port channel for transmission. The data channel has a large amount of data and is dynamic multi-port transmission. The data port allocated according to the number of cores is more efficient than a single data port. The dynamic port number calculated based on the timestamp can reduce the risk of data transmission being monitored.
[0071] Furthermore, the above-mentioned new port number is bound periodically calculated by using the timestamp and the timer. The specific example is: Set the embedded device as the server and the PC as the client. The client transfers files to the server for upload, and the client obtains files from the server for download. In PASV mode, the client first communicates with the server through the specified command port, such as transmitting information such as file name and file size. During the file data transmission process, the server calculates multiple newly opened data port numbers through timestamp-related algorithms (timestamp-related algorithms, such as converting timestamps (seconds as the smallest unit) into time with minutes as the smallest unit and then obtaining open port numbers through fixed calculations). The client calculates multiple port numbers that need to be bound through the same algorithm and tries to bind. After the client successfully binds the newly opened port on the server, the server will use the port number for data transmission.
[0072] The server-side steps include: Send a PASV return command to the client to enter PASV mode.
[0073] Receive the bound port returned by the client and send the file to the client through the bound single-channel data transmission port.
[0074] The multiple open data transmission port numbers are periodically calculated through timestamps and timers and sent to the client. The receiving client periodically calculates and binds multiple data transmission ports, and sends files to the client in packets through the multiple data transmission ports bound by the client until the file transfer is completed.
[0075] It is easy to understand that the multiple data transmission port numbers opened by periodic calculation of timestamp and timer are specifically shown as follows: the new multiple data port numbers are calculated by the unified algorithm of the server and the client, and this algorithm is related to the timestamp. As long as the time difference between the client and the server is within the range allowed by the algorithm (for example, the timestamp difference is 1 second, and the timestamp second / 60*60 is used for calculation, the timestamp difference will not be greater than 60 seconds, Figure 2 The client and server use the same timing cycle to calculate (for example, once every 1 minute). The old port number will be dynamically deleted after the transmission is completed, and then the client will rebind the new port for transmission.
[0076] In summary, the large-capacity reliable file transmission method of this embodiment encrypts the large-capacity file data, which actually converts the plaintext into dynamic ciphertext, and encapsulates a layer of data structure at the application layer, so that the security of large-capacity file transmission is guaranteed.
[0077] Traditional FTP only transfers files through a single data channel plus a command channel. This method uses a command channel plus multiple data channels for transmission, which can transfer files more efficiently.
[0078] Traditional FTP cannot implement breakpoint resume and error retransmission mechanisms. This method supports breakpoint resume and error retransmission by adding a temporary file to record the data transmission process.
[0079] Embodiment 2: Based on the same inventive concept, the second embodiment of the present invention further provides a computer program product, including a computer program or instruction, which, when executed by a processor, implements the steps of a large-capacity reliable file transmission method executed on the client as described in Embodiment 1. And, when executed by a processor, the computer program or instruction implements the steps of a large-capacity reliable file transmission method executed on the server as described in Embodiment 1.
[0080] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0081] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0084] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flow involved in the above embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0085] The above description is only the preferred embodiment of the present invention. It is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the protection scope of the present invention.
Claims
1. A method for transmitting large-capacity reliable files, characterized in that: The client side includes the following steps: Before the transmitted files enter the Ethernet, the transmitted files are packaged and encrypted, so that the transmitted files are converted from plain text data into multiple dynamic ciphertext data packets; Establishing a connection with a data transmission channel periodically opened by the server, wherein the period of opening the data transmission channel is determined according to the transmission time and transmission completion status of multiple dynamic ciphertext data packets; Multiple dynamic ciphertext data packets are transmitted to the server through a data transmission channel connected to the server.
2. A method for transmitting large-capacity reliable files according to claim 1, characterized in that: Before the files are packaged and encrypted for transmission, the time is periodically synchronized and corrected with the server based on the time difference with the server. If the time difference is greater than the set threshold, the PTP time synchronization method is used to periodically synchronize and correct the time with the server.
3. A method for transmitting large-capacity reliable files according to claim 2, characterized in that: Calculating the time difference with the server includes the following steps: After connecting to the server, a time synchronization instruction with a timestamp of T1 is sent to the server at time T1; After receiving the time synchronization instruction at time T2, the receiving server sends a data packet with timestamps T2 and T3 at time T3, and records the current client time T4 after receiving the data packet; Calculate the time difference with the server based on T1, T2, T3, and T4; time difference The calculation formula is: ; Among them, T12 is the time from timestamp T1 to timestamp T2, and T34 is the time from timestamp T3 to timestamp T4.
4. A method for transmitting large-capacity reliable files according to claim 1, characterized in that: During the transmission of dynamic ciphertext data packets, the client performs packet splitting when it is the sender, and performs packet assembly when it is the receiver; During data transmission, the encryption algorithm interface is registered through the reserved callback method, and the encryption and decryption algorithms of the server and client are consistent.
5. A method for transmitting large-capacity reliable files according to claim 1, characterized in that: It also includes generating a temporary file for recording the completion of file transmission during the transmission process of the dynamic ciphertext data packet. When uploading a file, the temporary file is stored on the server side, and when downloading a file, the temporary file is stored on the client side.
6. A method for transmitting large-capacity reliable files, characterized in that: The server side includes the following steps: Before the transmitted files enter the Ethernet, the transmitted files are packaged and encrypted, so that the transmitted files are converted from plain text data into multiple dynamic ciphertext data packets; According to the transmission time and transmission completion status of multiple dynamic ciphertext data packets, a data transmission channel is periodically opened to the client; Multiple dynamic ciphertext data packets are transmitted to the client through an open data transmission channel bound to the client.
7. A method for transmitting large-capacity reliable files according to claim 6, characterized in that: After the server and the client are synchronized, the client and the server calculate the same port number of the data transmission channel through the same timestamp and the same algorithm, so that the port of the client's data transmission channel is dynamically bound to the port of a different data transmission channel on the server; During the transmission of ciphertext data packets, the number of port numbers of the data transmission channel is consistent with the number of cores on the server. When the server acts as a sender, it performs packet subdivision processing, and when the server acts as a receiver, it performs packet assembly processing.
8. A method for transmitting large-capacity reliable files according to claim 6, characterized in that: Before the files are packaged and encrypted for transmission, the time is periodically synchronized and corrected with the client based on the time difference with the client. If the time difference is greater than the set threshold, the PTP time synchronization method is used to periodically synchronize and correct the time with the client.
9. A method for transmitting large-capacity reliable files according to claim 6, characterized in that: Add file information of multiple dynamic ciphertext data packets and port numbers of data transmission channels, bind the port number of the data transmission channel and the timestamp, and make the data transmission channel in a periodic changing state through the timestamp, timer and configuration update cycle.
10. A computer program product, characterized in that It comprises a computer program or instructions, which, when executed by a processor, implements the steps of a large-capacity reliable file transmission method as described in any one of claims 1 to 5.
11. A computer program product, characterized in that It includes a computer program or instructions, which, when executed by a processor, implements the steps of a large-capacity reliable file transmission method as described in any one of claims 6 to 9.
Citation Information
Patent Citations
Time synchronization method, device and system
CN104270238A
FTP file reliable transmission method based on port hopping
CN107094183A
Secure file transmission management method and system
CN109428899A