A file transmission method, system and medium based on multiple transmission protocols
By combining multiple transmission protocols and real-time verification in file transfer, the problem that a single protocol cannot achieve accuracy and speed at the same time is solved, an efficient and intelligent file transfer process is achieved, and the transmission quality and efficiency are optimized.
Patent Information
- Application Number
- CN202111574837.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-12-21
AI Technical Summary
In the prior art, a single transmission protocol cannot achieve the accuracy and speed of file transmission at the same time, resulting in inefficient transmission efficiency. A method is needed to combine multiple transmission protocols to complement their disadvantages and optimize file transmission efficiency.
By configuring multiple transmission protocols on the file sending and receiving ends, bandwidth calculation and file integrity verification are performed, transmission logic is set according to transmission requirements and bandwidth, multi-protocol transmission or single-protocol transmission is adopted, real-time verification and adjustment of transmission protocols are checked and implemented according to transmission requirements and bandwidth. , to achieve efficient and accurate file transfer.
It realizes segmented transmission through multi-protocol combination, real-time checksum protocol adjustment, improves the quality and efficiency of file transmission, can judge and solve the causes of transmission failures, intelligently optimize the transmission process, and make up for the shortcomings of the existing technology.
Smart Images

Figure CN114363317B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of file transmission technology, and in particular to a file transmission method, system and medium based on multiple transmission protocols. Background Art
[0002] With the development of network technology, there are many ways to transfer files, and there are also many corresponding transfer protocols. Correspondingly, the transfer protocols are mainly divided into reliable protocols and unreliable protocols. Reliable protocols have great advantages in the accuracy of file transfer and can handle file transfer interruption problems. However, the file transfer speed of reliable protocols is slower than that of unreliable protocols, while the file transfer speed of unreliable protocols is faster, but the accuracy of file transfer needs to be improved.
[0003] To sum up, using a single transmission protocol can only achieve a single transmission advantage, so a file transmission method that can effectively combine multiple transmission protocols is needed, thereby complementing the disadvantages of the transmission protocols and ultimately optimizing the file transmission efficiency. Summary of the invention
[0004] The main purpose of the present invention is to develop a file transmission method that can effectively combine multiple transmission protocols, thereby complementing the disadvantages of the transmission protocols and ultimately optimizing the file transmission efficiency.
[0005] To achieve the above object, a technical solution adopted by the present invention is to provide a file transmission method based on multiple transmission protocols, comprising the following steps:
[0006] Initial setup steps:
[0007] Configure a file sending end and a file receiving end, and establish an Ethernet connection between the file sending end and the file receiving end; perform a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth;
[0008] File transfer steps:
[0009] A file transfer protocol is configured at both the file sending end and the file receiving end; a file integrity check program is configured at the file receiving end; a file resource threshold is set to obtain a file transfer requirement; and a protocol adaptation transmission operation is performed based on the first transmission bandwidth, the file transfer protocol, the file integrity check program, the file resource threshold, and the file transfer requirement.
[0010] As an improved solution, the file transfer protocol includes: a first transfer protocol and a second transfer protocol; the file transfer requirement includes a first requirement and a second requirement; the first requirement is that there is a first file to be transferred; the second requirement is that there is no first file to be transferred.
[0011] As an improved solution, the bandwidth calculation operation includes:
[0012] Acquire first support information of a first network card at the file sending end, and acquire second support information of a second network card at the file receiving end; identify a first bandwidth benchmark in the first support information, and identify a second bandwidth benchmark in the second support information;
[0013] The first bandwidth benchmark and the second bandwidth benchmark are compared; if the first bandwidth benchmark is greater than the second bandwidth benchmark, the second bandwidth benchmark is set as the first transmission bandwidth; if the first bandwidth benchmark is less than the second bandwidth benchmark, the first bandwidth benchmark is set as the first transmission bandwidth; if the first bandwidth benchmark is equal to the second bandwidth benchmark, the first bandwidth benchmark or the second bandwidth benchmark is set as the first transmission bandwidth.
[0014] As an improved solution, the protocol adaptation transmission operation includes:
[0015] Identify the file transfer requirement; when the file transfer requirement is a first requirement, obtain a first file resource value of the first file;
[0016] Determine whether the first file resource value reaches the file resource threshold; if so, execute a multi-protocol transmission step based on the first transmission bandwidth, the first transmission protocol, the second transmission protocol, the file integrity verification program and the first file resource value; if not, execute a single-protocol transmission step based on the first transmission protocol.
[0017] As an improved solution, the multi-protocol transmission step includes:
[0018] Setting a division base; configuring a bandwidth matching table; setting a first transmission logic and a second transmission logic based on the file integrity check program, the first transmission protocol and the second transmission protocol;
[0019] Calculating the quotient of the first file resource value and the partitioning base to obtain a first partitioning resource value; dividing the first file into a plurality of file blocks to be transmitted according to the first partitioning resource value; and selecting a first file block to be transmitted from the plurality of file blocks to be transmitted;
[0020] The first file block to be transmitted is transmitted between the file sending end and the file receiving end based on the first transmission logic to obtain a first transmission result;
[0021] identifying the first transmission result;
[0022] If the first transmission result is that the first file block to be transmitted is transmitted normally, transmitting a plurality of the file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the first transmission logic;
[0023] If the first transmission result is that the first file block to be transmitted is missing, transmitting the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic to obtain a second transmission result;
[0024] identifying the second transmission result;
[0025] If the second transmission result is that the first file block to be transmitted is transmitted normally, transmitting a plurality of the file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic;
[0026] If the second transmission result is that the first file block to be transmitted is missing, the first real-time Ethernet rate of the file receiving end and the second real-time Ethernet rate of the file sending end are obtained; a first bandwidth value matching the first real-time Ethernet rate is screened out in the bandwidth matching table; a second bandwidth value matching the second real-time Ethernet rate is screened out in the bandwidth matching table; the first transmission bandwidth is compared with the first bandwidth value and the second bandwidth value respectively; if the first bandwidth value does not reach the first transmission bandwidth or the second bandwidth value does not reach the first transmission bandwidth, a network card fault prompt information is sent to the file receiving end or the file sending end; if the first bandwidth value reaches the first transmission bandwidth and the second bandwidth value reaches the first transmission bandwidth, a transmission protocol fault prompt information is sent to the file receiving end and the file sending end.
[0027] As an improved solution, the first transmission logic includes:
[0028] The first file block to be transmitted is transmitted to the file receiving end by using the second transmission protocol at the file sending end, and a first calling instruction is sent to the file integrity verification program at the same time; the file integrity verification program is called at the file receiving end based on the first calling instruction, and a first transmission verification operation is performed on the received first file block to be transmitted by using the first transmission protocol;
[0029] The second transmission logic includes:
[0030] The first transmission protocol is used at the file sending end to transmit the first file block to be transmitted to the file receiving end, and the first calling instruction is sent to the file integrity verification program at the same time; the file integrity verification program is called at the file receiving end based on the first calling instruction, and the first transmission protocol is used to perform a second transmission verification operation on the received first file block to be transmitted.
[0031] As an improved solution, the first transmission verification operation includes:
[0032] Obtain a second transmission rate value supported by the second transmission protocol; obtain file character value information of the first file block to be transmitted; calculate the quotient of the first partition resource value and the second transmission rate value to obtain a first transmission time; call the file integrity check program to perform a timing operation upon receiving the first call instruction to generate a first waiting time; compare the first transmission time and the first waiting time; when the first waiting time reaches the first transmission time, call the file integrity check program to use the first transmission protocol to read the first file check value of the first file block to be transmitted received by the file receiving end; determine whether the first file check value matches the file character value information; if they match, set the first transmission result as normal transmission of the first file block to be transmitted; if they do not match, set the first transmission result as missing of the first file block to be transmitted;
[0033] The second transmission verification operation includes:
[0034] Obtain a first transmission rate value supported by the first transmission protocol; obtain the file character value information of the first file block to be transmitted; calculate the quotient of the first partitioned resource value and the first transmission rate value to obtain a second transmission time; call the file integrity check program to perform a timing operation upon receiving the first call instruction to generate a second waiting time; compare the second transmission time and the second waiting time; when the second waiting time reaches the second transmission time, call the file integrity check program to use the first transmission protocol to read the second file check value of the first file block to be transmitted received by the file receiving end; determine whether the second file check value matches the file character value information; if they match, set the second transmission result as normal transmission of the first file block to be transmitted; if they do not match, set the second transmission result as missing of the first file block to be transmitted.
[0035] As an improved solution, the single-protocol transmission step includes:
[0036] The first file is sent to the file receiving end by using the first transmission protocol at the file sending end; and the first file is received by using the first transmission protocol at the file receiving end.
[0037] The present invention also provides a file transmission system based on multiple transmission protocols, comprising:
[0038] Initial setup module and file transfer module;
[0039] The initial setting module is used to configure a file sending end and a file receiving end, and the initial setting module is also used to establish an Ethernet connection between the file sending end and the file receiving end; the initial setting module performs a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth;
[0040] The file transfer module is used to configure the file transfer protocol at both the file sending end and the file receiving end; the file transfer module is also used to configure the file integrity verification program at the file receiving end; the file transfer module is also used to set the file resource threshold and obtain the file transfer demand; the file transfer module performs the protocol adaptation transmission operation based on the first transmission bandwidth, the file transfer protocol, the file integrity verification program, the file resource threshold and the file transfer demand.
[0041] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the file transmission method based on multiple transmission protocols are implemented.
[0042] The beneficial effects of the present invention are:
[0043] 1. The file transmission method based on multiple transmission protocols described in the present invention can realize segmented transmission of files by segmented combination of multiple transmission protocols. Real-time verification can be performed during the transmission process. At the same time, the transmission protocol can be adjusted according to different transmission situations. When a transmission failure occurs, the cause of the transmission failure can also be determined. It is highly intelligent and simultaneously optimizes the transmission quality and transmission efficiency of the file, making up for the shortcomings of the existing technology and having certain application value.
[0044] 2. The file transfer system based on multiple transmission protocols described in the present invention can realize segmented transmission of files by segmented combination of multiple transmission protocols through the mutual cooperation of the initial setting module and the file transfer module. Real-time verification can be performed during the transmission process. At the same time, the transmission protocol can be adjusted according to different transmission situations. When a transmission failure occurs, the cause of the transmission failure can also be determined. It is highly intelligent, and the transmission quality and efficiency of the file are simultaneously optimized, which makes up for the shortcomings of the existing technology and has certain application value.
[0045] 3. The computer-readable storage medium described in the present invention can guide the initial setting module and the file transfer module to cooperate, and then realize the segmented combination of multiple transmission protocols, and then the segmented transmission of files. Real-time verification can be performed during the transmission process, and the transmission protocol can be adjusted according to different transmission situations. When a transmission failure occurs, the cause of the transmission failure can also be determined. It is highly intelligent and simultaneously optimizes the transmission quality and transmission efficiency of the file, making up for the shortcomings of the existing technology. It has certain application value and effectively improves the operability of the file transmission method based on multiple transmission protocols. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 is a flowchart of the file transmission method based on multiple transmission protocols described in Example 1 of the present invention;
[0048] Figure 2 It is a schematic diagram of a specific process of the file transmission method based on multiple transmission protocols according to Embodiment 1 of the present invention;
[0049] Figure 3 It is an architecture diagram of a file transfer system based on multiple transmission protocols described in Example 2 of the present invention. DETAILED DESCRIPTION
[0050] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0051] In the description of the present invention, it should be noted that the embodiments described in the present invention are only part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0052] In the description of the present invention, it should be noted that the terms “first” and “second” are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0053] Example 1
[0054] This embodiment provides a file transmission method based on multiple transmission protocols, such as Figure 1 and Figure 2 As shown, the following steps are included:
[0055] S100, initial setting steps, specifically including:
[0056] S110, configure a file sending end and a file receiving end, establish an Ethernet connection between the file sending end and the file receiving end; perform a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth; step S100 specifically collects information involving a sending end, a receiving end, transmission software and transmission hardware; perform a detection of the sending end hardware and software in the initial step, thereby ensuring that problems are discovered in a timely manner during subsequent file transmission;
[0057] Specifically, the file transfer protocol includes: a first transfer protocol and a second transfer protocol; the file transfer demand includes a first demand and a second demand; the first demand is that there is a first file to be transferred; the second demand is that there is no first file to be transferred; in this embodiment, the first transfer protocol is a reliable transfer protocol, and its transmission rate is low, but its transmission accuracy and integrity are strong; the second transfer protocol is an unreliable transfer protocol, and its transmission rate is higher than the first transfer protocol, which can meet the file transfer in emergency situations, but its transmission accuracy is relatively low; this method adopts the mutual combination of the two transfer protocols for real-time adjustment, thereby giving full play to the maximum advantages of the two protocols, and performing efficient file transmission and high-precision file verification;
[0058] In the following steps, the file sending end is referred to as the "sending end" and the file receiving end is referred to as the "receiving end";
[0059] Specifically, the bandwidth calculation operation includes: obtaining first support information of the first network card of the sending end, and obtaining second support information of the second network card of the receiving end; the support information is the basic rate information of the network card, and the maximum rate / bandwidth that can be supported; identifying the first bandwidth benchmark in the first support information, identifying the second bandwidth benchmark in the second support information, comparing the first bandwidth benchmark and the second bandwidth benchmark, if the first bandwidth benchmark is greater than the second bandwidth benchmark, setting the second bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is less than the second bandwidth benchmark, setting the first bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is equal to the second bandwidth benchmark, setting the first bandwidth benchmark or the second bandwidth benchmark as the first transmission bandwidth; correspondingly, the above steps set the maximum supported bandwidth during file transfer. According to relevant knowledge in network transmission, the maximum transmission bandwidth that can be supported between two network cards is the one with the lower bandwidth, and this result is caused by the influence of hardware architecture; the first transmission bandwidth is used for accurate judgment of transmission failures in subsequent transmission steps; through step S100, an effective data foundation is established for step S200.
[0060] S200, file transfer step, specifically including:
[0061] S210, configuring a file transfer protocol at both the file sending end and the file receiving end; configuring a file integrity check program at the file receiving end; setting a file resource threshold to obtain a file transfer requirement; performing a protocol adaptation transmission operation based on the first transmission bandwidth, the file transfer protocol, the file integrity check program, the file resource threshold and the file transfer requirement; the protocol adaptation transmission operation is to start transmitting the file by adopting a multi-protocol combined segmented transmission method after completing the comparison and setting of the initial data in step S100;
[0062] Specifically, the protocol adaptation transmission operation includes:
[0063] First, it is necessary to identify the file transfer demand. When the file transfer demand is the first demand, it means that the first file needs to be transferred, and the first file is the file that the sender will transfer to the receiver; obtain the first file resource value of the first file; in this embodiment, the file resource threshold is set to 500MB; determine whether the first file resource value reaches the file resource threshold; if it reaches, it means that the first file currently being transferred is a large-capacity file and needs to be efficiently transmitted in multiple protocols, so the multi-protocol transmission step is performed based on the first file resource value; if it does not reach, it means that the first file currently being transferred is a low-capacity file, so there is no need to perform multi-protocol segmented transmission to save read and write resources, so the single-protocol transmission step is performed based on the first file resource value;
[0064] Specifically, the multi-protocol transmission steps include:
[0065] A partitioning cardinality is set. In this embodiment, the partitioning cardinality is specifically set according to the first file resource value. In this embodiment, the partitioning cardinality is set to 3, so the quotient of the first file resource value and the partitioning cardinality is calculated to obtain the first partitioning resource value; for example, when the first file resource value is 1.5GB, the first partitioning resource value is 0.5GB; the first file is divided into a number of file blocks to be transmitted according to the first partitioning resource value, and the width of each file to be transmitted is the first partitioning resource value; a first file block to be transmitted is selected from the number of the first file blocks to be transmitted; the first file block to be transmitted is any one of the first file blocks to be transmitted that is first transmitted; in this method, the file is divided into file blocks for transmission, which not only improves the security of data transmission, but also the small file blocks will improve the transmission efficiency and thread processing efficiency to a certain extent;
[0066] First, a first transmission logic with a faster transmission rate is adopted, that is: the first file block to be transmitted is transmitted to the receiving end by adopting the second transmission protocol at the sending end, and a first call instruction is sent to the file integrity verification program at the same time; the file integrity verification program is called at the receiving end to perform a first transmission verification operation on the received first file block to be transmitted by adopting the first transmission protocol to obtain a first transmission result; if the first transmission result is that the first file block to be transmitted is transmitted normally, it means that the corresponding second transmission protocol in the first transmission logic is stable and adaptable, so the first transmission logic is continued to be adopted to send a number of the file blocks to be transmitted except the first file block to be transmitted to the receiving end. receiving end; if the first transmission result is that the first file block to be transmitted is missing, it means that delay and packet loss have occurred, and the second transmission protocol corresponding to the first transmission logic is unstable, and it is necessary to judge other transmission protocols, and in order to ensure the effectiveness and security of the entire transmission process, analyze the specific faults in the transmission; accordingly, the second transmission logic is adopted, that is: the first transmission protocol is adopted to transmit the first file block to be transmitted to the receiving end, and the first calling instruction is sent to the file integrity verification program at the same time, and the file integrity verification program is called at the receiving end to perform the second transmission verification operation on the first file block to be transmitted using the first transmission protocol to obtain a second transmission result;
[0067] Correspondingly, the second transmission result is identified; if the second transmission result is that the first file block to be transmitted is transmitted normally, it means that there is a problem with the second transmission protocol abnormality in the first transmission logic, so this second transmission logic is used to send several file blocks to be transmitted except the first file block to be transmitted to the receiving end to ensure the orderly transmission of files; if the second transmission result is that the first file block to be transmitted is missing, it means that delay and packet loss have occurred, and there may be a network card problem or a transmission protocol problem, so specific judgment is required; at this time, the first real-time Ethernet rate of the receiving end and the second real-time Ethernet rate of the sending end are obtained; a bandwidth matching table is configured, and the bandwidth matching table is configured with several Ethernet rates and bandwidths that match the several Ethernet rates respectively. value; therefore, a first bandwidth value matching the first real-time Ethernet rate is screened out in the bandwidth matching table; a second bandwidth value matching the second real-time Ethernet rate is screened out in the bandwidth matching table; if the first bandwidth value does not reach the first transmission bandwidth or the second bandwidth value does not reach the first transmission bandwidth, it means that there is a problem with the network cards of the current receiving end and the sending end and the transmission efficiency of the transmission protocol is affected, so a network card fault prompt information is sent to the receiving end or the sending end; if the first bandwidth value reaches the first transmission bandwidth and the second bandwidth value reaches the first transmission bandwidth, it means that there is no problem with the network cards of the current receiving end and the sending end, and specifically it is an abnormality of the transmission protocol, so a transmission protocol fault prompt information is sent to the receiving end and the sending end.
[0068] Specifically, in this embodiment, the operation principles of the first transmission verification operation and the second transmission verification operation are similar, but the specific object data of the operation is different. When performing the verification operation, it is necessary to obtain the first transmission rate value supported by the first transmission protocol and the second transmission rate value supported by the second transmission protocol; the verification principles of the first transmission verification operation and the second transmission verification operation are:
[0069] Obtain file character value information of the first file block to be transmitted; calculate the quotient of the first partition resource value and the second transmission rate value (calculate the quotient of the first partition resource value and the first transmission rate value when the second transmission logic is adopted) to obtain a first transmission time (obtain a second transmission time when the second transmission logic is adopted); call the file integrity check program to perform a timing operation upon receiving the first call instruction to generate a first waiting time, and when the first waiting time reaches the first transmission time (when the second transmission logic is adopted, when the first waiting time reaches the second transmission time), call the file integrity check program to read the first file check value of the first file block to be transmitted received by the receiving end using the first transmission protocol; determine whether the first file check value matches the file character value information, and if so, set the first transmission result as normal transmission of the first file block to be transmitted (when the second transmission logic is adopted, set the second transmission result as normal transmission of the first file block to be transmitted); if not, set the first transmission result or the second transmission result as missing of the first file block to be transmitted (when the second transmission logic is adopted, set the second transmission result as missing of the first file block to be transmitted).
[0070] Specifically, the single-protocol transmission step includes: using the first transmission protocol at the sending end to send the first file to the receiving end; using the first transmission protocol at the receiving end to receive the first file; the purpose of the single-protocol transmission step is to perform the most stable transmission for low-capacity files, so the first transmission protocol is used for file transmission.
[0071] Example 2
[0072] This embodiment is based on the same inventive concept as the file transmission method based on multiple transmission protocols described in Embodiment 1, and provides a file transmission system based on multiple transmission protocols, such as Figure 3 As shown, it includes: an initial setting module and a file transfer module;
[0073] In the file transmission system based on multiple transmission protocols, the initial setting module is used to configure a file sending end and a file receiving end, and the initial setting module is also used to establish an Ethernet connection between the file sending end and the file receiving end; the initial setting module performs a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth;
[0074] Specifically, the file transfer protocol includes: a first transfer protocol and a second transfer protocol;
[0075] Specifically, the bandwidth calculation operation includes: the initial setting module obtains the first support information of the first network card of the file sending end, and the initial setting module obtains the second support information of the second network card of the file receiving end; the initial setting module identifies the first bandwidth benchmark in the first support information, and the initial setting module identifies the second bandwidth benchmark in the second support information; the initial setting module compares the first bandwidth benchmark and the second bandwidth benchmark; if the first bandwidth benchmark is greater than the second bandwidth benchmark, the initial setting module sets the second bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is less than the second bandwidth benchmark, the initial setting module sets the first bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is equal to the second bandwidth benchmark, the initial setting module sets the first bandwidth benchmark or the second bandwidth benchmark as the first transmission bandwidth.
[0076] In the file transfer system based on multiple transmission protocols, the file transfer module is used to configure the file transfer protocol at both the file sending end and the file receiving end; the file transfer module is also used to configure the file integrity check program at the file receiving end; the file transfer module is also used to set the file resource threshold and obtain the file transfer demand; the file transfer module performs the protocol adaptation transmission operation based on the first transmission bandwidth, the file transfer protocol, the file integrity check program, the file resource threshold and the file transfer demand;
[0077] Specifically, the file transmission requirement includes a first requirement and a second requirement; the first requirement is that there is a first file to be transmitted; the second requirement is that there is no first file to be transmitted;
[0078] Specifically, the protocol adaptation transmission operation includes: the file transfer module identifies the file transfer requirement; when the file transfer requirement is the first requirement, the file transfer module obtains the first file resource value of the first file; the file transfer module determines whether the first file resource value reaches the file resource threshold; if reached, the file transfer module performs a multi-protocol transmission step based on the first transmission bandwidth, the first transmission protocol, the second transmission protocol, the file integrity verification program and the first file resource value; if not reached, the file transfer module performs a single-protocol transmission step based on the first transmission protocol.
[0079] Specifically, the multi-protocol transmission step includes: the file transmission module sets a division cardinality; the file transmission module configures a bandwidth matching table; the file transmission module sets a first transmission logic and a second transmission logic based on the file integrity check program, the first transmission protocol and the second transmission protocol; the file transmission module calculates the quotient of the first file resource value and the division cardinality to obtain a first division resource value; the file transmission module divides the first file into a plurality of file blocks to be transmitted according to the first division resource value; the file transmission module selects a first file block to be transmitted from the plurality of file blocks to be transmitted; the file transmission module transmits the first file block to be transmitted between the file sending end and the file receiving end based on the first transmission logic to obtain a first transmission result; the file transmission module identifies the first transmission result; if the first transmission result is that the first file block to be transmitted is transmitted normally, the file transmission module transmits a plurality of file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the first transmission logic; if the first transmission result is that the first file block to be transmitted is missing, the file transmission module transmits the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic to obtain a second transmission result; the file transmission module identifies the second transmission result; if the second transmission result is that the first file block to be transmitted is transmitted normally, the file transmission module transmits several file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic; if the second transmission result is that the first file block to be transmitted is missing, the file transmission module obtains the first real-time Ethernet rate of the file receiving end and the second real-time Ethernet rate of the file sending end; the file transmission module selects a first bandwidth value matching the first real-time Ethernet rate in the bandwidth matching table; the file transmission module selects a second bandwidth value matching the second real-time Ethernet rate in the bandwidth matching table; the file transmission module compares the first transmission bandwidth with the first bandwidth value and the second bandwidth value respectively; if the first bandwidth value does not reach the first transmission bandwidth or the second bandwidth value does not reach the first transmission bandwidth, the file transmission module sends a network card fault prompt information to the receiving end or the sending end; if the first bandwidth value reaches the first transmission bandwidth and the second bandwidth value reaches the first transmission bandwidth, the file transmission module sends a transmission protocol fault prompt information to the receiving end and the sending end.
[0080] Specifically, the first transmission logic includes: the file transmission module at the file sending end transmits the first file block to be transmitted to the file receiving end by using the second transmission protocol, and sends a first call instruction to the file integrity verification program at the same time; the file transmission module calls the file integrity verification program at the file receiving end based on the first call instruction, and uses the first transmission protocol to perform a first transmission verification operation on the received first file block to be transmitted;
[0081] The second transmission logic includes: the file transmission module uses the first transmission protocol at the file sending end to transmit the first file block to be transmitted to the file receiving end, and sends the first calling instruction to the file integrity verification program at the file receiving end; the file transmission module calls the file integrity verification program at the file receiving end based on the first calling instruction, and uses the first transmission protocol to perform a second transmission verification operation on the received first file block to be transmitted.
[0082] Specifically, the first transmission verification operation includes: the file transmission module obtains the second transmission rate value supported by the second transmission protocol; the file transmission module obtains the file character value information of the first file block to be transmitted; the file transmission module calculates the quotient of the first divided resource value and the second transmission rate value to obtain the first transmission time; the file transmission module calls the file integrity verification program to perform a timing operation and generate a first waiting time when receiving the first calling instruction; the file transmission module compares the first transmission time and the first waiting time; when the first waiting time reaches the first transmission time, the file transmission module calls the file integrity verification program to use the first transmission protocol to read the first file verification value of the first file block to be transmitted received by the file receiving end; the file transmission module determines whether the first file verification value matches the file character value information; if they match, the file transmission module sets the first transmission result as normal transmission of the first file block to be transmitted; if they do not match, the file transmission module sets the first transmission result as missing of the first file block to be transmitted;
[0083] Specifically, the second transmission verification operation includes: the file transmission module obtains the first transmission rate value supported by the first transmission protocol; the file transmission module obtains the file character value information of the first file block to be transmitted; the file transmission module calculates the quotient of the first divided resource value and the first transmission rate value to obtain a second transmission time; the file transmission module calls the file integrity verification program and performs a timing operation when receiving the first call instruction to generate a second waiting time; the file transmission module compares the second transmission time and the second waiting time; when the second waiting time reaches the second transmission time, the file transmission module calls the file integrity verification program to use the first transmission protocol to read the second file verification value of the first file block to be transmitted received by the file receiving end; the file transmission module determines whether the second file verification value matches the file character value information; if they match, the file transmission module sets the second transmission result as normal transmission of the first file block to be transmitted; if they do not match, the file transmission module sets the second transmission result as missing of the first file block to be transmitted.
[0084] Specifically, the single-protocol transmission step includes: the file transmission module at the file sending end uses the first transmission protocol to send the first file to the file receiving end; the file transmission module at the file receiving end uses the first transmission protocol to receive the first file.
[0085] Example 3
[0086] This embodiment provides a computer-readable storage medium, including:
[0087] The storage medium is used to store computer software instructions used to implement the file transfer method based on multiple transmission protocols described in the above-mentioned embodiment 1, which includes a program for executing the above-mentioned program set for the file transfer method based on multiple transmission protocols; specifically, the executable program can be built into the file transfer system based on multiple transmission protocols described in embodiment 2, so that the file transfer system based on multiple transmission protocols can implement the file transfer method based on multiple transmission protocols described in embodiment 1 by executing the built-in executable program.
[0088] In addition, the computer-readable storage medium of this embodiment may adopt any combination of one or more computer-readable storage media, wherein the computer-readable storage medium includes electrical, optical, electromagnetic, infrared or semiconductor systems, devices or components, or any combination thereof.
[0089] Different from the prior art, the present application adopts a file transmission method, system and medium based on multiple transmission protocols. Through this method, the segmented combination of multiple transmission protocols can be achieved, and then the file is transmitted in segments. Real-time verification can be performed during the transmission process. At the same time, the transmission protocol can be adjusted according to different transmission situations. When a transmission failure occurs, the cause of the transmission failure can also be determined. It is highly intelligent. The system provides effective technical support for the method, and ultimately the file transmission quality and transmission efficiency are simultaneously optimized, which makes up for the shortcomings of the prior art and has certain application value.
[0090] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0091] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware. The program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0092] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A file transmission method based on multiple transmission protocols, characterized in that: The following steps are involved: Initial setup steps: Configure a file sending end and a file receiving end, and establish an Ethernet connection between the file sending end and the file receiving end; perform a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth; File transfer steps: Configure a file transfer protocol at both the file sending end and the file receiving end; configure a file integrity check program at the file receiving end; Setting a file resource threshold to obtain a file transfer requirement; performing a protocol adaptation transmission operation based on the first transmission bandwidth, the file transfer protocol, the file integrity check program, the file resource threshold and the file transfer requirement; The file transfer protocol includes: a first transfer protocol and a second transfer protocol; the file transfer requirement includes a first requirement and a second requirement; the first requirement is that there is a first file to be transferred; the second requirement is that there is no first file to be transferred; The bandwidth calculation operation includes: Acquire first support information of a first network card at the file sending end, and acquire second support information of a second network card at the file receiving end; identify a first bandwidth benchmark in the first support information, and identify a second bandwidth benchmark in the second support information; Compare the first bandwidth benchmark and the second bandwidth benchmark; if the first bandwidth benchmark is greater than the second bandwidth benchmark, set the second bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is less than the second bandwidth benchmark, set the first bandwidth benchmark as the first transmission bandwidth; if the first bandwidth benchmark is equal to the second bandwidth benchmark, set the first bandwidth benchmark or the second bandwidth benchmark as the first transmission bandwidth; The protocol adaptation transmission operation includes: Identify the file transfer requirement; when the file transfer requirement is a first requirement, obtain a first file resource value of the first file; Determine whether the first file resource value reaches the file resource threshold; if so, perform a multi-protocol transmission step based on the first transmission bandwidth, the first transmission protocol, the second transmission protocol, the first file resource value of the file integrity check program; if not, perform a single-protocol transmission step based on the first transmission protocol; The multi-protocol transmission step comprises: Setting a division base; configuring a bandwidth matching table; setting a first transmission logic and a second transmission logic based on the file integrity check program, the first transmission protocol and the second transmission protocol; Calculating the quotient of the first file resource value and the partition base to obtain a first partition resource value; dividing the first file into a plurality of file blocks to be transmitted according to the first partition resource value; and selecting a first file block to be transmitted from the plurality of file blocks to be transmitted; The first file block to be transmitted is transmitted between the file sending end and the file receiving end based on the first transmission logic to obtain a first transmission result; identifying the first transmission result; If the first transmission result is that the first file block to be transmitted is transmitted normally, transmitting a plurality of the file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the first transmission logic; If the first transmission result is that the first file block to be transmitted is missing, transmitting the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic to obtain a second transmission result; identifying the second transmission result; If the second transmission result is that the first file block to be transmitted is transmitted normally, transmitting a plurality of the file blocks to be transmitted except the first file block to be transmitted between the file sending end and the file receiving end based on the second transmission logic; If the second transmission result is that the first file block to be transmitted is missing, the first real-time Ethernet rate of the file receiving end and the second real-time Ethernet rate of the file sending end are obtained; a first bandwidth value matching the first real-time Ethernet rate is screened out in the bandwidth matching table; a second bandwidth value matching the second real-time Ethernet rate is screened out in the bandwidth matching table; the first transmission bandwidth is compared with the first bandwidth value and the second bandwidth value respectively; if the first bandwidth value does not reach the first transmission bandwidth or the second bandwidth value does not reach the first transmission bandwidth, a network card fault prompt information is sent to the file receiving end or the file sending end; if the first bandwidth value reaches the first transmission bandwidth and the second bandwidth value reaches the first transmission bandwidth, a transmission protocol fault prompt information is sent to the file receiving end and the file sending end.
2. The file transmission method based on multiple transmission protocols according to claim 1, characterized in that: The first transmission logic includes: The first file block to be transmitted is transmitted to the file receiving end by using the second transmission protocol at the file sending end, and a first calling instruction is sent to the file integrity verification program at the same time; the file integrity verification program is called at the file receiving end based on the first calling instruction, and a first transmission verification operation is performed on the received first file block to be transmitted by using the first transmission protocol; The second transmission logic includes: The first transmission protocol is used at the file sending end to transmit the first file block to be transmitted to the file receiving end, and the first calling instruction is sent to the file integrity verification program at the same time; the file integrity verification program is called at the file receiving end based on the first calling instruction, and the first transmission protocol is used to perform a second transmission verification operation on the received first file block to be transmitted.
3. The file transmission method based on multiple transmission protocols according to claim 2, characterized in that: The first transmission verification operation includes: Obtain a second transmission rate value supported by the second transmission protocol; obtain file character value information of the first file block to be transmitted; calculate the quotient of the first partition resource value and the second transmission rate value to obtain a first transmission time; call the file integrity check program to perform a timing operation upon receiving the first call instruction to generate a first waiting time; compare the first transmission time and the first waiting time; when the first waiting time reaches the first transmission time, call the file integrity check program to use the first transmission protocol to read the first file check value of the first file block to be transmitted received by the file receiving end; determine whether the first file check value matches the file character value information; if they match, set the first transmission result as normal transmission of the first file block to be transmitted; if they do not match, set the first transmission result as missing of the first file block to be transmitted; The second transmission verification operation includes: Obtain a first transmission rate value supported by the first transmission protocol; obtain the file character value information of the first file block to be transmitted; calculate the quotient of the first partitioned resource value and the first transmission rate value to obtain a second transmission time; call the file integrity check program to perform a timing operation upon receiving the first call instruction to generate a second waiting time; compare the second transmission time and the second waiting time; when the second waiting time reaches the second transmission time, call the file integrity check program to use the first transmission protocol to read the second file check value of the first file block to be transmitted received by the file receiving end; determine whether the second file check value matches the file character value information; if they match, set the second transmission result as normal transmission of the first file block to be transmitted; if they do not match, set the second transmission result as missing of the first file block to be transmitted.
4. The file transmission method based on multiple transmission protocols according to claim 3 is characterized in that: The single protocol transmission step comprises: The first file is sent to the file receiving end by using the first transmission protocol at the file sending end; and the first file is received by using the first transmission protocol at the file receiving end.
5. A file transmission system based on multiple transmission protocols based on a file transmission method based on multiple transmission protocols according to any one of claims 1 to 4, characterized in that: include: Initial setup module and file transfer module; The initial setting module is used to configure a file sending end and a file receiving end, and the initial setting module is also used to establish an Ethernet connection between the file sending end and the file receiving end; the initial setting module performs a bandwidth calculation operation based on the file sending end and the file receiving end to obtain a first transmission bandwidth; The file transfer module is used to configure the file transfer protocol at both the file sending end and the file receiving end; the file transfer module is also used to configure the file integrity verification program at the file receiving end; the file transfer module is also used to set the file resource threshold and obtain the file transfer demand; the file transfer module performs the protocol adaptation transmission operation based on the first transmission bandwidth, the file transfer protocol, the file integrity verification program, the file resource threshold and the file transfer demand.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the file transmission method based on multiple transmission protocols described in any one of claims 1 to 4 are implemented.
