A file compression and transmission method, device and equipment

By accurately identifying file types and attributes and dynamically adjusting compression algorithms, the efficiency and reliability issues of file compression and transmission in existing technologies have been resolved, achieving targeted optimal compression and adaptive transmission.

CN122159888APending Publication Date: 2026-06-05CHINA MOBILE GROUP DESIGN INST +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE GROUP DESIGN INST
Filing Date
2026-02-02
Publication Date
2026-06-05

Smart Images

  • Figure CN122159888A_ABST
    Figure CN122159888A_ABST
Patent Text Reader

Abstract

The application relates to a file compression and transmission method, device and equipment, and belongs to the technical field of data compression. The method comprises the following steps: analyzing an obtained to-be-compressed file, identifying the file type and at least one file attribute of the to-be-compressed file; dynamically selecting a target compression algorithm from a preset compression algorithm library according to the identified file type and the at least one file attribute, and dynamically matching and adjusting the compression parameters of the target compression algorithm based on the specific value of the at least one file attribute; compressing the to-be-compressed file based on the target compression algorithm and the adjusted compression parameters to generate a compressed file, and adaptively completing the transmission of the compressed file based on the network state of a target receiving end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of file compression technology, and in particular to a file compression and transmission method, apparatus and device. Background Technology

[0002] File compression and transmission technologies are among the key supporting technologies in modern information technology fields such as cloud computing, big data, and edge computing. Efficient file compression can significantly reduce data volume, saving storage space and network bandwidth, while reliable file transmission is the foundation for achieving rapid data sharing and business collaboration. With the explosive growth of enterprise data and the increasingly urgent need of individual users for efficient cross-device transfer of multi-format files, developing an integrated compression and transmission solution capable of intelligently and adaptively handling any type of file has become an important technological direction for improving data processing efficiency and user experience.

[0003] Existing technologies mainly fall into two categories: one is a combination of general-purpose tools (such as ZIP and RAR) using fixed compression algorithms and standard transmission protocols (such as FTP and TCP). Users need to manually select compression and transfer, a cumbersome process lacking targeted optimization. The other category is limited automatic compression functions provided by some cloud services, which typically only trigger preset compression processes for specific file types (such as text and images) and sizes. However, their compression strategies are fixed and lack the ability to analyze and dynamically adapt to deep file characteristics. In addition, there are also dedicated solutions for customized compression of specific file formats (such as FPGA binary files), but these solutions are highly specialized, and their identification and processing methods cannot be applied to a wide range of unknown file types.

[0004] In summary, existing technologies suffer from the following core shortcomings: First, in the compression stage, they lack the ability to accurately and intelligently identify diverse file types and adapt corresponding dynamic compression strategies. They cannot select the optimal algorithm and adjust parameters in real time based on the unique data structures and redundancy characteristics of different files such as text, images, and videos, making it difficult to achieve an optimal balance between compression efficiency and file quality. Second, in the transmission stage, they lack an adaptive decision-making mechanism based on the actual network environment and device performance of the target receiver. This makes it difficult to intelligently select transmission protocols and dynamically adjust transmission behavior under complex and changing network conditions (such as high and low bandwidth, stable and fluctuating networks), affecting the overall efficiency and reliability of transmission. These shortcomings collectively render existing solutions inadequate for meeting users' urgent needs for efficient, seamless, and high-quality file processing and transmission, especially in complex scenarios such as mobile and edge computing, when dealing with massive amounts of heterogeneous files. Summary of the Invention

[0005] This application provides a file compression and transmission method, apparatus, and device to solve the technical problems in the prior art where the use of a fixed compression strategy cannot achieve the optimal compression effect, and where the use of a fixed transmission strategy makes it difficult to guarantee efficient and reliable transmission under different network conditions.

[0006] This application provides a file compression and transmission method, including: The obtained file to be compressed is analyzed to identify the file type and at least one file attribute of the file to be compressed; Based on the identified file type and at least one file attribute, a target compression algorithm is dynamically selected from a preset compression algorithm library, and the compression parameters of the target compression algorithm are dynamically matched and adjusted based on the specific value of the at least one file attribute. Based on the target compression algorithm and the adjusted compression parameters, the file to be compressed is compressed to generate a compressed file, and the transmission of the compressed file is adaptively completed based on the network status of the target receiving end.

[0007] This application also provides a file compression and transmission device, including: The identification module is used to analyze the acquired file to be compressed and identify the file type and at least one file attribute of the file to be compressed. The adjustment module is used to dynamically select a target compression algorithm from a preset compression algorithm library based on the identified file type and the at least one file attribute, and to dynamically match and adjust the compression parameters of the target compression algorithm based on the specific value of the at least one file attribute. The compression and transmission module is used to compress the file to be compressed based on the target compression algorithm and the adjusted compression parameters to generate a compressed file, and to adaptively complete the transmission of the compressed file based on the network status of the target receiving end.

[0008] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. The processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps in the file compression and transmission method provided in this application.

[0009] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the file compression and transmission method provided in this application.

[0010] This application also provides a computer program product that stores instructions that, when executed by a computer, cause the computer to perform the steps in the file compression and transmission method provided in this application.

[0011] The beneficial effects of this application's embodiments are as follows: By analyzing the file to be compressed, its file type and the specific value of at least one file attribute are identified, which serves as the basis for dynamically matching and adjusting the compression algorithm parameters. This invention achieves fine-grained adaptation of the algorithm and parameters through the specific values ​​of file attributes, thereby providing targeted and optimal compression schemes for files with different data characteristics, significantly improving compression efficiency and effect. Simultaneously, transmission is adaptively completed based on the network status of the target receiving end, enabling efficient and reliable file transmission under various network conditions. Attached Figure Description

[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a file compression and transmission method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a file compression and transmission device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] The following is a description of the terms used in this application: Cloud computing is a service model that provides, uses, and delivers computing resources (such as servers, storage, networks, software, analytics, etc.) on demand via the Internet. It allows users to easily obtain configurable resources from a shared pool of resources without having to manage or maintain complex underlying infrastructure, thereby achieving high availability, high scalability, and cost-effectiveness through pay-as-you-go pricing.

[0015] Edge computing is a computing paradigm that migrates data processing, storage, and applications from centralized cloud data centers to network edge nodes closer to data sources or end users. Its core purpose is to reduce data transmission latency, save bandwidth, improve response speed, and is suitable for latency-sensitive scenarios such as the Internet of Things and real-time analytics.

[0016] IT support refers to the collective term for the underlying technical infrastructure, platforms, and services that provide support for an enterprise's business operations, management decisions, and customer service. It includes, but is not limited to, network communication, data centers, servers, storage systems, database management, and the development and maintenance of various application software. It is the technological foundation for ensuring smooth information flow and business continuity within an enterprise.

[0017] File type identification is a technique that determines a file's format (such as a JPEG image or a PDF document) by analyzing its internal characteristics (such as the "magic number" of a specific byte sequence in the file header), external characteristics (such as the file extension), and data content patterns. Accurate identification is a prerequisite for subsequent format-specific processing (such as targeted compression).

[0018] The file header information typically refers to a specific sequence of bytes located at the beginning of a file. It contains key metadata defining the file format, version, structure, encoding method, etc. For example, the header of a PNG image file contains a signature identifying it as a PNG format, image dimensions, and color depth. Analyzing the header is one of the most reliable methods for identifying file types.

[0019] Lossless compression algorithms are data compression techniques whose compression process is completely reversible. After decompression, the recovered data is completely identical to the original data at the bit level, with no information loss. These algorithms are often used in scenarios where any data loss is unacceptable, such as text, source code, and databases. Typical examples include DEFLATE (ZIP), LZ77, and Huffman coding.

[0020] Lossy compression algorithms are a data compression technique that achieves higher compression ratios by selectively discarding information that is not perceptible to the human eye or ear. The compression process is irreversible, and the decompressed data is an approximation of the original data. These algorithms are widely used for multimedia data such as images (e.g., JPEG), audio (e.g., MP3), and video (e.g., H.264), significantly reducing file size while maintaining subjective quality.

[0021] Huffman coding is a classic lossless data compression coding method. Its core idea is to construct a binary code table of varying lengths based on the frequency of occurrence of each symbol (such as a character) in the source data. Symbols with high frequency of occurrence are assigned shorter codewords, and symbols with low frequency of occurrence are assigned longer codewords, thereby minimizing the total length of the encoded data sequence.

[0022] The DEFLATE algorithm is a widely used lossless data compression algorithm and the foundation of the ZIP file format and Gzip compression tool. It combines the LZ77 algorithm (which finds and replaces duplicate strings using a sliding window) and Huffman coding (which efficiently encodes processed symbols), achieving a good balance between compression ratio and speed.

[0023] The LZ77 algorithm is a dictionary-based lossless compression algorithm. It uses a sliding window to find the longest substring in the processed data that matches the data to be encoded, and replaces this substring with a triple (distance, length, next character), thus eliminating duplicate data. This algorithm is a core component of many modern compression techniques, such as DEFLATE.

[0024] Frame rate refers to the number of frames of images displayed per second in a video, measured in FPS. It is a key metric for measuring video smoothness. For example, 25 FPS means 25 images are played per second. A higher frame rate generally means smoother motion, but it also means more data and higher compression requirements.

[0025] Multithreading is a concurrent programming technique that allows a single program or process to execute multiple computational tasks (threads) simultaneously. In compression scenarios, the task of compressing a large file or processing a batch of files can be broken down into multiple subtasks and distributed to different threads for parallel execution, thereby fully utilizing the computing power of multi-core CPUs and significantly reducing the overall processing time.

[0026] Hardware acceleration refers to the technique of offloading specific computationally intensive tasks (such as video encoding, graphics rendering, and cryptographic operations) from general-purpose processors (CPUs) to hardware specifically designed for these tasks (such as GPUs, FPGAs, and ASICs). It can significantly improve task execution speed and energy efficiency. For example, the parallel computing architecture of GPUs can be used to accelerate video compression algorithms.

[0027] FIFO stands for "First-In, First-Out," a classic data structure management and resource scheduling strategy. Under this strategy, the data item that enters the queue first will be processed or removed first. In cache management, FIFO means that when the cache space is full, the earliest stored data will be evicted to make room for new data.

[0028] LRU stands for "Least Recently Used," a cache replacement algorithm. Its core idea is that when cache space is insufficient, it prioritizes evicting data items that have not been accessed for the longest time. This strategy is based on the "locality principle," assuming that recently used data is more likely to be used again in the future, thus making more efficient use of cache space and improving cache hit rate.

[0029] A transport protocol is a set of rules and standards that define how data is packaged, addressed, transmitted, routed, and received in a computer network. It ensures reliable or efficient communication between different devices. Common protocols include the connection-oriented TCP protocol, which provides reliable transmission, and the connectionless UDP protocol, which focuses on efficient transmission.

[0030] TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. After a connection is established between the communicating parties, data transmission occurs. Mechanisms such as acknowledgment, timeout retransmission, flow control, and congestion control ensure that data packets arrive at the receiving end in order, without errors, loss, or duplication. It is suitable for applications requiring high reliability, such as file transfer and web browsing.

[0031] UDP is a connectionless, unreliable transport layer protocol. It does not guarantee the order, reliability, or non-duplication of data packets, but therefore has low overhead and low latency. UDP is suitable for scenarios with high real-time requirements but where a small amount of data loss is acceptable, such as real-time audio and video streaming, online games, and DNS queries. In this proposal, its reliability can be enhanced by adding retransmission and error correction mechanisms at a higher layer.

[0032] Packet retransmission is a mechanism used in network communication to ensure data reliability. When a sender transmits a data packet, if it does not receive an acknowledgment from the receiver within a specified time, or receives feedback from the receiver that the packet is lost or corrupted, the sender will retransmit the packet. This is the foundation of reliable protocols such as TCP and can also be applied to build reliable transmission over UDP.

[0033] Error correction coding is a technique that achieves error control by adding redundant check information (checksums) to the data to be transmitted. The receiver can use this redundancy to not only detect errors that occur during transmission, but also automatically correct these errors as long as the number of errors does not exceed the encoding / decoding capacity. This allows the original data to be recovered without requesting retransmission, thus improving transmission efficiency.

[0034] As described in the background section, target file compression and transmission technologies are mainly divided into two categories. Specifically, the first category is the traditional method based on standard protocols and general-purpose compression tools. Users typically use protocols such as FTP and HTTP for file transfer and manually process the files before transfer using general-purpose compression tools such as ZIP and RAR. Although these tools (such as ZIP using the DEFLATE algorithm) are widespread, they employ fixed compression algorithms or limited preset compression levels, making it impossible to deeply optimize for the data structure characteristics of different types of files. For example, high-frequency words in text files, spatial redundancy in image files, and temporal redundancy in video files each require drastically different compression algorithms and parameters, making it difficult to achieve the optimal compression ratio using general-purpose compression methods.

[0035] The second category comprises improved solutions with basic automation capabilities, but still with significant limitations. For example, some cloud storage services offer limited automatic file compression functionality. Typically, when an uploaded file is detected to be of a specific type (such as text or images) and its size exceeds a threshold, a pre-defined, fixed compression process is triggered. However, this type of solution suffers from the following prominent problems: First, it has narrow file type adaptability, usually supporting only a few common formats, and cannot recognize or process professional or special formats. Second, its compression strategy is rigid, using the same compression algorithm and intensity regardless of the specific characteristics of the file content (such as high-resolution versus low-resolution images, complex versus simple documents), resulting in poor compression performance—either a low compression ratio or unnecessary quality loss for lossy compressed files.

[0036] Furthermore, in the file transfer process, existing technologies mostly employ fixed transmission protocols (such as TCP), lacking the ability to perceive and adapt to dynamic network environments and heterogeneous receiving devices. In mobile networks or edge computing scenarios with limited bandwidth and fluctuating latency, fixed transmission strategies can easily lead to low transmission efficiency and excessively long processing times, affecting user experience.

[0037] A closer prior art (such as Chinese patent document CN106202213A) discloses a dedicated compression method for FPGA binary files. This method improves compression efficiency by analyzing the data area types within the FPGA file and applying different encoding methods to different areas. However, this technical solution is highly specialized; its file type identification logic and encoding method library are designed for the inherent structure of FPGA binary files and cannot be directly applied to or extended to intelligent compression of any type of general-purpose file (such as documents, images, videos, audio, etc.). Essentially, it is a static optimization for a single specific file format, rather than a dynamic adaptive system for diverse and unknown file types.

[0038] In summary, existing technologies generally suffer from the following shortcomings: (1) In the compression stage, they lack the ability to accurately identify any file type and adapt to dynamic compression strategies, making it difficult to achieve both compression efficiency and versatility; (2) In the transmission stage, they lack intelligent protocol selection and dynamic control mechanisms based on the network conditions and device performance of the receiving end, resulting in insufficient transmission robustness. This makes it difficult for existing solutions to meet users' higher requirements for efficiency, quality, and experience when dealing with massive, heterogeneous files, especially when performing efficient compression and transmission in complex network environments.

[0039] To address the aforementioned problems in related technologies, embodiments of this application provide a file compression and transmission method, apparatus, and device. This method analyzes an acquired file to be compressed, identifying its file type and at least one file attribute. Based on the identified file type and the at least one file attribute, it dynamically selects a target compression algorithm from a preset compression algorithm library and dynamically adjusts the compression parameters of the target compression algorithm based on the specific values ​​of the at least one file attribute. Then, based on the target compression algorithm and the adjusted compression parameters, it compresses the file to generate a compressed file and adaptively completes the transmission of the compressed file based on the network status of the target receiving end. By analyzing the file to be compressed and identifying its file type and the specific values ​​of at least one file attribute, this method provides the basis for dynamically adjusting the compression algorithm parameters. This invention achieves fine-grained adaptation of the algorithm and parameters through the specific values ​​of file attributes, thereby providing targeted and optimal compression schemes for files with different data characteristics, significantly improving compression efficiency and effect. Simultaneously, the adaptive transmission based on the network status of the target receiving end ensures efficient and reliable file transmission under various network conditions.

[0040] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0041] Figure 1 This is a schematic flowchart illustrating a file compression and transmission method provided for an exemplary embodiment of this application. Figure 1 As shown, the method includes: Step 110: Analyze the obtained file to be compressed to identify the file type and at least one file attribute of the file to be compressed.

[0042] This process involves multi-dimensional in-depth analysis of the acquired files to be compressed. This includes not only identifying their macro-level file types (such as text, images, and videos), but more importantly, extracting their micro-level data content features directly related to compression potential—namely, file attributes. File attributes are a set of parameters used to describe a file's technical characteristics, content features, or application requirements. These attributes transcend basic type classifications, providing the quantitative or qualitative basis needed for compression algorithm decisions. For example, for an image file, attributes might include resolution (e.g., 1920x1080 pixels), color depth (e.g., 24-bit true color), and detail richness (which can be evaluated through gradient analysis); for a video file, attributes might include frame rate (e.g., 30 FPS), resolution, and scene switching frequency. This step comprehensively analyzes file header information, verifies file extensions, and, most importantly, extracts these attributes by directly analyzing the file data content. This completes the intelligent perception from file recognition to feature extraction, laying the foundation for subsequent accurate compression decisions.

[0043] Step 110 is the perception and identification stage of the entire intelligent compression process. Its purpose is to accurately obtain the type and attributes of the file through a comprehensive, multi-dimensional analysis. This process first relies on the file's inherent identification information (header, extension) for rapid initial screening and classification, then delves into the data to uncover quantitative features that can guide in-depth optimization. This combination of multi-dimensional analysis ensures the accuracy and robustness of the identification, providing a reliable basis for subsequent intelligent decision-making.

[0044] In some exemplary embodiments, the acquired file to be compressed is analyzed, including: The process involves parsing the header information of the file to be compressed, verifying the file extension, and extracting the data features of the file.

[0045] Data features refer to characteristic values ​​obtained through mathematical or statistical analysis of the original file data, reflecting its inherent patterns or distribution patterns, such as text word frequencies and image pixel gradients. These are specific technical means for extracting and quantifying file attributes. For example, for text files, one can analyze their word frequency distribution and the length of repeated strings; for images, one can analyze their pixel value statistical histograms or spatial frequency components. These features can more accurately reveal the redundancy of the file at the data level, thereby guiding the precise matching of compression parameters.

[0046] Since each standard file format typically has a specific, conventional binary identifier at the beginning of the file (file header), this application's embodiments, based on this, can accurately determine the file format by reading and matching these predefined byte sequences. This method is unaffected by the filename and has high accuracy. For example, for common file types such as .docx files, their file headers have specific binary identifiers; for .jpg image files, their file headers contain specific encodings of key information such as the image format and resolution. Matching these identifiers allows for rapid identification.

[0047] File extensions (such as .txt, .jpg, .mp4) are intuitive conventions between users and operating systems for file types. Checking the extension allows for a preliminary file classification in a very short time. However, this method is susceptible to modification or spoofing by users, so it is usually not used as the sole criterion. Instead, it is used in conjunction with header parsing to improve overall recognition efficiency and serve as secondary verification. Furthermore, combining file extensions with other methods enhances the accuracy of the identification process.

[0048] Extracting data features from a file to be compressed can be done without relying on external identifiers. Instead, it can involve directly reading part or all of the file's content and using specific algorithms (such as statistical analysis, pattern recognition, and signal analysis) to calculate quantitative indicators reflecting its internal structural patterns. These features directly correspond to the potential and challenges of compression. For text files, the file type identification module can statistically analyze the repetition of characters (extracting data features: repetitive string features). For image files, it can analyze image resolution, color depth, and the richness of image detail (extracting file attributes). For video files, it can analyze frame rate, resolution, scene transition frequency, etc. (extracting file attributes).

[0049] In some exemplary embodiments, the acquired file to be compressed is analyzed, including a combination of one or more of the following methods: (1) Parsing the header information of the file to be compressed: Each standard file format usually has a specific binary identifier ("magic number") at the beginning. By reading and matching these predefined byte sequences, the file format can be accurately determined. For example, .docx files have a specific file header binary identifier; the file header of .jpg image files contains specific encodings of key information such as image format and resolution. This identifier can be matched for quick identification.

[0050] (2) Verify the file extension of the file to be compressed: The file extension (such as .txt, .mp4) provides an intuitive indication of the file type. This method is fast and efficient, but as an auxiliary means, it is usually used in conjunction with header parsing to improve recognition efficiency and serve as a secondary verification, thereby enhancing the overall recognition accuracy.

[0051] (3) Extracting data features of the file to be compressed: This method directly analyzes the file content to obtain quantitative attributes that guide compression. This is the core of achieving intelligent dynamic adaptation. Specifically: For text files, their data characteristics can be analyzed, such as counting the repetition of characters to obtain features like the length of repeated strings. For image files, their file attributes can be analyzed, such as resolution, color depth, and detail richness (which can be obtained by analyzing data features like pixel gradients). For video files, their file attributes can be analyzed, such as frame rate, resolution, and scene transition frequency.

[0052] For example, in a specific implementation scenario, the file type identification process may include: first, reading the file header information for matching; if the match is successful, directly outputting the file type; if the match fails or further confirmation is needed, verifying the file extension; finally, combining statistical analysis of file data samples (such as statistically analyzing character repetition patterns in text files) to comprehensively determine the file type and attributes, ensuring the robustness of the identification results. For text files, the extracted data features specifically include statistically analyzing the frequency and length of repeated characters or strings, providing key attribute values ​​such as the length of repeated strings for subsequent compression algorithms.

[0053] Step 120: Based on the identified file type and at least one file attribute, dynamically select a target compression algorithm from a preset compression algorithm library, and dynamically match and adjust the compression parameters of the target compression algorithm based on the specific value of at least one file attribute.

[0054] This step is the core manifestation of the intelligence of the method provided in this application embodiment. Based on the specific values ​​of the file attributes extracted in step 110, it performs two levels of dynamic decision-making to tailor a compression scheme for the current file: 1. Dynamic optimization within the algorithm library: From a pre-defined library of compression algorithms covering lossless / lossy and various scenarios such as text / image / video, the most suitable target compression algorithm is dynamically selected based on file type and attribute characteristics. For example, Huffman coding is selected for text that needs to be preserved losslessly, while JPEG lossy compression is selected for images used for web page previews.

[0055] 2. Dynamic Matching of Parameter Space: After selecting an algorithm, the optimal set of compression parameters is dynamically matched and adjusted within the parameter space of the target algorithm based on the specific values ​​of file attributes (such as the specific number of pixels at resolution and the specific statistical histogram of word frequencies). For example, the JPEG quantization table (Quality Factor) is adjusted based on the specific indicators of image detail richness, and the keyframe interval (GOP size) of H.264 encoding is dynamically set based on the specific frequency of video scene switching. The entire process realizes the transformation from a fixed strategy to a case-specific approach; the compression strategy (algorithm and parameters) is synthesized in real time based on the unique content characteristics of each file.

[0056] The pre-defined compression algorithm library refers to a collection of compression algorithms pre-generated and stored in the system, optimized for different data types and scenarios. For example, it may include Huffman coding and DEFLATE for text, PNG and JPEG algorithms for images, and H.264 and H.265 encoders for video.

[0057] Dynamic matching and adjustment, after selecting a base algorithm, involves tailoring an optimal set of compression parameters for the current file based on its specific file attributes (e.g., resolution 1080p instead of 720p) and within the algorithm's allowed parameter space, using predefined rules or models (e.g., lookup tables, formulas, or machine learning models). This process combines matching (finding the corresponding parameter set based on attribute values) and adjustment (applying that parameter set).

[0058] More specifically, based on the specific value of at least one file attribute, the compression parameters of the target compression algorithm are dynamically matched and adjusted, including: When the file type is a text file, the target compression algorithm is a lossless compression algorithm, and the encoding parameters are matched and adjusted based on the word frequency distribution or the length of repeated strings in the text. When the file type is an image file, a lossless compression algorithm or a lossy compression algorithm is selected based on the usage scenario, and the quantization parameters are matched and adjusted based on at least one of the image resolution, color depth, detail richness, file size and image quality requirements. When the file type is a video file, the target compression algorithm is a video hybrid coding algorithm based on the content of the original video and inter-frame prediction, and adjusts the keyframe interval and coding block size parameters based on at least one of the video's frame rate, resolution, scene switching frequency and content complexity.

[0059] The application scenarios may include, but are not limited to: images used for online preview can be selected with lossy algorithms (such as JPEG) with a higher compression ratio for fast loading; images used for professional archiving or printing should be selected with lossless algorithms (such as PNG) to retain all details; when mobile device storage space is limited, algorithms with a higher compression ratio can be given priority with acceptable quality loss.

[0060] The principle behind video coding algorithms based on inter-frame prediction is that adjacent frames in a video sequence typically have a high degree of similarity (temporal redundancy). These algorithms (such as H.264 / AVC and H.265 / HEVC) first encode a complete keyframe. Then, for subsequent predicted frames, they do not directly encode all pixels, but rather encode the differences (motion vectors and residuals) between the predicted frame and the previous frame (or frames before and after). This greatly eliminates temporal redundancy and achieves a high compression ratio.

[0061] For text files, the core redundancy lies in the repetition of characters / words. Lossless compression algorithms eliminate this statistical redundancy by constructing a more efficient encoding table, and their adjustments are based on specific statistical characteristics. Specifically, the intelligent compression algorithm selection and parameter adjustment module selects a suitable lossless compression algorithm based on the character repetition statistics obtained from the file type identification module, such as Huffman coding, the DEFLATE algorithm, the LZ77 algorithm, and its variants. Regarding parameter adjustment, it analyzes features such as word frequency distribution and the length of repeated strings in the text file. If certain words appear with extremely high frequency in the text, the compression intensity for these high-frequency words is appropriately increased (matching and adjusting encoding parameters: for example, assigning shorter Huffman codewords to high-frequency words); for texts with a large number of long repeated strings, parameters such as the sliding window size are adjusted to better capture and compress the repetitive information.

[0062] For example, if the analysis finds that the frequency of the word "the" in a text file exceeds 5%, then the shortest Huffman codeword is assigned to it; if the average length of repeated strings exceeds 20 characters, then the sliding window size of the LZ77 algorithm is set to 32KB to optimize the compression efficiency of long repeated sequences.

[0063] For image files, image compression requires a trade-off between fidelity and compression ratio. Algorithm selection (lossless / lossy) and parameter adjustment (quantization intensity) are highly dependent on the image content and usage scenario. Therefore, a suitable compression algorithm can be selected based on factors such as user scenario, image quality requirements, file size limitations, and specific usage objectives. By comprehensively analyzing various image attributes, a more intelligent balance between compression ratio and visual quality can be achieved, enabling content-based adaptive compression. For example, lossless PNG compression uses the DEFLATE algorithm; lossy JPEG compression employs a compression algorithm based on discrete cosine transform. When adjusting parameters, factors such as image resolution, color depth, and detail richness are analyzed. For high-resolution and detail-rich images, while ensuring visual acceptableness, the precision of the quantization table can be appropriately reduced to increase the compression ratio (matching and adjusting quantization parameters); for images with a single color, the encoding redundancy of color channels is reduced.

[0064] For example, for a landscape photo with a resolution of 3840x2160 (4K) and rich details, when using the JPEG algorithm, its quality factor can be dynamically adjusted to 85 (range 1-100) to achieve a high compression ratio while maintaining good visual quality; for a logo image with fewer than 256 colors, lossless PNG compression is preferred, and color palette optimization parameters may be enabled.

[0065] For video files, due to the highest complexity in video compression, both spatial redundancy (within a single frame) and temporal redundancy (between frames) must be handled simultaneously. Keyframe interval and code block size are key parameters for balancing compression efficiency, quality, and smoothness. This application addresses this by selecting a suitable compression algorithm based on identified information and a comprehensive consideration of factors such as video quality, compression ratio, and compatibility. For example, compression algorithms from video coding standards like H.264 or H.265 (video coding algorithms based on inter-frame prediction) can be used. During parameter adjustment, the video's frame rate, resolution, and scene switching frequency are analyzed. For videos with high frame rates and frequent scene switching, the keyframe interval is increased, and redundant information encoding in non-keyframes is reduced (matching keyframe interval adjustment); for videos with low resolution, the code block size is appropriately reduced to improve coding efficiency (matching code block size parameter adjustment). By analyzing video scene switching and content complexity in real time, intelligent decisions on coding parameters can be made, achieving content- and scene-oriented adaptive and efficient coding. For example, for a game recording with a frame rate of 60fps and a large number of fast camera transitions, the keyframe interval (GOP size) of H.264 encoding is set to a shorter 30 frames to ensure image quality after scene transitions; for a static speech video with a resolution of 1280x720, the encoding block size can be adjusted to 16x16 to improve encoding speed.

[0066] Step 120 receives the file type and attribute information provided in step 110 and performs two key decisions: dynamically selecting the most suitable target compression algorithm from a preset compression algorithm library, and dynamically matching and adjusting the parameters of the algorithm based on the specific values ​​of the file attributes. The preset compression algorithm library refers to a collection of various compression algorithms pre-integrated into the system; dynamic matching and adjustment refers to the process of generating customized compression parameters for the current file based on specific attribute values ​​through rules or models.

[0067] More specifically, based on the specific value of at least one file attribute, the compression parameters of the target compression algorithm are dynamically matched and adjusted, including: (1) When the file type is a text file: The target compression algorithm is selected as a lossless compression algorithm, such as Huffman coding, DEFLATE algorithm, or LZ77 algorithm and its variants. Parameter adjustment is based on specific attributes of the text, such as word frequency distribution or the length of repeated strings, for matching and adjustment. For example, shorter codewords are assigned to high-frequency words to improve the compression ratio; the sliding window size of the LZ77 algorithm is adjusted according to the length characteristics of repeated strings to more effectively capture and compress long repetition patterns.

[0068] (2) When the file type is an image file: First, select a lossless compression algorithm (such as PNG) or a lossy compression algorithm (such as JPEG) based on the usage scenario (such as fidelity requirements and file size limitations). Then, adjust the quantization parameters according to the image's resolution, color depth, and / or detail richness. For example, for high-resolution, detail-rich images, moderately increase the quantization intensity to improve the compression ratio while ensuring subjective quality; for images with a single color, reduce the allocation of coding bits for color channels.

[0069] (3) When the file type is a video file: The target compression algorithm is selected as a video coding algorithm based on inter-frame prediction, such as H.264 or H.265 encoder. Parameter adjustment is based on attributes such as video frame rate, resolution, and / or scene switching frequency. For example, for high frame rate videos with frequent scene switching, the keyframe interval is dynamically increased to reduce the proportion of keyframes (frames with large data volume); for lower resolution videos, a smaller coding block size is adapted to improve coding efficiency and image quality at that resolution.

[0070] Step 130: Based on the target compression algorithm and the adjusted compression parameters, the file to be compressed is compressed to generate a compressed file, and the transmission of the compressed file is completed adaptively based on the network status of the target receiving end.

[0071] Based on the proprietary compression strategy dynamically synthesized in step 120, the file to be compressed is efficiently compressed to generate a compressed file. This process can utilize technologies such as multithreading and hardware acceleration to optimize performance. Subsequently, based on intelligent awareness of the target receiver's network status (such as bandwidth and latency) and device performance, the transmission protocol (such as TCP / UDP) is adaptively selected, and the transmission rate and number of concurrent threads are dynamically adjusted during transmission to ensure that the compressed file can be transmitted efficiently and reliably in various network environments.

[0072] In some exemplary embodiments, to address the computational efficiency bottleneck of the compression process itself, the file to be compressed is compressed, including: By using multithreading technology, the compression task of the file to be compressed is split into multiple subtasks and executed in parallel; During the execution of the compression task, hardware acceleration technology is used to execute the target compression algorithm.

[0073] For example, multithreading and hardware acceleration techniques can be used to improve compression efficiency during the compression process. For large or batch file compression tasks, they can be divided into multiple subtasks and processed in parallel across multiple threads. Simultaneously, the multi-core performance of the CPU and the parallel computing power of the GPU (if hardware supports it) can be utilized to accelerate the execution of the compression algorithm. For instance, when compressing high-definition video files, the powerful floating-point arithmetic capabilities of the GPU can be leveraged to accelerate the video encoding process, significantly reducing compression time.

[0074] For example, when processing H.265 encoded high-definition or 4K video compression, the system detects the availability of the GPU. If available, computationally intensive tasks such as motion estimation and discrete cosine transform in the encoding process are offloaded to the GPU for parallel acceleration, thereby reducing the compression time to a fraction of that of pure CPU processing.

[0075] In some exemplary embodiments, the method provided in this application further includes: Allocate a cache space in memory to store intermediate data during the compression process; The cache space is managed using either First-In-First-Out (FIFO) or Least Recently Used (LRU) algorithms.

[0076] The cache is a key component that coordinates the speed difference between a high-speed processor and relatively slow memory (such as a disk). In compression processing, proper cache management can significantly reduce I / O latency and improve overall system throughput.

[0077] Specifically, a cache space of a certain size is allocated in memory to temporarily store file data that is being compressed or about to be compressed, as well as intermediate results during the compression process. The caching module uses a First-In-First-Out (FIFO) or Least Recently Used (LRU) algorithm to manage cached data, ensuring efficient cache utilization and fast data read and write. For example, when processing the compression of a large number of small files, the caching module can effectively reduce frequent read and write operations between disk and memory, improving overall system performance.

[0078] This caching mechanism is particularly effective when processing batch compression of albums consisting of hundreds of images. It keeps frequently accessed image data in memory, avoiding repeated reads from storage devices and significantly improving the overall throughput of the processing flow.

[0079] In some exemplary embodiments, before transmission begins, a basic protocol framework can be selected for this transmission session based on an assessment of the receiver's capabilities and network environment. Specifically, the transmission of compressed files is adaptively completed based on the network status of the target receiver, including: Obtain network environment information and device performance information of the target receiving end; Based on network environment information and device performance information, the system adaptively selects the initial transmission protocol to complete the transmission of compressed files.

[0080] Specifically, the transmission module first selects a suitable transmission protocol based on the network environment and device performance of the target receiver. If the target is in a low-bandwidth, high-latency network environment and has low device performance, the UDP protocol is preferred for transmission, and mechanisms such as packet retransmission and error correction coding are used to ensure the reliability of transmission; if the network environment is stable and the bandwidth is sufficient, and the target device has good performance, the TCP protocol is selected for reliable transmission.

[0081] In some exemplary embodiments, before transmission begins, a basic protocol framework is selected for this transmission session based on an assessment of the receiver's capabilities and the network environment. Specifically, based on network environment information and device performance information, an initial transmission protocol is adaptively selected for the transmission, including: If the network environment information indicates a low bandwidth, high latency environment, and / or the device performance information indicates that the performance is lower than a preset threshold, then User Datagram Protocol (UDP) is selected as the initial transport protocol, and packet retransmission and / or error correction coding mechanisms are enabled. If the network environment information indicates a stable, high-bandwidth environment, and the device performance information indicates good performance, then the Transmission Control Protocol (TCP) is selected as the initial transmission protocol.

[0082] Specifically, the appropriate transmission protocol should first be selected based on the network environment and device performance of the target receiving end. If the target end is in a low-bandwidth, high-latency network environment and the device performance is low, the UDP protocol should be selected for transmission, and mechanisms such as packet retransmission and error correction coding should be used to ensure the reliability of transmission; if the network environment is stable and the bandwidth is sufficient, and the target end device performance is good, the TCP protocol should be selected for reliable transmission.

[0083] In some exemplary embodiments, during transmission, the transmission of compressed files can be adaptively completed based on real-time feedback of network conditions (such as packet loss rate and latency changes), dynamic conditional transmission rate, and number of concurrent threads. Specifically, this also includes: During the transmission process using the initial transmission protocol, the transmission rate and the number of concurrent transmission threads are dynamically adjusted based on real-time network monitoring, so as to complete the transmission of the compressed file based on the dynamically adjusted transmission rate and the number of concurrent transmission threads.

[0084] The number of concurrent transmission threads refers to the number of independent data transmission channels established and used simultaneously during network transmission to improve throughput. Each thread can independently handle the sending or receiving of one data block. Increasing the number of concurrent threads can make fuller use of network resources, enabling the parallel transmission of multiple data streams, thereby accelerating the overall transmission speed, provided bandwidth allows. However, an excessive number of threads may lead to network congestion or excessive processing pressure on the receiving end, therefore, dynamic adjustment based on network conditions is necessary.

[0085] For example, during transmission, the transmission rate and the number of concurrent transmission threads can be dynamically adjusted according to network conditions. For instance, when network congestion is detected, the transmission rate is reduced and the number of concurrent threads is decreased; when the network is idle, the transmission rate is appropriately increased and the number of concurrent threads is increased to speed up transmission.

[0086] For example, when transferring files over a mobile network, if a sharp increase in round-trip time (RTT) and packet loss rate is detected in real time, it is determined to be network congestion. The system will automatically reduce the transmission rate to 50% of the current rate and reduce the number of concurrent threads from 8 to 2 to alleviate network pressure. Once the network stabilizes, the rate and number of threads will be gradually increased.

[0087] In some exemplary embodiments, before adaptively completing the transmission of the compressed file based on the network status of the target receiving end, the method further includes: Split the compressed file into multiple data blocks; Add header information to each data block. The header information should include at least the block sequence number and check information.

[0088] The header information is a metadata packet appended to each independently transmitted data block. It precedes the data block payload and is used to manage and reassemble data during stateless transmission. Typical header information includes: block sequence number (used to identify the order of data blocks so that they can be correctly ordered at the receiving end) and checksum information (such as a cyclic redundancy check (CRC) code, used by the receiving end to verify whether data blocks have been corrupted during transmission). The header information is a key technical means to ensure transmission reliability and data integrity.

[0089] Specifically, during transmission, the compressed file can be divided into blocks, with each block having a header containing information such as block number, block size, and checksum. Upon receiving the transmitted file blocks, the receiving end first performs integrity checks and sorts them according to the header information. If any data blocks are found to be missing or corrupted, it requests the sending end to retransmit the corresponding data blocks according to the error correction mechanism of the transmission protocol. After the data blocks are complete and ordered, the appropriate decompression algorithm is selected based on the file type information to perform the decompression operation, ultimately recovering the original file.

[0090] In a typical mobile application implementation, a user can select up to hundreds of photos and videos from their phone's album. Using the intelligent compression and sharing function provided by this method, the system automatically identifies the file type and performs intelligent compression (such as transcoding HEVC videos to the more common H.264 and adjusting parameters for lossy compression of photos) in the background, then a share menu pops up. When the user chooses to share to social applications such as WeChat or QQ, the transmission module automatically segments the compressed file package into chunks and selects an appropriate protocol for high-speed transmission based on the network estimation of the recipient (which may be a server or another device). Finally, the files are losslessly restored to viewable images and videos at the receiving end, greatly simplifying user operations and improving sharing efficiency.

[0091] Accordingly, after the target receiving end receives the data block, it can perform verification and sorting based on the header information; If a data block is found to be lost or corrupted, a retransmission is requested; Select the appropriate decompression algorithm based on the file type, decompress the data blocks after verification and sorting, and recover the original file.

[0092] Integrity verification, in network data transmission, refers to the process by which the receiver uses redundant information (most commonly a checksum) provided by the sender to verify whether the received data block is completely identical to the one sent and whether any bit errors have occurred. The principle is that the sender calculates a short checksum for the data block content before sending it and sends it along with the data block; the receiver recalculates the fingerprint of the received data, and if it does not match the received checksum, it is determined that the data has been corrupted during transmission.

[0093] Accordingly, after the target receiver successfully receives the data block, the following steps are performed to restore the original file: Step 1: Verification and Sorting. The receiving end first performs integrity verification and sorting on the received data blocks based on the header information carried by each data block (especially the checksum information and block sequence number). This ensures the correctness of the data and the correct assembly order.

[0094] Step 2: Error Control and Retransmission. If any data block is found to be lost or corrupted based on the verification information during the above verification and sorting process, the receiving end will immediately initiate a retransmission request for the specific lost or corrupted data block to the sending end according to the error correction mechanism established in the transmission protocol.

[0095] Step 3: Intelligent Decompression and File Recovery. Once all data blocks have been confirmed to be complete and correctly ordered, the receiving end selects the corresponding decompression algorithm based on the file type information obtained from the transmission process or parsed from the file itself. Subsequently, this algorithm is used to decompress the sorted sequence of data blocks, ultimately recovering the original file that is completely identical to the original file sent from the receiving end.

[0096] In other embodiments, the intelligent compression algorithm selection and parameter adjustment module can be implemented using a machine learning model. Specifically, a large number of file samples covering different types and attributes, along with their corresponding optimal compression algorithms and parameter labels, can be pre-collected to train a composite model. This model can include a classification sub-model (for predicting the best compression algorithm based on file features) and a regression sub-model (for predicting the optimal set of compression parameters). During actual operation, the file feature vector extracted in step 110 is input into the trained model, which directly outputs the recommended compression algorithm identifier and specific parameter configuration, thereby achieving more intelligent, data-driven dynamic adaptation.

[0097] The file compression and transmission method provided in this application analyzes the file to be compressed, identifying its file type and the specific value of at least one file attribute, which serves as the basis for dynamically matching and adjusting the compression algorithm parameters. This invention achieves fine-grained adaptation of the algorithm and parameters through the specific values ​​of file attributes, thereby providing targeted and optimal compression schemes for files with different data characteristics, significantly improving compression efficiency and effect. Simultaneously, transmission is adaptively completed based on the network status of the target receiving end, enabling efficient and reliable file transmission under various network conditions.

[0098] Figure 2 This is a schematic diagram of the structure of a file compression and transmission apparatus 200 provided for an exemplary embodiment of this application. (See diagram below.) Figure 2As shown, the device 200 includes: an identification module 210, an adjustment module 220, and a compression and transmission module 230, wherein: The identification module 210 is used to analyze the acquired file to be compressed and identify the file type and at least one file attribute of the file to be compressed. The adjustment module 220 is used to dynamically select a target compression algorithm from a preset compression algorithm library based on the identified file type and the at least one file attribute, and to dynamically match and adjust the compression parameters of the target compression algorithm based on the specific value of the at least one file attribute. The compression and transmission module 230 is used to compress the file to be compressed based on the target compression algorithm and the adjusted compression parameters to generate a compressed file, and to adaptively complete the transmission of the compressed file based on the network status of the target receiving end.

[0099] The file compression and transmission apparatus 200 provided in this application analyzes the file to be compressed, identifying its file type and the specific value of at least one file attribute, which serves as the basis for dynamically matching and adjusting compression algorithm parameters. This invention achieves fine-grained adaptation of the algorithm and parameters through the specific values ​​of file attributes, thereby providing targeted and optimal compression schemes for files with different data characteristics, significantly improving compression efficiency and effect. Simultaneously, transmission is adaptively completed based on the network status of the target receiving end, enabling efficient and reliable file transmission under various network conditions.

[0100] Optionally, the identification module 210 is specifically used for: The header information of the file to be compressed is parsed, the file extension of the file to be compressed is verified, and the data features of the file to be compressed are extracted.

[0101] Optionally, the adjustment module 220 is specifically used for: When the file type is a text file, the target compression algorithm is a lossless compression algorithm, and the encoding parameters are matched and adjusted based on the word frequency distribution or the length of repeated strings in the text. When the file type is an image file, a lossless compression algorithm or a lossy compression algorithm is selected based on the usage scenario, and the quantization parameters are matched and adjusted based on at least one of the image resolution, color depth, detail richness, file size and image quality requirements. When the file type is a video file, the target compression algorithm is a video hybrid coding algorithm based on the content of the original video and inter-frame prediction, and adjusts the keyframe interval and coding block size parameters based on at least one of the video's frame rate, resolution, scene switching frequency and content complexity.

[0102] Optionally, the compression and transmission module 230 is specifically used for: Using multithreading technology, the compression task of the file to be compressed is split into multiple subtasks and executed in parallel; During the execution of the compression task, hardware acceleration technology is used to execute the target compression algorithm.

[0103] Optionally, the method further includes a buffer management module for: A cache space is allocated in memory to store intermediate data during the compression process; The cache space is managed using either First-In-First-Out (FIFO) or Least Recently Used (LRU) algorithms.

[0104] Optionally, the compression and transmission module 230 is specifically used for: Obtain the network environment information and device performance information of the target receiving end; Based on the network environment information and the device performance information, an initial transmission protocol is adaptively selected for the transmission, so as to complete the transmission of the compressed file based on the initial transmission protocol.

[0105] Optionally, the compression and transmission module 230 is specifically used for: If the network environment information indicates a low bandwidth, high latency environment, and / or the device performance information indicates that the performance is lower than a preset threshold, then User Datagram Protocol (UDP) is selected as the initial transport protocol, and packet retransmission and / or error correction coding mechanisms are enabled. If the network environment information indicates a stable, high-bandwidth environment, and the device performance information indicates good performance, then the Transmission Control Protocol (TCP) is selected as the initial transmission protocol.

[0106] Optionally, the compression and transmission module 230 is specifically used for: During the transmission process using the initial transmission protocol, the transmission rate and the number of concurrent transmission threads are dynamically adjusted based on real-time network monitoring, so as to complete the transmission of the compressed file based on the dynamically adjusted transmission rate and the number of concurrent transmission threads.

[0107] Optionally, before the compression and transmission module 230 adaptively completes the transmission of the compressed file based on the network status of the target receiving end, the device further includes a segmentation module, used for: The compressed file is divided into multiple data blocks; Add header information to each data block, the header information including at least the block number and check information.

[0108] The file compression and transmission device 200 is capable of achieving... Figure 1For details of the method implementation examples, please refer to [link / reference]. Figure 1 The file compression and transmission methods shown in the embodiments will not be described in detail.

[0109] Figure 3 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. For example... Figure 3 As shown, the device includes a memory 31 and a processor 32.

[0110] Memory 31 is used to store computer programs and can be configured to store various other data to support operation on the computing device. Examples of this data include instructions for any application or method operating on the computing device, contact data, phone book data, messages, images, videos, etc.

[0111] The processor 32, coupled to the memory 31, is used to execute a computer program in the memory 31 for: analyzing an acquired file to be compressed, identifying the file type and at least one file attribute of the file to be compressed; dynamically selecting a target compression algorithm from a preset compression algorithm library based on the identified file type and the at least one file attribute, and dynamically matching and adjusting the compression parameters of the target compression algorithm based on the specific value of the at least one file attribute; compressing the file to be compressed based on the target compression algorithm and the adjusted compression parameters to generate a compressed file, and adaptively completing the transmission of the compressed file based on the network status of the target receiving end.

[0112] The electronic device provided in this application analyzes the file to be compressed, identifying its file type and the specific value of at least one file attribute, which serves as the basis for dynamically matching and adjusting compression algorithm parameters. This invention achieves fine-grained adaptation of the algorithm and parameters through the specific values ​​of file attributes, thereby providing targeted and optimal compression schemes for files with different data characteristics, significantly improving compression efficiency and effect. Simultaneously, transmission is adaptively completed based on the network status of the target receiving end, enabling efficient and reliable file transmission under various network conditions.

[0113] Furthermore, such as Figure 3 As shown, the electronic device also includes other components such as a communication component 33, a display 34, a power supply component 35, and an audio component 36. Figure 3 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 3 The components shown. Additionally, depending on the implementation of the traffic playback device, Figure 3 The components within the dashed box are optional, not mandatory. For example, when an electronic device is implemented as a terminal device such as a smartphone, tablet, or desktop computer, it may include... Figure 3The components within the dashed box; when the electronic device is implemented as a server-side device such as a conventional server, cloud server, data center, or server array, it may be excluded. Figure 3 The component within the dashed box.

[0114] The above Figure 3 The communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component may further include a Near Field Communication (NFC) module, Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, etc.

[0115] The above Figure 3 The memory in the memory can be implemented by any class of volatile or non-volatile storage devices or combinations thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0116] The above Figure 3 The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action, but also the duration and pressure associated with the touch or swipe operation.

[0117] The above Figure 3 The power supply component provides power to the various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which it resides.

[0118] The above Figure 3The audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0119] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described file compression and transmission method embodiments.

[0121] Accordingly, this application also provides a computer program product, which stores instructions that, when executed by a computer, cause the computer to perform the steps in the file compression and transmission method embodiments provided in this application.

[0122] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0123] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.

[0124] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0125] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0126] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0127] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other classes of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0128] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such 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 limitation, 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 said element.

[0129] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A file compression and transmission method, characterized in that, include: The obtained file to be compressed is analyzed to identify the file type and at least one file attribute of the file to be compressed; Based on the identified file type and at least one file attribute, a target compression algorithm is dynamically selected from a preset compression algorithm library, and the compression parameters of the target compression algorithm are dynamically matched and adjusted based on the specific value of the at least one file attribute. Based on the target compression algorithm and the adjusted compression parameters, the file to be compressed is compressed to generate a compressed file, and the transmission of the compressed file is adaptively completed based on the network status of the target receiving end.

2. The method according to claim 1, characterized in that, The analysis of the acquired file to be compressed includes: The header information of the file to be compressed is parsed, the file extension of the file to be compressed is verified, and the data features of the file to be compressed are extracted.

3. The method according to claim 1 or 2, characterized in that, The dynamic matching and adjustment of the compression parameters of the target compression algorithm based on the specific values ​​of the at least one file attribute includes: When the file type is a text file, the target compression algorithm is a lossless compression algorithm, and the encoding parameters are matched and adjusted based on the word frequency distribution or the length of repeated strings in the text. When the file type is an image file, a lossless compression algorithm or a lossy compression algorithm is selected based on the usage scenario, and the quantization parameters are matched and adjusted based on at least one of the image resolution, color depth, detail richness, file size and image quality requirements. When the file type is a video file, the target compression algorithm is a video hybrid coding algorithm based on the content of the original video and inter-frame prediction, and adjusts the keyframe interval and coding block size parameters based on at least one of the video's frame rate, resolution, scene switching frequency and content complexity.

4. The method according to claim 1, characterized in that, The compression process for the file to be compressed includes: Using multithreading technology, the compression task of the file to be compressed is split into multiple subtasks and executed in parallel; During the execution of the compression task, hardware acceleration technology is used to execute the target compression algorithm.

5. The method according to claim 4, characterized in that, The method further includes: A cache space is allocated in memory to store intermediate data during the compression process; The cache space is managed using either First-In-First-Out (FIFO) or Least Recently Used (LRU) algorithms.

6. The method according to claim 1, characterized in that, The process of adaptively transmitting the compressed file based on the network status of the target receiver includes: Obtain the network environment information and device performance information of the target receiving end; Based on the network environment information and the device performance information, an initial transmission protocol is adaptively selected for the transmission, so as to complete the transmission of the compressed file based on the initial transmission protocol.

7. The method according to claim 6, characterized in that, The step of adaptively selecting an initial transmission protocol for the transmission based on the network environment information and the device performance information includes: If the network environment information indicates a low bandwidth, high latency environment, and / or the device performance information indicates that the performance is lower than a preset threshold, then User Datagram Protocol (UDP) is selected as the initial transport protocol, and packet retransmission and / or error correction coding mechanisms are enabled. If the network environment information indicates a stable, high-bandwidth environment, and the device performance information indicates good performance, then the Transmission Control Protocol (TCP) is selected as the initial transmission protocol.

8. The method according to claim 6, characterized in that, The method of adaptively transmitting the compressed file based on the network status of the target receiver also includes: During the transmission process using the initial transmission protocol, the transmission rate and the number of concurrent transmission threads are dynamically adjusted based on real-time network monitoring, so as to complete the transmission of the compressed file based on the dynamically adjusted transmission rate and the number of concurrent transmission threads.

9. The method according to claim 1, characterized in that, Before the method adaptively completes the transmission of the compressed file based on the network status of the target receiving end, it further includes: The compressed file is divided into multiple data blocks; Add header information to each data block, the header information including at least the block number and check information.

10. A file compression and transmission device, characterized in that, include: The identification module is used to analyze the acquired file to be compressed and identify the file type and at least one file attribute of the file to be compressed. The adjustment module is used to dynamically select a target compression algorithm from a preset compression algorithm library based on the identified file type and the at least one file attribute, and to dynamically match and adjust the compression parameters of the target compression algorithm based on the specific value of the at least one file attribute. The compression and transmission module is used to compress the file to be compressed based on the target compression algorithm and the adjusted compression parameters to generate a compressed file, and to adaptively complete the transmission of the compressed file based on the network status of the target receiving end.

11. An electronic device, characterized in that, include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor communicates with the memory via the bus, and the machine-readable instructions, when executed by the processor, constitute the steps of the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed on a computer, cause the method as described in any one of claims 1 to 9 to be performed.

13. A computer program product, characterized in that, When the computer program product is run on a computer, the method as described in any one of claims 1 to 9 is performed.