Summary of the invention
In view of this, the invention provides a kind of method and device that parses physics code from remote control code pulse, to overcome the duration due to adjacent low and high level pulse in the remote controller codes pulse of use timer computational physics code correspondence in prior art, may there is error, in this case, there will be duration because calculating not within the scope of predetermined threshold value, and make driver abandon the problem of this duration, finally cause the problem of physics code parse error.
For achieving the above object, the invention provides following technical scheme:
A method that parses physics code from remote control code pulse, is applied to intelligent television, comprising:
Obtain successively the duration of each low level pulse in remote control code pulse section;
For the duration of each low level pulse, the size of more described duration and default time interval;
When the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0;
When the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1;
The all binary values that parse are generated to physics code.
Preferably, the described duration of obtaining successively each low level pulse in remote control code pulse section comprises:
Receive the remote control code pulse that infrared receiving circuit reports, described remote control code pulse is corresponding with the button of Infrared remote controller;
When starting, first rising edge of described remote control code pulse starts timer;
Calculate respectively the mistiming of adjacent negative edge and rising edge, the mistiming except first mistiming is the duration of each low level pulse in remote control code pulse section.
Preferably, the mistiming of the adjacent negative edge of described calculating and rising edge comprises:
Obtain the first clocking value, the value of timer when described the first clocking value is described negative edge arrival;
Obtain the second clocking value, the value of timer when described the second clocking value is described rising edge arrival;
The difference of calculating described the second clocking value and described the first clocking value, described difference is the mistiming of adjacent negative edge and rising edge.
Preferably, in described remote control code pulse section, at least comprise 33 low level pulses.
Preferably, described very first time interval was 100000 nanoseconds nanosecond to 999999, and described the second time interval was 900000 nanoseconds nanosecond to 2500000.
A device that parses physics code from remote control code pulse, is applied to intelligent television, comprising:
Duration acquiring unit, for obtaining successively the duration of each low level pulse of remote control code pulse section;
Comparing unit, for the duration for each low level pulse, the size of more described duration and default time interval;
The first resolution unit, for when the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, and described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0;
The second resolution unit, for when the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, and described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1;
Physics code resolution unit, for generating physics code by all binary values that parse.
Preferably, described duration acquiring unit comprises:
Remote control code pulse receives subelement, the remote control code pulse reporting for receiving infrared receiving circuit, and described remote control code pulse is corresponding with the button of Infrared remote controller;
Promoter unit, starts timer while starting for first rising edge at described remote control code pulse;
Low level pulse duration computation subunit, the mistiming of calculating respectively adjacent negative edge and rising edge, the mistiming except first mistiming is the duration of each low level pulse in remote control code pulse section.
Preferably, described low level pulse duration computation subunit comprises:
The first computing module, for obtaining the first clocking value, the value of timer when described the first clocking value is described negative edge arrival;
The second computing module, for obtaining the second clocking value, the value of timer when described the second clocking value is described rising edge arrival;
The 3rd computing module, for calculating the difference of described the second clocking value and described the first clocking value, described difference is the mistiming of adjacent negative edge and rising edge.
Preferably, in described remote control code pulse section, at least comprise 33 low level pulses.
Preferably, described very first time interval was 100000 nanoseconds nanosecond to 999999, and described the second time interval was 900000 nanoseconds nanosecond to 2500000.
Known via above-mentioned technical scheme, compared with prior art, the invention discloses a kind of method and device that parses physics code from remote controller codes pulse, the method and application of installation are in intelligent television, first, obtain successively the duration of each low level pulse in remote control code pulse section; For the duration of each low level pulse, the size of duration and default time interval relatively; When the duration is in very first time interval, low level pulse corresponding to duration resolved to binary value 0, very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; When the duration is in the second time interval, low level pulse corresponding to duration is resolved to binary value 1, the second time interval and be greater than and judge that whether low level pulse is that the original time of binary value 1 is interval; The all binary values that parse are generated to physics code.By expanding very first time interval and the second time interval, and then guaranteed accurate parsing physics code.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Term " first " in instructions of the present invention and claims and above-mentioned accompanying drawing, " second " etc. are for distinguishing similar object, and needn't be for describing specific order or precedence.The term that should be appreciated that such use suitably can exchange in situation, and this is only to describe the differentiation mode in embodiments of the invention, the object of same alike result being adopted when describing.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, so that the process that comprises a series of unit, method, system, product or equipment are not necessarily limited to those unit, but can comprise clearly do not list or for other intrinsic unit of these processes, method, product or equipment.
From background technology, may there is error in the duration due to adjacent low and high level pulse in the remote controller codes pulse of use timer computational physics code correspondence in prior art, in this case, there will be duration because calculating not within the scope of predetermined threshold value, and make driver abandon the problem of this duration, finally cause the problem of physics code parse error.
For this reason, the invention discloses a kind of method and device that parses physics code from remote controller codes pulse, the method and application of installation, in intelligent television, first, obtain the duration of each low level pulse in remote control code pulse section successively; For the duration of each low level pulse, the size of duration and default time interval relatively; When the duration is in very first time interval, low level pulse corresponding to duration resolved to binary value 0, very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; When the duration is in the second time interval, low level pulse corresponding to duration is resolved to binary value 1, the second time interval and be greater than and judge that whether low level pulse is that the original time of binary value 1 is interval; The all binary values that parse are generated to physics code.By expanding very first time interval and the second time interval, and then guaranteed accurate parsing physics code.
Relevant for the idiographic flow of the above-mentioned method that parses physics code from remote controller codes pulse and the concrete structure that parses the device of physics code from remote controller codes pulse, will be elaborated by following examples.
Embodiment mono-
Referring to accompanying drawing 2, is the disclosed a kind of idiographic flow schematic diagram that parses the method for physics code from remote controller codes pulse of the embodiment of the present invention one, and the method is applied to intelligent television, and this specifically comprises following steps:
S101: the duration of obtaining successively each low level pulse in remote control code pulse section.
Remote control code pulse is that the button that triggers Infrared remote controller by user produces, due in remote control code pulse, by high level or low level, do not represent " 1 " or " 0 " in scale-of-two, but width by a pair of low and high level pulse represents, and, in remote control code pulse, in the paired height pulse of corresponding binary one or " 0 ", the duration of high level is identical, therefore, in the present embodiment, as long as the duration of obtaining successively each low level pulse in remote controller codes pulse burst, just can determine pulse burst with the paired low and high level of its composition corresponding be " 1 " or " 0 " in scale-of-two.
S102: for the duration of each low level pulse, the size of more described duration and default time interval.
Default time interval has two, " 1 " in a corresponding scale-of-two, " 0 " in another corresponding scale-of-two, by comparing the duration of each low level pulse and the size of above-mentioned default time interval, could determine " 1 " in the corresponding scale-of-two of which low level pulse, " 0 " in the corresponding scale-of-two of which low level pulse.
S103: when the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0.
Whether low level pulse is that the interval corresponding duration of the original time of Binary Zero is 0.565ms left and right, and in the present embodiment, the interval corresponding duration of the very first time is far longer than 0.565ms.
S104: when the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1.
Whether low level pulse is that the interval corresponding duration of the original time of binary one is 1.69ms left and right, and in the present embodiment, the duration that the second time interval is corresponding is far longer than 1.69ms.
S105: all binary values that parse are generated to physics code.
In this step, be according to parsing order, all binary values that parse are generated to physics code,
The invention discloses a kind of method that parses physics code from remote controller codes pulse, the method is applied to intelligent television, first, obtains successively the duration of each low level pulse in remote control code pulse section; For the duration of each low level pulse, the size of duration and default time interval relatively; When the duration is in very first time interval, low level pulse corresponding to duration resolved to binary value 0, very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; When the duration is in the second time interval, low level pulse corresponding to duration is resolved to binary value 1, the second time interval and be greater than and judge that whether low level pulse is that the original time of binary value 1 is interval; The all binary values that parse are generated to physics code.By expanding very first time interval and the second time interval, and then guaranteed accurate parsing physics code.
On the basis of the disclosed embodiment of the invention described above, the invention also discloses the another kind of method that parses physics code from remote control code pulse, will be described in detail by following examples below.
Embodiment bis-
Refer to accompanying drawing 3, for the disclosed another kind of the embodiment of the present invention two parses the method for physics code from remote control code pulse, the method is applied to intelligent television, and the method specifically comprises the steps:
S201: receive the remote control code pulse that infrared receiving circuit reports, described remote control code pulse is corresponding with the button of Infrared remote controller.
S202: start timer when first rising edge of described remote control code pulse starts.
S203: calculate respectively the mistiming of adjacent negative edge and rising edge, the mistiming except first mistiming is the duration of each low level pulse in remote control code pulse section.
It should be noted that, what first mistiming was corresponding is the low level duration of lead code.
Further it should be noted that, the mistiming of the adjacent negative edge of described calculating and rising edge specifically comprises the steps:
Obtain the first clocking value, the value of timer when described the first clocking value is described negative edge arrival;
Obtain the second clocking value, the value of timer when described the second clocking value is described rising edge arrival;
The difference of calculating described the second clocking value and described the first clocking value, described difference is the mistiming of adjacent negative edge and rising edge.
Further it should be noted that, in remote control code pulse section, at least comprise 33 low level pulses, wherein first low level pulse is the low level pulse in preamble code, and remaining is the low level pulse of physics code correspondence.
S204: for the duration of each low level pulse, the size of more described duration and default time interval.
S205: when the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0.In the present embodiment, interval of the described very first time was 100000 nanoseconds nanosecond to 999999.
S206: when the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1.In the present embodiment, described the second time interval was 900000 nanoseconds nanosecond to 2500000.
S207: all binary values that parse are generated to physics code.
The invention discloses a kind of method that parses physics code from remote controller codes pulse, the method is applied to intelligent television, first, obtains successively the duration of each low level pulse in remote control code pulse section by timer; For the duration of each low level pulse, the size of duration and default time interval relatively; When the duration is in very first time interval, low level pulse corresponding to duration resolved to binary value 0, very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; When the duration is in the second time interval, low level pulse corresponding to duration is resolved to binary value 1, the second time interval and be greater than and judge that whether low level pulse is that the original time of binary value 1 is interval; The all binary values that parse are generated to physics code.By expanding very first time interval and the second time interval, and then guaranteed accurate parsing physics code.
In the disclosed embodiment of the invention described above, describe method in detail, for method of the present invention, can adopt the device of various ways to realize, therefore the invention also discloses a kind of device, provide specific embodiment below and be elaborated.
Embodiment tri-
Referring to accompanying drawing 4, is the disclosed a kind of concrete structure schematic diagram that parses the device of physics code from remote control code pulse of the embodiment of the present invention three, and this application of installation is in intelligent television, and this device specifically comprises as lower unit:
Duration acquiring unit 11, for obtaining successively the duration of each low level pulse of remote control code pulse section.
Comparing unit 12, for the duration for each low level pulse, the size of more described duration and default time interval.
The first resolution unit 13, for when the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, and described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0.
The second resolution unit 14, for when the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, and described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1.
Physics code resolution unit 15, for generating physics code by all binary values that parse.
It should be noted that, relevant for the functional description of above-mentioned unit, specifically refer to the related description in embodiment of the method, the present embodiment repeats no more.
Embodiment tetra-
Refer to accompanying drawing 5, for the disclosed another kind of the embodiment of the present invention four parses the concrete structure schematic diagram of the device of physics code from remote control code pulse, this application of installation is in intelligent television, and this device specifically comprises as lower unit:
Remote control code pulse receives subelement 21, the remote control code pulse reporting for receiving infrared receiving circuit, and described remote control code pulse is corresponding with the button of Infrared remote controller.
Promoter unit 22, starts timer while starting for first rising edge at described remote control code pulse.
Low level pulse duration computation subunit 23, the mistiming of calculating respectively adjacent negative edge and rising edge, the mistiming except first mistiming is the duration of each low level pulse in remote control code pulse section.
It should be noted that, described low level pulse duration computation subunit specifically comprises: the first computing module, and for obtaining the first clocking value, the value of timer when described the first clocking value is described negative edge arrival; The second computing module, for obtaining the second clocking value, the value of timer when described the second clocking value is described rising edge arrival; The 3rd computing module, for calculating the difference of described the second clocking value and described the first clocking value, described difference is the mistiming of adjacent negative edge and rising edge.
Further it should be noted that, in described remote control code pulse section, at least comprise 33 low level pulses.
Comparing unit 24, for the duration for each low level pulse, the size of more described duration and default time interval.
The first resolution unit 25, for when the described duration is in very first time interval, low level pulse corresponding to described duration resolved to binary value 0, and described very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; In the present embodiment, interval of the described very first time was 100000 nanoseconds nanosecond to 999999.
The second resolution unit 26, for when the described duration is in the second time interval, low level pulse corresponding to described duration resolved to binary value 1, and described the second time interval is greater than and judges whether low level pulse is the original time interval of binary value 1; In the present embodiment, described the second time interval was 900000 nanoseconds nanosecond to 2500000.
Physics code resolution unit 27, for generating physics code by all binary values that parse.
It should be noted that, relevant for the functional description of above-mentioned unit, specifically refer to the related description in embodiment of the method, the present embodiment repeats no more.
In sum:
The invention discloses a kind of method and device that parses physics code from remote controller codes pulse, the method and application of installation, in intelligent television, first, obtain the duration of each low level pulse in remote control code pulse section successively; For the duration of each low level pulse, the size of duration and default time interval relatively; When the duration is in very first time interval, low level pulse corresponding to duration resolved to binary value 0, very first time interval is greater than and judges whether low level pulse is the original time interval of binary value 0; When the duration is in the second time interval, low level pulse corresponding to duration is resolved to binary value 1, the second time interval and be greater than and judge that whether low level pulse is that the original time of binary value 1 is interval; The all binary values that parse are generated to physics code.By expanding very first time interval and the second time interval, and then guaranteed accurate parsing physics code.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part partly illustrates referring to method.
It should be noted that in addition, device embodiment described above is only schematic, the wherein said unit as separating component explanation can or can not be also physically to separate, the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of module wherein to realize the object of the present embodiment scheme.In addition, in device embodiment accompanying drawing provided by the invention, the annexation between module represents to have communication connection between them, specifically can be implemented as one or more communication bus or signal wire.Those of ordinary skills, in the situation that not paying creative work, are appreciated that and implement.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add essential common hardware by software and realize, and can certainly comprise that special IC, dedicated cpu, private memory, special-purpose components and parts etc. realize by specialized hardware.Generally, all functions being completed by computer program can realize with corresponding hardware at an easy rate, and the particular hardware structure that is used for realizing same function can be also diversified, such as mimic channel, digital circuit or special circuit etc.But software program realization is better embodiment under more susceptible for the purpose of the present invention condition.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium can read, as the floppy disk of computing machine, USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) method described in each embodiment of execution the present invention.
In sum, above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to above-described embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record the various embodiments described above is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.