Infrared communication method, device and equipment and readable storage medium

Through infrared communication methods, low-cost and low-complexity data transmission is achieved in automation systems, and the high cost and complexity problems of existing wireless communication technologies in low data volume scenarios are solved. It is suitable for price-sensitive consumer electronics and industrial automation field.

CN119229633APending Publication Date: 2024-12-31SHENZHEN YOUBIXING TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411664491.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In automated systems, existing wireless communication technologies such as Bluetooth and WiFi lead to high costs and complexity in low data transmission rates and small data volume scenarios, and devices that do not have built-in wireless communication capabilities require additional modules, which limits the need for additional modules. Device selection and compatibility.

Method used

The infrared communication method is adopted to obtain data through the transmitter, assemble and encode it into a logical code sequence according to the preset protocol format, and use the infrared transmitter module to send data to the receiver, simplifying hardware requirements and reducing energy consumption.

Benefits of technology

It provides a cost-effective communication solution that reduces system cost and complexity, and is suitable for automated systems with low data transmission rates and small data volumes, extends the service life of the equipment and improves the competitiveness of the product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229633A_ABST
    Figure CN119229633A_ABST
Patent Text Reader

Abstract

The invention discloses an infrared communication method, device and equipment and a readable storage medium, and relates to the technical field of communication. The method comprises the following steps: a transmitting end acquires target data to be transmitted, assembles the data according to a preset communication protocol format to obtain a data packet, and encodes the data packet into a logic code sequence; the transmitting end extracts the logic code from the logic code sequence and obtains modulation data; and the transmitting end transmits data to the receiving end by using the infrared transmitting module based on the modulation data. Wireless communication between devices is achieved through the infrared receiving and transmitting module, and the wireless communication device is particularly suitable for application scenes with small data transmission quantity and low speed requirement. According to the method, the circuit design is simplified, and the complexity and cost of development are reduced, so that the market competitiveness of products is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an infrared communication method, device, equipment and readable storage medium. Background Art

[0002] In modern automation systems, communication between robots or workstations is a key factor in achieving efficient operation and data exchange. This communication usually requires the use of near-field wireless communication technology to support fast and reliable communication between devices. In this context, wireless technologies such as Bluetooth and WiFi are widely used in a variety of application scenarios, from simple data transmission to the sending and receiving of complex control commands. These technologies have become a natural choice for communication between automation devices due to their popularity in consumer electronics.

[0003] Although Bluetooth and WiFi technologies have been widely accepted and used in the market, their application in automation equipment communication also brings some limitations. For example, if the equipment controller has a built-in Bluetooth or WiFi module, these devices can communicate directly without additional hardware. However, for devices that do not have these built-in wireless communication functions, additional communication modules must be installed. This not only increases the physical size of the equipment, but may also limit the choice of controllers, as not all controllers are easily compatible with existing wireless modules.

[0004] In addition, existing wireless communication solutions have cost and complexity issues in design and implementation. Especially in scenarios where the amount of data to be transmitted is small and the data transmission rate requirement is not high, the use of Bluetooth or WiFi communication may lead to unnecessary high costs. This includes increased hardware costs, increased complexity of circuit design, and increased difficulty in software development. These factors together constitute important economic and technical barriers that need to be considered when selecting and deploying wireless communication solutions for automation equipment.

[0005] In summary, the main issues faced when implementing wireless communication technology in an automation environment are the increase in cost and complexity, as well as the limitation of technology choices. These issues may lead to inefficiency and overinvestment of the entire system, especially in application scenarios with low requirements for communication rate and data volume. Therefore, seeking more economical and simpler wireless communication solutions has become a key direction to improve the performance of automation systems. Summary of the invention

[0006] In view of this, in order to solve the above technical problems, the technical solution provided by the present invention includes:

[0007] In a first aspect, the present invention provides an infrared communication method, comprising:

[0008] The transmitting end obtains the target data to be sent, assembles the data according to a preset communication protocol format to obtain a data packet, and encodes the data packet into a logic code sequence;

[0009] The transmitting end extracts a logic code from the logic code sequence and obtains modulation data corresponding to the logic code;

[0010] The transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data.

[0011] In one implementation, the first byte is device information, the second byte is checksum, the third byte is data packet information, and the fourth byte and subsequent bytes are data areas.

[0012] In one implementation, the device information includes a device ID and a transmitter ID; the device ID occupies N bits; the transmitter ID occupies 8-N bits;

[0013] And / or, the data packet check code occupies 8 bits;

[0014] And / or, the data packet information includes a data area length and a data packet type; the data area length occupies Mbits; the data packet type occupies 8-Mbits;

[0015] And / or, the length of the data area is determined based on the length of the data area in the data packet information in the third byte.

[0016] In one embodiment, encoding the data packet into a logical code sequence includes:

[0017] According to a preset encoding and decoding format, encoding the data packet into the logical code sequence;

[0018] In the preset codec format, the logical code sequence into which the specified data packet is encoded includes: a leading code, an indefinite number of 0 codes or 1 codes, and an end code;

[0019] The carrier pulse time and carrier idle time of the end code are both determined according to the minimum receiving level width of the receiving end;

[0020] The carrier pulse time of the 0 code, the 1 code and the preamble code is twice the minimum receiving level width;

[0021] The carrier idle time of the 0 code, the 1 code and the preamble code is distinguished from the carrier pulse time of the 0 code, the 1 code and the preamble code.

[0022] In one embodiment, after encoding the data packet into a logical code sequence, the method further includes:

[0023] Determine whether the current infrared channel status is idle;

[0024] If the current infrared channel state is an idle state, executing the transmitting end to extract a logic code from the logic code sequence;

[0025] If the current infrared channel state is not an idle state, the process returns to the step of determining whether the current infrared channel state is an idle state.

[0026] In one implementation, the transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data, including:

[0027] The transmitting end controls the transmitting circuit to convert the modulated data into an infrared modulated signal for transmission;

[0028] Determine whether the current logic code sequence is empty or an end code has been sent;

[0029] If yes, it is determined that the transmitting end has completed data transmission;

[0030] If not, the process returns to executing the transmitting end to extract the logic code from the logic code sequence, and obtain the modulation data corresponding to the logic code.

[0031] In one implementation, before the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data, the method further includes:

[0032] Determine whether there are other infrared transmitting modules other than the current infrared transmitting module transmitting infrared signals;

[0033] If there are other infrared transmitting modules transmitting infrared signals, the current infrared transmitting module of the transmitting end enters a sending waiting state, and returns to execute the step of determining whether there are other infrared transmitting modules other than the current infrared transmitting module transmitting infrared signals;

[0034] If there is no other infrared transmitting module transmitting infrared signals, it is determined that the infrared channel is idle, so that the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data.

[0035] In one embodiment, the infrared communication method further comprises:

[0036] The receiving end obtains the level data of the receiving module;

[0037] The receiving end calculates the logic code according to a preset coding format;

[0038] The receiving end determines whether the currently received logic code is an end code;

[0039] If yes, it is determined that the current data packet transmission has ended, and the data in the logic code sequence is verified;

[0040] If not, it is determined that the current data packet transmission has not ended, the logic code sequence is added, and the receiving end is returned to execute to obtain the receiving module level data.

[0041] In one implementation, the verifying the data in the logic code sequence includes:

[0042] Converting the logic code sequence into a data packet and verifying the data packet;

[0043] Determining whether the data packet is successfully verified;

[0044] If yes, then obtain the data in the data packet and provide it to the upper layer application;

[0045] If not, the data in the data packet is discarded.

[0046] In a second aspect, the present invention provides an infrared communication method, comprising:

[0047] Constructing an infrared transmitting module list; wherein the infrared transmitting module list includes all available infrared transmitting modules to which data is to be sent;

[0048] Determine a currently idle infrared transmitting module based on the infrared transmitting module list;

[0049] Using the infrared communication method as described above, starting data transmission based on the currently idle infrared transmitting module;

[0050] Determine whether all infrared transmitting modules in the infrared transmitting module list have completed data transmission;

[0051] If yes, resetting operations on all the infrared transmitting modules according to the infrared transmitting module list;

[0052] If not, the method returns to executing the infrared communication method as described above and starts data transmission based on the currently idle infrared transmitting module.

[0053] In a third aspect, the present invention provides an infrared communication device, comprising:

[0054] An assembling module is used for the transmitter to obtain the target data to be sent, assemble the data according to a preset communication protocol format to obtain a data packet, and encode the data packet into a logic code sequence;

[0055] A modulation module, used for the transmitting end to extract a logic code from the logic code sequence and obtain modulation data corresponding to the logic code;

[0056] The sending module is used for the transmitting end to send data to the receiving end based on the modulated data by using the infrared transmitting module.

[0057] In a fourth aspect, the present invention provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the infrared communication method described above.

[0058] In a fifth aspect, the present invention provides a computer storage medium storing a computer program, wherein when the computer program is executed on a processor, the infrared communication method described above is implemented.

[0059] The embodiments of the present application have the following beneficial effects:

[0060] The infrared communication method provided in the embodiments of the present application provides an economical and efficient solution, which is particularly suitable for automation system environments that require low data transmission rates and small data volumes. By using infrared communication technology, this method avoids the high cost and complex system design problems that may be caused by traditional Bluetooth or WiFi technology. Specifically, the infrared communication method does not rely on complex wireless communication modules, thereby reducing material costs and the complexity of circuit design, and simplifying the development process.

[0061] In this technical solution, the transmitter assembles data through a preset communication protocol format and encodes it into a logical code sequence. This structured data processing method helps to improve the accuracy and efficiency of data transmission. The use of infrared transmitter modules further simplifies hardware requirements because infrared components are more economical, easier to integrate, and have lower power consumption than other wireless communication hardware. In addition, the use of infrared technology also reduces the energy consumption of communication between devices, which helps to extend the service life of the equipment.

[0062] This infrared communication method can significantly improve the competitiveness of products due to its simple design and high cost-effectiveness, especially in the price-sensitive consumer electronics and industrial automation markets. Overall, this infrared communication method not only optimizes communication costs and system complexity, but also provides a reliable data transmission method, making it an ideal choice for scenarios with low communication rate and data volume requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. For ordinary technicians in this field, other related drawings can also be obtained based on these drawings without creative work.

[0064] Figure 1 A schematic diagram showing the structure of the hardware operating environment involved in the infrared communication method embodiment of the present invention;

[0065] Figure 2 A schematic diagram of the process of the infrared communication method embodiment 1 of the present invention is shown;

[0066] Figure 3 A waveform diagram showing the carrier pulse time and carrier idle time of the transmitting end and the receiving end of the infrared communication method embodiment 2 of the present invention is shown;

[0067] Figure 4 The diagram shows a supplementary flow chart of the infrared communication method embodiment 3 of the present invention including step S100-1;

[0068] Figure 5 A schematic flow chart of the refinement of step S300 (including step S200) of embodiment 3 of the infrared communication method of the present invention is shown;

[0069] Figure 6 A schematic flow chart of supplementary steps including steps S400, S500 and S600 before step S300 of embodiment 4 of the infrared communication method of the present invention is shown;

[0070] Figure 7 A schematic flow chart of the infrared communication method supplementary steps (steps S710 to S750) of the infrared communication method embodiment 5 of the present invention is shown;

[0071] Figure 8 A schematic diagram showing a detailed flow chart of step S740 in Embodiment 5 of the infrared communication method of the present invention;

[0072] Fig. 9 A supplementary flow chart of steps S1 to S5 of Example 6 of the infrared communication method of the present invention is shown;

[0073] Fig.10 Schematic diagram of module connection of an infrared communication device in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The embodiments of the present invention are described in detail below, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.

[0075] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0076] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0077] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0078] like Figure 1 , which is a schematic diagram of the structure of the hardware operating environment of the terminal involved in the embodiment of the present invention.

[0079] The infrared communication system provided in the embodiment of the present invention may be a PC, or a mobile terminal device such as a smart phone, a tablet computer or a portable computer. The infrared communication system may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005 and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen, an input unit such as a keyboard, and a remote control, and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory, such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Optionally, the infrared communication system may also include an RF (Radio Frequency) circuit, an audio circuit, a WiFi module, and the like.

[0080] Those skilled in the art will understand that Figure 1 The infrared communication system shown in the figure does not constitute a limitation thereof, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently. Figure 1As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a data interface control program, a network connection program, and an infrared communication program.

[0081] Example 1

[0082] Reference Figure 2 Embodiment 1 of the present invention provides an infrared communication method, comprising:

[0083] Step S100, the transmitting end obtains target data to be sent, assembles the data according to a preset communication protocol format to obtain a data packet, and encodes the data packet into a logic code sequence;

[0084] As mentioned above, the infrared communication method in this embodiment is a communication method between devices based on infrared signals.

[0085] In this embodiment, it can be applied to communication between multiple terminals, including a sending terminal and a receiving terminal.

[0086] Each end may include an infrared transmitting module and an infrared receiving module. When the end is transmitting data, it can be used as a transmitting end, and the infrared transmitting module works at this time. That is, the party that sends the infrared signal is the infrared transmitting device, i.e., the transmitting end, and the party that receives the infrared signal is the infrared receiving device, i.e., the receiving end.

[0087] This step involves the transmitter acquiring the target data to be sent. First, the transmitter collects the data to be transmitted from the upper-layer application or other data sources, which may include text information, control commands, sensor readings, etc. Then, according to the preset communication protocol format, such as data frame structure, synchronization bytes, address information, etc., the collected data is assembled to form a structured data packet. Finally, the data packet is converted into a logical code sequence according to certain rules (coding scheme), and the logical code includes but is not limited to the preamble, data code, check code, etc.

[0088] This step generates standardized data packets for infrared transmission, ensuring the correct organization and encoding of data, which helps improve the reliability and efficiency of data transmission. Using standardized communication protocols can improve the compatibility and scalability of the system.

[0089] Specifically, various digital coding technologies may be used to implement data coding, such as pulse width modulation (PWM) or Manchester coding, etc., to adapt to different transmission requirements and hardware configurations.

[0090] Step S200, the transmitting end extracts a logic code from the logic code sequence, and obtains modulation data corresponding to the logic code;

[0091] As mentioned above, in this step, the transmitter extracts a single logic code from the encoded logic code sequence and obtains corresponding modulation data for each logic code. The modulation data determines the emission characteristics of the infrared LED, such as emission frequency, duration and intensity.

[0092] By converting the logic code into specific modulation data, this step realizes the conversion of digital signal to analog signal, preparing for actual physical transmission. This method can accurately control the behavior of the infrared transmitter module and optimize the transmission effect and reception quality of the signal.

[0093] Specifically, the modulation can be implemented by adjusting the driving circuit of the infrared LED through software-controlled hardware (such as a microcontroller) to ensure that the infrared light is emitted according to a predetermined time and intensity.

[0094] Step S300: the transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data.

[0095] As described above, the transmitting end uses an infrared transmitting module to send data to the receiving end according to the obtained modulation data. This involves activating an infrared transmitter (such as an infrared LED) to transmit an infrared signal according to the instruction of the modulation data.

[0096] This step realizes the actual physical transmission of data, securely delivering digital information to the receiving end via infrared signals. The wireless nature of infrared communication reduces the need for physical connections between devices, provides greater layout flexibility and reduces hardware costs.

[0097] The driving circuit of the infrared LED can be built with simple electronic components, and the control logic can be embedded in a microcontroller or a dedicated communication chip to ensure efficient and accurate execution of the modulated data.

[0098] Through these steps, the infrared communication method can efficiently process and transmit data, and is suitable for a variety of application scenarios that require low-speed and small data volume transmission, while reducing the complexity and cost of the system.

[0099] In summary, the infrared communication method in the embodiment of the present application provides an economical and efficient solution for the automation system that requires low data transmission rate and small data volume. By adopting infrared communication technology, this method effectively avoids the high cost and complex system design problems that may be caused by traditional Bluetooth or WiFi technology, reduces material cost and complexity of circuit design, and simplifies the development process. The transmitter assembles and encodes data through a preset communication protocol format, thereby improving the accuracy and efficiency of transmission. The use of an economical and low-power infrared transmitter module further simplifies hardware requirements, reduces energy consumption, and extends the service life of the equipment. Due to its simple design and high cost-effectiveness, this method can significantly enhance product competitiveness, and is particularly suitable for price-sensitive consumer electronics and industrial automation fields, and is an ideal choice for low-rate and small data volume communication needs.

[0100] Example 2

[0101] An infrared communication method is provided in an embodiment of the present invention. Based on the above embodiment 1, the data packet defined by the preset communication protocol format includes: device information of the first byte, a check code of the second byte, data packet information of the third byte, and data area of ​​the fourth byte and subsequent bytes.

[0102] In the above-mentioned preset communication protocol format, a complete data packet may include device information, a check code, data packet information and a data area.

[0103] Device information can include a device identifier or address that identifies the specific device that sends and receives data. This ensures that data packets are correctly sent to the specified device and received from the correct device.

[0104] Among them, the check code is used to check the integrity and accuracy of data transmission. The check code can be generated by a variety of algorithms, such as CRC (cyclic redundancy check), checksum, etc. It helps the receiving end to verify whether the received data has been tampered with or damaged during the transmission process.

[0105] Packet information, including the packet type, sequence number, or other metadata that helps the receiver understand and process the context and structure of the data.

[0106] In the data area, the data content actually to be transmitted may be control commands, status information, user data, etc.

[0107] Through such organization, the data packet not only contains the actual data content, but also helps to ensure the security and integrity of the data, while providing the necessary information to support complex communication requirements and error handling. The device information ensures the correct routing of the data, the checksum enhances the reliability of the data, the data packet information provides a means to manage the data flow, and the data area carries the specific application data.

[0108] Furthermore, the device information is the first byte, including a device ID and a transmitter ID; the device ID occupies N bits; the transmitter ID occupies 8-N bits;

[0109] The device information includes the device ID and the transmitter ID. The device ID is used to identify the specific device that receives or sends data, while the transmitter ID is used to distinguish different transmitter modules on the same device.

[0110] In terms of bit allocation, the device ID can occupy N bits, indicating different types of communication devices.

[0111] The transmitter ID occupies the remaining (8-N) bits and is used to distinguish multiple infrared transmitters on the device.

[0112] This allocation method provides sufficient address space and flexibility for different types and numbers of devices and their transmission modules.

[0113] It should be noted that there is no requirement for the order of the device ID and the transmitter ID; the number of bits occupied by the device ID and the transmitter ID can be adjusted according to the transmission scenario, but the size of N must be the same for devices communicating with each other.

[0114] Furthermore, the data packet check code occupies 8 bits;

[0115] The 8-bit check code is used to check whether the entire data packet is received correctly. Various check methods such as sum check and CRC8 check can be used.

[0116] Furthermore, the data packet information includes a data area length and a data packet type; the data area length occupies M bits; the data packet type occupies 8-M bits;

[0117] As mentioned above, the data area length occupies M bits and is used to specify the byte length of the data area. The data packet type occupies (8-M) bits and is used to mark the data packet type, such as ordinary data packet, firmware upgrade, etc.

[0118] It should be noted that there is no requirement for the order of the data area length and the data packet type; the number of bits occupied by the data area length and the data packet type can be adjusted according to the transmission scenario, but the size of M must be the same for devices communicating with each other; there is no requirement for the order of the data packet check code and the data packet information.

[0119] Furthermore, starting from the fourth byte, there is the data area.

[0120] The length of the data area is determined based on the length of the data area in the data packet information in the third byte.

[0121] As mentioned above, the data area is used to store the data actually sent.

[0122] Furthermore, the step S100, encoding the data packet into a logic code sequence, includes:

[0123] Step S110, encoding the data packet into the logic code sequence according to a preset coding format.

[0124] The above steps involve further encoding the data packet assembled according to the preset communication protocol format into a logic code sequence according to a specific encoding and decoding format. This includes converting each part of the data packet into corresponding logic codes, such as the preamble code, data code (0 code and 1 code), and end code.

[0125] Through this encoding, the data packet is converted into a format that can be understood by a series of infrared signals, ensuring the correct transmission and identification of data during transmission and reception. Using the preset codec format can standardize the data transmission process, improve the stability and reliability of data transmission, and facilitate compatibility between different devices.

[0126] In the preset encoding and decoding format, the specified data packet is encoded into a logical code sequence, including: a leading code, an indefinite number of 0 codes or 1 codes, and an end code, wherein the 0 code represents a logical 0; the 1 code represents a logical 1; and the end code indicates the end of transmission.

[0127] It should be noted that the reference Figure 3 , the infrared modulation signal is composed of two values: "carrier pulse time + carrier idle time", so each logic code value is also composed of these two values. Different logic codes have different values.

[0128] The carrier pulse time and carrier idle time of the end code are both determined according to the minimum receiving level width of the receiving end; the carrier pulse time of the 0 code, the 1 code and the preamble code is twice the minimum receiving level width; the carrier idle time of the 0 code, the 1 code and the preamble code is different from the carrier pulse time of the 0 code, the 1 code and the preamble code.

[0129] As mentioned above, the carrier pulse time and carrier idle time need to be determined according to the "minimum receiving level width" of the infrared receiving module.

[0130] For example, if the minimum receiving level width is 600us, the following code value definition rules are used:

[0131] Table 1. Code value definition table

[0132] Logical Code Carrier pulse time us Carrier idle time us 0 yards 1200 1000 1 yard 1200 1700 Preamble 1200 2400 End code 600 600

[0133] The end code is set to the minimum allowed wave pulse time width, which can shorten the transmission time and increase the transmission rate.

[0134] Based on the data in Table 1, the carrier pulse time of 0 code, 1 code and preamble code is uniformly set to 1200us, which is twice the minimum level width. This not only allows a certain deviation range for the time width of the received carrier pulse level, improves the decoding success rate, but also facilitates the design of decoding logic. The carrier idle time of 0 code, 1 code and preamble code is set to different values ​​for the receiving device to parse the type of code value. The larger the difference between the values, the lower the probability of decoding error, but the lower the transmission rate.

[0135] Code 0 and code 1 are sent most frequently, so the level time width of code 0 and code 1 should be as small as possible.

[0136] Example 3

[0137] Reference Figure 4 In an embodiment of the present invention, an infrared communication method is provided. Based on the above embodiment 1, the step S100, after encoding the data packet into a logic code sequence, further includes:

[0138] Step S100-1, determining whether the current infrared channel state is idle;

[0139] As mentioned above, before transmitting any data, first check whether the infrared channel is idle. This is to ensure that there are no other interfering signals in the channel when the data is sent, avoiding data collision and signal interference.

[0140] This step can significantly improve the reliability of data transmission, prevent data loss and signal conflicts, and achieve a more stable and reliable communication environment.

[0141] Specifically, the infrared receiving module can be used to monitor whether there is a signal being transmitted in the channel. If a signal is detected, the channel is considered busy; otherwise, the channel is considered idle. This detection can be achieved through program-controlled time intervals or continuous monitoring.

[0142] If the current infrared channel state is an idle state, then executing step S200, the transmitting end extracts a logic code from the logic code sequence;

[0143] As mentioned above, if the channel is idle, the transmitter starts to extract the logic code from the pre-encoded logic code sequence and prepares to send data, thereby ensuring that the data is sent without interference, maximizing communication efficiency and data integrity.

[0144] The transmitting end can send data according to a predetermined logic code sequence, including a leading code, a data code and an ending code, which are converted into corresponding infrared signals by the infrared transmitting module.

[0145] If the current infrared channel state is not an idle state, the process returns to step S100 - 1 to determine whether the current infrared channel state is an idle state.

[0146] As mentioned above, if the channel is not idle, the system will re-detect the channel status until the channel becomes idle. This feedback loop ensures that data will not be sent before the channel is idle. Through this cyclic detection mechanism, possible conflicts and interferences during data transmission are avoided, and the success rate of communication is improved.

[0147] This step can be achieved by writing a loop or recursive function to detect the channel status and jump out of the loop to continue the sending operation when the idle state is detected.

[0148] In summary, the channel detection and data transmission control process described in the above method provides an efficient and secure way to manage data transmission for infrared communication methods, especially in environments where multiple signal interference may exist. By intelligently managing channel status and adjusting transmission behavior in a timely manner, this method not only optimizes the data transmission process, but also significantly improves the overall stability and reliability of the system.

[0149] For further reference, Figure 5 In step S300, the transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data, including:

[0150] Step S310, the transmitting end controls the transmitting circuit to convert the modulated data into an infrared modulated signal for transmission;

[0151] The above steps involve the transmitter extracting the modulated data from the data packet and converting it into an infrared light signal by controlling the transmitting circuit (which may include an infrared LED or laser and its driving circuit). This process ensures that the physical form of the data is infrared light waves, which are suitable for wireless transmission.

[0152] This conversion ensures efficient data transmission and low-energy operation by precisely controlling the infrared transmitter module. Using infrared communication allows devices to communicate effectively without complex hardware support, reducing system cost and power consumption.

[0153] Step S320, determining whether the current logic code sequence is empty or an end code has been sent;

[0154] In the above steps, whether all logic codes have been sent includes two cases, namely (1) checking whether the logic code sequence has been completely processed; (2) or whether the end mark (end code) of the sequence has been reached. This is to ensure that the entire data packet has been completely sent.

[0155] This step improves the reliability of communication and data integrity by ensuring the complete transmission of data, and avoids the problem of lost or incomplete fragments in data transmission.

[0156] The sending status of the logic code sequence can be tracked by a counter or pointer in the program. Once the counter reaches the sequence length or the pointer reaches the end mark of the sequence, the sending is considered complete.

[0157] Step S330: If yes, it is determined that the transmitting end has completed data transmission;

[0158] If not, the process returns to step S200 , where the transmitting end extracts a logic code from the logic code sequence and obtains modulation data corresponding to the logic code.

[0159] As mentioned above, if all data has been sent (including the end code), the process ends and the data sending task is completed; if the data has not been completely sent, the next logic code is extracted from the logic code sequence and modulated accordingly to continue the sending process. This feedback control loop ensures that each logic code is sent accurately and provides dynamic control during the sending process, so that the transmitter can adjust the sending behavior according to the actual situation. Specifically, a loop structure can be implemented through programming, which contains a conditional judgment statement to check the sending status and decide whether to end the sending or continue to send a new logic code based on the condition.

[0160] The method provided in this embodiment not only optimizes the data transmission logic in infrared communication, but also improves the efficiency and reliability of the overall communication by ensuring that each data packet is sent completely and correctly. This method is particularly suitable for application scenarios that require low-cost, low-power and reliable short-range wireless communication, such as but not limited to home automation, consumer electronics, etc. Through effective logic control and transmission circuit design, this method ensures efficient and economical data transmission.

[0161] Example 4

[0162] Reference Figure 6 In an embodiment of the present invention, an infrared communication method is provided. Based on the above embodiment 1, in step S300, before the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data, the method further includes:

[0163] Step S400, determining whether there is any infrared transmitting module other than the current infrared transmitting module transmitting infrared signals.

[0164] The method provided in this embodiment addresses the defect that when two or more transmitting modules transmit signals at the same time, infrared signals will be confused, resulting in decoding failure of the receiving device.

[0165] The above steps involve monitoring whether there are other infrared transmitter modules in the environment that are transmitting signals at the same time. This is usually achieved by detecting the infrared signal strength or specific frequency in the environment to confirm whether there are other active infrared signal sources.

[0166] This monitoring can effectively avoid interference and data loss caused by multiple infrared devices transmitting signals at the same time, ensuring the reliability of communication. Specifically, sensors can be installed on infrared receivers to continuously monitor infrared signals in the environment, or software algorithms can be used to analyze and judge environmental signals.

[0167] Step S500, if there are other infrared transmitting modules transmitting infrared signals, the current infrared transmitting module of the transmitting end enters a sending waiting state, and returns to execute step S400 to determine whether there are other infrared transmitting modules other than the current infrared transmitting module transmitting infrared signals;

[0168] As mentioned above, if other transmitting modules are detected to be active, the current module will suspend transmission and wait until the channel is detected to be idle. This implements a dynamic feedback control mechanism to ensure that each module sends data in sequence. This waiting mechanism avoids signal collisions and data conflicts, improving the overall efficiency of the system and the transmission quality of the signal.

[0169] Step S600: If there is no other infrared transmitting module transmitting infrared signals, it is determined that the infrared channel is idle, so as to execute the step S300, and the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data.

[0170] As mentioned above, once the channel is determined to be idle, the current transmitting module will start to send infrared signals based on the pre-modulated data. This step is the beginning of the actual data transmission in the entire communication process. This ensures data transmission under optimal conditions and minimizes the possibility of interference and data errors.

[0171] In summary, in this embodiment, a method for efficiently managing infrared channels is provided, which is particularly suitable for multi-emitter environments. By intelligently monitoring and managing channel usage, the method significantly improves the reliability and efficiency of infrared communications. In addition, this method can be widely used in any type of wireless communication system that requires precise control of channel access, such as smart homes, industrial control systems, etc., to optimize the coordination between devices and the quality of data transmission.

[0172] Example 5

[0173] Reference Figure 7 In an embodiment of the present invention, an infrared communication method is provided. Based on the above embodiment 1, the infrared communication method further includes:

[0174] Step S710, the receiving end obtains the level data of the receiving module;

[0175] The above steps involve the receiving end using its receiving module (such as an infrared receiver) to capture the infrared signal sent from the transmitting end and convert it into level data. This usually involves amplification and adjustment of the signal for further data processing.

[0176] It should be noted that the steps in this embodiment may be executed after step S300, or may be executed simultaneously or sequentially during any other steps.

[0177] The above steps are the basis of the data transmission process, ensuring that the received signal can be further processed by the electronic equipment in digital form, which is the prerequisite for subsequent data decoding and verification.

[0178] Specifically, an infrared receiving sensor and related electronic circuits (such as an operational amplifier) ​​can be used to achieve this conversion, and the data is then converted into a digital signal through an analog-to-digital converter (ADC) for analysis by a microprocessor.

[0179] Step S720, the receiving end calculates the logic code according to the preset coding format;

[0180] As mentioned above, the received level data is decoded into logic code according to a predefined coding format (corresponding to the transmitting end). This may include identifying specific pulse lengths, sequences and intervals to determine the data bit (0 or 1).

[0181] This step ensures the correct interpretation of the data, that is, the accurate conversion of the received signal into digital information, which is the key to data integrity and correctness.

[0182] Step S730, the receiving end determines whether the currently received logic code is an end code;

[0183] In the above steps, the decoded logic code is checked to see if it is a predefined end code, which marks the end of a data transmission. Determining whether the end code is received is the key to determining whether the data packet is completely received, which helps to synchronize the data stream and confirm the boundaries of the data packet.

[0184] Step S740: If yes, it is determined that the current data packet transmission has ended, and the data in the logic code sequence is verified;

[0185] Step S750: If not, it is determined that the current data packet transmission has not ended, the logic code sequence is added, and the process returns to execute step S710, where the receiving end obtains the receiving module level data.

[0186] If the data transmission is confirmed to be over, the receiving end will perform verification operations on the entire logic code sequence, such as calculating and comparing CRC or checksum, to ensure the correctness and integrity of the data. If the currently received logic code is not the end code, it means that the data packet has not been completely received, and the system continues to receive more data.

[0187] The data verification step increases the reliability of the communication process, ensuring that the received data is correct and avoiding the risk of data corruption or tampering. This cycle ensures the continuous reception of data until a complete data packet is received.

[0188] In summary, the receiving process provided in this embodiment not only ensures the correct reception and analysis of data, but also improves the reliability of data transmission through a strict verification mechanism. These steps are implemented through the collaborative work of software and hardware, so that the infrared communication method can provide stable and reliable data exchange services in various application scenarios.

[0189] For further reference, Figure 8 The step S740 of verifying the data in the logic code sequence includes:

[0190] Step S741, converting the logic code sequence into a data packet, and verifying the data packet;

[0191] In the above steps, the receiving end converts the received logic code sequence back to the original data packet format. This usually involves decoding the logic code into the corresponding digital or character information to reconstruct the original data packet structure. After the conversion is completed, a check operation will be performed, usually by comparing the calculated check code (such as CRC, checksum, etc.) with the check code in the data packet.

[0192] This step ensures the integrity and correctness of the received data and improves the reliability of data transmission. Successful verification means that the data packet has not been tampered with or damaged during transmission, reducing problems caused by erroneous data.

[0193] Step S742, determining whether the data packet is successfully verified;

[0194] The above steps involve evaluating the verification results of the previous step to determine whether the data packet has passed the verification process as expected. The judgment of successful verification is a key indicator of signal integrity, ensuring that data is further processed only when the data is correct, avoiding problems caused by potential data errors.

[0195] Step S743: If yes, obtain the data in the data packet and provide it to the upper layer application;

[0196] Step S744: if not, the data in the data packet is discarded.

[0197] If the packet verification succeeds, the receiving end extracts the data in the packet and sends it to the upper-layer application of the system, such as the user interface, data processing module or other software application. If the packet fails the verification, it indicates that the data may be damaged or erroneous, so the data will be discarded without further processing.

[0198] The above steps ensure that only verified and reliable data is used for further processing and display, improving the data security and operation accuracy of the entire system; avoiding further processing of erroneous data and potential erroneous operations, and enhancing the robustness and reliability of the system.

[0199] In summary, the verification and processing process provided in this embodiment is a key step to ensure data transmission quality and system stability. Through a strict data verification mechanism, the system can ensure that only correct data is processed, thereby maintaining the reliability and security of the entire communication process. The implementation of these steps usually involves complex software logic and precise algorithm application, which is the basis for the design of a high-reliability communication system.

[0200] Example 6

[0201] Reference Fig. 9 , an embodiment of the present invention further provides an infrared communication method, comprising:

[0202] Step S1, constructing an infrared transmitting module list; wherein the infrared transmitting module list includes all available infrared transmitting modules to which data is to be sent.

[0203] In this embodiment, when there are multiple infrared transmitting modules on a device, they are transmitted alternately to avoid frequent use of individual transmitting modules and to avoid multiple modules transmitting infrared signals at the same time.

[0204] The above steps involve identifying and recording all available infrared transmitter modules and compiling them into a list. This list serves as the basis for managing transmitter modules in the infrared communication system. Creating this list enables the system to effectively manage and schedule multiple transmitter modules, optimize resource utilization, and reduce waiting time and conflicts.

[0205] Step S2, determining a currently idle infrared transmitting module based on the infrared transmitting module list;

[0206] In the above steps, the system needs to select a currently unoccupied transmitting module from the established list for use in the upcoming data transmission.

[0207] Selecting idle modules can maximize the system's response speed and communication efficiency and avoid single module overload and signal interference.

[0208] By monitoring the status (busy / idle) of each module, the system dynamically selects an idle module for data transmission.

[0209] Step S3, using the infrared communication method as described above, starting data transmission based on the currently idle infrared transmitting module;

[0210] As mentioned above, once an idle transmission module is selected, the communication method described previously (such as the method in Embodiment 1) will be used to start the data transmission process.

[0211] This ensures that each data transmission task is executed according to the optimal communication protocol, enhancing the reliability and security of data transmission.

[0212] Step S4, determining whether all infrared transmitting modules in the infrared transmitting module list have completed data transmission;

[0213] As mentioned above, the system needs to check whether all transmission modules have completed their transmission tasks in order to schedule the next round or end the operation. This step ensures that all data transmission tasks have been properly handled and system resources are reasonably utilized.

[0214] Step S5: if yes, resetting all the infrared transmitting modules according to the infrared transmitting module list;

[0215] If not, the process returns to step S3 and uses the infrared communication method as described above to start data transmission based on the currently idle infrared transmitting module.

[0216] If all modules have completed sending, the system will reset all modules to their initial state and prepare for the next round of operations; if there are modules that have not completed, the system will continue to use idle modules to send data. The reset operation ensures that all modules return to a known initial state and are ready to accept new tasks, while continuous data transmission allows the system to seamlessly handle continuous communication needs.

[0217] In summary, the method provided in this embodiment provides an efficient operating framework for multi-module management in an infrared communication system, allowing the system to optimize resource usage and improve the efficiency and reliability of data transmission. This method is particularly suitable for complex systems that need to manage multiple data transmission tasks at the same time, such as in the fields of smart homes, industrial automation, etc. In this way, it can be ensured that each transmitting module is fully utilized while maintaining the high response speed and reliability of the system.

[0218] In addition, reference Fig.10 In an embodiment of the present application, an infrared communication device is also provided, comprising:

[0219] An assembling module 10 is used for the transmitter to obtain target data to be sent, assemble the data according to a preset communication protocol format to obtain a data packet, and encode the data packet into a logic code sequence;

[0220] The modulation module 20 is used for the transmitting end to extract the logic code from the logic code sequence and obtain the modulation data corresponding to the logic code;

[0221] The sending module 30 is used for the transmitting end to send data to the receiving end based on the modulated data by using an infrared transmitting module.

[0222] In addition, a computer device is provided in an embodiment of the present application. The computer device includes a processor and a memory. The memory stores a computer program. The processor is used to execute the computer program to implement any of the infrared communication methods described above.

[0223] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0224] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0225] It should be noted that in the embodiments of the present application, the computer device provided includes an infrared transmitting module and a receiving module, and each computer device is an independent device that can be used as both a receiving end and a transmitting end.

[0226] In addition, a computer storage medium is provided in an embodiment of the present application, which stores a computer program. When the computer program is executed on a processor, the infrared communication method described above is implemented.

[0227] For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0228] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0229] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0230] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0231] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An infrared communication method, characterized in that: include: The transmitting end obtains the target data to be sent, assembles the data according to a preset communication protocol format to obtain a data packet, and encodes the data packet into a logic code sequence; The transmitting end extracts a logic code from the logic code sequence and obtains modulation data corresponding to the logic code; The transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data.

2. The infrared communication method according to claim 1, characterized in that: The data packet defined in the preset communication protocol format includes: device information in the first byte, a check code in the second byte, data packet information in the third byte, and data areas in the fourth byte and subsequent bytes.

3. The infrared communication method according to claim 2, characterized in that: The device information includes a device ID and a transmitter ID; the device ID occupies N bits; the transmitter ID occupies 8-N bits; And / or, the data packet check code occupies 8 bits; And / or, the data packet information includes a data area length and a data packet type; the data area length occupies M bits; the data packet type occupies 8-M bits; And / or, the length of the data area is determined based on the length of the data area in the data packet information in the third byte.

4. The infrared communication method according to claim 1, characterized in that: The step of encoding the data packet into a logic code sequence comprises: According to a preset encoding and decoding format, encoding the data packet into the logical code sequence; In the preset codec format, the logical code sequence into which the specified data packet is encoded includes: a leading code, an indefinite number of 0 codes or 1 codes, and an end code; The carrier pulse time and carrier idle time of the end code are both determined according to the minimum receiving level width of the receiving end; The carrier pulse time of the 0 code, the 1 code and the preamble code is twice the minimum receiving level width; The carrier idle time of the 0 code, the 1 code and the preamble code is distinguished from the carrier pulse time of the 0 code, the 1 code and the preamble code.

5. The infrared communication method according to claim 1, characterized in that: After encoding the data packet into a logic code sequence, the method further includes: Determine whether the current infrared channel status is idle; If the current infrared channel state is an idle state, executing the transmitting end to extract a logic code from the logic code sequence; If the current infrared channel state is not an idle state, the process returns to the step of determining whether the current infrared channel state is an idle state.

6. The infrared communication method according to claim 1, characterized in that: The transmitting end uses an infrared transmitting module to send data to the receiving end based on the modulated data, including: The transmitting end controls the transmitting circuit to convert the modulated data into an infrared modulated signal for transmission; Determine whether the current logic code sequence is empty or an end code has been sent; If yes, it is determined that the transmitting end has completed data transmission; If not, the process returns to executing the transmitting end to extract the logic code from the logic code sequence, and obtain the modulation data corresponding to the logic code.

7. The infrared communication method according to claim 1, characterized in that: Before the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data, the method further includes: Determine whether there are other infrared transmitting modules other than the current infrared transmitting module transmitting infrared signals; If there are other infrared transmitting modules transmitting infrared signals, the current infrared transmitting module of the transmitting end enters a sending waiting state, and returns to execute the step of determining whether there are other infrared transmitting modules other than the current infrared transmitting module transmitting infrared signals; If no other infrared transmitting module is transmitting infrared signals, it is determined that the infrared channel is idle, so that the transmitting end uses the infrared transmitting module to send data to the receiving end based on the modulated data.

8. The infrared communication method according to claim 1, characterized in that: The infrared communication method further comprises: The receiving end obtains the level data of the receiving module; The receiving end calculates the logic code according to a preset coding format; The receiving end determines whether the currently received logic code is an end code; If yes, it is determined that the current data packet transmission has ended, and the data in the logic code sequence is verified; If not, it is determined that the current data packet transmission has not ended, the logic code sequence is added, and the receiving end is returned to execute to obtain the receiving module level data.

9. The infrared communication method according to claim 8, characterized in that: The verifying of the data in the logic code sequence includes: Converting the logic code sequence into a data packet and verifying the data packet; Determining whether the data packet is successfully verified; If yes, then obtain the data in the data packet and provide it to the upper layer application; If not, the data in the data packet is discarded.

10. An infrared communication method, characterized in that: include: Constructing an infrared transmitting module list; wherein the infrared transmitting module list includes all available infrared transmitting modules to which data is to be sent; Determine a currently idle infrared transmitting module based on the infrared transmitting module list; Using the infrared communication method according to any one of claims 1 to 9, starting data transmission based on the currently idle infrared transmitting module; Determine whether all infrared transmitting modules in the infrared transmitting module list have completed data transmission; If yes, resetting operations on all the infrared transmitting modules according to the infrared transmitting module list; If not, the method returns to executing the infrared communication method as described in any one of claims 1 to 9, and starts data transmission based on the currently idle infrared transmitting module.

11. An infrared communication device, characterized in that: include: An assembling module is used for the transmitter to obtain the target data to be sent, assemble the data according to a preset communication protocol format to obtain a data packet, and encode the data packet into a logic code sequence; A modulation module, used for the transmitting end to extract a logic code from the logic code sequence and obtain modulation data corresponding to the logic code; The sending module is used for the transmitting end to send data to the receiving end based on the modulated data by using the infrared transmitting module.

12. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the infrared communication method according to any one of claims 1 to 10.

13. A computer storage medium, characterized in that: The device stores a computer program, which, when executed on a processor, implements the infrared communication method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Infrared data coding and decoding method and apparatus thereof

    CN105261199A

  • Point-to-point infrared communication method and system

    CN106877925A