Decompression method and system of data packet in network on chip, medium and device

By dividing data packets into data blocks of equal length in an on-chip network, and judging and setting the overall basis and compression value bit by bit, the problem of wasted computing resources in the prior art is solved, and efficient lossless data packet compression is achieved.

CN118381831BActive Publication Date: 2026-01-13SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410512146.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2026-01-13
Estimated Expiration
2044-04-26

AI Technical Summary

Technical Problem

Existing on-chip network packet compression methods require traversing every bit of each data block and performing sorting and averaging operations when determining the base, resulting in a waste of time and computing resources.

Method used

The data to be compressed is divided into multiple data blocks of equal length. Each data block is checked bit by bit to see if the corresponding bits are the same. The check stops when the first difference is found. The high bit of the current check is used as the base of the whole, and the low bit is used as the compression value. The data is then assembled into a compressed package and sent to the receiving end for lossless decompression.

Benefits of technology

It reduces the amount of data in the data packets, achieves lossless compression, saves computing resources, improves compression efficiency, and avoids unnecessary sorting and averaging calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118381831B_ABST
    Figure CN118381831B_ABST
Patent Text Reader

Abstract

The application provides a data packet decompression method and system in a network on chip, a medium and an equipment. The method comprises the following steps: obtaining to-be-compressed data; dividing the to-be-compressed data into a plurality of data blocks; judging whether the corresponding bits of each data block are the same in sequence from the most significant bit to the least significant bit, and stopping the judgment when the corresponding bits are not the same for the first time; taking each high bit of the current judgment bit as the overall base of the to-be-compressed data, and taking the current judgment bit and each low bit of the current judgment bit in each data block as the compression value of the data block; assembling a compression package corresponding to the to-be-compressed data; and sending the compression package to a receiving end, so that the receiving end splices the overall base in the compression package with the compression value corresponding to each data block respectively, and realizes lossless decompression of the compression package. The embodiment of the application can reduce the waste of time and computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of on-chip network technology, and in particular to a method, system, medium, and device for decompressing data packets in an on-chip network. Background Technology

[0002] In recent years, multi-core chips have become an important solution for improving hardware computing power, saving space, and reducing costs, and are gradually becoming a development trend. Traditional connection methods such as buses and crossbar switches are increasingly inadequate for multi-core systems, becoming performance bottlenecks. NoC (Network on Chip) emerged to address this, replacing traditional connection architectures. However, NoC also faces challenges such as communication latency and network power consumption. NoC stands for Network on Chip.

[0003] In NoC, data packets are divided into fixed-width slices (Flits) based on link bandwidth. A data request consists of a header slice, while a response packet consists of a header slice, at least one data slice (Body), and a tail slice (Tail). The massive data traffic generated by multi-core communication is the root cause of the aforementioned challenges. Therefore, reducing network traffic is a crucial starting point, which can be achieved by compressing data packets to reduce data traffic.

[0004] Traditional compression methods include differential compression. The basic idea is to set a base for the entire data to be transmitted, and then use the difference between the actual value of each data block and the base as the compressed value to replace the actual value of that data block, thus achieving data compression. At the receiving end, decompression is completed simply by adding the difference to the base, achieving lossless compression. Common differential compression methods generally use the average of the maximum and minimum values ​​of the data block as the base. The problem with this method is that determining the base requires traversing every bit of each data block, performing sorting operations, and averaging calculations, resulting in a waste of time and computational resources.

[0005] Therefore, it is necessary to provide a compression scheme for on-chip networks that can reduce the waste of time and computing resources. Summary of the Invention

[0006] To address at least one of the above technical problems, embodiments of the present invention provide a method, system, medium, and device for decompressing data packets in an on-chip network.

[0007] According to a first aspect, the method for decompressing data packets in an on-chip network provided by embodiments of the present invention includes:

[0008] Obtain the data to be compressed; wherein the data to be compressed is represented in binary format;

[0009] The data to be compressed is divided into multiple data blocks, and each data block has the same number of bits.

[0010] The corresponding bits of each data block are checked one by one in order from the most significant bit to the least significant bit. When the first case of different corresponding bits is encountered during the check, the check of whether the corresponding bits are the same is stopped.

[0011] The high bits of the current judgment bit are used as the overall base of the data to be compressed, and the current judgment bit and the low bits of the current judgment bit in each data block are used as the compression value of the data block.

[0012] Based on the overall base of the data to be compressed and the compression value corresponding to each data block, a compressed package corresponding to the data to be compressed is assembled.

[0013] The compressed package is sent to the receiving end, so that the receiving end splices the overall base in the compressed package with the compression value corresponding to each data block, thereby achieving lossless decompression of the compressed package.

[0014] In one embodiment, the step of determining whether corresponding bits in each data block are the same, bit by bit, in order from the most significant bit to the least significant bit, and stopping the determination of whether subsequent corresponding bits are the same when a different pair of bits is encountered for the first time during the determination process, includes:

[0015] Following the order from the most significant bit to the least significant bit, each bit in each data block is checked to see if the corresponding bits are the same. When the first instance of a different corresponding bit occurs during the check, the check for the sameness of subsequent corresponding bits is stopped, and a compression feature value is determined based on the current check bit. The compression feature value reflects the position of the current check bit.

[0016] Correspondingly, the step of assembling the compressed package corresponding to the data to be compressed based on the overall base of the data to be compressed and the compression value corresponding to each data block includes: assembling the compressed package of the data to be compressed based on the binary representation data of the compression feature value, the overall base of the data to be compressed and the compression value corresponding to each data block.

[0017] Correspondingly, before concatenating the overall base in the compressed package with the compression values ​​corresponding to each data block, the receiving end determines the overall base and each compression value in the compressed package based on the compression feature value.

[0018] In one embodiment, the step of determining whether corresponding bits of each data block are the same bit by bit in order from the most significant bit to the least significant bit, stopping the determination of whether subsequent corresponding bits are the same when the first case of a difference occurs during the determination process, and determining the compression feature value based on the current determined bit, includes the following steps:

[0019] A1. Set the initial value of the compression feature value and the initial value of the current judgment bit i to n-1; where n is the number of bits in each data block;

[0020] A2. Determine whether the i-th bit in each data block is completely identical;

[0021] A3. If they are completely identical, then the compressed feature value is assigned to i, and i is updated by decrementing i by 1.

[0022] A4. Determine if the updated i is less than 0;

[0023] A5. If the updated i is less than 0, then exit the loop;

[0024] A6. If the updated i is greater than or equal to 0, then return A2;

[0025] A7. If they are not completely identical, then exit the loop.

[0026] In one embodiment, determining whether the i-th bit in each data block is completely identical includes:

[0027] Perform a bitwise AND operation on the i-th bit in each data block to obtain the result of the AND operation.

[0028] Perform an OR operation on the i-th bit in each data block to obtain the OR operation result;

[0029] Determine the NOT value of the OR operation result, and calculate the sum of the AND operation result and the NOT value;

[0030] If the sum is 1, then the i-th bit in each of the data blocks is exactly the same;

[0031] If the sum is not 1, then the i-th bit in each of the data blocks is not completely identical.

[0032] In one embodiment, the step of using each high-order bit of the current judgment bit as the overall basis of the data to be compressed, and using the current judgment bit and each low-order bit of the current judgment bit in each data block as the compressed value of the data block, includes:

[0033] If the compression feature value is greater than 0 and less than n-1, then the (n-1)th to the rth bit in any data block is used as the overall basis of the data to be compressed, and the (r-1)th to the 0th bit in each data block is used as the compression value corresponding to that data block, where r is the compression feature value.

[0034] In one embodiment, the step of using each high-order bit of the current judgment bit as the overall basis of the data to be compressed, and using the current judgment bit and each low-order bit of the current judgment bit in each data block as the compressed value of the data block, includes:

[0035] If the compression feature value is 0, then any data block is used as the overall basis of the data to be compressed, and the compression value of each data block is 0.

[0036] In one embodiment, the step of using each high-order bit of the current judgment bit as the overall basis of the data to be compressed, and using the current judgment bit and each low-order bit of the current judgment bit in each data block as the compressed value of the data block, includes:

[0037] If the compression feature value is n-1, then each data block is used as its own compression value, and the overall basis of the data to be compressed is 0.

[0038] According to a second aspect, embodiments of the present invention provide a data packet decompression system for an on-chip network, comprising:

[0039] A data acquisition module is used to acquire data to be compressed; wherein the data to be compressed is represented in binary format.

[0040] The data segmentation module is used to segment the data to be compressed into multiple data blocks, and each data block has the same number of bits.

[0041] The bit comparison module is used to compare the corresponding bits of each data block in order from the most significant bit to the least significant bit. When the first case of a difference in corresponding bits occurs during the comparison process, the comparison of whether the corresponding bits are the same is stopped.

[0042] The first determining module is used to take each high bit of the current judgment bit as the overall basis of the data to be compressed, and take the current judgment bit and each low bit of the current judgment bit in each data block as the compression value of the data block.

[0043] The package assembly module is used to assemble the data to be compressed into a compressed package corresponding to the data to be compressed based on the overall base of the data to be compressed and the compression value corresponding to each data block.

[0044] The packet sending module is used to send the compressed packet to the receiving end, so that the receiving end can concatenate the overall base in the compressed packet with the compression values ​​corresponding to each data block, thereby achieving lossless decompression of the compressed packet.

[0045] According to a third aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method provided in the first aspect.

[0046] According to a fourth aspect, the computing device provided in the embodiments of the present invention includes a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method provided in the first aspect.

[0047] The present invention provides a method, system, medium, and device for decompressing data packets in an on-chip network. The method involves dividing the data to be compressed into multiple data blocks of equal length. Then, following the order from the most significant bit to the least significant bit, it sequentially checks whether corresponding bits in each data block are the same. If a discrepancy is found for the first time during the check, the check stops. The high-order bits of the current check are used as the overall base of the data to be compressed, and the current check bit and its low-order bits in each data block are used as the compressed value of that data block. The overall base of the data to be compressed and the compressed values ​​of each data block are then assembled into a compressed package corresponding to the data to be compressed. This compressed package is sent to a receiving end, whereby the receiving end can concatenate the overall base of the compressed package with the compressed values ​​of each data block, thereby achieving lossless decompression of the compressed package. In the above process, the identical parts of each data block are set as the overall base, and the non-identical parts are used as their respective compression values. Since the overall base applies to each data block, the data size of the data packet can be reduced, and lossless compression can be achieved. The receiving end can also achieve lossless decompression. Because this embodiment of the invention only involves AND-OR operations with low computational resource consumption, and avoids redundant operations that do not contribute to the compression operation as much as possible, it is not necessary to traverse every bit of each data block and perform sorting and averaging operations. Therefore, compared with the prior art, it can reduce the waste of time and computational resources, thus improving compression efficiency and saving computational resources. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating a method for decompressing data packets in an on-chip network according to an embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the data structure of a compressed package in one embodiment of the present invention;

[0050] Figure 3 This is a flowchart illustrating a method for decompressing data packets in an on-chip network according to an embodiment of the present invention;

[0051] Figure 4 This is a structural block diagram of a data packet decompression system in an on-chip network according to an embodiment of the present invention. Detailed Implementation

[0052] In a first aspect, embodiments of the present invention provide a method for decompressing data packets in an on-chip network, see [link to relevant documentation]. Figure 1 The method includes the following steps S110 to S160:

[0053] S110. Obtain the data to be compressed; wherein the data to be compressed is represented in binary format;

[0054] S120. Divide the data to be compressed into multiple data blocks, and each data block has the same number of bits.

[0055] For example, the data block to be compressed is divided into k data blocks: c1, c2…c k Each data block c has n bits.

[0056] S130. In order from the most significant bit to the least significant bit, check whether the corresponding bits of each data block are the same. When the first case of different corresponding bits occurs during the check, stop checking whether the corresponding bits are the same.

[0057] In this data block, the most significant bit is the (n-1)th bit and the least significant bit is the 0th bit.

[0058] For example, the leftmost bit is the most significant bit, and the rightmost bit is the least significant bit. The order from the most significant bit to the least significant bit is the same as the order from left to right.

[0059] In other words, following the order from the (n-1)th bit to the 0th bit, first check if the (n-1)th bit in each data block is the same. If the (n-1)th bit in each data block is the same, then check if the (n-2)th bit in each data block is the same. If the (n-2)th bit in each data block is the same, then check if the (n-3)th bit in each data block is the same, and so on. For example, when checking the njth bit, if the njth bit in each data block is found to be different, then the subsequent checking process stops, and the njth bit is the current checking bit. Here, j is a positive integer greater than or equal to 1 and less than or equal to n.

[0060] S140. Take each high bit of the current judgment bit as the overall base of the data to be compressed, and take the current judgment bit and each low bit of the current judgment bit in each data block as the compression value of the data block.

[0061] For example, when determining the nj-th bit, it is found that the nj-th bit is different in each data block. At this point, bits from (n-j+1)-n-1 are the same in each data block, and bits from (n-j+1)-n-1 are all the high-order bits of the current determination bit (i.e., the nj-th bit). Therefore, the data from (n-j+1)-n-1 can be used as the overall base. During compression, the compressed package only needs to store bits from (n-j+1)-n-1 of one data block. Bits from (nj-1)-0 are the low-order bits of the current determination bit. Therefore, for each data block, bits from nj-0 are used as the compressed value of that data block. During compression, the compressed package needs to include the compressed values ​​of all data blocks.

[0062] S150. Based on the overall base of the data to be compressed and the compression value corresponding to each data block, assemble the data into a compressed package corresponding to the data to be compressed.

[0063] S160. The compressed package is sent to the receiving end, so that the receiving end splices the overall base in the compressed package with the compression value corresponding to each data block, thereby achieving lossless decompression of the compressed package.

[0064] In other words, the overall base and the compressed values ​​corresponding to each data block are assembled to form a compressed package. The compressed package is sent to the receiving end. After receiving the compressed package, the receiving end parses it to obtain the overall base and the compressed values ​​of each data block. Then, the overall base is concatenated with the compressed values ​​corresponding to each data block to obtain the individual data blocks, thus achieving lossless decompression.

[0065] In one embodiment, S140 may include:

[0066] If the compression feature value is greater than 0 and less than n-1, then the (n-1)th to the rth bit in any data block is used as the overall basis of the data to be compressed, and the (r-1)th to the 0th bit in each data block is used as the compression value corresponding to that data block, where r is the compression feature value.

[0067] That is, if r is greater than 0 and less than n-1, then bits n-1 to r are used as the overall basis, and bits r-1 to 0 of each data block are used as the compressed value of that data block. This is the most common case, where the compression feature value is neither 0 nor n-1, but rather between 0 and n-1.

[0068] In one embodiment, S140 may include:

[0069] If the compression feature value is 0, then any data block is used as the overall basis of the data to be compressed, and the compression value of each data block is 0.

[0070] Understandably, if the compression feature value is 0, it means that all data blocks are the same. In this case, the compression value of each data block is 0, and any one data block is used as the overall basis.

[0071] In one embodiment, S140 may include:

[0072] If the compression feature value is n-1, then each data block is used as its own compression value, and the overall basis of the data to be compressed is 0.

[0073] Understandably, the compression feature value of n-1 indicates two possibilities: either the data blocks differ at the (n-1)th bit, or the data blocks are the same at the (n-1)th bit but different at the (n-2)th bit. In practice, further differentiation between these two cases would require introducing additional compression feature values, which would introduce extra data length. Therefore, these two cases are combined into one, both considered incompressible, i.e., the overall basis is 0, and each bit of each data block is used as the compression value for that data block.

[0074] The compression feature values ​​of 0 and n-1 are relatively uncommon. With a compression feature value of 0, only one data block is needed to represent all data blocks, resulting in the highest compression ratio. However, with a compression feature value of n-1, no effective compression occurs, resulting in the lowest compression ratio.

[0075] In one embodiment, S130 may specifically include:

[0076] Following the order from the most significant bit to the least significant bit, each bit in each data block is checked to see if the corresponding bits are the same. When the first instance of a different corresponding bit occurs during the check, the check for the sameness of subsequent corresponding bits is stopped, and a compression feature value is determined based on the current check bit. The compression feature value reflects the position of the current check bit.

[0077] In other words, in S130, when the corresponding bits are different for the first time during the judgment process, in addition to stopping the subsequent judgment, the compressed feature value is also determined. The compressed feature value can reflect the position of the current judgment bit, but it does not mean that the compressed feature value is the same as the current judgment bit. Rather, the compressed feature value can determine the position of the first occurrence of the corresponding bits being different.

[0078] If the compression feature value is determined in S130, S150 may include: assembling the compressed package of the data to be compressed according to the binary representation data of the compression feature value, the overall basis of the data to be compressed, and the compression value corresponding to each data block.

[0079] Furthermore, in S130, when the compression feature value is determined, the receiving end determines the overall base and each compression value in the compressed package based on the compression feature value before splicing the overall base in the compressed package with the compression value corresponding to each data block.

[0080] In other words, the compressed feature value's binary representation, the overall basis, and the compressed value corresponding to each data block are assembled to obtain a compressed packet. For example, if the binary representation of the compressed feature value occupies 3 bits in the compressed packet, the receiving end can determine the position of the first instance where the corresponding bits differ in each data block by using the binary representation of the compressed feature value in the compressed packet. This allows the receiving end to determine the number of bits occupied by the overall basis in the compressed packet, and thus the number of bits occupied by the compressed value of each data block. Therefore, adding the binary representation of the compressed feature value to the compressed packet greatly facilitates decompression by the receiving end.

[0081] Of course, if the method of adding compression feature values ​​to the compressed data in binary representation is not used, other methods can be used to let the receiving end know which bits of data belong to the overall base and which bits belong to the compressed values ​​of each data block. However, using the method of adding compression feature values ​​to the compressed data in binary representation is a preferred method because it is simple to implement for the compressed segment and convenient to use for the receiving end.

[0082] Furthermore, the step of checking whether corresponding bits of each data block are the same bit by bit in order from the most significant bit to the least significant bit, and stopping the checking of subsequent corresponding bits when the first case of a different corresponding bit occurs during the checking process, and determining the compression feature value based on the current checked bit, may specifically include the following steps A1 to A7:

[0083] A1. Set the initial value of the compression feature value and the initial value of the current judgment bit i to n-1; where n is the number of bits in each data block;

[0084] A2. Determine whether the i-th bit in each data block is completely identical;

[0085] A3. If they are completely identical, then the compressed feature value is assigned to i, and i is updated by decrementing i by 1.

[0086] A4. Determine if the updated i is less than 0;

[0087] A5. If the updated i is less than 0, then exit the loop;

[0088] A6. If the updated i is greater than or equal to 0, then return A2;

[0089] A7. If they are not completely identical, then exit the loop.

[0090] For example, if n is 8, then the initial value of the compressed feature value and the initial value of the current judgment bit i are both 7. First, it checks whether the 7th bit of each data block is completely identical (either all 0 or all 1). If they are completely identical, the compressed feature value is assigned 7, i is updated to 6, and the loop continues to the next iteration, checking whether the 6th bit of each data block is identical. This continues until the 4th bit of each data block is checked, at which point the loop exits. At this point, the compressed feature value is 5, and the current control bit i is 4.

[0091] As can be seen, based on A1 to A7 above, the compression feature value and the current control bit i can be determined.

[0092] Furthermore, the determination of whether the i-th bit in each data block is completely identical, as described in A2, may include the following steps A21 to A25:

[0093] A21. Perform a bitwise AND operation on the i-th bit in each data block to obtain the result of the AND operation.

[0094] That is, by using andout = c1[i]&c2[i]&…&c k [i] determines the result of the operation.

[0095] Understandably, if the i-th bit of each data block is 1, then andout is 1. If the i-th bit of any data block is 0, then andout is 0.

[0096] A22. Perform an OR operation on the i-th bit in each data block to obtain the OR operation result;

[0097] That is, by orout = c1[i]||c2[i]||…||c k [i] determines or operates on the result.

[0098] Understandably, if the i-th bit of each data block is 0, then the orout output is 0. If the i-th bit of any data block is 1, then the orout output is 1.

[0099] A23. Determine the NOT value of the OR operation result, and calculate the sum of the AND operation result and the NOT value;

[0100] A24. If the sum is 1, then the i-th bit in each of the data blocks is exactly the same;

[0101] A25. If the sum is not 1, then the i-th bit in each of the data blocks is not completely the same.

[0102] That is, when andout+! orout = 1, it means that the i-th bit of each data block is the same. If andout+! orout is not equal to 1, it means that the i-th bit of each data block is not completely the same.

[0103] Thus, the determination of whether the i-th bit in each data block is completely identical has been achieved.

[0104] Referring to Table 1 below, we can see the correspondence between the binary representation of the compressed feature value, the corresponding data feature, the length of the overall basis, and the length of the compressed value.

[0105] Table 1 Correspondence Table

[0106]

[0107] See Figure 2 From this, we can see that the compressed data structure includes a 3-bit compression word (the binary representation of the compression feature value), an overall base, and compressed values ​​for k data blocks. Therefore, a compressed data package includes a 3-bit compression word, a 0-8 bit overall base, k 0-8 bit compressed values, and the sum of the bit widths of the overall base and the compressed values ​​in a single data block is 8. Figure 2 In this context, the compression value in each data block is p bits.

[0108] See Figure 3 A slice is treated as a string of binary data to be compressed. The slice is divided into k data blocks, each containing 8 bits of binary data. The 7th bit of each of the k data blocks is input to an AND gate and an OR gate. The output of the OR gate is then NOT processed, and the two results are summed. If the sum is 1, the compression feature value is updated, and the process of checking the 6th bit is resumed. If the sum is not 1, the loop is exited, and the overall basis and the compression values ​​of each data block are determined based on the current compression feature value, thus forming the compressed packet.

[0109] In summary, in this embodiment of the invention, the identical parts of each data block are set as the overall base, and the non-identical parts are used as their respective compression values. Since the overall base applies to each data block, the amount of data in the data packet can be reduced, and lossless compression can be achieved. The receiving end can also achieve lossless decompression. Because this embodiment of the invention only involves AND / OR operations with low computational resource consumption, and avoids redundant operations that do not contribute to the compression operation as much as possible, it does not require traversing every bit of each data block and performing sorting and averaging operations. Therefore, compared with the prior art, it can reduce the waste of time and computational resources, thus improving compression efficiency and saving computational resources.

[0110] Secondly, embodiments of the present invention provide a data packet decompression system in an on-chip network, see [link to relevant documentation]. Figure 4 The system 100 includes:

[0111] The data acquisition module 110 is used to acquire data to be compressed; wherein the data to be compressed is represented in binary format.

[0112] The data segmentation module 120 is used to segment the data to be compressed into multiple data blocks, and each data block has the same number of bits.

[0113] The bit comparison module 130 is used to compare the corresponding bits of each data block in order from the most significant bit to the least significant bit. When the first case of different corresponding bits occurs during the comparison process, the comparison of whether the corresponding bits are the same is stopped.

[0114] The first determining module 140 is used to take each high bit of the current judgment bit as the overall basis of the data to be compressed, and take the current judgment bit and each low bit of the current judgment bit in each data block as the compression value of the data block.

[0115] Package assembly module 150 is used to assemble the data to be compressed into a compressed package corresponding to the data to be compressed based on the overall base of the data to be compressed and the compression value corresponding to each data block.

[0116] The packet sending module 160 is used to send the compressed packet to the receiving end, so that the receiving end can concatenate the overall base in the compressed packet with the compression value corresponding to each data block, thereby achieving lossless decompression of the compressed packet.

[0117] In one embodiment, the bit comparison module is specifically used to: determine whether the corresponding bits of each data block are the same in order from the most significant bit to the least significant bit; when the first case of different corresponding bits occurs during the determination process, stop determining whether the subsequent corresponding bits are the same, and determine the compression feature value based on the current determined bit; wherein the compression feature value can reflect the position of the current determined bit.

[0118] Correspondingly, the package assembly module is specifically used to: assemble the compressed data into a compressed package based on the binary representation data of the compression feature value, the overall basis of the data to be compressed, and the compression value corresponding to each data block;

[0119] Correspondingly, before concatenating the overall base in the compressed package with the compression values ​​corresponding to each data block, the receiving end is further configured to: determine the overall base and each compression value in the compressed package based on the compression feature value.

[0120] In one embodiment, the bit comparison module includes:

[0121] The initial setting unit is used to perform: A1, setting the initial value of the compression feature value and the initial value of the current judgment bit i to n-1; where n is the number of bits in each data block;

[0122] The comparison and judgment unit is used to perform: A2, judging whether the i-th bit in each data block is completely identical;

[0123] The assignment update unit is used to perform: A3, if they are completely identical, then assign the compressed feature value to i, and update i by decrementing i by 1;

[0124] The first judgment unit is used to execute: A4, determine whether the updated i is less than 0;

[0125] The first exit unit is used to execute: A5, if the updated i is less than 0, then exit the loop;

[0126] The first return unit is used to execute: A6, if the updated i is greater than or equal to 0, then return A2;

[0127] The second exit unit is used to execute: A7, if they are not exactly the same, then exit the loop.

[0128] In one embodiment, the comparison and judgment unit is specifically used to: perform an AND operation on the i-th bit in each data block to obtain an AND operation result; perform an OR operation on the i-th bit in each data block to obtain an OR operation result; determine the NOT value of the OR operation result, and calculate the sum of the AND operation result and the NOT value; if the sum is 1, then the i-th bit in each data block is completely identical; if the sum is not 1, then the i-th bit in each data block is not completely identical.

[0129] In one embodiment, the first determining module is specifically used to: if the compression feature value is greater than 0 and less than n-1, then take the (n-1)th to the rth bit in any data block as the overall basis of the data to be compressed, and take the (r-1)th to the 0th bit in each data block as the compression value corresponding to that data block, where r is the compression feature value.

[0130] In one embodiment, the first determining module is specifically used to: if the compression feature value is 0, then any data block is used as the overall basis of the data to be compressed, and the compression value of each data block is 0.

[0131] In one embodiment, the first determining module is specifically used to: if the compression feature value is n-1, then each data block is used as its own compression value, and the overall basis of the data to be compressed is 0.

[0132] It is understood that explanations of the contents, specific implementation methods, beneficial effects, examples, etc. in the system provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0133] Thirdly, embodiments of the present invention provide a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to perform the method provided in the first aspect.

[0134] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0135] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0136] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0137] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0138] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0139] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0140] Fourthly, one embodiment of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method of any embodiment of the specification.

[0141] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the computing device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0142] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0143] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, widgets, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0144] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for decompression of data packets in a network-on-chip, characterized in that, The method comprises the following steps: acquiring to-be-compressed data; wherein the to-be-compressed data adopts a binary representation mode; segmenting the to-be-compressed data into a plurality of data blocks, and the number of bits of each data block is the same; judging whether the corresponding bits of each data block are the same in sequence from the most significant bit to the least significant bit, and stopping the judgment of whether the corresponding bits are the same in the subsequent process when the corresponding bits are not the same for the first time in the judgment process; taking each high bit of the current judgment bit as the overall base of the to-be-compressed data, and taking the current judgment bit and each low bit of the current judgment bit in each data block as the compression value of the data block; assembling a compression package corresponding to the to-be-compressed data according to the overall base of the to-be-compressed data and the compression value corresponding to each data block; sending the compression package to a receiving end to make the receiving end splice the overall base in the compression package with the compression value corresponding to each data block respectively, so as to realize lossless decompression of the compression package.

2. The method of claim 1, wherein, The method of judging whether the corresponding bits of each data block are the same in sequence from the most significant bit to the least significant bit, and stopping the judgment of whether the corresponding bits are the same in the subsequent process when the corresponding bits are not the same for the first time in the judgment process comprises the following steps: judging whether the corresponding bits of each data block are the same in sequence from the most significant bit to the least significant bit, and stopping the judgment of whether the corresponding bits are the same in the subsequent process when the corresponding bits are not the same for the first time in the judgment process, and determining a compression characteristic value according to the current judgment bit; wherein the compression characteristic value can reflect the position of the current judgment bit; correspondingly, the method of assembling a compression package corresponding to the to-be-compressed data according to the overall base of the to-be-compressed data and the compression value corresponding to each data block comprises the following steps: assembling a compression package of the to-be-compressed data according to the binary representation data of the compression characteristic value, the overall base of the to-be-compressed data, and the compression value corresponding to each data block; correspondingly, the receiving end determines the overall base in the compression package and each compression value according to the compression characteristic value before splicing the overall base in the compression package with the compression value corresponding to each data block.

3. The method of claim 2, wherein, The method of judging whether the corresponding bits of each data block are the same in sequence from the most significant bit to the least significant bit, and stopping the judgment of whether the corresponding bits are the same in the subsequent process when the corresponding bits are not the same for the first time in the judgment process, and determining a compression characteristic value according to the current judgment bit comprises the following steps: A1, setting the initial value of the compression characteristic value and the initial value of the current judgment bit i as n-1; wherein n is the number of bits of each data block; A2, judging whether the i-th bit in each data block is completely the same; A3, if they are completely the same, assigning the compression characteristic value as i, and updating i by reducing 1; A4, judging whether the updated i is less than 0; A5, if the updated i is less than 0, jumping out of the loop; A6, if the updated i is greater than or equal to 0, returning to A2; A7, if they are not completely the same, jumping out of the loop.

4. The method of claim 3, wherein, The judging whether the i-th bit in each data block is completely same includes: performing AND operation on the i-th bit in each data block to obtain an AND operation result; performing OR operation on the i-th bit in each data block to obtain an OR operation result; determining a non-value of the OR operation result and calculating a sum of the AND operation result and the non-value; if the sum is 1, the i-th bit in each data block is completely same; if the sum is not 1, the i-th bit in each data block is not completely same.

5. The method of claim 3, wherein, The taking each high bit of the current judging bit as the overall base of the data to be compressed and taking the current judging bit and each low bit of the current judging bit in each data block as the compression value of the data block includes: if the compression characteristic value is greater than 0 and less than n-1, taking the n-1-th bit to the r-th bit in any one data block as the overall base of the data to be compressed and taking the r-1-th bit to the 0-th bit in each data block as the compression value corresponding to the data block, wherein r is the compression characteristic value.

6. The method of claim 3, wherein, The taking each high bit of the current judging bit as the overall base of the data to be compressed and taking the current judging bit and each low bit of the current judging bit in each data block as the compression value of the data block includes: if the compression characteristic value is 0, taking any one data block as the overall base of the data to be compressed and the compression value of each data block is 0.

7. The method of claim 3, wherein, The taking each high bit of the current judging bit as the overall base of the data to be compressed and taking the current judging bit and each low bit of the current judging bit in each data block as the compression value of the data block includes: if the compression characteristic value is n-1, taking each data block as its compression value and the overall base of the data to be compressed is 0.

8. A system for decompression of data packets in a network-on-chip, characterized in that, The method includes: a data acquisition module configured to acquire data to be compressed, wherein the data to be compressed is in binary representation; a data segmentation module configured to segment the data to be compressed into a plurality of data blocks, and the number of bits in each data block is the same; a bit comparison module configured to judge whether corresponding bits of each data block are the same in order from the most significant bit to the least significant bit, and stop judging whether the corresponding bits are the same when the corresponding bits are not the same for the first time in the judging process; a first determination module configured to take each high bit of the current judging bit as the overall base of the data to be compressed and take the current judging bit and each low bit of the current judging bit in each data block as the compression value of the data block; a package assembling module configured to assemble a compression package corresponding to the data to be compressed according to the overall base of the data to be compressed and the compression value corresponding to each data block; a package sending module configured to send the compression package to a receiving end to make the receiving end splice the overall base in the compression package with the compression value corresponding to each data block respectively to realize lossless decompression of the compression package.

9. A computer-readable storage medium, characterized in that, The computer program stored thereon, when executed in a computer, causes the computer to execute the method of any one of claims 1-7. The computer program stored thereon, when executed in a computer, causes the computer to execute the method of any one of claims 1-7.

10. A computing device, comprising: An apparatus comprising a memory having executable code stored therein and a processor that implements the method of any one of claims 1-7 when executing the executable code. An apparatus comprising a memory having executable code stored therein and a processor that implements the method of any one of claims 1-7 when executing the executable code.

Citation Information

Patent Citations

  • Data transmission method and device over the air

    CN106230990A

  • Method for compressing and decompressing a data packet under high-frequency sampling of GNSS equipment

    CN109768959A