CN109872522A - The algorithm that infrared code is decompressed based on sample index - Google Patents

The algorithm that infrared code is decompressed based on sample index Download PDF

Info

Publication number
CN109872522A
CN109872522A CN201910226160.0A CN201910226160A CN109872522A CN 109872522 A CN109872522 A CN 109872522A CN 201910226160 A CN201910226160 A CN 201910226160A CN 109872522 A CN109872522 A CN 109872522A
Authority
CN
China
Prior art keywords
code
data
sample
little endian
endian 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.)
Granted
Application number
CN201910226160.0A
Other languages
Chinese (zh)
Other versions
CN109872522B (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

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Details Of Television Systems (AREA)

Abstract

Invention provides a kind of algorithm decompressed based on sample index to infrared code, including a, filter code: logical filtering code formula obtained filter data N, obtained infrared absorption filter code data;B, hexadecimal data and little endian mode are converted into;C, sample yardage group and number of samples are obtained;D, compressing and converting sample code;E, the compressed code of splicing tape compressing information: final compressed code character string=reservation data (being fixed as " 00 ")+number of samples+sample yardage group+compressing and converting code;F, decompression algorithm is exactly the inverse operation to e to a.The length of transmission data can be shortened, largely after compression processing to reduce the bandwidth consumption and transmission speed when network transmission.Its effect is similar to video and neglects frequency file relatively by the formation of certain decompression algorithm come to reduce transmission consumption and memory space.

Description

The algorithm that infrared code is decompressed based on sample index
Technical field
The invention belongs to smart home infrared data transmission fields, are specifically related to one kind based on sample index to infrared code The algorithm of decompression.
Background technique
Generally existing receivable infrared data and the household electrical appliance controlled in resident family, such as: TV, air-conditioning, intelligence Energy TV box etc..Infrared waves are sent by the Microsecond grade time by low and high level, and we term it infrared radiation sources for this combination Code, such as the infrared source code of Huawei's intelligence box power button are as follows: 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.When infrared receiving set receives infrared radiation source After code, according to protocol, corresponding function is executed.
For infrared source code according to the difference of factory settings, length is also different, the longest infrared source code being currently known according to Character calculating reaches 2365 characters, 644 infrared waves.Uncompressed source code data can consume excessive when passing through network transmission Resource.
Summary of the invention
In order to solve the problems existing in the prior art, the present invention provides one kind to compress infrared source code, shortens and passes The infrared source code compression algorithm of transmission of data length.
The technical solution adopted by the present invention are as follows: based on the algorithm that sample index decompresses infrared code, include the following steps:
A, it filters code: some infrared waves data M is filtered, logical filtering code formula obtained filter data N, obtained infrared absorption filter Code data;
B, hexadecimal data and little endian mode are converted into: infrared absorption filter code data are converted into hexadecimal format, Each data are indicated using the hexadecimal of double byte, carry out cover using 0 in preamble bit if insufficient double byte, also It is to obtain hexadecimal data from 0000 to FFFF;Then hexadecimal data is converted into little endian mode, i.e., front two is with after Two exchanges, obtain little endian mode data;
C, sample yardage group and number of samples are obtained: since little endian mode data are all that high level with low level replaces Existing, i.e. first little endian mode data are high level, second little endian mode data is low level, third little endian mode data It is low level ... and so on for high level, the 4th little endian mode data, by the number of low and high level in little endian mode data According to being one group, that is, first little endian mode data is high level, second little endian mode data is low level, and merging becomes First group, third little endian mode data are high level, the 4th little endian mode data are low level, and merging becomes second Group ... and so on obtains low and high level data, then therefrom conclude and extract all different data until obtaining last group As sample code, all sample code collections are combined into sample yardage group, and the sample code number in sample yardage group is number of samples;Sample The call number of sample code is indicated with hexadecimal data from 0 to F in yardage group;
D, compressing and converting sample code: adjacent identical low and high level data obtain the reduced rule of single group compressed code are as follows: single group Compressed code is made of two numbers, and first digit is expressed as the call number of sample code, and second digit indicates this from 0 to F The number that adjacent identical low and high level data need to send;The permutation and combination of all single group compressed codes is compressing and converting code;
E, the compressed code of splicing tape compressing information: final compressed code character string=reservation data (being fixed as " 00 ")+sample Number+sample yardage group+compressing and converting code;
F, decompress: decompression algorithm is exactly the inverse operation to e to a.
Further, code formula is filtered in the step a are as follows: N=round (M/200.0) * 200.
Further, in the step d, if the number of adjacent identical low and high level data is more than 15, F is arrived using 0 The mode of superposition indicates;That is single group compressed code=sample code call number+" F "+sample code call number+" (for needing to send Several -15) corresponding hexadecimal notation ", and so on.
It further, is 65530 by its mandatory modification if N is greater than 65535 in the step a.
Further, number of samples requires to be no more than 16 in the step c.
What the present invention obtained has the beneficial effect that the also known as uncommon sub- algorithm of sample index algorithm SIA.Based on sample index to infrared The algorithm of code decompression is transmitted in a network after infrared source code is carried out compression processing, then the solution before infrared transmitter emits It is pressed into infrared source code to be emitted, to achieve the purpose that remote control home electrical appliance.Infrared source code is longer, after compression processing The length of transmission data can be shortened, largely to reduce the bandwidth consumption and transmission speed when network transmission.Its effect is similar to Video neglects frequency file relatively by the formation of certain decompression algorithm come to reduce transmission consumption and memory space.
Specific embodiment
The following is a clear and complete description of the technical scheme in the embodiments of the invention, it is clear that described embodiment Only a part of the embodiment of the present invention, instead of all the embodiments.
Based on the algorithm that sample index decompresses infrared code, include the following steps:
A, it filters code: some infrared waves data M is filtered, lead to filtering code formula N=round (M/ 200.0) * 200 filter data N was obtained;If N is greater than 65535, it is 65530 by its mandatory modification, obtains infrared absorption filter code data;
B, hexadecimal data and little endian mode are converted into: infrared absorption filter code data are converted into hexadecimal format, Each data indicate that insufficient double byte then carrys out cover using 0 in preamble bit using the hexadecimal of double byte, that is, From 0000 to FFFF, hexadecimal data is obtained;Hexadecimal data is so converted into little endian mode, i.e., rear front two and rear two Position exchanges, and obtains little endian mode data;
C, sample yardage group and number of samples are obtained: as soon as be group by the data of low and high level in little endian mode data, Be first little endian mode data be high level, second little endian mode data is low level, merging becomes first group, third Little endian mode data are high level, the 4th little endian mode data are low level, and merging becomes second group ... and so on, directly To last group is obtained, sample code is obtained, then therefrom concludes and extracts all different data, as sample yardage group, sample code Sample code number in array is number of samples;The call number hexadecimal data of sample code is from 0 to F table in sample yardage group Show;
D, compressing and converting sample code: adjacent identical sample code obtains the reduced rule of single group compressed code are as follows: single group compressed code Be made of two numbers, first digit is expressed as the call number of sample code, second digit indicated from 0 to F this it is adjacent and Identical sample code needs the number sent;The permutation and combination of all single group compressed codes is compressing and converting code;It is adjacent if they are the same When the number of sample code is more than 15, indicated by the way of 0 to F superposition;I.e. single group compressed code=sample code call number+ " F "+sample code call number+" (number -15 for needing to send) corresponding hexadecimal notation ", and so on;
E, the compressed code of splicing tape compressing information: final compressed code character string=reservation data (being fixed as " 00 ")+sample Number+sample yardage group+compressing and converting code;
F, decompress: decompression algorithm is exactly the inverse operation to e to a.
According to infrared code recognition rule, source code data can be supported to float up and down the offsets of 100 microseconds.
Embodiment 1
The infrared code source code of Huawei's box power supply are as follows:
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, it filters code: infrared code source code data (M) inconsistent each other is filtered into filter code data (N) identical as far as possible.Its If infrared code source code data have been more than 96056 uniformly to become 65530 (it is found through experiment that 20000 in 65535, such as case in It is an effect to 99999).
Filter code formula are as follows: N=round (M/200.0) * 200, such as bring formula into for 9019 and obtain 9000.
Red outer code data after filtering code are 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, hexadecimal data and little endian mode are converted into:
Each data are converted into hexadecimal representation, such as 9000 are converted to 2328.If number is namely less than 4096 FFF then supplements 0 in preamble bit, is 0FFF, such as 600 are converted to 0258.
Little endian mode, front two and rear two exchanges are converted data to, such as: 2328 are converted to 2823,0258 conversion It is 5802.
By conversion, data are obtained are 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, sample yardage group and number of samples are obtained:
Since little endian mode data are all that high level is alternately present with low level, i.e. first little endian mode data are high electricity Flat, second little endian mode data are low level, third little endian mode data are high level, the 4th little endian mode data are The data of low and high level in little endian mode data are one group by low level ... and so on, that is, first little endian mode Data are high level, second little endian mode data is low level, and merging becomes first group, and third little endian mode data are height Level, the 4th little endian mode data are low level, and merging becomes second group ... and so on, until obtaining last group, Obtain low and high level data;
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;
It therefrom concludes again and extracts all different data as sample code, all sample code collections are combined into sample yardage group, sample Sample code number in this yardage group is number of samples;The call number hexadecimal data of sample code is from 0 in sample yardage group It is indicated to F, number of samples rigid requirement is no more than 16 herein;
28233011,58025802,58024006,5802E899,28239808,5802FAFF;
Number of samples is 06, and call number is 0,1,2,3,4,5 respectively.
D, compressing and converting sample code:
Low and high level data are compressed according to sample code, that is, describe low and high level number using compressed format According to if previous group low and high level data, as later group low and high level data, the cumulative mode of the number that then be used directly describes.
Such as: 28233011 are compressed to 01, represent index and occur 1 time as 0 sample code (28233011).
It can obtain compressed code are as follows:
011121122211221122122113231124132112314151
E, the compressed code of splicing tape compressing information:
Final infrared compressed code=reservation data (it is fixed as " 00 ")+number of samples (" 06 ")+sample code (" 28233011 58025802580240065802E899282398085802FAFF ")+compressing and converting code (" 011121122211221122122 113231124132112314151“)
Therefore final infrared compressed code are as follows:
00062823301158025802580240065802E899282398085802FAFF0111211222112211 22122113231124132112314151
F, decompress: decompression algorithm is exactly the inverse operation to compression algorithm.
Embodiment 2
The infrared source code of certain key of the tune of certain air-conditioning:
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 red outer code data after code is filtered are 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, hexadecimal data and little endian mode are converted into:
Little endian 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, sample yardage group and number of samples are obtained:
Low and high 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
Statistics obtains sample yardage group are as follows:
90019001,90017062,100E0807,90017805,9001F087,9001E803;
Number of samples is 06, and call number is 0,1,2,3,4,5 respectively.
D, compressing and converting sample code:
By compression algorithm are as follows:
05112131033104310132013502310B310F0F0F0F06310F0F0F083102310241213103 3104310132013502310F03310233033101330E3101310F03320A320F023204320F023751;
E, the compressed code of splicing tape compressing information:
Finally compress infrared code are as follows:
00069001900190017062100E0807900178059001F0879001E8030511213103310431 0132013502310B310F0F0F0F06310F0F0F0831023102412131033104310132013502310F0331 0233033101330E3101310F03320A320F023204320F023751

Claims (5)

1. the algorithm decompressed based on sample index to infrared code, characterized by the following steps:
A, it filters code: some infrared waves data M is filtered, logical filtering code formula obtained filter data N, obtained infrared absorption filter yardage According to;
B, hexadecimal data and little endian mode are converted into: infrared absorption filter code data being converted into hexadecimal format, each Data are all indicated using the hexadecimal of double byte, carry out cover using 0 in preamble bit if insufficient double byte, that is, from 0000 arrives FFFF, obtains hexadecimal data;Then hexadecimal data is converted into little endian mode, i.e. front two and two latter It exchanges, obtains little endian mode data;
C, sample yardage group and number of samples are obtained: since little endian mode data are all that high level is alternately present with low level, i.e., First little endian mode data is high level, second little endian mode data is low level, third little endian mode data are high Level, the 4th little endian mode data are low level ... and so on, and the data by low and high level in little endian mode data are One group, that is, first little endian mode data is high level, second little endian mode data is low level, merging becomes first Group, third little endian mode data are high level, the 4th little endian mode data are low level, merge become second group ... with This analogizes, and until obtaining last group, obtains low and high level data, then therefrom conclude and extract all different data as sample Code, all sample code collections are combined into sample yardage group, and the sample code number in sample yardage group is number of samples;In sample yardage group The call number of sample code is indicated with hexadecimal data from 0 to F;
D, compressing and converting sample code: adjacent identical low and high level data obtain the reduced rule of single group compressed code are as follows: single group compression Code is made of two numbers, and first digit is expressed as the call number of sample code, and second digit indicates that this is adjacent from 0 to F Identical low and high level data need the number sent;The permutation and combination of all single group compressed codes is compressing and converting code;
E, the compressed code of splicing tape compressing information: final compressed code character string=reservation data (being fixed as " 00 ")+number of samples+ Sample yardage group+compressing and converting code;
F, decompress: decompression algorithm is exactly the inverse operation to e to a.
2. the algorithm decompressed according to claim 1 based on sample index to infrared code, it is characterised in that: the step a Middle filter code formula are as follows: N=round (M/200.0) * 200.
3. the algorithm decompressed according to claim 1 based on sample index to infrared code, it is characterised in that: the step d In, if the number of adjacent identical low and high level data is more than 15, indicated by the way of 0 to F superposition;I.e. single group is compressed The call number of code=sample code+" F "+sample code call number+" (number -15 for needing to send) corresponding hexadecimal notation ", And so on.
4. the algorithm decompressed according to claim 1 based on sample index to infrared code, it is characterised in that: the step a In, it is 65530 by its mandatory modification if N is greater than 65535.
5. the algorithm decompressed according to claim 1 based on sample index to infrared code, it is characterised in that: the step c Middle number of samples requires to be no 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 true CN109872522A (en) 2019-06-11
CN109872522B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113850988A (en) * 2020-12-24 2021-12-28 广东朝歌智慧互联科技有限公司 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

Cited By (1)

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

Also Published As

Publication number Publication date
CN109872522B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN101932002B (en) Method for realizing matching between uplink transmission rate and downlink transmission rate as well as BBU and RRU
RU2682009C2 (en) Method and device for coding and decoding of basic data using compression of symbols
CN102881286B (en) Intelligent remote control system and its control method
CN103442279B (en) A kind of based on Set Top Box and the interactive system of intelligent television and method
CN101795407A (en) Method and device for encoding a bit sequence
CN102968897A (en) Household appliance remote control method based on handheld equipment
CN104205831A (en) Golomb-Rice/EG coding technique for CABAC in HEVC
US20100127902A1 (en) Lossless data compression with separated index values and literal values in output stream
CN102916749A (en) Light communication transmitting and receiving system
CN101562455A (en) Context-based adaptive binary arithmetic coding (cabac) decoding apparatus and decoding method thereof
GB2444879A (en) System and up,down link transmission method of frequency distribution user inserted in local network
CN1242567C (en) Radio interconnected method and equipment for two-way communication between audio and/or video device
CN109872522A (en) The algorithm that infrared code is decompressed based on sample index
CN105719473A (en) Multifunctional remote control method and device based on single-chip microcomputer
CN106412384A (en) Video processing system
CN105120276A (en) Adaptive Motion JPEG coding method and system
CN113220651B (en) Method, device, terminal equipment and storage medium for compressing operation data
CN102595222A (en) Digital television set top box based on LED visible light communication
CN205029921U (en) No line light accuse sight system
CN102843345B (en) Remote communication method and computer program product thereof
CN112328373B (en) Distributed simulation-oriented automatic discovery method for data distribution service DDS
CN105590445A (en) Household intelligent remote control system
CN201965746U (en) Remote control encoding circuit based on FPGA (Field Programmable Gate Array)
CN112988211B (en) Equipment upgrading method and control device based on Zigbee
CN107393291A (en) A kind of compression of red outer code data and decompression 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