CN1119865C - method of letter compression - Google Patents

method of letter compression Download PDF

Info

Publication number
CN1119865C
CN1119865C CN 98104355 CN98104355A CN1119865C CN 1119865 C CN1119865 C CN 1119865C CN 98104355 CN98104355 CN 98104355 CN 98104355 A CN98104355 A CN 98104355A CN 1119865 C CN1119865 C CN 1119865C
Authority
CN
China
Prior art keywords
letter
tail
code
sign indicating
indicating number
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.)
Expired - Fee Related
Application number
CN 98104355
Other languages
Chinese (zh)
Other versions
CN1224953A (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.)
Daba Electronic Co ltd
Original Assignee
Daba Electronic Co ltd
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 Daba Electronic Co ltd filed Critical Daba Electronic Co ltd
Priority to CN 98104355 priority Critical patent/CN1119865C/en
Publication of CN1224953A publication Critical patent/CN1224953A/en
Application granted granted Critical
Publication of CN1119865C publication Critical patent/CN1119865C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Machine Translation (AREA)

Abstract

The invention relates to a letter compression method, which is used for storing a letter, wherein the letter is contained in a symbol set, and the method is characterized by comprising the following steps: setting a five-bit code, wherein the first bit is a head code, namely a specific bit, the second bit to the fifth bit are tail codes, namely storage units, the symbol set is set in the tail codes, and the four tail codes can form sixteen codes; step two, the head code is represented by '0' and '1', and the tail code corresponding to the head code '0', namely the symbol set, is 'A to M'; the tail code corresponding to the head code "1" is "N to Z"; step three, respectively coding the tail codes of the symbol sets from A to M into hexadecimal '0 to 9 and from A to C', and similarly, the tail codes of the symbol sets from N to Z are also '0 to 9 and from A to C'; therefore, twenty-six English letters can be equivalently coded into five bits, the storage space is effectively reduced, and more telephone identification codes can be stored in a smaller storage space.

Description

字母压缩的方法method of letter compression

本发明涉及一种字母压缩的方法,尤其涉及一种应用于电话机中储存电话识别码(CallerID)的字母压缩的方法。The invention relates to a method for letter compression, in particular to a method for letter compression applied to a telephone set storing a caller identification code (CallerID).

由于市场的需求,一种具电话识别码的电话机已渐渐普及。电话识别码通常包括来电者的姓名(或代码)、来电时间及日期等信息,在电话拨进时,用户能事先得知来电为谁,以决定接或不接该电话。这样的做法,可以使用户更安心的接听电话,当然,在防止不法事情的发生上,更具有其正面的效果。Due to market demands, a telephone set with a telephone identification code has been gradually popularized. The phone identification code usually includes information such as the name (or code) of the caller, the time and date of the call, and when the call is dialed in, the user can know who the caller is in advance, so as to decide whether to answer the call or not. Such an approach can make the user answer the phone more at ease, and of course, it has a positive effect on preventing illegal things from happening.

由于一个人的姓名通常在16个字母之内,又因为ASCII码系使用8位的编码,用以编出代表256不同符号的码,其中英文大写字母是从十六进位的21H到3AH,所以存放电话识别码姓名部份的存储空间是设计成16个字节(Bytes),但是这样的作法显然有待改善。Since a person's name is usually within 16 letters, and because the ASCII code system uses 8-bit codes to code codes representing 256 different symbols, the English capital letters are from hexadecimal 21H to 3AH, so The storage space for depositing the name part of the telephone identification code is designed to be 16 bytes (Bytes), but such a practice obviously needs to be improved.

请参见图1,在具电话识别码的电话机中,现有技术的电话识别码的数据结构通常分为三部份。第一部份11为2个字节,用来存放时间,例如十点30分,则存放在第一部份的数据为″1030″。第二部份12亦为2个字节,用以存放日期,例如十一月二十号,则为″1120″。第三部份13大小为16字节,用以存放来电者的姓名代码,例如″AB...N″,则存在第三部份13为十六进位的21,22,...,2E;其中第一部份及第二部份系以BCD码(二—十进制)表示,而第三部份13以ASCII码表示。Please refer to FIG. 1 , in a telephone set with a telephone identification code, the data structure of the telephone identification code in the prior art is usually divided into three parts. The first part 11 is 2 bytes and is used to store the time. For example, at 10:30, the data stored in the first part is "1030". The second part 12 is also 2 bytes for storing the date, such as "1120" on November 20th. The size of the third part 13 is 16 bytes, which is used to store the name code of the caller, such as "AB...N", then there is a third part 13 which is 21, 22, ..., 2E in hexadecimal ; wherein the first part and the second part are expressed in BCD code (binary-decimal system), and the third part 13 is expressed in ASCII code.

事实上,第三部份13的姓名代码,因为由大写英文字母组成即可,而英文字母共有二十六个,所以用五位即可编码完成,并不需要用到八位。但是存储器的编址通常是以字节为单位,若为了节省存储空间,以每五位为单位,将经五位编码的数据″一个接着一个″存在以八位(等于一字节)为编址单位的存储器中,在读写数据及处理上却变得复杂许多。In fact, the name code of the third part 13 can be composed of uppercase English letters, and there are 26 English letters, so five digits can be used to complete the encoding, and eight digits are not needed. However, the addressing of the memory is usually in units of bytes. If in order to save storage space, the five-bit coded data "one after another" will be stored in eight bits (equal to one byte) in units of five bits in order to save storage space. In the memory of the address unit, it becomes much more complicated in reading and writing data and processing.

本发明的目的在于提供一种字母压缩的方法,它能将二十六个英文字母以等效五位编码的方式有效减小存储空间,使较小的存储空间可储存较多的电话识别码。The purpose of the present invention is to provide a method for letter compression, which can effectively reduce the storage space of twenty-six English letters in a manner equivalent to five-digit encoding, so that a smaller storage space can store more phone identification codes .

本发明的目的是这样实现的:The purpose of the present invention is achieved like this:

一种字母压缩的方法,用以储存一字母,该字母系包含在一符号集合中,其特点是包括以下步骤:A letter compression method for storing a letter contained in a symbol set, which is characterized in that it includes the following steps:

步骤一,设置一五位编码,第一位是头码即特定位,第二位至第五位是尾码即存储单元,所述的符号集合就设置在尾码中,四位尾码可以组成十六种码;Step 1, a five-bit code is set, the first is a header code that is a specific position, the second to the fifth is a tail code that is a storage unit, the collection of symbols is set in the tail code, and the four tail codes can be Form sixteen codes;

步骤二,头码用“0”和“1”表示,头码“0”所对应的尾码即符号集合是“A,B,C,D,E,F,G,H,I,J,K,L,M”;头码“1”所对应的尾码是“N,O,P,Q,R,S,T,U,V,W,X,Y,Z”;Step 2, the header code is represented by "0" and "1", and the tail code corresponding to the header code "0" is the set of symbols "A, B, C, D, E, F, G, H, I, J, K, L, M"; the tail code corresponding to the head code "1" is "N, O, P, Q, R, S, T, U, V, W, X, Y, Z";

步骤三,将符号集合“A,B,C,D,E,F,G,H,I,J,K,L,M”的尾码分别编为十六进位的“0,1,2,3,4,5,6,7,8,9,A,B,C”,同理符号集合“N,O,P,Q,R,S,T,U,V,W,X,Y,Z”的尾码亦为“0,1,2,3,4,5,6,7,8,9,A,B,C”。Step 3, code the end codes of the symbol sets "A, B, C, D, E, F, G, H, I, J, K, L, M" into hexadecimal "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C", the same symbol set "N, O, P, Q, R, S, T, U, V, W, X, Y, The tail code of Z is also "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C".

在上述的字母压缩的方法中,其中,所述的字母的字序由符号集合{A}为0,{B}为1,....,到{Z}为25来表示;将该字母的字序除以13的商是决定头码的值,而其余数决定该存储单元的值。In the above-mentioned letter compression method, wherein, the word order of the letter is represented by the symbol set {A} being 0, {B} being 1, ..., to {Z} being 25; the letter The quotient of the word order divided by 13 determines the value of the header code, and the remainder determines the value of the storage unit.

在上述的字母压缩的方法中,其中,所述的用以存储一字母的存储单元的大小是为四个位。In the above letter compression method, wherein, the size of the storage unit for storing a letter is four bits.

在上述的字母压缩的方法中,其中,所述的四个位的尾码存储单元形成16个位,组成一10字节大小的存储空间,而该10字节大小的存储空间最多容纳16个字母。In the above-mentioned letter compression method, wherein, the four-bit tail code storage unit forms 16 bits to form a 10-byte storage space, and the 10-byte storage space can accommodate up to 16 letter.

本发明由于将英文符号集合分割一半,若所储存的英文字母为前半部的字母,则设定一特定位为″0″,反之则″1″;其次依所储存的英文字母在分割一半后的二个子集合中的字序决定一存储单元(4个位即可)的值,因此,储存一个字母仅需5个位,所以可以使储存电话识别码的空间大为减小。The present invention divides the English symbol set into half, if the stored English alphabet is the letter of the first half, then set a specific bit as "0", otherwise "1"; secondly, after dividing half according to the stored English alphabet The order of words in the two subsets determines the value of a storage unit (4 bits). Therefore, only 5 bits are needed to store a letter, so the space for storing the phone identification code can be greatly reduced.

通过以下对本发明字母压缩的方法的一实施例结合其附图的描述,可以更进一步理解本发明的目的、特点和优点。其中,附图为:The purpose, features and advantages of the present invention can be further understood through the following description of an embodiment of the method for letter compression of the present invention in conjunction with the accompanying drawings. Among them, the attached figure is:

图1是现有技术的电话识别码数据结构。Fig. 1 is a prior art telephone identification code data structure.

图2是以及本发明提出的字母压缩的方法中电话识别码数据结构。Fig. 2 is and the phone identification code data structure in the letter compression method that the present invention proposes.

请参见图2。如前所述,电话识别码30姓名中的英文字母事实上以五位(bit)来编码即可,但若纯粹照字母排列的顺序来编码,在处理的时候反而会更显复杂,所以在此提出一种可以五位编码,处理时又不会复杂的编码方法,如所列的头码/尾(Header/Tailer)对照表。将英文字母的前半部“A,B,C,D,E,F,G,H,I,J,K,L,M”赋与“0”的头码,而后半部的英文字母“N,O,P,Q,R,S,T,U,V,W,X,Y,Z”的头码则为“1”。其次在将A到M的尾码分别编为十六进位的“0”到“C”,同理“N”到“Z”的尾码亦为“0”到“C”。See Figure 2. As mentioned earlier, the English letters in the name of the phone identification code 30 can be coded with five bits in fact, but if they are coded purely according to the order of the letters, it will be more complicated when processing, so in This proposes a coding method that can be coded by five bits and is not complicated to process, such as the Header/Tailer comparison table listed. Assign the first half of the English letter "A, B, C, D, E, F, G, H, I, J, K, L, M" to the head code "0", while the second half of the English letter "N , O, P, Q, R, S, T, U, V, W, X, Y, Z" is "1". Secondly, the tail codes of A to M are respectively coded as "0" to "C" in hexadecimal, and the tail codes of "N" to "Z" are also "0" to "C" in the same way.

第一部份及第二部份的时间及日期因为本身即为BCD码(二—十进制),无需多加处理,所以并无改变。不同的地方在于规划16个特定位的头码部份31用以分别存储十六个字母的头码(Header);同时以十六个存储单元,每个存储单元4位Bits,最多可表示十六种码,来表示被分成一半的十三个英文字母(A~M或N~Z)。The time and date of the first part and the second part do not need to be further processed because they are BCD codes (binary-decimal system), so there is no change. The difference is that 16 specific bits of the header part 31 are planned to store the header code (Header) of 16 letters respectively; at the same time, with 16 storage units, each storage unit has 4 Bits, which can represent up to ten Six kinds of codes represent the thirteen English letters (A~M or N~Z) that are divided into half.

亦即,当中央处理器(CPU)在把电话识别码姓名的某一英文字母写入存储器时,必须先判断该英文字母是属于前十三个字母或者为后十三个字母。若为前十三个字母,则将“0”写入一特定位内,再将该字母的字序(0到12)写入一存储单元;反之,若属于后十三个字母,则将“1”写入该特定位内,再将该字母超过“M”的字序(0到12)写入该存储单元。该存储单元为四位,加上该特定位,共五位。以五位来存储字母,所以可以使存储空间大为减小。That is, when the central processing unit (CPU) is writing a certain English letter of the phone identification code name into the memory, it must be judged whether the English letter belongs to the first thirteen letters or the last thirteen letters. If it is the first thirteen letters, write "0" into a specific bit, and then write the word sequence (0 to 12) of the letter into a storage unit; otherwise, if it belongs to the last thirteen letters, write "1" is written into the specific bit, and then the word sequence (0 to 12) of the letter exceeding "M" is written into the storage unit. The storage unit is four bits, plus the specific bit, a total of five bits. The letters are stored in five bits, so the storage space can be greatly reduced.

在写入数据时,可以先将输入字母的ASCII码减去“A″的ASCII码(十六进位为21,十进位为33),即可得到该字母的字序,例如输入“A”时,“A″本身的ASCII码相减,字序即为0,又例如“Z”的ASCII码(十进位为58),减去“A”的ASCII码(十进位为33),即可得字序25。再将该字序除以13,所得的商数即为头码(Header),余数即为尾码(Tailer),例如“A”的字序为0,除以13,可得头码为0,尾码亦为0,而“Z”的字序为25,除以13,可得头码1,尾码12(十六进制为C)。当然,若不以除法来实作,也可以用减法来作,原理则相同。When writing data, you can first subtract the ASCII code of "A" from the ASCII code of the input letter (21 in hexadecimal, 33 in decimal) to get the word order of the letter, for example, when inputting "A" , the ASCII code of "A" itself is subtracted, and the word order is 0, and for example, the ASCII code of "Z" (decimal is 58), minus the ASCII code of "A" (decimal is 33), you can get Word order 25. Then divide the word order by 13, the resulting quotient is the header (Header), and the remainder is the tailer (Tailer). For example, the word order of "A" is 0, divided by 13, the header code is 0 , the tail code is also 0, and the word order of "Z" is 25, which can be divided by 13 to get the head code 1 and the tail code 12 (hexadecimal is C). Of course, if it is not implemented by division, it can also be done by subtraction, and the principle is the same.

而在读出数据时,可以依序将头码部份31及尾码部份32的数据一个个读出。每读出一个头码及一个尾码时,将头码乘以13,加上尾码,再加上“A”的ASCII码即还原为原来字母的ASCII码。When reading data, the data of the header part 31 and the tail part 32 can be read out one by one. When reading a head code and a tail code, multiply the head code by 13, add the tail code, and add the ASCII code of "A" to restore the ASCII code of the original letter.

在图2中,为了清楚说明,举一个姓名为“JOHNSONYKK”的例子。从头码/尾码对照表可得,其头码为“01011111100”尾码则为“9170510BAA”(以十六进制表示)。由于本实施例是以存储十六个字母为例,未足十六字母的部份则头码/尾码分别补十六进位“0”及“F”,所以真正存储在存储器的数据为,头码部份31“6F00”,尾码部份32“9170510BAAFFFFFF”。为什麽尾码不和头码一样补“0”呢?因为若尾码也是“0”,则当中央处理器读回该数据时,会误判为英文字母“A”,为了防止误判,所以尾码补十六进制“F”,而不补“0”。In FIG. 2, for clarity, an example with the name "JOHNSONYKK" is given. From the header code/tail code comparison table, the header code is "01011111100" and the tail code is "9170510BAA" (expressed in hexadecimal). Since this embodiment takes the storage of sixteen letters as an example, the head code/tail code will be filled with hexadecimal "0" and "F" respectively for the part that is less than sixteen letters, so the data actually stored in the memory is, The header code part is 31 "6F00", and the tail code part is 32 "9170510BAAFFFFFF". Why is the tail code not filled with "0" like the head code? Because if the tail code is also "0", when the central processing unit reads back the data, it will be misjudged as the English letter "A". In order to prevent misjudgment, the tail code is supplemented with hexadecimal "F" instead of " 0".

事实上,本发明也可应用在存储8个字母、24个字母、32个字母等,若存储8个字母,则仅需5个字节(Bytes)、存储24个字母则仅需15个字节、32个字母则为20个字节...。可见得比一般的储存,每个字节存一个字母,可压缩为八分之五倍的存储空间。In fact, the present invention can also be applied to store 8 letters, 24 letters, 32 letters, etc. If 8 letters are stored, only 5 bytes are needed, and 24 letters are stored, only 15 words are needed. Section, 32 letters are 20 bytes.... It can be seen that compared with ordinary storage, each byte stores a letter, which can be compressed to five-eighths of the storage space.

在应用上,本发明是以常用的字母{′A′,′B′,...′Z′}为一符号集合,取其一半来编码,当然可视需要,改变为其他的符号,或加上一些常用的符号(以本实施例而言,事实上当可以编进去六个符号)。In application, the present invention uses commonly used letters {'A', 'B',...'Z'} as a set of symbols, half of which is used for encoding, and of course, it can be changed to other symbols as required, or Add some commonly used symbols (in this embodiment, in fact, six symbols can be programmed).

上述数学运算是可利用中央处理器的逻辑运算单元(ALU)来达成,而中央处理器的技术是为一现有技术,故本发明不多描述。由上述的图解及说明,我们可知,利用编码及数据结构的特殊设计,可以使电话识别码(CallerID)储存姓名字母部份的存储空间减小为八分之五倍,换言之,同样的存储空间可记录更多的电话识别码。The above-mentioned mathematical operations can be realized by using the logical operation unit (ALU) of the central processing unit, and the technology of the central processing unit is a prior art, so the present invention does not describe it much. From the above illustrations and descriptions, we can see that the storage space of the phone identification code (CallerID) to store the letters of the name can be reduced to five-eighths by utilizing the special design of the code and data structure. In other words, the same storage space More phone IDs can be recorded.

Claims (4)

1. the method for a letter compression, in order to store a letter, this letter system is included in the assemble of symbol, it is characterized in that may further comprise the steps:
Step 1 is provided with First Five-Year Plan position coding, and first is that the head sign indicating number is a certain bits, and second to the 5th is that the tail sign indicating number is a memory cell, and described assemble of symbol just is arranged in the tail sign indicating number, and four tail sign indicating numbers can be formed 16 kinds of sign indicating numbers;
Step 2, head sign indicating number represent that with " 0 " and " 1 " head sign indicating number " a 0 " pairing tail sign indicating number is that assemble of symbol is " A, B, C, D, E, F, G, H, I, J, K, L, M "; Head sign indicating number " 1 " pairing tail sign indicating number is " N, O, P, Q, R, S, T, U, V, W, X, Y, Z ";
Step 3 is compiled the tail sign indicating number of assemble of symbol " A, B, C, D, E, F, G, H; I, J, K, L, M " respectively and to be sexadesimal system " 0,1,2,3,4; 5,6,7,8,9, A, B, C ", and in like manner the tail sign indicating number of assemble of symbol " N; O, P, Q, R, S, T, U, V; W, X, Y, Z " also is " 0,1,2,3,4; 5,6,7,8,9, A, B, C ".
2. the method for letter compression as claimed in claim 1 is characterized in that: the word preface of described letter by assemble of symbol A} is 0, and B} is 1 ...., to { Z} 25 represents; The word preface that this is alphabetical is the value of decision head sign indicating number divided by 13 merchant, and its remainder determines the value of this memory cell.
3. the method for letter compression as claimed in claim 1 is characterized in that: described size in order to the memory cell of storing a letter is to be four positions.
4. the method for letter compression as claimed in claim 1 is characterized in that: the tail code memory unit of described four positions forms 16 positions, form the memory space of one 10 byte-sized, and the memory space of this 10 byte-sized holds 16 letters at most.
CN 98104355 1998-01-26 1998-01-26 method of letter compression Expired - Fee Related CN1119865C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 98104355 CN1119865C (en) 1998-01-26 1998-01-26 method of letter compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 98104355 CN1119865C (en) 1998-01-26 1998-01-26 method of letter compression

Publications (2)

Publication Number Publication Date
CN1224953A CN1224953A (en) 1999-08-04
CN1119865C true CN1119865C (en) 2003-08-27

Family

ID=5218231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 98104355 Expired - Fee Related CN1119865C (en) 1998-01-26 1998-01-26 method of letter compression

Country Status (1)

Country Link
CN (1) CN1119865C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1297934C (en) * 2003-07-15 2007-01-31 蔡长林 Hidden cipher coding and identifying method

Also Published As

Publication number Publication date
CN1224953A (en) 1999-08-04

Similar Documents

Publication Publication Date Title
US5969647A (en) Method of compressing letters in a caller identification code system
CN105846825B (en) Compression method, decompression method, compression device, and decompression device
US4597057A (en) System for compressed storage of 8-bit ASCII bytes using coded strings of 4 bit nibbles
US5812841A (en) Method and apparatus for recording and reading date data having coexisting formats
CN103995887B (en) Bitmap index compression method and bitmap index decompressing method
US5060286A (en) Raster row and byte group graphics images data compression method
JPH0644714B2 (en) Code conversion device
WO2022042103A1 (en) Data protection method, device, equipment, and medium
JP2012506665A (en) Method and apparatus for compressing and decompressing data records
CN1119865C (en) method of letter compression
CN114268323B (en) Data compression coding method, device and time sequence database supporting line memory
CN102508690A (en) Storing method and decoding method for command line of embedded equipment
CN112527951B (en) Storage method and device of integer data and storage medium
CN115940958A (en) Compression method based on Fasta and Fastq biological big data
CN110111852A (en) A kind of magnanimity DNA sequencing data lossless Fast Compression platform
CN115510811A (en) Character string encoding and decoding methods, encoding device and decoding device
CN111614613A (en) Data compression method
JPH05174584A (en) Data memory
CN110046159B (en) Bank account storage method and device, computer equipment and storage medium
JPH0936748A (en) Huffman coding method, its device, huffman decoding method and its device
CN119254239A (en) Numerical value type data compression method, device, medium and equipment
CN113037292A (en) Data compression method and data decompression method of structured database and communication equipment
JPH04277822A (en) Method for compressing data
CN115878503A (en) Data conversion method and device, and data reading and writing method and device
CN119450067A (en) An image compression method, DNA encoding method and related devices

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
PP01 Preservation of patent right

Effective date of registration: 20060510

Pledge (preservation): Preservation

PD01 Discharge of preservation of patent

Date of registration: 20070515

Pledge (preservation): Preservation

C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee