A file transmission method and device

CN122933629APending Publication Date: 2026-10-16HANGZHOU AIMEI AVIATION MFG EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331123.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

但此类方案在弱通信链路场景下存在明显技术缺陷:其一,固定分片尺寸无法适配链路质量的动态波动,当链路质量恶化、丢包率升高时,较大的分片尺寸会导致单分片丢失后的重传成本显著上升,传输可靠性不足;当链路状态稳定、带宽富余时,较小的分片尺寸又无法充分利用链路带宽,整体传输效率偏低,传输效率与可靠性难以兼顾

Benefits of technology

下发模块,用于根据所述任务文件的文件优先级、链路质量信息以及各数据分片的排序信息,将封装后的数据分片下发至接收端;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933629A_ABST
    Figure CN122933629A_ABST
Patent Text Reader

Abstract

The application discloses a file transmission method and device, comprising: obtaining a task file to be transmitted and link quality information of a current communication link; performing fragmentation processing on the task file according to the link quality information to obtain a plurality of data fragments; encapsulating each data fragment based on a preset fragmentation transmission protocol; according to the file priority of the task file, the link quality information and the sorting information of each data fragment, the encapsulated data fragment is issued to a receiving end; when receiving the fragment state confirmation information fed back by the receiving end, the transmission operation corresponding to the fragment state confirmation information is executed. The application can improve the efficiency and reliability of file transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, specifically to a file transfer method and apparatus. Background Technology

[0002] With the rapid development of underwater resource exploration and intelligent offshore operations, the demand for file transfer between autonomous underwater vehicles, remote sensing devices, and shore-based host computers continues to grow. These scenarios often employ transmission links such as underwater acoustic communication, BeiDou short message service, and low-Earth orbit satellite communication. These methods generally suffer from weak communication characteristics, including limited bandwidth, high round-trip latency, high packet loss rates, and susceptibility to connection interruptions, placing stringent demands on the reliability and efficiency of large file transfers.

[0003] Existing file transfer solutions mostly employ fixed-size fragmented transmission, coupled with basic packet loss retransmission mechanisms to deliver data. Some solutions achieve multi-task hierarchical scheduling by prioritizing files. However, these solutions have significant technical drawbacks in weak communication link scenarios: First, fixed fragment sizes cannot adapt to dynamic fluctuations in link quality. When link quality deteriorates and packet loss rate increases, larger fragment sizes lead to a significant increase in retransmission costs after a single fragment is lost, resulting in insufficient transmission reliability. When the link is stable and bandwidth is abundant, smaller fragment sizes cannot fully utilize the link bandwidth, resulting in low overall transmission efficiency, making it difficult to balance transmission efficiency and reliability. Second, existing transmission scheduling mechanisms do not link file priority with real-time link quality. In weak link environments, they cannot prioritize the transmission of high-priority files, and their ability to resume transmission after communication interruptions is insufficient, easily causing invalid duplicate transmissions, further reducing file transfer efficiency in weak communication scenarios.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0005] This application provides a file transfer method and apparatus that can improve the efficiency and reliability of file transfer.

[0006] In a first aspect, embodiments of this application provide a file transfer method, including: Obtain the task file to be transmitted and the link quality information of the current communication link; The task file is fragmented based on the link quality information to obtain multiple data fragments. Each data fragment is encapsulated based on a pre-defined fragmentation transmission protocol; Based on the file priority, link quality information, and sorting information of each data fragment of the task file, the encapsulated data fragments are sent to the receiving end. When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed.

[0007] Optionally, in some embodiments of this application, the step of fragmenting the task file according to the link quality information to obtain multiple data fragments includes: The current communication link is classified according to the link quality information. The initial segment size for file splitting is determined based on the hierarchical results; The task file is divided into multiple data fragments according to the initial fragment size.

[0008] Secondly, embodiments of this application provide a file transfer device, including: The acquisition module is used to acquire the task file to be transmitted and the link quality information of the current communication link; The processing module is used to perform fragmentation processing on the task file according to the link quality information to obtain multiple data fragments; The encapsulation module is used to encapsulate each data fragment based on a preset fragmentation transmission protocol; The delivery module is used to deliver the encapsulated data fragments to the receiving end according to the file priority, link quality information and sorting information of each data fragment of the task file. The receiving module is used to execute the transmission operation corresponding to the fragmentation status confirmation information when it receives the fragmentation status confirmation information fed back by the receiving end.

[0009] This application provides a file transfer method and apparatus. After obtaining the task file to be transferred and the link quality information of the current communication link, the task file is fragmented according to the link quality information to obtain multiple data fragments. Then, each data fragment is encapsulated based on a preset fragmentation transmission protocol. Next, the encapsulated data fragments are sent to the receiving end according to the file priority of the task file, the link quality information, and the sorting information of each data fragment. When fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed. In the file transfer scheme provided in this application, by obtaining the quality information of the current communication link, the link transmission capability is graded and the fragment size is dynamically matched. When the link quality deteriorates and the packet loss rate increases, smaller fragments are used to reduce the retransmission cost after a single fragment is lost, ensuring transmission reliability. When the link status is stable and the bandwidth is sufficient, larger fragments are used to fully utilize the link bandwidth to improve transmission throughput efficiency, achieving a dynamic balance between reliability and efficiency, and solving the pain point that fixed fragment sizes cannot adapt to dynamic fluctuations in link quality. On the other hand, by combining task file priority, real-time link quality and fragment sorting information, hierarchical scheduling transmission is performed to prioritize the transmission resources of high-priority files, and targeted retransmission and breakpoint resumption are performed based on the fragment status confirmation information fed back by the receiving end to avoid invalid and repeated transmission. This achieves linkage adaptation between file priority and link quality, effectively improving the overall file transmission efficiency in weak communication scenarios. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is an application environment diagram of the file transfer method provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the file transfer method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the file transfer device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of systems and methods consistent with those detailed in the appended claims or with some aspects of this application.

[0013] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover descriptions such as non-exclusive inclusion, so that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.

[0014] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0015] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0016] To address the aforementioned technical problems and overcome the shortcomings of existing technologies, embodiments of this application provide a file transfer method and apparatus that can efficiently construct and reasonably inject prior information in long context scenarios, thereby improving prediction accuracy and generation quality.

[0017] Figure 1 This is a diagram illustrating the application environment of a file transfer method in one embodiment. (Refer to...) Figure 1This file transfer method is applied to a file transfer system. The file transfer system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal; the mobile terminal can be at least one of a mobile phone, tablet computer, or laptop computer. The server 120 can be a standalone server or a server cluster consisting of multiple servers. The server 120 is configured to execute the above file transfer method, including: acquiring the task file to be transferred and the link quality information of the current communication link; fragmenting the task file according to the link quality information to obtain multiple data fragments; encapsulating each data fragment based on a preset fragmentation transmission protocol; sending the encapsulated data fragments to the receiving end according to the file priority of the task file, the link quality information, and the sorting information of each data fragment; and executing the transmission operation corresponding to the fragmentation status confirmation information when receiving fragmentation status confirmation information from the receiving end.

[0018] Please see Figure 2 , Figure 2 This is a schematic flowchart of a file transfer method provided in an embodiment of this application. This embodiment mainly uses the application of this file transfer method to a computer device as an example for illustration. The file transfer method provided in an embodiment of this application may specifically include the following steps: S1. Obtain the task file to be transmitted and the link quality information of the current communication link; The task file to be transmitted refers to the business data file that the sending end (such as a shore-based host computer) needs to send to the remote receiving device (such as an autonomous underwater vehicle). In some embodiments of this application, it can be classified according to business type, such as task control scripts, device configuration files, emergency command files, sensor calibration data, and log update packages, etc. Different types correspond to different transmission priorities. The current communication link refers to the physical communication channel that has been established between the sending end and the receiving end to carry this file transmission, such as underwater acoustic communication links, Beidou short message links, low-orbit satellite (Iridium) communication links, and short-range radio / WiFi links. Link quality information refers to a set of indicators that quantify the transmission capacity and stability of the current communication link, including the link's real-time available bandwidth, data packet loss rate, round-trip time (RTT), historical fragment retransmission count, ACK timeout frequency, and overall link quality score.

[0019] For example, specifically, the binary data of the target task file, including the filename and total number of bytes, is read from local storage or the business system. Based on the file's business type and urgency, a corresponding file priority level is matched. Optionally, in some embodiments of this application, a pre-calculated overall file checksum (such as an MD5 hash value) is performed so that the receiving end can subsequently verify the file's integrity using this checksum. Further, the type of the active communication link currently connected to the receiving end is identified, and its basic capability attributes are determined, such as whether it is a strong or weak communication link. Optionally, in some embodiments of this application, a link with an available bandwidth greater than or equal to 1 Mbps, a steady-state packet loss rate less than or equal to 1%, and a round-trip latency less than or equal to 100 ms is identified as a strong communication link; otherwise, it is identified as a weak communication link.

[0020] Furthermore, through the link layer interface, physical indicators of the link are collected, including real-time available bandwidth, signal strength, and physical layer bit error rate. Then, the fragmentation packet loss rate, ACK round-trip time, fragmentation retransmission count, and timeout count within a recent transmission cycle are statistically analyzed. Combining the physical indicators of the link with the transport layer statistical data, a comprehensive link quality score is calculated to form link quality information.

[0021] S2. The task file is fragmented based on the link quality information to obtain multiple data fragments.

[0022] Fragmentation refers to the process of dividing a complete task file into several small data units that can be transmitted and verified independently, based on the actual transmission capacity of the current communication link and according to specified rules. Its core purpose is to break down large files into data blocks that adapt to the link's carrying capacity, reduce the cost of retransmission after a single transmission failure, and balance transmission efficiency and reliability through dynamic adaptation of fragment size.

[0023] Data fragments refer to individual, independent data units obtained after a task file has been fragmented; they are the smallest unit of transmission for this file transfer. Each data fragment has a unique sequence number and can independently perform protocol encapsulation, link transmission, integrity verification, and retransmission in case of anomalies. It should be noted that after the receiving end receives all data fragments, it can reassemble them according to their sequence numbers to restore the complete task file.

[0024] For example, specifically, the collected link quality information is compared with a preset classification threshold to classify the transmission capacity of the current communication link into strong or weak communication links. Then, based on the classification result of the link transmission capacity, the corresponding initial fragment size is matched from the preset fragment size mapping rules. The binary data of the task file is segmented in bytes according to the determined initial fragment size. Finally, all the resulting data fragments are assigned continuously increasing fragment numbers, and basic attribute information such as the total number of fragments generated and the actual byte length of each fragment is statistically analyzed. Optionally, in some embodiments of this application, the step "segmenting the task file according to the link quality information to obtain multiple data fragments" may specifically include: The current communication link is classified according to the link quality information; The initial segment size for file splitting is determined based on the hierarchical results; The task file is split into multiple data fragments according to the initial fragment size.

[0025] The initial fragment size refers to the standard byte length of a single data fragment initially determined based on the quality level of the current communication link during the file transfer initiation phase. The larger the size, the more data a single fragment can carry, the lower the proportion of protocol header overhead, and the higher the transmission efficiency; the smaller the size, the lower the retransmission cost after a single fragment is lost, and the stronger the transmission reliability.

[0026] For example, specifically, real-time available bandwidth, steady-state packet loss rate, and round-trip time (RTT) are extracted from the link quality information, and the above indicators are compared one by one with the link classification thresholds preset by the system. Through multi-dimensional comprehensive judgment, the current communication link is classified into the corresponding quality level. In some embodiments of this application, it can be divided into two levels: strong communication link and weak communication link. It can also be expanded into multiple levels of strong, medium, and weak depending on the scenario.

[0027] Furthermore, if the link is determined to be a strong communication link (sufficient bandwidth, low packet loss rate, and low latency), a larger initial fragment size is matched. By increasing the proportion of data payload per fragment and reducing the total number of fragments, the overhead of the protocol header is reduced, and the link bandwidth is fully utilized to improve the overall transmission throughput efficiency. If the link is determined to be a weak communication link (limited bandwidth, high packet loss rate, and high latency), a smaller initial fragment size is matched. By reducing the size of each fragment, the amount of data retransmitted after a single packet loss is reduced, the retransmission consumes more link resources, and the transmission reliability and fault tolerance in a weak network environment are improved. Finally, starting from the beginning byte position of the task file, the file is continuously cut in byte order. A complete data fragment is generated every time the length of the initial fragment size is reached, and the process is continued towards the end of the file.

[0028] It should be noted that any remaining data at the end of the file that is less than the size of a complete initial fragment is directly retained as the last independent data fragment without zero padding or data discarding, thus ensuring the integrity of the original file data.

[0029] S3. Encapsulate each data fragment based on a preset fragmentation transmission protocol.

[0030] Fragmentation protocols are pre-agreed and jointly followed specifications for fragmented message interaction between the sender and receiver. They define the field composition, field order, data type and length of each field, and encoding / parsing rules for fragmented messages. Encapsulation refers to the process of adding identification, verification, and control fields to data fragments according to the format standards agreed upon in the fragmentation protocol, packaging the pure data payload into a standard message that can be transmitted in the communication link and independently parsed by the receiver.

[0031] For example, specifically, the fields required for this encapsulation are extracted from the preset fragmentation transmission protocol. The extracted fields may include common encapsulation fields and exclusive encapsulation fields. The common encapsulation fields correspond to the global file identification information. All fragments of the same task file share the same value, which is the basis for the receiving end to identify the file identity and judge the overall transmission progress. The exclusive encapsulation fields correspond to the fragment identification information and data payload. Each fragment has a unique value.

[0032] Furthermore, the pre-generated global file identification information is uniformly filled into the common encapsulation field of each data segment to ensure that all segments of the same task file carry consistent global identity information. Specifically, the unique file identifier (filename / file ID) can be filled in for the receiving end to distinguish different transmission tasks, the total number of file segments can be filled in for the receiving end to predict the total transmission volume and judge the overall completion rate, the overall file checksum can be filled in as the benchmark for the receiving end to finally verify the correctness of the complete file, and the transmission operation type flag can be filled in to identify the transmission stage to which the current segment belongs (such as the start of transmission or the continuation of transmission).

[0033] For each individual data fragment, its unique fragment identification information and original data are sequentially filled in to complete the field filling for that fragment. This includes filling in the fragment sequence number, assigning each fragment a unique, sequentially increasing number according to the fragmentation order; filling in the actual byte length of the fragment, used by the receiving end to verify whether a fragment has been truncated or received completely; and filling in the binary data of the current fragment, i.e., the payload content of the fragmented transmission. Finally, all the filled fields are packaged and assembled according to the field order and data encoding format agreed upon in the fragmented transmission protocol to form a fragmented transmission message.

[0034] Optionally, in some embodiments of this application, the step of "encapsulating each data fragment based on a preset fragmentation transmission protocol" may specifically include: Obtain the encapsulation fields from the preset fragmentation transmission protocol; Each data shard is encapsulated based on the encapsulated fields, the global identifier information corresponding to the task file, and the shard identifier information corresponding to each data shard.

[0035] For example, specifically, the sending end encapsulation module first reads the preset fragmentation transmission protocol specification and extracts all the encapsulation fields required for this fragmentation transmission. Simultaneously, based on the information attributes of the fields, it categorizes them into two types: file-global encapsulation fields and fragment-specific encapsulation fields, establishing a one-to-one correspondence between fields and information sources. For all data fragments of the same task file, the pre-generated file-global identification information (including the file's unique identifier, the total number of file fragments, the overall file checksum, and transmission operation type markers) is uniformly filled into the file-global encapsulation field. For a single data fragment, its unique fragment identification information (including the fragment's unique sequence number, the actual byte length of the fragment, and the fragment's binary data payload) is sequentially filled into the corresponding fragment-specific encapsulation field. Finally, all encapsulation fields with completed information filling are structurally assembled according to the field order and data encoding format agreed upon in the preset fragmentation transmission protocol.

[0036] Optionally, in some embodiments of this application, the step of "encapsulating each data shard based on the encapsulation field, the global identifier information corresponding to the task file, and the shard identifier information corresponding to each data shard" may specifically include: Fill the first encapsulation field with the global identifier information corresponding to the task file, and Fill the second encapsulation field with the fragment identifier information corresponding to each data fragment; Each data fragment is encapsulated based on the first and second encapsulation fields after being filled.

[0037] The first encapsulation field is a set of fields in the pre-defined fragmentation transmission protocol used to carry globally common identification information of the task file. It belongs to the common header fields of the fragmented message. All data fragments under the same task file have completely identical content in their first encapsulation field, which does not change with the fragment sequence number. The core design purpose of this field is to allow the receiving end to identify file ownership and determine the overall transmission progress based on a single fragmented message, without relying on independent file handshake messages. This adapts to scenarios where weak communication links are prone to interruption and frequent interruption and resumption are required. It typically includes subfields such as unique file identifier, total number of file fragments, overall file checksum, and transmission operation type.

[0038] The second encapsulation field is a set of fields in the pre-defined fragmentation transmission protocol used to carry the unique identification information and data payload of each individual data fragment. The content of the second encapsulation field is different for each data fragment, corresponding one-to-one with the fragment. This field is the carrier for enabling independent transmission, independent verification, and independent retransmission of fragments, and it typically includes subfields such as fragment sequence number, actual byte length of the fragment, and original binary data payload of the fragment.

[0039] For example, specifically, the sending end encapsulation module first extracts the pre-generated global identification information of the task file and completely fills it into the corresponding subfield of the first encapsulation field. Since the global identification information is shared by all fragments of the same file, this content only needs to be generated once and can be reused for all data fragments of the task file, ensuring that the common header information of all fragments of the same file is completely consistent.

[0040] For each independent data fragment, the fragment's unique sequence number and actual byte length are filled into the identifier subfield, and the fragment's original binary data is filled into the payload subfield. Finally, the filled first and second encapsulation fields are structurally assembled according to the field order, data encoding format, and byte alignment rules agreed upon in the preset fragmentation transmission protocol to form a fragmented message.

[0041] S4. Based on the file priority of the task file, the link quality information, and the sorting information of each data fragment, the encapsulated data fragments are sent to the receiving end.

[0042] The receiving end is the target receiving device for file transfer tasks, typically deployed at a remote work site. It can establish a two-way data connection with the sending end (shore-based host computer / control center) via communication links such as underwater acoustic communication, BeiDou short message service, and low-Earth orbit satellite. The receiving end can be an autonomous underwater vehicle (AUV), an underwater sensor monitoring node, a offshore operation terminal, or a narrowband satellite terminal, etc.

[0043] After obtaining the priority level of the task file, the data fragments of the encapsulated task file are allocated to the corresponding priority transmission queues. Emergency control instructions or core configuration files enter the highest priority queue and have the right to preempt transmission resources; historical logs or non-real-time sensor data enter the lowest priority queue and only occupy idle bandwidth resources.

[0044] Next, based on the core indicators of the current link quality information (such as available bandwidth, steady-state packet loss rate, or round-trip time), the transmission parameters of the fragmented data are dynamically adjusted. The transmission parameters may include the sending rate, the sending window size, and the ACK waiting timeout threshold.

[0045] If the communication link is determined to be strong, a larger sending window and a higher sending rate are configured; if the communication link is determined to be weak, the sending window is reduced and the sending rate is decreased to avoid channel congestion and batch packet loss. Furthermore, within the same priority sending queue, all fragments of the same task file are sent in the order arranged according to the fragment sorting information. During the fragment sending process, the queue scheduling level is maintained by file priority, the transmission parameters are dynamically calibrated by real-time link quality, and the sending order within the queue is maintained by the fragment sorting information.

[0046] Optionally, in some embodiments of this application, the step "sending the encapsulated data fragments to the receiving end according to the file priority of the task file, the link quality information, and the sorting information of each data fragment" may specifically include: Configure the sending queue corresponding to the task file based on the file priority of the task file; Adjust the transmission parameters when sending files based on link quality information; Based on the sorting information of each data fragment, the queue order of each data fragment in the sending queue is determined; Based on the adjusted transmission parameters, queue order, and queue priority of the sending queue, the encapsulated data is fragmented and sent to the receiving end.

[0047] File priority is a pre-defined hierarchical identifier based on the business importance and urgency of the task file. Optionally, in some embodiments of this application, high priority corresponds to business data such as urgent control instructions and core configuration files, and enjoys the right to preempt transmission resources; low priority corresponds to non-critical data such as historical logs and non-real-time sensor data, and only occupies idle link resources. The sending queue is a pre-built multi-level structured buffer queue used to cache fragments to be transmitted. The higher the priority of the queue, the earlier the scheduling order and the more link resources it can occupy; when there are fragments to be sent in a high-priority queue, it can preempt the transmission time slots of the low-priority queue. Transmission parameters are the core set of parameters that control the fragment distribution rhythm and transmission strategy, and determine the utilization efficiency of link resources and transmission reliability. Core transmission parameters include sending rate, sending window size, ACK waiting timeout threshold, and retransmission interval. Sorting information is the position identifier assigned to each data fragment during the fragment processing stage, usually a continuously increasing fragment sequence number, corresponding to the byte order of the fragment in the original task file. Queue order refers to the order in which data fragments within the same sending queue are arranged. It is determined by the fragment sorting information and is usually arranged in ascending order of fragment number to ensure that fragments of the same file are sent in the original data order.

[0048] For example, specifically, after obtaining the priority level of the task file, the encapsulated data of the task file is fragmented and allocated to the corresponding priority sending queue in the system. Then, the current real-time link quality information is read, such as available bandwidth, steady-state packet loss rate, and round-trip latency. After comparing the extracted indicators with preset classification thresholds, the transmission parameters of the fragmented data are dynamically adjusted. If the link is determined to be a strong communication link, the sending rate is increased and the sending window is expanded to maximize the use of link bandwidth and improve transmission throughput efficiency. If the link is determined to be a weak communication link, the sending rate is decreased, the sending window is narrowed, and the ACK timeout threshold is extended to avoid channel congestion and batch packet loss.

[0049] Within the same priority sending queue, all data fragments of the same task file are sorted in ascending order based on the fragment sorting information (such as fragment sequence number) to determine the order of each fragment in the queue, thus forming the sending order within the queue: the smaller the fragment sequence number, the earlier it ranks in the queue and the earlier it is scheduled to be sent.

[0050] Optionally, in some embodiments of this application, it may further include: When the encapsulated data fragments are sent to the receiving end, the link quality information and the waiting status of each sending queue are updated.

[0051] For example, specifically, the system counts the total number of fragments sent, the number of successful receptions, the number of retransmissions, and the number of timeouts within the most recent statistical window to calculate the latest real-time packet loss rate and retransmission rate; it matches the fragment sending timestamp with the corresponding ACK confirmation receiving timestamp to calculate the actual round-trip time (RTT) of the current link and updates the latency metrics; and it integrates the latest complete link quality information with physical layer metrics such as real-time available bandwidth and signal strength reported by the link layer to generate the latest complete link quality information, covering core dimensions such as bandwidth, packet loss rate, latency, and overall quality level, while also covering the original historical data.

[0052] Once a fragment is sent and receives a valid acknowledgment, the fragment is removed from the list of fragments to be sent in the corresponding sending queue and marked as sent. The remaining number of fragments to be sent and the total length of each priority queue are counted one by one, and the busy / idle flag of the queue is updated (data to be sent / idle). If a fragment of a new task enters the corresponding priority queue, the list and number of fragments to be sent in that queue are updated synchronously to ensure that the queue status is completely consistent with the actual data to be transmitted.

[0053] S5. When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed.

[0054] Fragment status confirmation information is a feedback signal sent back to the sender by the receiving end after completing the reception, parsing, and verification of fragmented messages. The sender can use this information to monitor transmission progress, identify abnormal fragments, and complete error control without relying on retransmission of the entire file. Fragment status confirmation information can include confirmation of normal reception of a single fragment, confirmation of fragment loss / verification failure, confirmation of batch reception progress after communication reconnection, and confirmation of completion of the entire file transmission after all fragments have been received.

[0055] Transmission operations are the corresponding transmission control actions executed by the sending end after receiving fragmentation status confirmation information, based on the feedback status. The purpose is to complete reliable file delivery with minimal link overhead in scenarios with weak communication, high packet loss, and easy interruption. Transmission operations include four categories: normal resumption of subsequent fragments, directed retransmission of abnormal fragments, breakpoint resumption of incomplete fragments, and termination of the current transmission task, each corresponding to different receive feedback statuses.

[0056] For example, specifically, after receiving the feedback message from the receiver, the sending end parses it according to the format specification of the preset fragmentation transmission protocol, extracting the task file identifier, the fragment sequence number range, and the status type. Then, it matches the parsed status type with the system's preset status-operation mapping relationship to determine the corresponding action for this feedback. For example, a normal reception confirmation for a single fragment corresponds to a subsequent fragment retransmission operation, and a batch progress confirmation after communication interruption recovery corresponds to a breakpoint retransmission operation, etc. Furthermore, based on the matching result, differentiated transmission control is executed: if it is a normal reception confirmation, the corresponding fragment is marked as sent and removed from the sending queue. According to the order in the queue and the current transmission parameters, the subsequent fragments to be sent in the queue continue to be sent, maintaining a stable transmission rhythm. If it is an abnormal confirmation, the lost / verification failed fragments marked in the feedback are located and re-inserted into the waiting position of the corresponding priority sending queue, with priority scheduling for retransmission; only abnormal fragments are retransmitted, and fragments that have been received normally are not retransmitted, compressing invalid link overhead. If it is a batch progress confirmation after communication interruption recovery, the sequence number range of successfully received fragments is compared with that of the receiving end, and the corresponding completed fragments are removed from the sending queue in batches. Starting from the first fragment that has not been confirmed as received, the transmission continues in the queue order to achieve seamless resumption of transmission after interruption. If it is a confirmation of the completion of the entire file, all pending fragments in the sending queue corresponding to the task file are cleared, the current transmission task is marked as completed, and the occupied link scheduling resources and queue buffer space are released.

[0057] After completing the corresponding transmission operation, the link quality indicators are updated synchronously based on the confirmation information. For example, the round-trip delay is updated by combining the fragment sending time and the feedback receiving time, and the real-time packet loss rate is updated based on the reception success rate.

[0058] Optionally, in some embodiments of this application, the step "when receiving fragmentation status confirmation information from the receiving end, performing the transmission operation corresponding to the fragmentation status confirmation information" may specifically include: Parse the fragmentation status confirmation information returned by the receiving end; If a missing or abnormal fragment is identified from the fragment status confirmation information, a directed retransmission operation is performed. If the fragment status confirmation information indicates that communication has been interrupted and then resumed, the interruption resume operation will be performed based on the received fragment progress reported by the receiving end.

[0059] Optionally, in some embodiments of this application, the step "if a missing or abnormal fragment is identified from the fragment status confirmation information, then perform a directed retransmission operation" may specifically include: If a missing fragment is identified from the fragment status confirmation information, a targeted retransmission operation is performed; If an abnormal fragment is identified from the fragment status confirmation information, the abnormal fragment is added back to the transmission queue according to its sequence number so that it can be retransmitted.

[0060] For example, specifically, after parsing the message according to the preset fragmentation transmission protocol, if a fragment is determined to be undelivered through the sequence number continuity check of the received fragments, a list of missing fragment sequence numbers is fed back to identify the missing fragment. Then, based on the missing fragment sequence number, the corresponding encapsulated data fragment is retrieved from the local fragment cache to generate the fragment list for this retransmission. In addition, if a fragment is determined to be invalid after length and integrity checks, the corresponding abnormal fragment sequence number and abnormal flag are fed back to identify the abnormal fragment. Then, based on the fed-back abnormal fragment sequence number, the corresponding encapsulated data fragment is located from the local cache. The original priority level of the task file is retained, and the abnormal fragment is re-entered into the corresponding priority sending queue. When enqueuing, the position in the queue is determined according to the fragment sorting information (fragment sequence number), maintaining the fragments in the queue in order of sequence number, ensuring that retransmitted fragments and normal pending fragments follow the same sorting rules.

[0061] Optionally, in some embodiments of this application, the step "if the fragmentation status confirmation information indicates that communication has resumed after an interruption, then perform a breakpoint resumption operation based on the received fragmentation progress fed back by the receiving end" may specifically include: If the fragmentation status confirmation information indicates that communication has resumed after an interruption, then the received fragmentation information synchronized by the receiving end is obtained. Based on the received fragment information, identify the unreceived data fragments and transmit them through the send queue. For example, specifically, after detecting the restoration of the communication link, the system receives and parses the fragment status confirmation information fed back by the receiving end. When the status identifier of the message indicates that this feedback is a batch progress synchronization after the communication interruption is restored, the corresponding task file is located, and the received fragment information carried in the message is extracted, including the range of fragment sequence numbers that have been successfully received and verified, the total number of received fragments, etc. Then, based on the fragment sorting information (unique fragment sequence number), the received fragments reported by the receiving end are matched one by one with the local full set of fragments. After filtering out all fragments that have been confirmed to be received normally, the remaining fragments that are not marked as received are the unreceived data fragments to be resumed. All unreceived data fragments to be resumed are added to the corresponding priority sending queues in ascending order according to the fragment sorting information, and the queue order of each fragment is determined. Finally, based on the transmission parameters adjusted according to the latest link quality information, combined with the scheduling priority of the sending queue and the queue order within the queue, the unreceived data fragments are uniformly scheduled and distributed.

[0062] In summary, compared with the prior art, the file transfer method provided in this embodiment, after obtaining the task file to be transferred and the link quality information of the current communication link, performs fragmentation processing on the task file according to the link quality information to obtain multiple data fragments. Then, each data fragment is encapsulated based on a preset fragmentation transmission protocol. Next, according to the file priority of the task file, the link quality information, and the sorting information of each data fragment, the encapsulated data fragments are sent to the receiving end. When fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed. In the file transfer scheme provided in this application, by obtaining the quality information of the current communication link, the link transmission capability is graded and the fragmentation size is dynamically matched. When the link quality deteriorates and the packet loss rate increases, smaller fragments are used to reduce the retransmission cost after a single fragment is lost, ensuring transmission reliability. When the link status is stable and the bandwidth is sufficient, larger fragments are used to fully utilize the link bandwidth to improve transmission throughput efficiency, achieving a dynamic balance between reliability and efficiency, and solving the pain point that fixed fragmentation sizes cannot adapt to dynamic fluctuations in link quality. On the other hand, by combining task file priority, real-time link quality and fragment sorting information, hierarchical scheduling transmission is performed to prioritize the transmission resources of high-priority files, and targeted retransmission and breakpoint resumption are performed based on the fragment status confirmation information fed back by the receiving end to avoid invalid and repeated transmission. This achieves linkage adaptation between file priority and link quality, effectively improving the overall file transmission efficiency in weak communication scenarios.

[0063] To facilitate better implementation of the file transfer method of this application embodiment, this application embodiment also provides a file transfer device based on the above file transfer method. The meanings of the terms used are the same as in the above file transfer method, and specific implementation details can be found in the description of the method embodiment.

[0064] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a file transfer device provided in an embodiment of this application. The file transfer device may specifically include an acquisition module 201, a processing module 202, an encapsulation module 203, a sending module 204, and a receiving module 205, as detailed below: The acquisition module 201 is used to acquire the task file to be transmitted and the link quality information of the current communication link; Processing module 202 is used to perform fragmentation processing on the task file according to the link quality information to obtain multiple data fragments; The encapsulation module 203 is used to encapsulate each data fragment based on a preset fragmentation transmission protocol; The sending module 204 is used to send the encapsulated data fragments to the receiving end according to the file priority, link quality information and sorting information of each data fragment of the task file. The receiving module 205 is used to perform the transmission operation corresponding to the fragmentation status confirmation information when it receives the fragmentation status confirmation information fed back by the receiving end.

[0065] For specific limitations regarding the file transfer device, please refer to the limitations on the file transfer method above, which will not be repeated here. Each module in the aforementioned file transfer device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0066] The file transfer device provided in this embodiment includes a processing module 202 that, after the acquisition module 201 acquires the task file to be transmitted and the link quality information of the current communication link, performs fragmentation processing on the task file according to the link quality information to obtain multiple data fragments. Then, the encapsulation module 203 encapsulates each data fragment based on a preset fragmentation transmission protocol. Next, the sending module 204 sends the encapsulated data fragments to the receiving end according to the file priority of the task file, the link quality information, and the sorting information of each data fragment. The receiving module 205 receives the fragmentation data from the receiving end. Upon receiving fragment status confirmation information, the transmission operation corresponding to the fragment status confirmation information is executed. In the file transmission scheme provided in this application, by obtaining the quality information of the current communication link, the link transmission capability is classified and the fragment size is dynamically matched. When the link quality deteriorates and the packet loss rate increases, smaller fragments are used to reduce the retransmission cost after a single fragment is lost, ensuring transmission reliability. When the link status is stable and the bandwidth is sufficient, larger fragments are used to fully utilize the link bandwidth to improve transmission throughput efficiency, achieving a dynamic balance between reliability and efficiency, and solving the pain point that fixed fragment size cannot adapt to dynamic fluctuations in link quality. On the other hand, hierarchical scheduling transmission is performed by combining task file priority, real-time link quality, and fragment sorting information, prioritizing the transmission resources of high-priority files, and performing targeted retransmission and breakpoint resumption based on the fragment status confirmation information fed back by the receiving end, avoiding invalid repeated transmission, realizing the linkage adaptation between file priority and link quality, and effectively improving the overall file transmission performance in weak communication scenarios.

[0067] Furthermore, embodiments of this application also provide an electronic device, such as... Figure 4 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically: The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 301 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 302, and by calling data stored in the memory 302, thereby providing overall monitoring of the electronic device. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.

[0068] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and file transfer methods by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device. In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0069] The electronic device also includes a power supply 303 that supplies power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0070] The electronic device may also include an input unit 304, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0071] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processor 301 runs the applications stored in the memory 302 to realize various functions, as follows: The system acquires the task file to be transmitted and the link quality information of the current communication link. Based on the link quality information, the task file is fragmented to obtain multiple data fragments. Each data fragment is encapsulated based on a preset fragmentation transmission protocol. According to the file priority of the task file, the link quality information, and the sorting information of each data fragment, the encapsulated data fragments are sent to the receiving end. When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed.

[0072] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0073] This application's embodiments construct static and dynamic dual-branch priors that satisfy causal constraints, adaptively fuse them based on dynamic evidence strength, and then apply them to the attention output using a gating modulation method. This enables efficient construction and reasonable injection of prior information in long-context scenarios, thereby effectively improving the accuracy and generation quality of the next label prediction of the linear attention model in long-context scenarios.

[0074] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0075] Therefore, embodiments of this application provide a storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the file transfer methods provided in embodiments of this application. For example, the instructions can execute the following steps: The system acquires the task file to be transmitted and the link quality information of the current communication link. Based on the link quality information, the task file is fragmented to obtain multiple data fragments. Each data fragment is encapsulated based on a preset fragmentation transmission protocol. According to the file priority of the task file, the link quality information, and the sorting information of each data fragment, the encapsulated data fragments are sent to the receiving end. When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed.

[0076] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0077] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0078] Since the instructions stored in the storage medium can execute the steps of any of the file transfer methods provided in the embodiments of this application, the beneficial effects that any of the file transfer methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0079] The above provides a detailed description of a file transfer method and apparatus provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A file transfer method, characterized in that, include: Obtain the task file to be transmitted and the link quality information of the current communication link; The task file is fragmented based on the link quality information to obtain multiple data fragments. Each data fragment is encapsulated based on a pre-defined fragmentation transmission protocol; Based on the file priority, link quality information, and sorting information of each data fragment of the task file, the encapsulated data fragments are sent to the receiving end. When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed.

2. The file transfer method according to claim 1, characterized in that, The step of fragmenting the task file based on the link quality information to obtain multiple data fragments includes: The current communication link is classified according to the link quality information. The initial segment size for file splitting is determined based on the hierarchical results; The task file is divided into multiple data fragments according to the initial fragment size.

3. The file transfer method according to claim 1, characterized in that, The encapsulation of each data fragment based on a preset fragmentation transmission protocol includes: Obtain the encapsulation fields from the preset fragmentation transmission protocol; Based on the encapsulation fields, the global identifier information corresponding to the task file, and the fragment identifier information corresponding to each data fragment, each data fragment is encapsulated.

4. The file transfer method according to claim 3, characterized in that, The encapsulation of each data shard based on the encapsulation field, the global identifier information corresponding to the task file, and the shard identifier information corresponding to each data shard includes: Fill the first encapsulation field with the global identifier information corresponding to the task file, and Fill the second encapsulation field with the fragment identifier information corresponding to each data fragment; Each data fragment is encapsulated based on the first and second encapsulation fields after being filled.

5. The file transfer method according to claim 1, characterized in that, The step of sending the encapsulated data fragments to the receiving end based on the file priority, link quality information, and sorting information of each data fragment of the task file includes: Configure the sending queue corresponding to the task file according to the file priority of the task file; Adjust the transmission parameters when sending files based on the link quality information; Based on the sorting information of each data fragment, the queue order of each data fragment in the sending queue is determined; Based on the adjusted transmission parameters, the queue order, and the queue priority of the sending queue, the encapsulated data is fragmented and sent to the receiving end.

6. The file transfer method according to claim 1, characterized in that, Also includes: When the encapsulated data fragments are sent to the receiving end, the link quality information and the waiting status of each sending queue are updated.

7. The file transfer method according to claim 1, characterized in that, When the fragmentation status confirmation information is received from the receiving end, the transmission operation corresponding to the fragmentation status confirmation information is executed, including: Parse the fragmentation status confirmation information returned by the receiving end; If a missing or abnormal fragment is identified from the fragment status confirmation information, a directed retransmission operation is performed. If the fragmentation status confirmation information indicates that communication has resumed after an interruption, then a breakpoint resume operation is performed based on the received fragmentation progress reported by the receiving end.

8. The file transfer method according to claim 7, characterized in that, If a missing or abnormal fragment is identified from the fragment status confirmation information, a directed retransmission operation is performed, including: If a missing fragment is identified from the fragment status confirmation information, a directed retransmission operation is performed; If an abnormal fragment is identified from the fragment status confirmation information, the abnormal fragment is added back to the transmission queue according to its sequence number so as to retransmit the abnormal fragment.

9. The file transfer method according to claim 7, characterized in that, If the fragmentation status confirmation information indicates a communication interruption followed by recovery, then a resume operation is performed based on the received fragmentation progress reported by the receiving end, including: If the fragmentation status confirmation information indicates that communication has resumed after an interruption, then the received fragmentation information synchronized by the receiving end is obtained. Based on the received fragment information, the unreceived data fragments are determined and transmitted through the sending queue.

10. A file transfer device, characterized in that, include: The acquisition module is used to acquire the task file to be transmitted and the link quality information of the current communication link; The processing module is used to perform fragmentation processing on the task file according to the link quality information to obtain multiple data fragments; The encapsulation module is used to encapsulate each data fragment based on a preset fragmentation transmission protocol; The delivery module is used to deliver the encapsulated data fragments to the receiving end according to the file priority, link quality information and sorting information of each data fragment of the task file. The receiving module is used to execute the transmission operation corresponding to the fragmentation status confirmation information when it receives the fragmentation status confirmation information fed back by the receiving end.