Filtering method, system and application of IR analysis based on NEC standard

文档序号:684896 发布日期:2021-04-30 浏览:8次 中文

阅读说明:本技术 一种基于nec标准的ir解析的过滤方法、系统及应用 (Filtering method, system and application of IR analysis based on NEC standard ) 是由 杜君 于 2020-12-28 设计创作,主要内容包括:本发明公开是关于一种基于NEC标准的IR解析的过滤方法、系统及应用,涉及数据处理技术领域。基于NEC标准的IR解析的过滤方法包括:对按键未无义长按功能的处理和对按键有长按功能的处理;其中,对按键未定义长按功能的处理包括:遥控键值直接设置为空,遥控解析状态设置为同步码状态,默认未收到任何遥控码;对按键定义长按功能的处理包括:每进来一次过滤次数变量加一,如果达到自己设定的次数,遥控键值赋值为键值备份值,默认收到一次按键本发明在硬件和遥控器不变的情况下,从NEC标准IR协议的特征出发,通过一种软件的方法进行过滤,从而提高软件运行速度,更好的提高用户体验。(The invention discloses a filtering method, a system and application of IR analysis based on NEC standard, relating to the technical field of data processing. The filtering method of the IR analysis based on the NEC standard comprises the following steps: processing the function of long pressing the key without meaning and processing the function of long pressing the key; wherein, the processing of the key without the defined long-press function comprises the following steps: the remote key value is directly set to be null, the remote analysis state is set to be the synchronous code state, and the default is that no remote control code is received; the processing of the key definition long press function comprises: the filtering times variable is increased by one every time, if the filtering times variable reaches the set times per se, the remote control key value is assigned as the key value backup value, and the key is received once by default.)

1. A filtering method for IR analysis based on NEC standard is characterized in that the filtering method for IR analysis based on NEC standard comprises: processing the function of long pressing the key without meaning and processing the function of long pressing the key; wherein the content of the first and second substances,

the processing for the key with undefined long-press function comprises the following steps: the remote key value is directly set to be null, the remote analysis state is set to be the synchronous code state, and the default is that no remote control code is received;

the processing of the key definition long press function comprises: adding one to the filtering frequency variable every time, if the filtering frequency variable reaches the set frequency, assigning a remote control key value as a key value backup value, receiving a key by default, and clearing the filtering frequency variable; if the set N is 1, no filtering is indicated, and only if N is more than 1, filtering is indicated.

2. The filtering method for IR parsing based on NEC standard according to claim 1, wherein in the process of defining the long press function for the key, the value of N is adjusted according to the actual condition of the item, and the filtering time is (N-1) × 108 ms.

3. The filtering method for IR parsing based on NEC standard according to claim 1, further comprising the step of receiving a remote control signal by the micro control unit, triggering an interrupt by a falling edge, starting a counting function of a timer in an interrupt service routine, and recording a counting value between every two falling edges of the waveform as a time parameter for remote control; and comparing the time parameter with the theoretical value to obtain the current analysis step and the remote control data.

4. The filtering method for IR parsing based on NEC standard according to claim 1, wherein the filtering method for IR parsing based on NEC standard is processed with repetition codes.

5. The filtering method for IR parsing based on NEC standard according to claim 4, wherein said repetition code consists of: 9ms, 2.25ms, delay.

6. A filtering system for implementing the filtering method based on the IR analysis of NEC standards according to any one of claims 1 to 5, wherein the filtering system based on the IR analysis of NEC standards comprises:

the micro control unit is used for analyzing and processing the filtering data;

the timer is connected with the processor and used for controlling the running time of the processor;

and the external interrupt module is connected with the processor and compares the time parameter with the theoretical value to obtain the current analysis step and the remote control data.

7. The NEC standard based IR parsing filtering system according to claim 6, wherein an external interrupt pin of the processor receives a remote control reception signal, the external interrupt pin being set to a falling edge triggered interrupt mode.

8. A computer program product stored on a computer readable medium, comprising a computer readable program for providing a user input interface for implementing the filtering method for NEC standard based IR parsing of any one of claims 1-5 when executed on an electronic device.

9. A computer-readable storage medium storing instructions which, when executed on a computer, cause the computer to perform the filtering method for IR parsing based on NEC criteria as claimed in any one of claims 1 to 5.

10. An electronic device, comprising: a memory for storing one or more programs; a processor, when said one or more programs are executed by said processor, implementing the filtering method for IR parsing based on NEC criteria as claimed in any one of claims 1-5.

Technical Field

The invention relates to the technical field of data processing, in particular to an IR analysis filtering method, system and application based on NEC standards.

Background

At present, in practical application development, some remote controllers have the problem of misoperation sometimes when a user operates due to quality problems. While the developer can often block other tasks when analyzing the remote control code due to the unfiltered state.

Infrared remote control is a very convenient and cable-free means of remote control and communication, and is now widely used in society. Because the infrared remote control device has the characteristics of strong function, low power consumption, low cost, small volume, stable operation, rapidness, reliability and the like, the infrared remote control device is widely applied to various household electric appliance products and commercial equipment by people. But in some cases, this rapidity can cause trouble in our handling: (1) due to the quality problem of the remote controller keys, triggering the remote controller often causes the sending of repeated codes; (2) due to the fact that the speed of the device is fast, the device can process the blockage of other tasks, and the device has no significance to actual functions and causes poor user experience.

In summary, the problems of the prior art are as follows: the problem that filtering cannot be realized in the analysis codes of the existing remote control is solved, and in the existing system, due to the limitation of processing speed, if the analysis codes are not processed, tasks are often blocked; in addition, if the client is not filtered, the client may malfunction due to malfunction or due to quality problems at the remote controller.

The significance of solving the technical problems is as follows: according to the invention, filtering is carried out by a software method, so that on one hand, misoperation caused by the defects of the remote controller is avoided, on the other hand, task blockage is conveniently avoided by software, and finally, user experience is improved. The invention starts from a remote control analysis end, and filters by matching with a certain software algorithm according to the protocol of NEC remote control coding.

Disclosure of Invention

In order to overcome the problems in the related art, the disclosed embodiments of the present invention provide a filtering method, system and application for IR analysis based on NEC standards. The technical scheme is as follows:

a filtering method for IR analysis based on NEC standard is characterized in that the filtering method for IR analysis based on NEC standard comprises: processing the function of long pressing the key without meaning and processing the function of long pressing the key; wherein the content of the first and second substances,

the processing for the key with undefined long-press function comprises the following steps: the remote key value is directly set to be null, the remote analysis state is set to be the synchronous code state, and the default is that no remote control code is received;

the processing of the key definition long press function comprises: adding one to the filtering frequency variable every time, if the filtering frequency variable reaches the set frequency, assigning a remote control key value as a key value backup value, receiving a key by default, and clearing the filtering frequency variable; if the set N is 1, no filtering is indicated, and only if N is more than 1, filtering is indicated.

In one embodiment, during the process of defining the long press function for the key, the value of N is adjusted according to the actual condition of the item, and the filtering time is (N-1) × 108 ms.

In one embodiment, the filtering method for IR analysis based on NEC standard further includes that the micro control unit receives a remote control signal, triggers an interrupt through a falling edge, starts a counting function of a timer in an interrupt service routine, and records a series of counting values between every two waveform falling edges as a time parameter for remote control; and comparing the time parameter with the theoretical value to obtain the current analysis step and the remote control data.

In one embodiment, the filtering method based on IR parsing of NEC standards is processed with repetition codes.

In one embodiment, the repetition code consists of: 9ms, 2.25ms, delay.

Another object of the present invention is to provide a filtering system for implementing the filtering method for IR parsing based on NEC standards, including:

the micro control unit is used for analyzing and processing the filtering data;

the timer is connected with the processor and used for controlling the running time of the processor;

and the external interrupt module is connected with the processor and compares the time parameter with the theoretical value to obtain the current analysis step and the remote control data.

In one embodiment, an external interrupt pin of the processor receives the remote control receiving signal, and the external interrupt pin is set to be in a falling edge triggering interrupt mode.

It is a further object of the present invention to provide a computer program product stored on a computer readable medium, comprising a computer readable program for providing, when executed on an electronic device, a user input interface for implementing said filtering method for NEC standard based IR parsing.

It is another object of the present invention to provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the filtering method for IR parsing based on NEC standards.

Another object of the present invention is to provide an electronic device, comprising: a memory for storing one or more programs; a processor that, when executed by the one or more programs, implements the filtering method for IR parsing based on NEC criteria.

The technical scheme provided by the embodiment of the invention has the following beneficial effects:

under the condition that hardware and a remote controller are not changed, the invention starts from the characteristics of the NEC standard IR protocol and carries out filtering by a software method, thereby improving the software running speed and better improving the user experience. According to the protocol of NEC remote control coding, a certain software algorithm is matched for filtering, and extra effort is not needed in the aspect of hardware.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.

Fig. 1 is a schematic diagram of a general infrared remote control system.

Fig. 2 is a schematic diagram of the pulse width modulation provided by the present invention.

Fig. 3 is a schematic diagram of normal code sending provided by the present invention.

Fig. 4 is a schematic diagram of a repetition code provided by the present invention.

FIG. 5 is a logical "0" and "1" identification diagram provided by the present invention.

Fig. 6 is a schematic level diagram of an infrared receiving head provided by the present invention.

FIG. 7 is a flow chart of interrupt service software provided by the present invention.

Detailed Description

In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, but rather should be construed as broadly as the present invention is capable of modification in various respects, all without departing from the spirit and scope of the present invention.

It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. As used herein, the terms "vertical," "horizontal," "left," "right," and the like are for purposes of illustration only and are not intended to represent the only embodiments.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

As shown in fig. 1, the general infrared remote control system is composed of two parts, namely a transmitting part and a receiving part, wherein the transmitting part comprises: keyboard matrix, code modulation and infrared transmitting tube; the receiving section includes: and a circuit for converting, amplifying, demodulating and decoding optical and electric signals. Generally, the transmission of the remote controller signal is to modulate the control command and system code (sequence composed of 0 and 1) corresponding to the corresponding key on a carrier wave within 3256kHz (for the purpose of anti-interference and low power), and then to amplify and drive the infrared transmitting tube to transmit the signal.

The popular control method is realized by applying a coding/decoding application-specific integrated circuit chip. Different remote control chips adopt different remote control coding formats. As shown in fig. 2, the present invention is the NEC (representative chip WD6122) PWM (pulse width modulation) standard. The frequency of the remote control carrier is 38 KHz. When a key is pressed, the system first transmits a complete full code, and then transmits a series of short codes after time delay until the key is released, and the transmission is stopped. The short code repeats with a delay of 108ms, i.e. 108ms between the rising edges of both leading pulses.

As shown in fig. 3, the normal code sending consists of: the time delay is realized by a guide code (9ms +4.5ms), a user code reverse code (or a reverse code of the user code), a key data code and a key data reverse code.

As shown in fig. 4, the repetition code consists of: the delay is realized by 9ms and 2.25 ms.

As shown in FIG. 5, the present invention can see from the bit definition of the key code that 0 and 1 both start at a high level of 0.56 ms, but the difference is that the width of the low level is different, 0 is 0.56 ms, but 1 is 1.68 ms.

In the normal transmission code of fig. 3, the repetition code of fig. 4, and the logical "0" and "1" identifications of fig. 5, the levels are viewed from the transmitting end. As shown in fig. 6, the level output by the infrared receiving head is the opposite level of the transmitting end, and the level emitted by the remote receiving head is "1" when the remote receiving head is idle. It can be known from the standard protocol of NEC that when the remote control key is pressed, the signal received by the receiving end is a complete full code: guide code (9ms +4.5ms), user code complement, key data code, key data complement, and delay. At this point, if not released in time, a repetition code is then received: 9ms, 2.25ms, delay. The repetition code repeats with a delay of 108ms, i.e. 108ms between the rising edges of both leading pulses. The filtering method of the invention is to process according to the repeated codes.

The hardware wiring method comprises the following steps: the remote control receiving signal is directly connected with an external interrupt pin of the MCU, and the external interrupt pin is set to be in a falling edge triggering interrupt mode.

The analysis method comprises the following steps: the MCU receives the remote control signal, triggers interruption through a falling edge, starts the counting function of the timer in an interruption service program, and records a series of counting values between every two waveform falling edges as a remote control time parameter. And comparing the time parameter with the theoretical value to obtain the current analysis step and the remote control data.

The frequency of the timer set by the current program is 2M, the low level time is 1.12MS, the theoretical value of counting according to the 2M frequency is 2240, the theoretical value of counting according to the high level (2.25MS) is 4500, the theoretical value of counting according to the guide code (13.5MS) is 27000, and the theoretical value of counting according to the repetition code (11.25MS) is 22500.

The filtering method comprises the following steps: the remote control code parsing method is shown in the flowchart of fig. 7. The filtering method of the invention corresponds to the part of the filtering treatment (situation treatment) at the inner side of the flow chart. From the standard of NEC remote control, it is known that a full code is received first, and that repeated codes (without client code and data portions) are received consecutively if the key is not released in time, with 108MS between the rising edges of every two consecutive repeated leading pulses. By these features, the filtration treatment is performed at this stage. The treatment is generally divided into two cases: one is the function of processing the key which is not pressed for an unambiguous length; one is that the key to be processed has a long press function.

The key does not define a long press function. In this case, the remote key value is directly set to null, and the remote resolution state is set to the sync code state. I.e. by default no remote control code is received.

The key is defined with a long-press function condition. In this case, the filtering time variable is increased by one every time, and if the number of times set by the user is reached (assuming that N actually represents a time parameter), the remote key value is assigned as a key value backup value (the key value backup value is obtained when the full code is received), that is, a key is received by default, and the filtering time variable is cleared (to prepare for counting next time). If the set N is 1, no filtering is indicated, and only if N is more than 1, filtering is indicated. This value of N can be adjusted to the actual condition of the project, with a filter time of (N-1) × 108 MS. Such application scenarios are relatively common: for example, some players operate via a remote control to adjust the volume.

Both of the above situations are relatively common. In actual development, if other situations need filtering, the filtering method can be adjusted according to the idea.

The invention is realized based on a timer and external interrupt, the selected processor has the functions of the timer and the external interrupt, the chip used by the invention is RH850 series, and the selected time parameter can be adjusted according to the requirements of the system and the user experience.

Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure should be limited only by the attached claims.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种家电设备遥控方法、装置、红外设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!