Scene-adaptive file transmission method and device, equipment and storage medium

Through the file transfer method of adaptive scenarios, small files are filtered and batched, and the transmission strategy is dynamically adjusted according to network status and file type, solving the problem of inefficient large-scale file transfer and achieving faster and more stable file transfer.

CN119788659APending Publication Date: 2025-04-08CHINA TELECOM CLOUD TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411755642.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing massive file transfer technology is inefficient and fails to effectively consider factors such as file size, network status and file type, resulting in long transmission time and low efficiency.

Method used

By obtaining the file attributes of the file to be transferred, filter out the first type of transmission files with a file size smaller than the set value, and divide it into several batch transmissions, and confirm character responses after a single batch transmission. In addition, the number of files transferred in batches is dynamically adjusted according to the network status, and whether to perform compressed transmission is determined based on the file type.

Benefits of technology

It reduces the number of confirmation character responses, shortens the total time-consuming file transfer, improves transmission efficiency and stability, and effectively utilizes host resources and network bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788659A_ABST
    Figure CN119788659A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of file transmission, and discloses a scene-adaptive file transmission method and device, equipment and a storage medium, the method comprises the following steps: obtaining file attributes of a to-be-transmitted file, the file attributes comprising a file size; screening out a first type of transmission files with the file size smaller than a set value according to the file attributes; and dividing the set of the first type of transmission files into a plurality of times of batch transmission, and performing acknowledgement character response after single batch transmission. According to the method, the process of confirming character response for many times can be reduced for massive small files, and the total time consumption of file transmission is greatly shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of file transmission, and in particular to a scene-adaptive file transmission method, device, equipment and storage medium. Background Art

[0002] Massive file transfer refers to the transfer of large amounts of files at the TB level or even TB level. Massive files have always been criticized for their large data volume (usually up to TB / PB level) and long transfer time.

[0003] At present, the relevant technologies for mass file transmission usually transmit through packaging, parallelization and other methods, and the effects vary greatly in different environments. Because they do not take into account the specific situation of the files to be transmitted and the transmission conditions, lack consideration of scenarios such as multiple complex file types and external network status factors, the effects in actual production environments are often unsatisfactory.

[0004] For massive small files in massive file transfer, the bottleneck is low CPU or bandwidth utilization and long transmission time. The current common optimization solution is to achieve faster transmission through concurrency. When a file transfer is completed, an acknowledgement character (ack) is responded. When the number of files is large, many ack responses are required, resulting in long transmission time and low transmission efficiency. Summary of the invention

[0005] In view of this, the present invention provides a scenario-adaptive file transmission method, device, equipment and storage medium to solve the technical problem of low efficiency in existing mass file transmission.

[0006] In a first aspect, the present invention provides a file transfer method for an adaptive scenario, comprising: obtaining file attributes of a file to be transferred, the file attributes including a file size; screening out a first category of transfer files whose file size is less than a set value according to the file attributes; dividing a collection of the first category of transfer files into several batch transmissions, and performing a confirmation character response after a single batch transmission.

[0007] The present invention provides an adaptive scenario file transmission method, which obtains the file attributes of the files to be transmitted, screens out the first category of transmission files whose file sizes are smaller than a set value according to the file attributes, divides the collection of the first category of transmission files into several batch transmissions, and performs a confirmation character response after a single batch transmission. After successfully transmitting several first category transmission files with smaller file sizes in batches at one time, a confirmation character response is performed again. For a large number of small files, the process of confirming character responses can be reduced for many times, thereby greatly shortening the total time consumed for file transmission.

[0008] Optionally, before dividing the set of the first category transmission files into several batch transmissions and performing a confirmation character response after a single batch transmission, it also includes: obtaining the network status of the transmission device; and confirming the number of the first category transmission files in a single batch transmission based on the network status.

[0009] In this way, the number of files transferred in a single batch is dynamically adjusted according to the network status, which can better adapt to network fluctuations and improve the stability and efficiency of transmission.

[0010] Optionally, the network status includes network delay, and confirming the number of the first category transmission files for a single batch transmission based on the network status includes: if the network delay is greater than the set initial delay, reducing the number of the first category transmission files for a single batch transmission; if the network delay is less than the set initial delay, increasing the number of the first category transmission files for a single batch transmission.

[0011] By dynamically adjusting the transmission quantity to adapt to changes in network delay, transmission interruption or data loss caused by network delay can be reduced and transmission reliability can be improved.

[0012] Optionally, after obtaining the file attributes of the file to be transmitted, it also includes: filtering out second-category transmission files whose file size is greater than or equal to a set value according to the file attributes; judging whether the host resource status of the transmission device is sufficient; if the host resource status is sufficient, dividing the second-category transmission file into blocks according to the set block size to obtain a number of file blocks, and transmitting the several file blocks in parallel; if the host resource status is insufficient, directly transmitting the second-category transmission file.

[0013] By judging the host resource status and selecting block processing or direct transmission, the host resources can be used more effectively and the transmission efficiency of the second type of transmission files with larger file sizes can be improved.

[0014] Optionally, before the second-type transmission file is divided into blocks according to the set block size to obtain a plurality of file blocks, the method includes: obtaining a network status of a transmission device; and determining a block size according to the network status.

[0015] Determining the block size according to the network status can better adapt to changes in network bandwidth and optimize transmission efficiency.

[0016] Optionally, the network status includes network bandwidth, and determining the block size based on the network status includes: judging whether the network bandwidth is less than a first bandwidth setting value; if the network bandwidth is less than the first bandwidth setting value, setting the block size to a first preset size; if the network bandwidth is greater than the first bandwidth setting value, setting the block size to increase proportionally with the network bandwidth, and the block size is not greater than a second preset size.

[0017] By setting different block sizes to adapt to different network bandwidths, you can reduce the transmission bottleneck caused by network bandwidth limitations and increase the transmission speed of large files.

[0018] Optionally, the file attributes also include a file type. Before transmitting several of the file blocks in parallel or directly transmitting the second-type transmission file, the following steps are performed: confirming whether the second-type transmission file is a default uncompressed file based on the file type; if the second-type transmission file is a default uncompressed file, compressing the file block or the second-type transmission file.

[0019] Since compression itself consumes resources, when the compressibility ratio of a file is very low, compressed transmission will be counterproductive and prolong the transmission time. Therefore, different transmission methods need to be adopted according to the file type to effectively shorten the transmission time. The default uncompressed file is a file with a relatively high compressibility ratio. Only the default uncompressed file can avoid unnecessary compression and improve the transmission time.

[0020] In a second aspect, the present invention provides a file transfer device for an adaptive scenario, comprising: an attribute acquisition module, used to obtain file attributes of a file to be transferred, the file attributes including the file size; a file type screening module, used to screen out a first category of transfer files whose file size is less than a set value according to the file attributes; a batch transfer module, used to divide the set of the first category of transfer files into several batch transfers, and perform a confirmation character response after a single batch transfer.

[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the adaptive scenario file transfer method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the scene-adaptive file transfer method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] 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.

[0024] Figure 1 It is a flowchart of a scene-adaptive file transmission method according to an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of a batch transmission process according to an embodiment of the present invention;

[0026] Figure 3 It is a schematic diagram of the process of block transmission according to an embodiment of the present invention;

[0027] Figure 4 is a flowchart of another adaptive scenario file transmission method according to an embodiment of the present invention;

[0028] Figure 5 is a structural block diagram of a scene-adaptive file transmission device according to an embodiment of the present invention;

[0029] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0031] At present, the related technologies for mass file transmission usually transmit through packaging, parallelization and other methods, and the effects vary greatly in different environments. Because it does not take into account the specific situation of the files to be transmitted and the transmission conditions, lacks consideration of scenarios such as multiple complex file types and external network status factors, the effect in the actual production environment is often unsatisfactory. Based on this, an embodiment of the present invention provides a scene-adaptive file transmission method, which can automatically identify the transmission scene, adopt different transmission strategies for different scenes and network conditions, and effectively shorten the transmission time.

[0032] According to an embodiment of the present invention, an embodiment of a file transfer method for an adaptive scenario is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] In this embodiment, a scenario-adaptive file transmission method is provided, which can be used in mobile terminals, such as mobile phones, tablet computers, etc. Figure 1 As shown, the process includes the following steps:

[0034] Step S101, obtaining file attributes of a file to be transmitted, wherein the file attributes include the file size.

[0035] Specifically, when a large number of files need to be transferred, the file path of the file to be transferred is obtained, the entire directory structure indicated by the file path is scanned, and all files and their related attributes, such as file size, file type, etc., are obtained.

[0036] Step S102: Filter out the first type of transfer files whose file sizes are smaller than a set value according to the file attributes.

[0037] Specifically, the file size of each file to be transmitted is compared with a set value, and when the file size is smaller than the set value, it is classified as a small file, that is, a first-class transmission file. The set value can be set according to the transmission requirements, for example, 1KB, 5KB, 10KB, etc.

[0038] Step S103, dividing the set of first-category transmission files into several batch transmissions, and performing a confirmation character response after a single batch transmission.

[0039] like Figure 2 As shown, the number of files in each batch is set to k, and k can be set according to the specific scenario, for example, 500, 1000, etc. After the batch transmission successfully transmits k small files at one time, an acknowledgement character (ACK) response is performed. If the transmission fails, all k files are retransmitted.

[0040] An adaptive scenario file transmission method according to an embodiment of the present invention obtains file attributes of files to be transmitted, selects first-category transmission files whose file sizes are smaller than set values ​​according to the file attributes, divides the set of first-category transmission files into several batch transmissions, and performs a confirmation character response after a single batch transmission. After successfully transmitting several first-category transmission files with smaller file sizes in one batch at a time, a confirmation character response is performed again. For massive small files, the process of confirming character responses can be reduced many times, thereby greatly shortening the total time consumed for file transmission.

[0041] In some embodiments, in step S103, the set of first-category transmission files is divided into several batch transmissions, and before a confirmation character response is sent after a single batch transmission, the method further includes:

[0042] Step a1, obtaining the network status of the transmission device.

[0043] Step a2: confirming the number of first-category transmission files in a single batch transmission according to the network status.

[0044] Specifically, the network status includes network delay. Step a2, confirming the number of first-category transmission files of a single batch transmission according to the network status, includes:

[0045] Step a21: if the network delay is greater than the set initial delay, the number of the first type of transmission files in a single batch transmission is reduced.

[0046] Step a22: if the network delay is less than the set initial delay, the number of the first type of transmission files in a single batch transmission is increased.

[0047] During transmission, the size of the batch transmission file number K is adjusted according to the network delay.

[0048] When the network delay is large, that is, greater than the initial delay, the K value should be appropriately reduced to avoid excessive overhead in the number of retransmitted files.

[0049] When the network delay is small, that is, smaller than the initial delay, increase the K value appropriately to ensure that the number of acks is minimized.

[0050] In one example, the network delay can be divided into different areas, and the network delay in each area corresponds to a different K value. As shown in Table 1, when the network delay is between 0ms and 9ms, K is adjusted to 4000, when the network delay is between 10ms and 100ms, K is adjusted to 1000, and when the network delay is greater than 100ms, K is adjusted to 200.

[0051] Table 1 Correspondence between network delay and K value

[0052]

[0053]

[0054] In this way, the number of batch transmissions is dynamically adjusted through network delay, which can reduce transmission interruption or data loss caused by network delay and improve transmission reliability.

[0055] In some embodiments, after obtaining the file attributes of the file to be transmitted in step S101, the following steps are further included:

[0056] Step b1, filtering out the second type of transmission files whose file sizes are greater than or equal to a set value according to the file attributes.

[0057] Specifically, the file size of each file to be transmitted is compared with the set value. When the file size is greater than or equal to the set value, it is classified as a large file, that is, the second type of transmission file. The set value can be set according to the transmission requirements, for example, 1KB, 5KB, 10KB, etc.

[0058] In one example, after filtering out the first category of transmission files as in step S102 , the files other than the first category of transmission files are classified as the second category of transmission files.

[0059] Step b2, determining whether the host resource status of the transmission device is sufficient.

[0060] Specifically, determine whether the host CPU occupancy is less than 80% and it is a multi-core processor. When the host CPU occupancy is less than 80% and it is a multi-core processor, it means that the host resources are sufficient. If the host CPU occupancy is greater than or equal to 80% or it is a single-core processor, it means that the host resource status is insufficient.

[0061] Step b3: if the host resource status is sufficient, the second type of transmission file is divided into blocks according to the set block size to obtain a plurality of file blocks, and the plurality of file blocks are transmitted in parallel.

[0062] Specifically, the block size is set to a preset value, which can be adjusted according to the network status.

[0063] like Figure 3 As shown, the original second-category transmission file is first divided into blocks with a set block size to obtain multiple file blocks, and then the multiple file blocks are transmitted in parallel. After the transmission is completed, the file blocks are reassembled to obtain a complete second-category transmission file.

[0064] Step b4: If the host resource status is insufficient, the second type of transmission files are directly transmitted.

[0065] The host resource status is insufficient. If parallel transmission is performed, it will increase the operating pressure, so direct transmission is performed at this time.

[0066] Currently, large file transfers can fully utilize the bandwidth when the network status is good, but there is still room for optimization. Large file transfers cannot fully utilize the bandwidth when the network status is poor. When the host resources are sufficient, the second type of transfer files can be divided into blocks and then transmitted in parallel to effectively improve bandwidth utilization and shorten transmission time.

[0067] In some embodiments, in step b3, before the second type of transmission file is divided into blocks according to the set block size to obtain a plurality of file blocks, the method includes:

[0068] Step c1, obtaining the network status of the transmission device.

[0069] Step c2, determine the block size according to the network status.

[0070] Specifically, the network status includes the network bandwidth. Step c2, determining the block size according to the network status, includes:

[0071] Step c21, determining whether the network bandwidth is less than the first bandwidth setting value.

[0072] Step c22: if the network bandwidth is less than the first bandwidth setting value, the block size is set to the first preset size.

[0073] Step c23: if the network bandwidth is greater than the first bandwidth setting value, the block size is set to increase in proportion to the network bandwidth, and the block size is not greater than the second preset size.

[0074] Specifically, the first preset size is a default block size, and the first preset size can be set to 1KB, 5KB, 10KB, etc.

[0075] The second preset size is larger than the first preset size. The second preset size is the maximum value of the block and can be set to 0.5MB, 1MB, etc.

[0076] The first bandwidth setting value needs to be preset, for example, it can be set to 4KB, 5KB, etc.

[0077] The file block size is customized according to the network bandwidth. When the network bandwidth is less than the first bandwidth setting value, the first preset size is used. When the network bandwidth is greater than 4MB, the block size increases proportionally, but does not exceed the second preset size.

[0078] By adjusting the block size of the chunks according to the network bandwidth, the transmission bottleneck caused by network bandwidth limitation can be reduced and the transmission speed of large files can be improved.

[0079] In some embodiments, the file attributes also include the file type, and the file type can be determined by the file suffix.

[0080] Before transferring several file blocks in parallel or directly transferring the second type of transfer files, including:

[0081] Step d1, confirming whether the second type of transmission file is a default uncompressed file according to the file type.

[0082] Step d2: If the second type of transmission file is a default uncompressed file, compress the file block or the second type of transmission file.

[0083] Specifically, large file transfers can basically utilize full bandwidth when the network status is good, and the transmission time can be shortened by using compressed transmission methods.

[0084] However, it is worth noting that compression itself consumes resources. When the compressibility ratio of a file is very low, compressed transmission will be counterproductive and increase the transmission time. As shown in Table 2, different types of files have different compression ratios. The ratio of compressed transmission time to original transmission time may be greater than 1 or less than 1.

[0085] Table 2 Correspondence between file type, compression ratio and transmission time

[0086]

[0087] Therefore, different transmission methods need to be adopted according to the file type to effectively shorten the transmission time. In this method, the default file types with low transmission compression such as 7z / zip / jar / gz are used as the set compressed files, and other files except compressed files are the default uncompressed files.

[0088] The compression ratio of the compressed file is set to be relatively low. If the compression is performed, the benefits are low. On the contrary, the compression process takes time, so such files are not compressed for transmission. By default, uncompressed files are transmitted after compression, which can shorten the transmission time.

[0089] Since compression itself consumes resources, when the compressibility ratio of a file is very low, compressed transmission will be counterproductive and prolong the transmission time. Therefore, it is necessary to decide whether to compress based on the file type, which can effectively shorten the transmission time. The default uncompressed file is a file with a relatively high compressibility ratio. Only compressing the default uncompressed file can avoid unnecessary compression and improve the transmission time.

[0090] like Figure 4 As shown, an implementation process of a scene-adaptive file transmission method according to an embodiment of the present invention is as follows:

[0091] 1. Determine the file path of the file to be transferred.

[0092] 2. Scan the entire directory structure and obtain all files and their file attributes, including file size, file type, etc.

[0093] 3. Get the network status, including network bandwidth and network delay, and determine the block size based on the network bandwidth. The default is 1KB, and the block size can be adjusted according to the network bandwidth. For example, if the current network bandwidth is 10MB, confirm that the block size is 2.5KB.

[0094] 4. Filter small files, i.e., the first type of transfer files, and perform batch transfer on the first type of transfer file set. At the same time, periodically obtain the current network delay to adjust the single batch number K. When the delay is 0ms-9ms, adjust K to 4000; when the delay is 10ms-100ms, adjust K to 1000; when the delay exceeds 100ms, adjust K to 200.

[0095] 5. The files to be transferred except the first type of transfer files are regarded as the second type of transfer files. According to the file type of the second type of transfer files, it is determined whether they are default uncompressed files, and whether they are divided into blocks according to the host resource conditions. According to the judgment results, the corresponding transmission methods are adopted respectively, including four transmission methods: block compression, block uncompressed, compression without block, and direct transmission. The block size is determined by step 2.

[0096] The adaptive scene file transmission method of the embodiment of the present invention has the following beneficial effects:

[0097] For the first-class transfer files with smaller file sizes, they are divided into several batch transmissions, and a confirmation character response is performed after a single batch transmission. After several first-class transfer files are successfully transferred in batches at one time, a confirmation character response is performed again. For massive small files, the process of confirming character responses can be reduced many times, greatly shortening the total time consumed in file transfer.

[0098] By dynamically adjusting the number of batch transmissions based on network delays, you can reduce transmission interruptions or data loss caused by network delays and improve transmission reliability.

[0099] By dividing the second type of transfer files into blocks and then transmitting them in parallel, the bandwidth utilization rate can be effectively improved and the transmission time can be shortened. By adjusting the block size according to the network bandwidth, the transmission bottleneck caused by network bandwidth limitation can be reduced and the transmission speed of large files can be improved.

[0100] Deciding whether to compress files based on the file type and only compressing the default uncompressed files before transmitting can avoid unnecessary compression and improve transmission time.

[0101] In summary, the present invention adopts different transmission strategies by autonomously identifying transmission scenarios, including network bandwidth, network delay, file size, file type and other different situations, thereby effectively shortening the transmission time.

[0102] The embodiment of the present invention also provides a scene-adaptive file transmission device, such as Figure 5 As shown, including:

[0103] The attribute acquisition module 501 is used to acquire the file attributes of the file to be transmitted, and the file attributes include the file size;

[0104] The file type screening module 502 is used to screen out the first type of transfer files whose file size is smaller than a set value according to the file attributes;

[0105] The batch transmission module 503 is used to divide the set of the first type of transmission files into several batch transmissions, and to respond with a confirmation character after a single batch transmission.

[0106] The adaptive scenario file transmission device of the embodiment of the present invention obtains the file attributes of the files to be transmitted, screens out the first category transmission files whose file sizes are smaller than the set values ​​according to the file attributes, divides the collection of the first category transmission files into several batch transmissions, and performs a confirmation character response after a single batch transmission. After successfully transmitting several first category transmission files with smaller file sizes in batches at one time, a confirmation character response can be performed again. For a large number of small files, the process of confirming character responses can be reduced many times, thereby greatly shortening the total time consumed for file transmission.

[0107] Furthermore, the scene-adaptive file transmission device further includes:

[0108] A first network status acquisition module, used to acquire the network status of the transmission device;

[0109] The transmission quantity determination module is used to confirm the quantity of the first type of transmission files in a single batch transmission according to the network status.

[0110] Furthermore, the network status includes network delay, and the transmission quantity determination module includes:

[0111] A quantity reduction module, used for reducing the quantity of the first type of transmission files in a single batch transmission if the network delay is greater than the set initial delay;

[0112] The quantity increasing module is used to increase the quantity of the first type of transmission files in a single batch transmission if the network delay is less than the set initial delay.

[0113] Furthermore, the scene-adaptive file transmission device further includes:

[0114] The second type of transmission file screening module is used to screen out the second type of transmission files whose file size is greater than or equal to a set value according to the file attributes;

[0115] A host resource determination module is used to determine whether the host resource status of the transmission device is sufficient;

[0116] A parallel transmission module, for dividing the second type of transmission file into blocks according to a set block size to obtain a plurality of file blocks, and transmitting the plurality of file blocks in parallel if the host resource status is sufficient;

[0117] The direct transmission module is used to directly transmit the second type of transmission files if the host resource status is insufficient.

[0118] Furthermore, the scene-adaptive file transmission device further includes:

[0119] A second network status acquisition module, used to acquire the network status of the transmission device;

[0120] The block size determination module is used to determine the block size according to the network status.

[0121] Furthermore, the network status includes network bandwidth, and the block size determination module includes:

[0122] A bandwidth determination module, used to determine whether the network bandwidth is less than a first bandwidth setting value;

[0123] A first block size setting module, configured to set the block size to a first preset size if the network bandwidth is less than a first bandwidth setting value;

[0124] The second block size setting module is used to set the block size to increase in proportion to the network bandwidth if the network bandwidth is greater than the first bandwidth setting value, and the block size is not greater than a second preset size.

[0125] Furthermore, the file attribute also includes the file type, and the scene-adaptive file transmission device also includes:

[0126] A file type confirmation module, used to confirm whether the second type of transmission file is a default uncompressed file according to the file type;

[0127] The file compression module is used to compress the file block or the second type of transmission file if the second type of transmission file is a default non-compressed file.

[0128] The embodiment of the present invention also provides a schematic diagram of the structure of a computer device, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6A processor 10 is taken as an example.

[0129] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0130] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0131] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0133] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0134] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0135] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0136] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0137] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope of protection.

Claims

1. A scenario-adaptive file transmission method, characterized in that: include: Obtaining file attributes of the file to be transferred, wherein the file attributes include the file size; Filter out the first type of transfer files whose file size is smaller than a set value according to the file attributes; The set of the first type of transmission files is divided into several batch transmissions, and a confirmation character response is performed after a single batch transmission.

2. The scene-adaptive file transmission method according to claim 1, characterized in that: Before dividing the set of the first type of transmission files into several batch transmissions and performing a confirmation character response after a single batch transmission, the method further includes: Get the network status of the transmission device; The number of the first-category transmission files in a single batch transmission is confirmed according to the network status.

3. The scene-adaptive file transmission method according to claim 2, characterized in that: The network status includes a network delay, and the confirming the number of the first type of transmission files for a single batch transmission according to the network status includes: If the network delay is greater than the set initial delay, reducing the number of the first type of transmission files in a single batch transmission; If the network delay is less than the set initial delay, the number of the first type of transmission files in a single batch transmission is increased.

4. The scene-adaptive file transmission method according to claim 1, characterized in that: After obtaining the file attributes of the file to be transferred, it also includes: Filter out the second type of transfer files whose file size is greater than or equal to a set value according to the file attribute; Determine whether the host resource status of the transmission device is sufficient; If the host resource status is sufficient, the second type of transmission file is divided into blocks according to the set block size to obtain a plurality of file blocks, and the plurality of the file blocks are transmitted in parallel; If the host resource status is insufficient, the second type of transfer files are directly transferred.

5. The scene-adaptive file transmission method according to claim 4, characterized in that: Before dividing the second type of transmission file into blocks according to the set block size to obtain a plurality of file blocks, the method includes: Get the network status of the transmission device; The block size is determined according to the network status.

6. The scene-adaptive file transmission method according to claim 5, characterized in that: The network status includes network bandwidth, and determining the block size according to the network status includes: Determining whether the network bandwidth is less than a first bandwidth setting value; If the network bandwidth is less than the first bandwidth setting value, setting the block size to a first preset size; If the network bandwidth is greater than the first bandwidth setting value, the block size is set to increase in proportion to the network bandwidth, and the block size is not greater than a second preset size.

7. The scene-adaptive file transmission method according to claim 4, characterized in that: The file attribute also includes a file type, and before the plurality of the file blocks are transmitted in parallel or the second type of transmission file is directly transmitted, the file attribute includes: Determine whether the second type of transmission file is a default uncompressed file according to the file type; If the second-type transmission file is a default uncompressed file, the file block or the second-type transmission file is compressed.

8. A scene-adaptive file transmission device, characterized in that: include: An attribute acquisition module, used to acquire file attributes of the file to be transmitted, wherein the file attributes include the file size; A file type screening module, used to screen out first-class transfer files whose file size is smaller than a set value according to the file attributes; The batch transmission module is used to divide the set of the first type of transmission files into several batch transmissions, and to respond with a confirmation character after a single batch transmission.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the adaptive scenario file transfer method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the scene-adaptive file transmission method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • File transmission method and device

    CN102685159A

  • File transferring method and apparatus

    CN104185216A

  • Data continuous transmission method and device

    CN106027651A

  • Transmission method and system for packaged files based on cloud computing environment

    CN106161633A

  • Large file uploading method used in narrowband network environment

    CN114020703A