CN1317882A - Method for compressing and decompressing data in database - Google Patents

Method for compressing and decompressing data in database Download PDF

Info

Publication number
CN1317882A
CN1317882A CN 01111579 CN01111579A CN1317882A CN 1317882 A CN1317882 A CN 1317882A CN 01111579 CN01111579 CN 01111579 CN 01111579 A CN01111579 A CN 01111579A CN 1317882 A CN1317882 A CN 1317882A
Authority
CN
China
Prior art keywords
data
database
character
identifier
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 01111579
Other languages
Chinese (zh)
Other versions
CN1129232C (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN 01111579 priority Critical patent/CN1129232C/en
Publication of CN1317882A publication Critical patent/CN1317882A/en
Application granted granted Critical
Publication of CN1129232C publication Critical patent/CN1129232C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

A comprssion and decompression method for the data in database features that before the numerical fields in database are stored or transmitted, N (N is greater than 10) character strings different from each other are created and related to numerals 00-(N-1) one by one, converting the numerals to characters. When they are read or received, they are converted to original numerals. Its advantages include simple structure, no need of decompression, high information amount to be stored, and svaing storage space.

Description

A kind of method that data in the database are compressed and decompressed
The present invention relates to the storing technology and the communication transmission technology of data, specifically, is to refer in particular to compression and the decompression method that the data of numeric type field in the database store and transmit, and can be widely used in various Database Systems.
Along with the development of computer science, computer is more and more higher to the requirement of data library storage amount, storage speed, particularly in science is calculated, has a large amount of numeric type data to store and to transmit.Compression and the decompression method that stores and transmit at the data of this particular values type-word section in the database how, in the hope of memory capacity, the saving backup space that improves database, improve efficiency of transmission, people fail to propose effective solution always, also do not see the special report of relevant this respect on public publication.
Purpose of the present invention is intended to overcome above-mentioned the deficiencies in the prior art, proposes a kind of memory space that can save data in the database greatly, increases the compression and the decompression method of information storage.
Of the present invention time a purpose is by this compression, improves the efficiency of transmission of data.
Realize the technical scheme of above-mentioned purpose: a kind of method that data in the database are compressed and decompressed is characterized in that:
Compression method comprises the steps:
A, the individual character inequality of making N (N>10),
B, numerical value 00 to N-1 and N character are set up one-to-one relationship,
C, if the data in the database are negative, identifier is set, if data are positive number, sign
Symbol is sky,
The decimal digits M of data in d, the database of record,
E, the absolute value of data in the database be multiply by 10 MBecome the integer data,
F, the integer tables of data is shown as ∑ X i* N i(0≤X i≤ N-1, i are zero or integer), obtain numerical value X i,
G, with each numerical value X among the step f iReplace with the corresponding character among the step b, obtain character type data ∏ X i(that is: be expressed as X N-1X N-2X 1X 0Form),
Data record in h, the database is by identifier, decimal digits and character type data ∏ X iForm;
To in the above-mentioned database by identifier, decimal digits and character type data ∏ X iThe decompression method of the data record of forming comprises the steps:
(1) N character setting up according to above-mentioned steps b and the one-to-one relationship between the numerical value 00 to N-1 are with character type data ∏ X iBe expressed as N system numeric type data ∑ X i* N i, X wherein iReplace with value corresponding,
(2) draw 10 system numeric type data by step (1),
(3) according to the decimal digits M in the record, 10 system numeric type data are stamped decimal point, become absolute value data,
(4) identifier is placed on the absolute value data front and reverts to the preceding signed number certificate of compression.
A kind of method that data in the database are compressed and decompressed is characterized in that: N=100,
Compression method comprises the steps:
A, 100 characters inequality of making,
B, one-to-one relationship set up in from 00 to 99 and 100 character of numerical value,
C, if the data in the database are negative, identifier is set, if data are positive number, identifier be a sky,
The decimal digits M of data in d, the database of record,
E, the absolute value of data in the database be multiply by 10 MBecome the integer data,
F, the integer data are represented with the corresponding character among the step b, are become character type data,
Data record in g, the database is made up of identifier, decimal digits and character type data;
Decompression method to the data record in the above-mentioned database comprises the steps:
(1), 100 characters setting up according to step b and the one-to-one relationship the numerical value from 0 to 99, character type data is expressed as the numeric type data,
(2), according to the record in decimal digits M, above-mentioned numeric type data are stamped decimal point, become absolute value data,
(3), identifier is placed on the absolute value data front and reverts to the preceding signed number certificate of compression.
Adopt technique scheme, the technological progress that the present invention gives prominence to is: 1, its physical significance is with data characterization, under the identical situation of character length, can express the more information amount.As: on the length of a character, by 10 kinds of variations of decimal data, can be extended to 100 variations, 1000 variations even as required, big increasing contains much information.2, by compression and decompression to numeric type field data in the database, memory space be can save greatly, the room and time that backs up, the transmission time of saving data saved, be suitable for various Database Systems.For example: make 100 characters inequality according to the method described above, 3,4 integer number are compressed, it is only about half of that number of characters is reduced; For the length that has decimal point is 5 several XX.XX or XXX.X, wants 5 under the normal condition, and through only needing 2 after the conversion, number of characters has only original 40%; And, have only one after the conversion for the situation of 0.XX, be compressed to original 25%.Use it for the storage aspect of database, saved the space of memory space and backup greatly.Use it for the stock certificate data transmission aspect of FM FM broadcasting, because FM FM broadcasting unit interval institute's information transmitted amount is limited, become the bottleneck that improves transmission speed, numeral is carried out the FM transmission again after overcompression, because 5 figure places of a large amount of band two-decimal points are arranged, be hopeful to improve its efficiency of transmission at double abovely, thereby strengthen competitiveness with video transmission greatly.3, simple (under the certain situation of no negative or decimal digits according to the inventive method written program, program can also be simpler), so can be easily call at any time for other program and function, also can directly appear in the calculating formula, can direct compilation in the source program of each database, make it become a kind of new recording mode of numeric type data in the database.Therefore, the database through the compression of this compression method need not decompress and just can carry out various database manipulations.
The present invention will benefit each Database Systems, and purposes is widely arranged.
The present invention is further detailed explanation below by embodiment:
Embodiment: a kind of method that data in the database are compressed and decompressed comprises compression method and decompression method.
Compression method comprises the steps:
A, at first, make character string N (N>10), each character in the character string is all inequality, and all characters in the character string are arranged (so just can directly carry out field name and without conversion) from small to large by the ASC sign indicating number in index INDEX or operation such as ordering SORT etc.Character string is in a single day selected, has just become the password of access numeral;
B, one-to-one relationship set up in numerical value 00 to N-1 and N the character of arranging from small to large by the ASC sign indicating number;
The positive negative of decimal data in c, the judgment data storehouse, if negative is provided with identifier "-", if positive number, identifier is a null character string;
The decimal digits M of data in d, the above-mentioned database of record;
E, the absolute value of data in the database be multiply by 10 MBecome the integer data;
F, the integer tables of data is shown as ∑ X i* N i(0≤X i≤ N-1, i are zero or integer), obtain numerical value X i
G, with each numerical value X among the step f iReplace with the corresponding character among the step b, obtain character type data ∏ X i
Data record in h, the database is by identifier, decimal digits and character type data ∏ X iForm.
To in the above-mentioned database by identifier, decimal digits and character type data ∏ X iThe decompression method of the data record of forming comprises the steps:
(1) N character setting up according to above-mentioned steps b and the one-to-one relationship between the numerical value 00 to N-1 are with character type data ∏ X iBe expressed as N system numeric type data ∑ X i* N i, X wherein 1Replace with value corresponding;
(2) draw 10 system numeric type data by step (1);
(3) according to the decimal digits M in the record, 10 system numeric type data are stamped decimal point, become absolute value data;
(4) identifier is placed on the absolute value data front and reverts to the preceding signed number certificate of compression.
As special case, get N=100, the method that the data in the database " 780036.26 " are compressed comprises the steps:
A, at first make 100 characters inequality;
B, one-to-one relationship set up in from 00 to 99 and 100 character of numerical value;
C, identifier are set to "-";
D, get M=2;
E, data 780036.26 be multiply by 10 2Become integer data 78003626;
F, according to the one-to-one relationship that from 00 to 99 and 100 character of numerical value is set up, suppose wherein 00 corresponding A, 26 corresponding Z, 36 corresponding α, 78 corresponding φ, because 78003626=78*100 3+ 00*100 2+ 36*100 1+ 26*100 0, therefore, the character type data when the corresponding character of integer data 78003626 usefulness is represented is φ A α Z, the data record after the compression is that the character type data φ A α Z of "-", decimal digits M=2 forms by identifier.
During to above-mentioned N=100 in the data-base recording identifier be the decompression method of the character type data φ A α Z of "-", decimal digits M=2, comprise the steps:
(1) according to N character setting up in advance and the numerical value one-to-one relationship from 0 to N-1, character type data φ A α Z is expressed as numeric type data 78003626;
(2) according to the decimal digits M=2 in the record, 10 system numeric type data are stamped decimal point, become absolute value data 780036.26;
D, identifier "-" is placed on absolute value data 780036.26 fronts reverts to signed number before the compression according to-780036.26.
Adopt above-mentioned compression and decompression method, if be used for archival memory, its physical significance is: if do not compress, need 10 bytes could store data " 780036.26 ", after the present invention compresses, only need 6 bytes just can store (comprising the character type data φ A α Z of 4 bytes, the identifier "-" and the decimal digits 2 of each 1 byte), save memory space 40% (compression ratio is 50%).If signless integer, then save memory space 50%!
Be without loss of generality, according to commercial needs, the setting of number of characters N also can be more than 100 even 1000, is used for further increasing improving compression ratio; The setting of number of characters N also can be below 100, and at this moment, compression ratio has reduction in various degree.But, though these two kinds of ways can strengthen confidentiality, however its data deficiency circulation.

Claims (2)

1, a kind of method that data in the database are compressed and decompressed is characterized in that:
Compression method comprises the steps:
A, the individual character inequality of making N (N>10),
B, numerical value 00 to N-1 and N character are set up one-to-one relationship,
C, if the data in the database are negative, identifier is set, if data are positive number, sign
Symbol is sky,
The decimal digits M of data in d, the database of record,
E, the absolute value of data in the database be multiply by 10 MBecome the integer data,
F, the integer tables of data is shown as ∑ X i* N i(0≤X i≤ N-1, i are zero or integer), obtain numerical value X i,
G, with each numerical value X among the step f iReplace with the corresponding character among the step b, obtain character type data ∏ X i,
Data record in h, the database is by identifier, decimal digits and character type data ∏ X iForm;
To in the above-mentioned database by identifier, decimal digits and character type data ∏ X iThe decompression method of the data record of forming comprises the steps:
(1) N character setting up according to above-mentioned steps b and the one-to-one relationship between the numerical value 00 to N-1 are with character type data ∏ X iBe expressed as N system numeric type data ∑ X i* N i, X wherein 1Replace with value corresponding,
(2) draw 10 system numeric type data by step (1),
(3) according to the decimal digits M in the record, 10 system numeric type data are stamped decimal point, become absolute value data,
(4) identifier is placed on the signed number certificate that reverts to before the absolute value data before the compression.
2, according to the described a kind of method that data in the database are compressed and decompressed of claim 1, it is characterized in that: N=100,
Compression method comprises the steps:
A, 100 characters inequality of making,
B, one-to-one relationship set up in from 00 to 99 and 100 character of numerical value,
C, if the data in the database are negative, identifier is set, if data are positive number, identifier be a sky,
The decimal digits M of data in d, the database of record,
E, the absolute value of data in the database be multiply by 10 MBecome the integer data,
F, the integer data are represented with the corresponding character among the step b, are become character type data,
Data record in g, the database is made up of identifier, decimal digits and character type data;
Decompression method to the data record in the above-mentioned database comprises the steps:
(1), 100 characters setting up according to step b and the one-to-one relationship the numerical value from 0 to 99, character type data is expressed as the numeric type data,
(2), according to the record in decimal digits M, above-mentioned numeric type data are stamped decimal point, become absolute value data,
(3), identifier is placed on the signed number certificate that reverts to before the absolute value data before the compression.
CN 01111579 2001-03-22 2001-03-22 Method for compressing and decompressing data in database Expired - Fee Related CN1129232C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 01111579 CN1129232C (en) 2001-03-22 2001-03-22 Method for compressing and decompressing data in database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 01111579 CN1129232C (en) 2001-03-22 2001-03-22 Method for compressing and decompressing data in database

Publications (2)

Publication Number Publication Date
CN1317882A true CN1317882A (en) 2001-10-17
CN1129232C CN1129232C (en) 2003-11-26

Family

ID=4659128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 01111579 Expired - Fee Related CN1129232C (en) 2001-03-22 2001-03-22 Method for compressing and decompressing data in database

Country Status (1)

Country Link
CN (1) CN1129232C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102445707A (en) * 2010-10-04 2012-05-09 王子影 Earthquake precursor data compression storage and decompression technology
CN105357532A (en) * 2015-11-06 2016-02-24 苏州博思得电气有限公司 Compression method, uncompression method, compression apparatus and uncompression apparatus
CN105574021A (en) * 2014-10-14 2016-05-11 北京神州泰岳软件股份有限公司 Data compression method and device of database
CN106681968A (en) * 2016-12-21 2017-05-17 桂林力港网络科技股份有限公司 Transmitting method for batch numeric data, receiving terminal and sending terminal
CN103678339B (en) * 2012-09-06 2017-05-17 阿里巴巴集团控股有限公司 Data backflow method and system and data access method and system in relational database
WO2018020299A1 (en) * 2016-07-29 2018-02-01 Chan Kam Fu Lossless compression and decompression methods
CN111602111A (en) * 2018-04-03 2020-08-28 深圳市柔宇科技有限公司 Data processing method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102445707A (en) * 2010-10-04 2012-05-09 王子影 Earthquake precursor data compression storage and decompression technology
CN103678339B (en) * 2012-09-06 2017-05-17 阿里巴巴集团控股有限公司 Data backflow method and system and data access method and system in relational database
CN105574021A (en) * 2014-10-14 2016-05-11 北京神州泰岳软件股份有限公司 Data compression method and device of database
CN105357532A (en) * 2015-11-06 2016-02-24 苏州博思得电气有限公司 Compression method, uncompression method, compression apparatus and uncompression apparatus
WO2018020299A1 (en) * 2016-07-29 2018-02-01 Chan Kam Fu Lossless compression and decompression methods
US11515888B2 (en) 2016-07-29 2022-11-29 Kam Fu Chan CHAN framework, CHAN coding and CHAN code
CN106681968A (en) * 2016-12-21 2017-05-17 桂林力港网络科技股份有限公司 Transmitting method for batch numeric data, receiving terminal and sending terminal
CN111602111A (en) * 2018-04-03 2020-08-28 深圳市柔宇科技有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN1129232C (en) 2003-11-26

Similar Documents

Publication Publication Date Title
CN1119868C (en) Compact source coding tables for encoder/decoder system
CN1251151C (en) Method of compressing packets
US20090254521A1 (en) Frequency partitioning: entropy compression with fixed size fields
CN1949670A (en) Data compression and decompression method
CN102088604A (en) Method and device for compressing film thumbnails
CN1369970A (en) Position adaptive coding method using prefix prediction
CN102122960A (en) Multi-character combination lossless data compression method for binary data
CN108153483B (en) Time sequence data compression method based on attribute grouping
US6919826B1 (en) Systems and methods for efficient and compact encoding
CN1129232C (en) Method for compressing and decompressing data in database
US20130018856A1 (en) Compression of bitmaps and values
CN1514662A (en) Method for intensifying short message business
CN1452397A (en) Frame compression using radix approximation or differential code and escape code
CN1951017A (en) Method and apparatus for sequence data compression and decompression
CN100544277C (en) A kind of method and apparatus that improves data-handling efficiency of network management system
CN1333947A (en) Low power counter
CN1115782C (en) Compression method suitable for wide character set document
CN1107381C (en) Real-time compression/decompression method for scanned image
US8918374B1 (en) Compression of relational table data files
CN114666406B (en) Electric power Internet of things data compression method and device based on object model
CN1236623C (en) Information ontropy holding decoding method and device
JPS6276931A (en) Data compressor
CN1186987A (en) Information compressing method and its device
CN1067833C (en) Compression/decompression method of digital image data
CN1609783A (en) Image floating-point data conversion operation method

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
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