Infrared communication method and device, electronic equipment and storage medium

By selecting an unoccupied transmission frequency based on priority arbitration when the infrared communication device is powered on, the problem of low communication efficiency of the infrared communication device is solved, and efficient and flexible infrared communication is realized.

CN121815342APending Publication Date: 2026-04-07GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In the prior art, when multiple infrared communication devices communicate, signal crosstalk occurs because they use the same infrared emission frequency, resulting in reduced communication efficiency.

Method used

By selecting an unoccupied frequency from multiple candidate transmission frequencies as the target transmission frequency when the infrared communication device is powered on, and arbitrating according to priority, it is ensured that each device communicates using a different frequency.

Benefits of technology

It improves the communication efficiency of infrared communication devices, avoids the misalignment of signal transmission processes, and enhances the flexibility and anti-interference capability of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121815342A_ABST
    Figure CN121815342A_ABST
Patent Text Reader

Abstract

The invention relates to an infrared communication method and device, electronic equipment and a storage medium, and the method comprises the steps: selecting any candidate transmission frequency from a plurality of candidate transmission frequencies as the first transmission frequency of a first infrared communication device, and monitoring the second transmission frequency of a second infrared communication device; under the condition that the second transmitting frequency comprises the first transmitting frequency, judging whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device; and under the condition that the first priority is lower than or equal to the second priority, re-selecting a new transmitting frequency from the plurality of candidate transmitting frequencies as the first transmitting frequency, and repeatedly executing the judgment step until a preset condition is met. Determining the currently selected candidate emission frequency as a target emission frequency of the first infrared communication device; and performing infrared communication with the second infrared communication device by using the target emission frequency. Therefore, the communication efficiency of the infrared communication device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless communication technology, and in particular to an infrared communication method, apparatus, electronic device and storage medium. Background Technology

[0002] In existing technologies, when multiple infrared communication devices communicate with each other, since each device uses the same infrared emission frequency, to avoid signal crosstalk, the infrared signal transmission processes of each device must be completely staggered. This places high demands on the timing of signal transmissions from each device. While this is sufficient for scenarios with a small number of infrared communication devices, it leads to a significant reduction in communication efficiency when there are many devices. Therefore, improving the communication efficiency of infrared communication devices has become an urgent technical problem to be solved. Summary of the Invention

[0003] This application provides an infrared communication method, apparatus, electronic device, and storage medium to solve the problem that the infrared signal transmission processes of various infrared communication devices in the prior art need to be completely staggered, resulting in low communication efficiency.

[0004] In a first aspect, embodiments of this application provide an infrared communication method applied to a first infrared communication device, wherein the first infrared communication device is any infrared communication device in an infrared communication cluster, and the method includes: S1, when the first infrared communication device is powered on, select any candidate transmission frequency from multiple candidate transmission frequencies as the first transmission frequency of the first infrared communication device itself, and monitor the second transmission frequency of the second infrared communication device, wherein the second infrared communication device is another infrared communication device in the infrared communication cluster besides the first infrared communication device. S2, determine whether the second transmission frequency includes the first transmission frequency; S3, if the second transmission frequency includes the first transmission frequency, determine whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device; S4, when the first priority is lower than or equal to the second priority, a new transmission frequency is selected from the plurality of candidate transmission frequencies as the first transmission frequency, and steps S2 to S3 are repeated until a preset condition is met, and the currently selected candidate transmission frequency is determined as the target transmission frequency of the first infrared communication device, wherein the preset condition is that the first priority is higher than the second priority. S5, use the target transmission frequency to perform infrared communication with the second infrared communication device.

[0005] Optionally, after determining whether the second transmission frequency includes the first transmission frequency, the method further includes: If the second transmission frequency does not include the first transmission frequency, the first transmission frequency is determined as the target transmission frequency.

[0006] Optionally, after determining whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device, the method further includes: If the first priority is higher than the second priority, the first transmission frequency is determined as the target transmission frequency.

[0007] Optionally, the method further includes: If all candidate transmission frequencies have been selected and the preset conditions are still not met, a prompt message is generated. The prompt message is used to remind the user to expand the candidate transmission frequencies or reduce the number of infrared communication devices in the infrared communication cluster.

[0008] Optionally, the step of using the target transmission frequency to perform infrared communication with the second infrared communication device includes: Infrared signals are sequentially transmitted to each of the second infrared communication devices using the target transmission frequency. The infrared signals carry communication data and a check code, and the check code is used to verify the communication data.

[0009] Optionally, the method further includes: When using the target transmission frequency to conduct infrared communication with the second infrared communication device, the number of infrared signals received from the second infrared communication device within a preset time window is counted. Determine whether the number of received infrared signals falls within a preset range, wherein the preset range is determined based on the total number of infrared communication devices in the infrared communication cluster, the signal transmission cycle of each infrared communication device, and the duration of the preset time window; If the number of received infrared signals does not fall within the preset range, the target transmission frequency is marked as an unreliable frequency, and a notification message is sent to the second infrared communication device, wherein the notification message is used to notify the second infrared communication device that the target transmission frequency is an unreliable frequency.

[0010] Optionally, after determining whether the number of received infrared signals falls within a preset range, the method further includes: If the number of received infrared signals falls within the preset range, the target emission frequency is stored in the local storage area of ​​the first infrared communication device, so that the first infrared communication device can directly obtain the target emission frequency from the local storage area for infrared communication when powered on subsequently.

[0011] Secondly, this application also provides an infrared communication device, which is any infrared communication device in an infrared communication cluster. The infrared communication device includes: a controller and an infrared transceiver module connected to the controller. The infrared transceiver module is used to transmit and receive infrared signals. The controller is used to execute the infrared communication method described in the first aspect.

[0012] Thirdly, embodiments of this application also provide an electronic device, which includes the infrared communication device described in the second aspect.

[0013] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the infrared communication method described in the first aspect.

[0014] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application, when the first infrared communication device is powered on, selects any candidate transmission frequency from a plurality of candidate transmission frequencies as the first transmission frequency of the first infrared communication device itself, and monitors the second transmission frequency of the second infrared communication device, wherein the second infrared communication device is another infrared communication device in the infrared communication cluster besides the first infrared communication device; determines whether the second transmission frequency includes the first transmission frequency; if the second transmission frequency includes the first transmission frequency, determines whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device; if the first priority is lower than or equal to the second priority, reselects a new transmission frequency from the plurality of candidate transmission frequencies as the first transmission frequency, and repeats the above determination steps until a preset condition is met, and then determines the currently selected candidate transmission frequency as the target transmission frequency of the first infrared communication device, wherein the preset condition is that the first priority is higher than the second priority; and uses the target transmission frequency to perform infrared communication with the second infrared communication device. In this way, when any infrared communication device in the infrared communication cluster is powered on, its priority can be compared with the priorities of other infrared communication devices that have been powered on. This allows the determination of an unoccupied candidate transmission frequency from multiple candidate transmission frequencies, which is then used as the target transmission frequency for that infrared communication device. This ensures that each infrared communication device uses a different transmission frequency for infrared communication, eliminating the need to stagger the infrared signal transmission processes of each device and thus improving the communication efficiency of each device. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1 A flowchart illustrating an infrared communication method provided in an embodiment of this application; Figure 2 A schematic diagram of a network topology for an infrared communication cluster provided in an embodiment of this application; Figure 3 A flowchart illustrating yet another infrared communication method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an infrared communication device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] To address the problem that the infrared signal transmission processes of various infrared communication devices in the prior art need to be completely staggered, resulting in low communication efficiency, this application provides an infrared communication method, device, electronic device, and storage medium that can improve the communication efficiency of infrared communication devices.

[0022] See Figure 1 , Figure 1 This is a flowchart illustrating an infrared communication method provided in an embodiment of this application. Figure 1 As shown, the infrared communication method is applied to a first infrared communication device, which is any infrared communication device in an infrared communication cluster. The infrared communication method may include the following steps: Step S101: When the first infrared communication device is powered on, select any candidate transmission frequency from multiple candidate transmission frequencies as the first transmission frequency of the first infrared communication device itself, and monitor the second transmission frequency of the second infrared communication device, wherein the second infrared communication device is any other infrared communication device in the infrared communication cluster other than the first infrared communication device.

[0023] It should be noted that the infrared communication method provided in this application embodiment can be applied to a first infrared communication device, which can be any infrared communication device in an infrared communication cluster. Here, an infrared communication cluster refers to a cluster composed of multiple infrared communication devices. The network topology of this infrared communication cluster can be as follows: Figure 2 As shown. In this infrared communication cluster, each infrared communication device communicates by sending infrared signals. Each infrared communication device plays an equal role, and there is no master-slave distinction.

[0024] Specifically, the number of candidate transmission frequencies can be set according to actual conditions. However, to ensure that all infrared communication devices in the infrared communication cluster can communicate normally, the number of candidate transmission frequencies needs to be greater than or equal to the number of infrared communication devices. The first infrared communication device can be any infrared communication device in the infrared communication cluster. The second infrared communication device can be any other powered-on infrared communication device in the infrared communication cluster besides the first infrared communication device. The first transmission frequency refers to any candidate transmission frequency randomly selected from multiple candidate transmission frequencies when the first infrared communication device is powered on. The second transmission frequency refers to the transmission frequency currently used by the second infrared communication device.

[0025] Step S102: Determine whether the second transmission frequency includes the first transmission frequency.

[0026] Determine whether the second transmission frequency includes the first transmission frequency. If the second transmission frequency includes the first transmission frequency, it means that the first transmission frequency has been occupied by the second infrared communication device. In this case, step S103 needs to be executed to arbitrate the ownership of the first transmission frequency. If the second transmission frequency does not include the first transmission frequency, it means that the first transmission frequency has not been occupied by the second infrared communication device. In this case, the first transmission frequency can be used as the transmission frequency of the first infrared communication device.

[0027] Step S103: If the second transmission frequency includes the first transmission frequency, determine whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device.

[0028] Specifically, the priority order of each infrared communication device in the infrared communication cluster has been pre-set. Each infrared communication device can determine its own priority order based on its own Identity Document (ID).

[0029] When the first infrared communication device determines that the second transmission frequency includes the first transmission frequency (i.e., the first transmission frequency is already occupied by the second infrared communication device), it can further determine whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device. If the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device, it means that the first transmission frequency continues to be occupied by the second infrared communication device. In this case, the first infrared communication device needs to abandon the currently selected candidate transmission frequency and reselect a new candidate transmission frequency. If the first priority of the first infrared communication device is higher than the second priority of the second infrared communication device, it means that the first transmission frequency can be occupied by the first infrared communication device. In this case, the second infrared communication device needs to abandon the first transmission frequency.

[0030] Step S104: If the first priority is lower than or equal to the second priority, a new transmission frequency is selected from multiple candidate transmission frequencies as the first transmission frequency, and steps S102 to S103 are repeated until a preset condition is met. Then, the currently selected candidate transmission frequency is determined as the target transmission frequency of the first infrared communication device. The preset condition is that the first priority is higher than the second priority.

[0031] Specifically, when the first infrared communication device determines that its first priority is lower than or equal to the second priority of the second infrared communication device, it can reselect a new transmission frequency from multiple candidate transmission frequencies as the first transmission frequency, and then re-determine whether the second transmission frequency includes the first transmission frequency. If the second transmission frequency still includes the first transmission frequency, it continues to determine whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device. If the first priority of the first infrared communication device is still lower than or equal to the second priority of the second infrared communication device, the above process is repeated until the first priority of the first infrared communication device is higher than the second priority of the second infrared communication device. At this point, the candidate transmission frequency currently selected by the first infrared communication device is determined as its target transmission frequency.

[0032] Step S105: Use the target transmission frequency to conduct infrared communication with the second infrared communication device.

[0033] After the first infrared communication device determines the target transmission frequency, it can use the target transmission frequency to conduct infrared communication with the second infrared communication device.

[0034] In this way, when any infrared communication device in the infrared communication cluster is powered on, its priority can be compared with the priorities of other infrared communication devices that have been powered on. This allows the determination of an unoccupied candidate transmission frequency from multiple candidate transmission frequencies, which is then used as the target transmission frequency for that infrared communication device. This ensures that each infrared communication device uses a different transmission frequency for infrared communication, eliminating the need to stagger the infrared signal transmission processes of each device and thus improving the communication efficiency of each device.

[0035] In an optional embodiment, after step S102, determining whether the second transmission frequency includes the first transmission frequency, the method further includes: If the second transmission frequency does not include the first transmission frequency, the first transmission frequency is determined as the target transmission frequency.

[0036] Specifically, if the second transmission frequency does not include the first transmission frequency, it means that the first transmission frequency is not occupied by the second infrared communication device. In other words, other powered-on infrared communication devices have not yet used the first transmission frequency. In this case, the first transmission frequency can be directly used as the target transmission frequency of the first infrared communication device to participate in communication.

[0037] In this way, when the first transmission frequency is not occupied by the second infrared communication device, the first infrared communication device can directly use the first transmission frequency for infrared communication, thereby further improving the communication efficiency of the first infrared communication device.

[0038] In an optional embodiment, after step S103 above, determining whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device, the method further includes: If the first priority is higher than the second priority, the first transmission frequency is determined as the target transmission frequency.

[0039] Specifically, if the first priority of the first infrared communication device is higher than the second priority of the second infrared communication device, it means that the first infrared communication device can preferentially use the first transmission frequency, that is, the first transmission frequency can be occupied by the first infrared communication device. At this time, the first infrared communication device can determine the first transmission frequency as its own target transmission frequency and use the target transmission frequency for infrared communication. The second infrared communication device, on the other hand, needs to abandon the first transmission frequency and re-determine its own transmission frequency.

[0040] In this way, when the first transmission frequency is occupied by the second infrared communication device, and the first infrared communication device has a higher priority than the second infrared communication device, the first infrared communication device can also directly use the first transmission frequency for infrared communication, thereby further improving the communication efficiency of the first infrared communication device.

[0041] In an optional embodiment, the method further includes: If all candidate transmission frequencies have been selected and the preset conditions are still not met, a prompt message is generated. The prompt message is used to remind the user to expand the candidate transmission frequencies or reduce the number of infrared communication devices in the infrared communication cluster.

[0042] Specifically, when the first infrared communication device selects the last candidate transmission frequency from multiple candidate transmission frequencies as the first transmission frequency, but the first priority of the first infrared communication device is still lower than or equal to the second priority of the second infrared communication device, the first infrared communication device can generate a prompt message to remind the user to expand the candidate transmission frequencies or reduce the number of infrared communication devices in the infrared communication cluster, thereby ensuring that the first infrared communication device can normally access the infrared communication cluster for communication.

[0043] In an optional embodiment, step S106, which involves using the target transmission frequency to perform infrared communication with the second infrared communication device, includes: Infrared signals are sequentially transmitted to each infrared communication device in the second infrared communication device using the target transmission frequency. The infrared signals carry communication data and a check code, and the check code is used to verify the communication data.

[0044] Specifically, since each time a new infrared communication device is powered on in an infrared communication cluster, there is a possibility of transmission frequency conflict with other already powered-on infrared communication devices, leading to signal crosstalk, communication data and checksums can be carried in the transmitted infrared signal when the first infrared communication device communicates with other infrared communication devices. Of course, the infrared signal can also carry information such as source ID and target ID.

[0045] In this way, the signal receiver can use the check code to verify the communication data and determine whether to receive or discard the communication data based on the verification result.

[0046] In an optional embodiment, the method further includes: When using the target transmission frequency to conduct infrared communication with the second infrared communication device, the number of infrared signals received from the second infrared communication device within a preset time window is counted. Determine whether the number of received infrared signals falls within a preset range. The preset range is determined based on the total number of infrared communication devices in the infrared communication cluster, the signal transmission cycle of each infrared communication device, and the duration of a preset time window. If the number of received infrared signals does not fall within a preset range, the target transmission frequency is marked as an unreliable frequency, and a notification message is sent to the second infrared communication device. The notification message is used to notify the second infrared communication device that the target transmission frequency is an unreliable frequency.

[0047] Specifically, each infrared communication device actively sends data to other infrared communication devices at fixed time intervals. For example, assuming that the infrared communication cluster includes infrared communication device 1, infrared communication device 2, and infrared communication device 3, and infrared communication device 1 acts as the signal sender, the sending behavior of the signal sender is as follows: infrared communication device 1 sends an infrared signal to infrared communication device 2, and after an interval of time t, infrared communication device 1 sends an infrared signal to infrared communication device 3, and after another interval of time t, infrared communication device 1 sends an infrared signal to infrared communication device 2, and so on in a cyclical manner.

[0048] In this way, a preset time window T (T≥(M-1)×t) can be set. Under normal circumstances, each signal receiver will successfully receive at least T÷[(M-1)×t] infrared signals transmitted by other signal transmitters within the preset time window T. Based on this rule, a preset interval range can be determined based on the total number of infrared communication devices in the infrared communication cluster, the signal transmission period of each infrared communication device, and the duration of the preset time window. This preset interval range can represent the range of the number of infrared signals that each infrared communication device can receive when there is no signal loss or signal reflection.

[0049] If the number of infrared signals received by the first infrared communication device is lower than the preset range, it indicates that the target transmission frequency of the first infrared communication device is interfered with, resulting in the complete loss of communication signals. If the number of infrared signals received by the first infrared communication device is higher than the preset range, it indicates that the target transmission frequency of the first infrared communication device may have signal reflection in the environment, and the signal is received multiple times. In this case, the target transmission frequency can be marked as an unreliable frequency, and a notification message can be sent to the second infrared communication device to notify the second infrared communication device that the target transmission frequency is an unreliable frequency, so that the second infrared communication device can actively switch to other unused transmission frequencies.

[0050] In this way, the transmission frequency can be dynamically adjusted by identifying communication reliability, allowing each infrared communication device to communicate using different transmission frequencies at the same time, thus realizing a masterless and highly flexible communication scheme, which greatly improves communication efficiency and anti-interference capability.

[0051] In an optional embodiment, after the above steps of determining whether the number of received infrared signals falls within a preset range, the method further includes: If the number of received infrared signals falls within a preset range, the target transmission frequency is stored in the local storage area of ​​the first infrared communication device, so that the first infrared communication device can directly obtain the target transmission frequency from the local storage area for infrared communication when powered on subsequently.

[0052] Specifically, when the number of infrared signals received by the first infrared communication device falls within the aforementioned preset range, it indicates that the first infrared communication device does not experience signal loss or signal reflection. In this case, the target transmission frequency can be stored in the local storage area of ​​the first infrared communication device. Thus, when the first infrared communication device is powered on subsequently, it can directly obtain the target transmission frequency from the local storage area for infrared communication, thereby improving the communication efficiency of the first infrared communication device.

[0053] In an optional embodiment, the infrared communication method provided in this application can be as follows: Figure 3 As shown, it specifically includes the following steps: Step S301: A certain infrared communication device is powered on and started.

[0054] Step S302: The infrared communication device monitors the transmission frequencies of other infrared communication devices and randomly selects its own transmission frequency.

[0055] When the infrared communication device is powered on for the first time, it first starts listening and randomly selects a transmission frequency, and then checks whether the transmission frequency of other infrared communication devices it is listening to is the same as its own.

[0056] Step S303: Determine whether your own transmission frequency is different from the transmission frequency of other infrared communication devices.

[0057] If its own transmission frequency differs from the transmission frequencies of other infrared communication devices, step S304 is executed; if its own transmission frequency is the same as the transmission frequencies of other infrared communication devices, step S308 is executed. That is, the priority of its own ID is compared with the priority of the other party's ID. If its own ID has a lower priority, the currently selected transmission frequency is abandoned, and a new transmission frequency is randomly selected from the remaining candidate transmission frequencies. During the monitoring process, if it is detected that all transmission frequencies are already used by other high-priority infrared communication devices, and no transmission frequency is available, an alarm mechanism is triggered, prompting that frequency resources need to be expanded or the number of infrared communication devices reduced. In other words, to ensure normal communication for all infrared communication devices, the number of infrared communication devices M must be less than or equal to the number of candidate transmission frequencies N.

[0058] Step S304: Detect the communication quality of the infrared communication device within a preset time window.

[0059] Each infrared communication device actively sends data to other infrared communication devices at fixed time intervals. For example, assuming that the infrared communication cluster includes infrared communication device 1, infrared communication device 2 and infrared communication device 3, and infrared communication device 1 acts as the signal sender, the sending behavior of the signal sender is as follows: infrared communication device 1 sends an infrared signal to infrared communication device 2, after an interval of time t, infrared communication device 1 sends an infrared signal to infrared communication device 3, after another interval of time t, infrared communication device 1 sends an infrared signal to infrared communication device 2, and so on in a cyclical manner.

[0060] In this way, a preset time window T (T≥(M-1)×t) can be set. Under normal circumstances, each signal receiver will successfully receive at least T÷[(M-1)×t] infrared signals transmitted by other signal transmitters within the preset time window T. Based on this rule, a preset interval range can be determined based on the total number of infrared communication devices in the infrared communication cluster, the signal transmission period of each infrared communication device, and the duration of the preset time window. This preset interval range can represent the range of the number of infrared signals that each infrared communication device can receive when there is no signal loss or signal reflection.

[0061] Step S305: Determine whether the communication quality of the infrared communication device is reliable.

[0062] If the number of infrared signals received by the infrared communication device is lower or higher than the preset range, it indicates that the communication quality of the infrared communication device is unreliable. If the number of infrared signals received by the infrared communication device is within the preset range, it indicates that the communication quality of the infrared communication device is reliable.

[0063] Step S306: Store its own transmission frequency.

[0064] If the infrared communication device has reliable communication quality, it can store its own transmission frequency in the local storage space, and directly select the transmission frequency when powered on in subsequent power-ups, avoiding the process of readjusting the transmission frequency.

[0065] Step S307: Mark its own transmission frequency as an unreliable transmission frequency and notify the user to actively switch to another transmission frequency.

[0066] If the communication quality of an infrared communication device is unreliable, it can mark its own transmission frequency as unreliable and share it with other infrared communication devices. Once other infrared communication devices recognize that their transmission frequency is unreliable, they will proactively switch to other unused transmission frequencies.

[0067] Step S308: The low-priority infrared communication device switches to another transmission frequency.

[0068] The above methods enable automatic allocation, dynamic adjustment, and over-limit alarm of the transmission frequency of infrared communication devices. They also feature flexibility and anti-interference capabilities, support flexible expansion and addition of infrared communication devices, and are suitable for infrared communication scenarios with multiple infrared communication devices, such as industrial control and smart homes.

[0069] See Figure 4 , Figure 4 This is a schematic diagram of an infrared communication device provided in an embodiment of this application. Figure 4 As shown, the infrared communication device 400 is any infrared communication device in the infrared communication cluster. The infrared communication device 400 includes: a controller 401 and an infrared transceiver module 402 connected to the controller 401. Among them, the infrared transceiver module 402 is used to transmit and receive infrared signals; The controller 401 is used to execute the steps of the infrared communication method provided in the foregoing method embodiments, and can achieve the same technical effect, which will not be described in detail here.

[0070] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 includes an infrared communication device 400.

[0071] It should be noted that the infrared communication device 400 can implement the steps of the infrared communication method provided in the aforementioned method embodiments and achieve the same technical effect, which will not be elaborated here.

[0072] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the infrared communication method provided in any of the foregoing method embodiments.

[0073] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0074] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0075] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0076] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An infrared communication method, characterized in that, The method, applied to a first infrared communication device, which is any infrared communication device in an infrared communication cluster, includes: S1, when the first infrared communication device is powered on, select any candidate transmission frequency from multiple candidate transmission frequencies as the first transmission frequency of the first infrared communication device itself, and monitor the second transmission frequency of the second infrared communication device, wherein the second infrared communication device is another powered-on infrared communication device in the infrared communication cluster other than the first infrared communication device. S2, determine whether the second transmission frequency includes the first transmission frequency; S3, if the second transmission frequency includes the first transmission frequency, determine whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device; S4, when the first priority is lower than or equal to the second priority, a new transmission frequency is selected from the plurality of candidate transmission frequencies as the first transmission frequency, and steps S2 to S3 are repeated until a preset condition is met, and the currently selected candidate transmission frequency is determined as the target transmission frequency of the first infrared communication device, wherein the preset condition is that the first priority is higher than the second priority. S5, use the target transmission frequency to perform infrared communication with the second infrared communication device.

2. The method according to claim 1, characterized in that, After determining whether the second transmission frequency includes the first transmission frequency, the method further includes: If the second transmission frequency does not include the first transmission frequency, the first transmission frequency is determined as the target transmission frequency.

3. The method according to claim 1, characterized in that, After determining whether the first priority of the first infrared communication device is lower than or equal to the second priority of the second infrared communication device, the method further includes: If the first priority is higher than the second priority, the first transmission frequency is determined as the target transmission frequency.

4. The method according to claim 1, characterized in that, The method further includes: If all candidate transmission frequencies have been selected and the preset conditions are still not met, a prompt message is generated. The prompt message is used to remind the user to expand the candidate transmission frequencies or reduce the number of infrared communication devices in the infrared communication cluster.

5. The method according to claim 1, characterized in that, The step of using the target transmission frequency to perform infrared communication with the second infrared communication device includes: Infrared signals are sequentially transmitted to each of the second infrared communication devices using the target transmission frequency. The infrared signals carry communication data and a check code, and the check code is used to verify the communication data.

6. The method according to claim 1, characterized in that, The method further includes: When using the target transmission frequency to conduct infrared communication with the second infrared communication device, the number of infrared signals received from the second infrared communication device within a preset time window is counted. Determine whether the number of received infrared signals falls within a preset range, wherein the preset range is determined based on the total number of infrared communication devices in the infrared communication cluster, the signal transmission cycle of each infrared communication device, and the duration of the preset time window; If the number of received infrared signals does not fall within the preset range, the target transmission frequency is marked as an unreliable frequency, and a notification message is sent to the second infrared communication device, wherein the notification message is used to notify the second infrared communication device that the target transmission frequency is an unreliable frequency.

7. The method according to claim 6, characterized in that, After determining whether the number of received infrared signals falls within a preset range, the method further includes: If the number of received infrared signals falls within the preset range, the target emission frequency is stored in the local storage area of ​​the first infrared communication device, so that the first infrared communication device can directly obtain the target emission frequency from the local storage area for infrared communication when powered on subsequently.

8. An infrared communication device, characterized in that, The infrared communication device is any infrared communication device in the infrared communication cluster, and the infrared communication device includes: a controller and an infrared transceiver module connected to the controller; The infrared transceiver module is used to transmit and receive infrared signals. The controller is used to execute the infrared communication method according to any one of claims 1-7.

9. An electronic device, characterized in that, The electronic device includes the infrared communication device as described in claim 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the infrared communication method according to any one of claims 1-7.