File transmission method and device, electronic equipment and readable storage medium

By splitting large files according to file format and network/processor information and transmitting them in parallel, the problem of inefficient large file transmission is solved and the transmission efficiency and reliability are improved.

CN118764478APending Publication Date: 2024-10-11BEIJING YOUTEJIE INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411136537.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The transmission efficiency of large files is low and reliability is poor, resulting in easy failures during the transmission process.

Method used

Determine the file segmentation mechanism and segmentation threshold based on the file format of the file to be transferred, the current network communication quality, and the processor execution information, split it into multiple sub-files, and use parallel transmission for transmission.

Benefits of technology

It improves the transmission efficiency and reliability of large files, ensures reasonable file segmentation, and enhances the transmission success rate and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764478A_ABST
    Figure CN118764478A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a file transmission method and device, electronic equipment and a readable storage medium. The method comprises the steps that when it is monitored that the file size of a to-be-transmitted file exceeds a preset length threshold value, a file segmentation mechanism is determined according to the file format of the to-be-transmitted file; obtaining network communication quality information and processor execution information in current transmission, and determining a file segmentation threshold value of the to-be-transmitted file according to the network communication quality information and the processor execution information; under the file segmentation mechanism, segmenting the to-be-transmitted file according to the file segmentation threshold to obtain a plurality of corresponding to-be-transmitted sub-files; and transmitting the to-be-transmitted sub-files in a parallel transmission mode. The file is segmented according to the file format, the network communication and the processor execution condition, parallel transmission is carried out, the file transmission efficiency can be improved, and the file segmentation reasonability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a file transmission method, device, electronic device and readable storage medium. Background Art

[0002] With the development and application of big data technology, the demand for transmission and storage of massive data is increasing. In practical applications, the transmission of large files usually leads to low transmission efficiency and poor reliability due to various reasons.

[0003] Therefore, it is urgent to provide a new transmission method to improve the transmission speed of large files. Summary of the invention

[0004] The present invention provides a file transmission method, device, electronic device and readable storage medium, so as to reasonably segment large files and improve the transmission efficiency of large files.

[0005] According to one aspect of the present invention, there is provided a file transmission method, the method comprising:

[0006] When it is detected that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted;

[0007] Acquire network communication quality information and processor execution information in current transmission, and determine a file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information;

[0008] Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted;

[0009] A parallel transmission method is adopted to transmit each sub-file to be transmitted.

[0010] Optionally, determining a file segmentation mechanism according to a file format of the file to be transmitted includes:

[0011] When the file format of the file to be transmitted is a document type, determining that the file segmentation mechanism is segmentation according to semantic information;

[0012] When the file format of the file to be transmitted is an audio or video type, the file segmentation mechanism is determined to be segmentation according to length information.

[0013] Optionally, obtain network communication quality information and processor execution information in the current transmission, including:

[0014] Get the current network bandwidth size, network speed, processor utilization, processor hard disk storage utilization, and processor memory usage in the transmission.

[0015] Optionally, determining a file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information includes:

[0016] Determine a first candidate threshold for file segmentation according to the network bandwidth size, a preset network bandwidth reference value, and the size of the file to be transmitted;

[0017] Determine a second candidate threshold for file segmentation according to the network speed, a preset network speed reference value, and the size of the file to be transmitted;

[0018] Determine a third candidate threshold for file segmentation according to the processor utilization, the processor hard disk storage utilization, the processor memory occupancy rate, and the size of the file to be transferred;

[0019] The file segmentation threshold of the to-be-transferred file is determined according to the first candidate threshold, the second candidate threshold, the third candidate threshold, and the weights corresponding to the candidate thresholds.

[0020] Optionally, under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including:

[0021] When the file format of the file to be transmitted is a document type, semantic segmentation is performed on the file to be transmitted by using a preset natural language model to obtain semantic segmentation blocks;

[0022] When the block size of the semantic segmentation block is less than or equal to the file segmentation threshold, the semantic segmentation block is used as a sub-file to be transmitted;

[0023] When the block size of the semantic segmentation block is greater than the file segmentation threshold, the semantic segmentation block is segmented according to the file segmentation threshold to obtain a plurality of sub-files to be transmitted.

[0024] Optionally, under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including:

[0025] When the file format of the file to be transmitted is an audio or video type, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted.

[0026] Optionally, when the parallel transmission mode is adopted to transmit each sub-file to be transmitted, the method further includes:

[0027] generating a unique identifier for each sub-file to be transmitted according to the arrangement order of each sub-file to be transmitted in the file to be transmitted;

[0028] According to the unique identifier, the transmission status of each sub-file to be transmitted is recorded in a file block table, and the transmission status of the file to be transmitted is recorded in a file summary table;

[0029] When there is a target to-be-transmitted sub-file with a transmission failure mark in the file block table, a retransmission mechanism of the target to-be-transmitted sub-file is triggered;

[0030] When the number of retransmissions reaches a preset retransmission threshold, marking the corresponding target file to be transmitted as a transmission failure in the file overview table;

[0031] When all the to-be-transmitted sub-files corresponding to the to-be-transmitted file are successfully transmitted, the to-be-transmitted file is marked as successfully transmitted in the file overview table.

[0032] According to another aspect of the present invention, there is provided a file transmission device, the device comprising:

[0033] A file segmentation mechanism determination module, used to determine a file segmentation mechanism according to the file format of the file to be transmitted when it is detected that the file size of the file to be transmitted exceeds a preset length threshold;

[0034] A file segmentation threshold determination module, used to obtain network communication quality information and processor execution information in the current transmission, and determine the file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information;

[0035] A file segmentation module, used to segment the file to be transmitted according to the file segmentation threshold under the file segmentation mechanism to obtain a corresponding plurality of sub-files to be transmitted;

[0036] The file transmission module is used to transmit each sub-file to be transmitted in a parallel transmission mode.

[0037] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0038] at least one processor; and

[0039] a memory communicatively connected to the at least one processor; wherein,

[0040] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file transmission method described in any embodiment of the present invention.

[0041] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file transmission method described in any embodiment of the present invention when executed.

[0042] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the file transmission method according to any embodiment of the present invention is implemented.

[0043] The technical solution of the embodiment of the present invention is as follows: when it is monitored that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted; network communication quality information and processor execution information in the current transmission are obtained, and the file segmentation threshold of the file to be transmitted is determined according to the network communication quality information and the processor execution information; under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted; and each sub-file to be transmitted is transmitted in a parallel transmission mode, thereby solving the problem of low efficiency in large file transmission. By segmenting the file according to the file format, network communication and processor execution status, and transmitting the segmented sub-files in parallel, the file transmission efficiency can be improved and the reasonableness of the file segmentation can be ensured.

[0044] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0046] Figure 1 is a flowchart of a file transmission method provided according to Embodiment 1 of the present invention;

[0047] Figure 2 is a flowchart of a file transmission method provided according to Embodiment 2 of the present invention;

[0048] Figure 3 is a structural schematic diagram of a file transmission device provided according to Embodiment 3 of the present invention;

[0049] Figure 4 It is a structural schematic diagram of an electronic device for implementing the file transmission method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0052] Embodiment 1

[0053] Figure 1 This is a flowchart of a file transfer method provided according to Embodiment 1 of the present invention. This embodiment can be used to solve the situation where the file is too large and easily leads to file transfer failure when transferring large files. The method can be executed by a file transfer device, which can be implemented in the form of hardware and / or software, and the file transfer device can be configured in an electronic device such as a computer.

[0054] like Figure 1 As shown, the method includes:

[0055] Step 110: When it is detected that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted.

[0056] By judging the file size of the file to be transmitted by a preset length threshold, it can be determined whether the file to be transmitted is a large file. When the file to be transmitted is a large file, the file to be transmitted is divided to generate multiple small files. Therefore, the small files are transmitted in parallel, which can improve the file transmission efficiency and the success rate of file transmission. Exemplarily, the preset length threshold can be a value in the GB to TB level. The preset length threshold can be determined based on the transmission performance of the device in actual application. For example, the size of the file that is successfully transmitted and the size of the file that fails to be transmitted can be counted when the device is transmitting. According to the size of the file that is successfully transmitted and the size of the file that fails to be transmitted, the critical value of transmission success and failure is determined, and the critical value is set to the preset length threshold.

[0057] File formats include, but are not limited to, document files, document compressed files, video files, audio files, video compressed files, and audio compressed files. Document files can also be specifically Word files, PDF files, and Excel files. The file transmission method in the embodiment of the present invention can support the transmission of files in various file formats, which is not specifically limited.

[0058] The file segmentation mechanism may be a specific form of file segmentation, for example, the file segmentation mechanism includes but is not limited to: segmenting files according to file content and segmenting files according to file size.

[0059] In an optional implementation of an embodiment of the present invention, a file segmentation mechanism is determined according to the file format of the file to be transmitted, including: when the file format of the file to be transmitted is a document type, the file segmentation mechanism is determined to be segmentation according to semantic information; when the file format of the file to be transmitted is an audio or video type, the file segmentation mechanism is determined to be segmentation according to length information.

[0060] The document class can be a document file or a document compression file, etc. When the file format is a document class, the file segmentation mechanism of semantic information segmentation is adopted to ensure the semantic integrity of each sub-file. When there is a sub-file transmission failure, when the file is displayed through the sub-file that has been successfully transmitted, since each sub-file is semantically complete, the user's understanding of the file content is not affected despite the sub-file transmission failure, which can improve the reliability of file transmission and facilitate the user's understanding of the file content.

[0061] The audio and video files may be audio files, video files, audio compression files or video compression files, etc. It is not convenient to segment audio and video files according to semantic information, but in order to improve the reliability of file transmission, audio and video files may be segmented according to length information.

[0062] It should be noted that when it is inconvenient to perform semantic analysis on a document compression file, a file segmentation mechanism based on length information can also be used.

[0063] Step 120: Obtain network communication quality information and processor execution information in the current transmission, and determine a file segmentation threshold for the file to be transmitted based on the network communication quality information and the processor execution information.

[0064] Among them, network communication quality information includes but is not limited to: network bandwidth size, network status, and network speed. Processor execution information includes but is not limited to: CPU hard disk storage status, operation status, and memory consumption. When the network communication quality is good, the file segmentation threshold can be set to a larger value; when the network communication quality is poor, the file segmentation threshold can be set to a smaller value. When the processor execution occupancy is large, the file segmentation threshold can be set to a smaller value; when the processor execution occupancy is small, the file segmentation threshold can be set to a larger value. Based on the network communication quality information and the processor execution information, the current transmission capacity can be comprehensively evaluated to determine the appropriate file segmentation threshold.

[0065] The file segmentation threshold may be an upper limit of the size of sub-files of the file to be transmitted when the file is segmented. For example, the file segmentation threshold may be 64MB or 128MB.

[0066] In an optional implementation of an embodiment of the present invention, obtaining network communication quality information and processor execution information in the current transmission includes: obtaining the network bandwidth size, network speed, processor utilization, processor hard disk storage utilization and processor memory occupancy in the current transmission.

[0067] On the basis of the above implementation, optionally, a file segmentation threshold for the file to be transmitted is determined according to the network communication quality information and the processor execution information, including: determining a first alternative threshold for file segmentation according to the network bandwidth size, a preset network bandwidth reference value, and the size of the file to be transmitted; determining a second alternative threshold for file segmentation according to the network speed, the preset network speed reference value, and the size of the file to be transmitted; determining a third alternative threshold for file segmentation according to the processor utilization, the processor hard disk storage utilization, the processor memory occupancy, and the size of the file to be transmitted; determining the file segmentation threshold for the file to be transmitted according to the first alternative threshold, the second alternative threshold, the third alternative threshold, and the weights corresponding to each alternative threshold.

[0068] Among them, the ratio of the network bandwidth size to the preset network bandwidth reference value multiplied by the size of the file to be transmitted can be determined as the first alternative threshold. The ratio of the network speed to the preset network speed reference value multiplied by the size of the file to be transmitted is determined as the second alternative threshold. The processor utilization, the processor hard disk storage utilization, and the processor memory occupancy are integrated to obtain the processor resource occupancy. The difference between 1 and the processor resource occupancy is multiplied by the size of the file to be transmitted to determine the third alternative threshold. Each alternative threshold is weighted by the corresponding weight to obtain the file segmentation threshold of the file to be transmitted.

[0069] Specifically, the preset network bandwidth reference value can be set according to the ideal transmission bandwidth. The preset network speed can be set according to the ideal transmission network speed. The integration of the processor utilization, the processor hard disk storage utilization, and the processor memory occupancy rate can be to use the average, minimum, or weighted average of the processor utilization, the processor hard disk storage utilization, and the processor memory occupancy rate as the processor resource occupancy rate.

[0070] By setting the file segmentation threshold by considering various factors, the reliability of file segmentation can be improved, making it easier for sub-files to be transferred successfully.

[0071] Step 130: Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold value to obtain a corresponding plurality of sub-files to be transmitted.

[0072] Among them, under the file segmentation mechanism, the file to be transmitted can be segmented with the file segmentation threshold as the segmentation size upper limit to obtain corresponding multiple sub-files to be transmitted.

[0073] In an optional implementation of an embodiment of the present invention, under a file segmentation mechanism, the file to be transmitted is segmented according to a file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including: when the file format of the file to be transmitted is a document type, the file to be transmitted is semantically segmented by a preset natural language model to obtain semantic segmentation blocks; when the segmentation size of the semantic segmentation block is less than or equal to the file segmentation threshold, the semantic segmentation block is used as a sub-file to be transmitted; when the segmentation size of the semantic segmentation block is greater than the file segmentation threshold, the semantic segmentation block is segmented according to the file segmentation threshold to obtain a plurality of sub-files to be transmitted.

[0074] The preset natural language model may be a model generated in advance through training of a neural network model. For example, the preset natural language model may be a natural language processing (NLP) model. The preset natural language model may be used to perform semantic recognition on document files, and the content with the same semantics may be regarded as a semantic segmentation block.

[0075] In order to avoid the problem of transmission failure caused by the semantic segmentation block being too large, when the segmentation size of the semantic segmentation block is larger than the file segmentation threshold, the semantic segmentation block can be segmented according to the file segmentation threshold to obtain multiple sub-files to be transmitted. There are many ways to split the semantic segmentation block again. For example, the number of segments is determined by the ratio of the segmentation size of the semantic segmentation block to the file segmentation threshold. The semantic segmentation block is evenly divided according to the number of segments to obtain multiple sub-files to be transmitted. Alternatively, the semantic segmentation block is segmented with the file segmentation threshold as the segmentation length to obtain multiple sub-files to be transmitted.

[0076] When the block size of the semantic segmentation block is less than or equal to the file segmentation threshold, the semantic segmentation block is used as a sub-file to be transmitted. Furthermore, multiple consecutively arranged semantic segmentation blocks whose block size is less than the preset segmentation lower limit can be merged to generate a sub-file to be transmitted; wherein the size of the sub-file to be transmitted generated by merging is less than or equal to the file segmentation threshold.

[0077] Through the above segmentation method, the flexibility of file segmentation can be increased. On the basis of ensuring that the file segmentation meets the transmission performance requirements, the semantic integrity of the file segmentation can be improved to ensure that users can correctly understand the successfully transmitted files when some sub-files fail to be transmitted.

[0078] In an optional implementation of an embodiment of the present invention, under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including: when the file format of the file to be transmitted is an audio or video type, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted.

[0079] The file size of each sub-file to be transmitted is less than or equal to the file segmentation threshold.

[0080] Step 140: Use parallel transmission to transmit each sub-file to be transmitted.

[0081] Specifically, the sub-file to be transferred can be uploaded to the Hadoop Distributed File System (HDFS). HDFS is one of the core components of the Hadoop project and is designed for distributed data storage. HDFS has the advantages of high fault tolerance, high throughput, suitability for large files, streaming data access, and a simplified consistency model. HDFS can automatically handle hardware failures and ensure data reliability through a data replication mechanism. By default, each file block is replicated three times to different nodes. HDFS is designed for batch processing applications of large-scale data sets and can provide high-throughput data access. HDFS is good at processing large files (GB to TB level) by storing files in blocks, each block is usually 128MB or 256MB. HDFS uses a write-once, read-many model to optimize the performance of streaming data access. HDFS can provide a simplified consistency model that allows append operations but does not support random writes.

[0082] The technical solution of this embodiment is as follows: when it is monitored that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted; network communication quality information and processor execution information in the current transmission are obtained, and the file segmentation threshold of the file to be transmitted is determined according to the network communication quality information and the processor execution information; under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted; and each sub-file to be transmitted is transmitted in a parallel transmission mode, thereby solving the problem of low efficiency in large file transmission. By segmenting the file according to the file format, network communication and processor execution status, and transmitting the segmented sub-files in parallel, the file transmission efficiency can be improved and the reasonableness of the file segmentation can be ensured.

[0083] Embodiment 2

[0084] Figure 2 1 is a flowchart of a file transmission method provided according to Embodiment 2 of the present invention. This embodiment is a further addition to the above technical solution. The technical solution in this embodiment can be combined with each optional solution in one or more of the above embodiments. Figure 2 As shown, the method includes:

[0085] Step 210: When it is detected that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted.

[0086] Optionally, the file segmentation mechanism is determined according to the file format of the file to be transmitted, including: when the file format of the file to be transmitted is a document type, the file segmentation mechanism is determined to be segmentation according to semantic information; when the file format of the file to be transmitted is an audio or video type, the file segmentation mechanism is determined to be segmentation according to length information.

[0087] Step 220: Obtain network communication quality information and processor execution information in the current transmission, and determine a file segmentation threshold for the file to be transmitted based on the network communication quality information and the processor execution information.

[0088] Optionally, network communication quality information and processor execution information in the current transmission are obtained, including: obtaining the network bandwidth size, network speed, processor utilization, processor hard disk storage utilization, and processor memory occupancy in the current transmission.

[0089] Optionally, a file segmentation threshold for files to be transmitted is determined based on network communication quality information and processor execution information, including: determining a first alternative threshold for file segmentation based on the network bandwidth size, a preset network bandwidth reference value, and the size of the file to be transmitted; determining a second alternative threshold for file segmentation based on the network speed, a preset network speed reference value, and the size of the file to be transmitted; determining a third alternative threshold for file segmentation based on processor utilization, processor hard disk storage utilization, processor memory occupancy, and the size of the file to be transmitted; determining the file segmentation threshold for files to be transmitted based on the first alternative threshold, the second alternative threshold, the third alternative threshold, and the weights corresponding to each alternative threshold.

[0090] Step 230: Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold value to obtain a corresponding plurality of sub-files to be transmitted.

[0091] Optionally, under the file segmentation mechanism, the file to be transmitted is segmented according to a file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including: when the file format of the file to be transmitted is a document type, the file to be transmitted is semantically segmented by a preset natural language model to obtain semantic segments; when the segmentation size of the semantic segmentation block is less than or equal to the file segmentation threshold, the semantic segmentation block is used as a sub-file to be transmitted; when the segmentation size of the semantic segmentation block is greater than the file segmentation threshold, the semantic segmentation block is segmented according to the file segmentation threshold to obtain a plurality of sub-files to be transmitted.

[0092] Optionally, under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain corresponding multiple sub-files to be transmitted, including: when the file format of the file to be transmitted is audio or video type, the file to be transmitted is segmented according to the file segmentation threshold to obtain corresponding multiple sub-files to be transmitted.

[0093] Step 240: Generate a unique identifier for each sub-file to be transmitted according to the arrangement order of each sub-file to be transmitted in the file to be transmitted.

[0094] The unique identifier can reflect the order of arrangement of each transmission sub-file in the file to be transmitted, and can be used to subsequently merge the sub-files to be transmitted to restore the file to be transmitted. The unique identifier is also used to monitor the transmission status of each sub-file to be transmitted to determine whether the transmission of each sub-file to be transmitted and the file to be transmitted is successful.

[0095] Step 250: Use parallel transmission to transmit each sub-file to be transmitted.

[0096] Step 260: According to the unique identifier, the transmission status of each sub-file to be transmitted is recorded in the file block table, and the transmission status of the file to be transmitted is recorded in the file summary table.

[0097] Table 1

[0098]

[0099] Exemplarily, Table 1 is an exemplary file overview table, and Table 2 is an exemplary file segmentation table. As shown in Table 1, the file overview table can record the unique identifier of the file to be transmitted, the name of the file to be transmitted, the transmission status of the file to be transmitted (not uploaded, uploading, successful upload, failed upload), and the number of retransmissions. As shown in Table 2, the file segmentation table can record the unique identifier of the sub-file to be transmitted, the unique identifier (or name) of the file to be transmitted to which the sub-file to be transmitted belongs, the storage path of the sub-file to be transmitted, the transmission status of the sub-file to be transmitted (not uploaded, uploading, successful upload, failed upload), and the number of retransmissions. Among them, the transmission status can be represented by coding. For example, 0 means not uploaded, 1 means uploading, 2 means failed upload, and 3 means successful upload.

[0100] Table 2

[0101]

[0102] Step 270: When there is a target to-be-transmitted sub-file with a transmission failure mark in the file block table, a retransmission mechanism of the target to-be-transmitted sub-file is triggered.

[0103] When transferring files, the system's file scanner will scan the file block table and file overview table in real time to check whether there are new sub-files to be transferred. When a new sub-file to be transferred is detected, the parallel upload operation is immediately triggered. During the upload process, the file block table and file overview table can be used to record the transfer status of each sub-file to be transferred and the file to be transferred. If an error occurs during the upload process, the failure to transfer the target sub-file to be transferred is recorded in the file block table, which triggers the retransmission mechanism of the target sub-file to be transferred.

[0104] Step 280: When the number of retransmissions reaches a preset retransmission threshold, the corresponding target file to be transmitted is marked as transmission failure in the file overview table.

[0105] When retransmitting, a preset retransmission threshold can be set to avoid unlimited retransmission of subfiles. When the number of retransmissions reaches the preset retransmission threshold, the corresponding target file to be transmitted is marked as failed in the file overview table. The transmission status of the target subfile to be transmitted in the file block table is also failed. At this time, the administrator can be notified that the target subfile to be transmitted and the corresponding target file to be transmitted have failed to be transmitted.

[0106] Step 290: When all the sub-files to be transmitted corresponding to the file to be transmitted are transmitted successfully, mark the file to be transmitted as successfully transmitted in the file overview table.

[0107] When the file to be transmitted is marked as successfully transmitted in the file overview table, the upload success information can be transmitted to the client to inform that the file to be transmitted is accessible. It should be noted that in the embodiment of the present invention, since the file to be transmitted is transmitted by splitting first and then transmitting, when the transmission status of the sub-file to be transmitted is a transmission failure, the transmission status of each sub-file to be transmitted can be determined by the file block table. If there is a sub-file to be transmitted that has been successfully transmitted, the file to be transmitted can still be executed for reference. At this time, only the sub-files to be transmitted that have been successfully transmitted can be displayed, and they can be spliced ​​in sequence according to the unique identifiers of each sub-file to be transmitted. For the sub-files to be transmitted that are identified by the transmission, the transmission failure can be marked in the file display. In addition, the retransmission mechanism can be triggered again for the sub-file to be transmitted that failed to transmit in response to the user's operation instruction. It is convenient to retransmit based on user needs when the content is very important to the user. When the content has little impact on the user's understanding, the retransmission of the sub-file to be transmitted can no longer be requested.

[0108] The technical solution of the embodiment of the present invention is as follows: when it is monitored that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted; network communication quality information and processor execution information in the current transmission are obtained, and the file segmentation threshold of the file to be transmitted is determined according to the network communication quality information and the processor execution information; under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted; a unique identifier of each sub-file to be transmitted is generated according to the arrangement order of each sub-file to be transmitted in the file to be transmitted; each sub-file to be transmitted is transmitted in a parallel transmission mode; according to the unique identifier, the transmission status of each sub-file to be transmitted is recorded in a file segmentation table, and the transmission status of the file to be transmitted is recorded in a file overview table; when there is a target sub-file to be transmitted with a transmission failure mark in the file segmentation table, The retransmission mechanism of the target sub-file to be transmitted is triggered; when the number of retransmissions reaches the preset retransmission threshold, the corresponding target file to be transmitted is marked as failed in the file overview table; when all the sub-files to be transmitted corresponding to the file to be transmitted are successfully transmitted, the file to be transmitted is marked as successfully transmitted in the file overview table, which solves the problem of low efficiency in large file transmission. By segmenting the file according to the file format, network communication and processor execution status, and transmitting the segmented sub-files in parallel, the file transmission efficiency can be improved and the file segmentation can be ensured to be reasonable; by real-time scanning of the file segmentation table, the upload operation can be triggered immediately when a new sub-file appears, reducing delays; the transmission status of each file is recorded through the file segmentation table and the file overview table, which is convenient for file transmission status feedback and enables the client to grasp the file upload progress in real time; the reliability of file upload is improved through the retransmission mechanism.

[0109] Embodiment 3

[0110] Figure 3 Schematic diagram of a file transmission device according to Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a file segmentation mechanism determination module 310, a file segmentation threshold determination module 320, a file segmentation module 330, and a file transmission module 340. Among them:

[0111] The file segmentation mechanism determination module 310 is used to determine the file segmentation mechanism according to the file format of the file to be transmitted when it is detected that the file size of the file to be transmitted exceeds a preset length threshold;

[0112] The file segmentation threshold determination module 320 is used to obtain the network communication quality information and processor execution information in the current transmission, and determine the file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information;

[0113] The file segmentation module 330 is used to segment the file to be transmitted according to the file segmentation threshold under the file segmentation mechanism to obtain a corresponding plurality of sub-files to be transmitted;

[0114] The file transmission module 340 is used to transmit each sub-file to be transmitted in a parallel transmission manner.

[0115] Optionally, the file segmentation mechanism determination module 310 includes:

[0116] A first file segmentation mechanism determination unit, configured to determine the file segmentation mechanism as segmentation according to semantic information when the file format of the file to be transmitted is a document type;

[0117] The second file segmentation mechanism determining unit is used to determine the file segmentation mechanism as segmentation according to length information when the file format of the file to be transmitted is an audio or video type.

[0118] Optionally, the file segmentation threshold determination module 320 includes:

[0119] The transmission information acquisition unit is used to obtain the network bandwidth size, network speed, processor utilization, processor hard disk storage utilization and processor memory occupancy rate in the current transmission.

[0120] Optionally, the file segmentation threshold determination module 320 includes:

[0121] A first candidate threshold determination unit, configured to determine a first candidate threshold for file segmentation according to a network bandwidth size, a preset network bandwidth reference value, and a size of a file to be transmitted;

[0122] A second candidate threshold determination unit, configured to determine a second candidate threshold for file segmentation according to a network speed, a preset network speed reference value, and a size of a file to be transmitted;

[0123] A third candidate threshold determination unit, used to determine a third candidate threshold for file segmentation according to a processor utilization rate, a processor hard disk storage utilization rate, a processor memory occupancy rate, and a size of a file to be transferred;

[0124] The file segmentation threshold determination unit is used to determine the file segmentation threshold of the to-be-transmitted file according to the first candidate threshold, the second candidate threshold, the third candidate threshold, and the weights corresponding to the candidate thresholds.

[0125] Optionally, the file segmentation module 330 includes:

[0126] A semantic segmentation block determination unit is used to, when the file format of the file to be transmitted is a document type, semantically segment the file to be transmitted by using a preset natural language model to obtain semantic segmentation blocks;

[0127] A first file segmentation unit, configured to treat the semantic segmentation block as a sub-file to be transmitted when the segmentation size of the semantic segmentation block is less than or equal to the file segmentation threshold;

[0128] The second file segmentation unit is used to segment the semantic segmentation block according to the file segmentation threshold to obtain a plurality of sub-files to be transmitted when the segmentation size of the semantic segmentation block is greater than the file segmentation threshold.

[0129] Optionally, the file segmentation module 330 includes:

[0130] The third file segmentation unit is used to segment the file to be transmitted according to the file segmentation threshold value to obtain a corresponding plurality of sub-files to be transmitted when the file format of the file to be transmitted is an audio or video type.

[0131] Optionally, the device further includes:

[0132] The identifier generation module is used to generate a unique identifier for each sub-file to be transmitted according to the arrangement order of each sub-file to be transmitted in the file to be transmitted when each sub-file to be transmitted is transmitted in a parallel transmission mode;

[0133] A transmission status recording module, used to record the transmission status of each sub-file to be transmitted through a file block table according to a unique identifier, and to record the transmission status of the file to be transmitted through a file overview table;

[0134] A retransmission mechanism triggering module, used to trigger a retransmission mechanism for a target sub-file to be transmitted when a target sub-file to be transmitted has a transmission failure mark in the file segmentation table;

[0135] A transmission failure recording module is used to mark the corresponding target file to be transmitted as a transmission failure in the file overview table when the number of retransmissions reaches a preset retransmission threshold;

[0136] The transmission success recording module is used to mark the file to be transmitted as successfully transmitted in the file overview table when all the sub-files to be transmitted corresponding to the file to be transmitted are successfully transmitted.

[0137] The file transmission device provided in the embodiment of the present invention can execute the file transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0138] Embodiment 4

[0139] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0140] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0141] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0142] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a file transfer method.

[0143] In some embodiments, the file transfer method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the file transfer method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the file transfer method in any other appropriate manner (e.g., by means of firmware).

[0144] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0145] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0146] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0147] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0148] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0149] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0150] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0151] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A file transfer method, It is characterized in that include: When it is detected that the file size of the file to be transmitted exceeds a preset length threshold, a file segmentation mechanism is determined according to the file format of the file to be transmitted; Acquire network communication quality information and processor execution information in current transmission, and determine a file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information; Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted; A parallel transmission method is adopted to transmit each sub-file to be transmitted.

2. The method according to claim 1, It is characterized in that Determining a file segmentation mechanism according to the file format of the file to be transmitted includes: When the file format of the file to be transmitted is a document type, determining that the file segmentation mechanism is segmentation according to semantic information; When the file format of the file to be transmitted is an audio or video type, the file segmentation mechanism is determined to be segmentation according to length information.

3. The method according to claim 1, It is characterized in that Get the network communication quality information and processor execution information currently being transmitted, including: Get the current network bandwidth size, network speed, processor utilization, processor hard disk storage utilization, and processor memory usage in the transmission.

4. The method according to claim 3, It is characterized in that Determining a file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information includes: Determine a first candidate threshold for file segmentation according to the network bandwidth size, a preset network bandwidth reference value, and the size of the file to be transmitted; Determine a second candidate threshold for file segmentation according to the network speed, a preset network speed reference value, and the size of the file to be transmitted; Determine a third candidate threshold for file segmentation according to the processor utilization, the processor hard disk storage utilization, the processor memory occupancy rate, and the size of the file to be transferred; The file segmentation threshold of the to-be-transferred file is determined according to the first candidate threshold, the second candidate threshold, the third candidate threshold, and the weights corresponding to the candidate thresholds.

5. The method according to claim 2, It is characterized in that Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including: When the file format of the file to be transmitted is a document type, semantic segmentation is performed on the file to be transmitted by using a preset natural language model to obtain semantic segmentation blocks; When the block size of the semantic segmentation block is less than or equal to the file segmentation threshold, the semantic segmentation block is used as a sub-file to be transmitted; When the block size of the semantic segmentation block is greater than the file segmentation threshold, the semantic segmentation block is segmented according to the file segmentation threshold to obtain a plurality of sub-files to be transmitted.

6. The method according to claim 2, It is characterized in that Under the file segmentation mechanism, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted, including: When the file format of the file to be transmitted is an audio or video type, the file to be transmitted is segmented according to the file segmentation threshold to obtain a corresponding plurality of sub-files to be transmitted.

7. The method according to claim 1, It is characterized in that When the parallel transmission mode is adopted to transmit each sub-file to be transmitted, the following steps are also included: generating a unique identifier for each sub-file to be transmitted according to the arrangement order of each sub-file to be transmitted in the file to be transmitted; According to the unique identifier, the transmission status of each sub-file to be transmitted is recorded in a file block table, and the transmission status of the file to be transmitted is recorded in a file summary table; When there is a target to-be-transmitted sub-file with a transmission failure mark in the file block table, a retransmission mechanism of the target to-be-transmitted sub-file is triggered; When the number of retransmissions reaches a preset retransmission threshold, marking the corresponding target file to be transmitted as a transmission failure in the file overview table; When all the to-be-transmitted sub-files corresponding to the to-be-transmitted file are successfully transmitted, the to-be-transmitted file is marked as successfully transmitted in the file overview table.

8. A file transmission device, It is characterized in that include: A file segmentation mechanism determination module, used to determine a file segmentation mechanism according to the file format of the file to be transmitted when it is detected that the file size of the file to be transmitted exceeds a preset length threshold; A file segmentation threshold determination module, used to obtain network communication quality information and processor execution information in the current transmission, and determine the file segmentation threshold of the file to be transmitted according to the network communication quality information and the processor execution information; A file segmentation module, used to segment the file to be transmitted according to the file segmentation threshold under the file segmentation mechanism to obtain a corresponding plurality of sub-files to be transmitted; The file transmission module is used to transmit each sub-file to be transmitted in a parallel transmission mode.

9. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file transmission method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file transmission method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Front-end processing method, system and equipment for large file and storage medium

    CN121056452A