Compression algorithm optimization method, device and electronic device based on RapidIO protocol stack

By integrating the compression algorithm module into the RapidIO protocol stack and dynamically adjusting the strategy, the problem of the traditional RapidIO protocol stack being unable to meet real-time and high-bandwidth requirements in large-scale data transmission is solved, and efficient data transmission and integrity verification are achieved.

CN119906760BActive Publication Date: 2025-09-09AVIC GENERAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510087127.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-09-09
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

The traditional RapidIO protocol stack cannot meet the real-time and high-bandwidth requirements when processing large-scale data transmission, resulting in network congestion and resource waste.

Method used

By integrating the compression algorithm module into the RapidIO protocol stack, the compression strategy is dynamically adjusted according to the data type and network status, and data integrity verification is added during the compression and decompression process to optimize data transmission.

Benefits of technology

It improves bandwidth utilization, meets high bandwidth demands, reduces resource waste, and ensures the real-time and integrity of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906760B_ABST
    Figure CN119906760B_ABST
Patent Text Reader

Abstract

The present invention relates to a compression algorithm optimization method, device, and electronic device based on the RapidIO protocol stack. The method comprises: determining an applicable compression algorithm based on the data type transmitted by RapidIO; integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack and creating compression and decompression functions as independent modules; dynamically adjusting the compression strategy based on real-time network status and data characteristics; and adding a data integrity verification mechanism during the compression and decompression process. By selecting an appropriate compression algorithm and integrating it into the protocol stack, the invention can significantly reduce the amount of data transmitted, thereby improving bandwidth utilization and meeting high-bandwidth requirements. At the same time, the modular design and introduction of dynamic compression strategies enable the system to adaptively adjust according to real-time network status and data characteristics, meeting real-time requirements, facilitating efficient bandwidth utilization and reducing resource waste when processing large-scale data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of RapidIO protocol stack, and in particular to a compression algorithm optimization method, device and electronic equipment based on RapidIO protocol stack. Background Art

[0002] RapidIO, a high-performance serial communication protocol, is widely used in high-performance computing and embedded systems. However, as data volumes continue to increase, traditional transmission methods are unable to meet real-time and high-bandwidth requirements, leading to network congestion and latency. Furthermore, when handling large-scale data transmission, bandwidth is often not effectively utilized, resulting in wasted resources. Therefore, improvements are needed. Summary of the Invention

[0003] Based on this, it is necessary to provide a compression algorithm optimization method, device and electronic device based on the RapidIO protocol stack to address the problem that traditional transmission methods cannot meet the real-time and high bandwidth requirements, resulting in network congestion and delay problems. At the same time, when processing large-scale data transmission, it is often impossible to effectively utilize bandwidth, resulting in resource waste.

[0004] The present invention provides a compression algorithm optimization method based on the RapidIO protocol stack, the method comprising:

[0005] Determine the appropriate compression algorithm based on the data type transmitted by RapidIO;

[0006] Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack and create compression and decompression functions as independent modules;

[0007] Dynamically adjust compression strategies based on real-time network status and data characteristics;

[0008] Add data integrity checking mechanism during compression and decompression process.

[0009] In one embodiment, determining an applicable compression algorithm based on the data type transmitted by RapidIO includes:

[0010] Identify the data characteristics and structure of RapidIO transmission;

[0011] Obtain the occurrence frequency of each symbol in the data to be compressed;

[0012] Build a Huffman tree based on frequency, with symbols with lower frequencies being closer to the leaf nodes of the tree, and generate a Huffman code for each symbol;

[0013] Replace symbols in the original data with the generated encoding.

[0014] In one embodiment, determining an applicable compression algorithm based on the data type transmitted by RapidIO further includes:

[0015] Initialize the dictionary to contain all single-character encodings;

[0016] Read input data and find the longest matching string;

[0017] Output the encoding of the matching string and add the new string to the dictionary.

[0018] In one embodiment, determining an applicable compression algorithm based on the data type transmitted by RapidIO further includes:

[0019] Iterate over the data and store the number of consecutive identical symbols;

[0020] Combine symbols and their repetition times into a new encoding form.

[0021] In one embodiment, integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack includes:

[0022] Design a standardized interface for the compression module to enable seamless interaction with other components of the RapidIO protocol stack. The interface includes functions for data input, compression processing, and data output.

[0023] In the transport layer of the RapidIO protocol stack, a data flow control mechanism is set to automatically call the compression module before data is sent.

[0024] In one embodiment, dynamically adjusting the compression strategy based on real-time network status and data characteristics includes:

[0025] Get the current bandwidth data and the round-trip time of the data packet, and calculate the delay time of the data packet;

[0026] Identify data type and size to determine whether to compress further or transmit directly;

[0027] Dynamically adjust the compression ratio and determine the appropriate compression algorithm based on real-time monitoring of network status and data characteristics;

[0028] Before sending data, call the compression module interface and pass in the dynamically adjusted compression ratio and compression algorithm;

[0029] At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency;

[0030] The collected performance data, including compression ratio, decompression time, and transmission delay, is regularly analyzed to evaluate the effects of different algorithms and parameter settings.

[0031] In one embodiment, adding a data integrity check mechanism during compression and decompression includes:

[0032] Calculate the checksum of the data to be sent based on the integrity check algorithm;

[0033] Packing the calculated checksum together with the data to be sent to form a complete data packet;

[0034] Call the compression module to compress the data packet;

[0035] At the receiving end, the received data packet is decompressed and the original data and check value are extracted;

[0036] Recalculate the checksum of the decompressed data and compare the received checksum with the recalculated checksum;

[0037] In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

[0038] The present invention also provides a compression algorithm optimization device based on the RapidIO protocol stack, comprising:

[0039] A determination module, configured to determine an applicable compression algorithm according to a data type transmitted by RapidIO;

[0040] Integration module for integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack and creating compression and decompression functions as independent modules;

[0041] An adjustment module, used to dynamically adjust the compression strategy based on real-time network status and data characteristics;

[0042] The verification module is used to add a data integrity verification mechanism during the compression and decompression process.

[0043] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above-mentioned compression algorithm optimization methods based on the RapidIO protocol stack when executing the computer program.

[0044] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any of the above-described compression algorithm optimization methods based on the RapidIO protocol stack.

[0045] The above-mentioned compression algorithm optimization method, device and electronic device based on the RapidIO protocol stack, on the one hand, by selecting a suitable compression algorithm and integrating it into the protocol stack, can significantly reduce the amount of data transmitted, thereby improving bandwidth utilization and meeting high bandwidth requirements. On the other hand, the introduction of modular design and dynamic compression strategy enables the system to adaptively adjust according to the real-time network status and data characteristics to meet real-time requirements, facilitate the effective use of bandwidth and reduce resource waste when processing large-scale data transmission, and further optimize transmission efficiency. At the same time, by adding a data integrity verification mechanism during the compression and decompression process, it is convenient to ensure that the data has not been tampered with or damaged during transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 FIG1 is a flow chart of a compression algorithm optimization method based on the RapidIO protocol stack in one embodiment;

[0048] Figure 2 1 is a flow chart of a Huffman coding algorithm in one embodiment;

[0049] Figure 3 Schematic diagram of the LZW algorithm flow in one embodiment;

[0050] Figure 4 Schematic diagram of the RLE algorithm flow in one embodiment;

[0051] Figure 5 FIG1 is a flow chart of integrating a selected compression algorithm into the transport layer of a RapidIO protocol stack in one embodiment;

[0052] Figure 6 A schematic diagram of a process for dynamically adjusting a compression strategy in one embodiment;

[0053] Figure 7 A schematic diagram of a data integrity verification mechanism flow in one embodiment;

[0054] Figure 8 FIG1 is a structural diagram of a compression algorithm optimization device based on the RapidIO protocol stack in one embodiment;

[0055] Figure 9 FIG. 1 is a diagram showing the internal structure of an electronic device according to an embodiment. DETAILED DESCRIPTION

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying 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 making creative efforts shall fall within the scope of protection of the present invention.

[0057] The following combination Figures 1-9 The present invention describes a compression algorithm optimization method, device and electronic device based on RapidIO protocol stack.

[0058] like Figure 1 As shown, in one embodiment, a compression algorithm optimization method based on the RapidIO protocol stack includes the following steps:

[0059] Step S100: determining an applicable compression algorithm according to the data type transmitted by RapidIO.

[0060] When choosing a suitable compression algorithm, it is necessary to consider the characteristics of the data, compression efficiency, and decompression speed. Compression algorithms include Huffman coding, LZW (Lempel-Ziv-Welch, string list compression) algorithm, or RLE (Run-Length Encoding). Among them, Huffman coding is a lossless compression algorithm that assigns variable-length codes to data of different frequencies by constructing a binary tree. LZW is a dictionary compression algorithm suitable for data with many repeated patterns. Its basic idea is to replace repeated strings by constructing a dynamic dictionary. RLE is a simple compression algorithm suitable for compressing continuously repeated data.

[0061] Step S200: Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack, and create compression and decompression functions as independent modules.

[0062] By designing the compression and decompression functions as independent modules, they are easy to integrate and manage in the RapidIO protocol stack, ensuring system flexibility and maintainability.

[0063] 1. Module design and definition:

[0064] Compression module: Create an independent module named CompressionModule to be responsible for data compression. This module should have the following functions:

[0065] Interface definition: Design a standardized interface so that other modules can easily call compression functions. The interface includes: receiving original data and returning compressed data; setting the compression level to adjust the compression effect according to different needs.

[0066] Algorithm selection: Implements a selection mechanism for multiple compression algorithms within the module, such as Huffman coding, LZW, and RLE. Dynamic switching of algorithms is achieved through the strategy mode.

[0067] Decompression module: Create an independent module named DecompressionModule to be responsible for data decompression. This module should have the following functions:

[0068] Interface definition: Design a standardized interface so that other modules can easily call the decompression function. The interface includes: receiving compressed data and returning the decompressed original data; setting the decompression algorithm to match the algorithm used during compression.

[0069] 2. Data flow control: In the transport layer of the RapidIO protocol stack, a data flow control mechanism is set up to automatically call the compression and decompression modules during data transmission and reception. The specific implementation steps are as follows:

[0070] Data sending process:

[0071] During the data preparation phase, the CompressionModule.compress interface is called to compress the data to be sent.

[0072] The compressed data is passed to the lower layer of the RapidIO protocol stack for actual transmission.

[0073] Data receiving process:

[0074] After receiving the data, call the DecompressionModule.decompress interface to decompress the compressed data.

[0075] The decompressed data is passed to the upper-layer application for processing.

[0076] Step S300: Dynamically adjust the compression strategy according to the real-time network status and data characteristics.

[0077] In order to adapt to different types of data and network conditions, the function of dynamically selecting compression and decompression algorithms can be implemented in the module.

[0078] Data characteristic analysis: Before data transmission, analyze the data characteristics (such as data type and size) and select the most appropriate compression algorithm based on the analysis results. For example, for text data, Huffman encoding is preferred; for image data, the LZW algorithm is selected.

[0079] Network status monitoring: Real-time monitoring of network status (such as bandwidth and latency) allows for dynamic adjustment of compression levels or algorithms based on network conditions. For example, during times of network congestion, a higher compression ratio can be selected to reduce data volume.

[0080] Step S400: Add a data integrity check mechanism during the compression and decompression process.

[0081] By adding a data integrity check mechanism during the compression and decompression process, such as using CRC (cyclic redundancy check), it ensures that the data has not been tampered with or damaged during transmission.

[0082] This compression algorithm optimization method based on the RapidIO protocol stack, on the one hand, by selecting a suitable compression algorithm and integrating it into the protocol stack, can significantly reduce the amount of data transmitted, thereby improving bandwidth utilization and meeting high-bandwidth requirements. On the other hand, the introduction of modular design and dynamic compression strategies enables the system to make adaptive adjustments based on real-time network status and data characteristics to meet real-time requirements, facilitate the effective use of bandwidth and reduce resource waste when processing large-scale data transmission, and further optimize transmission efficiency. At the same time, by adding a data integrity verification mechanism during the compression and decompression process, it is convenient to ensure that the data has not been tampered with or damaged during transmission.

[0083] In this embodiment, see Figure 2 , based on the data type transmitted by RapidIO, determine the applicable compression algorithm, including the following steps:

[0084] Step S111 , identifying the data characteristics and structure of RapidIO transmission.

[0085] The data characteristics and structures transmitted by RapidIO include images, audio, video streams, and other types of binary data.

[0086] Step S112: Obtain the occurrence frequency of each symbol in the data to be compressed.

[0087] The mathematical expression is: ,

[0088] Where C is the average number of bits after compression, is the probability of symbol i. This formula shows that the compression effect is closely related to the probability distribution of symbols.

[0089] Step S113: construct a Huffman tree based on the frequency, where the lower the frequency of the symbol, the closer it is to the leaf node of the tree, and generate a Huffman code for each symbol.

[0090] Data with high frequency uses shorter codes, while data with low frequency uses longer codes, thereby effectively reducing the overall data volume.

[0091] Step S114: Use the generated code to replace the symbols in the original data.

[0092] By replacing the original data with the generated Huffman code, a compressed data packet is formed, which helps improve the efficiency of data transmission and bandwidth utilization.

[0093] In this embodiment, see Figure 3 , according to the data type transmitted by RapidIO, determining the applicable compression algorithm also includes the following steps:

[0094] Step S121, initializing the dictionary to include the encoding of all single characters.

[0095] Initially, the dictionary contains all possible single characters as keys and maps them to their corresponding encoded values. For example, for 8-bit ASCII characters, the dictionary will contain 256 key-value pairs.

[0096] Step S122: read the input data and search for the longest matching character string.

[0097] Read the first character from the input data, append it to the current string, and check if the current string exists in the dictionary. If so, extend the current string by one character and continue searching for the new extended string, repeating this process until no matching string is found. Once the longest matching string is found, output the encoding value of that string from the dictionary.

[0098] Step S123: Output the encoding of the matching character string and add the new character string to the dictionary.

[0099] The extension of the current string is added to the dictionary, and a new encoding value is assigned. The current string is then reset to the last character so that the next loop can continue, and the above steps are repeated until all data has been processed.

[0100] In this embodiment, see Figure 4 , according to the data type transmitted by RapidIO, determining the applicable compression algorithm also includes the following steps:

[0101] Step S131, traverse the data and store the number of consecutive identical symbols.

[0102] By traversing the data and storing the number of consecutive identical symbols, it is convenient to count the number of occurrences of consecutive data and the data itself, which makes it easier to subsequently convert the data sequence into a short representation containing a single data value and the number of repetitions.

[0103] Step S132: Combine the symbol and its repetition times into a new coding form.

[0104] If there is continuous repeated data, represent this data in the form of "data + count", which can reduce the overall amount of data that needs to be stored or transmitted.

[0105] In this embodiment, see Figure 5 ,Integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack includes the following steps:

[0106] Step S210 , designing a standardized interface for the compression module so that it can seamlessly interact with other components of the RapidIO protocol stack. The interface includes functions of data input, compression processing, and data output.

[0107] For example, an interface could be defined as:

[0108] Compression: Receives raw data and returns compressed data.

[0109] Decompression: Receives compressed data and returns the decompressed original data.

[0110] Step S220: In the transport layer of the RapidIO protocol stack, a data flow control mechanism is set to automatically call a compression module before data is sent.

[0111] In specific implementation, a compression step can be inserted into the data sending process to ensure that all data to be sent is compressed.

[0112] For example, in the data sending function, you can add the following logic:

[0113] During the data preparation phase, the compression interface is called to compress the data to be sent.

[0114] The compressed data is passed to the lower layer of the RapidIO protocol stack for actual transmission.

[0115] In this embodiment, see Figure 6 , dynamically adjust the compression strategy according to the real-time network status and data characteristics, including the following steps:

[0116] Step S310: Obtain current bandwidth data and round-trip time of the data packet, and calculate the delay time of the data packet.

[0117] For example, you can set a threshold, such as when bandwidth usage exceeds 80%, the network is considered to be in a congested state. If the delay exceeds the set threshold (such as 100ms), it is marked as a high delay state.

[0118] Step S320 , identifying the data type and data size to determine whether to further compress or directly transmit.

[0119] The data type can be determined through data header information or content analysis algorithms (such as MIME type identification).

[0120] The need for compression depends on the size of the data. For example, for data smaller than a certain number of bytes (such as 256 bytes), compression may not be necessary because the overhead of compression and decompression may outweigh the benefits of transmission.

[0121] Step S330 , dynamically adjusting the compression ratio and determining an applicable compression algorithm based on the real-time monitored network status and data characteristics.

[0122] Dynamically adjust the compression ratio: When the network is congested (bandwidth utilization exceeds 80%), increase the compression ratio and select a more efficient compression algorithm (such as Huffman coding) to reduce the data volume. When the network is in good condition (bandwidth utilization is less than 50%), select a lower compression ratio to increase the compression and decompression speed.

[0123] Compression algorithm selection: For text data, Huffman encoding is preferred; for image data, LZW or JPEG compression is selected; for video data, H.264 or other video compression standards are used.

[0124] Step S340: before sending the data, call the interface of the compression module and pass in the dynamically adjusted compression ratio and compression algorithm.

[0125] For example, call CompressionModule.setCompressionLevel(newLevel) and CompressionModule.setCompressionAlgorithm(newAlgorithm).

[0126] Step S350: At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency.

[0127] If the transmission efficiency is found to be lower than expected, the compression strategy can be adjusted and feedback can be provided to optimize subsequent data transmission.

[0128] Step S360: regularly analyze the collected performance data and evaluate the effects of different algorithms and parameter settings. The performance data includes compression ratio, decompression time, and transmission delay.

[0129] By evaluating the effects of different algorithms and parameter settings, it is convenient to optimize algorithm parameters and module design.

[0130] Integrate logging functionality into the module to monitor compression effects and transmission efficiency in real time.

[0131] The specific examples are as follows:

[0132] Assume that during a data transmission, the system detects that the bandwidth usage is 85%, the data type is text, and the data size is 512 bytes. The implementation steps are as follows:

[0133] 1. Real-time monitoring: When the system detects that the bandwidth usage exceeds 80%, it marks the network as congested.

[0134] 2. Data characteristic analysis: The data to be sent is identified as text type and its size is 512 bytes.

[0135] 3. Dynamic adjustment:

[0136] According to the network congestion status, it is decided to increase the compression ratio and select Huffman coding as the compression algorithm.

[0137] Call CompressionModule.setCompressionLevel(9) to set the maximum compression level.

[0138] 4. Implementation strategy: Before sending data, call CompressionModule.compress(data) to compress it and send the compressed data.

[0139] 5. Feedback and Optimization: At the receiving end, the decompressed data quality and transmission delay are monitored, and the compression effect is recorded. If the transmission delay exceeds 200ms, feedback is provided to the sending end to adjust the subsequent transmission strategy.

[0140] Through the above steps, the adaptive compression strategy can effectively adjust the compression parameters dynamically according to the real-time network status and data characteristics, thereby optimizing data transmission efficiency.

[0141] In this embodiment, see Figure 7 , add a data integrity check mechanism during the compression and decompression process, including the following steps:

[0142] Step S410: Calculate the check value of the data to be sent based on the integrity check algorithm.

[0143] Integrity check algorithms, such as CRC (Cyclic Redundancy Check) or SHA (Secure Hash Algorithm). CRC is suitable for fast verification, while SHA provides higher security. Choose the appropriate algorithm based on the application scenario. For example, for real-time transmission applications, the CRC32 algorithm can be selected because of its fast calculation speed and low overhead.

[0144] For example, when using the CRC32 algorithm, the checksum can be calculated using the following formula:

[0145] ,

[0146] in, For each byte of data; polynomial is a predefined polynomial; Represents the exclusive OR (XOR) operation, which is a logical operation that compares bits by bit, with the same value being 0 and the different value being 1. It is also an XOR operator symbol, here and The operation logic is consistent; It usually represents the i-th byte or bit of the data to be checked, etc., depending on the organization of the data, that is, the various components of the data content involved in the CRC check; polynomial refers to the generating polynomial, which is a very critical setting element in the CRC check algorithm. It is a binary polynomial representation used to define the operation rules in the check process; n is generally the upper limit of the number of loop operations, which is often related to the data length or the specific check configuration. Here it means a loop operation from 0 to "n-1".

[0147] Step S420: Pack the calculated check value together with the data to be sent to form a complete data packet.

[0148] By packaging the calculated checksum and the data to be sent into a complete data packet, subsequent compression of the data packet is facilitated.

[0149] Step S430: calling a compression module to compress the data packet.

[0150] The compressed data packet should contain the original data and the check value so that it can be checked at the receiving end.

[0151] Step S440: At the receiving end, the received data packet is decompressed and the original data and the check value are extracted.

[0152] This is convenient for subsequent verification of whether there are any errors in the data during transmission.

[0153] Step S450 , recalculating the check value of the decompressed data, and comparing the received check value with the recalculated check value after decompression.

[0154] If the received check value is the same as the check value after recalculation and decompression, the data is complete; if the received check value is different from the check value after recalculation and decompression, it means that an error occurred during data transmission.

[0155] Step S460: In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

[0156] Data retransmission can be achieved by defining a simple confirmation mechanism, such as using confirmation and negative signals.

[0157] After receiving the retransmission request, the sender resends the original data and its checksum to ensure data integrity.

[0158] The specific examples are as follows:

[0159] Assume that in a data transmission, the system needs to send a piece of text data with a size of 1024 bytes. The implementation steps are as follows:

[0160] 1. Select the verification algorithm: Select CRC32 as the integrity verification algorithm.

[0161] 2. Integrity check before compression:

[0162] Calculate the CRC checksum of the data. Assume that the result is 0xA3B2C1D4.

[0163] The checksum is packaged together with the original data to form a data packet.

[0164] 3. Data compression: Call the compression module to compress the data and generate a compressed data packet.

[0165] 4. Data sending: Send the compressed data packet to the receiving end.

[0166] 5. Integrity check after decompression:

[0167] The receiving end decompresses the data packet and extracts the original data and check value.

[0168] Recalculate the CRC checksum of the decompressed data. Assume that the calculated result is 0xA3B2C1D4, which is the same as the received checksum, confirming that the data is complete.

[0169] 6. Error handling: If the verification fails, the receiving end sends a NACK signal to request retransmission, and the sending end resends the data after receiving the request.

[0170] Through the above steps, the data integrity verification mechanism can effectively ensure the accuracy of data during the compression and decompression process, and improve the reliability of data transmission.

[0171] The compression algorithm optimization device based on the RapidIO protocol stack provided by the present invention is described below. The compression algorithm optimization device based on the RapidIO protocol stack described below and the compression algorithm optimization method based on the RapidIO protocol stack described above can refer to each other.

[0172] like Figure 8 As shown, in one embodiment, a compression algorithm optimization device based on the RapidIO protocol stack includes a determination module 810 , an integration module 820 , an adjustment module 830 and a verification module 840 .

[0173] The determination module 810 is configured to determine an applicable compression algorithm according to the data type transmitted by RapidIO.

[0174] The integration module 820 is used to integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack and create compression and decompression functions as independent modules.

[0175] The adjustment module 830 is used to dynamically adjust the compression strategy according to the real-time network status and data characteristics.

[0176] The verification module 840 is used to add a data integrity verification mechanism during the compression and decompression process.

[0177] In this embodiment, the determination module 810 is specifically configured to:

[0178] Identify the data characteristics and structure of RapidIO transmission;

[0179] Obtain the occurrence frequency of each symbol in the data to be compressed;

[0180] Build a Huffman tree based on frequency, with symbols with lower frequencies being closer to the leaf nodes of the tree, and generate a Huffman code for each symbol;

[0181] Replace symbols in the original data with the generated encoding.

[0182] In this embodiment, the determination module 810 is further specifically configured to:

[0183] Initialize the dictionary to contain all single-character encodings;

[0184] Read input data and find the longest matching string;

[0185] Output the encoding of the matching string and add the new string to the dictionary.

[0186] In this embodiment, the determination module 810 is further specifically configured to:

[0187] Iterate over the data and store the number of consecutive identical symbols;

[0188] Combine symbols and their repetition times into a new encoding form.

[0189] In this embodiment, the selected compression algorithm is integrated into the transport layer of the RapidIO protocol stack, specifically for:

[0190] Design a standardized interface for the compression module to enable seamless interaction with other components of the RapidIO protocol stack. The interface includes functions for data input, compression processing, and data output.

[0191] In the transport layer of the RapidIO protocol stack, a data flow control mechanism is set to automatically call the compression module before data is sent.

[0192] In this embodiment, the adjustment module 830 is specifically configured to:

[0193] Get the current bandwidth data and the round-trip time of the data packet, and calculate the delay time of the data packet;

[0194] Identify data type and size to determine whether to compress further or transmit directly;

[0195] Dynamically adjust the compression ratio and determine the appropriate compression algorithm based on real-time monitoring of network status and data characteristics;

[0196] Before sending data, call the compression module interface and pass in the dynamically adjusted compression ratio and compression algorithm;

[0197] At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency;

[0198] Regularly analyze the collected performance data and evaluate the effects of different algorithms and parameter settings. Performance data includes compression ratio, decompression time, and transmission delay.

[0199] In this embodiment, the verification module 840 is specifically configured to:

[0200] Calculate the checksum of the data to be sent based on the integrity check algorithm;

[0201] Packing the calculated checksum together with the data to be sent to form a complete data packet;

[0202] Call the compression module to compress the data packet;

[0203] At the receiving end, the received data packet is decompressed and the original data and check value are extracted;

[0204] Recalculate the checksum of the decompressed data and compare the received checksum with the recalculated checksum;

[0205] In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

[0206] This compression algorithm optimization device based on the RapidIO protocol stack, on the one hand, can significantly reduce the amount of data transmission by selecting a suitable compression algorithm and integrating it into the protocol stack, thereby improving bandwidth utilization and meeting high-bandwidth requirements. On the other hand, the introduction of modular design and dynamic compression strategies enables the system to make adaptive adjustments based on real-time network status and data characteristics to meet real-time requirements, facilitate the effective use of bandwidth and reduce resource waste when processing large-scale data transmission, and further optimize transmission efficiency. At the same time, by adding a data integrity verification mechanism during the compression and decompression process, it is convenient to ensure that the data has not been tampered with or damaged during transmission.

[0207] Figure 9 The following is a schematic diagram of the physical structure of an electronic device. The electronic device may be a smart terminal, and its internal structure diagram may be as follows: Figure 9 As shown. The electronic device includes a processor, a memory, and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a compression algorithm optimization method based on the RapidIo protocol stack is implemented, the method comprising:

[0208] Determine the appropriate compression algorithm based on the data type transmitted by RapidIO;

[0209] Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack and create compression and decompression functions as independent modules;

[0210] Dynamically adjust compression strategies based on real-time network status and data characteristics;

[0211] Add data integrity checking mechanism during compression and decompression process.

[0212] Those skilled in the art will understand that Figure 9The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the electronic device to which the solution of the present invention is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0213] In another aspect, the present invention further provides a computer storage medium storing a computer program, which, when executed by a processor, implements a compression algorithm optimization method based on a RapidIO protocol stack, the method comprising:

[0214] Determine the appropriate compression algorithm based on the data type transmitted by RapidIO;

[0215] Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack and create compression and decompression functions as independent modules;

[0216] Dynamically adjust compression strategies based on real-time network status and data characteristics;

[0217] Add data integrity checking mechanism during compression and decompression process.

[0218] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, implements a compression algorithm optimization method based on the RapidIO protocol stack, the method comprising:

[0219] Determine the appropriate compression algorithm based on the data type transmitted by RapidIO;

[0220] Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack and create compression and decompression functions as independent modules;

[0221] Dynamically adjust compression strategies based on real-time network status and data characteristics;

[0222] Add data integrity checking mechanism during compression and decompression process.

[0223] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory.

[0224] By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0225] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0226] The above-described embodiments merely illustrate several embodiments of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, and these modifications and improvements fall within the scope of the present invention. Therefore, the scope of the present invention shall be determined by the appended claims.

Claims

1. A compression algorithm optimization method based on RapidIo protocol stack, characterized in that: The method comprises: Determine the appropriate compression algorithm based on the data type transmitted by RapidIO; Integrate the selected compression algorithm into the transport layer of the RapidIO protocol stack, design standardized interfaces for the compression and decompression modules to enable seamless interaction with other components of the RapidIO protocol stack, create the compression and decompression functions as independent modules, and implement a data flow control mechanism at the transport layer to automatically invoke the compression modules. Dynamically adjust the compression strategy based on real-time network status and data characteristics, specifically including: obtaining current bandwidth data and round-trip time of data packets, and calculating the delay time of data packets; identifying data type and size to determine further compression or direct transmission; dynamically adjusting the compression ratio and determining the applicable compression algorithm based on the real-time monitored network status and data characteristics; calling the compression module interface before sending data and passing in the dynamically adjusted compression ratio and compression algorithm; at the data receiving end, feedback on the compression effect and transmission delay based on the decompressed data quality and transmission efficiency; regularly analyzing the collected performance data and evaluating the effects of different algorithms and parameter settings, such performance data including compression ratio, decompression time and transmission delay; A data integrity check mechanism is added during the compression and decompression process, specifically including: calculating a check value of the data to be sent based on an integrity check algorithm; packaging the calculated check value together with the data to be sent to form a complete data packet; calling a compression module to compress the data packet; at the receiving end, decompressing the received data packet and extracting the original data and check value; recalculating the check value of the decompressed data and comparing the received check value with the recalculated decompressed check value; in response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

2. The compression algorithm optimization method based on the RapidIo protocol stack according to claim 1, characterized in that: Determining an applicable compression algorithm based on the data type transmitted by RapidIO includes: Identify the data characteristics and structure of RapidIO transmission; Obtain the occurrence frequency of each symbol in the data to be compressed; Build a Huffman tree based on frequency, with symbols with lower frequencies being closer to the leaf nodes of the tree, and generate a Huffman code for each symbol; Replace symbols in the original data with the generated encoding.

3. The compression algorithm optimization method based on RapidIo protocol stack according to claim 2, characterized in that: The determining of an applicable compression algorithm based on the data type transmitted by RapidIO further includes: Initialize the dictionary to contain all single-character encodings; Read input data and find the longest matching string; Output the encoding of the matching string and add the new string to the dictionary.

4. The compression algorithm optimization method based on RapidIo protocol stack according to claim 3, characterized in that: The determining of an applicable compression algorithm based on the data type transmitted by RapidIO further includes: Iterate over the data and store the number of consecutive identical symbols; Combine symbols and their repetition times into a new encoding form.

5. The compression algorithm optimization method based on RapidIo protocol stack according to claim 4, characterized in that: Integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack includes: In the transport layer of the RapidIO protocol stack, a data flow control mechanism is set to automatically call the compression module before data is sent.

6. A compression algorithm optimization device based on RapidIo protocol stack, characterized in that: include: A determination module, configured to determine an applicable compression algorithm according to a data type transmitted by RapidIO; An integration module for integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack, designing standardized interfaces for the compression and decompression modules to enable seamless interaction with other components of the RapidIO protocol stack, creating compression and decompression functions as independent modules, and setting up a data flow control mechanism at the transport layer to automatically call the compression module; The adjustment module is used to dynamically adjust the compression strategy based on the real-time network status and data characteristics. Specifically, it includes: obtaining the current bandwidth data and the round-trip time of the data packet, and calculating the delay time of the data packet; identifying the data type and size to determine whether to further compress or directly transmit; dynamically adjusting the compression ratio and determining the applicable compression algorithm based on the real-time monitored network status and data characteristics; calling the compression module interface before sending the data and passing in the dynamically adjusted compression ratio and compression algorithm; at the data receiving end, feedback on the compression effect and transmission delay is provided based on the decompressed data quality and transmission efficiency; regularly analyzing the collected performance data and evaluating the effects of different algorithms and parameter settings, such performance data including compression ratio, decompression time and transmission delay; The verification module is used to add a data integrity verification mechanism during the compression and decompression process, specifically including: calculating the verification value of the data to be sent based on the integrity verification algorithm; packaging the calculated verification value together with the data to be sent to form a complete data packet; calling the compression module to compress the data packet; at the receiving end, decompressing the received data packet and extracting the original data and the verification value; recalculating the verification value of the decompressed data and comparing the received verification value with the recalculated decompressed verification value; in response to an error in the data transmission process, the receiving end sends a retransmission request to the sending end.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the compression algorithm optimization method based on the RapidIo protocol stack according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the compression algorithm optimization method based on the RapidIo protocol stack according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data compression method based on radar algorithm

    CN117895950A

  • Three-dimensional space data transmission method and system with application as drive guidance

    CN118400067A