CN101667843A - Methods and devices for compressing and uncompressing data of embedded system - Google Patents

Methods and devices for compressing and uncompressing data of embedded system Download PDF

Info

Publication number
CN101667843A
CN101667843A CN200910093863A CN200910093863A CN101667843A CN 101667843 A CN101667843 A CN 101667843A CN 200910093863 A CN200910093863 A CN 200910093863A CN 200910093863 A CN200910093863 A CN 200910093863A CN 101667843 A CN101667843 A CN 101667843A
Authority
CN
China
Prior art keywords
byte
byte serial
serial
data
sliding window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN200910093863A
Other languages
Chinese (zh)
Other versions
CN101667843B (en
Inventor
杨河山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN2009100938637A priority Critical patent/CN101667843B/en
Publication of CN101667843A publication Critical patent/CN101667843A/en
Application granted granted Critical
Publication of CN101667843B publication Critical patent/CN101667843B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for compressing data of an embedded system, which comprises the following steps: confirming same byte strings in data to be compressed and replacing the same byte strings besides the first byte string by the distance of the same byte strings and the number of same bytes. The invention also discloses a method for uncompressing data of the embedded system, which comprises the following steps: when the compressed data contain a compressing mark, acquiring the distance and the byte number instead of the byte strings, acquiring bytes with the byte number in the distance in the uncompressed data and filling the current uncompressed data. The invention also discloses devices for realizing the methods. The invention is particularly suitable for the embedded systemwith byte stream transmission, the more the repeated byte strings transmitted by a byte stream in the embedded system is, and the higher the data compression ratio is, thereby the CPU occupation rateof the embedded system is in a lower level.

Description

The data compression of embedded system, and decompression method and device
Technical field
The present invention relates to data compression technique, relate in particular to a kind of data compression method and device of embedded system, and decompression method and device.
Background technology
In the process of embedded system data link transmission data, when data traffic is very big, tend to cause the obstruction of link, can produce very large influence to the veneer that data report simultaneously, power system capacity is reduced greatly, even can cause board resetting.For example at code division multiple access (CDMA, Code Division MultipleAccess) gives the correct time in the EVDO channel board daily record of system, when data volume is big, will there be lot of data packet loss phenomenon, and when reporting option, data have when a plurality of, because the obstruction of link is easy to cause board resetting, bring a lot of risks to system, also increased difficulty for simultaneously outside agency's orientation problem.For accurate orientation problem, report when realizing a plurality of data item, and packet loss is dropped to minimum, proposed in daily record, to give the correct time, earlier it is carried out data compression, carry out data decompression again at receiving terminal.Thereby reduced the packet loss problem, avoided the congested of data transmission link.Because traditional compression method, be based on all that file compresses, and all on PC, compress, need not consider the occupancy of CPU, but in embedded system, all data all are to occur with the form of byte stream, have no idea to compress storage, can only compress buffered data streams in the mode of file, and because the transmission of data is continual processes, need consider occupancy, the memory usage of CPU, also need to consider simultaneously compression ratio.At present, Shang Weiyou is specially at the technical scheme than suitable data compression of embedded system.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of data compression method and device of embedded system, and decompression method and device, can the byte stream in the embedded system be compressed well, is beneficial to transfer of data.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of data compression method of embedded system comprises:
Determine byte serial identical in the data to be compressed, except that first byte serial, use to replace described identical byte serial in the identical byte serial with the distance of identical bytes string and the number of identical bytes.
Preferably, described method also comprises:
During the transmission data, for packed data and packed data are not provided with the sign position respectively.
Preferably, the number of the distance of described and identical bytes string and identical bytes uses gamma Gamma coded system to encode.
Preferably, describedly determine byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, the byte serial identical with described byte serial arranged then, then continue the described sliding window that slides, up to determining and the identical slab string of byte serial before, and determine distance with identical before byte serial.
Preferably, describedly determine byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, then determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the back sliding window of the byte serial identical and nearest with byte serial described in the last sliding window whether with current sliding window in byte serial identical, determine the identical slab string of byte serial, and whether the byte number of judging the slab string that byte serial is identical reaches setting threshold, then judge whether when not reaching also to exist with byte serial is identical for the first time sliding window in other identical byte serials of byte serial, reach setting threshold up to the byte number of the identical slab string of the byte serial of determining; Or determine not exist with the identical sliding window of the byte serial first time in other identical byte serials of byte serial, and with the identical slab string of determined byte serial as final identical byte serial.
Preferably, described method also comprises:
Determine in the described sliding window byte serial and byte serial before not simultaneously, described byte serial is stored in the node of index chained list, the side-play amount of record identical bytes string is zero, writes down node in described index chained list the sequence valve of the data of described byte serial corresponding address storage in class table array for the described byte serial of storage; Determine that byte serial in the described sliding window is when byte serial is identical before, described byte serial is stored in the node of index chained list, the side-play amount of described byte serial and current nearest identical bytes string writes down node in described index chained list the sequence valve of the data of described byte serial corresponding address storage in class table array for the described byte serial of storage as the side-play amount of described byte serial.
A kind of uncompressing data of embedded system comprises:
When including compressing mark in the packed data, obtain the distance and the byte number that replace byte serial, and obtain out the byte of described byte number, insert in the current decompressed data in distance described in the data of decompress(ion).
Preferably, described distance and the byte number that replaces byte serial that obtain comprises:
Use the Gamma coded system that the distance that replaces byte serial in the packed data and byte number are decoded and obtain described distance and described byte number.
A kind of data compression device of embedded system comprises:
Determining unit is used for determining the identical byte serial of data to be compressed; And
Compression unit is used for identical byte serial except that first byte serial, uses to replace described identical byte serial with the distance of identical bytes string and the number of identical bytes.
Preferably, described device also comprises:
The unit is set, when being used to transmit data, for packed data and packed data are not provided with the sign position respectively.
Preferably, described device also comprises:
Coding unit is used for using the Gamma coded system to encode with the distance of identical bytes string and the number of identical bytes.
Preferably, described determining unit is determined byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, the byte serial identical with described byte serial arranged then, then continue the described sliding window that slides, up to determining and the identical slab string of byte serial before, and determine distance with identical before byte serial.
Preferably, described determining unit is determined byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, then determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the back sliding window of the byte serial identical and nearest with byte serial described in the last sliding window whether with current sliding window in byte serial identical, determine the identical slab string of byte serial, and whether the byte number of judging the slab string that byte serial is identical reaches setting threshold, then judge whether when not reaching also to exist with byte serial is identical for the first time sliding window in other identical byte serials of byte serial, reach setting threshold up to the byte number of the identical slab string of the byte serial of determining; Or determine not exist with the identical sliding window of the byte serial first time in other identical byte serials of byte serial, and with the identical slab string of determined byte serial as final identical byte serial.
A kind of data decompression compression apparatus of embedded system comprises:
Determining unit when being used for determining that packed data includes compressing mark, triggers acquiring unit;
Acquiring unit is used to obtain distance and the byte number that replaces byte serial; And
The decompress(ion) unit is used for obtaining out the byte of described byte number in distance described in the data of decompress(ion), and inserts in the current decompressed data.
Among the present invention, bytes of stream data at embedded system, in data to be transmitted, determine all identical byte serials, for with identical before byte serial, use with the distance of identical before byte serial and identical byte number and replace this identical byte serial, because what replace byte serial only is two numerals, thereby significantly reduced the data volume of byte to be transmitted, thereby reached compression to bytes of stream data, during decompress(ion), for packed byte not, directly output gets final product, for the packed byte string, be reversed decompress(ion) by the compression mode and get final product.The present invention especially is fit to the embedded system of byte stream transmission, and the repetition byte string of the transmission of the byte stream in the embedded system is many, and therefore, data compression rate is than higher, thereby the CPU usage of embedded system is remained at low levels.
Description of drawings
Fig. 1 is the schematic diagram of the data compression method of embedded system of the present invention;
Fig. 2 is the composition structural representation of the data compression device of embedded system of the present invention;
Fig. 3 connects the composition structural representation of compression set for the data of embedded system of the present invention.
Embodiment
Basic thought of the present invention is: at the bytes of stream data of embedded system, in data to be transmitted, determine all identical byte serials, for with identical before byte serial, use with the distance of identical before byte serial and identical byte number and replace this identical byte serial, because what replace byte serial only is two numerals, thereby significantly reduced the data volume of byte to be transmitted, thereby reached compression to bytes of stream data, during decompress(ion), for packed byte not, directly output gets final product, and for the packed byte string, is reversed decompress(ion) by the compression mode and gets final product.The present invention especially is fit to the embedded system of byte stream transmission, and the repetition byte string of the transmission of the byte stream in the embedded system is many, and therefore, data compression rate is than higher, thereby the CPU usage of embedded system is remained at low levels.
For making the purpose, technical solutions and advantages of the present invention clearer, by the following examples and with reference to accompanying drawing, the present invention is described in more detail.
The contraction principle that the present invention once adopts at first is described, with character string " abcdef1234abcdeki1234 " is that example describes, in this character string, find out the identical byte serial of content, the part that brackets with " () " is exactly the identical part of byte serial below, as: abcdef1234 (abcde) ki (1234).The present invention uses the distance between the identical bytes string and a pair of like this information of number (or length) of identical characters, replace identical byte serial, can be expressed as above-mentioned byte serial: abcdef1234 (10,5) ki (11,4), wherein, " 10 " in " (10; 5) " are the distance between identical bytes string and the current location, and " 5 " are the number (or length) of identical bytes string.In like manner, " 11 " in " (11,4) " are the distance between identical bytes string and the current location, and " 4 " are the number of identical bytes string.Because the distance between the identical bytes string and this a pair of information of identical bytes number are much smaller than the size of superseded byte serial, the byte serial in the byte stream of transmission has obtained compression.
Below, further illustrate the essence of technical solution of the present invention by concrete example.
Fig. 1 is the schematic diagram of the data compression method of embedded system of the present invention, and as shown in Figure 1, the present invention is an example with byte stream " abcdef1234abcki123abcde1234 ", the essence scheme of sets forth in detail data compression of the present invention.
As shown in Figure 1, for byte stream to be compressed is provided with the index chained list that the store byte string is used, and the class table array m_awSortTable[of store byte string matching status is set], the data of storing in this array are 0 o'clock, represent that the byte serial in the current sliding window does not have identical with it byte serial in byte serial before, and class table array m_awSortTable[] in the storage data be not 0 o'clock, represent that the byte serial in the current sliding window has identical with it byte serial in byte serial before.Determine the memory address of this byte serial matching status in class table array according to the content of the concrete byte serial in the sliding window, below will describe in detail.Sliding window size in this example is 2 bytes, and the size of sliding window can be set arbitrarily according to concrete needs, its size for example is set is 3,4 bytes etc.
Begin by the whole byte stream of sliding window size traversal from the beginning of byte stream, at first find " ab " 2 byte serials, the matching status that calculates " ab " byte serial is at m_awSortTable[] in memory address, concrete, determine by " a * 256+b ", " a * 256+b " is equivalent to determine the hash value of " ab " byte serial, by searching m_awSortTable[a * 256+b], confirm as 0, because the current byte serial that does not exist with " ab " byte serial identical (coupling), then " ab " is inserted in the node 1 of index chained list, and with the wOffSet of node 1 correspondence, wSameOffSet and wnext carry out assignment, promptly be 0 entirely, wOffSet represents the side-play amount of current byte serial and nearest before identical byte serial, wSameOffSet represents whether current byte serial is the byte serial of identical bytes, determine promptly whether current byte serial is similar " aa ", " bb ", the identical byte serials of byte such as " 22 ", it in this example the identical byte serial of non-byte, the wSameOffSet value is 0, and when being the identical byte serial of byte, the wSameOffSet value is 1; Wnext be with identical byte serial between side-play amount, be to determine and the side-play amount of nearest byte serial (or distance) before that owing to there is not identical with it byte serial, therefore, this wnext is 0 among the present invention.Revise m awSortTable[a * 256+b]=1, expression " ab " has been inserted in the node 1 of index chained list.
Make sliding window slide backward a byte, sliding window is current to be " bc " 2 byte serials, does not still deposit the byte serial that matches in the byte serial before determining, with " ab " identical mode, " bc " inserted the node 2 of index chained list, wherein, the wOffSet=0 of node 2 correspondences, wSameOffSet=0, wnext=0, need to prove, this moment m_awSortTable[b * 256+c]=2 (these are worth and are sky before, are 0).
Slide backward sliding window so always, next " ab " 2 byte serials appear in sliding window, by calculating the class table group address of " ab " byte serial, find m_awSortTable[a * 256+b] be not 0, " ab " byte serial had appearred once in proof in front, and by inquiry m_awSortTable[a * 256+b]=1 can know that the byte serial identical with this byte serial is stored in the node 1 of index chained list, this moment is from these two identical byte serials " ab ", sliding window slides respectively after two identical byte serials, by the aforementioned manner byte serial in two sliding windows relatively one by one, till inequality, draw maximum identical bytes string, for this example, promptly determine three identical bytes " abc ".And calculate from the difference of the 11st node (node number of second byte serial " abc " or " ab " storage the index chained list) and the 1st node (node number of first byte serial " abc " or " ab " storage in the index chained list), the distance that obtains between two byte serials is " 10 ", and the byte number (or length) of the identical bytes of getting back simultaneously string is " 3 ".And with m_awSortTable[a * 256+b]=11 (11 is the corresponding node number of second byte serial " ab ").
Then continue the slip sliding window, when " 12 " 2 byte serials occurring in the sliding window, find m_awSortTable[1 * 256+2]=7, illustrate and occurred once " 12 " byte serial in the byte stream in front, the same one step process, obtain maximum identical characters, three repeat character (RPT)s " 123 " and distance between the two " 9 ".
Continue the slip sliding window, when " ab " 2 byte serials appear in sliding window once more, find m_awSortTable[a * 256+b]=11, illustrate and occurred once " ab " byte serial in the byte stream in front, utilization obtains byte serial (distance between the two with node 11 places with upper type, the byte length of identical bytes string), at this moment find the wnext=1 of node 11 correspondences, explanation also has " ab " byte serial at node 1, at this moment, to obtain (between the two the distance of byte stream current location in above step simultaneously to node 1 position, the byte length of identical bytes string), compare " byte length of identical bytes string " that obtain for twice, the identical bytes string that a maximum conduct is finally determined.In this example, the byte length of the identical bytes string between the byte serial in the node 1 of current byte serial " ab " and index chained list is big, is " 5 ", then replaces byte serial " abcde " with (18,5).
Need to prove, when sliding window slides into " ab " at node 19 places, the present invention also can carry out the coupling of byte serial earlier to the byte serial at node 11 places, determine that " byte length of identical bytes string " is " 3 ", then compare with preset threshold (as being set to 4), during more than or equal to threshold value, then directly with the maximal phase of this nearest identical bytes string with byte number as the same byte number of final maximal phase; The identical bytes length of determining is during less than setting threshold, determine whether this nearest identical bytes string (" ab ") also has this identical byte serial (" ab ") before, and determine and " byte length of identical bytes string " of time near identical bytes string, and with preset threshold relatively, if less than setting threshold whether would also have before continuing to search with current sliding window in identical byte serial (" ab "), up to " byte length of identical bytes string " that find out greater than setting threshold, perhaps search all byte streams that finishes, do not find byte serial yet if search all byte streams that finishes greater than " byte length of identical bytes string " of setting threshold, then with the son joint string of the maximum " byte length of identical bytes string " that found as final identical bytes string.
Below how explanation the present invention realizes compressing, suppose one section byte stream " abcdef1234abcki123abcde1234abcki123abcde1234 " is arranged, when sliding window points to byte stream beginning position, take out 2 byte serials " ab ", by the sliding window sliding process among Fig. 1 as can be known, ab at this moment " " 2 byte serials, do not repeat, so in output buffer, write bit ' 0 ' earlier, then write ' a '.
The sliding window byte that continues backward to slide is taken out 2 byte serials " bc ", bc at this moment " " and 2 byte serials, repetition is also arranged, so also be earlier in output buffer, write bit ' 0 ', then write ' b '.Add a node " ab ", i.e. node 1 in the index chained list among Fig. 1 toward the index chained list.
The sliding window byte that continues backward to slide is taken out 2 byte serials " cd ", and " cd " 2 byte serials also have repetition at this moment, so also be earlier in output buffer, writes bit ' 0 ', then writes ' c '.In a back node of index chained list, add " bc ", the i.e. node 2 of the index chained list among Fig. 1 again.
The rest may be inferred, when sliding window moves on to " 4a ", takes out 2 byte serials " 4a ", and " 4a " 2 byte serials at this moment do not repeat, so also be earlier in output buffer, writes bit ' 0 ', then writes ' 4 '.Add a node " 34 ", the i.e. node 9 of index chained list among Fig. 1 toward the index chained list again.
Sliding window continues to take out 2 byte serials " ab " toward byte of lower slider, and " ab " 2 byte serials when traveling through in concordance list, are found to occur in front at this moment.And, can find its wOffSet skew by its index node.Thereby can locate the position that it occurs, calculate " distance 10 " and " byte length 3 of identical bytes string ".In output buffer, write bit ' 1 ' this moment earlier, then earlier " distance 10 ", " byte length of identical bytes string " carried out outputing in the buffering area behind gamma (Gamma) coding.Add node " 4a " " ab ", the i.e. node 10 of the index chained list among Fig. 1, node 11 toward the index chained list then.When sliding window moved to " 12 ", disposition was the same with " ab ".
Below simply introduce the Gamma coding, suppose coding, make q=Int (log x 2X), then Bian Ma a preceding part is that q individual 1 adds one 0, and a back part is the long binary number in q position, and its value equals x-2 qThe corresponding relation of ordinary numeric value and Gamma encoded radio is as shown in table 1:
Numerical value ?1 ??2 ??3 ??4 ??5 ??6 ??7 ??8 ??9
Encoded radio ?0 ??100 ??101 ??11000 ??11001 ??11010 ??11011 ??1110000 ??1110001
Table 1
When sliding window down slides into another " ab ", take out 2 byte serials " ab " " ab " 2 byte serials at this moment, when in concordance list, traveling through, find to occur in front.And, can find its wOffSet skew by its index node 11.Thereby can locate the position that it occurs, calculate its distance 9 and identical length 3.Find that the wNext value of index node is not 0 this moment, be illustrated in also occurred once " ab " before the node 11 so, pass-out wNext obtains the index position of " ab " appearance, promptly node 1.Calculate its distance 19, identical length is 5, and is also bigger than the length of calculating with node 11.The value that then obtains the wNext of node 1 again is 0, does not have identical byte serial " ab " before the expression node 1.So in output buffer, write bit ' 1 ' this moment earlier, then earlier " distance ", " identical length " are carried out outputing in the buffering area behind the Gamma coding.Add node " 3a ", " ab ", " bc ", " cd ", the i.e. node 18,19,20,21 of the index chained list among Fig. 1 toward the index chained list then.
The rest may be inferred, data after the compression are " 30988c664329986232198d300d669c6e " (corresponding ASCII character) at last, and the ASCII character of data is " 616263646566313233346162636b6931323361626364653132333461 62636b69313233616263646531323334 " before the compression.Therefore greatly reduced the node flow data.
For a decompression example:
Decompression is a converse process, and is simpler relatively.Suppose that the data after the compression are " 30988c664329986232198d300d669c6e " (corresponding ASCII character), and at first, take out first bit with the pointed beginning, be ' 0 ', drawing ensuing 8 bit is exactly to need the direct character of exporting.Thereby obtain " 61 " (ASCII character), be character ' a ', then continue down to read one " bit " position, discovery or ' 0 ', continue to remember ensuing 8 " bit ", promptly obtain " 62 " (ASCII character), i.e. character ' b ', the rest may be inferred, can read " cdef1234 ", when having got character ' 4 ', next read a bit position again, discovery is ' 1 ', at this moment, down read the bit position when being not ' 1 ' always, draw q individual 1, and then down read one 0, then read q position bit value again.Encoding by Gamma this moment, formula is counter to be pushed away, and can draw the preceding coded data value of compression, thereby reads the length of repetition; Then down read the bit length of compressing the required storage of distance between the above two, promptly read distance between the two, just can begin copy data then to current location output.The rest may be inferred, just all data decompressions can be come out.
Fig. 2 is the composition structural representation of the data compression device of embedded system of the present invention, as shown in Figure 2, the data compression device of embedded system of the present invention comprises determining unit 20 and compression unit 21, and wherein, determining unit 20 is used for determining the identical byte serial of data to be compressed; Compression unit 21 is used for identical byte serial except that first byte serial, uses to replace described identical byte serial with the distance of identical bytes string and the number of identical bytes.
As shown in Figure 2, the data compression device of embedded system of the present invention also comprises unit 22 is set, when being used to transmit data, for packed data and packed data are not provided with the sign position respectively.
As shown in Figure 2, the data compression device of embedded system of the present invention also comprises coding unit 23, is used for using the Gamma coded system to encode with the distance of identical bytes string and the number of identical bytes.
Determining unit 20 is determined byte serial identical in the data to be compressed, comprise: set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, the byte serial identical with described byte serial arranged then, then continue the described sliding window that slides, up to determining and the identical slab string of byte serial before, and determine distance with identical before byte serial.
Perhaps, determining unit 20 is determined byte serial identical in the data to be compressed, comprise: set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, then determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the back sliding window of the byte serial identical and nearest with byte serial described in the last sliding window whether with current sliding window in byte serial identical, determine the identical slab string of byte serial, and whether the byte number of judging the slab string that byte serial is identical reaches setting threshold, then judge whether when not reaching also to exist with byte serial is identical for the first time sliding window in other identical byte serials of byte serial, reach setting threshold up to the byte number of the identical slab string of the byte serial of determining; Or determine not exist with the identical sliding window of the byte serial first time in other identical byte serials of byte serial, and with the identical slab string of determined byte serial as final identical byte serial.
Those skilled in the art are to be understood that, the data compression device of the embedded system that the present invention is shown in Figure 2 is to design for the data compression method of realizing aforementioned embedded system, the realization function of the each processing unit in the device shown in Figure 2 can be understood with reference to the associated description in the method for aforementioned reduction multicarrier phase mutual interference, the function of each unit can realize by the program that runs on the processor, also can realize by corresponding logical circuit.
Fig. 3 connects the composition structural representation of compression set for the data of embedded system of the present invention, as shown in Figure 3, the data compression device of embedded system of the present invention comprises determining unit 30, acquiring unit 31 and decompress(ion) unit 32, wherein, when determining unit 30 is used for determining that packed data includes compressing mark, trigger acquiring unit 31; Acquiring unit 31 is used to obtain distance and the byte number that replaces byte serial; Decompress(ion) unit 32 is used for obtaining out the byte of described byte number in distance described in the data of decompress(ion), and inserts in the current decompressed data.
Those skilled in the art are to be understood that, the data decompression compression apparatus of the embedded system that the present invention is shown in Figure 3 is to design for the data compression method of realizing aforementioned embedded system, the realization function of the each processing unit in the device shown in Figure 3 can be understood with reference to the associated description in the method for aforementioned reduction multicarrier phase mutual interference, the function of each unit can realize by the program that runs on the processor, also can realize by corresponding logical circuit.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.

Claims (14)

1, a kind of data compression method of embedded system is characterized in that, comprising:
Determine byte serial identical in the data to be compressed, except that first byte serial, use to replace described identical byte serial in the identical byte serial with the distance of identical bytes string and the number of identical bytes.
2, method according to claim 1 is characterized in that, described method also comprises:
During the transmission data, for packed data and packed data are not provided with the sign position respectively.
3, method according to claim 1 is characterized in that, the distance of described and identical bytes string and the number of identical bytes use gamma Gamma coded system to encode.
4, method according to claim 1 is characterized in that, describedly determines byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, the byte serial identical with described byte serial arranged then, then continue the described sliding window that slides, up to determining and the identical slab string of byte serial before, and determine distance with identical before byte serial.
5, method according to claim 1 is characterized in that, describedly determines byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, then determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the back sliding window of the byte serial identical and nearest with byte serial described in the last sliding window whether with current sliding window in byte serial identical, determine the identical slab string of byte serial, and whether the byte number of judging the slab string that byte serial is identical reaches setting threshold, then judge whether when not reaching also to exist with byte serial is identical for the first time sliding window in other identical byte serials of byte serial, reach setting threshold up to the byte number of the identical slab string of the byte serial of determining; Or determine not exist with the identical sliding window of the byte serial first time in other identical byte serials of byte serial, and with the identical slab string of determined byte serial as final identical byte serial.
6, according to claim 4 or 5 described methods, it is characterized in that described method also comprises:
Determine in the described sliding window byte serial and byte serial before not simultaneously, described byte serial is stored in the node of index chained list, the side-play amount of record identical bytes string is zero, writes down node in described index chained list the sequence valve of the data of described byte serial corresponding address storage in class table array for the described byte serial of storage; Determine that byte serial in the described sliding window is when byte serial is identical before, described byte serial is stored in the node of index chained list, the side-play amount of described byte serial and current nearest identical bytes string writes down node in described index chained list the sequence valve of the data of described byte serial corresponding address storage in class table array for the described byte serial of storage as the side-play amount of described byte serial.
7, a kind of uncompressing data of embedded system is characterized in that, comprising:
When including compressing mark in the packed data, obtain the distance and the byte number that replace byte serial, and obtain out the byte of described byte number, insert in the current decompressed data in distance described in the data of decompress(ion).
8, method according to claim 7 is characterized in that, described distance and the byte number that replaces byte serial that obtain comprises:
Use the Gamma coded system that the distance that replaces byte serial in the packed data and byte number are decoded and obtain described distance and described byte number.
9, a kind of data compression device of embedded system is characterized in that, comprising:
Determining unit is used for determining the identical byte serial of data to be compressed; And
Compression unit is used for identical byte serial except that first byte serial, uses to replace described identical byte serial with the distance of identical bytes string and the number of identical bytes.
10, device according to claim 9 is characterized in that, described device also comprises:
The unit is set, when being used to transmit data, for packed data and packed data are not provided with the sign position respectively.
11, device according to claim 9 is characterized in that, described device also comprises:
Coding unit is used for using the Gamma coded system to encode with the distance of identical bytes string and the number of identical bytes.
12, device according to claim 9 is characterized in that, described determining unit is determined byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, the byte serial identical with described byte serial arranged then, then continue the described sliding window that slides, up to determining and the identical slab string of byte serial before, and determine distance with identical before byte serial.
13, device according to claim 9 is characterized in that, described determining unit is determined byte serial identical in the data to be compressed, comprising:
Set sliding window is from the slip that word for word saves land of the first byte of data to be compressed, determine the address of described byte serial in class table array according to the byte serial in each described sliding window in back that slides, judge whether the data of storing in the described address are zero, if zero then before the byte serial identical not with described byte serial, when non-vanishing, then determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the back sliding window of the byte serial identical and nearest with byte serial described in the last sliding window whether with current sliding window in byte serial identical, determine the identical slab string of byte serial, and whether the byte number of judging the slab string that byte serial is identical reaches setting threshold, then judge whether when not reaching also to exist with byte serial is identical for the first time sliding window in other identical byte serials of byte serial, reach setting threshold up to the byte number of the identical slab string of the byte serial of determining; Or determine not exist with the identical sliding window of the byte serial first time in other identical byte serials of byte serial, and with the identical slab string of determined byte serial as final identical byte serial.
14, a kind of data decompression compression apparatus of embedded system is characterized in that, comprising:
Determining unit when being used for determining that packed data includes compressing mark, triggers acquiring unit;
Acquiring unit is used to obtain distance and the byte number that replaces byte serial; And
The decompress(ion) unit is used for obtaining out the byte of described byte number in distance described in the data of decompress(ion), and inserts in the current decompressed data.
CN2009100938637A 2009-09-22 2009-09-22 Methods and devices for compressing and uncompressing data of embedded system Active CN101667843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100938637A CN101667843B (en) 2009-09-22 2009-09-22 Methods and devices for compressing and uncompressing data of embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100938637A CN101667843B (en) 2009-09-22 2009-09-22 Methods and devices for compressing and uncompressing data of embedded system

Publications (2)

Publication Number Publication Date
CN101667843A true CN101667843A (en) 2010-03-10
CN101667843B CN101667843B (en) 2013-12-11

Family

ID=41804309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100938637A Active CN101667843B (en) 2009-09-22 2009-09-22 Methods and devices for compressing and uncompressing data of embedded system

Country Status (1)

Country Link
CN (1) CN101667843B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110145A (en) * 2011-02-15 2011-06-29 中国科学院计算技术研究所 Micro FAT file system and quick data access method thereof
CN103856296A (en) * 2010-07-16 2014-06-11 珠海中慧微电子有限公司 Address data compression algorithm for low-voltage power line carrier communication
CN104699219A (en) * 2013-12-10 2015-06-10 联想(北京)有限公司 Electronic equipment and information processing method
CN104951473A (en) * 2014-03-31 2015-09-30 中国移动通信集团宁夏有限公司 Method and device for compressing data
CN106850507A (en) * 2015-12-04 2017-06-13 北京航空航天大学 Harmful code detection method and device based on HTTP compressed data streams
CN106982165A (en) * 2016-01-15 2017-07-25 厦门雅迅网络股份有限公司 Data compression method and its system
CN107682016A (en) * 2017-09-26 2018-02-09 深信服科技股份有限公司 A kind of data compression method, data decompression method and related system
CN109033189A (en) * 2018-06-27 2018-12-18 阿里巴巴集团控股有限公司 Compression method, device, server and the readable storage medium storing program for executing of link structure log
CN110446124A (en) * 2019-08-19 2019-11-12 深圳市双翼科技股份有限公司 Unit remote management method, storage medium and device based on ONT Optical Network Terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6037883A (en) * 1998-05-07 2000-03-14 Microsoft Corporation Efficient memory usage for two-pass compression
KR100602394B1 (en) * 2000-08-15 2006-07-20 시게이트 테크놀로지 엘엘씨 Dual mode data compression for operating code

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856296A (en) * 2010-07-16 2014-06-11 珠海中慧微电子有限公司 Address data compression algorithm for low-voltage power line carrier communication
CN103856296B (en) * 2010-07-16 2017-05-17 珠海中慧微电子有限公司 Address data compression algorithm for low-voltage power line carrier communication
CN102110145A (en) * 2011-02-15 2011-06-29 中国科学院计算技术研究所 Micro FAT file system and quick data access method thereof
CN104699219A (en) * 2013-12-10 2015-06-10 联想(北京)有限公司 Electronic equipment and information processing method
CN104699219B (en) * 2013-12-10 2020-06-23 联想(北京)有限公司 Electronic equipment and information processing method
CN104951473A (en) * 2014-03-31 2015-09-30 中国移动通信集团宁夏有限公司 Method and device for compressing data
CN106850507B (en) * 2015-12-04 2020-01-14 北京航空航天大学 Harmful code detection method and device based on HTTP compressed data stream
CN106850507A (en) * 2015-12-04 2017-06-13 北京航空航天大学 Harmful code detection method and device based on HTTP compressed data streams
CN106982165A (en) * 2016-01-15 2017-07-25 厦门雅迅网络股份有限公司 Data compression method and its system
CN107682016A (en) * 2017-09-26 2018-02-09 深信服科技股份有限公司 A kind of data compression method, data decompression method and related system
CN107682016B (en) * 2017-09-26 2021-09-17 深信服科技股份有限公司 Data compression method, data decompression method and related system
CN109033189A (en) * 2018-06-27 2018-12-18 阿里巴巴集团控股有限公司 Compression method, device, server and the readable storage medium storing program for executing of link structure log
CN109033189B (en) * 2018-06-27 2021-08-24 创新先进技术有限公司 Compression method and device of link structure log, server and readable storage medium
CN110446124A (en) * 2019-08-19 2019-11-12 深圳市双翼科技股份有限公司 Unit remote management method, storage medium and device based on ONT Optical Network Terminal

Also Published As

Publication number Publication date
CN101667843B (en) 2013-12-11

Similar Documents

Publication Publication Date Title
CN101667843B (en) Methods and devices for compressing and uncompressing data of embedded system
US5955976A (en) Data compression for use with a communications channel
CN100517979C (en) Data compression and decompression method
US6489902B2 (en) Data compression for use with a communications channel
CN103236847B (en) Based on the data lossless compression method of multilayer hash data structure and Run-Length Coding
CN112953550B (en) Data compression method, electronic device and storage medium
US7990289B2 (en) Combinatorial coding/decoding for electrical computers and digital data processing systems
KR101725223B1 (en) Data compressing method of storage device
CN102970043B (en) A kind of compression hardware system based on GZIP and accelerated method thereof
CN104657362A (en) Method and device for storing and querying data
CN102122960A (en) Multi-character combination lossless data compression method for binary data
CN101783788A (en) File compression method, file compression device, file decompression method, file decompression device, compressed file searching method and compressed file searching device
CN101299611A (en) Data compression method based on set run
CN103139567A (en) Image compressing and uncompressing method and device
CN104125475A (en) Multi-dimensional quantum data compressing and uncompressing method and apparatus
CN116016606A (en) Sewage treatment operation and maintenance data efficient management system based on intelligent cloud
CN114900193A (en) Adaptive Huffman coding system and method
CN100578943C (en) Optimized Huffman decoding method and device
CN104410424A (en) Quick lossless compression method of memory data of embedded device
CN101469989A (en) Compression method for navigation data in mobile phone network navigation
CN115189696A (en) Hardware compression and decompression method based on Huffman decoding table
CN103078646A (en) Dictionary lookup compression and decompression method and device
CN112290953B (en) Array encoding device and method, array decoding device and method for multi-channel data stream
US6292115B1 (en) Data compression for use with a communications channel
CN110113402B (en) WEB service communication method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant