Nothing Special   »   [go: up one dir, main page]

WO2022188329A1 - Bluetooth broadcast packet-based code pairing remote control, controlled device, and method - Google Patents

Bluetooth broadcast packet-based code pairing remote control, controlled device, and method Download PDF

Info

Publication number
WO2022188329A1
WO2022188329A1 PCT/CN2021/107328 CN2021107328W WO2022188329A1 WO 2022188329 A1 WO2022188329 A1 WO 2022188329A1 CN 2021107328 W CN2021107328 W CN 2021107328W WO 2022188329 A1 WO2022188329 A1 WO 2022188329A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
bluetooth broadcast
remote control
broadcast packet
pairing
Prior art date
Application number
PCT/CN2021/107328
Other languages
French (fr)
Chinese (zh)
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 WO2022188329A1 publication Critical patent/WO2022188329A1/en

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • 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 invention relates to the field of Bluetooth technology, in particular to a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet.
  • remote controllers such as smart TVs, wireless mice, various players, smart lamps, etc.
  • remote controllers such as infrared remote control, RF remote control, Bluetooth remote control and so on.
  • the remote control is a wireless transmitting device. It encodes the key information through modern digital coding technology and sends it to the receiving end through infrared or other wireless signals.
  • the receiving end converts the received infrared signal or wireless signal into an electrical signal,
  • the processor decodes and demodulates the corresponding instructions to achieve the purpose of controlling the relevant equipment to complete the required operation requirements. Its biggest advantage is that it can also be controlled without close contact with the controlled equipment.
  • the use of the remote control involves two situations: pass code and pair code.
  • the passcode means that the controlled device does not recognize the remote control ID, and any remote control can control it.
  • Code matching means that after the code matching operation, the controlled device saves the remote control ID. After receiving the command, it checks whether it is sent by the code-matched remote control.
  • the controlled device can only be controlled by the code-matched remote control.
  • the remote control that is paired can prevent interference from other remote controls, and can use multiple sets of remote controls and controlled devices at the same time, so it is more favored.
  • one-way remote control is divided into infrared remote control, RF remote control, etc.; RF remote control is divided into 315MHz, 433MHz, 2.4GHz and other frequency bands, 2.4GHz frequency band remote control is also divided into private protocol remote control, remote control based on Bluetooth broadcast package, etc. ;
  • the one-way remote control based on the Bluetooth broadcast package is widely used for its advantages of long transmission distance, low power consumption, barrier-free, and support for more complex protocols, but the one-way remote control based on the Bluetooth broadcast package can only The signal is sent in one direction, and a Bluetooth connection cannot be established.
  • the existing one-way remote control pairing method based on Bluetooth broadcast packet is as follows:
  • the remote control sends Bluetooth broadcast packets continuously, and the controlled device detects a certain amount of Bluetooth broadcast packets to complete the pairing.
  • the above method has the following disadvantages: because the wireless signal is easily interfered, the controlled devices may not be able to receive all the Bluetooth signals continuously sent by the remote control, and the reception rate is relatively low in some cases of severe interference. If the agreed number of received Bluetooth broadcast packets is relatively large, the detection time will be relatively long. If the agreed number of received Bluetooth broadcast packets is small, the stability will be poor and false triggering will be easy. Therefore, when the one-way remote control based on the Bluetooth broadcast packet adopts the above method to perform code matching, the stability is not high.
  • the purpose of the present invention is to provide a remote controller, a controlled device and a method for realizing code matching based on a bluetooth broadcast packet, so as to improve the reliability of the remote controller's code matching operation based on the bluetooth broadcast packet.
  • the present invention proposes a remote controller for realizing code matching based on a Bluetooth broadcast packet, on which a code matching key is provided, including:
  • a key monitoring unit used to monitor in real time whether the code pair key on the remote control is pressed, and if it is detected that the code pair key is pressed, enter the long-press judgment unit;
  • the long-pressing judgment unit is used for judging whether the continuous key-pressing time of the code-matching key exceeds the preset code-matching setting time threshold, and if it exceeds the preset code-setting time threshold, the code-matching identification sending unit is entered;
  • the code matching identification sending unit is used to generate the matching code identification, fill the matching identification identification into the Bluetooth broadcast packet and send it, that is, send the matching code identification in the form of a Bluetooth broadcast packet. If the preset code matching time threshold is not exceeded, Then continue to wait and monitor the code key in real time;
  • the continuous monitoring unit is used for continuously judging whether the pairing key is kept pressed after the pairing identifier sending unit sends the Bluetooth broadcast packet, and if so, returning to the pairing identifier sending unit to continue to send the bluetooth containing the pairing identifier broadcast packets.
  • the key identifier is changed from a short-press identifier to a long-pressed code-matching identifier.
  • the identifier sending unit fills the long-pressed pairing identifier into the Bluetooth broadcast packet and sends it out.
  • the present invention also provides a controlled device for realizing code matching based on a Bluetooth broadcast packet, including:
  • the bluetooth broadcast packet parsing unit is used to analyze the bluetooth broadcast packet when receiving the bluetooth broadcast packet, and determine whether the bluetooth broadcast packet contains the code matching identification. ;
  • a code-matching success determination unit is used to determine the remote-controller's code-matching when the number of received Bluetooth broadcast packets containing the code-matching identifier of the same remote control ID is greater than or equal to a preset threshold for the number of Bluetooth broadcast packets for successful code-matching Successful, and save the remote control ID that has been successfully paired.
  • the Bluetooth broadcast packet parsing unit also compares the currently obtained remote control ID with the saved remote control ID with successful code matching, if the currently obtained remote control ID If it already exists in the saved remote control ID with successful code matching, exit the current remote control code matching process.
  • the controlled device further includes a scanning unit for starting the controlled device when it is powered on, starting the scanning of Bluetooth broadcast packets, and starting the Bluetooth broadcast packet parsing unit when a Bluetooth broadcast signal is scanned.
  • a scanning unit for starting the controlled device when it is powered on, starting the scanning of Bluetooth broadcast packets, and starting the Bluetooth broadcast packet parsing unit when a Bluetooth broadcast signal is scanned.
  • the Bluetooth broadcast packet parsing unit determines that the Bluetooth broadcast packet contains a code matching identifier, it further judges whether the time when the Bluetooth broadcast packet is received exceeds a preset time limit for code matching. If the time threshold is limited, then the remote control ID is obtained according to the Bluetooth broadcast packet and recorded, and when the code matching success determination unit does not exceed the preset time limit for code matching, the received code containing the same remote control ID contains the matching code.
  • the number of identified Bluetooth broadcast packets is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote control is successfully paired.
  • the present invention also provides a method for realizing code matching based on a Bluetooth broadcast packet, comprising the following steps:
  • Step S1 the remote controller monitors in real time whether the code pair key on it is pressed, and if pressed, then enters step S2;
  • Step S2 judging whether the continuous pressing time of the pairing key exceeds a preset pairing setting time threshold, and if it exceeds the preset pairing setting time threshold, then fill the pairing identifier corresponding to the pairing key into the Bluetooth broadcast the packet and send it out, and continuously send the Bluetooth broadcast packet containing the pair code identifier under the condition of continuously pressing the code pair key;
  • Step S3 when receiving the Bluetooth broadcast packet, the controlled device parses the Bluetooth broadcast packet, and determines whether the Bluetooth broadcast packet contains a pairing identifier, and if it contains a pairing identifier, obtains a corresponding remote control according to the Bluetooth broadcast packet. device ID and record it;
  • Step S4 when the number of times that the controlled device receives the bluetooth broadcast packets with the same remote control ID that contains the code pairing identifier is greater than or equal to the preset threshold of the number of bluetooth broadcast packets that successfully pair codes, then determine that the remote control pair codes. Successful, and save the remote control ID that has been successfully paired.
  • step S2 when the continuous pressing time of the pairing key exceeds the setting time threshold for pairing, the key identifier is changed from a short-press identifier to a long-pressed pairing identifier, and the long-pressed pairing identifier is changed.
  • the identity is filled into the Bluetooth broadcast packet and sent out.
  • step S3 the currently obtained remote control ID is compared with the saved remote control ID with successful code matching, if the currently obtained remote control ID already exists in the saved remote control ID with successful code matching, Then exit the code matching process of the current remote control.
  • step S3 when it is judged that the Bluetooth broadcast packet contains a code matching identifier, it is further judged whether the time when the Bluetooth broadcast packet is received exceeds a preset code matching time limit, and if it does not exceed the code matching time limit Threshold, then obtain the remote control ID according to the Bluetooth broadcast packet and record it, if it exceeds the limit time threshold for code matching, then end the current code matching process; in step S4, when the preset time limit for code matching does not exceed the threshold value, When the number of received Bluetooth broadcast packets with the same remote control ID containing the pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote controller is successfully paired.
  • a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet of the present invention can effectively prevent the controlled device from performing code matching only within a certain period of time when the controlled device is powered on.
  • the code is incorrectly paired due to interference, and after the time threshold is set by pressing the pairing button for a long time, the button identification is changed from the short-pressing mark to the long-pressing the pairing mark, and a Bluetooth broadcast packet containing the pairing mark is sent.
  • the method of using different identifications with long presses prevents false triggering of the code pairing by short presses.
  • the remote control terminal continuously sends the Bluetooth broadcast packets, and the controlled device only needs to detect a small number of times that the codes contain the pairing codes.
  • the Bluetooth broadcast packet can complete the code matching, which can ensure the reliability of the code matching operation.
  • FIG. 1 is a schematic structural diagram of a remote controller for realizing code matching based on a Bluetooth broadcast packet of the present invention
  • FIG. 2 is a schematic structural diagram of a controlled device that implements code matching based on a Bluetooth broadcast packet of the present invention
  • FIG. 3 is a flow chart of the steps of a method for implementing remote control code pairing based on a Bluetooth broadcast packet according to the present invention
  • FIG. 4 is a work flow diagram of a remote control end-to-code operation in an embodiment of the present invention.
  • FIG. 5 is a working flowchart of the controlled device detecting the remote control signal in the embodiment of the present invention.
  • FIG. 6 is a flowchart of remote control processing of a controlled device in an embodiment of the present invention.
  • Code-matching time limit The controlled device can accept code-matching operations within a certain period of time after it is powered on. After this time, the code-matching application will not be accepted. This time is the code-matching time limit.
  • Setting time threshold for code matching When the remote control performs code matching, it takes a certain period of time to press the code matching key to send the Bluetooth broadcast packet containing the matching code identification. This time is the code matching setting time.
  • Threshold of the number of Bluetooth broadcast packets for successful code pairing used to determine the number of Bluetooth broadcast packets containing the code pair identifier that need to be received for successful code pairing.
  • FIG. 1 is a schematic structural diagram of a remote controller for realizing code matching based on a Bluetooth broadcast packet according to the present invention.
  • the present invention is a remote controller for realizing code matching based on a Bluetooth broadcast packet, which is provided with a code matching key, including:
  • the key monitoring unit 101 is used to monitor in real time whether the pairing key on the remote control is pressed. If it is detected that the pairing key is pressed, enter the long-press judging unit 102, otherwise continue monitoring.
  • the remote controller is a remote controller that contains a Bluetooth chip or an RF chip, and can send a Bluetooth broadcast packet through a Bluetooth broadcast method.
  • the remote controller is provided with a pairing key, which can be a single key, or a pairing key. It can include a combination of multiple keys to form a pairing key, monitor the state of the pairing key, and monitor whether the user presses the pairing key in real time. If it is detected that the user presses the pairing key, the long press judgment unit 102.
  • the pairing identification sending unit 103 is used to generate the pairing identification, fill the pairing identification into the Bluetooth broadcast packet and send it, that is, send the pairing identification in the form of a Bluetooth broadcast packet, if the preset pairing setting time threshold is not exceeded , continue to wait and monitor the code key in real time.
  • the system of the remote controller is preset with a code setting time threshold.
  • a short-pressing mark is generated.
  • the key identifier is changed from a short press identifier to a long-pressed pairing identifier.
  • the above-mentioned Bluetooth broadcast packet is a command sent in a specified format.
  • the code identification it also includes the relevant control identification information of the remote control, such as the remote control ID, etc.
  • the remote control ID can be a MAC address or other non-repetitive information identification. .
  • the Bluetooth broadcast packet containing the code pair identifier will be sent not immediately but after a certain period of time.
  • the present invention sets the time threshold for code matching, so that the remote controller only fills the long-pressing code-matching logo into the Bluetooth after monitoring the long-pressing of the code-matching key to the preset code-matching setting time threshold.
  • the long-pressing button in the code-matching operation of the present invention can effectively avoid false triggering caused by short-pressing. Filling the long-press pair code identifier into the Bluetooth broadcast packet and sending it out, this method is more reliable to realize the long-press operation.
  • the continuous monitoring unit 104 is used for continuously judging whether the pairing key is kept pressed after the pairing identifier sending unit 103 sends the Bluetooth broadcast packet, and if so, returning to the pairing identifier sending unit 103 to send the bluetooth broadcast containing the pairing identifier again Otherwise, return to the key monitoring unit 101 to monitor again and wait for the code key to be pressed.
  • FIG. 2 is a schematic structural diagram of a controlled device that implements code matching based on a Bluetooth broadcast packet according to the present invention.
  • a controlled device for realizing code matching based on a Bluetooth broadcast packet of the present invention includes:
  • the bluetooth broadcast packet parsing unit 210 is used to analyze the bluetooth broadcast packet when receiving the bluetooth broadcast packet, and determine whether the bluetooth broadcast packet contains a code matching identifier, and if it contains a code matching identifier, obtain the remote control ID according to the Bluetooth broadcast packet and assign it Record, if the Bluetooth broadcast packet does not contain a code matching identifier, it is indicated as a Bluetooth broadcast packet other than the code matching, and the Bluetooth broadcast packet is processed for other identifications other than the code matching.
  • the Bluetooth broadcast packet parsing unit 210 also compares the currently obtained remote control ID with the saved remote control ID with successful code pairing. If it exists in the saved remote control ID with successful code matching, it will exit the current remote control code matching process.
  • the code pairing success determination unit 211 is used to determine that the code pairing of the remote control is successful when the number of received bluetooth broadcast packets containing the code pairing identifier of the same remote control ID is greater than or equal to the threshold of the number of Bluetooth broadcast packets that have successfully paired codes, And save the ID of the remote control that has been successfully matched, and save the ID of the remote control that has been successfully matched to the storage area, so that it will not be lost due to power failure.
  • the remote control ID will be verified every time a control command is received in the future to ensure that it is controlled.
  • the device only performs corresponding operations on the saved remote control ID, and the threshold of the number of Bluetooth broadcast packets for successful code pairing refers to the preset number of Bluetooth broadcast packets containing the code pair identifier that need to be received to judge that the code pair is successful.
  • the present invention is a controlled device that implements code matching based on a Bluetooth broadcast packet, further comprising:
  • the scanning unit 212 is used for starting the controlled device when it is powered on, starting the scanning of the Bluetooth broadcast packet, and starting the Bluetooth broadcast packet parsing unit 210 when the Bluetooth broadcast signal is scanned.
  • the Bluetooth broadcast packet parsing unit 210 when judging that the Bluetooth broadcast packet contains the code matching identifier, further judges whether the time when the Bluetooth broadcast packet is received exceeds the preset code matching time threshold, if not exceeds the code matching limit. If the time threshold is set, the remote control ID is obtained and recorded according to the Bluetooth broadcast packet.
  • the code-matching time threshold refers to the preset time range within which the controlled device can accept the code-matching operation after power-on, that is, the controlled device is on the After the power is turned on, the code matching operation can only be accepted within the code matching limited time threshold. If this time is exceeded, the code matching application will not be accepted. , when the number of received Bluetooth broadcast packets with the same remote control ID containing the code pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote control is successfully paired.
  • FIG. 3 is a flow chart of steps of a method for implementing code matching based on a Bluetooth broadcast packet according to the present invention.
  • a method for realizing code matching based on a Bluetooth broadcast packet of the present invention comprises the following steps:
  • Step S1 monitor in real time whether the code pair key on the remote control is pressed, if pressed, go to step S2, otherwise continue monitoring.
  • the remote control is a remote control that contains a Bluetooth chip or an RF chip and can send Bluetooth broadcast packets through Bluetooth broadcast.
  • a corresponding code pair identification will be generated.
  • the code pair key can be a single key or a combination of multiple keys to form a code pair key.
  • the state of the code key is monitored, and whether the user presses the key is monitored in real time. Press the pairing key, and if it is detected that the user presses the pairing key, step S2 is entered.
  • Step S2 judging whether the continuous pressing time of the pairing key exceeds the preset pairing setting time threshold, and if it exceeds the preset pairing setting time threshold, then fill the pairing identifier corresponding to the pairing key into the Bluetooth broadcast packet. And send, that is to say, the code matching identification is sent out in the form of a Bluetooth broadcast packet. If the preset code matching time threshold is not exceeded, continue to wait and monitor the code matching key in real time.
  • a Bluetooth broadcast packet refers to a Bluetooth broadcast command sent in a specified format through a Bluetooth broadcast method, and includes control identification information related to a remote control, such as a remote control ID.
  • the remote controller by setting the code setting time threshold, the remote controller fills the long-pressed code-pairing identifier into the Bluetooth broadcast packet and sends it out only after monitoring the long-pressing of the code-pairing key to the preset code-pairing setting time threshold.
  • the long-pressing of the code-matching key can effectively avoid false triggering caused by short-pressing, so that the code-matching operation is more reliable.
  • step S2 after the bluetooth broadcast packet is sent, it is continuously judged whether the pairing key is kept pressed, if so, the bluetooth broadcast packet containing the pairing identifier is sent again, otherwise it returns to step S1 to re-monitor and wait for the pairing key to be Press.
  • Step S3 when receiving the bluetooth broadcast packet, the controlled device parses the bluetooth broadcast packet, and judges whether the bluetooth broadcast packet contains a code-matching identifier, and if it contains a code-matching identifier, obtains the remote control ID according to the bluetooth broadcast packet and records it;
  • the bluetooth broadcast packet does not contain a code matching identifier, and it is indicated as a bluetooth broadcast packet other than the code matching identifier, and the Bluetooth broadcast packet is processed with other identifiers than the code matching identifier.
  • the controlled device refers to a device that can parse Bluetooth broadcast packets and needs a remote controller to control.
  • step S3 the currently obtained remote control ID is compared with the saved remote control ID with successful code matching, if the currently obtained remote control ID already exists in the saved remote control ID with successful code matching, Then exit the code matching process of the current remote control.
  • step S4 when the number of times that the controlled device receives the Bluetooth broadcast packets containing the code pairing identifier of the same remote control ID is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it means that the code pairing of the remote control is successful, and the pairing is saved.
  • the ID of the remote control that has been successfully coded will be saved to the storage area, so that it will not be lost due to power failure, and the remote control ID will be verified each time a control command is received in the future to ensure that the controlled device can only be used for Do the corresponding operation with the saved remote control ID.
  • the threshold of the number of Bluetooth broadcast packets for successful code pairing refers to a preset number of Bluetooth broadcast packets containing a code pair identifier that need to be received to judge that the code pair is successful.
  • a method for implementing remote control code matching based on a Bluetooth broadcast packet of the present invention further includes:
  • Step S2-1 the controlled device is powered on and started, and the Bluetooth broadcast packet scanning is started;
  • Step S2-2 determine whether the Bluetooth broadcast signal is scanned, if not, continue scanning, otherwise, go to step S3.
  • step S3 when it is judged that the Bluetooth broadcast packet contains a code matching identifier, it is further judged whether the time when the Bluetooth broadcast packet is received exceeds a preset code matching time limit, and if it does not exceed the code matching time limit Threshold, the remote control ID is obtained and recorded according to the Bluetooth broadcast packet.
  • the code-matching time limit refers to the preset time range within which the controlled device can accept the code-matching operation after power-on, that is, the controlled device is powered on. After that, the code matching operation can only be accepted within the code matching time threshold, and beyond this time limit, the code matching application will not be accepted.
  • the number of Bluetooth broadcast packets with the same remote control ID containing the code pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, then the remote control is successfully paired.
  • the controlled device can not perform the remote control code matching operation in real time, and the code matching process should be performed within a certain period of time when the controlled device is powered on.
  • the code can only be matched within the code limit time threshold, and the code matching application will not be accepted at other times, which can effectively prevent the controlled equipment from being interfered with and cause incorrect code matching.
  • FIG. 4 is a work flow diagram of a remote control end-to-end code operation in an embodiment of the present invention.
  • the code matching operation on the remote controller is as follows:
  • Step S401 start, generally the remote controller is powered on and starts to work
  • Step S402 determine whether the code key is pressed, if otherwise, continue to detect, if so, go to S403;
  • Step S403 it is judged whether the continuous pressing time exceeds the time threshold set for the code pairing, if otherwise, continue to wait and detect the button, and if so, go to S404.
  • Step S404 filling the pairing identifier into the Bluetooth broadcast packet and sending, and sending the pairing identifier in the form of a Bluetooth broadcast packet.
  • Step S405 it is judged whether the code pair key is kept pressed, if not, wait for the key to be pressed again. If so, go to S404, and return to step S404 again to send the Bluetooth broadcast packet containing the pair code identifier.
  • FIG. 5 is a work flow chart of a controlled device detecting a remote control signal in an embodiment of the present invention.
  • the workflow for the controlled device to detect the remote control signal is as follows:
  • Step S501 the controlled device is powered on and started
  • Step S502 enable Bluetooth scanning, initialize various parameters, and start scanning for Bluetooth broadcast packets.
  • Step S503 determine whether the Bluetooth broadcast signal is scanned, if otherwise, continue scanning, if so, go to S504.
  • step S504 the remote control processing flow is invoked, and after completion, the Bluetooth broadcast packet scanning is continued.
  • FIG. 6 is a flowchart of remote control processing of a controlled device in an embodiment of the present invention.
  • the remote control processing flow of the controlled device is as follows:
  • Step S601 the remote control processing flow starts, which is the entry of the remote control processing flow
  • Step S602 judging whether the received Bluetooth broadcast packet contains a pair code identification, if otherwise, enter S604, if so, enter S603;
  • Step S603 judging whether the time limit for code matching is exceeded, if so, go to S606; otherwise, go to S605;
  • Step S604 other identification processing, that is, if it is not a code identification, other identification processing is performed, and after the processing is completed, enter S606;
  • Step S605 obtain the remote control ID and record it, and judge whether the number of received Bluetooth broadcast packets of the same remote control ID is greater than or equal to the Bluetooth broadcast of successful code pairing under the condition that the time limit for code pairing is not exceeded.
  • Packet quantity threshold if it is, the code is successfully matched, and the remote control ID is saved in the storage area, and the remote control ID will be verified every time a control command is received subsequently, so that only the corresponding operation is performed on the saved remote control ID, and the process goes to step S606 , if not, go to step S606.
  • Step S606 the remote control processing flow is completed, the calling program is exited, and the next calling is awaited.
  • a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet of the present invention can effectively prevent the controlled device from being interfered by enabling the controlled device to perform code matching only within a certain period of time when it is powered on. After the time threshold is set by pressing the pairing button for a long time, the key identification is changed from the short-pressing mark to the long-pressing pairing mark, and a Bluetooth broadcast packet containing the pairing mark is sent. The method of using different identifiers for long presses prevents false triggering of the code pairing by short presses.
  • the remote control terminal continuously sends the Bluetooth broadcast packets, and the controlled device only needs to detect a small number of times the bluetooth containing the code pairing identifier.
  • the broadcast packet can complete the code matching, which can ensure the reliability of the code matching operation.
  • the present invention has the following advantages:
  • the code matching process of the controlled device of the present invention needs to be performed within the code matching time limit, to ensure that the code can be matched within the code matching time threshold after the controlled device is powered on, and the code matching application is not accepted at other times. This method is not easy to mistake the code.
  • the key identifier is changed from a short-pressing identifier to a long-pressing-pairing identifier, and continuously sent by means of Bluetooth broadcast packets under the condition of continuously pressing the pairing key.
  • long-pressing the button for the code-matching operation can effectively avoid false triggers caused by short presses.
  • the present invention determines whether the code pairing is successful according to the number of Bluetooth broadcast packets received and the threshold value of the number of Bluetooth broadcast packets that have successfully paired codes.
  • the threshold value of the number of Bluetooth broadcast packets that have successfully paired codes can be 1, It can also be N, the larger the threshold, the greater the reliability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Selective Calling Equipment (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A Bluetooth broadcast packet-based code pairing remote control, controlled device, and method. The method comprises: step S1, monitoring in real time whether a code pairing button on a remote control is pressed, and if yes, proceeding to step S2; step S2, determining whether a code pairing button pressing holding duration exceeds a code pairing setting time threshold, and if yes, filling a code pairing identifier corresponding to the code pairing button into a Bluetooth broadcast packet and sending out the packet, and continuously sending the Bluetooth broadcast packet under the condition of holding press of the code pairing button; step S3, upon the reception of the Bluetooth broadcast packet, a controlled device parsing the Bluetooth broadcast packet and determining whether the Bluetooth broadcast packet contains a code pairing identifier, and if yes, obtaining the ID of a corresponding remote control according to the Bluetooth broadcast packet and recording the ID; and step S4, when the number of times the controlled device receives the Bluetooth broadcast packets corresponding to the ID of the same remote control is greater than or equal to a threshold of the number of Bluetooth broadcast packets required for successful pairing, determining that the remote control is successfully paired, and saving the ID of the remote control that has been successfully paired.

Description

一种基于蓝牙广播包实现对码的遥控器、受控设备及方法A remote controller, controlled device and method for realizing code matching based on Bluetooth broadcast packets 技术领域technical field
本发明涉及蓝牙技术领域,特别是涉及一种基于蓝牙广播包实现对码的遥控器、受控设备及方法。The invention relates to the field of Bluetooth technology, in particular to a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet.
背景技术Background technique
随着技术的发展,对很多设备的控制都可以通过遥控器来控制,例如,智能电视、无线鼠标、各种各样的播放器、智能灯具等,市面上的遥控器也出现了很多种,如红外遥控器控制,RF遥控器控制,蓝牙遥控控制等等。With the development of technology, the control of many devices can be controlled by remote controllers, such as smart TVs, wireless mice, various players, smart lamps, etc. There are also many kinds of remote controllers on the market. Such as infrared remote control, RF remote control, Bluetooth remote control and so on.
遥控器是一种无线发射装置,通过现代的数字编码技术,将按键信息进行编码,通过红外线或其它无线信号发送给接收端,接收端将收到的红外信号或无线信号转变成电信号,进处理器进行解码,解调出相应的指令来达到控制相关设备完成所需操作要求的目的,其最大的优点就是不需要近距离接触受控设备也能实现对其进行控制。The remote control is a wireless transmitting device. It encodes the key information through modern digital coding technology and sends it to the receiving end through infrared or other wireless signals. The receiving end converts the received infrared signal or wireless signal into an electrical signal, The processor decodes and demodulates the corresponding instructions to achieve the purpose of controlling the relevant equipment to complete the required operation requirements. Its biggest advantage is that it can also be controlled without close contact with the controlled equipment.
目前,遥控器的使用涉及通码和对码两种情况。通码是指受控设备不识别遥控器ID,任何遥控器都可以对其进行控制。对码则是指进行对码操作后,受控设备把遥控器ID保存,接收指令后核对是否为对码过的遥控器发出,受控设备只能被对过码的遥控器进行控制,能进行对码的遥控器能防止其它遥控器干扰,能多套遥控器和受控设备同时使用,因此受到更大青睐。At present, the use of the remote control involves two situations: pass code and pair code. The passcode means that the controlled device does not recognize the remote control ID, and any remote control can control it. Code matching means that after the code matching operation, the controlled device saves the remote control ID. After receiving the command, it checks whether it is sent by the code-matched remote control. The controlled device can only be controlled by the code-matched remote control. The remote control that is paired can prevent interference from other remote controls, and can use multiple sets of remote controls and controlled devices at the same time, so it is more favored.
现在单向遥控器分红外遥控器,RF遥控器等;RF遥控器分315MHz、433MHz、2.4GHz等频段,2.4GHz频段遥控器也分了私有协议的遥控器,基于蓝牙广播包的遥控器等;其中,基于蓝牙广播包的单向遥控器以其传输距离远、功耗低、无障碍、支持更多复杂的协议等优点而被广泛使用,但基于蓝牙广播包的单向遥控器只能单向发送信号,不能建立蓝牙连接。Now one-way remote control is divided into infrared remote control, RF remote control, etc.; RF remote control is divided into 315MHz, 433MHz, 2.4GHz and other frequency bands, 2.4GHz frequency band remote control is also divided into private protocol remote control, remote control based on Bluetooth broadcast package, etc. ; Among them, the one-way remote control based on the Bluetooth broadcast package is widely used for its advantages of long transmission distance, low power consumption, barrier-free, and support for more complex protocols, but the one-way remote control based on the Bluetooth broadcast package can only The signal is sent in one direction, and a Bluetooth connection cannot be established.
现有基于蓝牙广播包的单向遥控器对码方法如下:The existing one-way remote control pairing method based on Bluetooth broadcast packet is as follows:
长按对码键,遥控器连续发送蓝牙广播包,受控设备检测到一定量蓝牙广播包完成对码。Long press the pairing button, the remote control sends Bluetooth broadcast packets continuously, and the controlled device detects a certain amount of Bluetooth broadcast packets to complete the pairing.
然而上述方法会存在如下缺点:由于无线信号容易受到干扰,因此遥控器连续发送蓝牙信号受控设备不一定能全部收到,在某些受干扰严重的情况下,接收率比较低。如果约定接收蓝牙广播包的数量比较大,则检测时间比较长,如果约定接收蓝牙广播包的数量少,则稳定性差,容易误触发。因此,基于蓝牙广播包的单向遥控器采用上述方法进行对码时,稳定性不高。However, the above method has the following disadvantages: because the wireless signal is easily interfered, the controlled devices may not be able to receive all the Bluetooth signals continuously sent by the remote control, and the reception rate is relatively low in some cases of severe interference. If the agreed number of received Bluetooth broadcast packets is relatively large, the detection time will be relatively long. If the agreed number of received Bluetooth broadcast packets is small, the stability will be poor and false triggering will be easy. Therefore, when the one-way remote control based on the Bluetooth broadcast packet adopts the above method to perform code matching, the stability is not high.
发明内容SUMMARY OF THE INVENTION
为克服上述现有技术存在的不足,本发明之目的在于提供一种基于蓝牙广播包实现对码的遥控器、受控设备及方法,以提高基于蓝牙广播包实现遥控器对码操作的可靠性。In order to overcome the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a remote controller, a controlled device and a method for realizing code matching based on a bluetooth broadcast packet, so as to improve the reliability of the remote controller's code matching operation based on the bluetooth broadcast packet. .
为达上述及其它目的,本发明提出一种基于蓝牙广播包实现对码的遥控器,其上设置对码键,包括:In order to achieve the above and other purposes, the present invention proposes a remote controller for realizing code matching based on a Bluetooth broadcast packet, on which a code matching key is provided, including:
按键监测单元,用于实时监测所述遥控器上的对码键是否按下,若监测到对码键按下,则进入长按判断单元;a key monitoring unit, used to monitor in real time whether the code pair key on the remote control is pressed, and if it is detected that the code pair key is pressed, enter the long-press judgment unit;
长按判断单元,用于判断对码键的持续按键时间是否超过预设的对码设置时间阈值,若超过预设的对码设置时间阈值,则进入对码标识发送单元;The long-pressing judgment unit is used for judging whether the continuous key-pressing time of the code-matching key exceeds the preset code-matching setting time threshold, and if it exceeds the preset code-setting time threshold, the code-matching identification sending unit is entered;
对码标识发送单元,用于生成对码标识,将对码标识填充到蓝牙广播包并发送,即将对码标识以蓝牙广播包的形式发送出去,若未超过预设的对码设置时间阈值,则继续等待并实时监测对码键;The code matching identification sending unit is used to generate the matching code identification, fill the matching identification identification into the Bluetooth broadcast packet and send it, that is, send the matching code identification in the form of a Bluetooth broadcast packet. If the preset code matching time threshold is not exceeded, Then continue to wait and monitor the code key in real time;
持续监测单元,用于在所述对码标识发送单元发送蓝牙广播包后,持续判断对码键是否保持按下状态,若是,则返回所述对码标识发送单元继续发送含有对码标识的蓝牙广播包。The continuous monitoring unit is used for continuously judging whether the pairing key is kept pressed after the pairing identifier sending unit sends the Bluetooth broadcast packet, and if so, returning to the pairing identifier sending unit to continue to send the bluetooth containing the pairing identifier broadcast packets.
优选地,当所述长按判断单元判断出使用者对对码键的持续按键时间超过 对码设置时间阈值时,则按键标识由短按标识改为长按的对码标识,所述对码标识发送单元将该长按的对码标识填充到蓝牙广播包发送出去。Preferably, when the long-press judging unit determines that the user's continuous pressing time on the code-matching key exceeds the code-matching setting time threshold, the key identifier is changed from a short-press identifier to a long-pressed code-matching identifier. The identifier sending unit fills the long-pressed pairing identifier into the Bluetooth broadcast packet and sends it out.
为达到上述目的,本发明还提供一种基于蓝牙广播包实现对码的受控设备,包括:In order to achieve the above object, the present invention also provides a controlled device for realizing code matching based on a Bluetooth broadcast packet, including:
蓝牙广播包解析单元,用于在接收到蓝牙广播包时,解析蓝牙广播包,判断该蓝牙广播包是否含有对码标识,若含有对码标识,则根据蓝牙广播包获取遥控器ID并予以记录;The bluetooth broadcast packet parsing unit is used to analyze the bluetooth broadcast packet when receiving the bluetooth broadcast packet, and determine whether the bluetooth broadcast packet contains the code matching identification. ;
对码成功确定单元,用于在接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于预设的成功对码的蓝牙广播包数量阀值时,确定该遥控器对码成功,并保存对码成功的遥控器ID。A code-matching success determination unit is used to determine the remote-controller's code-matching when the number of received Bluetooth broadcast packets containing the code-matching identifier of the same remote control ID is greater than or equal to a preset threshold for the number of Bluetooth broadcast packets for successful code-matching Successful, and save the remote control ID that has been successfully paired.
优选地,若接收的蓝牙广播包含有对码标识,所述蓝牙广播包解析单元还将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。Preferably, if the received Bluetooth broadcast contains a code pairing identifier, the Bluetooth broadcast packet parsing unit also compares the currently obtained remote control ID with the saved remote control ID with successful code matching, if the currently obtained remote control ID If it already exists in the saved remote control ID with successful code matching, exit the current remote control code matching process.
优选地,所述受控设备还包括扫描单元,用于在受控设备上电启动,启动蓝牙广播包扫描,于扫描到蓝牙广播信号时,启动所述蓝牙广播包解析单元。Preferably, the controlled device further includes a scanning unit for starting the controlled device when it is powered on, starting the scanning of Bluetooth broadcast packets, and starting the Bluetooth broadcast packet parsing unit when a Bluetooth broadcast signal is scanned.
优选地,所述蓝牙广播包解析单元在判断出该蓝牙广播包包含对码标识时,还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并予以记录,并且所述对码成功确定单元在没有超过预设的对码限定时间阈值时,在接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值时,判断该遥控器对码成功。Preferably, when the Bluetooth broadcast packet parsing unit determines that the Bluetooth broadcast packet contains a code matching identifier, it further judges whether the time when the Bluetooth broadcast packet is received exceeds a preset time limit for code matching. If the time threshold is limited, then the remote control ID is obtained according to the Bluetooth broadcast packet and recorded, and when the code matching success determination unit does not exceed the preset time limit for code matching, the received code containing the same remote control ID contains the matching code. When the number of identified Bluetooth broadcast packets is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote control is successfully paired.
为达到上述目的,本发明还提供一种基于蓝牙广播包实现对码的方法,包括如下步骤:In order to achieve the above object, the present invention also provides a method for realizing code matching based on a Bluetooth broadcast packet, comprising the following steps:
步骤S1,遥控器实时监测其上对码键是否按下,若按下,则进入步骤S2;Step S1, the remote controller monitors in real time whether the code pair key on it is pressed, and if pressed, then enters step S2;
步骤S2,判断所述对码键的持续按键时间是否超过预设的对码设置时间阈 值,若超过预设的对码设置时间阈值,则将所述对码键对应的对码标识填充到蓝牙广播包并发送出去,并在连续按下对码键的情况下连续发送包含所述对码标识的蓝牙广播包;Step S2, judging whether the continuous pressing time of the pairing key exceeds a preset pairing setting time threshold, and if it exceeds the preset pairing setting time threshold, then fill the pairing identifier corresponding to the pairing key into the Bluetooth broadcast the packet and send it out, and continuously send the Bluetooth broadcast packet containing the pair code identifier under the condition of continuously pressing the code pair key;
步骤S3,受控设备于接收到蓝牙广播包时,解析所述蓝牙广播包,判断所述蓝牙广播包是否含有对码标识,若含有对码标识,则根据所述蓝牙广播包获取相应的遥控器ID并予以记录;Step S3, when receiving the Bluetooth broadcast packet, the controlled device parses the Bluetooth broadcast packet, and determines whether the Bluetooth broadcast packet contains a pairing identifier, and if it contains a pairing identifier, obtains a corresponding remote control according to the Bluetooth broadcast packet. device ID and record it;
步骤S4,当所述受控设备接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于预设的成功对码的蓝牙广播包数量阀值,则判断该遥控器对码成功,并保存对码成功的遥控器ID。Step S4, when the number of times that the controlled device receives the bluetooth broadcast packets with the same remote control ID that contains the code pairing identifier is greater than or equal to the preset threshold of the number of bluetooth broadcast packets that successfully pair codes, then determine that the remote control pair codes. Successful, and save the remote control ID that has been successfully paired.
优选地,于步骤S2中,当所述对码键的持续按键时间超过对码设置时间阈值时,则按键标识由短按标识改为长按的对码标识,并将该长按的对码标识填充到蓝牙广播包中发送出去。Preferably, in step S2, when the continuous pressing time of the pairing key exceeds the setting time threshold for pairing, the key identifier is changed from a short-press identifier to a long-pressed pairing identifier, and the long-pressed pairing identifier is changed. The identity is filled into the Bluetooth broadcast packet and sent out.
优选地,于步骤S3中,将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。Preferably, in step S3, the currently obtained remote control ID is compared with the saved remote control ID with successful code matching, if the currently obtained remote control ID already exists in the saved remote control ID with successful code matching, Then exit the code matching process of the current remote control.
优选地,于步骤S3中,当判断出该蓝牙广播包包含对码标识时,还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并予以记录,若超过所述对码限定时间阈值,则结束当前对码流程;于骤S4中,在没有超过预设的对码限定时间阈值时,当接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值,确定该遥控器对码成功。Preferably, in step S3, when it is judged that the Bluetooth broadcast packet contains a code matching identifier, it is further judged whether the time when the Bluetooth broadcast packet is received exceeds a preset code matching time limit, and if it does not exceed the code matching time limit Threshold, then obtain the remote control ID according to the Bluetooth broadcast packet and record it, if it exceeds the limit time threshold for code matching, then end the current code matching process; in step S4, when the preset time limit for code matching does not exceed the threshold value, When the number of received Bluetooth broadcast packets with the same remote control ID containing the pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote controller is successfully paired.
与现有技术相比,本发明一种基于蓝牙广播包实现对码的遥控器、受控设备及方法通过使受控设备只在上电的一定时间内执行对码,可以有效防止受控设备受到干扰导致误对码,并通过长按对码键到对码设置时间阈值后,按键标识由短按标识改为长按对码标识,发送包含对码标识的蓝牙广播包,以通过短按和长按使用不同标识的方法,防止短按对码的误触发,同时本发明在触发对 码后,由遥控器端连续发送蓝牙广播包,受控设备只需要检测少量次数含有对码标识的蓝牙广播包即可完成对码,可以保证对码操作的可靠性。Compared with the prior art, a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet of the present invention can effectively prevent the controlled device from performing code matching only within a certain period of time when the controlled device is powered on. The code is incorrectly paired due to interference, and after the time threshold is set by pressing the pairing button for a long time, the button identification is changed from the short-pressing mark to the long-pressing the pairing mark, and a Bluetooth broadcast packet containing the pairing mark is sent. The method of using different identifications with long presses prevents false triggering of the code pairing by short presses. At the same time, after triggering the pairing codes, the remote control terminal continuously sends the Bluetooth broadcast packets, and the controlled device only needs to detect a small number of times that the codes contain the pairing codes. The Bluetooth broadcast packet can complete the code matching, which can ensure the reliability of the code matching operation.
附图说明Description of drawings
图1为本发明一种基于蓝牙广播包实现对码的遥控器的结构示意图;1 is a schematic structural diagram of a remote controller for realizing code matching based on a Bluetooth broadcast packet of the present invention;
图2为本发明一种基于蓝牙广播包实现对码的受控设备的结构示意图;2 is a schematic structural diagram of a controlled device that implements code matching based on a Bluetooth broadcast packet of the present invention;
图3为本发明一种基于蓝牙广播包实现遥控器对码的方法的步骤流程图;3 is a flow chart of the steps of a method for implementing remote control code pairing based on a Bluetooth broadcast packet according to the present invention;
图4为本发明实施例中遥控器端对码操作的工作流程图;4 is a work flow diagram of a remote control end-to-code operation in an embodiment of the present invention;
图5为本发明实施例中受控设备检测遥控器信号工作流程图;FIG. 5 is a working flowchart of the controlled device detecting the remote control signal in the embodiment of the present invention;
图6为本发明实施例中受控设备的遥控器处理流程图。FIG. 6 is a flowchart of remote control processing of a controlled device in an embodiment of the present invention.
具体实施方式Detailed ways
以下通过特定的具体实例并结合附图说明本发明的实施方式,本领域技术人员可由本说明书所揭示的内容轻易地了解本发明的其它优点与功效。本发明亦可通过其它不同的具体实例加以施行或应用,本说明书中的各项细节亦可基于不同观点与应用,在不背离本发明的精神下进行各种修饰与变更。The embodiments of the present invention will be described below through specific examples and in conjunction with the accompanying drawings, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific examples, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the spirit of the present invention.
在说明本发明之前,先定义本发明所涉及的几个概念:Before explaining the present invention, define several concepts involved in the present invention:
对码限定时间阈值:受控设备在上电后若干时间内能接受对码操作,超过此时间,不接受对码申请,此时间为对码限定时间。Code-matching time limit: The controlled device can accept code-matching operations within a certain period of time after it is powered on. After this time, the code-matching application will not be accepted. This time is the code-matching time limit.
对码设置时间阈值:遥控器进行对码时,要按下对码键若干时间才发送含有对码标识的蓝牙广播包,此时间为对码设置时间。Setting time threshold for code matching: When the remote control performs code matching, it takes a certain period of time to press the code matching key to send the Bluetooth broadcast packet containing the matching code identification. This time is the code matching setting time.
成功对码的蓝牙广播包数量阈值:用于判断对码成功需要接收到的含有对码标识的蓝牙广播包数量。Threshold of the number of Bluetooth broadcast packets for successful code pairing: used to determine the number of Bluetooth broadcast packets containing the code pair identifier that need to be received for successful code pairing.
图1为本发明一种基于蓝牙广播包实现对码的遥控器的结构示意图。如图1所示,本发明一种基于蓝牙广播包实现对码的遥控器,其上设置有对码键,包括:FIG. 1 is a schematic structural diagram of a remote controller for realizing code matching based on a Bluetooth broadcast packet according to the present invention. As shown in Figure 1, the present invention is a remote controller for realizing code matching based on a Bluetooth broadcast packet, which is provided with a code matching key, including:
按键监测单元101,用于实时监测所述遥控器上的对码键是否按下,若监测到对码键按下,则进入长按判断单元102,否则继续监测。The key monitoring unit 101 is used to monitor in real time whether the pairing key on the remote control is pressed. If it is detected that the pairing key is pressed, enter the long-press judging unit 102, otherwise continue monitoring.
在本发明中,所述遥控器为含有蓝牙芯片或者RF芯片,可通过蓝牙广播方式发送蓝牙广播包的遥控器,该遥控器上设置有对码键,该对码键可以为单个按键,也可以包括多个按键组合为对码键,对对码键的状态进行监控,实时监测使用者是否按下该对码键,若监测到使用者按下该对码键,则进入长按判断单元102。In the present invention, the remote controller is a remote controller that contains a Bluetooth chip or an RF chip, and can send a Bluetooth broadcast packet through a Bluetooth broadcast method. The remote controller is provided with a pairing key, which can be a single key, or a pairing key. It can include a combination of multiple keys to form a pairing key, monitor the state of the pairing key, and monitor whether the user presses the pairing key in real time. If it is detected that the user presses the pairing key, the long press judgment unit 102.
长按判断单元102,用于判断对码键的持续按键时间是否超过预设的对码设置时间阈值,若超过预设的对码设置时间阈值,则进入对码标识发送单元103;否则若未超过预设的对码设置时间阈值,则继续等待并实时监测对码键。Long press the judgment unit 102, for judging whether the continuous pressing time of the code key exceeds the preset code setting time threshold, if it exceeds the preset code setting time threshold, then enter the code matching identification sending unit 103; otherwise, if not If the preset time threshold for pairing is exceeded, continue to wait and monitor the pairing key in real time.
对码标识发送单元103,用于生成对码标识,将对码标识填充到蓝牙广播包并发送,即将对码标识以蓝牙广播包的形式发送出去,若未超过预设的对码设置时间阈值,则继续等待并实时监测对码键。The pairing identification sending unit 103 is used to generate the pairing identification, fill the pairing identification into the Bluetooth broadcast packet and send it, that is, send the pairing identification in the form of a Bluetooth broadcast packet, if the preset pairing setting time threshold is not exceeded , continue to wait and monitor the code key in real time.
在本发明中,遥控器的系统中预先设置有对码设置时间阈值,当使用者开始按下对码键时,产生短按标识,当长按判断单元102判断出使用者对对码键的持续按键时间超过对码设置时间阈值时,则按键标识由短按标识改为长按的对码标识,对码标识发送单元103将该长按的对码标识填充到蓝牙广播包发送出去,所述蓝牙广播包即为按照规定的格式发送的命令,除包含对码标识外,还包含遥控器相关控制标识信息,例如遥控器ID等,遥控器ID可以为MAC地址或者其它不重复的信息标识。也就是说,当该遥控器进行对码时,当按下对码键时,并不是立即而是要按下对码键一定时间后才会发送含有对码标识的蓝牙广播包,此时间即为对码设置时间阈值,本发明通过设置对码设置时间阈值,使得遥控器只在监测到长按对码键到预设的对码设置时间阈值后,才将长按对码标识填充到蓝牙广播包发送出去,本发明的对码操作使用长按按键能有效避免短按导致的误触发,采用长按超过对码设置时间阈值后,按键标识由短按标识改为长按对码标识,并将长按对码标识填充到蓝牙广播包并发送出去, 此方法来实现长按操作更为可靠。In the present invention, the system of the remote controller is preset with a code setting time threshold. When the user starts to press the code key, a short-pressing mark is generated. When the continuous key press time exceeds the set time threshold for the code pairing, the key identifier is changed from a short press identifier to a long-pressed pairing identifier. The above-mentioned Bluetooth broadcast packet is a command sent in a specified format. In addition to the code identification, it also includes the relevant control identification information of the remote control, such as the remote control ID, etc. The remote control ID can be a MAC address or other non-repetitive information identification. . That is to say, when the remote control performs code pairing, when the pair code button is pressed, the Bluetooth broadcast packet containing the code pair identifier will be sent not immediately but after a certain period of time. For setting the time threshold for code matching, the present invention sets the time threshold for code matching, so that the remote controller only fills the long-pressing code-matching logo into the Bluetooth after monitoring the long-pressing of the code-matching key to the preset code-matching setting time threshold. After the broadcast packet is sent out, the long-pressing button in the code-matching operation of the present invention can effectively avoid false triggering caused by short-pressing. Filling the long-press pair code identifier into the Bluetooth broadcast packet and sending it out, this method is more reliable to realize the long-press operation.
持续监测单元104,用于在对码标识发送单元103发送蓝牙广播包后,持续判断对码键是否保持按下状态,若是,则返回对码标识发送单元103再次发送含有对码标识的蓝牙广播包,否则返回按键监测单元101重新监测等待对码键按下。The continuous monitoring unit 104 is used for continuously judging whether the pairing key is kept pressed after the pairing identifier sending unit 103 sends the Bluetooth broadcast packet, and if so, returning to the pairing identifier sending unit 103 to send the bluetooth broadcast containing the pairing identifier again Otherwise, return to the key monitoring unit 101 to monitor again and wait for the code key to be pressed.
图2为本发明一种基于蓝牙广播包实现对码的受控设备的结构示意图。如图2所示,本发明一种基于蓝牙广播包实现对码的受控设备,包括:FIG. 2 is a schematic structural diagram of a controlled device that implements code matching based on a Bluetooth broadcast packet according to the present invention. As shown in Figure 2, a controlled device for realizing code matching based on a Bluetooth broadcast packet of the present invention includes:
蓝牙广播包解析单元210,用于在接收到蓝牙广播包时,解析蓝牙广播包,判断该蓝牙广播包是否含有对码标识,若含有对码标识,则根据蓝牙广播包获取遥控器ID并予以记录,若该蓝牙广播包中不含有对码标识,则表示为对码之外的蓝牙广播包,则对该蓝牙广播包进行对码之外的其他标识处理。The bluetooth broadcast packet parsing unit 210 is used to analyze the bluetooth broadcast packet when receiving the bluetooth broadcast packet, and determine whether the bluetooth broadcast packet contains a code matching identifier, and if it contains a code matching identifier, obtain the remote control ID according to the Bluetooth broadcast packet and assign it Record, if the Bluetooth broadcast packet does not contain a code matching identifier, it is indicated as a Bluetooth broadcast packet other than the code matching, and the Bluetooth broadcast packet is processed for other identifications other than the code matching.
优选地,若接收的蓝牙广播包含有对码标识,蓝牙广播包解析单元210还将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。Preferably, if the received Bluetooth broadcast contains a code pairing identifier, the Bluetooth broadcast packet parsing unit 210 also compares the currently obtained remote control ID with the saved remote control ID with successful code pairing. If it exists in the saved remote control ID with successful code matching, it will exit the current remote control code matching process.
对码成功确定单元211,用于在接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值时,确定该遥控器对码成功,并保存对码成功的遥控器ID,将对码成功的遥控器ID保存到存储区,这样不会因掉电而丢失,后续每次接收到控制命令则都会验证遥控器ID,以保证受控设备只对保存过的遥控器ID做对应操作,所述成功对码的蓝牙广播包数量阀值指的是预先设置的判断对码成功需要接收到的含有对码标识的蓝牙广播包数量。The code pairing success determination unit 211 is used to determine that the code pairing of the remote control is successful when the number of received bluetooth broadcast packets containing the code pairing identifier of the same remote control ID is greater than or equal to the threshold of the number of Bluetooth broadcast packets that have successfully paired codes, And save the ID of the remote control that has been successfully matched, and save the ID of the remote control that has been successfully matched to the storage area, so that it will not be lost due to power failure. The remote control ID will be verified every time a control command is received in the future to ensure that it is controlled. The device only performs corresponding operations on the saved remote control ID, and the threshold of the number of Bluetooth broadcast packets for successful code pairing refers to the preset number of Bluetooth broadcast packets containing the code pair identifier that need to be received to judge that the code pair is successful.
优选地,本发明一种基于蓝牙广播包实现对码的受控设备,还包括:Preferably, the present invention is a controlled device that implements code matching based on a Bluetooth broadcast packet, further comprising:
扫描单元212,用于在受控设备上电启动,启动蓝牙广播包扫描,于扫描到蓝牙广播信号时,启动蓝牙广播包解析单元210。The scanning unit 212 is used for starting the controlled device when it is powered on, starting the scanning of the Bluetooth broadcast packet, and starting the Bluetooth broadcast packet parsing unit 210 when the Bluetooth broadcast signal is scanned.
优选地,蓝牙广播包解析单元210在判断出该蓝牙广播包包含对码标识时, 还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并记录,所述对码限定时间阈值指的是预先设置的受控设备在上电后能接受对码操作的时间范围,即受控设备在上电后,只在该对码限定时间阈值内能接受对码操作,超过此时间,则不接受对码申请,同时,对码成功确定单元211需在没有超过预设的对码限定时间阈值时,在接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值时,判断该遥控器对码成功。Preferably, the Bluetooth broadcast packet parsing unit 210, when judging that the Bluetooth broadcast packet contains the code matching identifier, further judges whether the time when the Bluetooth broadcast packet is received exceeds the preset code matching time threshold, if not exceeds the code matching limit. If the time threshold is set, the remote control ID is obtained and recorded according to the Bluetooth broadcast packet. The code-matching time threshold refers to the preset time range within which the controlled device can accept the code-matching operation after power-on, that is, the controlled device is on the After the power is turned on, the code matching operation can only be accepted within the code matching limited time threshold. If this time is exceeded, the code matching application will not be accepted. , when the number of received Bluetooth broadcast packets with the same remote control ID containing the code pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it is determined that the remote control is successfully paired.
图3为本发明一种基于蓝牙广播包实现对码的方法的步骤流程图。本发明一种基于蓝牙广播包实现对码的方法,包括如下步骤:FIG. 3 is a flow chart of steps of a method for implementing code matching based on a Bluetooth broadcast packet according to the present invention. A method for realizing code matching based on a Bluetooth broadcast packet of the present invention comprises the following steps:
步骤S1,实时监测遥控器上的对码键是否按下,若按下,则进入步骤S2,否则继续监测。Step S1, monitor in real time whether the code pair key on the remote control is pressed, if pressed, go to step S2, otherwise continue monitoring.
在本发明中,所述遥控器为含有蓝牙芯片或者RF芯片、可通过蓝牙广播方式发送蓝牙广播包的遥控器,所述遥控器上设置有对码键,其对应对码标识,即当对码键被按压时,会产生相应的对码标识,该对码键可以为单个按键,也可以包括多个按键组合为对码键,对对码键的状态进行监控,实时监测使用者是否按下该对码键,若监测到使用者按下该对码键,则进入步骤S2。In the present invention, the remote control is a remote control that contains a Bluetooth chip or an RF chip and can send Bluetooth broadcast packets through Bluetooth broadcast. When the code key is pressed, a corresponding code pair identification will be generated. The code pair key can be a single key or a combination of multiple keys to form a code pair key. The state of the code key is monitored, and whether the user presses the key is monitored in real time. Press the pairing key, and if it is detected that the user presses the pairing key, step S2 is entered.
步骤S2,判断对码键的持续按键时间是否超过预设的对码设置时间阈值,若超过预设的对码设置时间阈值,则将所述对码键对应的对码标识填充到蓝牙广播包并发送,即将对码标识以蓝牙广播包的形式发送出去,若未超过预设的对码设置时间阈值,则继续等待并实时监测对码键。Step S2, judging whether the continuous pressing time of the pairing key exceeds the preset pairing setting time threshold, and if it exceeds the preset pairing setting time threshold, then fill the pairing identifier corresponding to the pairing key into the Bluetooth broadcast packet. And send, that is to say, the code matching identification is sent out in the form of a Bluetooth broadcast packet. If the preset code matching time threshold is not exceeded, continue to wait and monitor the code matching key in real time.
也就是说,所述遥控器的系统中需预先设置有对码设置时间阈值,当使用者开始按下对码键时,产生短按标识,当使用者对对码键的持续按键时间超过对码设置时间阈值时,则按键标识由短按标识改为长按的对码标识,并将该长按的对码标识填充到蓝牙广播包发送出去,所述对码标识可以为键值或者特别定义的一个用于对码的标识。也就是说,当该遥控器进行对码时,当按下对码 键时,并不是立即而是要按下对码键一定时间后才会发送含有对码标识的蓝牙广播包,此时间即为对码设置时间阈值。在本发明中,蓝牙广播包是指通过蓝牙广播方式按照规定的格式发送的蓝牙广播命令,包含遥控器相关控制标识信息,例如遥控器ID。That is to say, the system of the remote control needs to be pre-set with a code setting time threshold. When the user starts to press the code key, a short press mark is generated. When the user continues to press the code key for more than When the time threshold is set, the key identifier is changed from a short-press identifier to a long-pressed pairing identifier, and the long-pressed pairing identifier is filled into the Bluetooth broadcast packet and sent out. The pairing identifier can be a key value or a special identifier. A defined identifier used for code matching. That is to say, when the remote control performs code pairing, when the pair code button is pressed, the Bluetooth broadcast packet containing the code pair identifier will be sent not immediately but after a certain period of time. Set the time threshold for code matching. In the present invention, a Bluetooth broadcast packet refers to a Bluetooth broadcast command sent in a specified format through a Bluetooth broadcast method, and includes control identification information related to a remote control, such as a remote control ID.
本发明通过设置对码设置时间阈值,使得遥控器只有在监测到长按对码键到预设的对码设置时间阈值后,才将长按的对码标识填充到蓝牙广播包发送出去,本发明的对码操作使用长按对码键能有效避免短按导致的误触发,使得对码操作更为可靠。In the present invention, by setting the code setting time threshold, the remote controller fills the long-pressed code-pairing identifier into the Bluetooth broadcast packet and sends it out only after monitoring the long-pressing of the code-pairing key to the preset code-pairing setting time threshold. In the invention, the long-pressing of the code-matching key can effectively avoid false triggering caused by short-pressing, so that the code-matching operation is more reliable.
优选地,于步骤S2中,当发送蓝牙广播包后,持续判断对码键是否保持按下状态,若是,再次发送含有对码标识的蓝牙广播包,否则返回步骤S1重新监测等待对码键被按下。Preferably, in step S2, after the bluetooth broadcast packet is sent, it is continuously judged whether the pairing key is kept pressed, if so, the bluetooth broadcast packet containing the pairing identifier is sent again, otherwise it returns to step S1 to re-monitor and wait for the pairing key to be Press.
步骤S3,受控设备于接收到蓝牙广播包时,解析蓝牙广播包,判断该蓝牙广播包是否含有对码标识,若含有对码标识,则根据蓝牙广播包获取遥控器ID并予以记录;若该蓝牙广播包中不含有对码标识,则表示为对码之外的蓝牙广播包,则对该蓝牙广播包进行对码标识之外的其它标识处理。Step S3, when receiving the bluetooth broadcast packet, the controlled device parses the bluetooth broadcast packet, and judges whether the bluetooth broadcast packet contains a code-matching identifier, and if it contains a code-matching identifier, obtains the remote control ID according to the bluetooth broadcast packet and records it; The bluetooth broadcast packet does not contain a code matching identifier, and it is indicated as a bluetooth broadcast packet other than the code matching identifier, and the Bluetooth broadcast packet is processed with other identifiers than the code matching identifier.
在本发明中,所述受控设备指的是能解析蓝牙广播包、并需要遥控器进行控制的设备。In the present invention, the controlled device refers to a device that can parse Bluetooth broadcast packets and needs a remote controller to control.
优选地,于步骤S3中,将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。Preferably, in step S3, the currently obtained remote control ID is compared with the saved remote control ID with successful code matching, if the currently obtained remote control ID already exists in the saved remote control ID with successful code matching, Then exit the code matching process of the current remote control.
步骤S4,当受控设备接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值,则表示该遥控器对码成功,并保存对码成功的遥控器ID,即将对码成功的遥控器ID保存到存储区,这样不会因掉电而丢失,后续每次接收到控制命令则都会验证遥控器ID,以保证受控设备只对保存过的遥控器ID做对应操作。所述成功对码的蓝牙广播包数量阀值指的是预先设置的判断对码成功需要接收到的含有对码标识的蓝牙广播包数量。In step S4, when the number of times that the controlled device receives the Bluetooth broadcast packets containing the code pairing identifier of the same remote control ID is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, it means that the code pairing of the remote control is successful, and the pairing is saved. The ID of the remote control that has been successfully coded will be saved to the storage area, so that it will not be lost due to power failure, and the remote control ID will be verified each time a control command is received in the future to ensure that the controlled device can only be used for Do the corresponding operation with the saved remote control ID. The threshold of the number of Bluetooth broadcast packets for successful code pairing refers to a preset number of Bluetooth broadcast packets containing a code pair identifier that need to be received to judge that the code pair is successful.
优选地,于步骤S3之前,本发明一种基于蓝牙广播包实现遥控器对码的方法,还包括:Preferably, before step S3, a method for implementing remote control code matching based on a Bluetooth broadcast packet of the present invention further includes:
步骤S2-1,受控设备上电启动,启动蓝牙广播包扫描;Step S2-1, the controlled device is powered on and started, and the Bluetooth broadcast packet scanning is started;
步骤S2-2,判断是否扫描到蓝牙广播信号,如否则继续扫描,否则进入步骤S3。Step S2-2, determine whether the Bluetooth broadcast signal is scanned, if not, continue scanning, otherwise, go to step S3.
优选地,于步骤S3中,当判断出该蓝牙广播包包含对码标识时,还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并记录,所述对码限定时间阈值指的是预先设置的受控设备在上电后能接受对码操作的时间范围,即受控设备在上电后,只在该对码限定时间阈值内能接受对码操作,超过此时间,则不接受对码申请,同时于步骤S4中,在没有超过预设的对码限定时间阈值时,当接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值,则该遥控器对码成功。Preferably, in step S3, when it is judged that the Bluetooth broadcast packet contains a code matching identifier, it is further judged whether the time when the Bluetooth broadcast packet is received exceeds a preset code matching time limit, and if it does not exceed the code matching time limit Threshold, the remote control ID is obtained and recorded according to the Bluetooth broadcast packet. The code-matching time limit refers to the preset time range within which the controlled device can accept the code-matching operation after power-on, that is, the controlled device is powered on. After that, the code matching operation can only be accepted within the code matching time threshold, and beyond this time limit, the code matching application will not be accepted. The number of Bluetooth broadcast packets with the same remote control ID containing the code pairing identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, then the remote control is successfully paired.
可见,在本发明中,受控设备并不是实时都可以进行遥控器对码操作,对码过程要在受控设备上电一定的时间内执行,本发明通过限定受控设备上电后在对码限定时间阈值内才能对码,其它时间不接受对码申请,可以有效防止受控设备受到干扰导致误对码。It can be seen that in the present invention, the controlled device can not perform the remote control code matching operation in real time, and the code matching process should be performed within a certain period of time when the controlled device is powered on. The code can only be matched within the code limit time threshold, and the code matching application will not be accepted at other times, which can effectively prevent the controlled equipment from being interfered with and cause incorrect code matching.
实施例Example
图4为本发明实施例中遥控器端对码操作的工作流程图。在本实施例中,遥控器端的对码操作如下:FIG. 4 is a work flow diagram of a remote control end-to-end code operation in an embodiment of the present invention. In this embodiment, the code matching operation on the remote controller is as follows:
步骤S401,开始,一般为遥控器上电,开始工作;Step S401, start, generally the remote controller is powered on and starts to work;
步骤S402,判断对码键是否按下,若否则继续检测,若是则到S403;Step S402, determine whether the code key is pressed, if otherwise, continue to detect, if so, go to S403;
步骤S403,判断持续按下时间是否超过对码设置时间阈值,若否则继续等待并检测按键,若是则到S404。Step S403, it is judged whether the continuous pressing time exceeds the time threshold set for the code pairing, if otherwise, continue to wait and detect the button, and if so, go to S404.
步骤S404,把对码标识填充到蓝牙广播包并发送,将对码标识以蓝牙广播包的形式发送出去。Step S404, filling the pairing identifier into the Bluetooth broadcast packet and sending, and sending the pairing identifier in the form of a Bluetooth broadcast packet.
步骤S405,判断对码键是否保持按下状态,若否,则重新等待按键按下。若是则到S404,再次返回步骤S404发送含有对码标识的蓝牙广播包。Step S405, it is judged whether the code pair key is kept pressed, if not, wait for the key to be pressed again. If so, go to S404, and return to step S404 again to send the Bluetooth broadcast packet containing the pair code identifier.
图5为本发明实施例中受控设备检测遥控器信号工作流程图。在本实施例中,受控设备检测遥控器信号工作流程如下:FIG. 5 is a work flow chart of a controlled device detecting a remote control signal in an embodiment of the present invention. In this embodiment, the workflow for the controlled device to detect the remote control signal is as follows:
步骤S501,受控设备上电启动;Step S501, the controlled device is powered on and started;
步骤S502,开启蓝牙扫描,初始化各项参数,启动蓝牙广播包扫描。Step S502, enable Bluetooth scanning, initialize various parameters, and start scanning for Bluetooth broadcast packets.
步骤S503,判断是否扫描到蓝牙广播信号,如否则继续扫描,如是则进入S504。Step S503, determine whether the Bluetooth broadcast signal is scanned, if otherwise, continue scanning, if so, go to S504.
步骤S504,调用遥控器处理流程,完成后继续进行蓝牙广播包扫描。In step S504, the remote control processing flow is invoked, and after completion, the Bluetooth broadcast packet scanning is continued.
图6为本发明实施例中受控设备的遥控器处理流程图。在本实施例中,受控设备的遥控器处理流程如下:FIG. 6 is a flowchart of remote control processing of a controlled device in an embodiment of the present invention. In this embodiment, the remote control processing flow of the controlled device is as follows:
步骤S601,遥控器处理流程开始,为遥控器处理流程入口;Step S601, the remote control processing flow starts, which is the entry of the remote control processing flow;
步骤S602,判断接收到的蓝牙广播包是否含有对码标识,若否则进入S604,若是则进入S603;Step S602, judging whether the received Bluetooth broadcast packet contains a pair code identification, if otherwise, enter S604, if so, enter S603;
步骤S603,判断是否超过对码限定时间阈值,若是则进入S606;若否则进入S605;Step S603, judging whether the time limit for code matching is exceeded, if so, go to S606; otherwise, go to S605;
步骤S604,其它标识处理,即,如果不是对码标识,则做其它标识处理,处理完成后进入S606;Step S604, other identification processing, that is, if it is not a code identification, other identification processing is performed, and after the processing is completed, enter S606;
步骤S605,获取遥控器ID并予以记录,并在没有超过对码限定时间阈值的情况下,判断接收到的同一遥控器ID的对码蓝牙广播包的次数是否大于或等于成功对码的蓝牙广播包数量阀值,若是则对码成功,并把遥控器ID保存到存储区,后续每次接收到控制命令都会验证遥控器ID,以便只对保存过的遥控器ID做对应操作,进入步骤S606,若否,进入步骤S606。Step S605, obtain the remote control ID and record it, and judge whether the number of received Bluetooth broadcast packets of the same remote control ID is greater than or equal to the Bluetooth broadcast of successful code pairing under the condition that the time limit for code pairing is not exceeded. Packet quantity threshold, if it is, the code is successfully matched, and the remote control ID is saved in the storage area, and the remote control ID will be verified every time a control command is received subsequently, so that only the corresponding operation is performed on the saved remote control ID, and the process goes to step S606 , if not, go to step S606.
步骤S606,遥控器处理流程完成,退出调用程序,等待下一次调用。Step S606, the remote control processing flow is completed, the calling program is exited, and the next calling is awaited.
综上所述,本发明一种基于蓝牙广播包实现对码的遥控器、受控设备及方法通过使受控设备只在上电的一定时间内执行对码,可以有效防止受控设备受 到干扰导致误对码,并通过长按对码键到对码设置时间阈值后,按键标识由短按标识改为长按的对码标识,发送包含对码标识的蓝牙广播包,以通过短按和长按使用不同标识的方法,防止短按对码的误触发,同时本发明在触发对码后,由遥控器端连续发送蓝牙广播包,受控设备只需要检测少量次数含有对码标识的蓝牙广播包即可完成对码,可以保证对码操作的可靠性。In summary, a remote controller, a controlled device and a method for realizing code matching based on a Bluetooth broadcast packet of the present invention can effectively prevent the controlled device from being interfered by enabling the controlled device to perform code matching only within a certain period of time when it is powered on. After the time threshold is set by pressing the pairing button for a long time, the key identification is changed from the short-pressing mark to the long-pressing pairing mark, and a Bluetooth broadcast packet containing the pairing mark is sent. The method of using different identifiers for long presses prevents false triggering of the code pairing by short presses. At the same time, after triggering the pairing code, the remote control terminal continuously sends the Bluetooth broadcast packets, and the controlled device only needs to detect a small number of times the bluetooth containing the code pairing identifier. The broadcast packet can complete the code matching, which can ensure the reliability of the code matching operation.
与现有技术相比,本发明具有如下优点:Compared with the prior art, the present invention has the following advantages:
1、本发明的受控设备的对码过程需要在对码限定时间阈值内执行,保证受控设备上电后在对码限定时间阈值内才能对码,其它时间则不接受对码申请,这种方式不容易误对码。1. The code matching process of the controlled device of the present invention needs to be performed within the code matching time limit, to ensure that the code can be matched within the code matching time threshold after the controlled device is powered on, and the code matching application is not accepted at other times. This method is not easy to mistake the code.
2、本发明通过长按对码键超过对码设置时间阈值后,按键标识由短按标识改为长按对码标识,在连续按下对码键的情况下通过蓝牙广播包的方式连续发送带有对码标识的蓝牙广播包,对码操作使用长按按键能有效避免短按导致的误触发。2. In the present invention, after long-pressing the code-matching key exceeds the code-matching set time threshold, the key identifier is changed from a short-pressing identifier to a long-pressing-pairing identifier, and continuously sent by means of Bluetooth broadcast packets under the condition of continuously pressing the pairing key. For the Bluetooth broadcast package with the code pairing logo, long-pressing the button for the code-matching operation can effectively avoid false triggers caused by short presses.
3、本发明通过受控设备根据接收到的蓝牙广播包数量与成功对码的蓝牙广播包数量阀值的大小判定对码是否成功,该成功对码的蓝牙广播包数量阀值可以为1,也可以为N,阀值越大,可靠性越大。3. The present invention determines whether the code pairing is successful according to the number of Bluetooth broadcast packets received and the threshold value of the number of Bluetooth broadcast packets that have successfully paired codes. The threshold value of the number of Bluetooth broadcast packets that have successfully paired codes can be 1, It can also be N, the larger the threshold, the greater the reliability.
上述实施例仅例示性说明本发明的原理及其功效,而非用于限制本发明。任何本领域技术人员均可在不违背本发明的精神及范畴下,对上述实施例进行修饰与改变。因此,本发明的权利保护范围,应如权利要求书所列。The above-mentioned embodiments merely illustrate the principles and effects of the present invention, but are not intended to limit the present invention. Any person skilled in the art can modify and change the above embodiments without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be as listed in the claims.

Claims (10)

  1. 一种基于蓝牙广播包实现对码的遥控器,其上设置对码键,包括:A remote control for realizing code matching based on a Bluetooth broadcast packet, on which a code matching key is set, including:
    按键监测单元,用于实时监测所述遥控器上的对码键是否按下,若监测到对码键按下,则进入长按判断单元;a key monitoring unit, used to monitor in real time whether the code pair key on the remote control is pressed, and if it is detected that the code pair key is pressed, enter the long-press judgment unit;
    长按判断单元,用于判断对码键的持续按键时间是否超过预设的对码设置时间阈值,若超过预设的对码设置时间阈值,则进入对码标识发送单元;The long-pressing judgment unit is used for judging whether the continuous key-pressing time of the code-matching key exceeds the preset code-matching setting time threshold, and if it exceeds the preset code-setting time threshold, the code-matching identification sending unit is entered;
    对码标识发送单元,用于生成对码标识,将对码标识填充到蓝牙广播包并发送,即将对码标识以蓝牙广播包的形式发送出去,若未超过预设的对码设置时间阈值,则继续等待并实时监测对码键;The code matching identification sending unit is used to generate the matching code identification, fill the matching identification identification into the Bluetooth broadcast packet and send it, that is, send the matching code identification in the form of a Bluetooth broadcast packet. If the preset code matching time threshold is not exceeded, Then continue to wait and monitor the code key in real time;
    持续监测单元,用于在所述对码标识发送单元发送蓝牙广播包后,持续判断对码键是否保持按下状态,若是,则返回所述对码标识发送单元继续发送含有对码标识的蓝牙广播包。The continuous monitoring unit is used for continuously judging whether the pairing key is kept pressed after the pairing identifier sending unit sends the Bluetooth broadcast packet, and if so, returning to the pairing identifier sending unit to continue to send the bluetooth containing the pairing identifier broadcast packets.
  2. 如权利要求1所述的一种基于蓝牙广播包实现对码的遥控器,其特征在于:当所述长按判断单元判断出使用者对对码键的持续按键时间超过对码设置时间阈值时,则按键标识由短按标识改为长按的对码标识,所述对码标识发送单元将该长按的对码标识填充到蓝牙广播包发送出去。A remote controller for realizing code matching based on a Bluetooth broadcast packet according to claim 1, characterized in that: when the long-press judging unit determines that the user's continuous pressing time on the code matching key exceeds the code matching setting time threshold , the key identifier is changed from a short-press identifier to a long-pressed pairing identifier, and the pairing identifier sending unit fills the long-pressed pairing identifier into a Bluetooth broadcast packet and sends it out.
  3. 一种基于蓝牙广播包实现对码的受控设备,包括:A controlled device that implements code pairing based on Bluetooth broadcast packets, comprising:
    蓝牙广播包解析单元,用于在接收到蓝牙广播包时,解析蓝牙广播包,判断该蓝牙广播包是否含有对码标识,若含有对码标识,则根据蓝牙广播包获取遥控器ID并予以记录;The bluetooth broadcast packet parsing unit is used to analyze the bluetooth broadcast packet when receiving the bluetooth broadcast packet, and determine whether the bluetooth broadcast packet contains the code matching identification. ;
    对码成功确定单元,用于在接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于预设的成功对码的蓝牙广播包数量阀值时,确定该遥控器对码成功,并保存对码成功的遥控器ID。A code-matching success determination unit is used to determine the remote-controller's code-matching when the number of received Bluetooth broadcast packets containing the code-matching identifier of the same remote control ID is greater than or equal to a preset threshold for the number of Bluetooth broadcast packets for successful code-matching Successful, and save the remote control ID that has been successfully paired.
  4. 如权利要求3所述的一种基于蓝牙广播包实现对码的受控设备,其特征在于:若接收的蓝牙广播包含有对码标识,所述蓝牙广播包解析单元还将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥 控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。The controlled device that implements code matching based on a Bluetooth broadcast packet according to claim 3, wherein if the received Bluetooth broadcast contains a code matching identifier, the Bluetooth broadcast packet parsing unit will also use the currently acquired remote control to The ID is compared with the saved remote control ID with successful code matching. If the currently obtained remote control ID already exists in the saved remote control ID with successful code matching, exit the current remote control code matching process.
  5. 如权利要求4所述的一种基于蓝牙广播包实现对码的受控设备,其特征在于:所述受控设备还包括扫描单元,用于在受控设备上电启动,启动蓝牙广播包扫描,于扫描到蓝牙广播信号时,启动所述蓝牙广播包解析单元。A controlled device for realizing code matching based on a Bluetooth broadcast packet according to claim 4, wherein the controlled device further comprises a scanning unit, which is used to start the controlled device when it is powered on to start scanning the Bluetooth broadcast packet. , when the bluetooth broadcast signal is scanned, start the bluetooth broadcast packet parsing unit.
  6. 如权利要求5所述的一种基于蓝牙广播包实现对码的受控设备,其特征在于:所述蓝牙广播包解析单元在判断出该蓝牙广播包包含对码标识时,还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并予以记录,并且所述对码成功确定单元在没有超过预设的对码限定时间阈值时,在接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值时,判断该遥控器对码成功。The controlled device for realizing code matching based on a Bluetooth broadcast packet according to claim 5, wherein when the Bluetooth broadcast packet parsing unit determines that the Bluetooth broadcast packet contains a code matching identifier, it further judges that the received code is received Whether the time of the Bluetooth broadcast packet exceeds the preset time limit for code pairing, if it does not exceed the time limit for code pairing, the remote control ID is obtained according to the Bluetooth broadcast packet and recorded, and the successful code pairing determination unit does not exceed the time limit. When the preset time threshold for code pairing is limited, when the number of received Bluetooth broadcast packets with the same remote control ID containing the code pair identifier is greater than or equal to the threshold of the number of Bluetooth broadcast packets successfully paired, the remote control is judged to be paired. success.
  7. 一种基于蓝牙广播包实现对码的方法,包括如下步骤:A method for realizing code matching based on a Bluetooth broadcast packet, comprising the following steps:
    步骤S1,遥控器实时监测其上对码键是否按下,若按下,则进入步骤S2;Step S1, the remote controller monitors in real time whether the code pair key on it is pressed, and if pressed, then enters step S2;
    步骤S2,判断所述对码键的持续按键时间是否超过预设的对码设置时间阈值,若超过预设的对码设置时间阈值,则将所述对码键对应的对码标识填充到蓝牙广播包并发送出去,并在连续按下对码键的情况下连续发送包含所述对码标识的蓝牙广播包;Step S2, judging whether the continuous pressing time of the pairing key exceeds a preset pairing setting time threshold, and if it exceeds the preset pairing setting time threshold, then fill the pairing identifier corresponding to the pairing key into the Bluetooth broadcast the packet and send it out, and continuously send the Bluetooth broadcast packet containing the pair code identifier under the condition of continuously pressing the code pair key;
    步骤S3,受控设备于接收到蓝牙广播包时,解析所述蓝牙广播包,判断所述蓝牙广播包是否含有对码标识,若含有对码标识,则根据所述蓝牙广播包获取相应的遥控器ID并予以记录;Step S3, when receiving the Bluetooth broadcast packet, the controlled device parses the Bluetooth broadcast packet, and determines whether the Bluetooth broadcast packet contains a pairing identifier, and if it contains a pairing identifier, obtains a corresponding remote control according to the Bluetooth broadcast packet. device ID and record it;
    步骤S4,当所述受控设备接收到同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于预设的成功对码的蓝牙广播包数量阀值,则判断该遥控器对码成功,并保存对码成功的遥控器ID。Step S4, when the number of times that the controlled device receives the bluetooth broadcast packets with the same remote control ID that contains the code pairing identifier is greater than or equal to the preset threshold of the number of bluetooth broadcast packets that successfully pair codes, then determine that the remote control pair codes. Successful, and save the remote control ID that has been successfully paired.
  8. 如权利要求7所述的一种基于蓝牙广播包实现遥控器对码的方法,其特征在于:于步骤S2中,当所述对码键的持续按键时间超过对码设置时间阈值 时,则按键标识由短按标识改为长按的对码标识,并将该长按的对码标识填充到蓝牙广播包中发送出去。The method for realizing remote control code matching based on a Bluetooth broadcast packet according to claim 7, wherein in step S2, when the continuous pressing time of the code matching key exceeds the code matching setting time threshold, the key is pressed. The identification is changed from the short-press identification to the long-pressed pairing identification, and the long-pressed pairing identification is filled into the Bluetooth broadcast packet and sent out.
  9. 如权利要求8所述的一种基于蓝牙广播包实现遥控器对码的方法,其特征在于:于步骤S3中,将当前获取的遥控器ID与保存的对码成功的遥控器ID进行比对,若当前获取的遥控器ID已存在于保存的对码成功的遥控器ID中,则退出当前遥控器的对码流程。A method for realizing remote control code matching based on a Bluetooth broadcast packet as claimed in claim 8, characterized in that: in step S3, the currently obtained remote control ID is compared with the saved remote control ID with successful code matching. , if the currently obtained remote control ID already exists in the saved remote control IDs that have been successfully paired, exit the current remote control pairing process.
  10. 如权利要求9所述的一种基于蓝牙广播包实现遥控器对码的方法,其特征在于:于步骤S3中,当判断出该蓝牙广播包包含对码标识时,还进一步判断接收到该蓝牙广播包的时间是否超过预设的对码限定时间阈值,若未超过对码限定时间阈值,则根据蓝牙广播包获取遥控器ID并予以记录,若超过所述对码限定时间阈值,则结束当前对码流程;于骤S4中,在没有超过预设的对码限定时间阈值时,当接收到的同一遥控器ID的含有对码标识的蓝牙广播包的次数大于或等于成功对码的蓝牙广播包数量阀值,确定该遥控器对码成功。A method for realizing remote control code matching based on a Bluetooth broadcast packet as claimed in claim 9, wherein in step S3, when it is judged that the Bluetooth broadcast packet contains a code matching identifier, it is further judged that the Bluetooth broadcast packet is received. Whether the time of the broadcast packet exceeds the preset time limit for code pairing, if it does not exceed the time limit for code pairing, obtain the remote control ID according to the Bluetooth broadcast packet and record it; if it exceeds the time limit for code pairing, end the current The code matching process; in step S4, when the preset code matching time threshold is not exceeded, when the received number of the Bluetooth broadcast packets containing the code matching identifier of the same remote control ID is greater than or equal to the Bluetooth broadcast of the successful code matching The threshold of the number of packets determines that the remote control is successfully paired.
PCT/CN2021/107328 2021-03-12 2021-07-20 Bluetooth broadcast packet-based code pairing remote control, controlled device, and method WO2022188329A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110269552.2A CN112907930A (en) 2021-03-12 2021-03-12 Remote controller, controlled equipment and method for realizing code matching based on Bluetooth broadcast packet
CN202110269552.2 2021-03-12

Publications (1)

Publication Number Publication Date
WO2022188329A1 true WO2022188329A1 (en) 2022-09-15

Family

ID=76105048

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/107328 WO2022188329A1 (en) 2021-03-12 2021-07-20 Bluetooth broadcast packet-based code pairing remote control, controlled device, and method

Country Status (2)

Country Link
CN (1) CN112907930A (en)
WO (1) WO2022188329A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112907930A (en) * 2021-03-12 2021-06-04 江门市征极光兆科技有限公司 Remote controller, controlled equipment and method for realizing code matching based on Bluetooth broadcast packet
CN114120609B (en) * 2021-10-27 2023-11-14 深圳市芯中芯科技有限公司 Remote controller pairing, binding and pairing system and method based on Bluetooth broadcasting
CN115064164A (en) * 2022-05-31 2022-09-16 江门市征极光兆科技有限公司 Offline voice remote control method, device and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369945A (en) * 2007-08-16 2009-02-18 索尼株式会社 Remote control system, receiving device and electronic apparauts
US8736427B2 (en) * 2008-09-03 2014-05-27 Apple Inc. Intelligent infrared remote pairing
CN103985234A (en) * 2014-04-23 2014-08-13 杭州微纳科技有限公司 Remote control method based on bluetooth broadcast packet
CN106448113A (en) * 2016-11-09 2017-02-22 微鲸科技有限公司 Remote control pairing control method and multimedia playing terminal
CN110120147A (en) * 2019-05-16 2019-08-13 上海东软载波微电子有限公司 Wireless communication is to code method and system, reception device, emitter, medium
CN112907930A (en) * 2021-03-12 2021-06-04 江门市征极光兆科技有限公司 Remote controller, controlled equipment and method for realizing code matching based on Bluetooth broadcast packet

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103206765B (en) * 2012-01-17 2016-04-13 珠海格力电器股份有限公司 Pairing method and system for remote controller and air conditioner, remote controller and air conditioner
CN104318741B (en) * 2014-10-20 2018-02-02 小米科技有限责任公司 Bluetooth equipment control method and device
CN104661412B (en) * 2015-02-27 2018-02-27 王康 Intelligent dimming illuminator and its control method of auxiliary remote control and light fixture
CN105407453A (en) * 2015-11-23 2016-03-16 深圳还是威健康科技有限公司 Bluetooth pairing method and device
CN105554694B (en) * 2016-02-03 2018-09-14 贝尔特物联技术无锡有限公司 Utilize the method for bluetooth Beacon Broadcasting Control blue-tooth intelligence equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369945A (en) * 2007-08-16 2009-02-18 索尼株式会社 Remote control system, receiving device and electronic apparauts
US8736427B2 (en) * 2008-09-03 2014-05-27 Apple Inc. Intelligent infrared remote pairing
CN103985234A (en) * 2014-04-23 2014-08-13 杭州微纳科技有限公司 Remote control method based on bluetooth broadcast packet
CN106448113A (en) * 2016-11-09 2017-02-22 微鲸科技有限公司 Remote control pairing control method and multimedia playing terminal
CN110120147A (en) * 2019-05-16 2019-08-13 上海东软载波微电子有限公司 Wireless communication is to code method and system, reception device, emitter, medium
CN112907930A (en) * 2021-03-12 2021-06-04 江门市征极光兆科技有限公司 Remote controller, controlled equipment and method for realizing code matching based on Bluetooth broadcast packet

Also Published As

Publication number Publication date
CN112907930A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
WO2022188329A1 (en) Bluetooth broadcast packet-based code pairing remote control, controlled device, and method
US8094591B1 (en) Data carrier detector for a packet-switched communication network
EP2615869B1 (en) Systems for facilitating wireless communication and related methods
US20130178163A1 (en) Systems for Facilitating Wireless Communication and Related Methods
US20170071262A1 (en) Information pushing method and communication system
CN110913499B (en) Random access method, terminal and computer readable storage medium
CA2583352A1 (en) Detecting legacy spoofing in reduced functionality user terminals
US8954593B2 (en) Method and device for implementing remote control of a terminal
US20100268303A1 (en) Establishing a communication session between an implantable medical device and an external device using a burst period and a sniff interval
CN113490218A (en) Pairing method, pairing device, Bluetooth remote controller, intelligent device and storage medium
CN103337144B (en) Wireless network-based intelligent remote control method and wireless network-based terminal
WO2021223405A1 (en) Method and control terminal for activating network distribution mode of air conditioner
JP2006279822A (en) Wireless communication apparatus
CN102904784A (en) Intelligent home system of internet of things based on 433 wireless transceiving module
JP2003196775A (en) Meter reader
KR20120035047A (en) Apparatus for secure pairing in wireless communication and method thereof
CN112312386A (en) Equipment binding method and device and electronic equipment
CN105653923A (en) Authentication method, authentication device and terminal
CN106448113A (en) Remote control pairing control method and multimedia playing terminal
US7990886B2 (en) Network device and connection detection method thereof
CN113096373A (en) Remote controller, controlled equipment and method for realizing packet control based on Bluetooth broadcast packet
CN115767445A (en) Bluetooth broadcast two-way communication method and device, electronic equipment and storage medium
CN106044593B (en) Tower crane state monitoring method and device
US8538336B2 (en) Radio LSI device and interfering wave detecting circuit
US11272384B2 (en) Systems and methods for increasing the reliability of a wireless communication connection

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: 21929798

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21929798

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/02/2024)

122 Ep: pct application non-entry in european phase

Ref document number: 21929798

Country of ref document: EP

Kind code of ref document: A1