US 11,984,021 B2
Infrared remote control code matching method and apparatus, computer device, and readable storage medium
Lanfeng Li, Zhejiang (CN)
Assigned to HANGZHOU TUYA INFORMATION TECHNOLOGY CO., LTD., Zhejiang (CN)
Filed by HANGZHOU TUYA INFORMATION TECHNOLOGY CO., LTD., Zhejiang (CN)
Filed on Dec. 1, 2021, as Appl. No. 17/539,228.
Claims priority of application No. 202110002067.9 (CN), filed on Jan. 4, 2021.
Prior Publication US 2022/0215746 A1, Jul. 7, 2022
Int. Cl. G08C 23/04 (2006.01); H03M 7/30 (2006.01)
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
OG exemplary drawing
 
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.