WO2018082428A1 - 一种兼顾通信速度和功耗的蓝牙通信方法及终端 - Google Patents

一种兼顾通信速度和功耗的蓝牙通信方法及终端 Download PDF

Info

Publication number
WO2018082428A1
WO2018082428A1 PCT/CN2017/105038 CN2017105038W WO2018082428A1 WO 2018082428 A1 WO2018082428 A1 WO 2018082428A1 CN 2017105038 W CN2017105038 W CN 2017105038W WO 2018082428 A1 WO2018082428 A1 WO 2018082428A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
bluetooth module
terminal
module
mcu
Prior art date
Application number
PCT/CN2017/105038
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
飞天诚信科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 飞天诚信科技股份有限公司 filed Critical 飞天诚信科技股份有限公司
Publication of WO2018082428A1 publication Critical patent/WO2018082428A1/zh
Priority to US16/197,305 priority Critical patent/US10743258B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0241Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where no transmission is received, e.g. out of range of the transmitter
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0238Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is an unwanted signal, e.g. interference or idle signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • H04W52/028Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof switching on or off only a part of the equipment circuit blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • H04W76/32Release of transport tunnels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • H04W76/34Selective release of ongoing connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0229Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is a wanted signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/27Transitions between radio resource control [RRC] states
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a Bluetooth communication method and terminal that take into consideration communication speed and power consumption.
  • the use of the Bluetooth 3.0 chip in the payment terminal ensures the communication speed, but the use of the Bluetooth 3.0 chip has the drawback of high standby power consumption. Since current POS machines use a built-in battery solution, high standby power consumption will shorten the service life of POS machines, and frequent charging will also affect the user experience.
  • the present invention provides a Bluetooth communication method and terminal that take into consideration communication speed and power consumption.
  • the technical solution of the present invention includes a terminal that takes into consideration communication speed and power consumption, and the terminal includes an MCU and a first Bluetooth module and a second Bluetooth module connected to the MCU;
  • the MCU is configured to power on the first Bluetooth module and the second Bluetooth module, where the first Bluetooth module and the second Bluetooth module have the same Bluetooth name, and the Bluetooth name includes Decoding the MAC address information of the first Bluetooth module;
  • the second Bluetooth module is configured to open a Bluetooth broadcast, send a broadcast packet containing a Bluetooth name to the host computer, and wait for a Bluetooth connection event; and also be used to initiate a Bluetooth connection event sent by the host computer to the host computer. Disconnect the event, disconnect from the host computer, enter the low power state;
  • the first Bluetooth module is configured to implement communication between the terminal and the host computer when establishing a connection with the host computer.
  • the terminal further includes a memory module connected to the MCU, the memory module is configured to store the Bluetooth name, and the MCU is configured to determine, according to the Bluetooth name stored in the storage module, whether to perform setting of Bluetooth
  • the operation of the name is to read the first Bluetooth module MAC address, form the Bluetooth name according to the first Bluetooth module MAC address and the terminal SN code, and set the first Bluetooth module and the second Bluetooth
  • the name corresponding to the module is the Bluetooth name; otherwise, the second Bluetooth module is triggered.
  • the second Bluetooth module is further configured to: when entering a low power consumption state, switch the Bluetooth broadcast from a normal broadcast state to a slow broadcast state; when awake, switch the Bluetooth broadcast back from the slow broadcast state Normal broadcast status.
  • the second Bluetooth module is further configured to enter a low power consumption state when waiting for the Bluetooth connection event to time out;
  • the MCU includes a timer module, and the timer module is specifically configured to: when the second Bluetooth module is detected to be waiting When the Bluetooth connection times out, the MCU is triggered to power off the first Bluetooth module; and the MCU is further configured to power on the first Bluetooth module when detecting that the second Bluetooth module is awake.
  • the technical solution of the present invention further includes a Bluetooth communication method that takes into consideration communication speed and power consumption.
  • the method includes: the first Bluetooth module and the second Bluetooth module of the terminal are powered on, and the second Bluetooth module turns on the Bluetooth broadcast, and is up.
  • the machine sends a broadcast package including a Bluetooth name, the first Bluetooth module and the second Bluetooth module have the same Bluetooth name, and the Bluetooth name includes the MAC address information of the first Bluetooth module;
  • the second Bluetooth module of the terminal When the second Bluetooth module of the terminal receives the Bluetooth connection event sent by the host computer, the second Bluetooth module initiates a disconnection event to the host computer, and the second Bluetooth module of the terminal disconnects from the host computer, where the The second Bluetooth module enters a low power state;
  • the terminal When the first Bluetooth module of the terminal establishes a connection with the host computer, the terminal communicates with the host computer.
  • the terminal Before the second Bluetooth module is enabled to open the Bluetooth broadcast, the terminal further includes: determining, by the terminal, whether to perform the operation of setting the Bluetooth name, if the terminal sets the same Bluetooth name for the first Bluetooth module and the second Bluetooth module, otherwise directly executing the The second Bluetooth module opens the Bluetooth broadcast.
  • the terminal sets the same Bluetooth name for the first Bluetooth module and the second Bluetooth module. Specifically, the MCU of the terminal reads the MAC address of the first Bluetooth module, according to the MAC address of the first Bluetooth module and the terminal SN. The code forms a Bluetooth name, and sets a name corresponding to the first Bluetooth module and the second Bluetooth module as the Bluetooth name.
  • the Bluetooth name is formed according to the first Bluetooth module MAC address and the terminal SN code, and the terminal SN code is spliced with the last six digits of the first Bluetooth module MAC address to obtain the Bluetooth name.
  • the second Bluetooth module when the first Bluetooth module of the terminal establishes a connection with the upper computer, the second Bluetooth module is in a low power consumption state.
  • the method further includes: switching the Bluetooth broadcast from a normal broadcast state to a slow broadcast state; and when the second Bluetooth module is awake, further comprising: broadcasting the Bluetooth broadcast from the The slow broadcast state switches back to the normal broadcast state.
  • the method further includes: when the second Bluetooth module waits for a Bluetooth connection event to time out, the first Bluetooth module is powered off, the second Bluetooth module enters a low power consumption state; when the second Bluetooth module is awakened, The first Bluetooth module is powered on and waits to establish a connection with the host computer.
  • the technical solution of the present invention further includes a terminal that balances communication speed and power consumption, and the terminal includes an MCU chip and a first Bluetooth chip and a second Bluetooth chip connected to the MCU chip;
  • the MCU chip is configured to power on the first Bluetooth chip and the second Bluetooth chip, where the first Bluetooth chip and the second Bluetooth chip have the same Bluetooth name, and the Bluetooth name includes MAC address information of the first Bluetooth chip;
  • the second Bluetooth chip is used to open a Bluetooth broadcast, send a broadcast packet containing a Bluetooth name to the host computer, and wait for a Bluetooth connection event; and is also used to initiate a Bluetooth connection event sent by the host computer to the host computer. Disconnect the event, disconnect from the host computer, enter the low power state;
  • the first Bluetooth chip is configured to implement communication between the terminal and the host computer when establishing a connection with the host computer.
  • the beneficial effects of the present invention are as follows: By lower cost, the Bluetooth payment terminal with the Felica transaction function reduces standby power consumption, reduces the charging frequency, and improves user experience.
  • FIG. 1 is a flowchart of a Bluetooth communication method for considering communication speed and power consumption according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a Bluetooth communication method for taking into consideration communication speed and low power consumption according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a terminal of a terminal that takes into consideration communication speed and power consumption according to Embodiment 3 of the present invention.
  • the terminal mentioned in this embodiment includes an MCU chip (hereinafter referred to as MCU) and two Bluetooth chips (hereinafter referred to as a first Bluetooth module and a second Bluetooth module).
  • MCU MCU chip
  • first Bluetooth module adopts Bluetooth of the BT Classic standard.
  • the chip, the second Bluetooth module uses a Bluetooth chip of the BLE standard.
  • the present embodiment implements a Bluetooth communication method that takes into consideration both communication speed and power consumption based on the above terminal, as shown in FIG. 1, and includes the following contents:
  • Step 101 The MCU is powered on, and the IO connected to the first Bluetooth module and the IO connected to the second Bluetooth module are initialized, and the first Bluetooth module and the second Bluetooth module are powered on.
  • the step further includes initializing a timer and a real-time clock.
  • Step 102 The MCU reads the MAC address of the first Bluetooth module, and forms a Bluetooth name according to the first Bluetooth module MAC address and the terminal SN code, and sets the name corresponding to the first Bluetooth module and the second Bluetooth module to be the Bluetooth name.
  • the MCU reads the first Bluetooth module MAC address by sending a read command to the first Bluetooth module; the MCU forms a Bluetooth name according to the read first Bluetooth module MAC address and the terminal SN code, respectively, to the first Bluetooth module and The second Bluetooth module sends a setting instruction, and the names corresponding to the first Bluetooth module and the second Bluetooth module are all set to the Bluetooth name.
  • the Bluetooth name is formed according to the first Bluetooth module MAC address and the terminal SN code, and the terminal SN code is spliced with the last six digits of the first Bluetooth module MAC address to obtain a Bluetooth name.
  • the first Bluetooth module MAC address is 3481F40A05CF
  • the terminal SN code is 1234567890
  • the Bluetooth name is set to 12345678900A05CF.
  • the MCU may further determine that the MCU needs to perform the operation of setting the Bluetooth name. If yes, go to step 102. Otherwise, the MCU enters the idle state, and the second Bluetooth module enters low power consumption, and step 112 is performed.
  • the operation of determining, by the MCU, whether to perform the setting of the Bluetooth name may determine whether the Bluetooth name needs to be set by determining whether the preset flag is set, and if the preset flag is set, the first Bluetooth module is not required.
  • the second Bluetooth module sets the Bluetooth name, otherwise the Bluetooth name needs to be set for the first Bluetooth module and the second Bluetooth module, and the preset flag is set.
  • the preset flag bit is set, and the operation of setting the Bluetooth name may be omitted, and after the step 101, the MCU enters the idle state, and the second Bluetooth module enters the low state. Power consumption status, and step 112 is performed.
  • the terminal has set the same Bluetooth name for the first Bluetooth module and the second Bluetooth module before leaving the factory.
  • Step 102 may be omitted corresponding to the process provided in this implementation, and step 103 is directly executed after step 101.
  • the Bluetooth name is obtained by splicing the terminal SN code with the last six digits of the MAC address of the first Bluetooth module.
  • Step 103 The MCU initializes various parameters.
  • the parameters initialized by the MCU include a sleep time interval, an automatic shutdown time interval, a version number, and a system language.
  • Step 104 The MCU enters the idle state and waits for the Bluetooth connection; if it waits for the Bluetooth connection event to time out, step 105 is performed, and if the second Bluetooth module receives the Bluetooth connection event, step 111 is performed;
  • the timer further includes: if the timer reaches the preset sleep time interval and the second Bluetooth module does not receive the Bluetooth connection event, it is determined to wait for the Bluetooth connection event. Timeout is performed in step 105.
  • Step 105 The MCU sends a sleep instruction to the second Bluetooth module.
  • the sleep instruction is: 0xaa 0x55 0x01 0x00 0x00 0xFE.
  • Step 106 The MCU determines whether the response of the second Bluetooth module is received, if yes, step 107 is performed, otherwise, step 105 is performed;
  • the MCU determines whether 0x55 0xaa 0x01 0x00 0xFE is received, if yes, go to step 107, otherwise go to step 105.
  • Step 107 The MCU powers off the first Bluetooth module, and the MCU and the second Bluetooth module enter a low power consumption state; if the second Bluetooth module receives the Bluetooth connection event, step 108 is performed, and if a button is pressed, step 110 is performed;
  • the terminal automatically shuts down if the timer reaches the preset shutdown time interval and does not receive the Bluetooth connection event or the button is triggered.
  • the terminal automatically shuts down. Specifically, when the MCU detects that the IO connected to the button module is pulled high for a preset shutdown time interval, the terminal automatically shuts down.
  • the method when the second Bluetooth module enters a low power consumption state, the method further includes: switching the Bluetooth broadcast from a normal broadcast state to a slow broadcast state; and correspondingly, when the second Bluetooth module is awakened, The method includes switching the Bluetooth broadcast from the slow broadcast state to a normal broadcast state.
  • Step 108 The second Bluetooth module is woken up, and the second Bluetooth module initiates a disconnection event to the upper computer, disconnects from the upper computer, and wakes up the MCU by pulling up the IO connected to the MCU;
  • Step 109 The MCU initializes various parameters, and powers up the first Bluetooth module, and the MCU enters the idle state; then, step 112 is performed;
  • Step 110 The MCU is woken up, the MCU initializes various parameters, powers up the first Bluetooth module, and wakes up the second Bluetooth module by pulling up the IO connected to the second Bluetooth module, and the MCU and the second Bluetooth module enter the idle state;
  • step 111 is performed;
  • Step 111 The second Bluetooth module initiates a disconnection event to the upper computer, and disconnects from the upper computer;
  • Step 112 The first Bluetooth module receives the Bluetooth connection event, establishes a connection with the host computer, and pulls down the IO connected to the MCU;
  • the first Bluetooth module establishes a connection between the MCU and the first Bluetooth module and the host computer by lowering the IO connected to the MCU.
  • Step 113 The MCU waits to receive the data sent by the host computer through the first Bluetooth module.
  • step 114 is performed.
  • the MCU enters the idle state, and when the preset sleep time is reached. Return to step 107 when the interval is performed;
  • the timer is further set to start the sleep timer. If the timer reaches the preset sleep interval, the process returns to step 107.
  • Step 114 The MCU processes the received data, and sends a data response to the host computer through the first Bluetooth module, and then returns to step 113;
  • the MCU determines the data type according to the received data, performs a corresponding operation according to the data type, and obtains a data response according to the operation result, and sends the data response to the upper computer through the first Bluetooth module.
  • the data type is a card type instruction
  • the terminal performs a card search operation. If the card exists, the MCU returns to the 90 00 02 through the first Bluetooth module, if If the card does not exist, the MCU returns 90 00 00 to the upper computer through the first Bluetooth module.
  • the data type is an open card instruction
  • the terminal performs an open card operation. If the card is successfully opened, the MCU returns to the 90 00 02 00 08 through the first Bluetooth module. 06 78 80 78 02 80 56 BC, if the card is timed out, the MCU returns 00 59 to the terminal through the first Bluetooth module.
  • the terminal When the received data is 02 05 02 00 0C 00 A4 04 00 07 A0 00 00 03 33 01 01, the data type is a selection file instruction, the terminal notifies the card to perform a file selection operation, and if the selection is successful, the MCU passes The first Bluetooth module returns to the upper computer 6F3E8407A0000003330101A533500B50424F43204352454449548701019F38189F66049F02069F03069F1A0295055F2A029A039C019F3704BF0C059F4D020B0A9000, if the selection fails, the MCU returns 6E 00 to the upper computer through the first Bluetooth module.
  • the data type is a read command
  • the terminal reads the card data
  • the MCU returns to the 9F79060000000110009000 through the first Bluetooth module.
  • the terminal When the received data is 02 06, the terminal powers off the card, and the MCU returns 90 00 to the upper computer through the first Bluetooth module.
  • two independent Bluetooth modules ie, a first Bluetooth module and a second Bluetooth module
  • the first Bluetooth module is preferably a Bluetooth 3.0 chip
  • the second Bluetooth module is preferably a Bluetooth 4.0.
  • the chip, the first Bluetooth module is used to realize communication with the host computer when the terminal works normally, and completes the Felica transaction.
  • the second bluetooth module is configured to wait for the connection of the upper computer when the terminal is in sleep, wake up the terminal that is in the sleep after the connection, and then actively disconnect the connection with the upper computer, and after the terminal wakes up, the first bluetooth module is powered on. And waiting to interact with the host computer through the first Bluetooth module.
  • the first Bluetooth module and the second Bluetooth module are independent Bluetooth chips (ie, the first Bluetooth module and the second Bluetooth module) in the terminal.
  • a Bluetooth communication method that takes into consideration communication speed and power consumption is realized, as shown in FIG. 2,
  • the collaborative working methods of the Bluetooth chips include the following:
  • Step 201 The first Bluetooth module and the second Bluetooth module are powered on, and the second Bluetooth module turns on the Bluetooth broadcast.
  • the second Bluetooth module turns on the Bluetooth broadcast, and sends a broadcast packet including a Bluetooth name to the host computer, where the Bluetooth name includes the MAC address information of the first Bluetooth module.
  • the host computer parses the broadcast packet, and establishes a connection with the first Bluetooth module according to the MAC address parsed from the broadcast packet.
  • Step 202 The second Bluetooth module enters an idle state.
  • step 203 When the second Bluetooth module receives the Bluetooth connection event sent by the host computer, step 203 is performed; when the first Bluetooth module receives the Bluetooth connection event sent by the host computer, step 204 is performed; when the waiting for the Bluetooth connection event expires, the execution is performed. Step 205;
  • Step 203 The second Bluetooth module initiates a disconnection event to the host computer, disconnects from the host computer, and returns to step 202;
  • Step 204 The first Bluetooth module establishes a connection with the host computer to perform data transmission. After the data transmission ends, the first Bluetooth module is powered off, and the second Bluetooth module enters a low power consumption state, waiting to be awakened, and performing step 206;
  • Step 205 The first Bluetooth module is powered off, and the second Bluetooth module enters a low power consumption state, waiting to be awakened;
  • the method further includes: switching the Bluetooth broadcast from the normal broadcast state to the slow broadcast state.
  • the terminal further includes: if the second Bluetooth module is not woken up within a preset shutdown time interval, the terminal automatically shuts down.
  • Step 206 When the second Bluetooth module is woken up, the first Bluetooth module is powered on, and returns to step 202.
  • the second Bluetooth module when the second Bluetooth module is woken up, the second Bluetooth module further switches the Bluetooth broadcast from the slow broadcast state to the normal broadcast state.
  • the solution provided in this embodiment is characterized in that two independent Bluetooth modules (ie, a first Bluetooth module and a second Bluetooth module) are designed in the terminal, and the first Bluetooth module is a BT Classic standard, which is used to implement normal working of the terminal.
  • the communication of the host computer completes the Felica transaction.
  • the second Bluetooth module is a BLE standard, which is used to wait for the connection of the upper computer when the terminal is in a sleep state, and wakes up the terminal that is in the sleep after the connection, and then actively disconnects the BLE connection, and after the terminal wakes up, it will be given to the first Bluetooth module. Electric, and waiting to interact with the host computer through the first Bluetooth module.
  • the embodiment provides a terminal that takes into consideration communication speed and power consumption, as shown in FIG. 3, including an MCU and a first Bluetooth module and a second Bluetooth module connected to the MCU; preferably, the first Bluetooth module A Bluetooth chip using the BT Classic standard, such as a Bluetooth 3.0 chip; the second Bluetooth module uses a Bluetooth chip of the BLE standard, such as a Bluetooth 4.0 chip.
  • the first Bluetooth module A Bluetooth chip using the BT Classic standard, such as a Bluetooth 3.0 chip
  • the second Bluetooth module uses a Bluetooth chip of the BLE standard, such as a Bluetooth 4.0 chip.
  • the MCU is configured to power on the first Bluetooth module and the second Bluetooth module, specifically, by initializing an IO connected to the first Bluetooth module and an IO connected to the second Bluetooth module, The first Bluetooth module and the second Bluetooth module are powered on.
  • the first Bluetooth module and the second Bluetooth module in this embodiment have the same Bluetooth name, and the Bluetooth name includes the MAC address information of the first Bluetooth module.
  • the second Bluetooth module is configured to open a Bluetooth broadcast, send a broadcast packet containing a Bluetooth name to the host computer, and wait for a Bluetooth connection event; and also be used to initiate a Bluetooth connection event sent by the host computer to the host computer. Disconnect the event, disconnect from the host computer, enter the low power state;
  • the first Bluetooth module is configured to implement communication between the terminal and the host computer when establishing a connection with the host computer. It is also used to pull down the IO connected to the MCU when establishing a connection with the host computer.
  • the MCU is further configured to determine whether an operation of setting a Bluetooth name needs to be performed, and the same Bluetooth name is set for the first Bluetooth module and the second Bluetooth module, otherwise the second Bluetooth module is triggered.
  • the terminal further includes a memory module connected to the MCU, the memory module is configured to store the Bluetooth name, and the MCU is configured to determine, according to the Bluetooth name stored in the storage module, whether a setting needs to be performed.
  • the operation of the Bluetooth name is to read the first Bluetooth module MAC address, form the Bluetooth name according to the first Bluetooth module MAC address and the terminal SN code, and set the first Bluetooth module and the second
  • the name corresponding to the Bluetooth module is the Bluetooth name; otherwise, the second Bluetooth module is triggered.
  • the second Bluetooth module provided in this embodiment is further configured to: when entering a low power consumption state, switch the Bluetooth broadcast from a normal broadcast state to a slow broadcast state; when awake, the Bluetooth broadcast is taken from the The slow broadcast state is switched back to the normal broadcast state.
  • the second Bluetooth module is further configured to enter a low power consumption state when waiting for a Bluetooth connection event to time out;
  • the MCU includes a timer module, and the timer module is specifically configured to detect the When the Bluetooth module waits for the Bluetooth connection to time out, the MCU is triggered to power off the first Bluetooth module;
  • the MCU is further configured to: when detecting that the second Bluetooth module is awake, to the first Bluetooth module Powering on, when the timer module detects that the second Bluetooth module waits for the Bluetooth connection to time out, sending a sleep instruction to the second Bluetooth module;
  • the second Bluetooth module is specifically configured to receive The sleep instruction enters a low power state.
  • the second Bluetooth module is specifically configured to wake up the MCU by pulling up an IO connected to the MCU when receiving a Bluetooth connection event is awakened;
  • the MCU further includes a button module, and the MCU is specifically configured to: when the button module detects that a button press is pressed, the MCU is woken up; the MCU is further configured to initialize and give a The first Bluetooth module is powered on, and the second Bluetooth module is woken up by pulling up the IO connected to the second Bluetooth module.
  • the MCU further includes an automatic shutdown module, and the automatic shutdown module is configured to trigger the terminal to automatically shut down when the MCU detects that the second Bluetooth module is not awake within a preset shutdown time interval.
  • the MCU further includes an automatic shutdown module and a button module, and the automatic shutdown module is configured to trigger the terminal to automatically shut down when the button duration of the button module reaches a shutdown time.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本发明公开了一种兼顾通信速度和功耗的蓝牙通信方法及终端,属于通信技术领域。所述终端包括MCU以及与其相连的第一蓝牙模块和第二蓝牙模块,所述方法包括:终端的第一蓝牙模块和第二蓝牙模块上电,第二蓝牙模块打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,且所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息;当第二蓝牙模块接收到上位机发来的蓝牙连接事件时,第二蓝牙模块主动与上位机断开连接并进入低功耗状态;当第一蓝牙模块与上位机建立连接时,终端与上位机进行通信。本发明通过较低的成本,使得交易终端降低待机功耗,降低充电频率,提高了用户体验性。

Description

一种兼顾通信速度和功耗的蓝牙通信方法及终端 技术领域
本发明涉及通信技术领域,尤其涉及一种兼顾通信速度和功耗的蓝牙通信方法及终端。
背景技术
随着移动电子商务的发展,手机消费渐渐成为人们目前消费的一种主要趋势,越来越多的支付终端(如POS机)使用蓝牙和用户手机进行通信。由于支付终端通常要支持Felica(非接触式智能卡)交易,而Felica交易对支付终端的通信速度有非常严格的要求,随之而来的问题就是POS机和手机之间使用蓝牙通信的速度问题,因此为保证数据传输速度,现有技术中的做法是在支付终端中采用BT Classic标准的蓝牙模块(如蓝牙3.0芯片)来达到规定时间内完成交易通信的目的。
在支付终端中使用蓝牙3.0芯片虽然保证了通信速度,但是使用蓝牙3.0芯片存在高待机功耗的缺陷。由于目前的POS机多采用内置电池方案,因此高待机功耗将导致POS机使用寿命的缩短,而且频繁充电也会影响用户体验。
发明内容
为解决现有技术中存在的问题,本发明提供了一种兼顾通信速度和功耗的蓝牙通信方法及终端。
本发明的技术方案包括一种兼顾通信速度和功耗的终端,该终端包括MCU以及与所述MCU连接的第一蓝牙模块和第二蓝牙模块;
所述MCU,用于给所述第一蓝牙模块和所述第二蓝牙模块上电,所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息;
所述第二蓝牙模块,用于打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,并等待蓝牙连接事件;还用于当接收到上位机发来的蓝牙连接事件时,向上位机发起断开连接事件,与上位机断开连接,进入低功耗状态;
所述第一蓝牙模块,用于与上位机建立连接时,实现终端与上位机之间的通信。
上述终端还包括与所述MCU连接的存储器模块,所述存储器模块用于存储所述蓝牙名称;所述MCU,具体用于根据所述存储模块中存储的所述蓝牙名称判断是否需要执行设置蓝牙名称的操作,是则读取所述第一蓝牙模块MAC地址,根据所述第一蓝牙模块MAC地址和终端SN码组成所述蓝牙名称,并设置所述第一蓝牙模块和所述第二蓝牙模块对应的名称为所述蓝牙名称;否则触发所述第二蓝牙模块。
上述第二蓝牙模块,还用于当进入低功耗状态时,将所述蓝牙广播从正常广播状态切换为慢广播状态;当被唤醒时,将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
上述第二蓝牙模块,还用于当等待蓝牙连接事件超时时,进入低功耗状态;所述MCU包括定时器模块,所述定时器模块,具体用于当检测到所述第二蓝牙模块等待蓝牙连接超时时,触发所述MCU给所述第一蓝牙模块下电;所述MCU,还用于当检测到所述第二蓝牙模块被唤醒时,给所述第一蓝牙模块上电。
本发明的技术方案还包括一种兼顾通信速度和功耗的蓝牙通信方法,该方法包括:终端的第一蓝牙模块和第二蓝牙模块上电,所述第二蓝牙模块打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,且所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息;
当终端的第二蓝牙模块接收到上位机发来的蓝牙连接事件时,所述第二蓝牙模块向上位机发起断开连接事件,终端的第二蓝牙模块与上位机断开连接,所述第二蓝牙模块进入低功耗状态;
当终端的第一蓝牙模块与上位机建立连接时,终端与上位机进行通信。
上述第二蓝牙模块打开蓝牙广播之前还包括:终端判断是否需要执行设置蓝牙名称的操作,是则终端为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称,否则直接执行所述第二蓝牙模块打开蓝牙广播。
上述终端为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称具体为,终端的MCU读取所述第一蓝牙模块MAC地址,根据所述第一蓝牙模块MAC地址和终端SN码组成蓝牙名称,并设置所述第一蓝牙模块和所述第二蓝牙模块对应的名称为所述蓝牙名称。
上述根据所述第一蓝牙模块MAC地址与终端SN码组成蓝牙名称具体为,将所述终端SN码与所述第一蓝牙模块MAC地址的后六位进行拼接得到所述蓝牙名称。
上述方法中,当终端的第一蓝牙模块与上位机建立连接时,所述第二蓝牙模块处于低功耗状态。
上述第二蓝牙模块进入低功耗状态时,还包括将所述蓝牙广播从正常广播状态切换为慢广播状态;当所述第二蓝牙模块被唤醒时,还包括将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
上述方法还包括当所述第二蓝牙模块等待蓝牙连接事件超时时,所述第一蓝牙模块下电,所述第二蓝牙模块进入低功耗状态;当所述第二蓝牙模块被唤醒时,所述第一蓝牙模块上电并等待与上位机建立连接。
本发明的技术方案还包括一种兼顾通信速度和功耗的终端,该终端包括MCU芯片以及与所述MCU芯片连接的第一蓝牙芯片和第二蓝牙芯片;
所述MCU芯片,用于给所述第一蓝牙芯片和所述第二蓝牙芯片上电,所述第一蓝牙芯片和所述第二蓝牙芯片具有相同的蓝牙名称,所述蓝牙名称中包含有所述第一蓝牙芯片的MAC地址信息;
所述第二蓝牙芯片,用于打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,并等待蓝牙连接事件;还用于当接收到上位机发来的蓝牙连接事件时,向上位机发起断开连接事件,与上位机断开连接,进入低功耗状态;
所述第一蓝牙芯片,用于与上位机建立连接时,实现终端与上位机之间的通信。
本发明的有益效果如下:通过较低的成本,使得带有Felica交易功能的蓝牙支付终端降低待机功耗,降低充电频率,提高用户体验性。
附图说明
图1是本发明实施例1提供的一种兼顾通信速度和功耗的蓝牙通信方法流程图;
图2是本发明实施例2提供的一种兼顾通信速度和低功耗的蓝牙通信方法流程图;
图3是本发明实施例3提供的一种兼顾通信速度和功耗的终端的组成结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
实施例1
本实施例中提及的终端内包含有MCU芯片(以下简称MCU)和两个蓝牙芯片(以下简称第一蓝牙模块和第二蓝牙模块),优选的,第一蓝牙模块采用BT Classic标准的蓝牙芯片,第二蓝牙模块采用BLE标准的蓝牙芯片。
本实施例基于上述终端实现了一种兼顾通信速度和功耗的蓝牙通信方法,如图1所示,包括以下内容:
步骤101:MCU上电,初始化与第一蓝牙模块连接的IO以及和第二蓝牙模块连接的IO,给第一蓝牙模块和第二蓝牙模块上电;
进一步的,本步骤还包括初始化定时器、实时时钟。
步骤102:MCU读取第一蓝牙模块MAC地址,根据第一蓝牙模块MAC地址和终端SN码组成蓝牙名称,并设置第一蓝牙模块和第二蓝牙模块对应的名称为所述蓝牙名称;
具体的,MCU通过向第一蓝牙模块发送读取指令来读取第一蓝牙模块MAC地址;MCU根据读取的第一蓝牙模块MAC地址与终端SN码组成蓝牙名称,分别向第一蓝牙模块和第二蓝牙模块发送设置指令,将第一蓝牙模块和第二蓝牙模块对应的名称均设置统为所述蓝牙名称。
所述根据第一蓝牙模块MAC地址与终端SN码组成蓝牙名称具体为,将终端SN码与第一蓝牙模块MAC地址的后六位进行拼接得到蓝牙名称。
例如,第一蓝牙模块MAC地址为3481F40A05CF,终端SN码为1234567890,设置所述蓝牙名称为12345678900A05CF。
优选的,步骤102之前还可以包括:MCU判断是否需要执行设置蓝牙名称的操作,是则执行步骤102,否则MCU进入idle状态,第二蓝牙模块进入低功耗,执行步骤112。
本实施例中,所述MCU判断是否需要执行设置蓝牙名称的操作可以通过判断预设标志位是否置位来判断是否需要设置蓝牙名称,若预设标志位置位则不需要为第一蓝牙模块和第二蓝牙模块设置蓝牙名称,否则需要为第一蓝牙模块和第二蓝牙模块设置蓝牙名称,并置位预设标志位。本实施例中,若终端和上位机已建立过一次连接则所述预设标志位为置位,可以省略执行设置蓝牙名称的操作,则步骤101之后MCU进入idle状态,第二蓝牙模块进入低功耗状态,并执行步骤112。
进一步的,终端出厂前已为所述第一蓝牙模块和所述第二蓝牙模块设置了相同的蓝牙名称,在本实施提供的流程中对应的可以省略步骤102,步骤101之后直接执行步骤103。优选的,所述蓝牙名称根据终端SN码与第一蓝牙模块MAC地址的后六位进行拼接得到。
步骤103:MCU初始化各项参数;
具体的,MCU初始化的各项参数包括休眠时间间隔、自动关机时间间隔、版本号、***语言等。
步骤104:MCU进入idle状态,等待蓝牙连接;若等待蓝牙连接事件超时则执行步骤105,若第二蓝牙模块接收到蓝牙连接事件则执行步骤111;
具体的,MCU进入idle状态(准备就绪状态)之后还包括开启定时器,若定时器的计时达到预设的休眠时间间隔且第二蓝牙模块未接收到蓝牙连接事件,则判断为等待蓝牙连接事件超时执行步骤105。
步骤105:MCU向第二蓝牙模块发送休眠指令;
具体的,休眠指令为:0xaa 0x55 0x01 0x00 0x00 0xFE。
步骤106:MCU判断是否收到第二蓝牙模块的响应,是则执行步骤107,否则返回执行步骤105;
具体的,MCU判断是否收到0x55 0xaa 0x01 0x00 0xFE,是则执行步骤107,否则执行步骤105。
步骤107:MCU给第一蓝牙模块下电,MCU和第二蓝牙模块进入低功耗状态;若第二蓝牙模块接收到蓝牙连接事件则执行步骤108,若有按键按下则执行步骤110;
具体的,当MCU与按键模块连接的IO被拉高时表示有按键按下。
进一步的,MCU和第二蓝牙模块进入低功耗状态之后还包括,若定时器计时达到预设的关机时间间隔且未收到蓝牙连接事件或按键触发则终端自动关机。
还可以是,当MCU检测到有按键按下的时长达到关机时长时,终端自动关机。具体的,MCU检测与按键模块连接的IO被拉高的时间达到预设的关机时间间隔时,终端自动关机。
本实施例中,所述第二蓝牙模块进入低功耗状态时,还包括将所述蓝牙广播从正常广播状态切换为慢广播状态;相应的,当所述第二蓝牙模块被唤醒时,还包括将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
步骤108:第二蓝牙模块被唤醒,第二蓝牙模块向上位机发起断开连接事件,与上位机断开连接,并通过拉高与MCU连接的IO唤醒MCU;
步骤109:MCU初始化各项参数,给第一蓝牙模块上电,MCU进入idle状态;然后执行步骤112;
步骤110:MCU被唤醒,MCU初始化各项参数,给第一蓝牙模块上电,并通过拉高与第二蓝牙模块连接的IO唤醒第二蓝牙模块,MCU和第二蓝牙模块进入idle状态;
若第二蓝牙模块接收到蓝牙连接事件则执行步骤111;
步骤111:第二蓝牙模块向上位机发起断开连接事件,与上位机断开连接;
步骤112:第一蓝牙模块接收到蓝牙连接事件,与上位机建立连接,并拉低与MCU连接的IO;
具体的,第一蓝牙模块通过拉低与MCU连接的IO通知MCU当前与第一蓝牙模块与上位机建立了连接。
步骤113:MCU等待通过第一蓝牙模块接收上位机发送的数据,当接收到上位机发送的数据时执行步骤114,当等待数据超时或通信结束时MCU进入idle状态,当达到预设的休眠时间间隔时返回执行步骤107;
具体的,MCU进入idle状态之后还包括设置定时器开始休眠计时,若计时达到预设的休眠时间间隔则返回执行步骤107。
步骤114:MCU对接收到的所述数据进行处理,并通过第一蓝牙模块向上位机发送数据响应,然后返回步骤113;
本步骤具体的,MCU根据接收到的所述数据判断数据类型,根据数据类型执行相应操作,并根据操作结果得到数据响应,通过第一蓝牙模块向上位机发送所述数据响应。
例如,当接收到的所述数据为02 02 03,则所述数据类型为获取卡片类型指令,终端进行寻卡操作,若卡片存在则MCU通过第一蓝牙模块向上位机返回90 00 02,若卡片不存在则MCU通过第一蓝牙模块向上位机返回90 00 00。
当接收到的所述数据为02 04 00 05 03,则所述数据类型为打开卡片指令,终端进行打开卡片操作,若打开卡片成功则MCU通过第一蓝牙模块向上位机返回90 00 02 00 08 06 78 80 78 02 80 56 BC,若打开卡片超时则MCU通过第一蓝牙模块向终端返回00 59。
当接收到的所述数据为02 05 02 00 0C 00 A4 04 00 07 A0 00 00 03 33 01 01,则所述数据类型为选择文件指令,终端通知卡片进行选择文件操作,若选择成功则MCU通过第一蓝牙模块向上位机返回6F3E8407A0000003330101A533500B50424F43204352454449548701019F38189F66049F02069F03069F1A0295055F2A029A039C019F3704BF0C059F4D020B0A9000,若选择失败则MCU通过第一蓝牙模块向上位机返回6E 00。
当接收到的所述数据为02 05 02 00 05 80 CA 9F 79 09,则所述数据类型为读取指令,终端读取卡片数据,MCU通过第一蓝牙模块向上位机返回9F79060000000110009000。
当接收到的所述数据为02 06,则终端给卡片下电,MCU通过第一蓝牙模块向上位机返回90 00。
本实施例采用在终端内设计两个独立的蓝牙模块(即第一蓝牙模块和第二蓝牙模块)与MCU相连,其中,第一蓝牙模块优选为蓝牙3.0芯片,第二蓝牙模块优选为蓝牙4.0芯片,第一蓝牙模块用于实现终端正常工作时与上位机的通信,完成Felica交易。第二蓝牙模块用于在终端处于休眠时等待上位机的连接,并在连接后唤醒处于休眠中的终端,然后主动断开与上位机的连接,终端唤醒后,将给第一蓝牙模块上电,并等待通过第一蓝牙模块与上位机进行交互操作。
实施例2
本实施例2通过在终端内设计两个独立的蓝牙芯片(即第一蓝牙模块和第二蓝牙模块)来实现了一种兼顾通信速度和功耗的蓝牙通信方法,如图2所示,两个蓝牙芯片的协同工作方法包括以下内容:
步骤201:第一蓝牙模块和第二蓝牙模块上电,第二蓝牙模块打开蓝牙广播;
具体的,所述第二蓝牙模块打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息。上位机收到广播包后解析所述广播包,根据从所述广播包中解析得到的MAC地址与所述第一蓝牙模块建立连接。
步骤202:第二蓝牙模块进入idle状态;
当第二蓝牙模块接收到上位机发来的蓝牙连接事件时,执行步骤203;当第一蓝牙模块接收到上位机发来的蓝牙连接事件时,执行步骤204;当等待蓝牙连接事件超时,执行步骤205;
步骤203:第二蓝牙模块向上位机发起断开连接事件,与上位机断开连接,返回步骤202;
步骤204:第一蓝牙模块与上位机建立连接,进行数据传输,待数据传输结束之后,第一蓝牙模块下电,第二蓝牙模块进入低功耗状态,等待被唤醒,执行步骤206;
步骤205:第一蓝牙模块下电,第二蓝牙模块进入低功耗状态,等待被唤醒;
具体的,当第二蓝牙模块进入低功耗状态时还包括,将蓝牙广播从正常广播状态切换为慢广播状态。
进一步的,第二蓝牙模块进入低功耗状态之后还包括,若第二蓝牙模块在预设的关机时间间隔内未被唤醒则终端自动关机。
步骤206:当第二蓝牙模块被唤醒时,第一蓝牙模块上电,并返回步骤202。
具体的,当第二蓝牙模块被唤醒时还包括,第二蓝牙模块将蓝牙广播从慢广播状态切换回正常广播状态。
本实施例提供的方案的特点在于,在终端内设计两个独立的蓝牙模块(即第一蓝牙模块和第二蓝牙模块),第一蓝牙模块为BT Classic标准,用于实现终端正常工作时与上位机的通信,完成Felica交易。第二蓝牙模块为BLE标准,用于在终端处于休眠时等待上位机的连接,并在连接后唤醒处于休眠中的终端,然后主动断开BLE连接,终端唤醒后,将给第一蓝牙模块上电,并等待通过第一蓝牙模块与上位机进行交互操作。
实施例3
本实施例提供了一种兼顾通信速度和功耗的终端,如图3所示:包括MCU以及与所述MCU连接的第一蓝牙模块和第二蓝牙模块;优选的,所述第一蓝牙模块采用BT Classic标准的蓝牙芯片,例如蓝牙3.0芯片;所述第二蓝牙模块采用BLE标准的蓝牙芯片,例如蓝牙4.0芯片。
所述MCU,用于给所述第一蓝牙模块和所述第二蓝牙模块上电,具体用于通过初始化与所述第一蓝牙模块连接的IO以及与所述第二蓝牙模块连接的IO,给所述第一蓝牙模块和所述第二蓝牙模块上电。
本实施例中的所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息。
所述第二蓝牙模块,用于打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,并等待蓝牙连接事件;还用于当接收到上位机发来的蓝牙连接事件时,向上位机发起断开连接事件,与上位机断开连接,进入低功耗状态;
所述第一蓝牙模块,用于与上位机建立连接时,实现终端与上位机之间的通信。还用于与上位机建立连接时拉低与所述MCU连接的IO。
优选的,所述MCU,还用于判断是否需要执行设置蓝牙名称的操作,是则为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称,否则触发第二蓝牙模块。所述终端还包括与所述MCU连接的存储器模块,所述存储器模块用于存储所述蓝牙名称;所述MCU,具体用于根据所述存储模块中存储的所述蓝牙名称判断是否需要执行设置蓝牙名称的操作,是则读取所述第一蓝牙模块MAC地址,根据所述第一蓝牙模块MAC地址和终端SN码组成所述蓝牙名称,并设置所述第一蓝牙模块和所述第二蓝牙模块对应的名称为所述蓝牙名称;否则触发第二蓝牙模块。
本实施例提供的所述第二蓝牙模块,还用于当进入低功耗状态时,将所述蓝牙广播从正常广播状态切换为慢广播状态;当被唤醒时,将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
进一步的,所述第二蓝牙模块,还用于当等待蓝牙连接事件超时时,进入低功耗状态;所述MCU包括定时器模块,所述定时器模块,具体用于当检测到所述第二蓝牙模块等待蓝牙连接超时时,触发所述MCU给所述第一蓝牙模块下电;所述MCU,还用于当检测到所述第二蓝牙模块被唤醒时,给所述第一蓝牙模块上电,还用于当所述定时器模块检测到所述第二蓝牙模块等待蓝牙连接超时时,向所述第二蓝牙模块发送休眠指令;所述第二蓝牙模块,具体用于当收到所述休眠指令时进入低功耗状态。
相应的,所述第二蓝牙模块,具体用于当接收到蓝牙连接事件被唤醒时,通过拉高与所述MCU连接的IO唤醒所述MCU;
所述MCU还包括按键模块,所述MCU,具体用于当通过所述按键模块检测到有按键按下,所述MCU被唤醒;所述MCU,还用于当被唤醒时进行初始化并给所述第一蓝牙模块上电,通过拉高与所述第二蓝牙模块连接的IO唤醒所述第二蓝牙模块。
优选的,所述MCU还包括自动关机模块,所述自动关机模块,用于当所述MCU检测到所述第二蓝牙模块在预设的关机时间间隔内未被唤醒时触发终端自动关机。
或者是,所述MCU还包括自动关机模块和按键模块,所述自动关机模块,用于当所述按键模块的按键时长达到关机时长时,触发终端自动关机。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种兼顾通信速度和功耗的蓝牙通信方法,其特征在于,包括:终端的第一蓝牙模块和第二蓝牙模块上电,所述第二蓝牙模块打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,且所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息;
    当终端的第二蓝牙模块接收到上位机发来的蓝牙连接事件时,所述第二蓝牙模块向上位机发起断开连接事件,终端的第二蓝牙模块与上位机断开连接,所述第二蓝牙模块进入低功耗状态;
    当终端的第一蓝牙模块与上位机建立连接时,终端与上位机进行通信。
  2. 根据权利要求1所述的方法,其特征在于:所述第二蓝牙模块打开蓝牙广播之前还包括:终端判断是否需要执行设置蓝牙名称的操作,是则终端为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称,否则直接执行所述第二蓝牙模块打开蓝牙广播。
  3. 根据权利要求2所述的方法,其特征在于:所述终端为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称,具体为:终端的MCU读取所述第一蓝牙模块MAC地址,根据所述第一蓝牙模块MAC地址和终端SN码组成蓝牙名称,并设置所述第一蓝牙模块和所述第二蓝牙模块对应的名称为所述蓝牙名称。
  4. 根据权利要求1所述的方法,其特征在于:所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,具体为:所述终端出厂前为所述第一蓝牙模块和所述第二蓝牙模块设置了相同的蓝牙名称。
  5. 根据权利要求1所述的方法,其特征在于:所述当终端的第一蓝牙模块与上位机建立连接时,所述第二蓝牙模块处于低功耗状态。
  6. 根据权利要求1所述的方法,其特征在于:所述第二蓝牙模块进入低功耗状态时,还包括将所述蓝牙广播从正常广播状态切换为慢广播状态;
    当所述第二蓝牙模块被唤醒时,还包括将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
  7. 根据权利要求1所述的方法,其特征在于:所述方法还包括当所述第二蓝牙模块等待蓝牙连接事件超时时,所述第一蓝牙模块下电,所述第二蓝牙模块进入低功耗状态;
    当所述第二蓝牙模块被唤醒时,所述第一蓝牙模块上电并等待与上位机建立连接。
  8. 根据权利要求7所述的方法,其特征在于:当所述第二蓝牙模块等待蓝牙连接事件超时时,所述第一蓝牙模块下电,所述第二蓝牙模块进入低功耗状态具体包括:所述终端的MCU向所述第二蓝牙模块发送休眠指令,所述MCU给所述第一蓝牙模块下电,所述MCU和所述第二蓝牙模块进入低功耗状态。
  9. 根据权利要求1所述的方法,其特征在于:所述方法还包括,当所述终端的MCU检测到有按键按下的时长达到关机时长时,终端自动关机。
  10. 根据权利要求1所述的方法,其特征在于:所述终端的第一蓝牙模块和第二蓝牙模块上电具体为:所述终端的MCU上电,所述MCU初始化与所述第一蓝牙模块连接的IO以及与所述第二蓝牙模块连接的IO,给所述第一蓝牙模块和所述第二蓝牙模块上电。
  11. 根据权利要求1所述的方法,其特征在于:所述终端的第一蓝牙模块与上位机建立连接时还包括,所述第一蓝牙模块拉低与终端的MCU连接的IO,所述终端等待与上位机进行通信。
  12. 根据权利要求1所述的方法,其特征在于:所述终端与上位机进行通信具体包括:当所述终端的MCU通过第一蓝牙模块接收到上位机发送的数据时,所述终端与上位机进行通信;当所述终端的MCU等待接收上位机发送的数据超时或是与上位机通信结束时,所述MCU给所述第一蓝牙模块下电,所述MCU 和所述第二蓝牙模块进入低功耗状态;当所述终端的MCU检测到所述第一蓝牙模块与上位机断开连接时,所述MCU给所述第一蓝牙模块下电,所述MCU和所述第二蓝牙模块进入低功耗状态。
  13. 一种兼顾通信速度和功耗的终端,其特征在于:包括MCU以及与所述MCU连接的第一蓝牙模块和第二蓝牙模块;
    所述MCU,用于给所述第一蓝牙模块和所述第二蓝牙模块上电,所述第一蓝牙模块和所述第二蓝牙模块具有相同的蓝牙名称,所述蓝牙名称中包含有所述第一蓝牙模块的MAC地址信息;
    所述第二蓝牙模块,用于打开蓝牙广播,向上位机发送包含蓝牙名称的广播包,并等待蓝牙连接事件;还用于当接收到上位机发来的蓝牙连接事件时,向上位机发起断开连接事件,与上位机断开连接,进入低功耗状态;
    所述第一蓝牙模块,用于与上位机建立连接时,实现终端与上位机之间的通信。
  14. 根据权利要求13所述的终端,其特征在于:所述MCU,还用于判断是否需要执行设置蓝牙名称的操作,是则为所述第一蓝牙模块和所述第二蓝牙模块设置相同的蓝牙名称,否则触发第二蓝牙模块。
  15. 根据权利要求14所述的终端,其特征在于:所述终端还包括与所述MCU连接的存储器模块,所述存储器模块用于存储所述蓝牙名称;
    所述MCU,具体用于根据所述存储模块中存储的所述蓝牙名称判断是否需要执行设置蓝牙名称的操作,是则读取所述第一蓝牙模块MAC地址,根据所述第一蓝牙模块MAC地址和终端SN码组成所述蓝牙名称,并设置所述第一蓝牙模块和所述第二蓝牙模块对应的名称为所述蓝牙名称;否则触发第二蓝牙模块。
  16. 根据权利要求13所述的终端,其特征在于:所述第二蓝牙模块,还用于当进入低功耗状态时,将所述蓝牙广播从正常广播状态切换为慢广播状态;当被唤醒时,将所述蓝牙广播从所述慢广播状态切换回正常广播状态。
  17. 根据权利要求13所述的终端,其特征在于:所述第二蓝牙模块,还用于当等待蓝牙连接事件超时时,进入低功耗状态;
    所述MCU包括定时器模块,所述定时器模块,具体用于当检测到所述第二蓝牙模块等待蓝牙连接超时时,触发所述MCU给所述第一蓝牙模块下电;
    所述MCU,还用于当检测到所述第二蓝牙模块被唤醒时,给所述第一蓝牙模块上电。
  18. 根据权利要求13所述的终端,其特征在于:所述MCU还包括自动关机模块和按键模块,所述自动关机模块,用于当所述按键模块的按键时长达到关机时长时,触发终端自动关机。
  19. 根据权利要求13所述的终端,其特征在于:所述MCU,具体用于通过初始化与所述第一蓝牙模块连接的IO以及与所述第二蓝牙模块连接的IO,给所述第一蓝牙模块和所述第二蓝牙模块上电。
  20. 根据权利要求13所述的终端,其特征在于:所述第一蓝牙模块,还用于与上位机建立连接时拉低与所述MCU连接的IO。
PCT/CN2017/105038 2016-11-01 2017-09-30 一种兼顾通信速度和功耗的蓝牙通信方法及终端 WO2018082428A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/197,305 US10743258B2 (en) 2016-11-01 2018-11-20 Method of Bluetooth communication giving consideration to both communication speed and power consumption and a terminal thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610943369.5A CN106658677B (zh) 2016-11-01 2016-11-01 一种兼顾通信速度和功耗的蓝牙通信方法及终端
CN201610943369.5 2016-11-01

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/197,305 Continuation US10743258B2 (en) 2016-11-01 2018-11-20 Method of Bluetooth communication giving consideration to both communication speed and power consumption and a terminal thereof

Publications (1)

Publication Number Publication Date
WO2018082428A1 true WO2018082428A1 (zh) 2018-05-11

Family

ID=58821103

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105038 WO2018082428A1 (zh) 2016-11-01 2017-09-30 一种兼顾通信速度和功耗的蓝牙通信方法及终端

Country Status (3)

Country Link
US (1) US10743258B2 (zh)
CN (1) CN106658677B (zh)
WO (1) WO2018082428A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025337A (zh) * 2021-10-19 2022-02-08 山东电工电气集团新能科技有限公司 一种基于蓝牙通讯的物联网通信***及其通信方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658677B (zh) 2016-11-01 2019-10-08 飞天诚信科技股份有限公司 一种兼顾通信速度和功耗的蓝牙通信方法及终端
US11487344B2 (en) * 2017-08-18 2022-11-01 Rakuten Group, Inc. Communication system, communication device, and power saving method
CN107770757B (zh) * 2017-09-11 2019-01-01 前海随身宝(深圳)科技有限公司 数据通信方法、存储设备及移动设备
CN110139260A (zh) * 2019-05-21 2019-08-16 深圳云里物里科技股份有限公司 一种蓝牙通信的数据处理方法及相关装置
CN112068741B (zh) * 2019-06-10 2023-04-07 海信视像科技股份有限公司 显示设备及显示设备蓝牙开关状态的显示方法
CN110393333A (zh) * 2019-06-27 2019-11-01 东华大学 一种具有检测紫外线强度功能的智能纽扣
CN110572803A (zh) * 2019-07-25 2019-12-13 华为技术有限公司 蓝牙切换方法及蓝牙设备
CN112822658B (zh) * 2020-12-31 2022-12-30 北京千方科技股份有限公司 一种etc前装电子标签及其工作方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105101055A (zh) * 2015-07-03 2015-11-25 惠州Tcl移动通信有限公司 文件传输的方法及智能设备
CN105472038A (zh) * 2016-01-07 2016-04-06 腾讯科技(深圳)有限公司 文件传输的控制方法、装置以及***
CN106060904A (zh) * 2016-04-13 2016-10-26 卓荣集成电路科技有限公司 一种用于蓝牙芯片的电源管理***和方法
CN106658677A (zh) * 2016-11-01 2017-05-10 飞天诚信科技股份有限公司 一种兼顾通信速度和功耗的蓝牙通信方法及终端

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6366557B1 (en) * 1997-10-31 2002-04-02 Nortel Networks Limited Method and apparatus for a Gigabit Ethernet MAC (GMAC)
US9641239B2 (en) * 2012-06-22 2017-05-02 Fitbit, Inc. Adaptive data transfer using bluetooth
EP3203397B1 (en) * 2016-02-08 2020-04-01 PARI Pharma GmbH Medical evaluation device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105101055A (zh) * 2015-07-03 2015-11-25 惠州Tcl移动通信有限公司 文件传输的方法及智能设备
CN105472038A (zh) * 2016-01-07 2016-04-06 腾讯科技(深圳)有限公司 文件传输的控制方法、装置以及***
CN106060904A (zh) * 2016-04-13 2016-10-26 卓荣集成电路科技有限公司 一种用于蓝牙芯片的电源管理***和方法
CN106658677A (zh) * 2016-11-01 2017-05-10 飞天诚信科技股份有限公司 一种兼顾通信速度和功耗的蓝牙通信方法及终端

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025337A (zh) * 2021-10-19 2022-02-08 山东电工电气集团新能科技有限公司 一种基于蓝牙通讯的物联网通信***及其通信方法

Also Published As

Publication number Publication date
US20190090195A1 (en) 2019-03-21
US10743258B2 (en) 2020-08-11
CN106658677A (zh) 2017-05-10
CN106658677B (zh) 2019-10-08

Similar Documents

Publication Publication Date Title
WO2018082428A1 (zh) 一种兼顾通信速度和功耗的蓝牙通信方法及终端
WO2018157689A1 (zh) 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备
EP2403152B1 (en) Terminal of supporting enhanced near field communication and its processing method
US11916618B2 (en) Near field communication tag and control system for near field communication tag
WO2010048857A1 (zh) 降低射频sim卡待机功耗的软件方法
WO2013123863A1 (zh) 一种休眠方法、唤醒方法和移动终端设备
WO2014121681A1 (zh) 一种读卡器与上位机通信的方法
WO2010051728A1 (zh) 采用序列触发降低射频sim卡待机功耗的方法
JP2013531822A5 (zh)
US20080092248A1 (en) Wan module based remote wakeup system and terminal thereof
CN106412845A (zh) 无线保真Wi-Fi设备的休眠方法及装置
CN110365847A (zh) 一种基于nfc的电源控制***、控制方法以及电子产品
CN105375942A (zh) 一种具有无线sim传输功能的手表手机
CN103118420A (zh) 移动热点唤醒处理方法及装置
WO2017121359A1 (zh) 智能卡再次进场过程中保持工作状态的方法以及智能卡
CN101252733B (zh) 一种移动终端及模块间的通讯电路及其通讯方法
CN110430502B (zh) 一种蓝牙耳机配对方法及充电底座
CN101778174A (zh) 一种移动终端功能扩展的方法、***及外接卡
WO2022002236A1 (zh) 数据传输方法、多功能卡及电子设备
WO2021197257A1 (en) Processing method based on fingerprint card and fingerprint card
CN110854963A (zh) 一种应用于移动电源的充电***及方法
CN113660149A (zh) 设备控制方法及装置、存储介质和电子设备
CN113766468B (zh) 智能卡分享方法、电子设备及计算机可读存储介质
US7359695B2 (en) Circuit for a data carrier, which circuit can be switched from an energy-saving processing mode to a normal-consumption processing mode
CN212846705U (zh) 智能交互一体机及其智能笔座

Legal Events

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

Ref document number: 17866918

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

Country of ref document: EP

Kind code of ref document: A1