The method and device of physics code is parsed from remote control code pulse
Technical field
The present invention relates to ntelligent television technolog field, is to be related to from remote control code pulse to parse thing in particular
Manage the method and device of code.
Background technology
IR remote controller is a kind of radio transmitting apparatus, when any one button on IR remote controller is pressed,
IR remote controller first produces the remote control code pulse of button, then remote control code pulse is modulated to form remote signal, most
Remote signal is launched in the form of infrared ray by infrared transmitting tube by drive circuit afterwards, that is, sends infrared remote control letter
Number.It is integrated with radio system in intelligent television, radio system first passes through infrared receiver and will received
Infrared remote-controlled signal is transformed into remote signal, then remote signal is demodulated to form remote control code pulse, the bottom of finally by
The IR remote controller driver of layer parses physics code from remote control code pulse, and physics code is reported to the operation on upper strata
System.So that physics code is further mapped as key assignments by the operating system on upper strata and key assignments is reported into application program, by applying
Routine call application operating submodule corresponding with key assignments completes specific application operating.
As shown in figure 1, generally, code corresponding to the remote control code pulse of one-touch action, which comprises at least, a guidance code
With one physics code is formed by 32 Bits Serial binary values.First 16 in physics code are systematic code, and systematic code is not with button
Different and change, it is an identification mark in order to represent specific user and set, to distinguish different types of infrared remote control
The infrared remote-controlled signal of device transmitting, so as to prevent maloperation.Latter 16 in physics code include 8 numeric data codes(It is referred to as
Function code)And 8 numeric data code radix-minus-one complements, numeric data code change with the difference of button, are the identification marks of button.In addition, distant
Control in coded pulse, be not to represent " 1 " or " 0 " in binary system with high level or low level, but pass through a pair of height electricity
The width of flat pulse represents.For example, for guidance code, corresponding above-mentioned width is 13.5ms, right for binary value " 0 "
It is 1.125ms to answer above-mentioned width;For binary value " 1 ", corresponding above-mentioned width is 2.25ms.Therefore, IR remote controller drives
Program needs to parse physics code from remote control code pulse according to the width of each pair of pulse in remote control code pulse.
In the prior art, physics code is parsed from remote control code pulse by the IR remote controller driver of bottom
Method it is specific as follows:Holding for adjacent low and high level pulse in remote controller codes pulse is calculated corresponding to physics code using timer
The continuous time, by judging the duration whether in preset threshold range, and then determine binary value corresponding to this section of pulse
It is " 0 " or " 1 ", and binary value corresponding to this section of pulse is recorded, when the number of the value of record reaches physics code
Presetting digit capacity(Such as, 32)When, then succeed and a physics code is parsed from remote control code pulse.
But in the above-mentioned methods, calculate adjacent height in remote controller codes pulse corresponding to physics code using timer
Duration of level pulse it is possible that error, in this case, it may appear that because the duration calculated is not default
In threshold range, and the problem of driver is abandoned the duration, physics code parsing mistake is ultimately resulted in.
The content of the invention
In view of this, the invention provides a kind of method and device that physics code is parsed from remote control code pulse, with
Overcome in the prior art due to calculating adjacent low and high level pulse in remote controller codes pulse corresponding to physics code using timer
Duration it is possible that error, in this case, it may appear that because the duration calculated is not in preset threshold range
It is interior, and the problem of driver is abandoned the duration, ultimately result in the problem of parsing of physics code is wrong.
To achieve the above object, the present invention provides following technical scheme:
A kind of method that physics code is parsed from remote control code pulse, applied to intelligent television, including:
The duration of each low level pulse in remote control code pulse section is obtained successively;
For the duration of each low level pulse, the duration and the size of default time interval;
When the duration is in very first time section, low level pulse corresponding to the duration is resolved to
Binary value 0, the very first time section be more than judge low level pulse whether be binary value 0 original time section;
When the duration is in the second time interval, low level pulse corresponding to the duration is resolved to
Binary value 1, second time interval be more than judge low level pulse whether be binary value 1 original time section;
All binary values parsed are generated into physics code.
Preferably, the duration for obtaining each low level pulse in remote control code pulse section successively includes:
Receive the remote control code pulse that infrared receiving circuit reports, the button of the remote control code pulse and IR remote controller
It is corresponding;
Start timer when first rising edge of the remote control code pulse starts;
The time difference of adjacent falling edges and rising edge is calculated respectively, and the time difference in addition to first time difference is to be remotely controlled
The duration of each low level pulse in coded pulse section.
Preferably, the adjacent falling edges and the time difference of rising edge of calculating include:
The first clocking value is obtained, first clocking value is the value of timer when the trailing edge arrives;
The second clocking value is obtained, second clocking value is the value of timer when the rising edge arrives;
The difference of second clocking value and first clocking value is calculated, the difference is adjacent falling edges and rising
The time difference on edge.
Preferably, 33 low level pulses are comprised at least in the remote control code pulse section.
Preferably, the very first time section is 100000 nanoseconds to 999999 nanoseconds, and second time interval is
900000 nanoseconds to 2500000 nanoseconds.
A kind of device that physics code is parsed from remote control code pulse, applied to intelligent television, including:
Duration acquiring unit, for obtaining the duration of each low level pulse in remote control code pulse section successively;
Comparing unit, for the duration for each low level pulse, the duration with it is default when
Between section size;
First resolution unit, it is for when the duration is in very first time section, the duration is corresponding
Low level pulse resolve to binary value 0, the very first time section, which is more than, judges whether low level pulse is binary value 0
Original time section;
Second resolution unit, for when the duration is in the second time interval, the duration to be corresponded to
Low level pulse resolve to binary value 1, second time interval, which is more than, judges whether low level pulse is binary value 1
Original time section;
Physics code resolution unit, for all binary values parsed to be generated into physics code.
Preferably, the duration acquiring unit includes:
Remote control code pulse receiving subelement, the remote control code pulse reported for receiving infrared receiving circuit are described distant
It is corresponding with the button of IR remote controller to control coded pulse;
Promoter unit, for starting timer when first rising edge of the remote control code pulse starts;
Low level pulse duration computation subunit, the time difference of adjacent falling edges and rising edge is calculated respectively, except the
Time difference outside one time difference is the duration of each low level pulse in remote control code pulse section.
Preferably, the low level pulse duration computation subunit includes:
First computing module, for obtaining the first clocking value, first clocking value is timing when the trailing edge arrives
The value of device;
Second computing module, for obtaining the second clocking value, second clocking value is timing when the rising edge arrives
The value of device;
3rd computing module, for calculating the difference of second clocking value and first clocking value, the difference is
For the time difference of adjacent falling edges and rising edge.
Preferably, 33 low level pulses are comprised at least in the remote control code pulse section.
Preferably, the very first time section is 100000 nanoseconds to 999999 nanoseconds, and second time interval is
900000 nanoseconds to 2500000 nanoseconds.
Understood via above-mentioned technical scheme, compared with prior art, the invention discloses one kind from remote controller codes arteries and veins
The method and device of physics code is parsed in punching, this method and device are applied to intelligent television, first, obtain remote control coding successively
The duration of each low level pulse in pulse burst;For the duration of each low level pulse, compare the duration with it is pre-
If time interval size;When the duration is in very first time section, by low level pulse solution corresponding to the duration
Analyse as binary value 0, the very first time section be more than judge low level pulse whether be binary value 0 original time section;When
When duration is in the second time interval, low level pulse corresponding to the duration is resolved into binary value 1, the second time
Section be more than judge low level pulse whether be binary value 1 original time section;All binary values parsed are given birth to
Into physics code.By expanding very first time section and the second time interval, and then it ensure that accurate parsing physics code.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is coding schematic diagram corresponding to a kind of remote controller codes pulse provided in background of invention;
Fig. 2 is the tool for the method that physics code is parsed in a kind of pulse from remote controller codes disclosed in the embodiment of the present invention one
Body schematic flow sheet;
Fig. 3 is the method that another kind disclosed in the embodiment of the present invention two parses physics code from remote controller codes pulse
Idiographic flow schematic diagram;
Fig. 4 is the tool for the device that physics code is parsed in a kind of pulse from remote controller codes disclosed in the embodiment of the present invention three
Body structural representation;
Fig. 5 is the device that another kind disclosed in the embodiment of the present invention four parses physics code from remote controller codes pulse
Concrete structure schematic diagram.
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 carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
Term " first ", " second " in description and claims of this specification and above-mentioned accompanying drawing etc. are to be used to distinguish
Similar object, without for describing specific order or precedence.It should be appreciated that the term so used is in appropriate feelings
It can be exchanged under condition, this is only to describe object used differentiation in description in embodiments of the invention to same alike result
Mode.In addition, term " comprising " and " having " and their any deformation, it is intended that cover it is non-exclusive include, so as to
Process, method, system, product or equipment comprising a series of units are not necessarily limited to those units, but may include unclear
Other units that ground is listed or for these processes, method, product or equipment inherently.
From background technology, in the prior art due to calculating remote controller codes pulse corresponding to physics code using timer
In adjacent low and high level pulse duration it is possible that error, in this case, it may appear that because calculate it is lasting when
Between not in preset threshold range, and the problem of driver is abandoned the duration, it is wrong to ultimately result in the parsing of physics code
By mistake the problem of.
Therefore, the invention discloses the method and device that physics code is parsed in a kind of pulse from remote controller codes, the party
Method and device are applied to intelligent television, first, obtain the duration of each low level pulse in remote control code pulse section successively;Pin
To the duration of each low level pulse, compare the size of duration and default time interval;When the duration is
When in one time interval, low level pulse corresponding to the duration is resolved into binary value 0, the very first time, section was more than judgement
Low level pulse whether be binary value 0 original time section;When the duration is in the second time interval, when will be lasting
Between corresponding low level pulse resolve to binary value 1, the second time interval, which is more than, judges whether low level pulse is binary system
The original time section of value 1;All binary values parsed are generated into physics code.By expanding very first time section and second
Time interval, and then ensure that accurate parsing physics code.
It is related to parse the idiographic flow of the method for physics code in the above-mentioned pulse from remote controller codes and from remote control
The concrete structure of the device of physics code will be parsed in coded pulse to be described in detail by following examples.
Embodiment one
Accompanying drawing 2 is referred to, physics code is parsed from remote controller codes pulse for one kind disclosed in the embodiment of the present invention one
Method idiographic flow schematic diagram, this method is applied to intelligent television, and this is specifically comprised the steps of:
S101:The duration of each low level pulse in remote control code pulse section is obtained successively.
Remote control code pulse is caused by the button for triggering IR remote controller as user, due in remote control code pulse,
To represent " 1 " or " 0 " in binary system with high level or low level, but by the width of a pair of low and high level pulses come
Represent, moreover, in remote control code pulse, in the paired height pulse of corresponding binary one or " 0 ", high level continues
Time is identical, therefore, in the present embodiment, is held as long as obtaining each low level pulse in remote controller codes pulse burst successively
The continuous time, it just can determine that it is " 1 " or " 0 " in binary system that it is corresponding, which to form the pulse burst of paired low and high level, with it.
S102:For the duration of each low level pulse, the duration and default time interval
Size.
Default time interval has two, and " 1 " corresponded in binary system, another corresponds to " 0 " in binary system, leads to
The duration of more each low level pulse and the size of above-mentioned default time interval are spent, which low level arteries and veins just can determine that
" 1 " in the corresponding binary system of punching, which low level pulse correspond to " 0 " in binary system.
S103:When the duration is in very first time section, by low level pulse corresponding to the duration
Resolve to binary value 0, the very first time section be more than judge low level pulse whether be binary value 0 original time area
Between.
Low level pulse whether be the original time section of Binary Zero corresponding to the duration be 0.565ms or so, this
In embodiment, the duration corresponding to very first time section is far longer than 0.565ms.
S104:When the duration is in the second time interval, by low level pulse corresponding to the duration
Resolve to binary value 1, second time interval be more than judge low level pulse whether be binary value 1 original time area
Between.
Low level pulse whether be the original time section of binary one corresponding to the duration be 1.69ms or so, this
In embodiment, the duration corresponding to the second time interval is far longer than 1.69ms.
S105:All binary values parsed are generated into physics code.
In this step, it is according to parsing order, all binary values parsed is generated into physics code,
The invention discloses a kind of method that physics code is parsed in pulse from remote controller codes, this method is applied to intelligence
TV, first, the duration of each low level pulse in remote control code pulse section is obtained successively;For each low level pulse
Duration, compare the size of duration and default time interval;When the duration is in very first time section, will hold
Low level pulse corresponding to the continuous time resolves to binary value 0, the very first time section be more than and judge whether low level pulse is two
The original time section of hex value 0;When the duration is in the second time interval, by low level pulse corresponding to the duration
Resolve to binary value 1, the second time interval be more than judge low level pulse whether be binary value 1 original time section;
All binary values parsed are generated into physics code.By expanding very first time section and the second time interval, and then ensure
Accurate parsing physics code.
On the basis of the invention described above disclosed embodiment, the invention also discloses another kind from remote control code pulse
The method for parsing physics code, it will be described in detail below by following examples.
Embodiment two
Accompanying drawing 3 is referred to, physics code is parsed from remote control code pulse for another kind disclosed in the embodiment of the present invention two
Method, this method is applied to intelligent television, and this method specifically comprises the following steps:
S201:Receive the remote control code pulse that infrared receiving circuit reports, the remote control code pulse and IR remote controller
Button it is corresponding.
S202:Start timer when first rising edge of the remote control code pulse starts.
S203:The time difference of calculating adjacent falling edges and rising edge, the time difference in addition to first time difference are respectively
For the duration of each low level pulse in remote control code pulse section.
It should be noted that it is the low level duration of lead code corresponding to first time difference.
Explanation is needed further exist for, the time difference of the calculating adjacent falling edges and rising edge specifically includes following step
Suddenly:
The first clocking value is obtained, first clocking value is the value of timer when the trailing edge arrives;
The second clocking value is obtained, second clocking value is the value of timer when the rising edge arrives;
The difference of second clocking value and first clocking value is calculated, the difference is adjacent falling edges and rising
The time difference on edge.
Explanation is needed further exist for, 33 low level pulses are comprised at least in remote control code pulse section, wherein first
Low level pulse is the low level pulse in guidance code, and remaining is low level pulse corresponding to physics code.
S204:For the duration of each low level pulse, the duration and default time interval
Size.
S205:When the duration is in very first time section, by low level pulse corresponding to the duration
Resolve to binary value 0, the very first time section be more than judge low level pulse whether be binary value 0 original time area
Between.In the present embodiment, the very first time section is 100000 nanoseconds to 999999 nanoseconds.
S206:When the duration is in the second time interval, by low level pulse corresponding to the duration
Resolve to binary value 1, second time interval be more than judge low level pulse whether be binary value 1 original time area
Between.In the present embodiment, second time interval is 900000 nanoseconds to 2500000 nanoseconds.
S207:All binary values parsed are generated into physics code.
The invention discloses a kind of method that physics code is parsed in pulse from remote controller codes, this method is applied to intelligence
TV, first, obtain the duration of each low level pulse in remote control code pulse section successively by timer;For each low
The duration of level pulse, compare the size of duration and default time interval;When the duration is in very first time area
When interior, low level pulse corresponding to the duration is resolved into binary value 0, the very first time section be more than and judge low level arteries and veins
Punching whether be binary value 0 original time section;When the duration is in the second time interval, by corresponding to the duration
Low level pulse resolves to binary value 1, and the second time interval, which is more than, judges whether low level pulse is the original of binary value 1
Time interval;All binary values parsed are generated into physics code.By expanding very first time section and the second time interval,
And then it ensure that accurate parsing physics code.
Method is described in detail in the invention described above disclosed embodiment, can be taken various forms for the method for the present invention
Device realize, therefore the invention also discloses a kind of device, specific embodiment is given below and is described in detail.
Embodiment three
Accompanying drawing 4 is referred to, for a kind of physics code that parsed from remote control code pulse disclosed in the embodiment of the present invention three
The concrete structure schematic diagram of device, the device are applied to intelligent television, and the device is specifically included such as lower unit:
Duration acquiring unit 11, for obtain successively each low level pulse in remote control code pulse section it is lasting when
Between.
Comparing unit 12, for the duration for each low level pulse, the duration with it is default
The size of time interval.
First resolution unit 13, for when the duration is in very first time section, by the duration pair
The low level pulse answered resolves to binary value 0, and the very first time section, which is more than, judges whether low level pulse is binary system
The original time section of value 0.
Second resolution unit 14, for when the duration is in the second time interval, by the duration pair
The low level pulse answered resolves to binary value 1, and second time interval, which is more than, judges whether low level pulse is binary system
The original time section of value 1.
Physics code resolution unit 15, for all binary values parsed to be generated into physics code.
It should be noted that it is related to the specific correlation referred in embodiment of the method for function description of above-mentioned unit
Illustrate, the present embodiment repeats no more.
Example IV
Accompanying drawing 5 is referred to, physics code is parsed from remote control code pulse for another kind disclosed in the embodiment of the present invention four
Device concrete structure schematic diagram, the device is applied to intelligent television, and the device is specifically included such as lower unit:
Remote control code pulse receiving subelement 21, the remote control code pulse reported for receiving infrared receiving circuit are described
Remote control code pulse is corresponding with the button of IR remote controller.
Promoter unit 22, for starting timer when first rising edge of the remote control code pulse starts.
Low level pulse duration computation subunit 23, the time difference of adjacent falling edges and rising edge is calculated respectively, is removed
Time difference outside first time difference is the duration of each low level pulse in remote control code pulse section.
It should be noted that the low level pulse duration computation subunit specifically includes:First computing module, use
In obtaining the first clocking value, first clocking value is the value of timer when the trailing edge arrives;Second computing module, is used for
The second clocking value is obtained, second clocking value is the value of timer when the rising edge arrives;3rd computing module, based on
The difference of second clocking value and first clocking value is calculated, the difference is the time of adjacent falling edges and rising edge
Difference.
Explanation is needed further exist for, 33 low level pulses are comprised at least in the remote control code pulse section.
Comparing unit 24, for the duration for each low level pulse, the duration with it is default
The size of time interval.
First resolution unit 25, for when the duration is in very first time section, by the duration pair
The low level pulse answered resolves to binary value 0, and the very first time section, which is more than, judges whether low level pulse is binary system
The original time section of value 0;In the present embodiment, the very first time section is 100000 nanoseconds to 999999 nanoseconds.
Second resolution unit 26, for when the duration is in the second time interval, by the duration pair
The low level pulse answered resolves to binary value 1, and second time interval, which is more than, judges whether low level pulse is binary system
The original time section of value 1;In the present embodiment, second time interval is 900000 nanoseconds to 2500000 nanoseconds.
Physics code resolution unit 27, for all binary values parsed to be generated into physics code.
It should be noted that it is related to the specific correlation referred in embodiment of the method for function description of above-mentioned unit
Illustrate, the present embodiment repeats no more.
In summary:
The invention discloses the method and device that physics code is parsed in a kind of pulse from remote controller codes, this method and dress
Put and be applied to intelligent television, first, obtain the duration of each low level pulse in remote control code pulse section successively;For each
The duration of low level pulse, compare the size of duration and default time interval;When the duration is in the very first time
When in section, low level pulse corresponding to the duration is resolved into binary value 0, the very first time section be more than and judge low level
Pulse whether be binary value 0 original time section;When the duration is in the second time interval, will correspond to the duration
Low level pulse resolve to binary value 1, the second time interval be more than judge low level pulse whether be binary value 1 original
Beginning time interval;All binary values parsed are generated into physics code.By expanding very first time section and the second time zone
Between, and then ensure that accurate parsing physics code.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
It should be noted that, device embodiment described above is only schematical in addition, wherein described as separation
The unit of part description can be or may not be it is physically separate, can be as the part that unit is shown or
It can not be physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality
Border needs to select some or all of module therein to realize the purpose of this embodiment scheme.It is in addition, provided by the invention
In device embodiment accompanying drawing, the annexation between module represents there is communication connection between them, specifically can be implemented as one
Bar or a plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, you can with
Understand and implement.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can borrow
Software is helped to add the mode of required common hardware to realize, naturally it is also possible to include application specific integrated circuit, specially by specialized hardware
Realized with CPU, private memory, special components and parts etc..Generally, all functions of being completed by computer program can
Easily realized with corresponding hardware, moreover, for realizing that the particular hardware structure of same function can also be a variety of more
Sample, such as analog circuit, digital circuit or special circuit etc..But it is more for the purpose of the present invention in the case of software program it is real
It is now more preferably embodiment.Based on such understanding, technical scheme is substantially made to prior art in other words
The part of contribution can be embodied in the form of software product, and the computer software product is stored in the storage medium that can be read
In, such as the floppy disk of computer, USB flash disk, mobile hard disk, read-only storage(ROM, Read-Only Memory), random access memory
Device(RAM, Random Access Memory), magnetic disc or CD etc., including some instructions are causing a computer to set
It is standby(Can be personal computer, server, or network equipment etc.)Perform the method described in each embodiment of the present invention.
In summary, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to upper
Embodiment is stated the present invention is described in detail, it will be understood by those within the art that:It still can be to upper
State the technical scheme described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these
Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.