[go: up one dir, main page]

CN119520505A - File transmission method, device, storage medium and equipment for network bandwidth - Google Patents

File transmission method, device, storage medium and equipment for network bandwidth Download PDF

Info

Publication number
CN119520505A
CN119520505A CN202411650525.XA CN202411650525A CN119520505A CN 119520505 A CN119520505 A CN 119520505A CN 202411650525 A CN202411650525 A CN 202411650525A CN 119520505 A CN119520505 A CN 119520505A
Authority
CN
China
Prior art keywords
transmitted
token
file
sub
token bucket
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411650525.XA
Other languages
Chinese (zh)
Inventor
丁玎
刘晔
王晓亮
赵新颖
赵思萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202411650525.XA priority Critical patent/CN119520505A/en
Publication of CN119520505A publication Critical patent/CN119520505A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开属于数据传输技术领域,提供了用于网络带宽的文件传输方法、装置、存储介质和设备,所述方法包括:确定令牌桶中是否有大于或等于第一预设阈值的第一令牌;在确定令牌桶中有大于或等于第一预设阈值的第一令牌、且多个待传输子数据块中的任意一个待传输子数据块申请并获取到对应的第一令牌的情况下,将该待传输子数据块传输至对应的目的端。通过该文件传输方法,只有在令牌桶中有足够多的第一令牌、且任意一个待传输子数据块申请并获取到令牌桶中的一个令牌时,才将该待传输子数据块传输至对应的目的端,这样避免了可能出现的网络拥塞现象,从而实现了快速、稳定且可控的文件传输过程。

The present disclosure belongs to the technical field of data transmission, and provides a file transmission method, device, storage medium and equipment for network bandwidth, wherein the method comprises: determining whether there is a first token greater than or equal to a first preset threshold value in a token bucket; when it is determined that there is a first token greater than or equal to the first preset threshold value in the token bucket, and any one of a plurality of sub-data blocks to be transmitted applies for and obtains the corresponding first token, the sub-data block to be transmitted is transmitted to the corresponding destination. Through the file transmission method, only when there are enough first tokens in the token bucket, and any one of the sub-data blocks to be transmitted applies for and obtains a token in the token bucket, the sub-data block to be transmitted is transmitted to the corresponding destination, thus avoiding possible network congestion, thereby realizing a fast, stable and controllable file transmission process.

Description

File transmission method, device, storage medium and equipment for network bandwidth
Technical Field
The disclosure belongs to the technical field of data transmission, and particularly relates to a file transmission method, a device, a storage medium and equipment for network bandwidth.
Background
With the rapid development of the global civil aviation industry, airports serve as important transportation hubs, and the limitation of network bandwidth has become a big bottleneck for restricting the improvement of departure service efficiency. In airport departure services, departure network private lines are often limited to lower bandwidths, typically between 2Mbps and 10 Mbps. The bandwidth limitation forms obvious obstruction to the traditional file transportation mode, not only increases the risk of data transmission, but also buries potential safety hazard, and seriously interferes with normal departure business handling. Conventional file transfer methods typically rely on hardware speed limiting devices that require manual configuration and lack flexibility to cope with changes in network requirements, adding significant effort to the operation and maintenance team.
In the current high-speed development of civil aviation industry, efficient and rapid transmission of data becomes a core element for ensuring smooth operation. The massive data files, including flight information, passenger registration, security check, etc., all need to be transferred seamlessly between airports. The urgency of the requirement highlights the importance of network bandwidth, and the network bandwidth is not only the information pulse for connecting each aviation hub, but also the key point for improving the service quality and guaranteeing the flight safety.
The civil aviation application scenario is only an example of an application scenario under the condition of limited network bandwidth, and is not exhaustive for application scenarios under other conditions of limited network bandwidth.
Therefore, how to increase the speed of file transmission under the condition of limited network bandwidth is a technical problem to be solved.
Disclosure of Invention
Based on this, it is necessary to provide a file transfer method, apparatus, storage medium and device for network bandwidth, aiming at the defect that the file transfer speed is slow under the condition that the network bandwidth is limited.
In a first aspect, an embodiment of the present invention provides a method for transmitting a file for a network bandwidth, where the method includes:
Compressing a source file to be transmitted in a target compression mode to obtain a compressed file;
After the compressed file is used as a file to be transmitted, dividing a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size;
determining whether a first token greater than or equal to a first preset threshold exists in the token bucket;
and transmitting the sub-data block to be transmitted to a corresponding destination terminal under the condition that the first token greater than or equal to the first preset threshold value exists in the token bucket and any one of the plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token.
Optionally, the method further comprises:
waiting and generating second tokens to store all second tokens in the token bucket in response to tokens in the token bucket having been exhausted;
Determining whether the second token greater than or equal to a second preset threshold exists in the token bucket;
and applying for and acquiring a corresponding second token from any one of the plurality of sub-data blocks to be transmitted, which are larger than or equal to the second preset threshold, in the token bucket, and transmitting the sub-data block to be transmitted to a corresponding destination.
Optionally, the method further comprises:
monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
And dynamically determining the transmission rate of any one of the plurality of sub-data blocks to be transmitted according to the limit condition of the current network and the use condition of the current network bandwidth.
Optionally, the compressing the source file to be transmitted by using the target compression mode to obtain a compressed file includes:
Acquiring a target suffix matched with the target compression mode;
and compressing the source file to be transmitted in the target compression mode to obtain the compressed file with the target suffix.
Optionally, the method further comprises:
And creating an internal buffer area to store the compressed file through the internal buffer area.
In a second aspect, an embodiment of the present invention provides a file transmission apparatus for network bandwidth, where the apparatus includes:
The compression module is used for compressing the source file to be transmitted in a target compression mode to obtain a compressed file;
the segmentation module is used for segmenting a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size after the compressed file is used as the file to be transmitted;
A determining module, configured to determine whether a token bucket has a first token that is greater than or equal to a first preset threshold;
And the transmission module is used for transmitting the sub-data blocks to be transmitted to the corresponding destination end under the condition that the first token larger than or equal to the first preset threshold value exists in the token bucket and any one of the plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token.
Optionally, the apparatus further comprises:
A token generation module for waiting and generating second tokens to store all second tokens in the token bucket in response to the tokens in the token bucket having been exhausted;
The determining module is further configured to determine whether the second token is greater than or equal to a second preset threshold in the token bucket;
the transmission module is further configured to apply for and acquire a corresponding second token from any one of the plurality of sub-data blocks to be transmitted when the second token greater than or equal to the second preset threshold is determined to exist in the token bucket, and transmit the sub-data block to be transmitted to a corresponding destination.
Optionally, the apparatus further comprises:
the monitoring module is used for monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
and the transmission rate determining module is used for dynamically determining the transmission rate of each sub-data block to be transmitted in the plurality of sub-data blocks to be transmitted according to the limit condition of the current network and the use condition of the current network bandwidth.
In a third aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program for performing the above-described method steps.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
A processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method steps described above.
In the embodiment of the invention, a source file to be transmitted is compressed in a target compression mode to obtain a compressed file, after the compressed file is used as the file to be transmitted, a data block corresponding to the file to be transmitted is segmented into a plurality of sub-data blocks to be transmitted according to a preset size, whether a first token larger than or equal to a first preset threshold value exists in a token bucket or not is determined, and under the condition that a first token larger than or equal to the first preset threshold value exists in the token bucket and any sub-data block to be transmitted in the plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token, the sub-data block to be transmitted is transmitted to a corresponding destination terminal. According to the file transmission method for the network bandwidth, only when a token bucket has enough first tokens and any one sub-data block to be transmitted applies for and acquires one token in the token bucket, the sub-data block to be transmitted is transmitted to the corresponding destination end, so that the network congestion phenomenon possibly occurring is avoided, and the quick, stable and controllable file transmission process is realized.
Drawings
Exemplary embodiments of the present invention may be more fully understood by reference to the following drawings. The accompanying drawings are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, and not constitute a limitation to the invention. In the drawings, like reference numerals generally refer to like parts or steps.
Fig. 1 is a flowchart of a file transfer method for network bandwidth according to an exemplary embodiment of the present invention;
FIG. 2 is a schematic diagram of a file transfer method for network bandwidth in a specific application scenario;
fig. 3 is a schematic structural diagram of a file transfer device 300 for network bandwidth according to an exemplary embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs.
In addition, the terms "first" and "second" etc. are used to distinguish different objects and are not used to describe a particular order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or elements but may, in the alternative, include other steps or elements not expressly listed or inherent to such process, method, article, or device.
The embodiment of the invention provides a file transmission method and device for network bandwidth, electronic equipment and a computer readable medium, and the method and the device are described below with reference to the accompanying drawings.
Example 1
Referring to fig. 1, which is a flowchart illustrating a method for transmitting a file for network bandwidth according to some embodiments of the present invention, as shown in fig. 1, the method for transmitting a file for network bandwidth may include the following steps:
and step S101, compressing the source file to be transmitted in a target compression mode to obtain a compressed file.
In an actual application scenario, the target compression mode may be a gzip compression mode using a gzip algorithm. The gzip compression scheme can significantly reduce the size of the transmission file to reduce the network bandwidth requirements. In the compression process, the source file to be transmitted is converted into a compressed file in gz format.
In addition, GZIP Output Stream classes in Java can be used for compressing files. An open-source compression library, such as Apache Commons Compress, is integrated in the file transfer system. The compression level is set to balance the compression efficiency and the compression ratio.
In addition to the compression method of the above example, other compression methods may be used to compress the source file to be transmitted, which is not specifically limited herein.
In an actual application scene, the size of a transmission file can be obviously reduced by the compression mode, and the requirement on network bandwidth is directly reduced. By adopting the compression mode, such as gzip compression, the file volume of the source file can be reduced to 30% -50% of the file volume of the source file on the premise of ensuring the data integrity, so that the transmission time and the bandwidth occupation are effectively reduced.
In one possible implementation manner, compressing a source file to be transmitted in a target compression manner to obtain a compressed file, including the following steps:
Acquiring a target suffix matched with a target compression mode;
and compressing the source file to be transmitted in a target compression mode to obtain a compressed file with a target suffix.
In a possible implementation manner, the file transmission method for network bandwidth provided by the embodiment of the invention may further include the following steps:
an internal buffer is created to store the compressed file through the internal buffer.
In an actual application scenario, the compressed file is read using the data stream before the internal buffer is created.
In an actual application scene, file Input Stream types in Java are used for reading the compressed file. The creation of the internal Buffer can be implemented using Byte Buffer classes in Java or custom buffers.
ByteBuffer can be used as a buffer area, because it is a continuous space in the memory, and four indexes, namely mark, position, limit, capability, are defined in the ByteBuffer object, and are described for the above four indexes respectively, as follows:
mark is used for marking the current position;
The position represents the pointer of current read-write, if a byte is written into ByteBuffer objects, the byte is written into the address pointed by the position, if a byte is read out from ByteBuffer, the byte is read out from the address pointed by the position, and after the read-write is completed, the position is added with 1;
limit is a readable/writable boundary, and when positio reaches limit, it indicates that the content in ByteBuffer is completely read or ByteBuffer is full;
The capability is ByteBuffe bytes, and if a ByteBuffer.Allocate (128) is called in the program, it means that a ByteBuffer object with 128 bytes of capability is created.
Step S102, after taking the compressed file as a file to be transmitted, dividing a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size.
In the file transmission method provided in the embodiment of the present invention, the preset size in step S102 is not specifically limited, and may be configured according to the requirements of different application scenarios, which is not described herein.
In a specific application scenario, the preset size can be configured to be 1KB, and the data block corresponding to the file to be transmitted is divided into a plurality of sub-data blocks to be transmitted with the size of 1KB, so that network congestion is prevented by limiting the transmission rate of data, and the stability and the high efficiency of network communication are maintained.
Step S103, determining whether a first token greater than or equal to a first preset threshold exists in the token bucket.
It should be noted that the application scenario for this step is an application scenario in which there are enough tokens in the token bucket. The first preset threshold is not specifically limited, and may be adjusted according to requirements of different application scenarios, which is not described herein.
Step S104, under the condition that the token bucket has a first token which is larger than or equal to a first preset threshold value and any one of a plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token, the sub-data block to be transmitted is transmitted to the corresponding destination terminal.
It should be noted that the application scenario for this step is that there are enough first tokens in the token bucket, and any one of the plurality of sub-data blocks to be transmitted applies for and obtains the application scenario of the corresponding first token.
In order to avoid the problem of data congestion possibly occurring in the file transmission process, the file transmission method provided by the embodiment of the invention mainly has the following two application scenarios, and the specific steps are as follows:
the first case is that there are enough tokens in the token bucket:
and in response to the fact that enough first tokens (the first tokens larger than or equal to a first preset threshold value) exist in the token bucket, any one of the plurality of sub-data blocks to be transmitted applies for and acquires one first token in the token bucket, and the sub-data block to be transmitted is transmitted to the corresponding destination terminal.
In the second case, there are not enough tokens in the token bucket:
waiting to generate new tokens, namely second tokens, until the second tokens are generated, so as to store all the second tokens into the token bucket;
and determining that enough second tokens (second tokens larger than or equal to a second preset threshold) exist in the token bucket, and any one of a plurality of sub-data blocks to be transmitted applies for and acquires one second token in the token bucket, and transmitting the sub-data block to be transmitted to a corresponding destination terminal.
As above, the first token is directed to an application scenario in which there are enough tokens in the token bucket, while the second token is directed to an application scenario in which there are not enough tokens in the token bucket, generating a new token until the newly generated token, i.e., the second token.
It should be noted that the application scenario for this step is an application scenario in which there are enough newly generated second tokens in the token bucket. The second preset threshold is not specifically limited, and may be adjusted according to requirements of different application scenarios, which is not described herein.
In an actual application scene, the initialization process of the token bucket comprises the steps of setting the initial token number and the token generation rate. The initial number of tokens represents the number of tokens initially present in the token bucket and the token generation rate represents the number of tokens generated by the token generator per second.
The token generator dynamically adjusts the number of tokens generated per second according to the dynamic transmission rate control module.
In the file transmission method provided by the embodiment of the invention, the number of tokens generated by the token generator per second is not particularly limited, and the number of tokens generated per second can be determined by adopting the following strategy, and the method is as follows:
in the first case, if the current bandwidth of the current network is relatively abundant, the token generator increases the number of tokens generated per second to increase the transmission rate.
In the second case, the token generator may reduce the number of tokens generated per second to reduce the transmission rate if the current bandwidth of the current network is tight.
The token generator dynamically adjusts the number of tokens generated per second according to the dynamic transmission rate control module, thus flexibly adjusting the transmission speed under different network bandwidth conditions, improving the transmission efficiency to the greatest extent, reducing network congestion and ensuring the stability of the transmission process.
In a possible implementation manner, the file transmission method provided by the embodiment of the invention further includes the following steps:
monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
And dynamically determining the transmission rate of each sub-data block to be transmitted in the plurality of sub-data blocks to be transmitted according to the limit condition of the current network and the use condition of the current network bandwidth.
In an actual application scenario, the process of dynamically determining the transmission rate of each of the plurality of sub-data blocks to be transmitted by the dynamic transmission rate control module is specifically as follows:
and inquiring the network bandwidth condition of the current departure private line through an SNMP protocol. The number of input bytes and the number of output bytes of the network device can be obtained through the query action executed by the SNMP protocol, so that the current bandwidth utilization rate is calculated. And calculating the current bandwidth duty ratio according to the query result. If the current bandwidth usage of the current network does not reach 50%, a part of the remaining bandwidth is allocated to each sub-data block to be transmitted for file transmission, and if the current bandwidth usage of the current network has reached 50% and above, the current transmission rate is limited to 1% of the total bandwidth. The method for dynamically adjusting the transmission rate can furthest improve the file transmission rate when the network bandwidth utilization rate is low, and ensure the normal operation of other key services when the network bandwidth utilization rate is high. And then, every 30 seconds, updating the file transmission rate according to the new bandwidth duty ratio calculation result. Therefore, the file transmission method provided by the embodiment of the invention can dynamically optimize the transmission process according to the change of the actual network environment, and ensure the high efficiency and stability of file transmission.
Since the SNMP protocol is a conventional protocol, the details are not repeated here.
It should be noted that, the foregoing dynamic transmission rate control module may determine other key transmission parameters besides being capable of determining a transmission rate of any one of the plurality of sub-data blocks to be transmitted, where the other key transmission parameters may include an upper limit value of the transmission rate and an initial value of the transmission rate.
Fig. 2 is a schematic diagram of a file transmission method for network bandwidth in a specific application scenario.
As shown in fig. 2, the file transfer process is specifically as follows:
The method comprises the steps of obtaining a compressed file after a source file is compressed, taking the compressed file as a file to be transmitted, dividing a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size, and if not, waiting for generating a new token (a second token) until the new token is generated, storing all the new tokens into a token bucket, determining that the new token in the token bucket can be transmitted only after the corresponding token is applied for and acquired, judging whether the token in the token bucket is enough, applying for and acquiring one token in the token bucket by any one of the sub-data blocks to be transmitted, and transmitting the sub-data block to the corresponding destination end, otherwise, waiting for generating the new token (the second token) until the new token is generated, storing all the new tokens into the token bucket, and determining that the new token in the token bucket is enough, repeating the steps, and applying for and acquiring any one of the sub-data blocks to be transmitted to the corresponding sub-data block to be transmitted to the corresponding destination end.
In addition, in the file transmission process shown in fig. 2, the process of dynamically determining the transmission rate of any one of the plurality of sub-data blocks to be transmitted by the dynamic transmission rate control module also uses the network bandwidth ratio threshold value, which is the network bandwidth ratio of 50%, and the description of this portion is referred to the description of the same or similar portions, and will not be repeated here.
It should be noted that, the file transmission method provided by the embodiment of the invention can be applied to application scenarios with limited network bandwidth, especially application scenarios with limited airport network bandwidth, but is not limited to airport network application scenarios, and other specific application scenarios are not listed one by one.
According to the file transmission method for the network bandwidth, only when a token bucket has enough first tokens and any one sub-data block to be transmitted applies for and acquires one token in the token bucket, the sub-data block to be transmitted is transmitted to the corresponding destination end, so that the network congestion phenomenon possibly occurring is avoided, and the quick, stable and controllable file transmission process is realized.
In addition, the file transmission method provided by the embodiment of the invention has the following advantages, and the specific steps are as follows:
The method has the advantages of self-adapting network bandwidth, having the capability of dynamically adjusting the transmission rate and being capable of adapting to continuously changing network conditions better.
The method has the advantage of effectively utilizing the network bandwidth, and can automatically improve the transmission rate when the network bandwidth is available so as to complete file transmission more quickly, thereby improving the transmission efficiency. Under high load conditions, the transmission rate can be reduced to avoid network congestion and ensure that other critical traffic is not affected.
The method has the advantages of optimizing network flow management, combining file compression and current limiting methods, not only reducing the transmission time required by transmitting the compressed file, but also reasonably distributing network resources and preventing excessive consumption of bandwidth so as to keep the network smooth and free from jamming.
The method has the advantage of 4 that the transmission reliability is enhanced, namely, the stability performance can be kept under various network environments by continuously monitoring the network condition and adjusting the strategy of the transmission speed, so that the risk of transmission interruption is reduced, and the reliability of network transmission is enhanced.
In the above embodiment, a file transmission method for network bandwidth is provided, and correspondingly, the invention also provides a file transmission device for network bandwidth. The file transmission device for network bandwidth provided by the embodiment of the invention can implement the file transmission method for network bandwidth, and the file transmission device for network bandwidth can be realized by software, hardware or a combination of software and hardware. For example, the file transfer means for network bandwidth may comprise integrated or separate functional modules or units to perform the corresponding steps in the methods described above.
Example 2
Referring to fig. 3, a schematic diagram of a file transfer device for network bandwidth according to some embodiments of the present invention is shown. Since the apparatus embodiments are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
As shown in fig. 3, the file transfer device 300 for network bandwidth may include:
the compression module 301 is configured to compress a source file to be transmitted in a target compression manner to obtain a compressed file;
the splitting module 302 is configured to split, after taking the compressed file as a file to be transmitted, a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size;
a determining module 303, configured to determine whether there is a first token greater than or equal to a first preset threshold in the token bucket;
The transmission module 304 is configured to, when it is determined that there is a first token greater than or equal to a first preset threshold in the token bucket and any one of the plurality of sub-data blocks to be transmitted applies for and obtains a corresponding first token, transmit the sub-data block to be transmitted to a corresponding destination.
In some implementations of the embodiments of the present invention, the file transmission apparatus 300 for network bandwidth provided by the embodiments of the present invention may further include:
A token generation module (not shown in fig. 3) for waiting and generating second tokens to store all second tokens in the token bucket in response to tokens in the token bucket having been exhausted;
the determining module 303 is further configured to determine whether there are second tokens in the token bucket that are greater than or equal to a second preset threshold;
The transmission module 304 is further configured to apply for and obtain a corresponding second token from any one of the plurality of sub-data blocks to be transmitted when it is determined that the token bucket has a second token greater than or equal to a second preset threshold, and transmit the sub-data block to be transmitted to a corresponding destination.
In some implementations of the embodiments of the present invention, the file transmission apparatus 300 for network bandwidth provided by the embodiments of the present invention may further include:
A monitoring module (not shown in fig. 3) for monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
A transmission rate determining module (not shown in fig. 3) for dynamically determining a transmission rate of each of the plurality of sub-data blocks to be transmitted according to a limit condition of the current network and a use condition of the current network bandwidth.
In some implementations of the embodiments of the present invention, the compression module 301 is specifically configured to:
Acquiring a target suffix matched with a target compression mode;
and compressing the source file to be transmitted in a target compression mode to obtain a compressed file with a target suffix.
In some implementations of the embodiments of the present invention, the file transmission apparatus 300 for network bandwidth provided by the embodiments of the present invention may further include:
A creation module (not shown in fig. 3) for creating an internal buffer to store the compressed file through the internal buffer.
In some implementations of the embodiment of the present invention, the file transmission device 300 for network bandwidth provided by the embodiment of the present invention has the same beneficial effects as the file transmission method for network bandwidth provided by the foregoing embodiment of the present invention due to the same inventive concept.
Example 3
An embodiment of the present invention provides a computer device, including a memory and a processor, where the processor is configured to read an instruction stored in the memory, where the instruction may perform a file transfer method for network bandwidth in any of the foregoing method embodiments.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Example 4
The present embodiment provides a computer-readable storage medium storing computer-executable instructions that can perform a file transfer method for network bandwidth in any of the above-described method embodiments. The storage medium may be a magnetic disk, an optical disc, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a hard disk (HARD DISK DRIVE, abbreviated as HDD), a Solid state disk (Solid STATE DRIVE, SSD), or the like, and the storage medium may further include a combination of the above types of memories.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. While still being apparent from variations or modifications that may be made by those skilled in the art are within the scope of the invention.

Claims (10)

1.A method for file transfer for network bandwidth, the method comprising:
Compressing a source file to be transmitted in a target compression mode to obtain a compressed file;
After the compressed file is used as a file to be transmitted, dividing a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size;
determining whether a first token greater than or equal to a first preset threshold exists in the token bucket;
and transmitting the sub-data block to be transmitted to a corresponding destination terminal under the condition that the first token greater than or equal to the first preset threshold value exists in the token bucket and any one of the plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token.
2. The file transfer method according to claim 1, characterized in that the method further comprises:
waiting and generating second tokens to store all second tokens in the token bucket in response to tokens in the token bucket having been exhausted;
Determining whether the second token greater than or equal to a second preset threshold exists in the token bucket;
and applying for and acquiring a corresponding second token from any one of the plurality of sub-data blocks to be transmitted, which are larger than or equal to the second preset threshold, in the token bucket, and transmitting the sub-data block to be transmitted to a corresponding destination.
3. The file transfer method according to claim 1 or 2, characterized in that the method further comprises:
monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
And dynamically determining the transmission rate of each sub-data block to be transmitted in the plurality of sub-data blocks to be transmitted according to the limit condition of the current network and the use condition of the current network bandwidth.
4. The method for transmitting files according to claim 1, wherein the compressing the source file to be transmitted by the target compression method to obtain a compressed file includes:
Acquiring a target suffix matched with the target compression mode;
and compressing the source file to be transmitted in the target compression mode to obtain the compressed file with the target suffix.
5. The file transfer method according to claim 1, characterized in that the method further comprises:
And creating an internal buffer area to store the compressed file through the internal buffer area.
6. A file transfer device for use in a network bandwidth, the device comprising:
The compression module is used for compressing the source file to be transmitted in a target compression mode to obtain a compressed file;
the segmentation module is used for segmenting a data block corresponding to the file to be transmitted into a plurality of sub-data blocks to be transmitted according to a preset size after the compressed file is used as the file to be transmitted;
A determining module, configured to determine whether a token bucket has a first token that is greater than or equal to a first preset threshold;
And the transmission module is used for transmitting the sub-data blocks to be transmitted to the corresponding destination end under the condition that the first token larger than or equal to the first preset threshold value exists in the token bucket and any one of the plurality of sub-data blocks to be transmitted applies for and acquires the corresponding first token.
7. The file transfer device of claim 6, wherein said device further comprises:
A token generation module for waiting and generating second tokens to store all second tokens in the token bucket in response to the tokens in the token bucket having been exhausted;
The determining module is further configured to determine whether the second token is greater than or equal to a second preset threshold in the token bucket;
the transmission module is further configured to apply for and acquire a corresponding second token from any one of the plurality of sub-data blocks to be transmitted when the second token greater than or equal to the second preset threshold is determined to exist in the token bucket, and transmit the sub-data block to be transmitted to a corresponding destination.
8. The file transfer device of claim 6 or 7, wherein the device further comprises:
the monitoring module is used for monitoring the limit condition of the current network and the use condition of the current network bandwidth in real time;
and the transmission rate determining module is used for dynamically determining the transmission rate of each sub-data block to be transmitted in the plurality of sub-data blocks to be transmitted according to the limit condition of the current network and the use condition of the current network bandwidth.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the file transfer method according to any one of the preceding claims 1 to 5.
10. An electronic device, the electronic device comprising:
A processor;
A memory for storing executable instructions of the processor;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the file transfer method of any of the preceding claims 1 to 5.
CN202411650525.XA 2024-11-18 2024-11-18 File transmission method, device, storage medium and equipment for network bandwidth Pending CN119520505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411650525.XA CN119520505A (en) 2024-11-18 2024-11-18 File transmission method, device, storage medium and equipment for network bandwidth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411650525.XA CN119520505A (en) 2024-11-18 2024-11-18 File transmission method, device, storage medium and equipment for network bandwidth

Publications (1)

Publication Number Publication Date
CN119520505A true CN119520505A (en) 2025-02-25

Family

ID=94657137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411650525.XA Pending CN119520505A (en) 2024-11-18 2024-11-18 File transmission method, device, storage medium and equipment for network bandwidth

Country Status (1)

Country Link
CN (1) CN119520505A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200053590A1 (en) * 2017-04-20 2020-02-13 Huawei Technologies Co., Ltd. Data transmission method and apparatus
CN111669364A (en) * 2020-04-26 2020-09-15 视联动力信息技术股份有限公司 A method, device, electronic device and medium for data transmission
CN111884946A (en) * 2020-08-06 2020-11-03 深圳市物语智联科技有限公司 Data distribution transmission method and device in multiple wireless access systems, computer equipment and storage medium
CN113938435A (en) * 2021-08-30 2022-01-14 奇安信科技集团股份有限公司 Data transmission method, apparatus, electronic device, storage medium and program product
CN116016357A (en) * 2022-12-09 2023-04-25 中国电信股份有限公司 Data transmission method, device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200053590A1 (en) * 2017-04-20 2020-02-13 Huawei Technologies Co., Ltd. Data transmission method and apparatus
CN111669364A (en) * 2020-04-26 2020-09-15 视联动力信息技术股份有限公司 A method, device, electronic device and medium for data transmission
CN111884946A (en) * 2020-08-06 2020-11-03 深圳市物语智联科技有限公司 Data distribution transmission method and device in multiple wireless access systems, computer equipment and storage medium
CN113938435A (en) * 2021-08-30 2022-01-14 奇安信科技集团股份有限公司 Data transmission method, apparatus, electronic device, storage medium and program product
CN116016357A (en) * 2022-12-09 2023-04-25 中国电信股份有限公司 Data transmission method, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN111522636B (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
US10069946B2 (en) Hardware-based packet editor
US20200133533A1 (en) Methods, devices, and computer program products for processing data
RU2651219C2 (en) Computer, control device and data processing method
JP6251205B2 (en) MONITORING DEVICE, MONITORING METHOD, AND MONITORING PROGRAM
CN110389905B (en) Resource release method, resource allocation method, device and computer program product
CN103353850B (en) Virtual machine thermal migration memory processing method, device and system
CN112650575B (en) Resource scheduling method, device and cloud service system
CN112822724B (en) Message forwarding method and device
CN106161524A (en) A kind of resource downloading method based on distributed resource node and device
WO2021114025A1 (en) Incremental data determination method, incremental data determination apparatus, server and terminal device
CN112868265A (en) Network resource management method, management device, electronic device and storage medium
US11647103B1 (en) Compression-as-a-service for data transmissions
JP7075077B2 (en) Backup server, backup method, program, storage system
CN113453285A (en) Resource adjusting method, device and storage medium
CN119520505A (en) File transmission method, device, storage medium and equipment for network bandwidth
CN115460215A (en) Edge gateway extension method, system, device, equipment and medium
US11632319B2 (en) Processing device and moving method
CN114706526A (en) Automatic capacity expansion method, system and equipment for cloud native storage data volume
US11099965B2 (en) Management system, test method and recording medium
US10673801B2 (en) Dynamic communication session management
CN119316433A (en) Data stream fragmentation dynamic transmission method, device, storage medium and electronic device
CN119025261A (en) A method, device and related equipment for determining computing resources
CN115664826A (en) Data file encryption method and device, computing equipment and storage medium
CN116980289A (en) Vehicle upgrading method and device, electronic equipment, vehicle and storage medium

Legal Events

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