CN109872522B - Algorithm for decompressing infrared code based on sample index - Google Patents

Algorithm for decompressing infrared code based on sample index Download PDF

Info

Publication number
CN109872522B
CN109872522B CN201910226160.0A CN201910226160A CN109872522B CN 109872522 B CN109872522 B CN 109872522B CN 201910226160 A CN201910226160 A CN 201910226160A CN 109872522 B CN109872522 B CN 109872522B
Authority
CN
China
Prior art keywords
data
code
sample
small
end mode
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
CN201910226160.0A
Other languages
Chinese (zh)
Other versions
CN109872522A (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.)
Hebei Guangzhiyi Information Technology Co ltd
Original Assignee
Hebei Diye Information Technology 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 Hebei Diye Information Technology Co ltd filed Critical Hebei Diye Information Technology Co ltd
Priority to CN201910226160.0A priority Critical patent/CN109872522B/en
Publication of CN109872522A publication Critical patent/CN109872522A/en
Application granted granted Critical
Publication of CN109872522B publication Critical patent/CN109872522B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides an algorithm for decompressing infrared codes based on sample indexes, which comprises a, code filtering: acquiring filtered data N through a filter code formula to obtain infrared filter code data; b. converting into hexadecimal data and small-end mode; c. acquiring a sample code array and a sample number; d. compressing the converted sample code; e. compression coding of the concatenation band decompression information: the final compressed code string is the reserved data (fixed as "00") + sample number + sample code array + compressed conversion code; f. the decompression algorithm is the inverse of e to a. After compression processing, the length of the transmission data can be greatly shortened, so that the bandwidth consumption and the transmission speed during network transmission are reduced. It acts like a video passing through some decompression algorithm to form a smaller video file to reduce transmission consumption and storage space.

Description

Algorithm for decompressing infrared code based on sample index
Technical Field
The invention belongs to the field of infrared data transmission of smart homes, and particularly relates to an algorithm for decompressing infrared codes based on sample indexes.
Background
Household appliances which can receive infrared data and control the infrared data are ubiquitous in residents' homes, for example: televisions, air conditioners, smart television boxes, and the like. The infrared waves are sent according to high and low levels in microsecond time, the combination is called as an infrared source code, for example, the infrared source code of the intelligent box power supply key is: 9019,4497,578,558,579,1694,578,558,578,558,578,1694,578,1694,578,558,578,1694,578,1694,579,557,578,1694,578,1694,578,558,578,558,578,1694,578,558,578,558,578,558,578,1695,578,1694,578,1694,578,558,578,1695,578,1694,578,1694,578,1695,578,558,578,558,578,558,578,1695,578,558,578,554,577,39486,9017,2242,577,96056. And after the infrared receiving equipment receives the infrared source code, executing a corresponding function according to the protocol setting.
The infrared source codes are different in length according to different set by manufacturers, and the longest infrared source code known at present achieves 2365 characters and 644 infrared waves according to character calculation. Uncompressed source data consumes excessive resources when transmitted over a network.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an infrared source code compression algorithm which can compress infrared source codes and shorten the length of transmitted data.
The technical scheme adopted by the invention is as follows: the algorithm for decompressing the infrared code based on the sample index comprises the following steps:
a. and (3) code filtering: filtering certain infrared wave data M, and obtaining filtered data N through a code filtering formula to obtain infrared filtered data;
b. converted to hexadecimal data and small-end mode: converting the infrared filtering code data into a hexadecimal format, wherein each datum is represented by a double-byte hexadecimal, if the double-byte hexadecimal format is not used, the preceding bit is complemented by 0, namely from 0000 to FFFF, and the hexadecimal data is obtained; then, the hexadecimal data is converted into a small-end mode, namely the first two bits and the second two bits are interchanged to obtain small-end mode data;
c. acquiring a sample code array and the number of samples: because the small-end mode data are all high level and low level alternately, namely the first small-end mode data is high level, the second small-end mode data is low level, the third small-end mode data is high level, the fourth small-end mode data is low level … … and so on, the high-low level data in the small-end mode data are combined into a group, namely the first small-end mode data is high level, the second small-end mode data is low level, the first group is combined, the third small-end mode data is high level, the fourth small-end mode data is low level, the second group … … and so on are combined until the last group is obtained, the high-low level data are obtained, all different data are extracted from the high-low level data to be used as sample codes, all sample code sets are sample code arrays, and the number of the sample codes in the sample code arrays is the number of samples; the index numbers of the sample codes in the sample code array are represented by hexadecimal data from 0 to F;
d. compressing the converted sample code: the compression rule for obtaining a single group of compression codes by adjacent same high and low level data is as follows: the single group of compression codes consists of two numbers, wherein the first number represents the index number of the sample code, and the second number from 0 to F represents the number of the adjacent same high-low level data needing to be transmitted; all the permutation and combination of the single group of compressed codes are compressed conversion codes;
e. compression coding of the concatenation band decompression information: the final compressed code string is the reserved data (fixed as "00") + sample number + sample code array + compressed conversion code;
f. decompressing: the decompression algorithm is the inverse of e to a.
Further, the code filtering formula in step a is as follows: n is rounded to the integer (M/200.0) × 200.
Further, in the step d, if the number of the adjacent same high and low level data exceeds 15, the adjacent same high and low level data is represented by a 0 to F superposition mode; that is, a single set of compression codes is the hexadecimal symbol corresponding to the index number + "F" + sample code index number + "(the number that needs to be sent-15) of the sample code, and so on.
Further, in the step a, if N is greater than 65535, it is forcibly modified to 65530.
Further, the number of samples in the step c is required not to exceed 16.
The beneficial effects obtained by the invention are as follows: the sample indexing algorithm SIA is also called schia algorithm. The algorithm for decompressing the infrared codes based on the sample indexes is to compress the infrared source codes and then transmit the infrared source codes in a network, and then decompress the infrared source codes into the infrared source codes before the infrared source codes are transmitted by an infrared transmitter so as to achieve the aim of remotely controlling the household appliances. The infrared source code is longer, and the length of the transmission data can be greatly shortened after the compression processing, so that the bandwidth consumption and the transmission speed during network transmission are reduced. It acts like a video passing through some decompression algorithm to form a smaller video file to reduce transmission consumption and storage space.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments.
The algorithm for decompressing the infrared code based on the sample index comprises the following steps:
a. and (3) code filtering: filtering certain infrared wave data M, and obtaining filtered data N through a code filtering formula N-rounding-up (M/200.0) × 200; if N is larger than 65535, forcibly modifying the N to 65530 to obtain infrared filtering data;
b. converted to hexadecimal data and small-end mode: converting the infrared filtering code data into a hexadecimal format, wherein each datum is represented by a hexadecimal of a double byte, and the preceding bits of the data which are less than the double byte use 0 to complement the bits, namely from 0000 to FFFF, so as to obtain the hexadecimal data; then, the hexadecimal data is converted into a small-end mode, namely, the last two digits and the last two digits are interchanged to obtain small-end mode data;
c. acquiring a sample code array and the number of samples: the method comprises the steps of combining high-level and low-level data in small-end mode data into a group, namely combining a first small-end mode data into a first group when the first small-end mode data is high level and a second small-end mode data into low level, combining the third small-end mode data into a second group … … and so on until a last group is obtained to obtain a sample code, then summarizing and extracting all different data from the sample code to obtain a sample code array, wherein the number of the sample codes in the sample code array is the number of samples; the index numbers of the sample codes in the sample code array are represented by hexadecimal data from 0 to F;
d. compressing the converted sample code: the compression rule for obtaining a single set of compressed codes from adjacent identical sample codes is: the single group of compression codes consists of two numbers, wherein the first number represents the index number of the sample code, and the second number from 0 to F represents the number of the adjacent and same sample code needing to be sent; all the permutation and combination of the single group of compressed codes are compressed conversion codes; if the number of the same adjacent sample codes exceeds 15, representing by adopting a 0-F superposition mode; that is, a single group of compression codes is a hexadecimal symbol corresponding to the index number + "F" + sample code index number + "(the number to be sent is-15) of the sample code, and so on;
e. compression coding of the concatenation band decompression information: the final compressed code string is the reserved data (fixed as "00") + sample number + sample code array + compressed conversion code;
f. decompressing: the decompression algorithm is the inverse of e to a.
According to the infrared code identification rule, the source code data can support the offset which floats up and down for 100 microseconds.
Example 1
The Hua is a box power supply infrared code:
9019,4497,578,558,579,1694,578,558,578,558,578,1694,578,1694,578,558,578,1694,578,1694,579,557,578,1694,578,1694,578,558,578,558,578,1694,578,558,578,558,578,558,578,1695,578,1694,578,1694,578,558,578,1695,578,1694,578,1694,578,1695,578,558,578,558,578,558,578,1695,578,558,578,554,577,39486,9017,2242,577,96056。
a. and (3) code filtering: and filtering the infrared code source code data (M) which are inconsistent with each other into filtering code data (N) which are as same as possible. Wherein if the infrared code source code data exceeds 65535, for example, 96056 in the case is uniformly changed into 65530 (tests show that 20000 to 99999 are all one effect).
The filter formula is: rounding to the integer (M/200.0) × 200, for example, brings 9019 into the equation to yield 9000.
The filtered infrared code data is as follows:
9000,4400,600,600,600,1600,600,600,600,600,600,1600,600,1600,600,600,600,1600,600,1600,600,600,600,1600,600,1600,600,600,600,600,600,1600,600,600,600,600,600,600,600,1600,600,1600,600,1600,600,600,600,1600,600,1600,600,1600,600,1600,600,600,600,600,600,600,600,1600,600,600,600,600,600,39400,9000,2200,600,65530;
b. converted to hexadecimal data and small-end mode:
each data is converted to a hexadecimal representation, such as 9000 to 2328. If the number is less than 4096, i.e., FFF, then 0 is supplemented at the leading bit, which is 0FFF, e.g., 600 transitions to 0258.
Converting the data into a small end mode, exchanging the first two bits and the last two bits, for example: 2328 converts to 2823 and 0258 converts to 5802.
After conversion, the data are obtained as follows:
2823,3011,5802,5802,5802,4006,5802,5802,5802,5802,5802,4006,5802,4006,5802,5802,5802,4006,5802,4006,5802,5802,5802,4006,5802,4006,5802,5802,5802,5802,5802,4006,5802,5802,5802,5802,5802,5802,5802,4006,5802,4006,5802,4006,5802,5802,5802,4006,5802,4006,5802,4006,5802,4006,5802,5802,5802,5802,5802,5802,5802,4006,5802,5802,5802,5802,5802,E899,2823,9808,5802,FAFF;
c. acquiring a sample code array and the number of samples:
because the small-end mode data are all high level and low level which appear alternately, namely the first small-end mode data is high level, the second small-end mode data is low level, the third small-end mode data is high level, the fourth small-end mode data is low level … … and the like, the high-level and low-level data in the small-end mode data are combined into a group, namely the first small-end mode data is high level, the second small-end mode data is low level, the first small-end mode data is combined into a first group, the third small-end mode data is high level, the fourth small-end mode data is low level, the third small-end mode data is combined into a second group … … and the like, and the high-level and low-level data are obtained until the last group is obtained;
28233011,58025802,58024006,58025802,58025802,58024006,58024006,58025802,58024006,58024006,58025802,58024006,58024006,58025802,58025802,58024006,58025802,58025802,58025802,58024006,58024006,58024006,58025802,58024006,58024006,58024006,58024006,58025802,58025802,58025802,58024006,58025802,58025802,5802E899,28239808,5802FAFF;
inducing and extracting all different data from the data to be used as sample codes, wherein all sample code sets are sample code arrays, and the number of the sample codes in the sample code arrays is the number of the samples; the index numbers of the sample codes in the sample code array are represented by hexadecimal data from 0 to F, and the hard requirement of the number of the samples does not exceed 16;
28233011,58025802,58024006,5802E899,28239808,5802FAFF;
the number of the samples is 06, and the index numbers are 0, 1, 2, 3, 4 and 5 respectively.
d. Compressing the converted sample code:
the high and low level data are compressed according to the sample code, that is, the high and low level data are described by using a compression format, and if the former group of high and low level data is the same as the latter group of high and low level data, the description is directly performed by using a number accumulation mode.
For example: 28233011 is compressed to 01, representing a sample code (28233011) with index 0 appearing 1 time.
The compression code can be derived as:
011121122211221122122113231124132112314151
e. compression coding of the concatenation band decompression information:
final ir compression code ═ retention data (fixed to "00") + number of samples ("06") + sample code ("2823301158025802580240065802E 899282398085802 FAFF") + compression conversion code ("011121122211221122122113231124132112314151")
The final infrared compression code is therefore:
00062823301158025802580240065802E899282398085802FAFF011121122211221122122113231124132112314151
f. decompressing: the decompression algorithm is the inverse of the compression algorithm.
Example 2
A certain key infrared source code of a certain air conditioner:
420,440,420,440,420,440,420,440,420,440,420,25200,3500,1750,420,1300,420,440,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,1300,420,440,420,1300,420,1300,420,440,420,1300,420,1300,420,1300,420,1300,420,1300,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,440,420,440,420,1300,420,440,420,440,420,34700,3500,1700,420,1300,420,440,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,1300,420,440,420,1300,420,1300,420,440,420,1300,420,1300,420,1300,420,1300,420,1300,420,440,420,440,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,440,420,440,420,1300,420,1300,420,1300,420,440,420,440,420,440,420,1300,420,440,420,1300,420,1300,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,440,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,1300,420,440,420,440,420,440,420,440,420,1300,420,1300,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,440,420,1300,420,1300,420,1300,420,1300,420,1300,420,1300,420,1300,420,1000
a. the filtered infrared code data is as follows:
400,400,400,400,400,400,400,400,400,400,400,25200,3600,1800,400,1400,400,400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,1400,400,400,400,1400,400,1400,400,400,400,1400,400,1400,400,1400,400,1400,400,1400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,400,400,400,400,1400,400,400,400,400,400,34800,3600,1800,400,1400,400,400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,1400,400,400,400,1400,400,1400,400,400,400,1400,400,1400,400,1400,400,1400,400,1400,400,400,400,400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,400,400,400,400,1400,400,1400,400,1400,400,400,400,400,400,400,400,1400,400,400,400,1400,400,1400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,1400,400,400,400,400,400,400,400,400,400,1400,400,1400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1400,400,1400,400,1400,400,1400,400,1400,400,1400,400,1400,400,1000
b. converted to hexadecimal data and small-end mode:
small-end mode data:
9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7062,100E,0807,9001,7805,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,7805,9001,7805,9001,9001,9001,7805,9001,7805,9001,7805,9001,7805,9001,7805,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,F087,100E,0807,9001,7805,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,7805,9001,7805,9001,9001,9001,7805,9001,7805,9001,7805,9001,7805,9001,7805,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,9001,9001,7805,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,7805,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,9001,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,7805,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,9001,7805,9001,7805,9001,7805,9001,7805,9001,7805,9001,7805,9001,7805,9001,E803
c. acquiring a sample code array and the number of samples:
high and low level data: 90019001,90019001,90019001,90019001,90019001,90017062,100E0807,90017805,90019001,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90017805,90019001,90017805,90017805,90019001,90017805,90017805,90017805,90017805,90017805,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90019001,90019001,90017805,90019001,90019001,9001F087,100E0807,90017805,90019001,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90017805,90019001,90017805,90017805,90019001,90017805,90017805,90017805,90017805,90017805,90019001,90019001,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90019001,90019001,90017805,90017805,90017805,90019001,90019001,90019001,90017805,90019001,90017805,90017805,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90019001,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90017805,90019001,90019001,90019001,90019001,90017805,90017805,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90019001,90017805,90017805,90017805,90017805,90017805,90017805,90017805,9001E803
The statistical sample code array is:
90019001,90017062,100E0807,90017805,9001F087,9001E803;
the number of the samples is 06, and the index numbers are 0, 1, 2, 3, 4 and 5 respectively.
d. Compressing the converted sample code:
the compression algorithm is as follows:
05112131033104310132013502310B310F0F0F0F06310F0F0F0831023102412131033104310132013502310F03310233033101330E3101310F03320A320F023204320F023751;
e. compression coding of the concatenation band decompression information:
the final compressed infrared code is:
00069001900190017062100E0807900178059001F0879001E80305112131033104310132013502310B310F0F0F0F06310F0F0F0831023102412131033104310132013502310F03310233033101330E3101310F03320A320F023204320F023751。

Claims (5)

1. the algorithm for decompressing the infrared code based on the sample index is characterized in that: the method comprises the following steps:
a. and (3) code filtering: filtering certain infrared wave data M, and obtaining filtered data N through a code filtering formula to obtain infrared filtered data;
b. converted to hexadecimal data and small-end mode: converting the infrared filtering code data into a hexadecimal format, wherein each datum is represented by a double-byte hexadecimal, if the double-byte hexadecimal format is not used, the preceding bit is complemented by 0, namely from 0000 to FFFF, and the hexadecimal data is obtained; then, the hexadecimal data is converted into a small-end mode, namely the first two bits and the second two bits are interchanged to obtain small-end mode data;
c. acquiring a sample code array and the number of samples: because the small-end mode data are all high level and low level alternately, namely the first small-end mode data is high level, the second small-end mode data is low level, the third small-end mode data is high level, the fourth small-end mode data is low level … … and so on, the high-low level data in the small-end mode data are combined into a group, namely the first small-end mode data is high level, the second small-end mode data is low level, the first group is combined, the third small-end mode data is high level, the fourth small-end mode data is low level, the second group … … and so on are combined until the last group is obtained, the high-low level data are obtained, all different data are extracted from the high-low level data to be used as sample codes, all sample code sets are sample code arrays, and the number of the sample codes in the sample code arrays is the number of samples; the index numbers of the sample codes in the sample code array are represented by hexadecimal data from 0 to F;
d. compressing the converted sample code: the compression rule for obtaining a single group of compression codes by adjacent same high and low level data is as follows: the single group of compression codes consists of two numbers, wherein the first number represents the index number of the sample code, and the second number from 0 to F represents the number of the adjacent same high-low level data needing to be transmitted; all the permutation and combination of the single group of compressed codes are compressed conversion codes;
e. compression coding of the concatenation band decompression information: finally compressing the code character string, namely, reserving data, the number of samples, the array of sample codes and the compressed conversion code;
f. decompressing: the decompression algorithm is the inverse of e to a.
2. The algorithm for decompressing an infrared code based on a sample index according to claim 1, wherein: the code filtering formula in the step a is as follows: n is M/200.0 rounded up and then 200.
3. The algorithm for decompressing an infrared code based on a sample index according to claim 1, wherein: in the step d, if the number of the adjacent same high and low level data exceeds 15, the adjacent same high and low level data is represented by a mode of overlapping from 0 to F; that is, a single set of compression codes is the index number of the sample code + "F" + the index number of the sample code + "corresponding hexadecimal sign", and so on.
4. The algorithm for decompressing an infrared code based on a sample index according to claim 1, wherein: in the step a, if N is larger than 65535, the N is forcibly modified to 65530.
5. The algorithm for decompressing an infrared code based on a sample index according to claim 1, wherein: the number of samples in the step c is required to be not more than 16.
CN201910226160.0A 2019-03-25 2019-03-25 Algorithm for decompressing infrared code based on sample index Active CN109872522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910226160.0A CN109872522B (en) 2019-03-25 2019-03-25 Algorithm for decompressing infrared code based on sample index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910226160.0A CN109872522B (en) 2019-03-25 2019-03-25 Algorithm for decompressing infrared code based on sample index

Publications (2)

Publication Number Publication Date
CN109872522A CN109872522A (en) 2019-06-11
CN109872522B true CN109872522B (en) 2021-01-01

Family

ID=66921068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910226160.0A Active CN109872522B (en) 2019-03-25 2019-03-25 Algorithm for decompressing infrared code based on sample index

Country Status (1)

Country Link
CN (1) CN109872522B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113850988B (en) * 2020-12-24 2022-09-27 广东朝歌智慧互联科技有限公司 Key value correction method, device, equipment and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080082103A (en) * 2007-03-07 2008-09-11 삼성전자주식회사 Method and apparatus for encoding audio data in digital multimedia broadcasting system
CN101989379A (en) * 2009-07-31 2011-03-23 宁波家天下智能系统有限公司 Learning method and transmitting method of infrared cod signal and remote controller
CN104217576A (en) * 2014-07-10 2014-12-17 广州市河东电子有限公司 Decoding/coding method of infrared pulse signal
US9503123B1 (en) * 2014-12-22 2016-11-22 EMC IP Holding Company LLC Random access to compressed data using bitwise indices
CN107393291A (en) * 2017-07-07 2017-11-24 青岛酷控网络科技有限公司 A kind of compression of red outer code data and decompression method
CN105610447B (en) * 2015-10-29 2018-06-19 吴均 Zonal coding compression method based on LZ77 algorithms

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080082103A (en) * 2007-03-07 2008-09-11 삼성전자주식회사 Method and apparatus for encoding audio data in digital multimedia broadcasting system
CN101989379A (en) * 2009-07-31 2011-03-23 宁波家天下智能系统有限公司 Learning method and transmitting method of infrared cod signal and remote controller
CN104217576A (en) * 2014-07-10 2014-12-17 广州市河东电子有限公司 Decoding/coding method of infrared pulse signal
US9503123B1 (en) * 2014-12-22 2016-11-22 EMC IP Holding Company LLC Random access to compressed data using bitwise indices
CN105610447B (en) * 2015-10-29 2018-06-19 吴均 Zonal coding compression method based on LZ77 algorithms
CN107393291A (en) * 2017-07-07 2017-11-24 青岛酷控网络科技有限公司 A kind of compression of red outer code data and decompression method

Also Published As

Publication number Publication date
CN109872522A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
RU2682009C2 (en) Method and device for coding and decoding of basic data using compression of symbols
CN100517979C (en) Data compression and decompression method
CN101557517B (en) Decoder, decoding method and apparatus
US9900025B2 (en) Efficient adaptive seismic data flow lossless compression and decompression method
CN110518917B (en) LZW data compression method and system based on Huffman coding
CN101299611B (en) Data compression method based on set run
KR20120018360A (en) Method for variable length coding and apparatus
CN109872522B (en) Algorithm for decompressing infrared code based on sample index
CN105120276A (en) Adaptive Motion JPEG coding method and system
CN105281777B (en) A kind of compression method, system and the remote controler of remote controler learning data
CN105719473B (en) A kind of SCM Based multifunction remote-control method and remote control device
JP2022048930A (en) Data compression method, data compression device, data compression program, data decompression method, data decompression device, and data decompression program
Ibrahim et al. Comparison between (rle and huffman) algorithmsfor lossless data compression
CN114024952B (en) File compression transmission method based on DL/T698.45-2007 protocol
CN111600610A (en) Variable-length integer universal coding method, system and electronic equipment
CN104682966A (en) Non-destructive compressing method for list data
US20150236714A1 (en) Method and device for compressing digital data
CN112328373B (en) Distributed simulation-oriented automatic discovery method for data distribution service DDS
CN100581258C (en) Hoffman decoding method and Hoffman decoding device
KR101541869B1 (en) Method for encoding and decoding using variable length coding and system thereof
CN106549672B (en) A kind of three axis data compression methods of acceleration transducer
CN105007083A (en) Method for storing output result of LZ77 compression algorithm
CN105306941A (en) Video coding method
CN105141960A (en) Method for information transmission based on JPEG2000 compressed code stream
CN104113394A (en) Communication modulating signal compressing and decompressing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230425

Address after: Room 1101, Building 2, Science and Technology Center, No. 856 Zhongshan East Road, High tech Zone, Shijiazhuang City, Hebei Province, 050000

Patentee after: Hebei guangzhiyi Information Technology Co.,Ltd.

Address before: 050030 times ark B1001, 36 Guang'an Street, Chang'an District, Shijiazhuang City, Hebei Province

Patentee before: HEBEI DIYE INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right