CPC G08C 23/04 (2013.01) [H03M 7/3068 (2013.01); H03M 7/6011 (2013.01); G08C 2200/00 (2013.01); G08C 2201/20 (2013.01)] | 20 Claims |
1. An infrared remote control code matching method, comprising:
acquiring an infrared remote control code stream, the infrared remote control code stream comprising multiple pieces of code data;
statistically obtaining an occurrence frequency of each piece of code data in the infrared remote control code stream, and dividing a data region covered by the infrared remote control code stream into multiple data subregions according to the occurrence frequency of each piece of code data in the infrared remote control code stream;
performing an encoding process on the each piece of code data in the infrared remote control code stream according to a size of the each piece of code data in the infrared remote control code stream and the multiple data subregions to obtain an encoded stream; and
matching the encoded stream and an encoded infrared remote control code stream recorded in an infrared remote control code library to find a corresponding infrared remote control code stream from the infrared remote control code library;
wherein dividing the data region of the infrared remote control code stream into the multiple data subregions according to the occurrence frequencies of the code data in the infrared remote control code stream comprises:
selecting first code data and second code data from the infrared remote control code stream according to the occurrence frequencies of the code data in the infrared remote control code stream;
obtaining four pieces of partitioning code data according to the first code data, the second code data and a preset offset; and
dividing the data region of the infrared remote control code stream into five continuous data subregions according to sizes of the four pieces of partitioning code data;
wherein matching the encoded stream and the encoded infrared remote control code stream recorded in the infrared remote control code library comprises:
when a length of the code data in the encoded stream is different from a length of the encoded infrared remote control code stream recorded in the infrared remote control code library, comparing the code data in the encoded stream with code data of the encoded infrared remote control code stream of which the length is the same to the length of the code data in the encoded stream, in the encoded infrared remote control code stream recorded in the infrared remote control code library;
when a comparing result is a mismatched result, determining that the encoded stream is matched with the encoded infrared remote control code stream recorded in the infrared remote control code library.
|