WO2023045795A1 - 一种红外通讯方法及装置、存储介质及电子装置 - Google Patents

一种红外通讯方法及装置、存储介质及电子装置 Download PDF

Info

Publication number
WO2023045795A1
WO2023045795A1 PCT/CN2022/118372 CN2022118372W WO2023045795A1 WO 2023045795 A1 WO2023045795 A1 WO 2023045795A1 CN 2022118372 W CN2022118372 W CN 2022118372W WO 2023045795 A1 WO2023045795 A1 WO 2023045795A1
Authority
WO
WIPO (PCT)
Prior art keywords
communication terminal
infrared signal
target
infrared
target communication
Prior art date
Application number
PCT/CN2022/118372
Other languages
English (en)
French (fr)
Inventor
王睿麟
杨晓飞
徐银波
Original Assignee
追觅创新科技(苏州)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 追觅创新科技(苏州)有限公司 filed Critical 追觅创新科技(苏州)有限公司
Publication of WO2023045795A1 publication Critical patent/WO2023045795A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/11Arrangements specific to free-space transmission, i.e. transmission through air or vacuum
    • H04B10/114Indoor or close-range type systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/40Circuits
    • H04B1/401Circuits for selecting or indicating operating mode
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the communication field, in particular, to an infrared communication method and device, a storage medium and an electronic device.
  • infrared communication can be used for communication between communication terminals.
  • Infrared communications are susceptible to interference.
  • the problem of interference can be solved by adding a high-frequency carrier and a common infrared protocol.
  • this approach will increase the electronic cost.
  • most of the current protocols are one-way, which cannot complete the two-way interaction of information.
  • the infrared communication method in the related art has the problem of being unable to perform two-way information exchange due to the inability to distinguish two-way infrared signals.
  • the purpose of the present application is to provide an infrared communication method and device, a storage medium and an electronic device to at least solve the problem that the infrared communication method in the related art cannot perform two-way information exchange due to the inability to distinguish two-way infrared signals.
  • an infrared communication method including: sending a first infrared signal to a target communication terminal, wherein the first infrared signal is an infrared signal encoded based on a level duration; Sending a third infrared signal to the target communication terminal when the second infrared signal replied by the target communication terminal based on the first infrared signal is received within the first target duration.
  • the method before sending the first infrared signal to the target communication terminal, the method further includes: determining the target communication mode used for infrared communication with the target communication terminal, wherein the target The communication mode is a communication mode that only allows the target communication terminal to reply after receiving the infrared signal from the communication terminal; according to the target communication mode, the communication terminal is controlled to perform infrared communication with the target communication terminal.
  • the first infrared signal is used to send a header frame, an information frame, and a check frame;
  • the sending the first infrared signal to the target communication terminal includes: passing a high level for a first duration Sending the header frame to the target communication terminal, wherein the header frame is used to indicate the starting position of the first infrared signal; sending the information frame and the verification frame to the target communication terminal , wherein, the first symbol in the information frame and the check frame is sent through the high level signal of the second duration, and the second symbol in the information frame and the check frame is sent through the third duration
  • the low-level signal is sent, and the second duration is different from the third duration.
  • the first infrared signal carries a heartbeat frame; after sending the first infrared signal to the target communication terminal, the method further includes: not receiving the first infrared signal within the first target duration In the case of the infrared signal returned by the target communication terminal based on the first infrared signal, it is determined that the cumulative number of infrared signals returned by the target communication terminal has not been received; when the cumulative number of times is greater than or equal to the target number of times threshold Next, perform a reset operation on the infrared communication with the target communication terminal; if the accumulated number of times is less than the target number of times threshold, update the accumulated number of times, and resend the first infrared signal to the target communication terminal.
  • the first infrared signal carries a target frame, wherein the target frame is used to control the target communication terminal to perform a target operation; after sending the first infrared signal to the target communication terminal , the method further includes: in the case of not receiving the infrared signal replied by the target communication terminal based on the first infrared signal within the first target duration, continuing to send to the target according to the first target duration The communication terminal sends the first infrared signal until receiving an infrared signal replied by the target communication terminal.
  • the sending the third infrared signal to the target communication terminal includes: sending the third infrared signal carrying a heartbeat frame to the target communication terminal.
  • the target communication terminal is a dust collection station
  • the communication terminal that sends the first infrared signal is a host
  • the method further It includes: controlling the host to connect to the charging stand; waiting to receive an indication signal sent by the dust collection station within a second target time period, wherein the indication signal is used to indicate that the host is not in a charging state; In the case of the above indication signal, re-control the connection between the host and the charging stand.
  • an infrared communication device including: a first sending unit, configured to send a first infrared signal to a target communication terminal, wherein the first infrared signal is based on a level An infrared signal encoded with a duration; the second sending unit is configured to communicate with the target when receiving a second infrared signal replied by the target communication terminal based on the first infrared signal within the first target duration end sends a third infrared signal.
  • the device further includes: a first determination unit, configured to determine the target communication used for infrared communication with the target communication terminal before sending the first infrared signal to the target communication terminal mode, wherein the target communication mode is a communication mode that only allows the target communication terminal to reply after receiving the infrared signal of the communication terminal; the first control unit is used to control the communication mode according to the target communication mode The terminal performs infrared communication with the target communication terminal.
  • a first determination unit configured to determine the target communication used for infrared communication with the target communication terminal before sending the first infrared signal to the target communication terminal mode, wherein the target communication mode is a communication mode that only allows the target communication terminal to reply after receiving the infrared signal of the communication terminal
  • the first control unit is used to control the communication mode according to the target communication mode The terminal performs infrared communication with the target communication terminal.
  • the first infrared signal is used to send a header frame, an information frame, and a check frame;
  • the first sending unit includes: a first sending module, configured to pass a first duration of high power send the header frame to the target communication terminal with flat signal, wherein the header frame is used to indicate the starting position of the first infrared signal;
  • the second sending module is used to send the header frame to the target communication terminal An information frame and the verification frame, wherein, the first symbol in the information frame and the verification frame is sent by a high level signal of a second duration, and the information frame and the verification frame The second symbol is sent by a low level signal of a third duration, and the second duration is different from the third duration.
  • the first infrared signal carries a heartbeat frame; the device further includes: a second determining unit, configured to, after sending the first infrared signal to the target communication terminal, In the case that the infrared signal replied by the target communication terminal based on the first infrared signal is not received within a target duration, determine the cumulative number of times that the infrared signal replied by the target communication terminal has not been received; the execution unit is configured to When the cumulative number of times is greater than or equal to the target number of times threshold, perform a reset operation on the infrared communication with the target communication end; the third sending unit is configured to update the accumulated times when the cumulative number of times is less than the target number of times threshold , and resend the first infrared signal to the target communication terminal.
  • a second determining unit configured to, after sending the first infrared signal to the target communication terminal, In the case that the infrared signal replied by the target communication terminal based on the first infrared signal is not received within a target duration
  • the first infrared signal carries a target frame, wherein the target frame is used to control the target communication terminal to perform a target operation; the device further includes: a fourth sending unit, configured to After sending the first infrared signal to the target communication terminal, if the target communication terminal does not receive an infrared signal based on the first infrared signal reply within the first target duration, according to the first The target duration continuously sends the first infrared signal to the target communication terminal until receiving an infrared signal replied by the target communication terminal.
  • a fourth sending unit configured to After sending the first infrared signal to the target communication terminal, if the target communication terminal does not receive an infrared signal based on the first infrared signal reply within the first target duration, according to the first The target duration continuously sends the first infrared signal to the target communication terminal until receiving an infrared signal replied by the target communication terminal.
  • the second sending unit includes; a third sending module, configured to send the third infrared signal carrying a heartbeat frame to the target communication terminal.
  • the target communication terminal is a dust collection station
  • the communication terminal that sends the first infrared signal is a host computer
  • the device also includes: a second control unit, configured to transmit the first infrared signal to the target communication terminal Before sending the first infrared signal, control the host to connect to the charging stand;
  • the receiving unit is used to wait for receiving the indication signal sent by the dust collection station within the second target time length, wherein the indication signal is used to indicate the The main unit is not in the charging state;
  • the third control unit is configured to re-control the connection between the main unit and the charging stand when the indication signal is received.
  • a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is set to execute the above-mentioned infrared communication method when running .
  • an electronic device including a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the above-mentioned processor executes the above-mentioned Infrared communication method.
  • the infrared signal is represented by the duration of the level, and the infrared communication is carried out based on the response mode.
  • the first infrared signal is based on the continuous level of the level.
  • Infrared signal coded by time in the case of receiving the second infrared signal replied by the target communication terminal based on the first infrared signal within the first target duration, the third infrared signal is sent to the target communication terminal, due to the infrared communication based on the response mode , wait for a period of time after sending the infrared signal to the opposite end before sending the next infrared signal, so as to achieve the purpose of distinguishing the two-way infrared signal based on the actual sending of the infrared signal; at the same time, the infrared signal is represented by the duration of the level , without high-frequency carrier, can reduce the hardware cost of infrared communication, and can also reduce the requirements of infrared signal lights, so as to achieve the technical effect of ensuring two-way information interaction between communication terminals and reducing the cost of infrared communication, and then solve the problem of infrared communication in related technologies.
  • the communication method has the problem of being unable to perform two-way information exchange due
  • FIG. 1 is a schematic diagram of a hardware environment of an optional infrared communication method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an optional infrared communication method according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of another optional infrared communication method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another optional infrared communication method according to an embodiment of the present application.
  • FIG. 5 is a structural block diagram of an optional infrared communication device according to an embodiment of the present application.
  • Fig. 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application.
  • an infrared communication method is provided.
  • the above-mentioned infrared communication method may be applied in a hardware environment composed of the first communication terminal 102 and the second communication terminal 104 as shown in FIG. 1 .
  • the first communication terminal 102 first infrared communication terminal
  • the second communication terminal 104 second infrared communication terminal
  • the infrared communication method in the embodiment of the present application may be executed by the first communication terminal 102 , may also be executed by the second communication terminal 104 , or may be jointly executed by the first communication terminal 102 and the second communication terminal 104 .
  • the first communication terminal 102 or the second communication terminal 104 may execute the infrared communication method in the embodiment of the present application by a client installed thereon.
  • FIG. 2 is a schematic flow chart of an optional infrared communication method according to the embodiment of the present application. As shown in FIG. 2 , the method A process can include the following steps:
  • Step S202 sending a first infrared signal to the target communication terminal, wherein the first infrared signal is an infrared signal encoded based on a level duration.
  • the infrared communication method in this embodiment can be applied to the scene of short-distance infrared communication.
  • the above-mentioned infrared communication is a communication method that uses infrared light signals for information transmission.
  • the infrared communication here can be carried out between two infrared communication devices, or between multiple infrared communication devices, which will not be discussed here. limited.
  • the two infrared communication terminals for infrared communication can be respectively referred to as the local communication terminal (eg, the dust collection host terminal, hereinafter referred to as the host) and the target communication terminal (eg, the dust collection base station terminal, hereinafter referred to as the dust collection station).
  • the host here can be a cleaning robot
  • the dust collection station here can be a dust collection bucket.
  • the cleaning robot and the dust collection bucket can communicate through infrared communication, so that the dust collection bucket can confirm the relative position and connection of the cleaning robot and the dust collection bucket. status etc.
  • the communication mode between the above two communication terminals can be a master-slave response mode, or other communication modes. Take the master-slave response mode as an example to illustrate.
  • the communication terminal when the communication terminal is in the sending state, it can encode the infrared signal to be sent to the target communication terminal based on the duration of the level. After the encoding is completed, the communication terminal can send the signal to the target communication terminal. (that is, the first infrared signal), so as to complete the process of information transmission.
  • the encoding of the infrared signal may adopt a manner of binary encoding based on the duration of the level, that is, the duration of the level is used to represent binary 0 and 1.
  • the duration of the level can be limited by setting a level duration value. When the duration of the high level is greater than or equal to the set level duration value, it can be determined that the high level represents 1 in the binary code; when the duration of the low level is less than the set level duration value, it can be determined that the low level represents 0 in the binary code.
  • the carrier can be unnecessary, thereby reducing the hardware cost and the requirement for the infrared signal lamp.
  • the level duration value can be set to 1ms.
  • the high level can be expressed as 1 in the binary code.
  • the duration of the level is less than 1ms, it can be This low level is represented as 0 in binary code.
  • Step S204 Sending a third infrared signal to the target communication terminal when the second infrared signal replied by the target communication terminal based on the first infrared signal is received within the first target duration.
  • the first target duration can be configured as required, and can be 100ms, 150ms, 200ms, or other durations, which are not limited here. Whether the communication terminal and the target communication terminal have completed the infrared communication can be determined by whether the infrared signal replied by the target communication terminal based on the first infrared signal is received within the waiting time.
  • the target communication terminal When the target communication terminal is in the receiving state, it can wait to receive the infrared signal from the communication terminal. If the first infrared signal is received, the target communication terminal can enter the sending state, prepare a reply code, and send the prepared reply code to the communication terminal through the second infrared signal.
  • the first target duration can also be set at the target communication end. If the target communication end has not received the infrared signal sent by the communication end after exceeding the first target duration in the waiting state, it can be considered that this communication has failed, and you can Accumulate one communication failure, and re-enter the receiving state, and enter the next communication.
  • the master communication end it can wait to receive the infrared signal replied by the slave communication end.
  • the slave communication end it can wait to receive The infrared signal sent by the main communication terminal and reply to the received infrared signal.
  • the communication terminal can decode the returned infrared signal to determine that the target communication terminal has successfully received the first infrared signal sent by the communication terminal. Then it is determined that the communication is successful.
  • the communication terminal may send a third infrared signal to the target communication terminal to start a new infrared communication between the communication terminal and the target communication terminal.
  • the third infrared signal and the first infrared signal can be the same infrared signal, that is, both carry the same information and adopt the same encoding method, or they can be different infrared signals, that is, the two carry different information, Alternatively, use a different encoding.
  • the third infrared signal there is no limitation on the third infrared signal in this embodiment.
  • the first infrared signal is sent to the target communication terminal, wherein the first infrared signal is an infrared signal encoded based on the level duration;
  • the third infrared signal is sent to the target communication terminal, which solves the problem that the infrared communication method in the related art cannot perform two-way information interaction due to the inability to distinguish two-way infrared signals, and ensures Two-way information exchange between communication terminals reduces the cost of infrared communication.
  • the above method before sending the first infrared signal to the target communication terminal, the above method further includes:
  • S11 Determine the target communication mode used for infrared communication with the target communication terminal, wherein the target communication mode is a communication mode that only allows the target communication terminal to reply after receiving the infrared signal from the communication terminal;
  • the communication logic of the master-slave response mode can be used to avoid the time period that is prone to interference.
  • the master-slave response mode can ensure that only one communication terminal sends infrared signals at the same time and in the same space, so it can prevent bit error interference during infrared signal transmission.
  • the communication logic may also include response logic, which is used to ensure that the information sent by the communication terminal can be effectively received by the target communication terminal.
  • the communication terminal Before information transmission with the target communication terminal, the communication terminal may first determine the communication mode between the communication terminal and the target communication terminal, that is, the target communication mode.
  • the target communication mode may be a master-slave response mode, that is, a communication mode in which only the target communication terminal is allowed to reply after receiving the infrared signal from the communication terminal.
  • the communication terminal can control the transmission of infrared information between the communication terminal and the target communication terminal according to the determined communication mode.
  • the host computer after confirming that the communication mode between the host computer and the dust collection station is the master-slave response mode, according to the master-slave response mode, the host computer can be set as the master device, and the dust collection station can be determined as the slave device.
  • the host has the initiative to send signals, while the dust collection station is equivalent to the slave, and the dust collection station can respond only after receiving the infrared signal sent by the host.
  • adopting the master-slave response mode to control the communication between the communication terminals can avoid code errors in the process of infrared communication, and improve the accuracy of information interaction in infrared communication.
  • the anti-interference ability is reduced.
  • corresponding processing can be done at the protocol level to ensure the integrity of the information.
  • a header frame and a check frame may be specified in the communication protocol, and an information frame is included in the middle.
  • the first infrared signal may be an infrared signal including a header frame, an information frame and a check frame.
  • sending the first infrared signal to the target communication terminal may include:
  • S21 Send a header frame to the target communication terminal through a high-level signal of a first duration, where the header frame is used to indicate the starting position of the first infrared signal;
  • the start position of the communication can be identified by the header frame.
  • Control information may be carried in the header frame, for example, a pilot code, and the pilot code may remain at a high level for a period of time (that is, the first duration, for example, 3ms) or more.
  • the pilot code may remain at a high level for a period of time (that is, the first duration, for example, 3ms) or more.
  • the communication protocol it can be specified that the pilot code is low when idle. This encoding has no length limit and can be extended indefinitely.
  • the communication terminal may send a header frame to the target communication terminal through the high-level signal of the first duration, and the header frame may be used to indicate the starting position of the first infrared signal.
  • the first infrared signal may also carry an information frame and a check frame.
  • the information frame here can be used to indicate the configuration file of the encoding bit numbers of the header frame, check frame or other frames in the data frame based on the binary coded infrared communication transmission.
  • the specific coding bits of the head frame, tail frame, check frame and other check frames in the transmitted infrared signal encoded in binary can be determined.
  • CRC check Cyclic Redundancy Check, cyclic redundancy check
  • key information can be delivered accurately, and at the same time prevent misoperations caused by protocol errors, further strengthening the strength of the protocol.
  • the check frame can be a check code located at the end of the data frame, which can generate a fixed-digit check code at the end of the data frame through CRC check, and can be used to check errors that may occur during signal transmission. Repeat checking can be added in the communication logic, and the code value transmitted by itself can not be received.
  • the first symbol (for example, 1) in the above-mentioned information frame and check frame can be sent through the high-level signal of the second duration, and the second symbol (for example, 0) can be transmitted through the low-level signal of the third duration send.
  • the second duration is different from the third duration, and the second duration may be greater than or less than the third duration. This is not limited in this embodiment.
  • the header frame and the check frame are specified in the communication protocol, and the information frame is included in the middle.
  • the starting position of the communication is identified through the header frame, and the infrared signal is checked through the check frame, which can ensure the integrity of the infrared communication as a whole. Anti-interference, improve the reliability of infrared communication information interaction.
  • the protocol frames may include common heartbeat frames.
  • the heartbeat frame can be sent in real time to ensure that the exchange delay of the status bit is as low as possible.
  • the heartbeat frame is mainly used to describe the status of the dust collection station, for example, upload the dust collection station Cover button status, upload air pressure alarm, upload health status, etc.
  • lighting effect instructions can be issued to ensure the timeliness of lighting effects.
  • What is carried in the first infrared signal may be a heartbeat frame.
  • the above method further includes:
  • the infrared signal returned by the target communication terminal After sending the first infrared signal to the target communication terminal, if the infrared signal returned by the target communication terminal is not received within the first target duration after sending the first infrared signal, it can be determined that the infrared communication has failed. Communication failures may be accidental (for example, communication failures not caused by equipment failures or abnormal connections), or may be caused by equipment failures or abnormal connections. In order to ensure the reliability of the communication, after the communication failure is determined, the infrared communication with the target communication terminal can be directly reset.
  • the number of communication failures can be counted, and when the number of communication failures reaches a set number threshold (that is, the target number of times threshold), the infrared communication with the target communication terminal is executed Reset operation.
  • the communication terminal can determine the cumulative number of infrared signals that have not received the reply from the target communication terminal, which can be the original cumulative number of times (without adding the current round of communication failure), or it can be the original cumulative number of times. The value obtained by adding 1 to the cumulative number of times (plus the current round of communication failure).
  • the infrared communication with the target communication terminal can be reset; otherwise, the first infrared signal can be sent to the target communication terminal again.
  • the current cumulative count can also be updated, for example, an operation of adding 1 is performed.
  • the operation of updating the cumulative number of times is only performed once in each round of communication failure, and may be performed before determining whether the target number of times threshold is reached, or after determining whether the target number of times threshold is reached, which is not discussed in this embodiment. Do limited.
  • the cumulative number of communication failure thresholds may be set to 20 times. When the cumulative number of communication failures reaches 20 times, reset the infrared communication of the communication terminal; when the cumulative number of communication failures is less than 20 times, perform an update operation on the current cumulative number of failures, and re-send the infrared signal to the target communication terminal.
  • the protocol frames may include key protocol frames.
  • protocol frames can be divided into two categories, which are common heartbeat frames and key protocol frames.
  • the key protocol frame can be responsible for the key actions of the communication terminal, and the information may affect the essential function of the target communication terminal. Therefore, the key protocol frame cannot be lost.
  • key protocol frames can be responsible for key actions of the host, such as dust collection and barometer. The key protocol frame is only sent sometimes, you can check whether the sending is successful, then the bus will be released if it is successful, and other frames (for example, heartbeat frames) will continue to be sent, otherwise it will continue to be sent until the verification times out.
  • the first infrared signal may carry a target frame, where the target frame may be used to control the target communication end to perform a target operation, which may be the aforementioned key protocol frame.
  • the above method further includes:
  • the communication terminal receives the infrared signal returned by the target communication terminal Before, the first infrared signal can be continuously sent to the target communication terminal.
  • the communication terminal may also stop sending the first infrared signal to the target communication terminal after the verification timeout, and send prompt information through the communication terminal or a terminal device associated with the communication terminal to remind the communication terminal
  • the infrared communication with the target communication terminal is abnormal.
  • the reliability and stability of infrared communication can be guaranteed by continuously sending infrared signals carrying key protocol frames to the target communication terminal until receiving the infrared signal replied by the target communication terminal.
  • sending the third infrared signal to the target communication terminal may include;
  • the communication end can send the first frame that carries the heartbeat frame to the target communication end.
  • the first infrared signal and the third infrared signal are different infrared signals.
  • the infrared signal carrying the ordinary heartbeat frame is restarted to ensure the reliability of the communication between the communication terminal and the target communication terminal.
  • the target communication terminal is a dust collection station
  • the communication terminal that sends the first infrared signal is a host
  • the infrared communication performed is an infrared communication between the host and the dust collection station. It can be executed after the host is powered on, or it can be executed when it is in a specific state. The specific state can be the working state of the host, or the low power state of the host, or other states.
  • the above method before sending the first infrared signal to the target communication terminal, the above method further includes:
  • control host is connected to the charging stand
  • the host before the information exchange between the host and the dust collection station starts, the host can be controlled to connect to the charging stand on the dust collection station, so that the host is in a charging state.
  • the control chip on it can control the host to be connected to the charging stand, and the charging stand can be located on the dust collection station or at other locations, which is not limited in this embodiment.
  • the host may wait to receive an indication signal sent by the dust collection station within the second target time period, that is, a signal for indicating that the host is not in a charging state.
  • the dust collection station can continue to send the above indication information, for example, send the above indication information every second target time, until it is determined that the host has been recharged, that is, it is determined that the host has been charged seat.
  • the second target duration here may be a preconfigured duration, which may be the same as or different from the first target duration.
  • the indication signal here can be used to indicate that the host is in an uncharged state. After receiving the instruction signal sent by the dust collection station, the host can re-control the host to connect with the charging stand, so that the host is in the charging state.
  • the dust collection station can continue to send codes and wait for the host to recharge.
  • the control chip of the host can control the charging stand on it, and then determine whether the dust collection station stops sending codes, so as to determine whether the connection with the charging stand is successful. If the dust collection station does not stop sending codes, the control chip of the host can re-control the charging stand on it.
  • the accuracy of the control of the host can be improved, the normal function of the work between the host and the dust collection station can be ensured, and the stability of infrared communication can be improved.
  • the infrared communication method in this embodiment will be explained below in combination with optional examples.
  • a dust collection infrared communication solution is provided.
  • the communication terminal is the host computer, and the target communication terminal is the dust collection station.
  • the communication status between the host and the dust collection station can be divided into the following four types: sending status, receiving status, timeout status and waiting status.
  • the flow of the infrared communication method in this optional example may include the following steps:
  • Step S302 judging whether the host is on the charging stand, if yes, execute step S304, otherwise, execute step S302;
  • Step S304 judging whether the code sending by the dust collection station is stopped, if yes, execute step S306, otherwise, execute step S302;
  • Step S306 receiving the infrared code sent by the dust collection station and writing it into the buffer
  • Step S308 performing infrared communication with the dust collection station.
  • the communication mode used for infrared communication between the host and the dust collection station can be the master-slave response mode, which involves switching between the above four states:
  • the host is first in the sending state, and sends infrared signals. If there is a special frame written, it sends a feature frame, otherwise, it sends a heartbeat frame, and then enters the receiving state;
  • the host waits for 100ms to determine whether it has received the reply signal from the dust collection station. If it is received, it will decode and enter the sending state, otherwise, enter the timeout state;
  • the host In the timeout state, the host accumulatively fails to communicate once, and judges whether the failure exceeds 20 times, if yes, enters the waiting state, otherwise, enters the sending state;
  • the host In the waiting state, the host resets the entire communication (ie, infrared communication).
  • the flow of the infrared communication method in this optional example may include the following steps:
  • Step S402 continue to send codes and wait for the machine (that is, the host) to recharge;
  • Step S404 determine whether the machine is on the charging stand, if yes, execute step S406, otherwise, execute step S402;
  • Step S406 stop sending codes and enter the communication state
  • Step S408 performing infrared communication with the machine.
  • the communication mode used for infrared communication between the dust collection station and the host can be the master-slave response mode, which involves switching between the above four states:
  • the dust collection station is in the receiving state first, wait for 100ms, determine whether it has received the infrared signal sent by the host, if so, decode it, and prepare the reply code, enter the sending state, otherwise, enter the timeout state;
  • the dust collection station sends the code in the buffer (that is, the prepared reply code) to the host and enters the receiving state;
  • the dust collection station In the timeout state, the dust collection station has accumulated one communication failure, and judges whether the failure exceeds 20 times, if yes, enters the waiting state, otherwise, enters the sending state;
  • the dust collection station In the waiting state, the dust collection station resets the entire communication (ie, infrared communication).
  • the infrared communication circuit can be simplified.
  • the infrared anti-interference and error code can be guaranteed through a custom communication mechanism.
  • the infrared two-way communication in a small space can be completed. The integrity of the information delivery, and the amount of data is sufficient to complete the information exchange between the host and the dust collection station.
  • FIG. 5 is a structural block diagram of an optional infrared communication device according to an embodiment of the present application. As shown in Fig. 5, the device may include:
  • the first sending unit 502 is used to send the first infrared signal to the target communication terminal, wherein the first infrared signal is an infrared signal encoded based on the level duration;
  • the second sending unit 504 is connected to the first sending unit 502, and is used to send a third infrared signal to the target communication terminal when the second infrared signal replied by the target communication terminal based on the first infrared signal is received within the first target duration. Signal.
  • first sending unit 502 in this embodiment may be used to perform the above step S202
  • second sending unit 504 in this embodiment may be used to perform the above step S204.
  • the first infrared signal is sent to the target communication terminal, wherein the first infrared signal is an infrared signal encoded based on the level duration; within the first target duration, the target communication terminal receives the reply based on the first infrared signal
  • the third infrared signal is sent to the target communication terminal, which solves the problem that the infrared communication method in the related art cannot carry out two-way information interaction due to the inability to distinguish two-way infrared signals, and ensures that communication between communication terminals Two-way information exchange reduces the cost of infrared communication.
  • the above-mentioned device also includes:
  • the first determining unit is used to determine the target communication mode used for infrared communication with the target communication terminal before sending the first infrared signal to the target communication terminal, wherein the target communication mode is to only allow the target communication terminal to receive the communication The communication mode of replying after the infrared signal from the terminal;
  • the first control unit is used to control the infrared communication between the communication terminal and the target communication terminal according to the target communication mode.
  • the first infrared signal is used to send a header frame, an information frame and a check frame;
  • the first sending unit includes:
  • the first sending module is configured to send a header frame to the target communication terminal through a high-level signal of a first duration, wherein the header frame is used to indicate the starting position of the first infrared signal;
  • the second sending module is used to send an information frame and a verification frame to the target communication terminal, wherein the first symbol in the information frame and the verification frame is sent by a high level signal of the second duration, and the information frame and the verification frame The second symbol in is sent by a low-level signal of a third duration, and the second duration is different from the third duration.
  • the first infrared signal carries a heartbeat frame; the above-mentioned device also includes:
  • the second determining unit is used to determine that the target communication has not been received when the target communication terminal does not receive an infrared signal based on the first infrared signal reply within the first target duration after sending the first infrared signal to the target communication terminal The cumulative number of infrared signals returned by the terminal;
  • the execution unit is used to perform a reset operation on the infrared communication with the target communication terminal when the cumulative number of times is greater than or equal to the target number of times threshold;
  • the third sending unit is configured to update the accumulated times and re-send the first infrared signal to the target communication terminal when the accumulated times are less than the target times threshold.
  • the first infrared signal carries a target frame, wherein the target frame is used to control the target communication terminal to perform a target operation; the above-mentioned device further includes:
  • the fourth sending unit is configured to, after sending the first infrared signal to the target communication terminal, if the infrared signal replied by the target communication terminal based on the first infrared signal is not received within the first target duration, continue according to the first target duration Sending the first infrared signal to the target communication terminal until receiving an infrared signal replied by the target communication terminal.
  • the second sending unit includes;
  • the third sending module is configured to send the third infrared signal carrying the heartbeat frame to the target communication terminal.
  • the target communication terminal is a dust collection station, and the communication terminal that sends the first infrared signal is a host; the above-mentioned device also includes:
  • the second control unit is used to control the connection between the host computer and the charging stand before sending the first infrared signal to the target communication terminal;
  • the receiving unit is configured to wait to receive an indication signal sent by the dust collection station within a second target time period, wherein the indication signal is used to indicate that the host is not in a charging state;
  • the third control unit is used to re-control the connection between the main unit and the charging stand when the indication signal is received.
  • the above modules can run in the hardware environment shown in FIG. 1 , and can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
  • a storage medium is also provided.
  • the above-mentioned storage medium may be used to execute the program code of any one of the above-mentioned infrared communication methods in the embodiments of the present application.
  • the foregoing storage medium may be located on at least one network device among the plurality of network devices in the network shown in the foregoing embodiments.
  • the storage medium is configured to store program codes for performing the following steps:
  • the above-mentioned storage medium may include, but not limited to, various media capable of storing program codes such as a U disk, ROM, RAM, removable hard disk, magnetic disk, or optical disk.
  • an electronic device for implementing the above infrared communication method is also provided, and the electronic device may be a server, a terminal, or a combination thereof.
  • Fig. 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application. 604 and memory 606 complete mutual communication through communication bus 608, wherein,
  • memory 606 for storing computer programs
  • the communication bus may be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus, or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus, etc.
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 6 , but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the electronic device and other devices.
  • the above-mentioned memory may include RAM, and may also include non-volatile memory (non-volatile memory), for example, at least one disk memory.
  • non-volatile memory non-volatile memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • the memory 606 may include, but is not limited to, the first sending unit 502 and the second sending unit 504 in the infrared communication device. In addition, it may also include but not limited to other module units in the above-mentioned infrared communication device, which will not be repeated in this example.
  • the processor can be a general-purpose processor, which can include but not limited to: CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor), etc.; it can also be DSP (Digital Signal Processing, Digital Signal Processor), ASIC (Application Specific Integrated Circuit, Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit, central processing unit
  • NP Network Processor, network processor
  • DSP Digital Signal Processing, Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array, Field Programmable Gate Array
  • other programmable logic devices discrete gate or transistor logic devices, discrete hardware components.
  • the device implementing the above-mentioned infrared communication method can be a terminal device, and the terminal device can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, Handheld computers and mobile Internet devices (Mobile Internet Devices, MID), PAD and other terminal equipment.
  • FIG. 6 does not limit the structure of the above-mentioned electronic device.
  • the electronic device may also include more or less components than those shown in FIG. 6 (such as a network interface, a display device, etc.), or have a different configuration from that shown in FIG. 6 .
  • the integrated units in the above embodiments are realized in the form of software function units and sold or used as independent products, they can be stored in the above computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium.
  • Several instructions are included to make one or more computer devices (which may be personal computers, servers or network devices, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the disclosed client can be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

Abstract

本申请提供了一种红外通讯方法及装置、存储介质及电子装置,上述方法包括:向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号。采用上述技术方案,解决了相关技术中的红外通讯方式存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题。

Description

一种红外通讯方法及装置、存储介质及电子装置
本申请要求如下专利申请的优先权:于2021年09月23日提交中国专利局、申请号为202111116387.3、发明名称为“一种红外通讯方法及装置、存储介质及电子装置”的中国专利申请,上述专利申请的全部内容通过引用结合在本申请中。
【技术领域】
本申请涉及通信领域,具体而言,涉及一种红外通讯方法及装置、存储介质及电子装置。
【背景技术】
目前,通讯端之间可以采用红外通讯的方式进行通讯。红外通讯易受到干扰。相关技术中,可以采用加入高频载波和通用的红外协议来解决干扰的问题。然而,但这种方式会增加电子成本。并且,为了由于双向的红外信号之间存在干扰导致无法区分红外信号,当前的协议大多数都是单向的,无法完成信息的双向交互。
由此可见,相关技术中的红外通讯方式,存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题。
【发明内容】
本申请的目的在于提供一种红外通讯方法及装置、存储介质及电子装置,以至少解决相关技术中的红外通讯方式存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题。
本申请的目的是通过以下技术方案实现:
根据本申请实施例的一个方面,提供了一种红外通讯方法,包括:向目标通讯端发送第一红外信号,其中,所述第一红外信号是基于电平持续时间进行编码的红外信号;在第一目标时长内接收到所述目标通讯端基于所述第一红外信号回复的第二红外信号的情况下,向所述目标通讯端发送第三红外信号。
在一个示例性实施例中,在所述向目标通讯端发送第一红外信号之前,所述方法还包括:确定与所述目标通讯端进行红外通讯所采用的目标通讯 模式,其中,所述目标通讯模式为仅允许所述目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式;按照所述目标通讯模式控制所述本通讯端与所述目标通讯端进行红外通讯。
在一个示例性实施例中,所述第一红外信号用于发送头帧、信息帧和校验帧;所述向目标通讯端发送第一红外信号,包括:通过第一持续时间的高电平信号向所述目标通讯端发送所述头帧,其中,所述头帧用于指示所述第一红外信号的起始位置;向所述目标通讯端发送所述信息帧和所述校验帧,其中,所述信息帧和所述校验帧中的第一符号通过第二持续时间的高电平信号发送,所述信息帧和所述校验帧中的第二符号通过第三持续时间的低电平信号发送,所述第二持续时间与所述第三持续时间为不同的时间。
在一个示例性实施例中,所述第一红外信号携带有心跳帧;在所述向目标通讯端发送第一红外信号之后,所述方法还包括:在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,确定未接收到所述目标通讯端回复的红外信号的累计次数;在所述累计次数大于或者等于目标次数阈值的情况下,对与所述目标通讯端的红外通讯执行复位操作;在所述累计次数小于目标次数阈值的情况下,更新所述累计次数,并重新向所述目标通讯端发送所述第一红外信号。
在一个示例性实施例中,所述第一红外信号携带有目标帧,其中,所述目标帧用于控制所述目标通讯端执行目标操作;在所述向目标通讯端发送第一红外信号之后,所述方法还包括:在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,按照所述第一目标时长持续向所述目标通讯端发送所述第一红外信号,直到接收到所述目标通讯端回复的红外信号。
在一个示例性实施例中,所述向所述目标通讯端发送第三红外信号,包括;向所述目标通信端发送携带有心跳帧的所述第三红外信号。
在一个示例性实施例中,所述目标通讯端为集尘站,发送所述第一红外信号的本通讯端为主机;在所述向目标通讯端发送第一红外信号之前,所述方法还包括:控制所述主机与充电座连接;在第二目标时长内等待接 收所述集尘站发送的指示信号,其中,所述指示信号用于指示所述主机未处于充电状态;在接收到所述指示信号的情况下,重新控制所述主机与所述充电座连接。
根据本申请实施例的另一个方面,还提供了一种红外通讯装置,包括:第一发送单元,用于向目标通讯端发送第一红外信号,其中,所述第一红外信号是基于电平持续时间进行编码的红外信号;第二发送单元,用于在第一目标时长内接收到所述目标通讯端基于所述第一红外信号回复的第二红外信号的情况下,向所述目标通讯端发送第三红外信号。
在一个示例性实施例中,所述装置还包括:第一确定单元,用于在所述向目标通讯端发送第一红外信号之前,确定与所述目标通讯端进行红外通讯所采用的目标通讯模式,其中,所述目标通讯模式为仅允许所述目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式;第一控制单元,用于按照所述目标通讯模式控制所述本通讯端与所述目标通讯端进行红外通讯。
在一个示例性实施例中,所述第一红外信号用于发送头帧、信息帧和校验帧;所述第一发送单元包括:第一发送模块,用于通过第一持续时间的高电平信号向所述目标通讯端发送所述头帧,其中,所述头帧用于指示所述第一红外信号的起始位置;第二发送模块,用于向所述目标通讯端发送所述信息帧和所述校验帧,其中,所述信息帧和所述校验帧中的第一符号通过第二持续时间的高电平信号发送,所述信息帧和所述校验帧中的第二符号通过第三持续时间的低电平信号发送,所述第二持续时间与所述第三持续时间为不同的时间。
在一个示例性实施例中,所述第一红外信号携带有心跳帧;所述装置还包括:第二确定单元,用于在所述向目标通讯端发送第一红外信号之后,在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,确定未接收到所述目标通讯端回复的红外信号的累计次数;执行单元,用于在所述累计次数大于或者等于目标次数阈值的情况下,对与所述目标通讯端的红外通讯执行复位操作;第三发送单元,用于在累计次数小于目标次数阈值的情况下,更新所述累计次数,并重新 向所述目标通讯端发送所述第一红外信号。
在一个示例性实施例中,所述第一红外信号携带有目标帧,其中,所述目标帧用于控制所述目标通讯端执行目标操作;所述装置还包括:第四发送单元,用于在所述向目标通讯端发送第一红外信号之后,在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,按照所述第一目标时长持续向所述目标通讯端发送所述第一红外信号,直到接收到所述目标通讯端回复的红外信号。
在一个示例性实施例中,所述第二发送单元包括;第三发送模块,用于向所述目标通信端发送携带有心跳帧的所述第三红外信号。
在一个示例性实施例中,目标通讯端为集尘站,发送所述第一红外信号的本通讯端为主机;所述装置还包括:第二控制单元,用于在所述向目标通讯端发送第一红外信号之前,控制所述主机与充电座连接;接收单元,用于在第二目标时长内等待接收所述集尘站发送的指示信号,其中,所述指示信号用于指示所述主机未处于充电状态;第三控制单元,用于在接收到所述指示信号的情况下,重新控制所述主机与所述充电座连接。
根据本申请实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述红外通讯方法。
根据本申请实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的红外通讯方法。
在本申请实施例中,采用电平持续时间长短来表示红外信号、并基于应答模式进行红外通信的方式,通过向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号,由于基于应答模式进行红外通信,在向对端发送红外信号之后等待一段时间之后再发送下一个红外信号,从而实现基于红外信号的发送实际即可区分双向的红外信号的目的;同时,通过电平持续时间长短来表示红外信号,无需高频载波,可以降低红外通讯的 硬件成本,也可以降低红外信号灯的要求,从而可以达到保证通讯端之间的双向信息交互、降低红外通讯成本的技术效果,进而解决相关技术中的红外通讯方式存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题。
【附图说明】
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是根据本申请实施例的一种可选的红外通讯方法的硬件环境的示意图;
图2是根据本申请实施例的一种可选的红外通讯方法的流程示意图;
图3是根据本申请实施例的另一种可选的红外通讯方法的流程示意图;
图4是根据本申请实施例的又一种可选的红外通讯方法的流程示意图;
图5是根据本申请实施例的一种可选的红外通讯装置的结构框图;
图6是根据本申请实施例的一种可选的电子装置的结构框图。
【具体实施方式】
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
根据本申请实施例的一个方面,提供了一种红外通讯方法。可选地,在本实施例中,上述红外通讯方法可以应用于如图1所示的由第一通讯端102和第二通讯端104所构成的硬件环境中。如图1所示,第一通讯端102(第一红外通讯端)可以与第二通信端104(第二红外通讯端)之间可以具有绑定关系,两者可以进行红外通讯。
本申请实施例的红外通讯方法可以由第一通讯端102来执行,也可以由第二通讯端104来执行,还可以是由第一通讯端102和第二通讯端104共同执行。其中,第一通讯端102或者第二通讯端104执行本申请实施例的红外通讯方法也可以是由安装在其上的客户端来执行。
以由第一通讯端102来执行本实施例中的红外通讯方法为例,图2是根据本申请实施例的一种可选的红外通讯方法的流程示意图,如图2所示,该方法的流程可以包括以下步骤:
步骤S202,向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号。
本实施例中的红外通讯方法可应用于短距离的红外通讯的场景。上述的红外通讯为利用红外光信号进行信息传输的一种通讯方式,这里的红外通讯可以在两个红外通讯设备之间进行的,也可以在多个红外通讯设备之间进行,在此不做限定。进行红外通讯的两个红外通讯端可以分别称为本通讯端(如,集尘主机端,以下简称为主机)与目标通讯端(如,集尘基站端,以下简称为集尘站)。例如,这里的主机可以是清洁机器人,这里的集尘站可以是集尘桶。当连接到充电座上、执行清扫、或者实时反馈机身电量状态时,清洁机器人与集尘桶可以采用红外通讯的方式进行通讯,以便集尘桶确认清洁机器人与集尘桶的相对位置、连接状态等。上述两个通讯端之间的通讯模式可以是主从应答模式,也可以是其他通讯模式,本实施例中以本通讯端(例如,主机)和目标通讯端(例如,集尘站)之间的主从应答模式为例进行说明。
在本实施例中,本通讯端在处于发送状态的情况下,可以基于电平持续时间长短对要发送给目标通讯端的红外信号进行编码,编码完成后本通讯端可以向目标通讯端发送该信号(即,第一红外信号),以此完成信息传输的过程。
对红外信号进行编码可以采用基于电平持续时间长短进行二进制编码的方式,即,采用电平持续时间长短来表示二进制的0和1。可以通过设定一个电平持续时间值来限定电平的持续时间长短。当高电平的持续时间大于或等于设定的电平持续时间值时,可以确定该高电平表示的是二进制码 中的1;当低电平的持续时间小于设定的电平持续时间值时,可以确定该低电平表示的是二进制码中的0。通过上述编码方式,可以不需要载波,从而降低了硬件成本,也降低了对红外信号灯的要求。
例如,可以将电平持续时间值设置为1ms,当电平的持续时间大于或等于1ms时,就可以将该高电平表示为二进制码中的1,当电平持续时间小于1ms时,可以将该低电平表示为二进制码中的0。
步骤S204,在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号。
在本实施例中,为了确认本通讯端向目标通讯端发送的红外信号是否被目标通讯端成功接收到,同时为了避免信号感染,可以在发送完第一红外信号等待一段时间(即,第一目标时长),确定是否接收到目标通讯端基于该第一红外信号回复的红外信号。这里,第一目标时长可以根据需要进行配置,其可以为100ms、150ms、200ms、或其他时长,在此不做限定。通过在等待时长内是否接收到目标通讯端基于第一红外信号回复的红外信号,可以确定本通讯端与目标通讯端是否完成本次红外通讯。
目标通讯端在处于接收状态时,可以等待接收本通讯端方的红外信号。如果接收到第一红外信号,目标通讯端可以进入到发送状态,并准备回复码,通过第二红外信号将准备的回复码发送给本通讯端。
可选地,在目标通讯端也可以设置第一目标时长,如果目标通讯端在等待状态下超过第一目标时长仍未接收到本通讯端发送的红外信号,则可以认为本次通讯失败,可以累计一次通讯失败,并重新进入到接收状态,进入到下一次通讯。
例如,可以将通讯等待时间设置为100ms,在100ms内等待接收到对端发送的红外信号,对于主通讯端,其可以等待接收从通讯端回复的红外信号,对于从通讯端,其可以等待接收主通讯端发送的红外信号,并对接收到的红外信号进行回复。
如果在第一目标时长内接收到目标通讯端回复的第二红外信号,本通讯端可以对回复的该红外信号进行解码,确定目标通讯端已成功接收到本通讯端发送的第一红外信号,进而确定本次通讯成功。
在本实施例中,在完成一次红外通讯之后,本通讯端可以向目标通信端发送第三红外信号,开启本通信端与目标通信端之间新一次的红外通讯。这里,第三红外信号与第一红外信号可以是相同的红外信号,即,两者携带相同的信息,采用相同的编码方式,也可以是不同的红外信号,即,两者携带不同的信息,或者,采用不同的编码方式。本实施例中对于第三红外信号不做限定。
通过上述步骤S202至步骤S204,向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号,解决了相关技术中的红外通讯方式存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题,保证了通讯端之间的双向信息交互,降低了红外通讯成本。
在一个示例性实施例中,在向目标通讯端发送第一红外信号之前,上述方法还包括:
S11,确定与目标通讯端进行红外通讯所采用的目标通讯模式,其中,目标通讯模式为仅允许目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式;
S12,按照目标通讯模式控制本通讯端与目标通讯端进行红外通讯。
由于红外通讯的特性,红外通讯抗干扰能力较差,在相邻空间内,红外会互相串扰,导致通讯失败。为了避免红外信号传输时出现干扰,可以采用主从应答模式的通讯逻辑,以规避易干扰的时间段。主从应答模式可以保证在同一个时间、同一空间内只有一个通讯端进行红外信号的发送,因此可以防止红外信号传输时出现的误码干扰。此外,通讯逻辑还可以包括应答逻辑,用来保证本通讯端下发的信息能够有效的被目标通讯端接收。
在与目标通讯端之间进行信息传输之前,本通讯端可以首先确定本通讯端与目标通讯端之间的通讯模式,即,目标通讯模式。目标通讯模式可以是主从应答模式,即,只允许目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式。本通讯端可以根据确定的通讯模式控制本通讯端与目标通讯端之间的红外信息的传输。
例如,在确认主机与集尘站之间的通讯模式为主从应答模式之后,根据该主从应答模式可以将主机设置为主设备,将集尘站确定为从设备。主机具有发送信号的主动权,而集尘站相当于从机,集尘站在接收到主机发送的红外信号之后才可以做出回复。
通过本实施例,采用主从应答模式控制通讯端之间的通讯,可以避免在红外通过程中出现误码,提升红外通讯中信息交互的准确性。
在一个示例性实施例中,由于编码没有了载波,抗干扰能力下降。为了增强红外通讯的抗干扰性,保证传输的信息的完整性,可以在协议层面上做对应的处理来保证信息的完整性。在本实施例中,可以在通讯协议中规定头帧和校验帧,中间包含信息帧。第一红外信号可以为包含头帧、信息帧和校验帧的红外信号。对应地,向目标通讯端发送第一红外信号可以包括:
S21,通过第一持续时间的高电平信号向目标通讯端发送头帧,其中,头帧用于指示第一红外信号的起始位置;
S22,向目标通讯端发送信息帧和校验帧,其中,信息帧和校验帧中的第一符号通过第二持续时间的高电平信号发送,信息帧和校验帧中的第二符号通过第三持续时间的低电平信号发送,第二持续时间与第三持续时间为不同的时间。
在本实施例中,可以通过头帧来标识通讯的起始位置。在头帧中可以携带控制信息,例如,引导码,该引导码可以保持高电平持续一段时间(即,第一持续时间,例如,3ms)以上。并且,在通讯协议中可以在规定引导码的同时规定空闲时为低电平。此编码无长度限制,可无限加长。对于本次通讯,本通讯端可以通过第一持续时间的高电平信号向目标通讯端发送头帧,该头帧可以用于指示第一红外信号的起始位置。
在发送完头帧之后,第一红外信号中还可以携带信息帧与校验帧。这里的信息帧可以用于指示基于二进制编码的红外通讯传输的数据帧中头帧、校验帧或其他帧的编码位号的配置文件。通过信息帧中的编码信息,可以确定出传输的以二进制进行编码的红外信号中数据帧中的头帧、尾帧、校验帧及其他校验帧的具体编码位。
对于校验帧,考虑到红外通讯本身相当于单线半双工的通讯方式,可以采用主从通讯模式,同时也不可避免的存在短暂延时。为了防止延时造成的通讯丢失,可以信息的末尾添加CRC校验(Cyclic Redundancy Check,循环冗余校验),在通讯过程中会对关键信息进行重复校验,来保证整体的抗干扰性,确保关键信息可以准确送达,同时也防止因为协议的误码造成的误动作,进一步加强协议的强度。
这里,校验帧可以是位于数据帧末尾的校验码,可以通过CRC校验,在数据帧末尾产生固定位数的校验码,可以用于校验信号传输时可能发生的错误。在通讯逻辑中可以加入重复校验,可以对于自身发射的码值不予以接收。
上述的信息帧和校验帧中的第一符号(例如,1)可以通过第二持续时间的高电平信号发送,第二符号(例如,0)可以通过第三持续时间的低电平信号发送。第二持续时间与第三持续时间为不同的时间,第二持续时间可以大于第三持续时间,也可以小于第三持续时间。本实施例中对此不做限定。
通过本实施例,在通讯协议中规定头帧和校验帧,中间包含信息帧,通过头帧标识通讯的起始位置,并通过校验帧对红外信号进行校验,可以保证红外通讯整体的抗干扰性,提高红外通讯信息交互的可靠性。
在一个示例性实施例中,协议帧可以包括普通心跳帧。心跳帧可以是实时发送的,以确保状态位的交换延迟尽可能的低,对于主机和集尘站之间的红外通信,心跳帧主要用于描述集尘站的状态,例如,上传集尘站盖按键的状态,上传气压报警,上传健康状态等。同时,可以下发灯效指令,以确保灯效的时效性。第一红外信号中携带的可以是心跳帧。通过实时发送携带心跳帧的红外信号,可以对目标通信端的实时接收状态进行监测,增强通讯端之间的交互性。
在本实施例中,在向目标通讯端发送第一红外信号之后,上述方法还包括:
S31,在第一目标时长内未接收到目标通讯端基于第一红外信号回复的红外信号的情况下,确定未接收到目标通讯端回复的红外信号的累计次数;
S32,在累计次数大于或者等于目标次数阈值的情况下,对与目标通讯端的红外通讯执行复位操作;
S33,在累计次数小于目标次数阈值的情况下,更新累计次数,并重新向目标通讯端发送第一红外信号。
在向目标通讯端发送第一红外信号之后,在发送第一红外信号之后的第一目标时长内如果未接收到目标通讯端回复的红外信号,可以确定本次红外通讯失败。通讯失败可能是偶然的(例如,非设备故障或者连接异常导致的通讯失败),也可能是因为设备故障或者连接异常导致的。为了保证通讯的可靠性,可以在确定通讯失败之后,直接对与目标通讯端的红外通讯执行复位操作。
可选地,为了保证通讯的及时性,可以对通讯失败的次数进行统计,并在通讯失败的次数达到设定的次数阈值(即,目标次数阈值)时,才对与目标通讯端的红外通讯执行复位操作。在确定本次红外通讯失败之后,本通讯端可以确定未接收到目标通讯端回复的红外信号的累计次数,其可以是原有的累计次数(不加本轮通讯失败),也可以是在原有的累计次数的基础上加1所得到的值(加上本轮通讯失败)。
如果累计次数达到目标次数阈值,可以对与目标通讯端的红外通讯执行复位操作,否则,可以重新向目标通讯端发送第一红外信号。此外,还可以对当前的累计次数进行更新,例如,执行加1操作。这里,更新累计次数的操作在每轮通讯失败仅执行一次,可以是在确定是否达到目标次数阈值之前执行的,也可以是在确定是否达到目标次数阈值之后执行的,本实施例中对此不做限定。
例如,可以将通讯失败的累计次数阈值设置为20次。在通讯失败累计次数达到20次时,将本通讯端的红外通讯执行复位操作;在通讯累计次数小于20次时,对当前的失败累计次数执行更新操作,并重新向目标通讯端发送红外信号。
通过本实施例,通过对通讯失败的次数进行累计,可以避免由于偶然的通讯失败对红外通讯执行复位的情况,可以提高红外通讯的稳定性和及时性。
在一个示例性实施例中,协议帧可以包括关键协议帧。例如,协议帧可以分为两大类,分别为普通心跳帧和关键协议帧。关键协议帧可以负责本通讯端的关键动作,这些信息可能会影响到目标通讯端的本质功能,因此,关键协议帧是不能丢包的。对于主机,关键协议帧可以负责主机关键动作,如集尘和气压计。关键协议帧是在有时才会发送,可以检查是否发送成功,成功了才会释放掉总线,让其他帧(例如,心跳帧)继续发送,否则一直持续发送,直到验证超时。
对于第一红外信号,该第一红外信号可以携带有目标帧,这里的目标帧可以用于控制目标通讯端执行目标操作,其可以是前述关键协议帧。对应地,在向目标通讯端发送第一红外信号之后,上述方法还包括:
S41,在第一目标时长内未接收到目标通讯端基于第一红外信号回复的红外信号的情况下,按照第一目标时长持续向目标通讯端发送第一红外信号,直到接收到目标通讯端回复的红外信号。
在本实施例中,如果第一红外信号中携带的是目标帧,如果在第一目标时长内未接收到的目标通讯端回复的红外信号,本通讯端在接收到目标通讯端回复的红外信号之前,可以向目标通讯端持续发送该第一红外信号。
可选地,本通讯端也可以在验证超时之后,停止向目标通讯端发送第一红外信号,并通过本通讯端、或者与该本通讯端关联的终端设备发送提示信息,以提示本通讯端与目标通讯端之间的红外通讯异常。
通过本实施例,通过持续向目标通讯端发送携带关键协议帧的红外信号,直到接收到目标通讯端回复的红外信号,可以保证红外通讯的可靠性和稳定性。
在一个示例性实施例中,向目标通讯端发送第三红外信号可以包括;
S51,向目标通信端发送携带有心跳帧的第三红外信号。
在本实施例中,如果在第一目标时长内接收到的目标通讯端回复的第二红外信号,则可以确定目标帧已经发送成功。由于目标帧(即,关键协议帧)是在有时才会发送,因此,当目标帧发送成功、而没有新的目标帧需要发送时,本通讯端可以向目标通信端发送携带有心跳帧的第三红外信号。在此情况下,第一红外信号与第三红外信号为不同的红外信号。
通过本实施例,在关键协议帧发送成功之后,重新开始发送携带普通心跳帧的红外信号,可以保证本通讯端与目标通讯端之间通讯的可靠性。
在一个示例性实施例中,目标通讯端为集尘站,发送第一红外信号的本通讯端为主机,进行的红外通讯为主机与集尘站之间的红外通讯。其可以是在主机通电之后即执行的,也可以是在处于特定状态时执行的,特定状态可以是主机的工作状态,也可以是主机的低电量状态,还可以是其他状态。对应地,在向目标通讯端发送第一红外信号之前,上述方法还包括:
S61,控制主机与充电座连接;
S62,在第二目标时长内等待接收集尘站发送的指示信号,其中,指示信号用于指示主机未处于充电状态;
S63,在接收到指示信号的情况下,重新控制主机与充电座连接。
在本实施例中,在主机与集尘站之间未开始信息交互之前,可以控制主机与集尘站上的充电座进行连接,使主机处于充电状态。对于主机,其上的控制芯片可以控制主机与充电座连接,该充电座可以位于集尘站上,也可以是位于其他位置,本实施例中对此不做限定。
主机可以在第二目标时长内等待接收集尘站发送的指示信号,即,用于指示主机未处于充电状态的信号。对于集尘站,在主机未回充时,集尘站可以持续发送上述指示信息,例如,每隔第二目标时长发送一次上述指示信息,直到确定主机已回充,即,确定主机已上充电座。
这里的第二目标时长可以是预先配置的时长,其可以与第一目标时长相同,也可以不同。这里的指示信号可以用于指示主机处于未充电状态。在接收到集尘站发送的指示信号的情况下,主机端可以重新控制主机与充电座进行连接,使主机处于充电状态。
例如,在确定主机离开充电座、主机的电量低于目标电量阈值、或者、接收到主机的回充指令之后,集尘站可以持续发码,等待主机回充。主机的控制芯片可以控制其上充电座,然后确定集尘站是否停止发码,从而确定与充电座的连接是否成功。如果集尘站未停止发码,主机的控制芯片可以重新控制其上充电座。
在本实施例中,通过控制主机与充电座进行交互确定主机是否连上充 电座,可以提高主机控制的准确性,保证主机与集尘站之间工作的正常功能,可以提高红外通讯的稳定性。
下面结合可选示例对本实施例中的红外通讯方法进行解释说明。在本可选示例中提供的是一种集尘红外通讯方案,本通讯端为主机,目标通讯端为集尘站。主机和集尘站的通讯状态可以分为以下四种:发送状态,接收状态,超时状态和等待状态。
对于主机,如图3所示,本可选示例中的红外通讯方法的流程可以包括以下步骤:
步骤S302,判断主机是否上充电座,如果是,执行步骤S304,否则,执行步骤S302;
步骤S304,判断集尘站发码是否停止,如果是,执行步骤S306,否则,执行步骤S302;
步骤S306,接收集尘站发送的红外码并写入缓冲区;
步骤S308,与集尘站进行红外通讯。
主机与集尘站之间进行红外通讯采用的通讯模式可以是主从应答模式,涉及到上述四个状态之间的切换:
主机首先处于发送状态,进行红外信号发送,如果有特殊帧写入,则发送特征帧,否则,发送心跳帧,然后进入到接收状态;
在接收状态,主机等待100ms,确定是否接收到集尘站的回复信号,如果接收到,则进行解码,进入到发送状态,否则,进入超时状态;
在超时状态,主机累计一次通讯失败,判断失败是否超过20次,如果是,进入到等待状态,否则,进入发送状态;
在等待状态,主机复位整个通讯(即,红外通讯)。
对于集尘站,如图4所示,本可选示例中的红外通讯方法的流程可以包括以下步骤:
步骤S402,持续发码等待机器(即,主机)回充;
步骤S404,判断机器是否上充电座,如果是,执行步骤S406,否则,执行步骤S402;
步骤S406,停止发码,进入通信状态;
步骤S408,与机器进行红外通讯。
集尘站与主机之间进行红外通讯采用的通讯模式可以是主从应答模式,涉及到上述四个状态之间的切换:
集尘站首先处于接收状态,等待100ms,确定是否接收到主机发送的红外信号,如果是,解码,并准备好回复码,进入发送状态,否则,进入超时状态;
在发送状态,集尘站向主机发送缓冲区内的码(即,准备好的回复码),进入到接收状态;
在超时状态,集尘站累计一次通讯失败,判断失败是否超过20次,如果是,进入到等待状态,否则,进入发送状态;
在等待状态,集尘站复位整个通讯(即,红外通讯)。
通过本可选示例,可以简化红外通讯电路,在不需要高频载波的情况下,通过自定义通讯机制来保证红外的抗干扰及误码,同时还可以完成小空间内的红外双向通讯,确定信息送达的完整性,并且,数据量足够完成主机和集尘站之间的信息交互。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM(Read-Only Memory,只读存储器)/RAM(Random Access Memory,随机存取存储器)、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
根据本申请实施例的又一个方面,还提供了一种用于实施上述红外通讯方法的红外通讯装置。图5是根据本申请实施例的一种可选的红外通讯装置的结构框图,如图5所示,该装置可以包括:
第一发送单元502,用于向目标通讯端发送第一红外信号,其中,第一 红外信号是基于电平持续时间进行编码的红外信号;
第二发送单元504,与第一发送单元502相连,用于在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号。
需要说明的是,该实施例中的第一发送单元502可以用于执行上述步骤S202,该实施例中的第二发送单元504可以用于执行上述步骤S204。
通过上述模块,向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号,解决了相关技术中的红外通讯方式存在由于不能区分双向的红外信号导致无法进行双向信息交互的问题,保证了通讯端之间的双向信息交互,降低了红外通讯成本。
在一个示例性实施例中,上述装置还包括:
第一确定单元,用于在向目标通讯端发送第一红外信号之前,确定与目标通讯端进行红外通讯所采用的目标通讯模式,其中,目标通讯模式为仅允许目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式;
第一控制单元,用于按照目标通讯模式控制本通讯端与目标通讯端进行红外通讯。
在一个示例性实施例中,第一红外信号用于发送头帧、信息帧和校验帧;第一发送单元包括:
第一发送模块,用于通过第一持续时间的高电平信号向目标通讯端发送头帧,其中,头帧用于指示第一红外信号的起始位置;
第二发送模块,用于向目标通讯端发送信息帧和校验帧,其中,信息帧和校验帧中的第一符号通过第二持续时间的高电平信号发送,信息帧和校验帧中的第二符号通过第三持续时间的低电平信号发送,第二持续时间与第三持续时间为不同的时间。
在一个示例性实施例中,第一红外信号携带有心跳帧;上述装置还包括:
第二确定单元,用于在向目标通讯端发送第一红外信号之后,在第一 目标时长内未接收到目标通讯端基于第一红外信号回复的红外信号的情况下,确定未接收到目标通讯端回复的红外信号的累计次数;
执行单元,用于在累计次数大于或者等于目标次数阈值的情况下,对与目标通讯端的红外通讯执行复位操作;
第三发送单元,用于在累计次数小于目标次数阈值的情况下,更新累计次数,并重新向目标通讯端发送第一红外信号。
在一个示例性实施例中,第一红外信号携带有目标帧,其中,目标帧用于控制目标通讯端执行目标操作;上述装置还包括:
第四发送单元,用于在向目标通讯端发送第一红外信号之后,在第一目标时长内未接收到目标通讯端基于第一红外信号回复的红外信号的情况下,按照第一目标时长持续向目标通讯端发送第一红外信号,直到接收到目标通讯端回复的红外信号。
在一个示例性实施例中,第二发送单元包括;
第三发送模块,用于向目标通信端发送携带有心跳帧的第三红外信号。
在一个示例性实施例中,目标通讯端为集尘站,发送第一红外信号的本通讯端为主机;上述装置还包括:
第二控制单元,用于在向目标通讯端发送第一红外信号之前,控制主机与充电座连接;
接收单元,用于在第二目标时长内等待接收集尘站发送的指示信号,其中,指示信号用于指示主机未处于充电状态;
第三控制单元,用于在接收到指示信号的情况下,重新控制主机与充电座连接。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现,其中,硬件环境包括网络环境。
根据本申请实施例的又一个方面,还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于执行本申请实施例中上述任一项红 外通讯方法的程序代码。
可选地,在本实施例中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:
S1,向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;
S2,在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号。
可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例中对此不再赘述。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、ROM、RAM、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
根据本申请实施例的又一个方面,还提供了一种用于实施上述红外通讯方法的电子装置,该电子装置可以是服务器、终端、或者其组合。
图6是根据本申请实施例的一种可选的电子装置的结构框图,如图6所示,包括处理器602、通信接口604、存储器606和通信总线608,其中,处理器602、通信接口604和存储器606通过通信总线608完成相互间的通信,其中,
存储器606,用于存储计算机程序;
处理器602,用于执行存储器606上所存放的计算机程序时,实现如下步骤:
S1,向目标通讯端发送第一红外信号,其中,第一红外信号是基于电平持续时间进行编码的红外信号;
S2,在第一目标时长内接收到目标通讯端基于第一红外信号回复的第二红外信号的情况下,向目标通讯端发送第三红外信号。
可选地,在本实施例中,通信总线可以是PCI(Peripheral Component Interconnect,外设部件互连标准)总线、或EISA(Extended Industry Standard  Architecture,扩展工业标准结构)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。通信接口用于上述电子装置与其他设备之间的通信。
上述的存储器可以包括RAM,也可以包括非易失性存储器(non-volatile memory),例如,至少一个磁盘存储器。可选地,存储器还可以是至少一个位于远离前述处理器的存储装置。
作为一种示例,上述存储器606中可以但不限于包括上述红外通讯装置中的第一发送单元502以及第二发送单元504。此外,还可以包括但不限于上述红外通讯装置中的其他模块单元,本示例中不再赘述。
可选地,该处理器可以是通用处理器,可以包含但不限于:CPU(Central Processing Unit,中央处理器)、NP(Network Processor,网络处理器)等;还可以是DSP(Digital Signal Processing,数字信号处理器)、ASIC(Application Specific Integrated Circuit,专用集成电路)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。
本领域普通技术人员可以理解,图6所示的结构仅为示意,实施上述红外通讯方法的设备可以是终端设备,该终端设备可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图6其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图6中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图6所示的不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、ROM、RAM、磁盘或光盘等。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例中所提供的方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (10)

  1. 一种红外通讯方法,其特征在于,包括:
    向目标通讯端发送第一红外信号,其中,所述第一红外信号是基于电平持续时间进行编码的红外信号;
    在第一目标时长内接收到所述目标通讯端基于所述第一红外信号回复的第二红外信号的情况下,向所述目标通讯端发送第三红外信号。
  2. 根据权利要求1所述的方法,其中,在所述向目标通讯端发送第一红外信号之前,所述方法还包括:
    确定与所述目标通讯端进行红外通讯所采用的目标通讯模式,其中,所述目标通讯模式为仅允许所述目标通讯端在接收到本通讯端的红外信号之后进行回复的通讯模式;
    按照所述目标通讯模式控制所述本通讯端与所述目标通讯端进行红外通讯。
  3. 根据权利要求1所述的方法,其中,所述第一红外信号用于发送头帧、信息帧和校验帧;所述向目标通讯端发送第一红外信号,包括:
    通过第一持续时间的高电平信号向所述目标通讯端发送所述头帧,其中,所述头帧用于指示所述第一红外信号的起始位置;
    向所述目标通讯端发送所述信息帧和所述校验帧,其中,所述信息帧和所述校验帧中的第一符号通过第二持续时间的高电平信号发送,所述信息帧和所述校验帧中的第二符号通过第三持续时间的低电平信号发送,所述第二持续时间与所述第三持续时间为不同的时间。
  4. 根据权利要求1所述的方法,其中,所述第一红外信号携带有心跳帧;在所述向目标通讯端发送第一红外信号之后,所述方法还包括:
    在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,确定未接收到所述目标通讯端回复的红外信号的累计次数;
    在所述累计次数大于或者等于目标次数阈值的情况下,对与所述目标通讯端的红外通讯执行复位操作;
    在所述累计次数小于目标次数阈值的情况下,更新所述累计次数,并重新向所述目标通讯端发送所述第一红外信号。
  5. 根据权利要求1所述的方法,其中,所述第一红外信号携带有目标帧,其中,所述目标帧用于控制所述目标通讯端执行目标操作;在所述向目标通讯端发送第一红外信号之后,所述方法还包括:
    在所述第一目标时长内未接收到所述目标通讯端基于所述第一红外信号回复的红外信号的情况下,按照所述第一目标时长持续向所述目标通讯端发送所述第一红外信号,直到接收到所述目标通讯端回复的红外信号。
  6. 根据权利要求5所述的方法,其中,所述向所述目标通讯端发送第三红外信号,包括;
    向所述目标通信端发送携带有心跳帧的所述第三红外信号。
  7. 根据权利要求1至6中任一项所述的方法,其中,所述目标通讯端为集尘站,发送所述第一红外信号的本通讯端为主机;在所述向目标通讯端发送第一红外信号之前,所述方法还包括:
    控制所述主机与充电座连接;
    在第二目标时长内等待接收所述集尘站发送的指示信号,其中,所述指示信号用于指示所述主机未处于充电状态;
    在接收到所述指示信号的情况下,重新控制所述主机与所述充电座连接。
  8. 一种红外通讯装置,其特征在于,包括:
    第一发送单元,用于向目标通讯端发送第一红外信号,其中,所述第一红外信号是基于电平持续时间进行编码的红外信号;
    第二发送单元,用于在第一目标时长内接收到所述目标通讯端基于所述第一红外信号回复的第二红外信号的情况下,向所述目标通讯端发送第三红外信号。
  9. 一种计算机可读的存储介质,其特征在于,所述计算机可读的存储介质包括存储的程序,其中,所述程序运行时执行权利要求1至7中任一项所述的方法。
  10. 一种电子装置,包括存储器和处理器,其特征在于,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行权利要求1至7中任一项所述的方法。
PCT/CN2022/118372 2021-09-23 2022-09-13 一种红外通讯方法及装置、存储介质及电子装置 WO2023045795A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111116387.3 2021-09-23
CN202111116387.3A CN113904723B (zh) 2021-09-23 2021-09-23 一种红外通讯方法及装置、存储介质及电子装置

Publications (1)

Publication Number Publication Date
WO2023045795A1 true WO2023045795A1 (zh) 2023-03-30

Family

ID=79028942

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/118372 WO2023045795A1 (zh) 2021-09-23 2022-09-13 一种红外通讯方法及装置、存储介质及电子装置

Country Status (2)

Country Link
CN (2) CN117060999A (zh)
WO (1) WO2023045795A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117060999A (zh) * 2021-09-23 2023-11-14 追觅创新科技(苏州)有限公司 一种红外通讯方法及装置、存储介质及电子装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374212A (ja) * 2001-06-14 2002-12-26 Sharp Corp 赤外線通信装置および赤外線通信方法
CN107919009A (zh) * 2017-11-23 2018-04-17 四川爱联科技有限公司 一种双向红外通讯方法
CN108574535A (zh) * 2017-03-09 2018-09-25 深圳光启智能光子技术有限公司 用于光通信的编码方法、信号发送装置和接收装置及方法
CN110876076A (zh) * 2018-09-04 2020-03-10 宁波方太厨具有限公司 一种分离式家电控制装置
CN113904723A (zh) * 2021-09-23 2022-01-07 追觅创新科技(苏州)有限公司 一种红外通讯方法及装置、存储介质及电子装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI955200A (fi) * 1995-10-31 1997-05-01 Nokia Mobile Phones Ltd Yhteiskäytäntö half-duplex -liikennöintiä varten
JPH1115761A (ja) * 1997-06-02 1999-01-22 Internatl Business Mach Corp <Ibm> 赤外線通信機能を持つ情報処理装置及びその制御方法
KR100738890B1 (ko) * 2005-07-22 2007-07-12 엘지전자 주식회사 이동로봇을 이용한 홈 네트워킹 시스템
JP5917463B2 (ja) * 2013-09-02 2016-05-18 シャープ株式会社 制御装置、制御装置の制御方法、制御システム、および、制御プログラム
EP3190724B1 (en) * 2014-09-05 2021-07-28 Kuang-Chi Intelligent Photonic Technology Ltd. Optical signal encoding and decoding methods, and device
CN105450299B (zh) * 2014-09-05 2019-08-30 深圳光启智能光子技术有限公司 信号的编解码方法及系统
CN105119907A (zh) * 2015-07-22 2015-12-02 哈尔滨工业大学 一种基于FPGA的BiSS-C通信协议方法
CN106877925A (zh) * 2017-01-09 2017-06-20 深圳市欢创科技有限公司 一种点对点的红外通讯方法及系统
EP3609137A4 (en) * 2017-04-28 2020-07-29 Guangdong Oppo Mobile Telecommunications Corp., Ltd. METHOD AND DEVICE FOR WIRELESS COMMUNICATION
CN109064733A (zh) * 2018-09-30 2018-12-21 珠海全志科技股份有限公司 自适应红外信号解码方法、计算机装置及其控制装置
CN112396819B (zh) * 2019-08-16 2022-06-03 北京小米移动软件有限公司 红外通信装置、系统、方法、终端设备及存储介质
CN112748725B (zh) * 2019-10-31 2022-04-01 珠海一微半导体股份有限公司 一种机器人通用的回充控制方法、芯片及机器人
CN110865645B (zh) * 2019-11-29 2023-08-11 小狗电器互联网科技(北京)股份有限公司 一种机器人和回充系统
CN111580175A (zh) * 2020-04-28 2020-08-25 无锡小天鹅电器有限公司 红外信号处理方法、装置和家电设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374212A (ja) * 2001-06-14 2002-12-26 Sharp Corp 赤外線通信装置および赤外線通信方法
CN108574535A (zh) * 2017-03-09 2018-09-25 深圳光启智能光子技术有限公司 用于光通信的编码方法、信号发送装置和接收装置及方法
CN107919009A (zh) * 2017-11-23 2018-04-17 四川爱联科技有限公司 一种双向红外通讯方法
CN110876076A (zh) * 2018-09-04 2020-03-10 宁波方太厨具有限公司 一种分离式家电控制装置
CN113904723A (zh) * 2021-09-23 2022-01-07 追觅创新科技(苏州)有限公司 一种红外通讯方法及装置、存储介质及电子装置

Also Published As

Publication number Publication date
CN113904723A (zh) 2022-01-07
CN113904723B (zh) 2023-09-01
CN117060999A (zh) 2023-11-14

Similar Documents

Publication Publication Date Title
US20200351354A1 (en) System and method for supporting data communication in a heterogeneous environment
CN109660639B (zh) 一种数据上传方法、设备、系统及介质
CN104620564A (zh) 经由利用数据隧道的接口的多协议数据元素的传输
CN107612661A (zh) 数据通讯方法和装置
CN110808948B (zh) 远程过程调用方法、装置及系统
WO2023045795A1 (zh) 一种红外通讯方法及装置、存储介质及电子装置
CN111629368B (zh) 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质
CN107360177B (zh) 一种基于udp的报文传输方法及装置
CN105487937A (zh) 一种rdma实现方法和装置
WO2021217540A1 (zh) 通信链路的检测方法、装置、系统和可移动平台
CN105183687A (zh) 一种分时串口通信方法及系统
CN109688208B (zh) 一种基于fc-ae-asm消息的数据加载方法
CN112395237A (zh) 一种至少两个控制器之间通信的方法及其系统
CN101896978A (zh) 错误应答命令协议的前向纠错
KR20050046379A (ko) 시리얼 통신 프로토콜 중 명령 및 데이터 전송 및 수신 방법
CN110809002A (zh) 机器人和焊接设备间协议转换的方法及协议转换模块
CN114328183A (zh) 一种调试方法、装置、设备以及计算机可读存储介质
CN104579548A (zh) 基于管理数据输入输出多源协议的传输方法及装置
CN110048865B (zh) 一种总线数据传输方法、装置、电子设备及存储介质
CN104429009B (zh) 用于在数据包的双向传输情况下传输数据包的方法
CN112422485A (zh) 一种传输控制协议的通信方法及装置
CN105407003A (zh) 一种1553总线的数据加卸载方法
CN115422099A (zh) 一种通信信息发送方法、装置、电子设备及存储介质
CN115022424A (zh) 水电lcu控制器网卡虚拟控制方法、系统、设备及其介质
CN111741013A (zh) 数据传输方法及装置

Legal Events

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

Ref document number: 22871843

Country of ref document: EP

Kind code of ref document: A1