File transmission control method and device, equipment and medium

By applying the scanning and sliding window technology of target files, dynamically splitting files into data packets of different package lengths, solving the problem that fixed-length subcontracting algorithms in the existing technology is difficult to adapt to different file characteristics, and improving the efficiency of data packet utilization and file transfer efficiency.

CN119402488APending Publication Date: 2025-02-07INFORMATION2 SOFTWARE SHANGHAI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411529542.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, file transfer systems generally adopt fixed-length subcontracting algorithms, which are difficult to adapt to the content distribution characteristics of different types of files, resulting in low packet utilization efficiency and low file transfer efficiency.

Method used

By scanning the target file to be transferred, the number of concentrated rendered bytes of each type of data is determined, and the length of the sliding window is set based on this information. Based on the sliding window, the file contents at different locations are obtained from the file, and the file is split into multiple data packets of different packaging lengths according to the data proportion of each type of data, and sent separately.

Benefits of technology

It realizes dynamic optimization of packet length based on file content distribution, so that similar data with a large proportion can be packaged into the same data packet, improving the efficiency of data packet utilization and file transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402488A_ABST
    Figure CN119402488A_ABST
Patent Text Reader

Abstract

The invention discloses a file transmission control method and device, equipment and a medium, and relates to the technical field of computer network data transmission, and the method comprises the steps: scanning a to-be-transmitted target file, and determining the number of concentrated presentation bytes of various types of data in the target file, thereby determining the packaging length of the various types of data, the length of the sliding window is set accordingly; and acquiring file contents at different sliding window positions from the target file for multiple times, splitting the target file into a plurality of data packets with different packaging lengths according to the data proportion of each type of data in the file contents, and respectively sending the data packets to a data receiver. The packaging length and the length of the sliding window are determined through the number of concentrated presentation bytes of various types of data in the target file, and the data packets are split into a plurality of data packets with different packaging lengths according to the data proportion of the various types of data in the sliding window and are respectively sent, so that the packet length is dynamically optimized according to file content distribution; and the utilization efficiency of the data packet and the file transmission efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer network data transmission, and in particular to a file transmission control method, device, equipment and medium. Background Art

[0002] With the development of digital technology, the complexity of file transmission content and the amount of data are increasing dramatically. This trend has put forward higher requirements on the performance of file transmission systems.

[0003] In the prior art, file transfer systems generally adopt a fixed-length packetization algorithm. Since different types of files have significant differences in content distribution characteristics, the fixed-length packetization strategy is difficult to adapt to the diverse needs of file transfer, resulting in the inability to reach the maximum load of the data packet and the inability to fully utilize the potential of the network bandwidth, thereby reducing the utilization efficiency of the data packet and the efficiency of file transfer. Summary of the invention

[0004] The present invention provides a file transmission control method to solve the problem of low data packet utilization efficiency and low file transmission efficiency when transmitting files with high content complexity and large data volume in sub-packets.

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

[0006] Scan the target file to be transferred to determine the concentrated number of bytes of each type of data in the target file;

[0007] Determine the packing length of each type of data according to the number of bytes presented in each type of data, and set the length of the sliding window according to the packing length of each type of data;

[0008] Based on the sliding window, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different packaging lengths according to the data proportion of each type of data in the file content;

[0009] The split data packets with different package lengths are sent to the data receiver respectively.

[0010] According to another aspect of an embodiment of the present invention, a file transmission control device is also provided, the device comprising:

[0011] A module for determining the number of bytes presented in a centralized manner is used to scan the target file to be transmitted and determine the number of bytes presented in a centralized manner for each type of data in the target file;

[0012] A sliding window length setting module is used to determine the packing length of each type of data according to the number of bytes presented in the concentrated form of each type of data, and to set the length of the sliding window according to the packing length of each type of data;

[0013] The target file splitting module is used to obtain the file contents at different sliding window positions from the target file multiple times based on the sliding window, and split the target file into multiple data packets with different packaging lengths according to the data proportion of each type of data in the file content;

[0014] The data packet sending module is used to send the multiple data packets with different package lengths obtained by splitting to the data receiver respectively.

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

[0016] at least one processor; and

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

[0018] 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 control method described in any embodiment of the present invention.

[0019] According to another aspect of an embodiment 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 control method described in any embodiment of the present invention when executed.

[0020] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in any embodiment of the present invention are implemented.

[0021] The technical solution of the embodiment of the present invention determines the concentrated byte number of each type of data in the target file by scanning the target file to be transmitted; determines the packing length of each type of data according to the concentrated byte number of each type of data, and sets the length of the sliding window according to the packing length of each type of data; obtains the file content at different sliding window positions from the target file multiple times based on the sliding window, and splits the target file into multiple data packets with different packing lengths according to the data proportion of each type of data in the file content; and sends the multiple data packets with different packing lengths obtained by splitting to the data receiver respectively. The packing length of each type of data and the length of the sliding window are determined by the concentrated byte number of each type of data in the target file, and the data packets are split into multiple data packets with different packing lengths according to the data proportion of each type of data in the sliding window and sent respectively, so as to realize dynamic optimization of the packet length according to the distribution of the file content, so that the same type of data with a large proportion can be packed into the same data packet, thereby improving the utilization efficiency of the data packet and the efficiency of file transmission.

[0022] 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

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

[0024] Figure 1 is a flow chart of a file transmission control method provided according to Embodiment 1 of the present invention;

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

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

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

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

[0029] Embodiment 1

[0030] Figure 1 This is a flowchart of a file transmission control method provided in the first embodiment of the present invention. This embodiment is applicable to the case where a file is split into data packets of dynamic package length and sent in separate packets according to the distribution of the file content. The method can be executed by a file transmission control device. The file transmission control device can be implemented in the form of hardware and / or software and can generally be configured in an electronic device. Figure 1 As shown, the method includes:

[0031] S110 , scanning the target file to be transmitted, and determining the concentrated number of bytes of each type of data in the target file.

[0032] In an embodiment of the present invention, the target file to be transmitted refers to a file that is about to be sent during the transmission process. Various types of data refer to the file types containing file contents in the target file to be transmitted, and may include: text, images, codes, etc. The concentrated number of bytes presented refers to the byte length of continuous appearance of a certain type of data in a file, and is used to describe the density of a certain type of data in a composite file containing multiple different types of content. Among them, the continuous appearance of a certain type of data refers to the continuous storage of a certain type of data in a certain area of ​​the file without the insertion of other types of data. In this case, the byte length of the data is the total number of bytes from the beginning to the end of the data.

[0033] Specifically, the target file to be transmitted is scanned to determine the various types of data in the target file and the number of bytes in which they are presented in a concentrated manner. The data type of each data can be determined in the following manner: for compound files of known structures, such as PDF and Word documents, the number of bytes in which different contents are presented in a concentrated manner can be identified by analyzing the file structure. For example, a PDF file is composed of a variety of objects, including integers, strings, names, Boolean values, null objects, arrays, dictionaries, and streams. The files are parsed by programming libraries such as Apache POI (for processing Microsoft Office documents) or iText (for processing PDF files) to determine the location and length of text, images, and code snippets. When analyzing binary files, the continuity of data is one of the indicators for identifying different data types. When a mutation occurs in the byte pattern in the file, it indicates that a new type of data or the beginning of a data block has been encountered. After determining the various types of data in the target file, the number of bytes in which each type of data is presented in a concentrated manner is obtained.

[0034] S120, determining the packing length of each type of data according to the number of bytes presented in a concentrated manner for each type of data, and setting the length of the sliding window according to the packing length of each type of data.

[0035] In an embodiment of the present invention, the packet length is to divide the data into packets of a specific size for easy transmission. The packet length of each type of data can be determined by the number of bytes presented in the concentrated form of each type of data and the network conditions. For example, if a file contains data streams of multiple data types, a smaller packet length is required for data with a small number of bytes presented in the concentrated form of data to ensure the integrity and order of the data; and a larger packet length can be used for data with a large number of bytes presented in the concentrated form of data to improve transmission efficiency. When determining the packet length, the network load, delay and packet loss rate also need to be considered. In a network environment with high network load, high delay or high packet loss rate, the packet length needs to be reduced to reduce the risk of data loss. In a network environment with low network load, low delay or low packet loss rate, the packet length can be increased to improve transmission efficiency.

[0036] Generally speaking, the more consistent the data types contained in each data packet are, the greater the compression ratio of the data packet is, and the higher the network transmission efficiency of the data packet is. The number of bytes presented in a concentrated manner for each type of data reflects the (average or maximum) continuous length of each type of data at each occurrence. Optionally, the packing length of each type of data can be set to an integer multiple of the number of bytes presented in a concentrated manner for each type of data. The multiple relationship between the packing length of different types of data and the matching number of bytes presented in a concentrated manner can be the same or different.

[0037] A sliding window is a fixed-size window in a data stream or file. The window can slide along the data stream or file content, that is, it can move forward or backward continuously. Through continuous movement, all data information in the file can be obtained in sequence, and the transmission flow and order of the file data can be controlled. The position of the window in the data stream or file can be arbitrary, usually starting from the beginning (such as the beginning of the file).

[0038] In this embodiment, the length of the sliding window can be understood as the minimum value of the amount of data that can be continuously sent during the data transmission process, and can be determined by the package length of each type of data. After determining the length of the sliding window, by analyzing the sliding window heavy data dynamically obtained each time, the package length of a new data packet can be dynamically determined.

[0039] In other words, after each window sliding, the data contained in the sliding window can be understood as all or part of the data in the target file that needs to be packaged into a new data packet. By analyzing these data, the packaging length of the new data packet can be dynamically determined. For example, the sliding window currently obtains 100 bytes of data from the nearest unpacked position in the target file, and then determines that the packaging length of a new data packet is 200 bytes for this 100 bytes of data, then starts from the left window of the sliding window, obtains 200 bytes of data for packaging.

[0040] Specifically, according to the number of bytes presented in each type of data, the packet length of each type of data can be determined in combination with the network load, delay rate or packet loss rate, and the length of the sliding window can be set. The sliding window length can be used to dynamically determine the packet length of each new data packet to achieve a more balanced transmission efficiency between different types of data, and avoid the packet length of certain data types being too large or too small to affect the overall transmission performance. Among them, the length of the sliding window can be determined jointly according to the packet length of each type of data in the target file, or only the packet length of a specific type of data can be determined separately.

[0041] In a specific example, if the statistics show that the file contains text description, image data and code fragments. The byte length of the text part is concentrated around 60 bytes, the byte length of the image part is around 300 bytes, and the byte length of the code part is around 600 bytes. When the network load, delay rate or packet loss rate is low, the network bandwidth is sufficient, and a larger package length can be used to improve the transmission efficiency, the text can choose a package length of 60 bytes or its integer multiple, such as 120 bytes or 180 bytes; the image can choose a package length close to the average size of the image data, such as 300 bytes; the code can choose a package length close to the average size of the code data, such as 600 bytes. When the network load, delay rate or packet loss rate is medium, in order to avoid network congestion, the package length needs to be reduced. The text can choose a package length of 30 bytes or its integer multiple, such as 60 bytes; the image can choose a package length of about 150 bytes; the code can choose a package length of about 300 bytes. When the network load, delay rate or packet loss rate is high, in order to reduce the risk of data packet loss, the package length should be further reduced. The text can be packed with 15 bytes or its integer multiple, such as 30 bytes; the image can be packed with 75 bytes; the code can be packed with 150 bytes. For example, if the text is packed with 60 bytes, the image is packed with 300 bytes, and the code is packed with 600 bytes, the corresponding sliding window length can be set to the average value of the above packing lengths, 320 bytes, or the minimum text packing length of 60 bytes can be taken.

[0042] S130. Based on the sliding window, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different packing lengths according to the data proportion of each type of data in the file content.

[0043] Specifically, based on the set sliding window length, the file content at different sliding window positions is obtained from the starting position in the target file by moving the sliding window multiple times continuously. After obtaining the file content of the sliding window each time, the packaging length for the file content can be determined based on the data proportion of each type of data in the file content.

[0044] For example, in the file content obtained in the current sliding window, 30% of the area is text description, 60% is image data, and 10% is code snippets. Assuming that the text selection packaging length is 60 bytes, the image selection packaging length is 300 bytes, and the code selection packaging length is 600 bytes, the data packet packaging length of the file content corresponding to the current sliding window can be 60×30%+300×60%+600×10%=258 bytes. Alternatively, since the image data accounts for the highest proportion in the file content obtained in the current sliding window, 300 bytes can be used as the data packet packaging length of the file content corresponding to the current sliding window. That is, starting from the byte position D where the left window of the current sliding window is located, after obtaining 300 bytes of data and packaging them into a data packet, the left window of the current sliding window is moved to the position of D+300 bytes, and then the new file content of the sliding window length is obtained, and based on the proportion of each type of data in the new file content, the packaging length of the new data packet is determined, and so on, until the entire target file is packaged. Through the above settings, it is possible to dynamically determine the packing length of the data packet according to the arrangement of different types of data in the target file, so as to achieve the effect of data packing according to a variable packing length.

[0045] Dynamically setting the packet size according to the proportion of data types in the file content under different sliding windows and dynamically adjusting the packaging strategy according to the characteristics of the file content can ensure that the network bandwidth is more reasonably allocated to different types of data, improve network utilization, and for data types with a large number of bytes that account for a high proportion, using a larger packaging length can reduce the number of packets, thereby reducing the header overhead and improving transmission efficiency.

[0046] S140, sending the multiple data packets with different package lengths obtained by splitting to the data receiver respectively.

[0047] The technical solution of the embodiment of the present invention determines the concentrated byte number of each type of data in the target file by scanning the target file to be transmitted; determines the packing length of each type of data according to the concentrated byte number of each type of data, and sets the length of the sliding window according to the packing length of each type of data; obtains the file content at different sliding window positions from the target file multiple times based on the sliding window, and splits the target file into multiple data packets with different packing lengths according to the data proportion of each type of data in the file content; and sends the multiple data packets with different packing lengths obtained by splitting to the data receiver respectively. The packing length of each type of data and the length of the sliding window are determined by the concentrated byte number of each type of data in the target file, and the data packets are split into multiple data packets with different packing lengths according to the data proportion of each type of data in the sliding window and sent respectively, so as to realize dynamic optimization of the packet length according to the distribution of the file content, so that the same type of data with a large proportion can be packed into the same data packet, thereby improving the utilization efficiency of the data packet and the efficiency of file transmission.

[0048] Optionally, in an embodiment of the present invention, scanning the target file to be transmitted to determine the concentrated number of bytes of each type of data in the target file includes:

[0049] Obtain a binary coded file that matches the target file, and traverse and scan each binary number contained in the binary coded file;

[0050] According to the traversal scanning results, the binary coded file is divided into multiple sections in sequence, and the continuous binary numbers in each section belong to the same type;

[0051] According to the segment division result, the type corresponding to each segment and the number of segment bytes contained therein are obtained, and the number of bytes of each segment is grouped according to the type to obtain the number of bytes grouping corresponding to each type;

[0052] The concentrated presentation byte count of each type of data in the target file is determined based on the byte count of each section contained in each byte count group.

[0053] In the embodiment of the present invention, byte number grouping refers to classifying each segment of the file according to its data type and counting the total number of bytes of each type of segment.

[0054] In some file formats, data segments can be separated by specific markers or separators; different types of data (such as text, images, and code, etc.) can have unique binary characteristics. For example, text data usually follows ASCII or Unicode encoding rules and contains specific control characters, image data is identified by a specific file header, and code data can exist in a compiled binary format and contain an instruction set for a specific architecture; in a composite file format, each segment can contain a length field indicating the length of the segment. Therefore, a binary-encoded file can be divided into multiple segments in sequence by specific markers, separators, binary characteristics, or the length field of the segment. Within each segment, the binary numbers are continuous, which means that they are not interrupted by other types of data in the file. This continuity helps maintain the integrity and order of the data.

[0055] Specifically, the binary coded files matching the target file are traversed and scanned, and the file is divided into multiple segments according to the binary features of each segment in the file, each segment containing data of the same type. For each segment, the data type contained in it is identified, such as text, image, or code. The number of bytes of each segment is calculated, that is, the size of the storage space occupied by the segment in the file. The byte counts of all segments of the same type are grouped into a group, that is, the byte count group of this type. Finally, the statistical average value is calculated based on the byte counts of each segment contained in each byte count group, and the concentrated presentation byte count of each type of data in the target file is determined.

[0056] In a specific example, assuming that a file consists of three parts: text, image and code, after segmentation and type identification, the following information is obtained: text segment 1 includes 150 bytes, image segment 1 includes 3000 bytes, code segment 1 includes 500 bytes, text segment 2 includes 200 bytes, image segment 2 includes 2500 bytes and code segment 2 includes 600 words. Then, the bytes are grouped according to the type, and the concentrated bytes of each type of data in the target file are calculated: the concentrated bytes of text type = (bytes of text segment 1 + bytes of text segment 2) / 2 = (150+200) / 2 = 175 bytes; the concentrated bytes of image type = (bytes of image segment 1 + bytes of image segment 2) / 2 = (3000+2500) / 2 = 2750 bytes; the concentrated bytes of code type = (bytes of code segment 1 + bytes of code segment 2) / 2 = (500+600) / 2 = 550 bytes. Thus, we get the concentrated presentation bytes of each data type, which are 175 bytes for text, 2750 bytes for images, and 550 bytes for code.

[0057] Optionally, in an embodiment of the present invention, determining the packing length of each type of data according to the number of bytes presented in a centralized manner of each type of data includes:

[0058] The number of bytes presented in each type of data is multiplied by the preset data expansion ratio to obtain the package length of each type of data.

[0059] In an embodiment of the present invention, the preset data expansion ratio refers to a coefficient preset according to network conditions, transmission file content and system performance, which is used to adjust the packet length. The expansion ratio can be greater than 1 (indicating an increase in the packet length) or less than 1 (indicating a decrease in the packet length). By adjusting the expansion ratio, it is possible to adapt to different network conditions, such as bandwidth changes or delays. Increasing the packet length can reduce the header overhead and improve the utilization of the network bandwidth. When the network load is high, the amount of data transmitted in a single time can be reduced by reducing the expansion ratio, avoiding network congestion, and realizing dynamic adjustment of the data packet size of the packet transmission according to the transmission file content, network conditions and system performance.

[0060] In a specific example, if the concentrated presentation bytes of text data are 1000 bytes, the concentrated presentation bytes of image data are 5000 bytes, and the preset data expansion ratio is 1.2 (indicating that the packaging length is desired to be increased to improve transmission efficiency), it can be calculated that: the packaging length of text data = 1000 bytes × 1.2 = 1200 bytes, the packaging length of image data = 5000 bytes × 1.2 = 6000 bytes.

[0061] Optionally, in the embodiment of the present invention, the length of the sliding window is set according to the packing length of each type of data, including:

[0062] The minimum packing length is obtained from the packing lengths of each type of data, and the minimum packing length is used to set the length of the sliding window.

[0063] Specifically, the minimum packing length is obtained from the packing length of each type of data, and the minimum packing length is used to set the length of the sliding window. For example, if the packing length of text data is 60 bytes, image data is 300 bytes, and code data is 600 bytes, then 60 bytes can be selected as the length of the sliding window to ensure the integrity of the text data and optimize the overall transmission efficiency. By selecting the minimum packing length as the length of the sliding window, it can be ensured that each window contains a complete data type instance, avoiding the data from being cut off at the window boundary, thereby ensuring the integrity and accuracy of the data. Smaller sliding windows can adapt to changes in network conditions more quickly, such as bandwidth fluctuations or increased delays. When network conditions are poor, smaller windows can reduce retransmissions caused by packet loss and improve transmission efficiency. Different data types (such as text, images, and codes, etc.) may have different packing length requirements. Selecting the minimum packing length as the length of the sliding window can ensure that all types of data can be effectively processed in the sliding window.

[0064] Optionally, in an embodiment of the present invention, based on a sliding window, file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets of different packaging lengths according to the data proportion of each type of data in the file content, including:

[0065] Taking the position of the left window of the sliding window in the target file as the starting point, obtaining the target file content matching the length of the sliding window; wherein the left window of the sliding window is initially located at the starting position of the target file;

[0066] Calculate the data proportion of each type of data in the target file content, and obtain the target packaging length matching the target file content based on the calculation result;

[0067] Taking the position of the left window of the sliding window in the target file as the starting point, obtain the file content matching the target packaging length and package it to obtain the target data packet;

[0068] After moving the left window of the sliding window to the current packing position in the target file, return to the position of the left window of the sliding window in the target file as the starting point, and obtain the target file content that matches the length of the sliding window until the packing processing of all file contents in the target file is completed.

[0069] In the embodiment of the present invention, the target packet length refers to an expected data packet size set in order to achieve optimal network utilization, transmission efficiency and error recovery capability during data transmission. The target data packet refers to data extracted and packaged from the target file through the sliding window according to the target packet length.

[0070] Specifically, the left window of the sliding window is initialized to the starting position of the target file. Taking the position of the left window of the sliding window in the target file as the starting point, the target file content that matches the length of the sliding window is obtained, the data proportion of each type of data therein is calculated, and based on the calculation result, the target packaging length that matches the target file content is obtained.

[0071] Among them, after calculating the data proportion of each type of data in the target file content limited by the sliding window, if the data proportion of each type of data is not much different, the packing length of the new data packet is set to the weighted average of the packing lengths corresponding to each type of data in the target file content according to the data proportion; if there is a certain type of data whose data proportion is greater than the data proportion of other types of data, the packing length corresponding to this type of data is set to the packing length of the new data packet. For example, assuming that when the data proportions of two types of data differ by more than 30%, the gap is considered large, when the text part in the file presents a concentrated number of bytes of about 50 bytes, and the image and code parts present a concentrated number of bytes of about 300 bytes, and the corresponding packaging lengths of the text part, image and code parts are 100 bytes, 400 bytes and 400 bytes respectively, assuming that the calculated data proportions of each type of data in the sliding window are 30%, 40% and 30% respectively, the target packaging length matching the target file content is 100×30%+400×40%+400×30%=310 bytes; assuming that the calculated data proportions of each type of data in the sliding window are 10%, 60% and 30% respectively, since the data proportion of the image part differs by more than 30% from that of the text part, the packaging length of 400 bytes corresponding to the image part can be directly selected as the target packaging length matching the target file content.

[0072] Then, starting from the position of the left window of the sliding window in the target file, the file content matching the target packaging length is obtained for packaging to obtain the target data packet. After the left window of the sliding window is moved to the current packaging position in the target file, the operation of obtaining the target file content matching the length of the sliding window is repeated starting from the position of the left window of the moved sliding window in the target file until the packaging processing of all the file contents in the target file is completed, realizing the dynamic optimization of the packet length according to the file content distribution, and improving the utilization efficiency of the data packet and the efficiency of file transmission.

[0073] Optionally, in an embodiment of the present invention, scanning the target file to be transmitted to determine the concentrated number of bytes of each type of data in the target file specifically includes:

[0074] Scan the target file to be transferred to obtain the data ratio of each type of data in the target file;

[0075] If it is determined that the data proportion of any type of data in the target file is not higher than the preset proportion threshold, the concentrated presentation byte number of each type of data in the target file is determined.

[0076] Specifically, the preset proportion threshold refers to a standard used to determine whether the proportion of a specific type of data in the target file is significant. When the proportion of a certain type of data in the file exceeds this threshold, it indicates that the data of this type constitutes the main content of the file, and the package length corresponding to this type of data can be directly used to perform file subpackaging. If it is determined that the proportion of any type of data in the target file is not higher than the preset proportion threshold, the package length corresponding to a certain type of data cannot be directly used as the target package length, and it is still necessary to first determine the number of bytes presented in a concentrated manner for each type of data in the target file.

[0077] Furthermore, in an embodiment of the present invention, after obtaining the data proportion of each type of data in the target file, the method further includes:

[0078] If it is determined that the proportion of the target type of data in the target file is higher than a preset proportion threshold, the target file is split into multiple data packets of equal length according to the packet length matching the target type;

[0079] The multiple data packets of equal length obtained by splitting are sent to the data receiver respectively.

[0080] Specifically, if it is determined that the proportion of data of the target type in the target file is higher than the preset proportion threshold, the target file is split into multiple equal-length data packets according to the packet length that matches the target type, and sent to the data recipient separately. By selecting a packet length that matches the main content type, data transmission efficiency can be optimized, especially in an environment with limited network bandwidth. This method can improve transmission performance. At the same time, it helps maintain data integrity and prevents data loss or damage due to improper packetization operations. In addition, when most of the content of a file is of the same type, using the corresponding packet length can speed up file processing because it reduces the additional logical judgment required when processing multiple data types, thereby improving overall data processing efficiency.

[0081] In a specific example, if the preset proportion threshold is 60%, a mixed-type file contains three types of data: text, image and code, and the corresponding packaging lengths of these three types of data are 100 bytes, 400 bytes and 600 bytes respectively. The target file is analyzed. If the text data accounts for 20%, the image data accounts for 70% and the code data accounts for 10% in the target file, since the image data accounts for higher than the preset proportion threshold, the packaging length of 400 bytes corresponding to the image data proportion is used as the target packaging length, and the target file is split into multiple data packets of equal length and sent to the data recipient separately.

[0082] In addition, the file transmission control method may include:

[0083] Scan the target file to be transferred to determine the concentrated number of bytes and byte distribution density of each type of data in the target file;

[0084] Determine the packing length of each type of data according to the number of bytes presented in each type of data, and set the length of the sliding window according to the packing length of each type of data and the type of dense area where the starting position of the sliding window is located;

[0085] Based on the sliding window, the target packaging length is determined, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different packaging lengths;

[0086] The split data packets with different package lengths are sent to the data receiver respectively.

[0087] In this optional implementation manner, byte distribution density refers to the frequency distribution of different byte values ​​in a binary file. In a text file, some byte values ​​(such as letters, numbers and common punctuation marks in ASCII code) may appear more frequently, while in an image or audio file, the distribution of byte values ​​may be more uniform because they usually contain a large amount of binary data, which visually or auditorily represent continuous information. Dense area distribution refers to the area formed by the continuous appearance of certain specific types of data (such as text, images and codes, etc.) in a binary file. These areas can be identified by analyzing the byte distribution density. The distribution of dense areas can be determined by finding mutations in the byte distribution density. For example, the text area is composed of a series of dense areas with low byte distribution density, while the image area is represented by dense areas with high byte distribution density.

[0088] Specifically, the binary coded file matching the target file to be transmitted is scanned, and the position of each type of data in the target file is determined according to whether the binary numbers are continuous, and the concentrated number of bytes and byte distribution density of each type of data are calculated, where the byte distribution density of each type of data = the number of bytes of each type of data / the total number of bytes in the area.

[0089] According to the concentrated number of bytes of each type of data, the packing length of each type of data is determined, and according to the packing length of each type of data and the type of dense area where the starting position of the sliding window is located, the length of the sliding window is set. For example, if the statistical file contains text description, image data and code fragments, the concentrated number of bytes presented in the text part is about 60 bytes, the concentrated number of bytes presented in the image part is about 300 bytes, and the concentrated number of bytes presented in the code part is about 600 bytes. The corresponding packing lengths can be 60 bytes, 300 bytes and 600 bytes respectively. According to the dense area type where the starting position of the sliding window is located is the text type, the sliding window size can be set to 60 bytes.

[0090] Based on the sliding window, the target packing length can be set to the sliding window size, and the file content at different sliding window positions is obtained from the target file multiple times. The packing length of the target file corresponding to the sliding window can be set to the sliding window size, and the target file is split into multiple data packets with different packing lengths; the multiple data packets with different packing lengths obtained by splitting are sent to the data receiver respectively.

[0091] The byte distribution density is used to determine the dense area distribution of each type of data, and the target packaging length is determined according to the dense area hit by the starting position of the sliding window. This allows the packet length to be dynamically optimized based on the file content distribution, so that similar data with a large proportion can be packaged into the same data packet, thereby improving the utilization efficiency of the data packet and the efficiency of file transmission.

[0092] Specific application scenarios

[0093] Existing file transmission systems generally use fixed-length packetization algorithms. When processing files of different types and sizes, this approach is difficult to adapt to the content distribution differences of different files, resulting in each data packet being unable to reach the maximum load, which seriously limits the transmission efficiency. To this end, the present invention proposes a file transmission control method to dynamically adjust the packet length to adapt to different file characteristics.

[0094] The specific process of this method can be:

[0095] 1. Scan the files to be transferred

[0096] The content analysis module will first perform an overview scan of the binary encoded files that match the files to be transferred, and collect statistical parameters of the file content, such as the number of bytes presented in a centralized manner.

[0097] 2. Determine the threshold of document content complexity and dynamic packet length

[0098] Based on these statistical parameters, the content analysis module determines the concentrated presentation bytes of the document content, and calculates the packet length of each type of data in combination with the network load, delay and packet loss rate.

[0099] When processing files containing text, images, and code, the data packet length is adjusted according to the network load, delay rate, and packet loss rate to optimize transmission efficiency. When the network condition is good and the bandwidth is sufficient, a larger packet length is selected; when the network condition is medium, the packet length is reduced to avoid congestion; when the network load is high, the delay rate is high, and the packet loss rate is high, the packet length can be further reduced to reduce the risk of packet loss. Such a dynamic adjustment strategy helps to achieve efficient data transmission in different network environments. The number of bytes presented in each type of data is multiplied by the preset data expansion ratio to obtain the packet length of each type of data. The preset data expansion ratio can be adjusted according to the network load, delay rate, packet loss rate, and the number of bytes of the file content to be transmitted.

[0100] 3. When the file starts to be transferred, the variable length packet module will start. It will monitor the number of bytes of the file in real time and dynamically determine the appropriate packet length based on the number of data bytes in the current sliding window.

[0101] The minimum packing length is obtained from the packing length of each type of data, and the minimum packing length is used to set the length of the sliding window. The left window of the sliding window is initialized to the starting position of the target file. The position of the left window of the sliding window in the target file is used as the starting point to obtain the target file content that matches the length of the sliding window, calculate the data proportion of each type of data therein, and obtain the target packing length that matches the target file content according to the calculation result. Then, starting from the position of the left window of the sliding window in the target file, the file content that matches the target packing length is obtained for packing to obtain the target data packet. After moving the left window of the sliding window to the current packing position in the target file, the operation of obtaining the target file content that matches the length of the sliding window is repeated starting from the position of the left window of the moved sliding window in the target file until the packing processing of all the file contents in the target file is completed. The split multiple data packets of different packing lengths are sent to the data receiver respectively.

[0102] When the number of bytes presented in the centralized data is large, it will appropriately increase the packet length corresponding to the data segment to improve transmission efficiency. Otherwise, it will shorten the packet length to avoid data overflow. In network communications, each data packet has a fixed header and data payload size limit. If the data sent exceeds this limit, an overflow will occur. In addition, when processing received data, the system will allocate a certain size of memory space (buffer) for the data. If the received data packet exceeds the size of this space, the excess data will overflow into the memory space allocated to other variables.

[0103] Through this algorithm of dynamic and real-time adjustment of packet length, the variable-length packetization module makes the load of each data packet close to the maximum transmission unit, reduces the empty packet rate, fully utilizes the network bandwidth, and significantly improves the transmission efficiency.

[0104] The maximum transmission unit refers to the maximum number of bytes that can be transmitted by a single data packet in the network. By making the size of each data packet close to the maximum transmission unit, it is possible to ensure that the data packet is transmitted without fragmentation, thereby reducing network latency and improving transmission efficiency. The empty packet rate refers to the proportion of unused capacity in a data packet. By dynamically adjusting the packet size, the free space in the data packet can be reduced, thereby reducing the empty packet rate.

[0105] In addition, if it is determined that the proportion of data of the target type in the target file is higher than the preset proportion threshold, the target file is split into multiple equal-length data packets according to the packet length that matches the target type, and sent to the data recipient separately. By selecting a packet length that matches the main content type, data transmission efficiency can be optimized, especially in an environment with limited network bandwidth. This method can improve transmission performance. At the same time, it helps maintain data integrity and prevents data loss or damage due to improper packetization operations. In addition, when most of the content of a file is of the same type, using the corresponding packet length can speed up file processing because it reduces the additional logical judgment required when processing multiple data types, thereby improving overall data processing efficiency.

[0106] 4. At the receiving end, the data processing module will decode, error check and reassemble the packet data, and finally restore it to the original file data

[0107] Accordingly, in a specific example, after obtaining the file to be transmitted, the file transmission control of dynamically adjusting the packet length can be implemented in the following manner:

[0108] 1. Assume that the judgment threshold for fixed-length packaging and variable-length packaging is set to a single type of data that accounts for more than 60%. The sender performs a file overview scan and assumes that statistics show that 30% of the target file is text description, 30% is image data, and 40% is code snippets. Since the proportion of each type of data in the target file is close, and none of them exceeds 60%, at this time, the target file can be packaged and sent in a variable packaging length. Assume that the text part of the target file is concentrated in about 50 bytes, and the image and code parts are concentrated in 300-500 bytes.

[0109] 2. According to the above statistical parameters, the content analysis module presets the data expansion ratio to 2. Therefore, the packet lengths corresponding to the text part and the image or code part are 100 bytes and 400 bytes respectively.

[0110] 3. The variable length module adopts a sliding window method. The length of the sliding window is the smallest package length corresponding to each type of data in the file, that is, 100 bytes of data are taken each time for analysis and package length.

[0111] 4. Assuming that the data proportions of the two types of data in the target file content defined by the sliding window differ by more than 30%, it is considered that the difference is large. At this time, the packaging length of the type of data with the largest proportion in the target file content is selected. Otherwise, a compromise packaging length is calculated according to the proportion of each type of data in the target file content. When the data proportions of each type of data in the target file content defined by the sliding window are: text 30%, image 40% and code 30%, since the difference between the three is not large, the target packaging length matching the target file content can be set to 100×30%+400×40%+400×30%=310 bytes; assuming that the calculated data proportions of each type of data are: text 10%, image 60% and code 30%, since the data proportions of the image part differ by more than 30% from those of the text and code parts, the packaging length of 400 bytes corresponding to the image part can be directly selected as the target packaging length matching the target file content. By repeatedly performing the above operations, the target file can be packaged into multiple data packets with variable packaging lengths and sent to the data receiver respectively.

[0112] 5. Further, the sending end performs an overview scan of the file. If statistics show that 20% of the target file is text description, 70% is image data, and 10% is code snippets, and since the proportion of image data is higher than the preset proportion threshold of 60%, a preset packaging length corresponding to the image data can be obtained, for example, 300 bytes or 400 bytes, etc., as the fixed-length packaging length corresponding to the target file, the target file is split into multiple equal-length data packets according to the fixed-length packaging length, and each of them is sent to the data recipient.

[0113] 6. The sending end uses LZW encoding to compress the data packet, and the compression ratio can reach about 40%.

[0114] LZW encoding is a lossless data compression algorithm that uses repetitive patterns in data to compress data, mapping repeated strings in the input data to unique codes to achieve compression.

[0115] 7. After receiving the packet, the receiver detects the LZW encoding, loads the parameters of the LZW decoder, and decodes and expands the encoded data.

[0116] 8. After decoding, the data is checked by CRC32, and the packets that fail the check are requested to be retransmitted.

[0117] CRC32 is a widely used cyclic redundancy check algorithm that generates a 32-bit check value by treating the data as a large polynomial and then dividing it by a fixed generator polynomial. This check value can be attached to the data to detect whether errors occur during data transmission or storage.

[0118] 9. Finally, the decoded and expanded original data is reorganized according to the sequence number and identifier.

[0119] The file transmission control method proposed in the embodiment of the present invention can improve the utilization efficiency of data packets, enhance the stability of network transmission, improve the flexibility of algorithms, and improve the intelligence level of transmission strategies, which is specifically manifested as follows:

[0120] 1. Improved data packet utilization efficiency

[0121] After adopting the variable-length packetization algorithm of the embodiment of the present invention, the utilization efficiency of the data packet is improved by more than 20% compared with the fixed-length packetization. This is because the fixed algorithm cannot fully adapt to the dynamic changes in the distribution of file content, and data overflow or waste often occurs. The present invention adjusts the packet length according to the change in character density in the embodiment, so that the load of each data packet is close to the maximum transmission unit, which effectively improves the utilization efficiency of the packet.

[0122] 2. Enhanced network transmission stability

[0123] When the network load increases, the embodiment of the present invention can reduce the sub-packet length to avoid network congestion. At the same time, the packet length can be increased as needed to improve transmission efficiency. This dynamic adjustment capability can ensure the stability of file transmission in a complex network environment.

[0124] 3. Strong algorithm flexibility

[0125] Static algorithms are only applicable to specific types of files, but the embodiments of the present invention use content perception and dynamic calculation to enable variable-length algorithms to adapt to the content distribution of various types of files, greatly enhancing the universality and flexibility of the algorithm.

[0126] 4. Intelligent transmission strategy

[0127] The embodiment of the present invention conducts an in-depth analysis of the intrinsic characteristics of the file, rather than simply fixed subpackaging. This content-aware intelligent subpackaging strategy can achieve more efficient file transmission. In addition, when compressing the same type of data, the compression ratio can be relatively large. By considering the proportion of each type of data in the file to be transmitted to set the package length, the same type of data with a large proportion can be packaged into the same data packet, thereby improving the data transmission efficiency.

[0128] In summary, the embodiments of the present invention significantly improve the efficiency of data packet utilization while ensuring transmission stability, thereby greatly improving the transmission speed of file content. At the same time, the algorithm of the present invention is flexible, intelligent, and has a wider range of applications, and is an efficient and advanced file transmission technology.

[0129] Embodiment 2

[0130] Figure 2 This is a schematic diagram of the structure of a file transmission control device provided by Embodiment 2 of the present invention. Figure 2 As shown, the device includes: a centralized presentation byte number determination module 210, a sliding window length setting module 220, a target file splitting module 230 and a data packet sending module 240.

[0131] A concentrated presentation byte number determination module 210 is used to scan the target file to be transmitted and determine the concentrated presentation byte number of each type of data in the target file;

[0132] The sliding window length setting module 220 is used to determine the packing length of each type of data according to the number of bytes presented in the concentrated form of each type of data, and to set the length of the sliding window according to the packing length of each type of data;

[0133] The target file splitting module 230 is used to obtain the file contents at different sliding window positions from the target file multiple times based on the sliding window, and split the target file into multiple data packets with different packing lengths according to the data proportion of each type of data in the file content;

[0134] The data packet sending module 240 is used to send the multiple data packets with different package lengths obtained by splitting to the data receiving party respectively.

[0135] The technical solution of the embodiment of the present invention determines the concentrated byte number of each type of data in the target file by scanning the target file to be transmitted; determines the packing length of each type of data according to the concentrated byte number of each type of data, and sets the length of the sliding window according to the packing length of each type of data; obtains the file content at different sliding window positions from the target file multiple times based on the sliding window, and splits the target file into multiple data packets with different packing lengths according to the data proportion of each type of data in the file content; and sends the multiple data packets with different packing lengths obtained by splitting to the data receiver respectively. The packing length of each type of data and the length of the sliding window are determined by the concentrated byte number of each type of data in the target file, and the data packets are split into multiple data packets with different packing lengths according to the data proportion of each type of data in the sliding window and sent respectively, so as to realize dynamic optimization of the packet length according to the distribution of the file content, so that the same type of data with a large proportion can be packed into the same data packet, thereby improving the utilization efficiency of the data packet and the efficiency of file transmission.

[0136] Optionally, based on the above embodiments, a byte number determination module 210 is presented in a centralized manner, specifically used for:

[0137] Obtain a binary coded file that matches the target file, and traverse and scan each binary number contained in the binary coded file;

[0138] According to the traversal scanning results, the binary coded file is divided into multiple sections in sequence, and the continuous binary numbers in each section belong to the same type;

[0139] According to the segment division result, the type corresponding to each segment and the number of segment bytes contained therein are obtained, and the number of bytes of each segment is grouped according to the type to obtain the number of bytes grouping corresponding to each type;

[0140] The concentrated presentation byte count of each type of data in the target file is determined based on the byte count of each section contained in each byte count group.

[0141] Optionally, based on the above embodiments, the sliding window length setting module 220 is specifically used to:

[0142] The number of bytes presented in each type of data is multiplied by the preset data expansion ratio to obtain the package length of each type of data.

[0143] Further, based on the above embodiments, the sliding window length setting module 220 can also be specifically used for:

[0144] The minimum packing length is obtained from the packing lengths of each type of data, and the minimum packing length is used to set the length of the sliding window.

[0145] Optionally, based on the above embodiments, the target file splitting module 230 is specifically used for:

[0146] Taking the position of the left window of the sliding window in the target file as the starting point, obtaining the target file content matching the length of the sliding window; wherein the left window of the sliding window is initially located at the starting position of the target file;

[0147] Calculate the data proportion of each type of data in the target file content, and obtain the target packaging length matching the target file content based on the calculation result;

[0148] Taking the position of the left window of the sliding window in the target file as the starting point, obtain the file content matching the target packaging length and package it to obtain the target data packet;

[0149] After moving the left window of the sliding window to the current packing position in the target file, return to the position of the left window of the sliding window in the target file as the starting point, and obtain the target file content that matches the length of the sliding window until the packing processing of all file contents in the target file is completed.

[0150] Further, based on the above embodiments, the byte number determination module 210 is presented in a centralized manner, and can also be specifically used for:

[0151] Scan the target file to be transferred to obtain the data ratio of each type of data in the target file;

[0152] If it is determined that the data proportion of any type of data in the target file is not higher than the preset proportion threshold, the concentrated presentation byte number of each type of data in the target file is determined.

[0153] Further, based on the above embodiments, the byte number determination module 210 is presented in a centralized manner, and can also be specifically used for:

[0154] If it is determined that the proportion of the target type of data in the target file is higher than a preset proportion threshold, the target file is split into multiple data packets of equal length according to the packet length matching the target type;

[0155] The multiple data packets of equal length obtained by splitting are sent to the data receiver respectively.

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

[0157] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0158] Embodiment 3

[0159] Figure 3 A 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.

[0160] like Figure 3 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.

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

[0162] 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, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the file transmission control method, that is:

[0163] Scan the target file to be transferred to determine the concentrated number of bytes of each type of data in the target file;

[0164] Determine the packing length of each type of data according to the number of bytes presented in each type of data, and set the length of the sliding window according to the packing length of each type of data;

[0165] Based on the sliding window, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different packaging lengths according to the data proportion of each type of data in the file content;

[0166] The split data packets with different package lengths are sent to the data receiver respectively.

[0167] In some embodiments, the file transmission control method can 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 can 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 transmission control method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the file transmission control method in any other appropriate manner (for example, by means of firmware).

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

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

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

[0171] 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).

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

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

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

[0175] 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 transmission control method, characterized in that: include: Scan the target file to be transferred to determine the concentrated number of bytes of each type of data in the target file; Determine the packing length of each type of data according to the number of bytes presented in each type of data, and set the length of the sliding window according to the packing length of each type of data; Based on the sliding window, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different packaging lengths according to the data proportion of each type of data in the file content; The split data packets with different package lengths are sent to the data receiver respectively.

2. The method according to claim 1, characterized in that Scan the target file to be transferred to determine the concentrated number of bytes of each type of data in the target file, including: Obtain a binary coded file that matches the target file, and traverse and scan each binary number contained in the binary coded file; According to the traversal scanning results, the binary coded file is divided into multiple sections in sequence, and the continuous binary numbers in each section belong to the same type; According to the segment division result, the type corresponding to each segment and the number of segment bytes contained therein are obtained, and the number of bytes of each segment is grouped according to the type to obtain the number of bytes grouping corresponding to each type; The concentrated presentation byte count of each type of data in the target file is determined based on the byte count of each section contained in each byte count group.

3. The method according to claim 1, characterized in that According to the number of bytes presented in each type of data, the package length of each type of data is determined, including: The number of bytes presented in each type of data is multiplied by the preset data expansion ratio to obtain the package length of each type of data.

4. The method according to claim 1, characterized in that: According to the packing length of each type of data, set the length of the sliding window, including: The minimum packing length is obtained from the packing lengths of each type of data, and the minimum packing length is used to set the length of the sliding window.

5. The method according to any one of claims 1 to 4, characterized in that: Based on the sliding window, the file contents at different sliding window positions are obtained from the target file multiple times, and the target file is split into multiple data packets with different package lengths according to the data proportion of each type of data in the file content, including: Taking the position of the left window of the sliding window in the target file as the starting point, obtaining the target file content matching the length of the sliding window; wherein the left window of the sliding window is initially located at the starting position of the target file; Calculate the data proportion of each type of data in the target file content, and obtain the target packaging length matching the target file content based on the calculation result; Taking the position of the left window of the sliding window in the target file as the starting point, obtain the file content matching the target packaging length and package it to obtain the target data packet; After moving the left window of the sliding window to the current packing position in the target file, return to the position of the left window of the sliding window in the target file as the starting point, and obtain the target file content that matches the length of the sliding window until the packing processing of all file contents in the target file is completed.

6. The method according to claim 1, characterized in that Scan the target file to be transferred to determine the concentrated number of bytes of each type of data in the target file, including: Scan the target file to be transferred to obtain the data ratio of each type of data in the target file; If it is determined that the data proportion of any type of data in the target file is not higher than the preset proportion threshold, the concentrated presentation byte number of each type of data in the target file is determined.

7. The method according to claim 6, characterized in that After obtaining the proportion of each type of data in the target file, it also includes: If it is determined that the proportion of the target type of data in the target file is higher than a preset proportion threshold, the target file is split into multiple data packets of equal length according to the packet length matching the target type; The multiple data packets of equal length obtained by splitting are sent to the data receiver respectively.

8. A file transmission control device, characterized in that: include: A module for determining the number of bytes presented in a centralized manner is used to scan the target file to be transmitted and determine the number of bytes presented in a centralized manner for each type of data in the target file; A sliding window length setting module is used to determine the packing length of each type of data according to the number of bytes presented in the concentrated form of each type of data, and to set the length of the sliding window according to the packing length of each type of data; The target file splitting module is used to obtain the file contents at different sliding window positions from the target file multiple times based on the sliding window, and split the target file into multiple data packets with different packaging lengths according to the data proportion of each type of data in the file content; The data packet sending module is used to send the multiple data packets with different package lengths obtained by splitting to the data receiver respectively.

9. An electronic device, 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 control method according to any one of claims 1 to 7.

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

Citation Information

Cited By

  • Data packing method and device, electronic equipment, storage medium and computer program product

    CN121283571A

  • High-performance one-way transmission card based on FPGA

    CN121923721A