CN101667843B - 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
CN101667843B
CN101667843B CN2009100938637A CN200910093863A CN101667843B CN 101667843 B CN101667843 B CN 101667843B CN 2009100938637 A CN2009100938637 A CN 2009100938637A CN 200910093863 A CN200910093863 A CN 200910093863A CN 101667843 B CN101667843 B CN 101667843B
Authority
CN
China
Prior art keywords
byte
byte serial
data
serial
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.)
Active
Application number
CN2009100938637A
Other languages
Chinese (zh)
Other versions
CN101667843A (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

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

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 system with 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 rate of 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 large, tend to cause the obstruction of link, the veneer that simultaneously can report data produces very large impact, and power system capacity is reduced greatly, even can cause board resetting.For example, at code division multiple access (CDMA, Code Division MultipleAccess) in the EVDO channel board daily record of system, give the correct time, when data volume is larger, will there is a large amount of data packet loss phenomenons, and have when a plurality of when data report option, due to the obstruction of link, be easy to cause board resetting, bring a lot of risks to system, also increased difficulty to outside agency's orientation problem simultaneously.For accurate orientation problem, report when realizing a plurality of data item, and packet loss is dropped to minimum, proposed to give the correct time in daily record, first it is carried out to data compression, carry out again data decompression at receiving terminal.Thereby reduced the packet loss problem, avoided the congested of data transmission link.Due to traditional compression method, all being based on file is compressed, and all on PC, compressed, need not consider the occupancy of CPU, but in embedded system, all data are all to occur with the form of byte stream, have no idea to compress storage in the mode of file, can only compress buffered data streams, and because the transmission of data is continual processes, need to consider occupancy, the memory usage of CPU, also need to consider compression ratio simultaneously.The technical scheme that the special more suitable data compression for embedded system is not yet arranged at present.
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 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 data to be compressed, in identical byte serial, except first byte string, use with the distance of identical bytes string and the number of identical bytes and replace described identical byte serial.
Preferably, described method also comprises:
During the transmission data, for packed data and packed data do not arrange respectively flag.
Preferably, the number of the distance of described and identical bytes string and identical bytes is used gamma Gamma coded system to be encoded.
Preferably, describedly determine byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, the byte serial identical with described byte serial arranged, continue the described sliding window that slides, until determine and the slab string that byte serial is identical before, and determine the distance with identical before byte serial.
Preferably, describedly determine byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the rear sliding window of the byte serial identical and nearest with byte serial described in last sliding window whether with current sliding window in byte serial identical, determine the slab string that byte serial is identical, and whether the byte number that judges the slab string that byte serial is identical reaches setting threshold, judge whether also to exist other byte serials identical with byte serial in byte serial is identical for the first time sliding window while not reaching, until the byte number of the identical slab string of the byte serial of determining reaches setting threshold, or determine and not have other byte serials identical with byte serial in byte serial is identical for the first time sliding window, and using the identical slab string of determined byte serial as final identical byte serial.
Preferably, described method also comprises:
When determining byte serial in described sliding window and byte serial be different before, described byte serial is stored in the node of index chained list, the side-play amount that records the identical bytes string is zero, node sequence valve in described index chained list that the data that record the corresponding address storage in class table array of described byte serial are the described byte serial of storage; When determining byte serial in described sliding window and byte serial be 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 is as the side-play amount of described byte serial, node sequence valve in described index chained list that the data that record the corresponding address storage in class table array of described byte serial are the described byte serial of storage.
A kind of uncompressing data of embedded system comprises:
While in packed data, including compressing mark, obtain the distance and the byte number that replace byte serial, and obtain out the byte of described byte number in distance described in the data of decompress(ion), insert in current decompressed data.
Preferably, described distance and the byte number that replaces byte serial that obtain comprises:
Use the Gamma coded system decoded and obtain described distance and described byte number the distance and the byte number that replace byte serial in packed data.
A kind of data compression device of embedded system comprises:
Determining unit, for determining the byte serial that data to be compressed are identical; And
Compression unit, is used with the distance of identical bytes string and the number of identical bytes and is replaced described identical byte serial for the byte serial to identical except first byte string.
Preferably, described device also comprises:
Setting unit, when transmitting data, for packed data and packed data do not arrange respectively flag.
Preferably, described device also comprises:
Coding unit, encoded for the number use Gamma coded system of the distance to the identical bytes string and identical bytes.
Preferably, described determining unit is determined byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, the byte serial identical with described byte serial arranged, continue the described sliding window that slides, until determine and the slab string that byte serial is identical before, and determine the distance with identical before byte serial.
Preferably, described determining unit is determined byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the rear sliding window of the byte serial identical and nearest with byte serial described in last sliding window whether with current sliding window in byte serial identical, determine the slab string that byte serial is identical, and whether the byte number that judges the slab string that byte serial is identical reaches setting threshold, judge whether also to exist other byte serials identical with byte serial in byte serial is identical for the first time sliding window while not reaching, until the byte number of the identical slab string of the byte serial of determining reaches setting threshold, or determine and not have other byte serials identical with byte serial in byte serial is identical for the first time sliding window, and using 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, while for definite packed data, including compressing mark, trigger acquiring unit;
Acquiring unit, for obtaining distance and the byte number that replaces byte serial; And
The decompress(ion) unit, in distance described in the data of decompress(ion), obtaining out the byte of described byte number, and insert in current decompressed data.
In the present invention, bytes of stream data for embedded system, determine all identical byte serials in data to be transmitted, for the byte serial with identical before, replace this identical byte serial with distance and the identical byte number of the byte serial with identical before, due to what replace byte serial, be only two numerals, thereby greatly reduced the data volume of byte to be transmitted, thereby reached the 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 applicable to the embedded system of byte stream transmission, and the repetition byte string of the transmission of the byte stream in embedded system is many, and therefore, data compression rate is higher, thereby the CPU usage of embedded system is remained at low levels.
The accompanying drawing explanation
The schematic diagram of the data compression method that Fig. 1 is embedded system of the present invention;
The composition structural representation of the data compression device that Fig. 2 is embedded system of the present invention;
The data that Fig. 3 is embedded system of the present invention connect the composition structural representation of compression set.
Embodiment
Basic thought of the present invention is: for the bytes of stream data of embedded system, determine all identical byte serials in data to be transmitted, for the byte serial with identical before, replace this identical byte serial with distance and the identical byte number of the byte serial with identical before, due to what replace byte serial, be only two numerals, thereby greatly reduced the data volume of byte to be transmitted, thereby reached the compression to bytes of stream data, during decompress(ion), for packed byte not, directly output gets final product, for the packed byte string, being reversed decompress(ion) by the compression mode gets final product.The present invention especially is applicable to the embedded system of byte stream transmission, and the repetition byte string of the transmission of the byte stream in embedded system is many, and therefore, data compression rate is 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.
At first the contraction principle that the present invention once adopts is described, the character string " abcdef1234abcdeki1234 " of take describes as example, in this character string, find out the byte serial that content is identical, the part below bracketed with " () " is exactly the part that byte serial is identical, as: abcdef1234 (abcde) ki (1234).The present invention uses distance and a pair of like this information of number (or length) of identical characters between the identical bytes string, replace identical byte serial, as above-mentioned byte serial can be expressed as: abcdef1234 (10,5) ki (11,4), wherein, " 10 " in " (10; 5) " are the distance between identical bytes string and current location, the number that " 5 " are the identical bytes string (or length).In like manner, " 11 " in " (11,4) " are the distance between identical bytes string and current location, the number that " 4 " are the identical bytes string.Due to the distance between the identical bytes string and this pair of information of identical bytes number much smaller than the size of superseded byte serial, so the byte serial in the byte stream of transmission has obtained compression.
Below, by concrete example, further illustrate the essence of technical solution of the present invention.
The schematic diagram of the data compression method that Fig. 1 is embedded system of the present invention, as shown in Figure 1, it is example that byte stream " abcdef1234abcki123abcde1234 " is take in the present invention, illustrates in detail the essence scheme of data compression of the present invention.
As shown in Figure 1, for byte stream to be compressed arranges 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, mean that the byte serial in 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, mean that the byte serial in 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 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, such as its size is set, is 3,4 bytes etc.
From the beginning of byte stream, start by the whole byte stream of sliding window size traversal, at first find " ab " 2 byte serials, calculate the matching status of " ab " byte serial at m_awSortTable[] in memory address, concrete, by " a * 256+b ", determine, " a * 256+b " is equivalent to determine the hash value of " ab " byte serial, by searching m_awSortTable[a * 256+b], confirm as 0, there do not is the byte serial with " ab " byte serial identical (coupling) because current, " ab " is inserted in the node 1 of index chained list, and by the wOffSet of node 1 correspondence, wSameOffSet and wnext carry out assignment, be 0 entirely, wOffSet means the side-play amount of current byte serial and nearest before identical byte serial, wSameOffSet means whether current byte serial is the byte serial of identical bytes, determine whether current byte serial is similar " aa ", " bb ", the identical byte serials of byte such as " 22 ", it in this example, is the byte serial that non-byte is identical, the wSameOffSet value is 0, and while being the identical byte serial of byte, the wSameOffSet value is 1, wnext be with identical byte serial between side-play amount, in the present invention, be to determine and the side-play amount of nearest byte serial (or distance) before, owing to there not being identical with it byte serial, therefore, this wnext is 0.Revise m_awSortTable[a * 256+b]=1, mean that " ab " has been inserted in the node 1 of index chained list.
Make sliding window slide backward a byte, sliding window is current is " bc " 2 byte serials, does not still deposit the byte serial matched in the byte serial before determining, with " ab " identical mode, " bc " inserted to the node 2 of index chained list, wherein, the wOffSet=0 of node 2 correspondences, wSameOffSet=0, wnext=0, it should be noted that, now m_awSortTable[b * 256+c]=2 (this value, for empty, is 0 before).
Slide backward sliding window so always, until occur next " ab " 2 byte serials 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, now from these two identical byte serials " ab ", sliding window slides respectively after two identical byte serials, compare one by one in the manner aforesaid the byte serial in two sliding windows, until it is not identical, draw maximum identical bytes string, for this example, 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 string " abc " or " ab " storage in the index chained list), the distance obtained between two byte serials is " 10 ", and the byte number (or length) of the identical bytes of simultaneously getting back string is " 3 ".And by m_awSortTable[a * 256+b]=11 (11 is the node number that second byte serial " ab " is corresponding).
Then continue the slip sliding window, while in sliding window, " 12 " 2 byte serial occurring, find m_awSortTable[1 * 256+2]=7, illustrate in byte stream in front and " 12 " byte serial occurred once, 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 serial appears in sliding window again, find m_awSortTable[a * 256+b]=11, illustrate in byte stream in front and " ab " byte serial occurred once, utilization obtains the 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, now, to obtain (the distance between the two of byte stream current location to node 1 position in above step simultaneously, the byte length of identical bytes string), " byte length of identical bytes string " relatively obtained for twice, the final definite identical bytes string of a maximum conduct.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 large, is " 5 ", with (18,5), replaces byte serial " abcde ".
It should be noted that, when sliding window slides into " ab " at node 19 places, the present invention also can first carry out the coupling of byte serial to the byte serial at node 11 places, determine that " byte length of identical bytes string " is " 3 ", with the threshold value (as being set to 4) of setting, compare, while being more than or equal to threshold value, directly using the maximal phase of this nearest identical bytes string with byte number as the same byte number of final maximal phase, when the identical bytes length of determining is less than setting threshold, determine whether this nearest identical bytes string (" ab ") also has this identical byte serial (" ab ") before, and determine " byte length of identical bytes string " with inferior near identical bytes string, and compare with the threshold value of setting, if be less than setting threshold whether also have and byte serial (" ab ") identical in current sliding window before continuing to search, until find out " byte length of identical bytes string " that is greater than setting threshold, perhaps search complete all byte streams, if search the byte serial that complete all byte streams do not find " byte length of identical bytes string " that be greater than setting threshold yet, using 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 compression, suppose one section byte stream " abcdef1234abcki123abcde1234abcki123abcde1234 " is arranged, when sliding window points to byte stream beginning position, take out 2 byte serials " ab ", the sliding window sliding process in Fig. 1 is known, now " ab " and 2 byte serials, do not repeat, so first, in output buffer, write bit ' 0 ', then write ' a '.
The sliding window byte that continues backward to slide, take out 2 byte serials " bc ", now " bc " and 2 byte serials, repetition is also arranged, so be also first in output buffer, write bit ' 0 ', then write ' b '.Add a node " ab ", i.e. node 1 in index chained list in Fig. 1 toward the index chained list.
The sliding window byte that continues backward to slide, take out 2 byte serials " cd ", and now " cd " 2 byte serials, also have repetition, so be also first in output buffer, writes bit ' 0 ', then writes ' c '.Add " bc ", the i.e. node 2 of the index chained list in Fig. 1 again in a rear node of index chained list.
The rest may be inferred, when sliding window moves on to " 4a ", takes out 2 byte serials " 4a ", and " 4a " 2 byte serials now do not repeat, so be also first in output buffer, writes bit ' 0 ', then writes ' 4 '.Add a node " 34 ", the i.e. node 9 of index chained list in Fig. 1 toward the index chained list again.
Sliding window continues, toward byte of lower slider, to take out 2 byte serials " ab ", and now " ab " 2 byte serials, while traveling through in concordance list, find to occur in front.And, by its index node, can find its wOffSet skew.Thereby can locate the position that it occurs, calculate " distance 10 " and " byte length 3 of identical bytes string ".Now elder generation, in output buffer, writes bit ' 1 ', then first " distance 10 ", " byte length of identical bytes string " is carried out outputing in buffering area after gamma (Gamma) coding.Then add node " 4a " " ab ", the i.e. node 10 of the index chained list in Fig. 1, node 11 toward the index chained list.When sliding window moves to " 12 ", disposition is the same with " ab ".
Below simply introduce the Gamma coding, suppose the coding to x, make q=Int (log 2x), the front portion of coding is that q individual 1 adds one 0, and rear portion is the long binary number in q position, and its value equals x-2 q.The 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 10 0 10 1 110 00 110 01 110 10 110 11 111 0000 111 0001
Table 1
When sliding window down slides into another " ab ", take out now " ab " 2 byte serials of 2 byte serials " ab ", while traveling through in concordance list, find to occur in front.And, by its index node 11, can find its wOfffSet skew.Thereby can locate the position that it occurs, calculate its distance 9 and identical length 3.The wNext value of now finding index node is not 0, be illustrated in before node 11 also occurred once " ab " so, pass-out wNext obtains the index position that " ab " occurs, node 1.Calculate its distance 19, identical length is 5, also larger than the length of calculating with node 11.The value that then obtains again the wNext of node 1 is 0, and meaning does not have identical byte serial " ab " before node 1.Write bit ' 1 ' so now first in output buffer, then first " distance ", " identical length " are carried out outputing in buffering area after the Gamma coding.Then add node " 3a ", " ab ", " bc ", " cd ", the i.e. node 18,19,20,21 of the index chained list in Fig. 1 toward the index chained list.
The rest may be inferred, finally the data after the compression are " 30988c664329986232198d300d669c6e " (corresponding ASCII character), and before compression, the ASCII character of data is " 616263646566313233346162636b6931323361626364653132333461 62636b69313233616263646531323334 ".Therefore the node-flow data have been greatly reduced.
For a decompression example:
Decompression is a converse process, relatively simple.Suppose that the data after compression are " 30988c664329986232198d300d669c6e " (corresponding ASCII character), and at first, by the pointed beginning, take out first bit, be ' 0 ', show that ensuing 8 bit need the character of directly exporting.Thereby obtain " 61 " (ASCII character), be character ' a ', then continue down to read one " bit " position, find still ' 0 ', continue to remember ensuing 8 " bit ", obtain " 62 " (ASCII character), i.e. character ' b ', the rest may be inferred, can read " cdef1234 ", when taking character ' 4 ', next read again a bit position, discovery is ' 1 ', now, down read the bit position until for ' 1 ' time always, draw q 1, and then down read one 0, then read again q position bit value.Now by Gamma, encoding, formula is counter to be pushed away, and can draw the front coded data value of compression, thereby reads the length of repetition; Then down read the bit length of the required storage of distance of compressing between the above two, read distance between the two, then just can start copy data to current location output.The rest may be inferred, just can be by all data decompressions out.
The composition structural representation of the data compression device that Fig. 2 is 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 for determining the byte serial that data to be compressed are identical; Compression unit 21, is used with the distance of identical bytes string and the number of identical bytes and is replaced described identical byte serial for the byte serial to identical except first byte string.
As shown in Figure 2, the data compression device of embedded system of the present invention also comprises setting unit 22, when transmitting data, for packed data and packed data do not arrange respectively flag.
As shown in Figure 2, the data compression device of embedded system of the present invention also comprises coding unit 23, for the number use Gamma coded system of the distance to the identical bytes string and identical bytes, is encoded.
Determining unit 20 is determined byte serial identical in data to be compressed, comprise: the slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, the byte serial identical with described byte serial arranged, continue the described sliding window that slides, until determine and byte serial is identical before slab string, and determine the distance with identical before byte serial.
Perhaps, determining unit 20 is determined byte serial identical in data to be compressed, comprise: the slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the rear sliding window of the byte serial identical and nearest with byte serial described in last sliding window whether with current sliding window in byte serial identical, determine the slab string that byte serial is identical, and whether the byte number that judges the slab string that byte serial is identical reaches setting threshold, judge whether also to exist other byte serials identical with byte serial in byte serial is identical for the first time sliding window while not reaching, until the byte number of the identical slab string of the byte serial of determining reaches setting threshold, or determine and not have other byte serials identical with byte serial in byte serial is identical for the first time sliding window, and using 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 shown in Fig. 2 of the present invention is that the data compression method for realizing aforementioned embedded system designs, the practical function of the each processing unit in Fig. 2 shown device 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 run on processor, also can realize by corresponding logical circuit.
The data that Fig. 3 is embedded system of the present invention connect the composition structural representation of compression set, 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 includes compressing mark for definite packed data, trigger acquiring unit 31; Acquiring unit 31 is for obtaining distance and the byte number that replaces byte serial; Decompress(ion) unit 32 is in distance described in the data of decompress(ion), obtaining out the byte of described byte number, and inserts in current decompressed data.
Those skilled in the art are to be understood that, the data decompression compression apparatus of the embedded system shown in Fig. 3 of the present invention is that the data compression method for realizing aforementioned embedded system designs, the practical function of the each processing unit in Fig. 3 shown device 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 run on processor, also can realize by corresponding logical circuit.
The above, be only preferred embodiment of the present invention, is not intended to limit protection scope of the present invention.

Claims (11)

1. the data compression method of an embedded system, is characterized in that, comprising:
Determine byte serial identical in data to be compressed, in identical byte serial, except first byte string, use with the distance of identical bytes string and the number of identical bytes and replace described identical byte serial;
Wherein, describedly determine byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, the byte serial identical with described byte serial arranged, continue the described sliding window that slides, until determine and the slab string that byte serial is identical before, and determine the distance with identical before byte serial.
2. method according to claim 1, is characterized in that, described method also comprises:
During the transmission data, for packed data and packed data do not arrange respectively flag.
3. method according to claim 1, is characterized in that, the distance of described and identical bytes string and the number of identical bytes are used gamma Gamma coded system to be encoded.
4. method according to claim 1, is characterized in that, describedly determines byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the rear sliding window of the byte serial identical and nearest with byte serial described in last sliding window whether with current sliding window in byte serial identical, determine the slab string that byte serial is identical, and whether the byte number that judges the slab string that byte serial is identical reaches setting threshold, judge whether also to exist other byte serials identical with byte serial in byte serial is identical for the first time sliding window while not reaching, until the byte number of the identical slab string of the byte serial of determining reaches setting threshold, or determine and not have other byte serials identical with byte serial in byte serial is identical for the first time sliding window, and using the identical slab string of determined byte serial as final identical byte serial.
5. according to the described method of claim 1 or 4, it is characterized in that, described method also comprises:
When determining byte serial in described sliding window and byte serial be different before, described byte serial is stored in the node of index chained list, the side-play amount that records the identical bytes string is zero, node sequence valve in described index chained list that the data that record the corresponding address storage in class table array of described byte serial are the described byte serial of storage; When determining byte serial in described sliding window and byte serial be 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 is as the side-play amount of described byte serial, node sequence valve in described index chained list that the data that record the corresponding address storage in class table array of described byte serial are the described byte serial of storage.
6. the uncompressing data of an embedded system, is characterized in that, comprising:
While in packed data, including compressing mark, obtain the distance and the byte number that replace byte serial, and obtain out the byte of described byte number in distance described in the data of decompress(ion), insert in current decompressed data;
Specifically comprise: the address according to described byte serial in class table array judges whether the data of storing in described address are zero, if zero is directly exported corresponding character; When non-vanishing, by Gamma encode formula counter push away draw the compression before the coded data value, read the length of repetition, then read the compression before described replacement byte serial and before between the identical bytes string the distance required storage bit length, read distance between the two, copy corresponding data to current location.
7. the data compression device of an embedded system, is characterized in that, comprising:
Determining unit, for determining the byte serial that data to be compressed are identical; And
Compression unit, is used with the distance of identical bytes string and the number of identical bytes and is replaced described identical byte serial for the byte serial to identical except first byte string;
Wherein, described determining unit is determined byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, the byte serial identical with described byte serial arranged, continue the described sliding window that slides, until determine and the slab string that byte serial is identical before, and determine the distance with identical before byte serial.
8. device according to claim 7, is characterized in that, described device also comprises:
Setting unit, when transmitting data, for packed data and packed data do not arrange respectively flag.
9. device according to claim 7, is characterized in that, described device also comprises:
Coding unit, encoded for the number use Gamma coded system of the distance to the identical bytes string and identical bytes.
10. device according to claim 7, is characterized in that, described determining unit is determined byte serial identical in data to be compressed, comprising:
The slip that word for word saves land from the first byte of data to be compressed of set sliding window, determine the address of described byte serial in class table array according to the byte serial in described sliding window after each slip, judge whether the data of storing in described address are zero, if zero before the byte serial identical with described byte serial not, when non-vanishing, determine the byte serial identical and nearest with described byte serial, and the described sliding window of continuation slip, judge byte in the rear sliding window of the byte serial identical and nearest with byte serial described in last sliding window whether with current sliding window in byte serial identical, determine the slab string that byte serial is identical, and whether the byte number that judges the slab string that byte serial is identical reaches setting threshold, judge whether also to exist other byte serials identical with byte serial in byte serial is identical for the first time sliding window while not reaching, until the byte number of the identical slab string of the byte serial of determining reaches setting threshold, or determine and not have other byte serials identical with byte serial in byte serial is identical for the first time sliding window, and using the identical slab string of determined byte serial as final identical byte serial.
11. the data decompression compression apparatus of an embedded system, is characterized in that, comprising:
Determining unit, while for definite packed data, including compressing mark, trigger acquiring unit;
Acquiring unit, for obtaining distance and the byte number that replaces byte serial; And
The decompress(ion) unit, in distance described in the data of decompress(ion), obtaining out the byte of described byte number, and insert in current decompressed data;
Described acquiring unit, be further used for by Gamma encode formula counter push away draw the compression before the coded data value, read the length of repetition, then read the compression before described replacement byte serial and before between the identical bytes string the distance required storage bit length, read distance between the two;
Described decompress(ion) unit, be further used for the address in class table array according to described byte serial, judges whether the data of storing in described address are zero, if zero is directly exported corresponding character; When non-vanishing, by Gamma encode formula counter push away draw the compression before the coded data value, the length of the described replacement byte serial of reading according to acquiring unit and described replacement byte serial and the distance between the identical bytes string before, copy corresponding data to current location.
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 CN101667843A (en) 2010-03-10
CN101667843B true 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)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
CN106982165A (en) * 2016-01-15 2017-07-25 厦门雅迅网络股份有限公司 Data compression method and its system
CN107682016B (en) * 2017-09-26 2021-09-17 深信服科技股份有限公司 Data compression method, data decompression method and related system
CN109033189B (en) * 2018-06-27 2021-08-24 创新先进技术有限公司 Compression method and device of link structure log, server and readable storage medium
CN110446124B (en) * 2019-08-19 2021-10-12 深圳市双翼科技股份有限公司 Unit remote management method, storage medium and device based on optical network terminal

Citations (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
WO2002015408A2 (en) * 2000-08-15 2002-02-21 Seagate Technology Llc Dual mode data compression for operating code

Patent Citations (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
WO2002015408A2 (en) * 2000-08-15 2002-02-21 Seagate Technology Llc Dual mode data compression for operating code

Also Published As

Publication number Publication date
CN101667843A (en) 2010-03-10

Similar Documents

Publication Publication Date Title
CN101667843B (en) Methods and devices for compressing and uncompressing data of embedded system
US7099884B2 (en) System and method for data compression and decompression
CN112953550B (en) Data compression method, electronic device and storage medium
US5955976A (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
US7770091B2 (en) Data compression for use in communication systems
KR101725223B1 (en) Data compressing method of storage device
US20090016453A1 (en) Combinatorial coding/decoding for electrical computers and digital data processing systems
CN104657362A (en) Method and device for storing and querying data
CN101783788A (en) File compression method, file compression device, file decompression method, file decompression device, compressed file searching method and compressed file searching device
US20090015444A1 (en) Data compression for communication between two or more components in a system
CN110557124A (en) Data compression method and device
CN103139567A (en) Image compressing and uncompressing method and device
CN101469989B (en) Compression method for navigation data in mobile phone network navigation
CN104125475A (en) Multi-dimensional quantum data compressing and uncompressing method and apparatus
CN1426629A (en) Method and apparatus for optimized lossless compression using plurality of coders
CN103078646A (en) Dictionary lookup compression and decompression method and device
US6292115B1 (en) Data compression for use with a communications channel
CN112290953B (en) Array encoding device and method, array decoding device and method for multi-channel data stream
CN103618554B (en) Memory pages compression method based on dictionary
US11569841B2 (en) Data compression techniques using partitions and extraneous bit elimination
CN113312325B (en) Track data transmission method, device, equipment and storage medium
CN112506876B (en) Lossless compression query method supporting SQL query
CN114024952B (en) File compression transmission method based on DL/T698.45-2007 protocol
US8988258B2 (en) Hardware compression using common portions of data

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