KR20180007397A - HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof - Google Patents
HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof Download PDFInfo
- Publication number
- KR20180007397A KR20180007397A KR1020160088318A KR20160088318A KR20180007397A KR 20180007397 A KR20180007397 A KR 20180007397A KR 1020160088318 A KR1020160088318 A KR 1020160088318A KR 20160088318 A KR20160088318 A KR 20160088318A KR 20180007397 A KR20180007397 A KR 20180007397A
- Authority
- KR
- South Korea
- Prior art keywords
- bits
- byte
- bit
- header
- significant
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/46—Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind
- H03M7/48—Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind alternating with other codes during the code conversion process, e.g. run-length coding being performed only as long as sufficientlylong runs of digits of the same kind are present
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/55—Compression Theory, e.g. compression of random number, repeated compression
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/70—Type of the data to be coded, other than image and sound
- H03M7/705—Unicode
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
단문압축, SNS압축, 비트연산Short text compression, SNS compression, bit operation
단문압축, SNS압축, 비트연산Short text compression, SNS compression, bit operation
발명을 실시하기 위한 구체적인 내용에 상술Detailed description of specific embodiments for carrying out the invention
발명을 실시하기 위한 구체적인 내용에 상술Detailed description of specific embodiments for carrying out the invention
발명을 실시하기 위한 구체적인 내용에 상술Detailed description of specific embodiments for carrying out the invention
UTF_8 코드 체계의 경우 아래와 같이 유니코드의 값의 범위에 따라, byte 1의 헤더비트를 달리하면서, byte 2~byte 6을 가변적으로 읽어들일수 있게 하였고,In UTF_8 code system, byte 2 ~ byte 6 can be read variably by changing the header bit of byte 1 according to the range of Unicode value as follows,
byte 2이후부터는 최상위 비트앞에 “10”을 규칙적으로 부가한 코드이다.From byte 2 onward, it is a code that adds "10" regularly before the most significant bit.
아래 표의 x 표로 표기한 부분이 유니코드 포인터인 First code point ~ Last code point의In the table below, the part marked with x is the Unicode pointer First code point ~ Last code point
이진화된 비트가 순서대로 표기된 내용을 나타낸다.The binarized bits indicate the contents in order.
예를들어, U+07FF 는 이진수로 111 1111 1111 으로서 전체 11비트이며, 아래 표1에서처럼 For example, U + 07FF is a total of 11 bits with 111 1111 1111 in binary,
110 xxxxx 10 xxxxxx 안에 110 11111 10 111111 형태로 포함되어 2바이트의 UTF코드로 변환되는110 xxxxx 10 xxxxxx in the form of 110 11111 10 111111 and converted to 2-byte UTF code
원리이다.It is a principle.
본 발명은 기존의 본 발명가의 다른 발명에 따르면 이러한 UTF-8 코드에 정의된 byte 1의 헤더비트(0, 110, 1110, 11110, 111110, 1111110) 를 아래 표2와 같이 특정 패턴의 비트로 변환하고, byte 2 이후의 최상위 2비트인 “10”들은 제거함으로서 압축이 되도록 한다. According to another embodiment of the present invention, the header bits (0, 110, 1110, 11110, 111110, 1111110) of byte 1 defined in the UTF-8 code are converted into bits of a specific pattern as shown in Table 2 below , and the most significant 2 bits after byte 2 are "10" to be compressed.
그런데 본 발명에서는 However, in the present invention
특히 SNS 상에서 한국의 경우 한글이 포함된 유니코드의 범위는 (U+AC00~U+D7A3) 으로서 UTF-8 의 byte의 헤더는 “1110” 인데, 한국어의 기반 SNS 서비스등에서는 한글이 다빈도로 출현하므로, 보다 짧은 압축헤더비트를 “10”으로 매핑한다. 이와 같은 매핑은 사실상 U+8000~U+FFFF에 해당하는 문자에는 문다 적용할 수 있다.Especially, in Korea, the range of Unicode including Hangul is (U + AC00 ~ U + D7A3), and the header of UTF-8 byte is "1110" in Korea. In Korean based SNS service, And maps the shorter compressed header bits to " 10 ". This mapping can actually be applied to characters that correspond to U + 8000 to U + FFFF.
이 경우, 아래 표3에서처럼 BYTE 1의 헤더가 다빈도로 출현하지 않는 다른 문자들에 있어서는 이익이 없으나(물론 손해도 없다), 한글이 포함되는 영역에 대하여는 높은 첫번째 바이트에서 헤더비트를 "10"으로 치환하여 2비트의 이익을 얻은뒤, 표4와 같이 다시 이후 byte 1의 잔여비트 4비트와 결합하여 처리하는 과정에서 1비트를 추가로 압축하여 전체 3비트의 이익을 얻을 수 있다.In this case, as shown in Table 3 below, the header of BYTE 1 does not benefit other characters that do not appear on the road (of course, there is no harm), but the header bit is set to "10" As shown in Table 4, after combining the 4 bits of the remaining bits of the byte 1, one bit is further compressed to obtain a total of 3 bits.
또한, UAlso, U ++ 0020 의0020 경우 Occation 영문자,한국어,일본어,중국어English, Korean, Japanese, Chinese 문장에서 가장 많이 쓰이는 문자중의 하나인 공백문자(스페이스 문자)인데, 이를 2진수로 표현하면 0010 (Space character), which is one of the most commonly used characters in a sentence, 0000 0000 이다. 이를 7비트의 연속된 "1"인 "1111111" to be. Quot; 1111111 ", which is a 7-bit consecutive "1 & 으로to 대치하면, "1"로 시작하는 If you replace it, 압축compression 헤더와 Header and 유일복호성을Unicorn 해치지 않으면서도, 공백문자에 대해 Without hurting you, you can 1비트 감축이 가능하다1 bit reduction possible ..
물론 더 다빈도로 사용되는 문자를 7비트의 연속된 "1"로 대체하여 1비트를 압축할수 있음은 물론이다. It goes without saying that one bit can be compressed by substituting a 7-bit consecutive "1"
이과정을 좀 더 자세히 살펴보면A closer look at this process
한글의 경우 유니코드가 U+AC00~U+D7AF 으로서, In case of Hangul, Unicode is U + AC00 ~ U + D7AF,
이진수로는 1010 1100 00000000 ~ 1101 0111 10101111범위이며,Binary numbers are in the range of 1010 1100 00000000 to 1101 0111 10101111,
특히 주의해서 볼 부분은 각 한글 유니코드의 최상위 4 비트가 "1"로 시작하는 점이다. Especially, the part to watch carefully is the point where the most significant 4 bits of each Hangul Unicode start with "1".
이를 좀 더 일반화하면, 한글 유니코드가 포함된 U+A000~U+DFFF 영역에서는,More generally, in the U + A000 ~ U + DFFF region including the Korean Unicode,
유니코드의 최상위 4비트는 "1010", "1011", "1100", "1101" 이라는 4가지임을 알 수 있다.The four most significant bits of Unicode are "1010", "1011", "1100", and "1101".
한편, UTF-8 표준 규칙에 따르면 상기 유니코드가 U+AC00~U+D7AF 에 위치한 한글은 UTF8 코드 규칙에 따르면 아래와 같이 구성된다.On the other hand, according to the UTF-8 standard rule, the Hangul in which the Unicode is located at U + AC00 ~ U + D7AF is configured as follows according to the UTF8 code rule.
1110 1010 10 110000 10 000000 ~ 1110 1101 10 011110 10 101111. 1110 1010 10 110000 10 000000 ~ 1110 1101 10 011110 10 101111.
이제 상기 표3과 같은 방식으로 BYTE 1을 구성하는 헤더비트를 압축헤더비트로 변경하고, 이후 BYTE 1의 잔여비트들을 결합하면서 압축하여 BYTE 1을 압축하고, 이후 바이트들의 최상위 2비트들을 제거하여 압축하면 다음과 같다.Now, the header bits constituting BYTE 1 are changed to compressed header bits in the same manner as in Table 3, and then BYTE 1 is compressed by combining the remaining bits of BYTE 1, and then the most significant 2 bits of the bytes are removed and compressed As follows.
1110 1010 10 110000 10 000000 ~ 1110 1101 10 011110 10 101111 1110 1010 10 110000 10 000000 ~ 1110 1101 10 011110 10 101111
===>===>
10 1010 110000 000000 ~ 10 1101 011110 101111. 10 1010 110 000 000000 1101 011 110 101 111 ~ 10.
이때 압축결과에서 보면, 각 한글 코드의 중간 압축결과는At this time, from the compression result, the intermediate compression result of each Hangul code is
10 1 010 110000 000000 ~ 10 1 101 011110 101111. 10 1 010 110000 000000 ~ 10 1 101 011110 101111.
101XXX 과 같이 처음이 한글의 경우 반드시 101로 시작함을 알 수 있다. 101 XXX in the case of the first Hangul, such as 101 must start with.
따라서, U+AC00~U+D7AF 의 경우에 대하여 압축헤더비트를 "10"으로 해서 압축하면 BYTE 1 부분이 반드시 "101"로 시작하므로,Therefore, when the compressed header bit is compressed to "10" for U + AC00 to U + D7AF, the BYTE 1 portion always starts with "101"
이부분을 추가적을 "101" ==> "10" 으로 변경하면 아래와 같이 1비트를 추가압축하면서도 반드시 다시 “10"으로 시작하게 된다.If this part is further changed to "101" ==> "10", it will start again with "10" even if 1 bit is further compressed as shown below.
10 1010 110000 000000 ~ 10 1101 011110 101111. 10 1 010 110000 000000 ~ 10 1 101 011110 101111.
1 0 010 110000 000000 ~ 1 0 101 011110 101111. 1 0 010 110000 000000 ~ 1 0 101 011110 101111.
이제, 상기 결과에서, 아래와 같이 "10"으로 압축된 이후 3비트를 보면,Now, from the above results, if we look at 3 bits after being compressed to "10 " as shown below,
1 0 010 110000 000000 ~ 1 0 101 011110 101111.1 0 010 110000 000000 ~ 1 0 101 011110 101111.
한글의 경우 UTF-8 코드의 최상위 바이트의 헤더비트 1110 다음에 오는 4비트는,In the case of Hangul, the 4 bits following the header bit 1110 of the most significant byte of the UTF-
"1010", "1011", "1100", "1101" 4가지 밖에 존재하지 않으므로, 이후 3비트는 Since there are only four "1010", "1011", "1100", and "1101"
"010", "011", "100", "101" 이라는 4가지 종류밖에 없는데, AC00 ~ D7AF 에서, There are only four types of "010", "011", "100" and "101". In AC00 to D7AF,
A와 D 는 각각 이후에 C,D,F 및 0,1,2,3,4,5,6,7 이라는 형태의 제한된 숫자만 오므로, B 및 C 에 비해서 경우의 수가 많지 않다. Since A and D are only C, D, F and 0, 1, 2, 3, 4, 5, 6, and 7, respectively, the number of cases is less than that of B and C.
따라서, B에 해당하는 "1011" 및 C에 해당하는 "1100" 에 "0", "10" 을 할당하고, 나머지 A 및 D에 각각 "110", "111" 을 할당하여 1~2비트를 더 압축이 가능한 종류가 있게 된다.Accordingly, "0" and "10" are assigned to "1011" corresponding to B and "1100" corresponding to C, and "110" and "111" There are more compressible types.
010 ==> 110010 ==> 110
011 ==> 0011 ==> 0
100 ==> 10100 ==> 10
101 ==> 111101 ==> 111
물론 위와 같은 매핑은 가장 다빈도로 출현하는 코드에 따라 조정할 수 있다.Of course, the above mapping can be adjusted according to the code that appears most often.
100 ==> 110100 ==> 110
101 ==> 10101 ==> 10
011 ==> 0011 ==> 0
010 ==> 111 010 ==> 111
과같이 매핑하여도 무방하다.May be mapped as shown in FIG.
이렇게 하면 아래와 같이 압축된다. A 및 D로 시작할 경우에는 추가압축의 이득은 없다.This will be compressed as shown below. There is no gain in further compression when starting with A and D.
1 0 010 110000 000000 ~ 1 0 101 011110 101111.1 0 010 110000 000000 ~ 1 0 101 011110 101111.
1 0 111 110000 000000 ~ 1 0 111 011110 101111.1 0 111 110000 000000 ~ 1 0 111 011110 101111.
만약 B로시작한다면 아래와 같이 2비트를 추가로 압축 더 할수 있다.If you start with B, you can add 2 more bits as shown below.
1 0 011 ==> 10 0 1 0 011 ==> 10 0
U+0800~U+FFFF 영역에서 상기 한글영역 이외에 대해서 byte 1의 압축에 대하여 추가로 살펴보면If we further examine the compression of byte 1 in the U + 0800 ~ U + FFFF area other than the Hangul area
또한 U+8000~U+9fff 의 경우에 있어서는,In the case of U + 8000 to U + 9fff,
최상위 비트 "1110" 에 이어서, 하위 4비트가 "1000", "1001" 로 시작하고Following the most significant bit "1110 ", the lower four bits start with" 1000 ", "1001"
U+E000~U+FFFF 에 있어서는,In the case of U + E000 to U + FFFF,
최상위 비트 "1110" 에 이어서, 하위 4비트가 "1110", "1111" 로 시작하므로,Since the most significant bit "1110 ", the lower four bits start with" 1110 ", &
항상 최상위 1비트가 "1"로 시작하므로, 굳이 "1" 을 명기할 필요없이 제거하고, 각각 "1"로 시작하는 3비트의 값을 할당해준다 "100", "101", "110", "111"100 "," 101 "," 110 ", and" 1 "are assigned to each of the three bits starting with" 1 " "111"
"1110"(압축헤더) + "1000" ==> "1110" + "100""1110" (compressed header) + "1000" ==> "1110" + "100"
"1110"(압축헤더) + "1001" ==> "1110" + "101""1110" (compressed header) + "1001" ==> "1110" + "101"
"1110"(압축헤더) + "1110" ==> "1110" + "110""1110" (compressed header) + "1110" ==> "1110" + "110"
"1110"(압축헤더) + "1111" ==> "1110" + "111""1110" (compressed header) + "1111" ==> "1110" + "111"
로 U+8000~U+9fff 의 경우 및 U+E000~U+FFFF 에 있어서는In the case of U + 8000 to U + 9fff and in the case of U + E000 to U + FFFF
byte 1에서 1비트를 압축할수 있다. You can compress 1 bit by 1 byte.
이제 나머지 U+0800~U+7fff 영역에 있어서는, "0000"(0)~"0111"(7) 로 모두 "0"으로 시작하므로, 그대로 압축헤더("1110")에 이어서 4비트를 부가해준다.In the remaining U + 0800 to U + 7fff area, all the bits start from "0000" (0) to "0111" (7), so 4 bits are added to the compressed header (1110) .
byte 1 에서 이범위에서는 압축의 이득은 없다. 마찬가지로, BYTE 1의 헤더비트 11110, 111110, 1111110 의 경우에도 압축 헤더 비트는 변경이 없으며, BYTE 1의 나머지 비트도 그대로 붙임으로써 BYTE 1에서는 압축의 이득이 없다.In byte 1, there is no gain in compression above. Similarly, in the case of the header bits 11110, 111110, and 1111110 of BYTE 1, the compressed header bits remain unchanged, and the remaining bits of BYTE 1 are also retained, so that there is no gain in compression in BYTE 1.
다만 byte 2 이후의 최상위 비트가 “10”으로 시작되는 부분은 제거되므로, 이러한 경우에도 압축효과는 존재하게 되며(즉 UTF-8의 byte 1을 그대로 유지하되 이후 byte 2 ~ byte 6 을 구성할때는 최상위의 "10"을 각각 제거하여 2비트씩 압축된다.) In this case, however, the compression effect exists (ie, when byte 1 of UTF-8 is retained, but when the byte 2 through byte 6 are composed, the uppermost bit "10" of the " 10 "
정리하면, 다빈도 사용문자(한국,일본어,중국어) 관점에서 이들이 위치하는 U+0800~U+FFFF 영역에서의 BYTE 1의 압축효과가 크다.In summary, the compression effect of BYTE 1 in U + 0800 ~ U + FFFF areas where they are located from the viewpoint of the characters (Korean, Japanese, Chinese) is great.
또한 UAlso U +0080~U++ 0080 ~ U + 00FF00FF 영역에 대해서도 BYTE For areas, BYTE 1 의1 of 추가압축이 가능한데, Additional compression is possible,
상기 영역은 U+0080~U+7FF 영역의 일부영역으로서 BYTE 1의 헤더비트가 "110"으로 시작하는 영역이다. 아래 영역에서 굵은 표시로된 "10" 이후 영역을 BYTE 2 영역이다.This area is a part of the U + 0080 to U + 7FF area and the header bit of BYTE 1 starts with "110". The area after the "10" in bold in the area below is the BYTE 2 area.
U+0080~U+008F : 110 000 10 10 00 0000 ~ 110 000 10 10 00 1111U + 0080 ~ U + 008F: 110 000 10 10 00 0000 ~ 110 000 10 10 00 1111
U+0090~U+009F : 110 000 10 10 01 0000 ~ 110 000 10 10 01 1111U + 0090 ~ U + 009F: 110 000 10 10 01 0000 ~ 110 000 10 10 01 1111
U+00A0~U+00AF : 110 000 10 10 10 0000 ~ 110 000 10 10 10 1111U + 00A0 to U + 00AF: 110 000 10 10 10 0000 to 110 000 10 10 10 1111
U+00B0~U+00BF : 110 000 10 10 11 0000 ~ 110 000 10 10 11 1111U + 00B0 ~ U + 00BF: 110 000 10 10 11 0000 ~ 110 000 10 10 11 1111
U+00C0~U+00CF : 110 000 11 10 00 0000 ~ 110 000 11 10 00 1111U + 00C0 ~ U + 00CF: 110 000 11 10 00 0000 ~ 110 000 11 10 00 1111
U+00D0~U+00DF : 110 000 11 10 01 0000 ~ 110 000 11 10 01 1111U + 00D0 to U + 00DF: 110 000 11 10 01 0000 to 110 000 11 10 01 1111
U+00E0~U+00EF : 110 000 11 10 10 0000 ~ 110 000 11 10 10 1111U + 00E0 ~ U + 00EF: 110 000 11 10 10 0000 ~ 110 000 11 10 10 1111
U+00F0~U+00FF : 110 000 11 10 11 0000 ~ 110 000 11 10 11 1111U + 00F0 to U + 00FF: 110 000 11 10 11 0000 to 110 000 11 10 11 1111
상기를 표면 110 다음에 5비트에 있어서, 최상위로부터 4번째 비트가 항상 "1"임을 알수 있고 따라서 이 비트를 제거하여 BYTE1 에서 1비트를 추가압축할 수 있다. 그리고 BYTE 2 의 시작비트는 동일하게 최상위 2비트의 "10"을 제거하면,For the 5 bits following the surface 110, it can be seen that the fourth most significant bit is always "1 ", thus removing this bit and further compressing one bit in BYTE1. And if the start bit of BYTE 2 equally removes the "10" of the two most significant bits,
즉 아래와 같다. U+0080~U+00FF 영역에서 BYTE 1에서 1비트 BYTE 2에서 2비트 압축하여 3비트를 압축할 수 있다. In other words, In the U + 0080 ~ U + 00FF area, BYTE 1 can compress 3 bits by compressing 2 bits from 1 bit BYTE 2.
U+0080~U+008F : 110 000 0 00 0000 ~ 110 000 0 00 1111U + 0080 ~ U + 008F: 110 000 0 00 0000 ~ 110 000 0 00 1111
U+0090~U+009F : 110 000 0 01 0000 ~ 110 000 0 01 1111U + 0090 ~ U + 009F: 110 000 0 01 0000 ~ 110 000 0 01 1111
U+00A0~U+00AF : 110 000 0 10 0000 ~ 110 000 0 10 1111U + 00A0 to U + 00AF: 110 000 0 10 0000 to 110 000 0 10 1111
U+00B0~U+00BF : 110 000 0 11 0000 ~ 110 000 0 11 1111U + 00B0 ~ U + 00BF: 110 000 0 11 0000 ~ 110 000 0 11 1111
U+00C0~U+00CF : 110 000 1 00 0000 ~ 110 000 1 00 1111U + 00C0 to U + 00CF: 110 000 1 00 0000 to 110 000 1 00 1111
U+00D0~U+00DF : 110 000 1 01 0000 ~ 110 000 1 01 1111U + 00D0 to U + 00DF: 110 000 1 01 0000 to 110 000 1 01 1111
U+00E0~U+00EF : 110 000 1 10 0000 ~ 110 000 1 10 1111U + 00E0 ~ U + 00EF: 110 000 1 10 0000 ~ 110 000 1 10 1111
U+00F0~U+00FF : 110 000 1 11 0000 ~ 110 000 1 11 1111U + 00F0 to U + 00FF: 110 000 1 11 0000 to 110 000 1 11 1111
따라서 다음과 같이 유니코드의 범위에 따라 언어 특성이 맞추어 압축헤더를 좀더 세분화하여 조정 매핑 하여 BYTE 1의 효율을 높일 수 있다. Therefore, it is possible to increase the efficiency of BYTE 1 by adjusting and mapping the compressed header according to the language characteristics according to the range of Unicode as follows.
아래 표4는 상기과정을 정리한 표이다,Table 4 below is a table summarizing the above process,
"1"을 제거한뒤, 각각 100, 101인 1로 시작하는 3비트로 재할당하여 1비트 압축Since the top of the 4 bits always starts with "1" after the header bit of Byte 1,
After removing "1", it is reassigned to 3 bits starting with 1, which is 100, 101 respectively,
"1"을 제거한뒤, 각각 100, 101인 1로 시작하는 3비트로 재할당하여 1비트 압축Since the top of the 4 bits always starts with "1" after the header bit of Byte 1,
After removing "1", it is reassigned to 3 bits starting with 1, which is 100, 101 respectively,
Since the most significant 4 bits following the header bit of BYTE 1 are always "1", the most significant "1" is removed and the remaining 3 bits are mapped to "110", "0", "10"
"1"을 제거한뒤, 각각 110, 111인 1로 시작하는 3비트로 재할당하여 1비트 압축Since the top of the 4 bits always starts with "1" after the header bit of Byte 1,
After removing "1 ", it is reallocated to 3 bits starting with 1, which is 110 and 111 respectively,
"1"을 제거한뒤, 각각 110, 111인 1로 시작하는 3비트로 재할당하여 1비트 압축Since the top of the 4 bits always starts with "1" after the header bit of Byte 1,
After removing "1 ", it is reallocated to 3 bits starting with 1, which is 110 and 111 respectively,
이제 한글에 있어서 BYTE 2의 추가적인 압축방법을 설명하고자 한다.Now, we will explain the additional compression method of BYTE 2 in Hangul.
BYTE 2의 경우에, 한글의 유니코드 포인트인 U+AC00에서부터 U+D7AF까지에 있어서,In the case of BYTE 2, from U + AC00, which is the Unicode point of Hangul to U + D7AF,
AC00 ==> 1010 1100 0000 0000 인데 이를 UTF8로 변환하면, 아래와 같이 나타난다.AC00 ==> 1010 1100 0000 0000 and converting it to UTF8, it will appear as below.
1110 1010 10 1100 00 10 00 0000 1110 1010 10 1100 00 10 00 0000
BYTE 1 은 상기 표4에 따라 압축되며,BYTE 1 is compressed according to Table 4 above,
BYTE 2 부분은, The BYTE 2 part,
한글 유니코드 포인트의 첫 8비트가 AC ~ D7 까지라는 데 착안하여,Considering that the first 8 bits of the Unicode point are from AC to D7,
AC , AD, AE , AFAC, AD, AE, AF
B0, B1,B2, ... , BFB0, B1, B2, ..., BF
C0, C1,C2, ... , CFC0, C1, C2, ..., CF
D0, D1,D2,D3,D4,D5,D6,D7 이라는 경우로만 나옴을 이용한다.D0, D1, D2, D3, D4, D5, D6, and D7.
즉, In other words,
AC ==> 1010 (A) 1100 (C)AC == > 1010 (A) 1100 (C)
AD ==> 1010 (A) 1101 (D)AD == > 1010 (A) 1101 (D)
AE ==> 1010 (A) 1110 (E)AE == > 1010 (A) 1110 (E)
AF ==> 1010 (A) 1111 (F)AF == > 1010 (A) 1111 (F)
인데 이중 C,D,E,F 가 두 번째 바이트의 최상위 2비트인 "10" 다음의 4비트를 차지하게 된다.C, D, E, and F occupy 4 bits following the most significant 2 bits of the second byte, i.e., "10 ".
이 경우에는 두 번째 바이트의 최상위 2비트인 "10"을 제거한뒤, 다음 4비트중에 모두 최상위 비트가 "11"로 시작하므로, "11"을 추가로 제거한다. 즉 아래와 같은 유니코드 포인터 U+AC00 에 있어서In this case, after removing the most significant 2 bits "10" of the second byte, the most significant bit starts with "11" in the next 4 bits, so that "11" is further removed. That is, in the following Unicode pointer U + AC00
UTF8코드로는 다음과 같은데, BYTE 1의 압축결과는 10110 이고, BYTE2의 압축은 상기와 같이하고, BYTE 3의 압축은 최상위 2비트인 "10"을 제거하여 끝낸다. 즉 아래와 같다.In UTF8 code, the compression result of BYTE 1 is 10110, the compression of BYTE 2 is as described above, and the compression of BYTE 3 is finished by removing the most significant 2 bits of "10". In other words,
1110 1010 10 1100 00 10 00 0000 1110 1010 10 1100 00 10 00 0000
(BYTE 1) (BYTE 2) (BYTE3)(BYTE 1) (BYTE 2) (BYTE 3)
1 0110 00 00 00 0000 ==> 10110 0000 000000 즉 24비트의 한글이 9비트가 감축된 15비트로 표현된다. 1 0110 00 00 00 0000 ==> 10110 0000 000000 That is, the 24-bit Hangul is represented by 15 bits with 9 bits reduced.
이와 유사한 경우가, D0 ~D7 사이에 나타나는데,A similar case appears between D0 and D7,
D0 ==> 1101 (D) 0000 (0)D0 == > 1101 (D) 0000 (0)
D1 ==> 1101 (D) 0001 (0)D1 == > 1101 (D) 0001 (0)
D2 ==> 1101 (D) 0010 (0)D2 == > 1101 (D) 0010 (0)
D3 ==> 1101 (D) 0011 (0)D3 == > 1101 (D) 0011 (0)
D4 ==> 1101 (D) 0100 (0)D4 == > 1101 (D) 0100 (0)
D5 ==> 1101 (D) 0101 (0)D5 == > 1101 (D) 0101 (0)
D6 ==> 1101 (D) 0110 (0)D6 == > 1101 (D) 0110 (0)
D7 ==> 1101 (D) 0111 (0)D7 == > 1101 (D) 0111 (0)
최상위 4비트 다음 4비트가 항상 "0"으로 시작하므로, "0"을 제거하여 추가로 1비트를 더 압축할수있다.Since the next 4 bits of the most significant 4 bits always start with "0", one more bit can be further compressed by removing "0".
예를들어 한글의 마지막 글자의 유니코드 포인터인 U+D7AF 의 경우For example, U + D7AF, the Unicode pointer of the last character in Hangul
D7AF ==> 1101 0111 1010 1111 인데 이를 UTF8 코드로 매핑하면, 아래와 같고,D7AF ==> 1101 0111 1010 1111 and mapping it to the UTF8 code,
1110 1101 10 011110 10 101111 1110 1101 10 011110 10 101111
이를 압축하면,When compressed,
BYTE 1은 표4에 따르고, BYTE 2는 상기의 규칙에 따르고 BYTE 3은 최상위 2비트만을 제거하여 압축하면,BYTE 1 is according to Table 4, BYTE 2 is according to the above rules, BYTE 3 is compressed by removing only the two most significant bits,
1110 1101 10 011110 10 101111 1110 1101 10 011110 10 101111
(BYTE1) (BYTE2) (BYTE3)(BYTE1) (BYTE2) (BYTE3)
10111 11110 101111 ==> 1011111110101111 즉, 8비트가 줄어들어 16비트만으로 24비트의 한글을 표현할수 있게 된다. 10111 11110 101111 ==> 1011111110101111 In other words, it is possible to express 24-bit Hangul with only 16 bits because 8 bits are reduced.
나머지 U+B000~U+CFFF 까지의 한글영역의 BYTE 2의 압축은 BYTE 3의 압축과 동일하다. 즉 2비트의 압축효과만 기대된다.The compression of BYTE 2 in the Hangul area from U + B000 to U + CFFF is the same as BYTE 3 compression. That is, only a compression effect of 2 bits is expected.
아래 표5에 BYTE 2의 압축에 대하여 정리하였다.Compression of BYTE 2 is summarized in Table 5 below.
한글이 존재하는 영역의 UTF-8 코드부분이 byte 1에서 3비트~5비트의 압축, byte 2에서 2비트에서~4비트 압축 및 byte 3에서 각 2~3비트씩 전체 7~10비트의 압축효과가 집중적으로 발생하여 한글을 다빈도로 사용하는 우리나라의 경우 압축효과가 커진다. The UTF-8 code portion of the region in which the Korean character exists is compressed from 3 bits to 5 bits in byte 1, from 2 to 4 bits in byte 2, and from 7 to 10 bits in every 2 to 3 bits in byte 3 In Korea, where the effect is intensive and the Korean language is used in a large number of roads, the compression effect becomes large.
특히 기준 산술부호화, 허프만 부호화, deflate, 7zip등 다양한 전통적인 압축알고리즘에서도 짧은 단문의 경우 압축효과가 없이 오히려 데이터가 커지는 문제점이 있었으나,Especially, various conventional compression algorithms, such as standard arithmetic coding, Huffman coding, deflate, and 7zip,
본 알고리즘을 통해 빠르고 간편하게 한글 한글자마다 7비트~9비트의 압축이득을 얻게 될 수 있다. 또한 한자와 일본어에 대해서도 5비트의 압축효과를 얻을수있다. 특히 일부한자의 경우 한글처럼 7비트~9비트의 압축효과를 얻을 수 있다.Through this algorithm, it is possible to obtain a compression gain of 7 bits to 9 bits for each Korean speaker quickly and easily. In addition, 5-bit compression can be obtained for both Chinese characters and Japanese characters. Especially, some Chinese characters can get 7 bit ~ 9 bit compression effect like Hangul.
특히 사전식이 아니므로, 상호 사전에 대한 정의가 불필요하며, 문장에 따라 압축률이 달라지는 점이 크게 극복되었다.Especially, since it is not dictionary type, definition of mutual dictionary is unnecessary, and the compression ratio is largely overcome according to the sentence.
[BYTE 1의 압축해제][Decompress BYTE 1]
압축해제의 경우 먼저 압축데이터의 In the case of decompression,
[1] 첫 번째 바이트 1의 최상위 첫 비트가 “0”일 경우, 이후 7비트를 읽어 8비트로 만들어 압축해제 하고, [1] If the first most significant bit of the first byte 1 is "0", then the next 7 bits are read to make 8 bits,
[2] 첫 비트가 “1”로 시작할 경우,[2] If the first bit starts with "1"
0) 이후 6비트 모두 "1"인 경우 즉, 0) and all 6 bits are "1 ", that is, 첫비트포함Include the first beat 7비트가 모두 "1"인 경우 When all 7 bits are "1" 로서 as "1111111""1111111" 을 만나면, 0010 0000 이라는 8비트 문자인 공백문자로 압축해제 된다. , It is decompressed into a space character, which is an 8-bit character 0010 0000.
1) 혹은 “0”을 처음 만날 때 까지의 헤더비트를 읽어서, “11110”, “111110”, “1111110” 의 경우 별도의 byte1 에 대한 압축은 없으므로, 이후 각 3비트,2비트,1비트를 읽어서 결합하여 byte 1으로 하고, 이후 바이트들은 UTF-8의 규칙에 따라 헤더비트에 따라 읽어야할 바이트 수만큼 이후 6비트씩을 추가로 읽어 각 6비트 덩어리들마다 최상위 “10”을 추가하여 각 8비트로 하여 압축해제 한다. 111110 "and" 1111110 ", there is no compression for separate byte 1. Therefore, each of the 3 bits, 2 bits, and 1 bit is referred to as " 1 " Read and concatenate them into byte 1, and then read the additional 6 bits by the number of bytes to be read according to the header bit according to the rule of UTF-8, and add the uppermost " 10 " And decompresses it.
2) 다만, "1110" 일 경우에는, 2) However, in case of "1110"
다음 3비트가 "100", "101", "110", "111" 의 경우에는,When the next three bits are "100", "101", "110", and "111"
표4의 역과정에 따라 각각 1000 (8) , 1001 (9) ,1110 (E), 1111 (F) 로 4비트로 압축해제 되어,Are decompressed into 4 bits by 1000 (8), 1001 (9), 1110 (E), and 1111 (F)
"1110 100 , 1110 101, 1110 110, 1110 111" 의 경우에 아래와 같이In the case of "1110 100, 1110 101, 1110 110, 1110 111"
"1110 1000", "1110 1001", "1110 1110", "1110 1111" 로 압축해제된다1110 1000 "," 1110 1001 "," 1110 1110 "," 1110 1111 "
다음 4비트가 만약 0XXX와 같이 0으로 시작할 경우에는, 그대로 BYTE 1으로 한다. 즉 별도의 압축효과는 없는것이다.If the next 4 bits start with 0, such as 0XXX, it is set to BYTE 1 as it is. That is, there is no separate compression effect.
즉 아래와 같다.In other words,
"1110 0000" ==> "1110 0000""1110 0000" ==> "1110 0000"
"1110 0001" ==> "1110 0001""1110 0001" ==> "1110 0001"
"1110 0010" ==> "1110 0010""1110 0010" ==> "1110 0010"
"1110 0011" ==> "1110 0011""1110 0011" == "1110 0011"
"1110 0100" ==> "1110 0100""1110 0100" ==> "1110 0100"
"1110 0101" ==> "1110 0101""1110 0101" ==> "1110 0101"
"1110 0110" ==> "1110 0110""1110 0110" ==> "1110 0110"
"1110 0111" ==> "1110 0111""1110 0111" ==> "1110 0111"
3)“10”일 경우에는, 예외적으로3) In the case of "10", exceptionally
[1] 이후 1비트가 "0" 일경우에는, 1비트만 추가로 읽어서, 압축시에 아래와 같이 매핑되었다면 역으로 매핑을 풀면,[1] If 1 bit is "0", then only 1 bit is additionally read, and if the mapping is as follows during compression,
010 ==> 110010 ==> 110
011 ==> 0011 ==> 0
100 ==> 10100 ==> 10
101 ==> 111101 ==> 111
아래와 같고, 이후 10 다음에 "1"을 추가하여 아래와 같이 압축을 푼뒤,Then, after "10" is added after "10"
10/0 ==> 10 011 ==> 10 1011 10/0 ==> 10 011 ==> 10 1011
최상위의 "10" 을 "1110"으로 변환시키면, 아래와 같이 BYTE1 이 압축해제된다.By converting "10" at the top level to "1110", BYTE1 is decompressed as shown below.
10 1011 ==> 1110 101110 1011 ==> 1110 1011
[2] 이후 2비트가 "10" 일경우에는, 2비트만 추가로 읽어서, 아래와 같이 압축을 해제한다.[2] If the two bits are "10", then only two bits are read in addition, and compression is released as follows.
10/10 ==> 10 100 ==> 10 1100 ==> 1110 110010/10 ==> 10 100 ==> 10 1100 ==> 1110 1100
[3] 이후 3비트가 "110" 일경우에는, 3비트만 추가로 읽어서, 아래와 같이 압축을 해제한다.[3] If 3 bits are later than "110", only 3 bits are additionally read, and compression is released as follows.
10/110 ==> 10 100 ==> 10 1100 ==> 1110 110010/110 ==> 10 100 ==> 10 1100 ==> 1110 1100
[4] 이후 3비트가 "111" 일경우에는, 3비트만 추가로 읽어서, 아래와 같이 압축을 해제한다.[4] If the 3 bits are "111", then only 3 bits are additionally read, and compression is released as follows.
10/111 ==> 10 010 ==> 10 1010 ==> 1110 101010/111 ==> 10 010 ==> 10 1010 ==> 1110 1010
4) 한편 4) Meanwhile 110 일 경우에는In case of 110 days ,,
U+0080~U+008F : 110 000 0 00 0000 ~ 110 000 0 00 1111U + 0080 ~ U + 008F: 110 000 0 00 0000 ~ 110 000 0 00 1111
U+0090~U+009F : 110 000 0 01 0000 ~ 110 000 0 01 1111U + 0090 ~ U + 009F: 110 000 0 01 0000 ~ 110 000 0 01 1111
U+00A0~U+00AF : 110 000 0 10 0000 ~ 110 000 0 10 1111U + 00A0 to U + 00AF: 110 000 0 10 0000 to 110 000 0 10 1111
U+00B0~U+00BF : 110 000 0 11 0000 ~ 110 000 0 11 1111U + 00B0 ~ U + 00BF: 110 000 0 11 0000 ~ 110 000 0 11 1111
U+00C0~U+00CF : 110 000 1 00 0000 ~ 110 000 1 00 1111U + 00C0 to U + 00CF: 110 000 1 00 0000 to 110 000 1 00 1111
U+00D0~U+00DF : 110 000 1 01 0000 ~ 110 000 1 01 1111U + 00D0 to U + 00DF: 110 000 1 01 0000 to 110 000 1 01 1111
U+00E0~U+00EF : 110 000 1 10 0000 ~ 110 000 1 10 1111U + 00E0 ~ U + 00EF: 110 000 1 10 0000 ~ 110 000 1 10 1111
U+00F0~U+00FF : 110 000 1 11 0000 ~ 110 000 1 11 1111U + 00F0 to U + 00FF: 110 000 1 11 0000 to 110 000 1 11 1111
다음 3비트를 읽어들여, "000" 일 경우에는, "000" 다음에 "1"을 추가한뒤, 나머지 1비트를 추가로 읽어들인뒤, 헤더비트 "110"을 추가하여, 8비트로 BYTE 1을 압축해제 한다. The next three bits are read, and if it is "000", "1" is added after "000", and the remaining one bit is further read and then the header bit "110" Lt; / RTI >
즉, 110 000 0 00 0000 이라면, "110" 다음에 3비트가 "000"이므로, 이 다음에 "1"를 추가하고 나머지 1비트를 읽어서, 110 000 1 0 로 BYTE 1 은 압축해제 하고, BYTE 2 는 동일하게, 6비트를 읽어들인뒤, 최상위에 "10"을 추가하여 BYTE 2 를 압축해제 한다.In other words, if 110 000 0 00 0000, then "110" is followed by 3 bits "000", followed by "1" and the remaining 1 bit read to decompress BYTE 1 to 110 000 1 0, 2 reads the same 6 bits, then decompresses BYTE 2 by adding "10" to the top.
"110 "다음에 3비트가 "000" 이 아니라면, 5비트를 이후에 읽어들여 그대로 "110"에 추가하여 8비트로 만들어서 BYTE 1 을 압축해제 한다(즉 BYTE 1 에서 압축의 이득이 없다.)If the 3 bits after "110" are not "000", then 5 bits are read afterwards and added to "110" to make 8 bits to decompress BYTE 1 (ie there is no gain in compression at BYTE 1).
[BYTE 2의 압축해제][Decompress BYTE 2]
BYTE 1의 압축해제결과 구성하는 하위 4비트가 무엇인가에 따라 BYTE 2의 압축해제의 시나리오가 달라진다.The decompression scenario of BYTE 2 differs depending on what the lower 4 bits constitute as a result of decompression of BYTE 1.
하위 4비트가 1010 (A), 1011(B), 1100(C), 1101(D) 이면 상기 표4의 역과정에 따라If the lower four bits are 1010 (A), 1011 (B), 1100 (C), and 1101 (D)
먼저 압축해제뒤의 바이트 1의 하위 4비트가 "1010" 이면, 4비트를 읽어들인뒤, 최상위 앞에 "11"을 추가하고, 다시 그 앞에 "10"을 추가하여 압축해제한다. 이 같은 과정을 아래 표6에 정리하였다.First, if the lower 4 bits of byte 1 after decompression are "1010", 4 bits are read, then "11" is added to the top, and "10" is added to the top. This process is summarized in Table 6 below.
BYTE 1 상위 4비트Decompressed
BYTE 1 upper 4 bits
BYTE 1 의 하위 4 비트Decompressed
Lower 4 bits of BYTE 1
BYTE 1 헤더비트Decompressed
BYTE 1 header bit
BYTE 1 의 헤더비트 이후의 하위 비트Decompressed
Lower bit after header bit of BYTE 1
[BYTE 3~BYTE 6의 압축해제][Decompression of BYTE 3 ~ BYTE 6]
BYTE 1의 헤더비트가 1110, 11110, 111110, 1111110 의 경우 BYTE 1포함하여각각 3,4,5,6 바이트의 가변형 UTF-8코드 이므로 BYTE 3~ BYTE 6의 경우에는, BYTE 1의 압축해제된 헤더비트에 따라 추가적으로 생성해야할 바이트수를 알고 있으므로, 각 6비트씩 해당 가변적 바이트수를 만들만큼 읽어들인뒤, 최상위에 "10"을 추가하여 압축해제 한다.If the header bits of BYTE 1 are 1110, 11110, 111110, and 1111110, BYTE 3 to BYTE 6 are decompressed by 3, 4, 5, Since we know the number of bytes to be additionally generated according to the header bit, read 6 bits of each variable to make the number of variable bytes, and then add "10" to the top.
예를들어, BYTE 1의 헤더비트가 "11110" 은 4바이트 가변형이므로 BYTE1, BYTE 2 는 상기규칙에 맞도록 압축해제하고, BYTE3, BYTE4 를 위해 6비트씩 2덩어리를 읽어와서, 각 상위에 "10"을 추가하여, 압축해제한다.For example, since the header bit "11110" of BYTE 1 is a 4-byte variable type, BYTE1 and BYTE2 are decompressed according to the above rules, two chunks are read out by 6 bits for BYTE3 and BYTE4, 10 "is added to decompress it.
이제 다시 다음 비트부터 상기의 과정을 반복하며 압축해제한다.Now repeat the above process from the next bit and decompress.
본 발명을 사용할 경우, 특히 한글의 경우, 첫 번째 바이트에서 3비트 압축 및 이후 두 바이트에서 4비트를 압축하여 모두 7~9비트를 압축함으로써 실질적으로 UTF-8에서도 한글을 압축된 형태로 송수신이 가능하여, 한글메시지의 트래픽 절감에 획기적으로 기여할 수 있다.When the present invention is used, particularly in the case of Hangul, 3-bit compression is performed on the first byte, and 4-bit is compressed after two to four bytes are compressed, thereby transmitting and receiving Hangul in compressed form substantially in UTF-8 Therefore, it can significantly contribute to traffic reduction of Hangul message.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020160088318A KR20180007397A (en) | 2016-07-13 | 2016-07-13 | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020160088318A KR20180007397A (en) | 2016-07-13 | 2016-07-13 | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20180007397A true KR20180007397A (en) | 2018-01-23 |
Family
ID=61071005
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020160088318A KR20180007397A (en) | 2016-07-13 | 2016-07-13 | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20180007397A (en) |
-
2016
- 2016-07-13 KR KR1020160088318A patent/KR20180007397A/en unknown
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Dheemanth | LZW data compression | |
Ochoa et al. | RePair and all irreducible grammars are upper bounded by high-order empirical entropy | |
Nandi et al. | Modified compression techniques based on optimality of LZW code (MOLZW) | |
KR20180007397A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180006659A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180007740A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180006011A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR101791877B1 (en) | Method and apparatus for compressing utf-8 code character | |
KR20180009088A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180006605A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180009060A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180008034A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR101791880B1 (en) | Method and apparatus for compressing utf-8 code character | |
KR20180008226A (en) | HANGUL ON UTF-8 character set COMPRESSION Method and Appratus Thereof | |
KR20180047738A (en) | UTF-8 character set compression method and apparatus thereof | |
Shanmugasundaram et al. | IIDBE: A lossless text transform for better compression | |
US7930435B2 (en) | Hub and spoke compression | |
Yazdanpanah et al. | A simple lossless preprocessing algorithm for hardware implementation of Deflate data compression | |
Tsai et al. | An improved LZW algorithm for large data size and low bitwidth per code | |
KR101752281B1 (en) | Method and apparatus for compressing utf-8 code character | |
KR20180004409A (en) | Universal real-time lossless data compression method of binary data encoded by utf-8 | |
Xu et al. | SSE lossless compression method for the text of the insignificance of the lines order | |
KR20180004410A (en) | Universal real-time lossless data compression method of binary data encoded by utf-8 | |
EP0494038A2 (en) | Run-length encoding in extensible character sets | |
Padmanabhan et al. | Operations for Text Processing |