RapidIO protocol stack-based compression algorithm optimization method and apparatus, and electronic device

By integrating compression algorithms and dynamic adjustment strategies in the RapidIO protocol stack, the problem that traditional transmission methods cannot meet the needs of high bandwidth and real-time is solved, and efficient bandwidth utilization and data integrity guarantee are achieved.

CN119906760AActive Publication Date: 2025-04-29AVIC GENERAL TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The traditional RapidIO transmission method cannot meet the needs of real-time and high bandwidth, resulting in network congestion and delay problems. At the same time, it cannot effectively utilize bandwidth when handling large-scale data transmission, resulting in waste of resources.

Method used

A compression algorithm optimization method based on RapidIO protocol stack is provided. By determining the applicable compression algorithm based on the data type, the compression and decompression functions are integrated into the transport layer of the protocol stack, and the compression strategy is dynamically adjusted and the data integrity verification mechanism is added during the compression and decompression process.

Benefits of technology

Significantly reduce the amount of data transmission, improve bandwidth utilization, meet the needs of high bandwidth, achieve real-time and efficient resource utilization, and ensure the integrity of data during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906760A_ABST
    Figure CN119906760A_ABST
Patent Text Reader

Abstract

The invention relates to a compression algorithm optimization method and device based on a RapidIO protocol stack and electronic equipment, and the method comprises the steps: determining an applicable compression algorithm according to the type of data transmitted by RapidIO; integrating the selected compression algorithm to a transmission layer of a RapidIO protocol stack, and creating compression and decompression functions as independent modules; dynamically adjusting a compression strategy according to a real-time network state and data characteristics; and a data integrity checking mechanism is added in the compression and decompression processes. By selecting a proper compression algorithm and integrating the compression algorithm into a protocol stack, the data transmission quantity can be remarkably reduced, so that the bandwidth utilization rate is improved, the high-bandwidth requirement is met, meanwhile, due to the modular design and the introduction of a dynamic compression strategy, the system can perform self-adaptive adjustment according to the real-time network state and data characteristics, and the real-time performance of the system is improved. The real-time requirement is met, the bandwidth can be effectively utilized conveniently when large-scale data transmission is processed, and resource waste is reduced.
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] As a high-performance serial communication protocol, RapidIO is widely used in high-performance computing and embedded systems. However, with the continuous increase in data volume, traditional transmission methods cannot meet the requirements of real-time and high bandwidth, resulting in network congestion and delay problems. At the same time, when processing large-scale data transmission, it is often unable to effectively utilize bandwidth, resulting in resource waste. Therefore, it needs to be improved. 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 the bandwidth, resulting in waste of resources.

[0004] The present invention provides a compression algorithm optimization method based on RapidIO protocol stack, the method comprising: 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 and create compression and decompression functions as independent modules; Dynamically adjust compression strategy based on real-time network status and data characteristics; Add data integrity checking mechanism during compression and decompression.

[0005] In one embodiment, determining an applicable compression algorithm according to the data type transmitted by RapidIO includes: Identify the data characteristics and structure of RapidIO transmission; Obtaining 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.

[0006] In one embodiment, determining an applicable compression algorithm according to 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 matched string and add the new string to the dictionary.

[0007] In one embodiment, determining an applicable compression algorithm according to 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 new encoding forms.

[0008] In one embodiment, the step of integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack comprises: Design a standardized interface for the compression module so that it can interact seamlessly with other components of the RapidIO protocol stack. The interface includes functions for data input, compression processing, and data output. 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.

[0009] In one embodiment, dynamically adjusting the compression strategy according to the real-time network status and data characteristics includes: Get the current bandwidth data and the round trip time of the data packet, and calculate the delay time of the data packet; Identify data type and size to determine whether to compress further or transmit directly; Dynamically adjust the compression ratio and determine the applicable compression algorithm based on the real-time monitored network status and data characteristics; Before sending data, call the compression module interface and pass in the dynamically adjusted compression ratio and compression algorithm; At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency; 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.

[0010] In one embodiment, adding a data integrity check mechanism during compression and decompression includes: Based on the integrity check algorithm, calculate the check value of the data to be sent; Packing the calculated checksum value together with the data to be sent to form a complete data packet; Call the compression module to compress the data packet; At the receiving end, the received data packet is decompressed and the original data and check value are extracted; Recalculate the checksum of the decompressed data and compare the received checksum with the recalculated checksum; In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

[0011] The present invention also provides a compression algorithm optimization device based on RapidIO protocol stack, comprising: A determination module, used for determining an applicable compression algorithm according to the data type transmitted by RapidIO; 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; An adjustment module is used to dynamically adjust the compression strategy according to the real-time network status and data characteristics; The verification module is used to add a data integrity verification mechanism during the compression and decompression process.

[0012] 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 one of the above-mentioned compression algorithm optimization methods based on the RapidIO protocol stack when executing the computer program.

[0013] 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-mentioned compression algorithm optimization methods based on the RapidIO protocol stack.

[0014] The above-mentioned compression algorithm optimization method, device and electronic device based on 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 transmission, 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 the transmission efficiency. At the same time, by adding a data integrity verification mechanism in 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

[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is 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.

[0016] Figure 1 The figure is a flow chart of a compression algorithm optimization method based on RapidIO protocol stack in one embodiment; Figure 2 A schematic diagram of a Huffman coding algorithm flow in one embodiment; Figure 3 Schematic diagram of the LZW algorithm flow in one embodiment; Figure 4 is a schematic diagram of the RLE algorithm flow in one embodiment; Figure 5 A schematic diagram of a process of integrating a selected compression algorithm into a transport layer of a RapidIO protocol stack in one embodiment; Figure 6 A schematic diagram of a process of dynamically adjusting a compression strategy in an embodiment; Figure 7 A schematic diagram of a data integrity verification mechanism flow in one embodiment; Figure 8 It is a structural schematic diagram of a compression algorithm optimization device based on RapidIO protocol stack in one embodiment; Fig. 9 The figure is a diagram showing the internal structure of an electronic device according to an embodiment. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] Combine the following Figure 1-Figure 9 The present invention describes a compression algorithm optimization method, device and electronic device based on RapidIO protocol stack.

[0019] like Figure 1 As shown, in one embodiment, a compression algorithm optimization method based on RapidIO protocol stack includes the following steps: Step S100, determining an applicable compression algorithm according to the data type transmitted by RapidIO.

[0020] When choosing a suitable compression algorithm, it is necessary to consider the characteristics of the data, compression efficiency and decompression speed. The compression algorithms include Huffman coding, LZW (Lempel-Ziv-Welch, string table compression) algorithm or RLE (Run-Length Encoding, 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 compression of continuously repeated data.

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

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

[0023] 1. Module design and definition: Compression module: Create an independent module named CompressionModule to be responsible for data compression. This module should have the following functions: Interface definition: Design a standardized interface so that other modules can easily call the compression function. The interface includes: receiving the original data and returning the compressed data; setting the compression level to adjust the compression effect according to different needs.

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

[0025] Decompression module: Create an independent module named DecompressionModule to be responsible for data decompression. This module should have the following functions: 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.

[0026] 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 sending and receiving. The specific implementation steps are as follows: Data sending process: During the data preparation phase, the CompressionModule.compress interface is called to compress the data to be sent.

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

[0028] Data receiving process: After receiving the data, call the DecompressionModule.decompress interface to decompress the compressed data.

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

[0030] Step S300, dynamically adjusting the compression strategy according to the real-time network status and data characteristics.

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

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

[0033] Network status monitoring: Real-time monitoring of network status (such as bandwidth, latency, etc.) and dynamic adjustment of compression level or algorithm based on network conditions. For example, when the network is congested, a higher compression ratio can be selected to reduce the amount of data.

[0034] Step S400, adding a data integrity check mechanism during the compression and decompression process.

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

[0036] The compression algorithm optimization method 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 strategy enables the system to make adaptive adjustments according to real-time network status and data characteristics to meet real-time requirements, facilitate 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 in the compression and decompression process, it is convenient to ensure that the data has not been tampered with or damaged during transmission.

[0037] In this embodiment, see Figure 2 , according to the data type transmitted by RapidIO, determine the applicable compression algorithm, including the following steps: Step S111, identifying the data characteristics and structure of RapidIO transmission.

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

[0039] Step S112, obtaining the occurrence frequency of each symbol in the data to be compressed.

[0040] The mathematical expression is: , 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.

[0041] Step S113, constructing a Huffman tree according to the frequency, where symbols with lower frequencies are closer to the leaf nodes of the tree, and generating a Huffman code for each symbol.

[0042] Data with high frequency uses shorter codes, while data with low frequency uses longer codes, which effectively reduces the overall data volume.

[0043] Step S114, using the generated code to replace the symbol in the original data.

[0044] By using the generated Huffman code to replace the original data, a compressed data packet is formed, which facilitates improving the efficiency of data transmission and bandwidth utilization.

[0045] In this embodiment, see Figure 3 , according to the data type transmitted by RapidIO, determining the applicable compression algorithm also includes the following steps: Step S121, initializing the dictionary to include the encoding of all single characters.

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

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

[0048] Read the first character from the input data and add 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 to look for the new extended string, repeating this process until no matching string is found. Then after finding the longest matching string, output the encoding value of the string in the dictionary.

[0049] Step S123, output the encoding of the matching character string and add the new character string to the dictionary.

[0050] Add the extension of the current string to the dictionary, assigning a new encoding value. Then reset the current string to the last character so that it can continue to the next loop, repeating the above steps until all the data has been processed.

[0051] In this embodiment, see Figure 4 , according to the data type transmitted by RapidIO, determining the applicable compression algorithm also includes the following steps: Step S131, traverse the data and store the number of consecutive identical symbols.

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

[0053] Step S132, combining the symbol and its repetition times into a new coding form.

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

[0055] In this embodiment, see Figure 5 , integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack includes the following steps: Step S210, designing a standardized interface for the compression module so that it can interact seamlessly with other components of the RapidIO protocol stack, the interface including functions of data input, compression processing, and data output.

[0056] For example, an interface could be defined as: Compression: Receives raw data and returns compressed data.

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

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

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

[0060] For example, in the data sending function, you can add the following logic: During the data preparation phase, the compression interface is called to compress the data to be sent.

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

[0062] 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: Step S310, obtaining current bandwidth data and round trip time of the data packet, and calculating the delay time of the data packet.

[0063] For example, a threshold can be set, such as when the 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.

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

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

[0066] Depending on the size of the data, decide whether compression is needed. For example, for data smaller than a certain number of bytes (such as 256 bytes), compression may not be needed because the overhead of compression and decompression may exceed the benefits of transmission.

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

[0068] 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 amount of data; when the network is in good condition (bandwidth utilization is less than 50%), select a lower compression ratio to increase the speed of compression and decompression.

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

[0070] Step S340, before sending the data, calling the interface of the compression module, and passing in the dynamically adjusted compression ratio and compression algorithm.

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

[0072] Step S350: at the data receiving end, the compression effect and transmission delay are fed back according to the decompressed data quality and transmission efficiency.

[0073] If it is found that the transmission efficiency does not meet expectations, the compression strategy can be adjusted and feedback can be provided to optimize subsequent data transmission.

[0074] Step S360, regularly analyzing the collected performance data and evaluating the effects of different algorithms and parameter settings, the performance data including compression ratio, decompression time and transmission delay.

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

[0076] Integrate logging function into the module to monitor compression effect and transmission efficiency in real time.

[0077] The specific examples are as follows: Assume that in 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: 1. Real-time monitoring: When the system detects that the bandwidth usage rate exceeds 80%, it is marked as network congestion.

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

[0079] 3. Dynamic adjustment: According to the network congestion status, it is decided to increase the compression ratio and select Huffman coding as the compression algorithm.

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

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

[0082] 5. Feedback and optimization: At the receiving end, monitor the quality of decompressed data and transmission delay, and record the compression effect. If the transmission delay is found to exceed 200ms, feedback will be given to the sending end to adjust the subsequent transmission strategy.

[0083] 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 the data transmission efficiency.

[0084] In this embodiment, see Figure 7 , add a data integrity check mechanism during compression and decompression, including the following steps: Step S410: Calculate the check value of the data to be sent based on the integrity check algorithm.

[0085] 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. Select the appropriate algorithm according to the needs of the application scenario. For example, for real-time transmission applications, you can choose the CRC32 algorithm because it has fast calculation speed and low overhead.

[0086] For example, when using the CRC32 algorithm, the checksum can be calculated using the following formula: , in, For each byte of data; polynomial is a predefined polynomial; Indicates the exclusive OR (XOR) operation, that is, a logical operation in which the same bits are 0 and the different bits are 1. It is also an XOR operator, here and The operation logic is consistent; It usually represents the i-th byte or bit of the data to be checked, etc., which depends 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 and is 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".

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

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

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

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

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

[0092] It is convenient to check whether there are errors in the data during the transmission process.

[0093] Step S450, recalculate the check value of the decompressed data, and compare the received check value with the recalculated check value after decompression.

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

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

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

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

[0098] The specific examples are as follows: 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: 1. Select the verification algorithm: Select CRC32 as the integrity verification algorithm.

[0099] 2. Integrity check before compression: Calculate the CRC check value of the data, assuming the calculation result is 0xA3B2C1D4.

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

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

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

[0103] 5. Integrity check after decompression: The receiving end decompresses the data packet and extracts the original data and check value.

[0104] Recalculate the CRC check value of the decompressed data. Assume that the calculation result is 0xA3B2C1D4, which is the same as the received check value, confirming that the data is complete.

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

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

[0107] 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 be referred to each other.

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

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

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

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

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

[0113] In this embodiment, the determination module 810 is specifically configured to: Identify the data characteristics and structure of RapidIO transmission; Obtaining 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.

[0114] In this embodiment, the determination module 810 is further specifically configured to: Initialize the dictionary to contain all single-character encodings; Read input data and find the longest matching string; Output the encoding of the matched string and add the new string to the dictionary.

[0115] In this embodiment, the determination module 810 is further specifically configured to: Iterate over the data and store the number of consecutive identical symbols; Combine symbols and their repetition times into new encoding forms.

[0116] In this embodiment, the selected compression algorithm is integrated into the transport layer of the RapidIO protocol stack, specifically for: Design a standardized interface for the compression module so that it can interact seamlessly with other components of the RapidIO protocol stack. The interface includes functions for data input, compression processing, and data output. 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.

[0117] In this embodiment, the adjustment module 830 is specifically used to: Get the current bandwidth data and the round trip time of the data packet, and calculate the delay time of the data packet; Identify data type and size to determine whether to compress further or transmit directly; Dynamically adjust the compression ratio and determine the applicable compression algorithm based on the real-time monitored network status and data characteristics; Before sending data, call the compression module interface and pass in the dynamically adjusted compression ratio and compression algorithm; At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency; 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.

[0118] In this embodiment, the verification module 840 is specifically used for: Based on the integrity check algorithm, calculate the check value of the data to be sent; Packing the calculated checksum value together with the data to be sent to form a complete data packet; Call the compression module to compress the data packet; At the receiving end, the received data packet is decompressed and the original data and check value are extracted; Recalculate the checksum of the decompressed data and compare the received checksum with the recalculated checksum; In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

[0119] The 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 strategy enables the system to make adaptive adjustments according to real-time network status and data characteristics to meet real-time requirements, facilitate 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 compression and decompression, it is convenient to ensure that the data has not been tampered with or damaged during transmission.

[0120] Fig. 9 An example of a physical structure diagram of an electronic device is shown. The electronic device may be a smart terminal, and its internal structure diagram may be as follows: Fig. 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 the 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, and the method includes: 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 and create compression and decompression functions as independent modules; Dynamically adjust compression strategy based on real-time network status and data characteristics; Add data integrity checking mechanism during compression and decompression.

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

[0122] On the other hand, 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: 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 and create compression and decompression functions as independent modules; Dynamically adjust compression strategy based on real-time network status and data characteristics; Add data integrity checking mechanism during compression and decompression.

[0123] In another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being 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, a compression algorithm optimization method based on a RapidIO protocol stack is implemented, the method comprising: 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 and create compression and decompression functions as independent modules; Dynamically adjust compression strategy based on real-time network status and data characteristics; Add data integrity checking mechanism during compression and decompression.

[0124] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related 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.

[0125] 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 (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0126] The technical features of the above embodiments may be combined arbitrarily. 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.

[0127] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached 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 and create compression and decompression functions as independent modules; Dynamically adjust compression strategy based on real-time network status and data characteristics; Add data integrity checking mechanism during compression and decompression.

2. The compression algorithm optimization method based on RapidIO protocol stack according to claim 1, characterized in that: Determining an applicable compression algorithm according to the data type transmitted by RapidIO includes: Identify the data characteristics and structure of RapidIO transmission; Obtaining 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 step of determining an applicable compression algorithm according to 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 matched 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 step of determining an applicable compression algorithm according to 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 new encoding forms.

5. The compression algorithm optimization method based on RapidIO protocol stack according to claim 4, characterized in that: The step of integrating the selected compression algorithm into the transport layer of the RapidIO protocol stack comprises: Design a standardized interface for the compression module so that it can interact seamlessly with other components of the RapidIO protocol stack. The interface includes functions for data input, compression processing, and data output. 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. The compression algorithm optimization method based on RapidIO protocol stack according to claim 5, characterized in that: The method of dynamically adjusting the compression strategy according to the real-time network status and data characteristics includes: Get the current bandwidth data and the round trip time of the data packet, and calculate the delay time of the data packet; Identify data type and size to determine whether to compress further or transmit directly; Dynamically adjust the compression ratio and determine the applicable compression algorithm based on the real-time monitored network status and data characteristics; Before sending data, call the compression module interface and pass in the dynamically adjusted compression ratio and compression algorithm; At the data receiving end, the compression effect and transmission delay are fed back based on the decompressed data quality and transmission efficiency; 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.

7. The compression algorithm optimization method based on RapidIO protocol stack according to any one of claims 1 to 6, characterized in that: The data integrity verification mechanism is added during the compression and decompression process, including: Based on the integrity check algorithm, calculate the check value of the data to be sent; Packing the calculated checksum value together with the data to be sent to form a complete data packet; Call the compression module to compress the data packet; At the receiving end, the received data packet is decompressed and the original data and check value are extracted; Recalculate the checksum of the decompressed data and compare the received checksum with the recalculated checksum; In response to an error occurring during data transmission, the receiving end sends a retransmission request to the sending end.

8. A compression algorithm optimization device based on RapidIO protocol stack, characterized in that: include: A determination module, used for determining an applicable compression algorithm according to the data type transmitted by RapidIO; 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; An adjustment module is used to dynamically adjust the compression strategy according to the real-time network status and data characteristics; The verification module is used to add a data integrity verification mechanism during the compression and decompression process.

9. 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 described in any one of claims 1 to 7 are implemented.

10. 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 described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Hardware implementation method and system of adaptive compression algorithm based on configurable logic

    CN116578542A

  • Data compression method based on radar algorithm

    CN117895950A

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

    CN118400067A

  • Data processing method based on data compression

    CN118524224A

  • Dynamic bandwidth adaptive image compression / decompression scheme

    US20030039398A1

Cited By

  • Data compression transmission method, device and equipment and readable storage medium

    CN120416347A

  • A data compression transmission method, device, equipment and readable storage medium

    CN120416347B

  • Game role transmission method and device and electronic equipment

    CN121197806A