WO2018126927A1 - 一种点对点的红外通讯方法及系统 - Google Patents

一种点对点的红外通讯方法及系统 Download PDF

Info

Publication number
WO2018126927A1
WO2018126927A1 PCT/CN2017/118356 CN2017118356W WO2018126927A1 WO 2018126927 A1 WO2018126927 A1 WO 2018126927A1 CN 2017118356 W CN2017118356 W CN 2017118356W WO 2018126927 A1 WO2018126927 A1 WO 2018126927A1
Authority
WO
WIPO (PCT)
Prior art keywords
infrared
bit
information data
check
data
Prior art date
Application number
PCT/CN2017/118356
Other languages
English (en)
French (fr)
Inventor
周琨
曾广玺
杨文轩
Original Assignee
深圳市欢创科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢创科技有限公司 filed Critical 深圳市欢创科技有限公司
Publication of WO2018126927A1 publication Critical patent/WO2018126927A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/11Arrangements specific to free-space transmission, i.e. transmission through air or vacuum
    • H04B10/114Indoor or close-range type systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control

Definitions

  • the present application relates to the field of infrared communication, and in particular to a point-to-point infrared communication method and system.
  • each frame of the NEC encoding is composed of a boot code, an address code, and a data code.
  • the address code and data code are inverted to enhance the correctness of the data.
  • the coding definition of the pilot code and data code is shown in Figure 1b.
  • the infrared communication has a long time per frame, and the air velocity is only tens of bytes per second, and the rate is very slow, and cannot be transmitted at a high speed.
  • the other type is IrDA (Infrared Data Association), the standard IrDA for infrared data transmission specified by the organization. It is used for data communication between devices.
  • the transmission rate is 2400bps to 115200bps, the transmission range is 1m, and the transmission angle is half. 15 degrees to 30 degrees.
  • the shortcoming of this kind of protocol is that the communication distance is relatively short, the angle is relatively small, and the components are relatively expensive.
  • the technical problem mainly solved by the embodiment of the present application is to provide a point-to-point infrared communication method and system, which can realize high-speed communication of infrared and ensure the reliability of data transmission, and can also improve the distance of infrared communication and increase infrared coverage. From the perspective of, and the cost is minimized.
  • the embodiment of the present application provides a point-to-point infrared communication method, including:
  • the infrared transmitting end obtains the information data to be sent, determines the check code of the information data according to a preset verification method, and then prepares the information data and the check code into a soft coded frame according to a preset frame information format. Transmitting, wherein the preset frame information format includes a start bit + a data bit + a check bit + an end bit;
  • the infrared receiving end receives the soft coded frame transmitted by the infrared transmitting end, and when the infrared receiving end receives the start bit, starts to receive the information data and the check code of the current soft coded frame, when the infrared receiving end receives the end bit, Stop receiving the current soft-coded frame;
  • the infrared receiving end verifies whether the received information data is correct according to the check code and the preset checking method. If it is correct, it processes according to the received information data, and if not, discards the current soft coded frame information.
  • the embodiment of the present application further provides a point-to-point infrared communication system, including:
  • the infrared transmitting end is configured to obtain information data to be sent, determine a check code of the information data according to a preset verification method, and then compile the information data and the check code into a soft according to a preset frame information format. After the coded frame is transmitted, where the preset frame information format includes a start bit + a data bit + a check bit + an end bit;
  • the infrared receiving end is configured to receive the soft coded frame transmitted by the infrared transmitting end, and when the infrared receiving end receives the start bit, start to receive the information data and the check code of the current soft coded frame, and when the infrared receiving end receives the end
  • the bit is bit the current soft coded frame is stopped; the received information data is verified to be correct according to the check code and the preset check method, and if it is correct, the data is processed according to the received information data, and if not, the current soft coded frame is discarded. information.
  • the embodiment of the present application ensures the reliability of data transmission by using a check code in the case of improving the transmission rate of the infrared communication.
  • the infrared transmitting end and the infrared receiving end using an independent infrared transmitting tube and a separate infrared receiving tube, the infrared communication example can be provided and the infrared coverage angle can be increased. Therefore, the application has low cost, short air transmission time, and communication. The advantage of distance and angle is large.
  • 1a is a schematic diagram of the composition of NEC infrared protocol frame data in the prior art
  • Figure 1b is a schematic diagram of the coding definition of the NEC protocol in Figure 1a;
  • FIG. 2 is a flowchart of a point-to-point infrared communication method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a data format of each frame of information provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a code definition of data 0 and data 1 provided by an embodiment of the present application;
  • FIG. 5 is a hardware structural diagram of a point-to-point infrared communication system according to an embodiment of the present application.
  • FIG. 2 is a flowchart of a point-to-point infrared communication method provided by an embodiment of the present application, including:
  • Step S101 The infrared transmitting end acquires information data to be sent, determines a check code of the information data according to a preset verification method, and then compiles the information data and the check code into a soft according to a preset frame information format.
  • the preset frame information format includes a start bit + a data bit + a check bit + an end bit.
  • the preset verification method includes parity check, full value check, and CRC check (Cyclic). Redundancy Check, other verification methods suitable for the communication field. If parity is used, the value of the check code depends on the number of all information data 1 in the data bit. If the number is odd, the check code is 1, and if the number is even, the check code Is 0; if full value verification is used, the check code is the sum of each piece of information data in the data bits. As shown in FIG. 3, the format of each frame of information transmitted by the infrared transmitting end and the infrared receiving end includes a start bit + a data bit + a check bit + an end bit.
  • the start bit is used to indicate the start position of the current frame
  • the data bit is used to store the information data to be sent
  • the check bit is used to store the check code of the information data to be sent
  • the end bit is used to indicate the end of the current frame. position.
  • the infrared transmitting end and the infrared receiving end modulate and demodulate the soft coded frame by using a carrier of 20KHZ-60KHZ, and each carrier period is 1/f microsecond, wherein f is the carrier frequency, and the carrier duty ratio thereof It is 1/10 or more and 1/2 or less.
  • f is the carrier frequency
  • MCU Microcontroller
  • the infrared transmitting end and the infrared receiving end are modulated and demodulated by using a carrier of 57.6KHZ, the carrier period is 17.36 microseconds, and the duty ratio is 1/2, wherein the high level is 8.68 microseconds, and the low level is 8.68 microseconds.
  • bit 0 and bit 1 can be defined as needed.
  • bit 0 is defined as 3-8 carrier-level levels
  • bit 1 is defined as 3-8 carrier-free low levels.
  • bit 0 is defined as 6 levels with carrier
  • bit 1 is 6 low levels without carrier, each occupying 104.16 microseconds.
  • FIG. 4 is a schematic diagram of a code definition of data 0 and data 1 provided by an embodiment of the present application.
  • the 57.6KHZ carrier has a faster speed, and can easily modulate the baud rate of 19200dps and 9600dps.
  • the 19200dps and 9600dps are more common serial communication rates, which are convenient for debugging and decoding. For 1/2, the signal will be stronger and the communication distance will be farther.
  • the instrument debugging and MCU decoding the essence is equivalent to a serial port of infrared communication.
  • Step S102 The infrared receiving end receives the soft coded frame transmitted by the infrared transmitting end, and when the infrared receiving end receives the start bit, starts to receive the information data and the check code of the current soft coded frame, and when the infrared receiving end receives the end, When the bit is set, the reception of the current soft-coded frame is stopped.
  • Step S103 The infrared receiving end verifies whether the received information data is correct according to the check code and the preset verification method. If it is correct, the processing is performed according to the received information data. If not, the current soft coded frame information is discarded.
  • the infrared transmitting end emits a continuous high level to the infrared receiving end; when the infrared transmitting end transmits a signal to the infrared receiving end for communication, firstly, a start is transmitted.
  • the start signal is a jump signal from a high level to a low level, and is used to prompt the infrared receiving end to receive the start signal, start data reception on the current soft coded frame, and start as a decoding. end.
  • the infrared transmitter will transmit the data bits and check bits, and finally the end bit.
  • the end signal of the end bit is similar to the start signal, and is a transition signal from low level to high level, which is used to prompt the infrared receiving end to stop receiving the current soft coded frame when receiving the end signal, and The end of the decoding.
  • the check digit stores the check code used to calculate the data sent on the data bits using a preset check method. For example, a 34-bit data packet has 1 start bit, 27 data bits, 5 check bits, and 1 end bit.
  • the infrared transmitting end uses a separate infrared transmitting tube; the infrared receiving end also uses a separate infrared receiving tube, as shown in FIG.
  • a separate photodiode plus infrared preamplifier is used.
  • the performance of the infrared receiving tube can be selected autonomously to meet the communication requirements of long distance and large angle.
  • the infrared receiver of a conventional remote controller cannot use a separate infrared receiver and design amplifying circuit, so the sensitivity and angle of reception cannot be controlled.
  • the embodiment of the present application ensures the reliability of the data transmission by using the check code.
  • the infrared transmitting end and the infrared receiving end using an independent infrared transmitting tube and a separate infrared receiving tube, the infrared communication example can be provided and the infrared coverage angle can be increased. Therefore, the embodiment of the present application has low cost and short air transmission time. The advantages of long communication distance and large angle.
  • the embodiment of the present application further provides a point-to-point infrared communication system, including:
  • the infrared transmitting end is configured to obtain information data to be sent, determine a check code of the information data according to a preset verification method, and then compile the information data and the check code into a soft according to a preset frame information format. After the coded frame is transmitted, where the preset frame information format includes a start bit + a data bit + a check bit + an end bit;
  • the infrared receiving end is configured to receive the soft coded frame transmitted by the infrared transmitting end, and when the infrared receiving end receives the start bit, start to receive the information data and the check code of the current soft coded frame, and when the infrared receiving end receives the end
  • the bit is bit the current soft coded frame is stopped; the received information data is verified to be correct according to the check code and the preset check method, and if it is correct, the data is processed according to the received information data, and if not, the current soft coded frame is discarded. information.
  • the infrared transmitting end includes a transmitting end MCU, a driving circuit and an infrared transmitting tube, wherein the transmitting end MCU is connected to the driving circuit, and the driving circuit is further connected with the independent infrared transmitting tube.
  • the transmitting MCU prepares the information data to be sent into a soft coded frame according to a preset frame information format, and then modulates the signal into an electrical signal, and the control driving circuit drives the infrared transmitting tube to convert the electrical signal into an optical signal, that is, emits infrared light.
  • the infrared receiving end comprises a receiving end MCU, an amplifying circuit and an infrared receiving tube, wherein the receiving end MCU is connected with the amplifying circuit, and the amplifying circuit is further connected with the infrared receiving tube.
  • the infrared receiving tube is a separate photodiode.
  • the photodiode of the infrared receiving end receives the infrared light emitted by the infrared transmitting end and converts the optical signal into an electrical signal, and is amplified by the amplifying circuit, and outputted to the receiving end MCU for decoding.
  • the sender MCU and the receiver MCU can be any general purpose MCU, such as a stm8s or AVR microcontroller.
  • the embodiment of the present application uses a separate infrared emission tube and a separate infrared receiving tube, preferably a separate photodiode plus an infrared preamplifier.
  • a separate infrared receiving tube preferably a separate photodiode plus an infrared preamplifier.
  • the infrared receiver of a conventional remote controller cannot use a separate infrared receiver and design amplifying circuit, so the sensitivity and angle of reception cannot be controlled.
  • the preset verification method includes parity check, full value check, and CRC check (Cyclic). Redundancy Check, other verification methods suitable for the communication field. If parity is used, the value of the check code depends on the number of all information data 1 in the data bit. If the number is odd, the check code is 1, and if the number is even, the check code Is 0; if full value verification is used, the check code is the sum of each piece of information data in the data bits. As shown in FIG. 3, the format of each frame of information transmitted by the infrared transmitting end and the infrared receiving end includes a start bit + a data bit + a check bit + an end bit.
  • the start bit is used to indicate the start position of the current frame
  • the data bit is used to store the information data to be sent
  • the check bit is used to store the check code of the information data to be sent
  • the end bit is used to indicate the end of the current frame. position.
  • the infrared transmitting end and the infrared receiving end modulate and demodulate the soft coded frame by using a carrier of 20KHZ-60KHZ, each carrier period is 1/f second, wherein f is a carrier frequency, and the carrier duty ratio is greater than It is equal to 1/10 and less than or equal to 1/2.
  • f is a carrier frequency
  • the carrier duty ratio is greater than It is equal to 1/10 and less than or equal to 1/2.
  • higher frequency carriers can also be used for modulation and demodulation, but a better amplification circuit and MCU need to be configured.
  • the infrared transmitting end and the infrared receiving end are modulated and demodulated by using a carrier of 57.6KHZ, the carrier period is 17.36 microseconds, and the duty ratio is 1/2, wherein the high level is 8.68 microseconds, and the low level is 8.68 microseconds.
  • bit 0 and bit 1 can be defined as needed.
  • bit 0 is defined as 3-8 carrier-level levels
  • bit 1 is defined as 3-8 carrier-free low levels.
  • bit 0 is defined as 6 levels with carrier
  • bit 1 is 6 low levels without carrier, each occupying 104.16 microseconds.
  • FIG. 4 is a schematic diagram of a code definition of data 0 and data 1 provided by an embodiment of the present application.
  • the 57.6KHZ carrier has a faster speed, and can easily modulate the baud rate of 19200dps and 9600dps.
  • the 19200dps and 9600dps are more common serial communication rates, which are convenient for debugging and decoding. For 1/2, the signal will be stronger and the communication distance will be farther.
  • the instrument debugging and MCU decoding the essence is equivalent to a serial port of infrared communication.
  • the infrared transmitting end emits a continuous high level to the infrared receiving end; when the infrared transmitting end transmits a signal to the infrared receiving end for communication, firstly, a start is transmitted.
  • the start signal is a jump signal from a high level to a low level, and is used to prompt the infrared receiving end to receive the start signal, start data reception on the current soft coded frame, and start as a decoding. end.
  • the infrared transmitter will transmit the data bits and check bits, and finally the end bit.
  • the end signal of the end bit is similar to the start signal, and is a transition signal from low level to high level, which is used to prompt the infrared receiving end to stop receiving the current soft coded frame when receiving the end signal, and The end of the decoding.
  • the check digit stores the check code used to calculate the data sent on the data bits using a preset check method. For example, a 34-bit data packet has 1 start bit, 27 data bits, 5 check bits, and 1 end bit.
  • the embodiment of the present application ensures the reliability of the data transmission by using the check code.
  • the infrared transmitting end and the infrared receiving end using an independent infrared transmitting tube and a separate infrared receiving tube, the infrared communication example can be provided and the infrared coverage angle can be increased. Therefore, the embodiment of the present application has low cost and short air transmission time. The advantages of long communication distance and large angle.

Abstract

本申请公开了一种点对点的红外通讯方法及系统,其中,方法包括:红外发送端获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去;红外接收端接收红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。通过上述方式,本申请实施例能够实现红外的高速通讯,并保证数据传输的可靠性。

Description

一种点对点的红外通讯方法及系统
相关申请的交叉参考
本申请要求于2017年01月09日提交中国专利局、申请号为201710012690.6、发明名称为“一种点对点的红外通讯方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及红外通讯领域,特别是涉及一种点对点的红外通讯方法及系统。
背景技术
目前市场上存在的红外通讯协议主要有两类,一类是用于红外遥控器的传统红外通信协议,常见的有NEC协议、RC5、RC6等。以NEC协议为例,NEC编码的每一帧由引导码、地址码和数据码组成。如图1a所示,把地址码和数据码取反是为了加强数据的正确性。引导码及数据码的编码定义如图1b所示。从图1b可知,这种红外通信的每一帧时间较长,空中速率只有几十个字节每秒,速率很慢,不能高速传输。另一类是IrDA(Infrared Data Association,红外数据组织),该组织规定的红外数据传输的标准IrDA,用于设备之间的数据通信,传输速率为2400bps到115200bps,传输范围1m,传输半角度为15度到30度。这种协议的缺点是通信距离比较短,角度比较小,元器件比较贵。
发明内容
本申请实施例主要解决的技术问题是提供一种点对点的红外通讯方法及系统,能够实现红外的高速通讯,并保证数据传输的可靠性,此外,还能提高红外通讯的距离和增大红外覆盖的角度,且成本最低化。
为解决上述技术问题,本申请实施例提供一种点对点的红外通讯方法,包括:
红外发送端获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位;
红外接收端接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;
红外接收端根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
为解决上述技术问题,本申请实施例还提供一种点对点的红外通讯系统,包括:
红外发送端,用于获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位;
红外接收端,用于接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
本申请实施例的有益效果是:区别于现有技术的情况,本申请实施例在提高红外通讯传输速率的情况下,用校验码保证了数据传输的可靠性。此外,在红外发送端和红外接收端,使用独立的红外发送管和独立的红外接收管,能提供红外通信举例和增大红外覆盖角度,因此,本申请具有成本低、空中传输时间短、通信距离远、角度大的优点。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍。显而易见地,下面所描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a是现有技术中NEC红外协议帧数据的组成示意图;
图1b是图1a中NEC协议的编码定义示意图;
图2是本申请实施例提供的一种点对点的红外通讯方法的流程图;
图3是本申请实施例提供的每帧信息的数据格式示意图;
图4是本申请实施例提供的数据0和数据1的一种编码定义示意图;
图5是本申请实施例提供的一种点对点的红外通讯系统的硬件结构图。
具体实施方式
本申请实施例提供一种点对点的红外通讯方法,如图2所示为本申请实施例提供的一种点对点的红外通讯方法的流程图,包括:
步骤S101,红外发送端获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位。
具体的,预设的校验方法包括奇偶校验、全值校验、CRC校验(Cyclic Redundancy Check,循环冗余校验)等其他适用于通信领域的校验方法。如采用奇偶校验,则校验码的值取决于数据位中所有信息数据1的个数,如果该个数为奇数,则校验码为1,若该个数为偶数,则校验码为0;如采用全值校验,则校验码为数据位中每位信息数据的和。如图3所示为红外发送端和红外接收端传递的每一帧信息的格式,包括起始位+数据位+校验位+结束位。其中,起始位用来指示当前帧的开始位置,数据位用来存放待发送的信息数据,校验位用来存放待发送的信息数据的校验码,结束位用来指示当前帧的结束位置。
一般情况下,红外发送端和红外接收端采用20KHZ-60KHZ的载波对软编码帧进行调制和解调,每个载波周期为1/f微秒,其中,f为载波频率,其载波占空比大于等于1/10且小于等于1/2。当然,为了达到更快的通信速度,也可以采用更高频率的载波进行调制和解调,但是需要配置更优的放大电路和MCU(Microcontroller Unit,微控制单元)。优选地,红外发送端和红外接收端采用57.6KHZ的载波进行调制和解调,载波周期为17.36微秒,占空比为1/2,其中,高电平为8.68微秒,低电平为8.68微秒。实际应用中,位0和位1可以根据需要进行定义,如,位0定义为3-8个有载波的电平,位1定义为3-8个无载波的低电平。优选地,定义位0为6个有载波的电平,位1为6个无载波的低电平,各占104.16微秒。如图4所示是本申请实施例提供的数据0和数据1的一种编码定义示意图。相对于采用其他频率的载波,采用57.6KHZ的载波具有速度比较快,并且可以方便调制出19200dps和9600dps的波特率,19200dps和9600dps是比较常规的串口通信速率,方便调试和解码,占空比为1/2,信号会比较强,通信距离更远的有益效果。而采用6个载波的电平来定义位0和位1,可以调整出常规的9600dps的波特率,这样定义区别比较明显,可以速度比较快,而且减少误码率,并且可以直接使用逻辑分析仪调试和MCU进行解码,其实质就相当于一个红外通信的串口。
步骤S102,红外接收端接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧。
步骤S103,红外接收端根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
在一个通讯周期内,有一个起始位和一个结束位,用来指示当前帧的开始位置和结束位置。当红外发送端和红外接收端之间无通讯发生时,红外发送端会发射持续的高电平到红外接收端;当红外发送端向红外接收端发射信号进行通讯时,首先会发射一个起始信号,该起始信号是一个从高电平到低电平的跳变信号,用以提示红外接收端接收到该起始信号后,启动对当前软编码帧的数据接收,并作为解码的开始端。紧接着,红外发送端将发射数据位和校验位,最后为结束位。结束位的结束信号与起始信号类似,是一个从低电平到高电平的跳变信号,用以提示红外接收端接收到该结束信号时,停止对当前软编码帧的接收,并作为解码的结束端。校验位存放用来采用预设的校验方法对数据位上发送的数据计算所得的校验码。如一个34位的数据包有1个起始位,27个数据位,5个校验位,1个结束位,其发送所需的时间为104us*34=2536us,即空中传输的速度为7.6kb/s。由于该通讯方法加入了校验码,数据的准确性也得到了保证。
为了提高红外通信的距离和覆盖的范围,在硬件上,红外发射端使用独立的红外发射管;红外接收端也使用独立的红外接收管,如图5所示。优选地,使用独立的光敏二极管加红外前置放大器的方式。采用这种方式,可以自主选择红外接收管的性能,满足远距离和大角度的通信需求。常规的遥控器的红外接收头不能使用独立的红外接收头和设计放大电路,所以不能控制接收的灵敏度和角度等。
区别于现有技术的情况,本申请实施例在提高红外通讯传输速率的情况下,用校验码保证了数据传输的可靠性。此外,在红外发送端和红外接收端,使用独立的红外发送管和独立的红外接收管,能提供红外通信举例和增大红外覆盖角度,因此,本申请实施例具有成本低、空中传输时间短、通信距离远、角度大的优点。
本申请实施例还提供的一种点对点的红外通讯系统,包括:
红外发送端,用于获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位;
红外接收端,用于接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
如图5所示,红外发送端包括发送端MCU、驱动电路和红外发射管,其中,发送端MCU与驱动电路连接,驱动电路再与独立的红外发射管进行连接。发送端MCU将待发送的信息数据按照预设的帧信息格式编制成软编码帧后调制成电信号,控制驱动电路驱动红外发射管将电信号转变为光信号发射出去,即发射红外光线。红外接收端包括接收端MCU、放大电路和红外接收管,其中,接收端MCU与放大电路连接,放大电路再与红外接收管进行连接。优选地,红外接收管为独立的光敏二极管。红外接收端的光敏二极管接收到红外发送端发射的红外线后将光信号转换为电信号,并通过放大电路进行放大,输出到接收端MCU进行解码。发送端MCU和接收端MCU可以是任意的通用MCU,如stm8s或者AVR的单片机。
为了提高红外通信的距离和覆盖的范围,本申请实施例采用独立的红外发射管和独立的红外接收管,优选地,使用独立的光敏二极管加红外前置放大器的方式。采用这种方式,可以自主选择红外接收管的性能,满足远距离和大角度的通信需求。常规的遥控器的红外接收头不能使用独立的红外接收头和设计放大电路,所以不能控制接收的灵敏度和角度等。
具体的,预设的校验方法包括奇偶校验、全值校验、CRC校验(Cyclic Redundancy Check,循环冗余校验)等其他适用于通信领域的校验方法。如采用奇偶校验,则校验码的值取决于数据位中所有信息数据1的个数,如果该个数为奇数,则校验码为1,若该个数为偶数,则校验码为0;如采用全值校验,则校验码为数据位中每位信息数据的和。如图3所示为红外发送端和红外接收端传递的每一帧信息的格式,包括起始位+数据位+校验位+结束位。其中,起始位用来指示当前帧的开始位置,数据位用来存放待发送的信息数据,校验位用来存放待发送的信息数据的校验码,结束位用来指示当前帧的结束位置。
一般情况下,红外发送端和红外接收端采用20KHZ-60KHZ的载波对软编码帧进行调制和解调,每个载波周期为1/f秒,其中,f为载波频率,其载波占空比大于等于1/10且小于等于1/2。当然,为了达到更快的通信速度,也可以采用更高频率的载波进行调制和解调,但是需要配置更优的放大电路和MCU。优选地,红外发送端和红外接收端采用57.6KHZ的载波进行调制和解调,载波周期为17.36微秒,占空比为1/2,其中,高电平为8.68微秒,低电平为8.68微秒。实际应用中,位0和位1可以根据需要进行定义,如,位0定义为3-8个有载波的电平,位1定义为3-8个无载波的低电平。优选地,定义位0为6个有载波的电平,位1为6个无载波的低电平,各占104.16微秒。如图4所示是本申请实施例提供的数据0和数据1的一种编码定义示意图。相对于采用其他频率的载波,采用57.6KHZ的载波具有速度比较快,并且可以方便调制出19200dps和9600dps的波特率,19200dps和9600dps是比较常规的串口通信速率,方便调试和解码,占空比为1/2,信号会比较强,通信距离更远的有益效果。而采用6个载波的电平来定义位0和位1,可以调整出常规的9600dps的波特率,这样定义区别比较明显,可以速度比较快,而且减少误码率,并且可以直接使用逻辑分析仪调试和MCU进行解码,其实质就相当于一个红外通信的串口。
在一个通讯周期内,有一个起始位和一个结束位,用来指示当前帧的开始位置和结束位置。当红外发送端和红外接收端之间无通讯发生时,红外发送端会发射持续的高电平到红外接收端;当红外发送端向红外接收端发射信号进行通讯时,首先会发射一个起始信号,该起始信号是一个从高电平到低电平的跳变信号,用以提示红外接收端接收到该起始信号后,启动对当前软编码帧的数据接收,并作为解码的开始端。紧接着,红外发送端将发射数据位和校验位,最后为结束位。结束位的结束信号与起始信号类似,是一个从低电平到高电平的跳变信号,用以提示红外接收端接收到该结束信号时,停止对当前软编码帧的接收,并作为解码的结束端。校验位存放用来采用预设的校验方法对数据位上发送的数据计算所得的校验码。如一个34位的数据包有1个起始位,27个数据位,5个校验位,1个结束位,其发送所需的时间为104us*34=2536us,即空中传输的速度为7.6kb/s。由于该通讯方法加入了校验码,数据的准确性也得到了保证。
区别于现有技术的情况,本申请实施例在提高红外通讯传输速率的情况下,用校验码保证了数据传输的可靠性。此外,在红外发送端和红外接收端,使用独立的红外发送管和独立的红外接收管,能提供红外通信举例和增大红外覆盖角度,因此,本申请实施例具有成本低、空中传输时间短、通信距离远、角度大的优点。
以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (10)

  1. 一种点对点的红外通讯方法,其特征在于,包括:
    红外发送端获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位;
    红外接收端接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;
    红外接收端根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
  2. 如权利要求1所述的红外通讯方法,其特征在于,所述起始位用来指示当前帧的开始位置,所述数据位用来存放待发送的信息数据,所述校验位用来存放待发送的信息数据的校验码,所述结束位用来指示当前帧的结束位置。
  3. 如权利要求2所述的红外通讯方法,其特征在于,所述红外发送端和所述红外接收端采用20-60KHZ的载波对软编码帧进行调制和解调,每个载波周期为1/f秒,其中,f为载波频率,其载波占空比大于等于1/10且小于等于1/2。
  4. 如权利要求3所述的红外通讯方法,其特征在于,位0定义为3-8个有载波的电平,位1定义为3-8个无载波的低电平。
  5. 如权利要求1所述的红外通讯方法,其特征在于,所述预设的校验方法包括奇偶校验、全值校验和CRC校验。
  6. 如权利要求1所述的红外通讯方法,其特征在于,所述红外发送端和所述红外接收端均使用独立的红外发送管与接收管。
  7. 一种点对点的红外通讯系统,包括:
    红外发送端,用于获取待发送的信息数据,根据预设的校验方法确定所述信息数据的校验码,再将所述信息数据和校验码按照预设的帧信息格式编制成软编码帧后发射出去,其中,预设的帧信息格式包括起始位+数据位+校验位+结束位;
    红外接收端,用于接收所述红外发送端发射的软编码帧,当红外接收端接收到起始位时,启动接收当前软编码帧的信息数据和校验码,当红外接收端接收到结束位时,停止接收当前软编码帧;根据校验码和预设的检验方法验证接收的信息数据是否正确,如果正确,则根据接收的信息数据进行处理,如果不正确,则丢弃当前软编码帧信息。
  8. 如权利要求7所述的红外通讯系统,其特征在于,所述红外发送端和所述红外接收端采用20-60KHZ的载波对软编码帧进行调制和解调,每个载波周期为1/f秒,其中,f为载波频率,其载波占空比大于等于1/10且小于等于1/2。
  9. 如权利要求8所述的红外通讯系统,其特征在于,位0定义为3-8个有载波的电平,位1定义为3-8个无载波的低电平。
  10. 如权利要求7所述的红外通讯系统,其特征在于,所述红外发送端和所述红外接收端均使用独立的红外发送管与接收管。
PCT/CN2017/118356 2017-01-09 2017-12-25 一种点对点的红外通讯方法及系统 WO2018126927A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710012690.6 2017-01-09
CN201710012690.6A CN106877925A (zh) 2017-01-09 2017-01-09 一种点对点的红外通讯方法及系统

Publications (1)

Publication Number Publication Date
WO2018126927A1 true WO2018126927A1 (zh) 2018-07-12

Family

ID=59164744

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/118356 WO2018126927A1 (zh) 2017-01-09 2017-12-25 一种点对点的红外通讯方法及系统

Country Status (2)

Country Link
CN (1) CN106877925A (zh)
WO (1) WO2018126927A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315575A (zh) * 2021-06-01 2021-08-27 天津大学 自适应阈值解码的可视光通信方法

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106877925A (zh) * 2017-01-09 2017-06-20 深圳市欢创科技有限公司 一种点对点的红外通讯方法及系统
CN108429612A (zh) * 2018-03-01 2018-08-21 航天柏克(广东)科技有限公司 一种单线半双工的通讯方法
CN108736968B (zh) * 2018-08-29 2021-11-12 河南工程学院 一种控照型光信号并行通信系统及通信方法
CN110177151A (zh) * 2019-06-11 2019-08-27 北京搜狐新动力信息技术有限公司 一种点对点数据传输方法、系统、接收设备及发送设备
CN113113911A (zh) * 2021-03-31 2021-07-13 国网湖南省电力有限公司 一种具备拓扑识别功能的智能量测开关及拓扑识别方法
CN117060999A (zh) * 2021-09-23 2023-11-14 追觅创新科技(苏州)有限公司 一种红外通讯方法及装置、存储介质及电子装置
CN114863666B (zh) * 2022-06-07 2023-04-07 广州市欧谱莱电子科技有限公司 一种红外遥控的无载波编码方法
CN115242351B (zh) * 2022-07-13 2024-02-13 厦门九华通信设备厂 一种串行数据通信速率自适应方法
CN115866460B (zh) * 2023-02-06 2023-06-02 国科大杭州高等研究院 一种基于光通讯技术的串行通讯方法
CN116980290B (zh) * 2023-09-22 2024-01-26 北京智芯微电子科技有限公司 红外通讯升级方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5588009A (en) * 1994-02-03 1996-12-24 Will; Craig A. Personal paging, communications, and locating system
CN101248645A (zh) * 2005-08-25 2008-08-20 株式会社Ntt都科摩 红外线通信装置和红外线通信方法
CN101964768A (zh) * 2010-08-20 2011-02-02 苏州本控电子科技有限公司 自适应红外抗干扰传输方法
CN106877925A (zh) * 2017-01-09 2017-06-20 深圳市欢创科技有限公司 一种点对点的红外通讯方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3815841B2 (ja) * 1997-03-28 2006-08-30 ローム株式会社 IrDA変復調IC
CN1184751C (zh) * 1997-11-18 2005-01-12 国际商业机器公司 改进的无线光通信方法
CN105261199A (zh) * 2015-09-21 2016-01-20 深圳市天海基业科技有限公司 红外数据的编解码方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5588009A (en) * 1994-02-03 1996-12-24 Will; Craig A. Personal paging, communications, and locating system
CN101248645A (zh) * 2005-08-25 2008-08-20 株式会社Ntt都科摩 红外线通信装置和红外线通信方法
CN101964768A (zh) * 2010-08-20 2011-02-02 苏州本控电子科技有限公司 自适应红外抗干扰传输方法
CN106877925A (zh) * 2017-01-09 2017-06-20 深圳市欢创科技有限公司 一种点对点的红外通讯方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315575A (zh) * 2021-06-01 2021-08-27 天津大学 自适应阈值解码的可视光通信方法

Also Published As

Publication number Publication date
CN106877925A (zh) 2017-06-20

Similar Documents

Publication Publication Date Title
WO2018126927A1 (zh) 一种点对点的红外通讯方法及系统
US8463134B2 (en) Apparatus and method for transmitting and receiving data using visible light communication
US7805661B2 (en) Method of formatting and encoding uplink short length data in a wireless communication system
US7903745B2 (en) Error detection and correction for base-band wireless systems
KR101364390B1 (ko) 가시광 통신 시스템에서 데이터 전송 프레임을 위한가시적인 신호 생성 방법 및 장치
CN107615684A (zh) 光收发器的远程数字诊断监视信息的增强的发送和接收
WO2015143807A1 (zh) 红外信号发送方法、装置和遥控器
JP2017511034A5 (zh)
JP2008501277A (ja) Uartエンコードされたパルス変調技術
CN103684597A (zh) 基于fpga的可见光视频通信系统及方法
CA2797687A1 (en) Forward error correction media access control system
CN110351025B (zh) 信息反馈方法、装置和系统
CN108880682A (zh) 一种基于编码的可见光通信调光控制方法及系统
US7865803B2 (en) Method for processing noise interference in data accessing device with serial advanced technology attachment (SATA) interface
JP5895236B2 (ja) 光信号送信装置
JPH053588A (ja) 赤外線データ送受信システム
CN106130637B (zh) 一种基于led的可见光通信系统和方法
CN108353428B (zh) 无线通信方法和系统
CN114048162A (zh) 一种基于Xmodem协议的流文件传输方法
CN110518977B (zh) 水下可见光通信方法及水下可见光通信装置
US7624332B2 (en) Method for processing noise interference in data accessing device with serial advanced technology attachment interface
CN106844115B (zh) 一种用于光纤陀螺仪fpga串口功能的仿真验证方法
US11290207B2 (en) Optical transceiver apparatus and method
KR101336441B1 (ko) Lqi에 기초하여 전송 프레임의 길이를 결정하는 방법 및 장치
WO2016169071A1 (zh) 一种基于接近传感器的终端数字信息传输方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17889702

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17889702

Country of ref document: EP

Kind code of ref document: A1