WO2018157689A1 - 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备 - Google Patents

一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备 Download PDF

Info

Publication number
WO2018157689A1
WO2018157689A1 PCT/CN2018/074737 CN2018074737W WO2018157689A1 WO 2018157689 A1 WO2018157689 A1 WO 2018157689A1 CN 2018074737 W CN2018074737 W CN 2018074737W WO 2018157689 A1 WO2018157689 A1 WO 2018157689A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
bluetooth
security
state
security module
Prior art date
Application number
PCT/CN2018/074737
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 飞天诚信科技股份有限公司
Priority to US16/473,642 priority Critical patent/US11463955B2/en
Publication of WO2018157689A1 publication Critical patent/WO2018157689A1/zh

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/0212Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave
    • H04W52/0216Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave using a pre-established activity schedule, e.g. traffic indication frame
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3209Monitoring remote activity, e.g. over telephone lines or network connections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3228Monitoring task completion, e.g. by use of idle timers, stop commands or wait commands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • 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/0251Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3278Power saving in modem or I/O interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/442Shutdown
    • 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
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management
    • 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 a method for realizing low power consumption standby of a Bluetooth security device and a Bluetooth security device, and belongs to the field of electronic technology.
  • the Bluetooth security device In order to improve portability, the volume of the mobile payment device is smaller and smaller, but the small size brings about the problem of insufficient battery capacity; in the prior art, in order to improve the standby time of the battery, the Bluetooth security device The low-power standby mode (power consumption is about 2mA) and the working mode (power consumption is about 10mA) are set.
  • the technical solution for implementing the low-power standby mode in the prior art is: the Bluetooth security device is woken up by the host computer when receiving When the data is sent to the host computer, the processing result is processed according to the received data, and the processing result is returned to the upper computer and still in the working mode, and the peripheral device is turned off after the preset time of the host computer wake-up, and enters the low-power standby mode; When the data of the upper computer is not received, the Bluetooth security device turns off the peripheral device after entering the low power standby mode after the preset time that is awakened by the upper computer. That is, in the prior art, after the Bluetooth security device is woken up by the host computer, regardless of whether the Bluetooth security device receives the data, it is always in the working state for a preset time.
  • the shortcoming of the prior art is that the low power consumption standby mode of the Bluetooth security device saves limited power, and the effect of extending the standby time is not ideal.
  • the object of the present invention is to provide a method for implementing low-power standby of a Bluetooth security device and a Bluetooth security device, which have good power saving effect and long standby time of the Bluetooth security device.
  • a method for implementing low power consumption standby of a Bluetooth security device including the following steps:
  • Step S1 the security module is woken up by the Bluetooth module, and the self state is set to the working mode;
  • Step S2 The security module determines whether data from the Bluetooth module is received within the fifth preset time, if yes, step S3 is performed, otherwise step S5 is performed;
  • Step S3 The security module performs a corresponding operation according to the received data to obtain an operation result
  • Step S4 The security module returns the operation result to the Bluetooth module, and performs step S5;
  • Step S5 The security module sets its own state to a low power standby mode, waiting to be woken up by the Bluetooth module.
  • the above method further comprises the following steps:
  • Step H1 the Bluetooth module waits to receive data from the host computer
  • Step H2 When receiving the data from the upper computer, the Bluetooth module sets its own state to the working mode, and wakes up the security module;
  • Step H3 After the first preset time, the Bluetooth module sends data from the upper computer to the security module;
  • Step H4 The Bluetooth module determines whether the operation result from the security module is received within a second preset time, if yes, the operation result is sent to the upper computer, and step H5 is performed; otherwise, the step is performed. H5;
  • Step H5 The Bluetooth module sets its own state to a low power standby mode, and performs step H1.
  • a Bluetooth security device includes a security module and a Bluetooth module, and the security module includes: a first setting module, a first receiving module, a first determining module, an executing module, and a first sending Module, second setting module and waiting module;
  • the first setting module is configured to set a state of the security module to an operating mode when the security module is awake by the Bluetooth module;
  • the first receiving module is configured to receive data from the Bluetooth module
  • the first determining module is configured to determine, after the first setting module sets the state of the security module to be an operating mode, whether the first receiving module receives the Bluetooth module from within the fifth preset time.
  • the executing module is configured to: when the first determining module determines that the first receiving module receives data from the Bluetooth module, perform a corresponding operation according to data received by the first receiving module, to obtain an operation result;
  • the first sending module is configured to return the operation result obtained by the execution module to the Bluetooth module;
  • the second setting module is configured to: when the first determining module determines that the first receiving module does not receive data from the Bluetooth module within a fifth preset time, set the state of the security module a low power consumption standby mode; configured to set a state of the security module to a low power standby mode after the first sending module returns the operation result to the bluetooth module;
  • the waiting module is configured to wait for the security module to be woken up by the Bluetooth module after the second setting module sets the state of the security module to a low power standby mode.
  • the Bluetooth module includes: a first waiting receiving module, a third setting module, a wake-up execution module, a second sending module, a second receiving module, a second determining module, a third sending module, and a fourth setting module;
  • the first waiting receiving module is configured to wait to receive data from the upper computer
  • the third setting module is configured to set a state of the bluetooth module to an operating mode when the first waiting receiving module receives data from the upper computer;
  • the wake-up execution module is configured to wake up the security module after the third setting module sets the state of the bluetooth module to an active mode
  • the second sending module is configured to send data from the upper computer that is received by the first waiting receiving module to the security module after the wake-up execution module wakes up the security module for a first preset time ;
  • the second receiving module is configured to receive the operation result from the security module
  • the second determining module after the second sending module sends the data from the upper computer received by the first waiting receiving module to the security module, determining that the second receiving module is in the second pre- Whether the operation result from the security module is received within the set time;
  • the third sending module is configured to: after the second determining module determines that the second receiving module receives the operation result from the security module within a second preset time, to the upper computer Transmitting the operation result received by the second receiving module;
  • the fourth setting module is configured to set a state of the bluetooth module to a low power standby mode after the third sending module sends the operation result received by the second receiving module to the upper computer;
  • the second determining module determines that the second receiving module does not receive the operation result from the security module within a second preset time, setting the state of the bluetooth module to low power consumption Standby mode
  • the first waiting for receiving module is further configured to: after the fourth setting module sets the state of the bluetooth module to a low power standby mode, wait for receiving data from the upper computer.
  • the beneficial effects of the present invention compared with the prior art are: in the Bluetooth security device, when the security module determines that no data is received and returns the operation result to the Bluetooth module, the state is immediately set to the low power standby mode, and the prior art Compared with the scheme in which the Bluetooth security device is always in the working state after being woken up by the host computer, the power saving effect is good, and therefore, the present invention can further improve the standby duration of the Bluetooth security device.
  • FIG. 1 is a flowchart of an operation method of a security module for implementing a Bluetooth power consumption low-power standby method according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of an operation method of a Bluetooth module for implementing a low power consumption standby method of a Bluetooth security device according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of an operation method of a security module for implementing a Bluetooth power consumption low-power standby method according to Embodiment 2 of the present invention
  • FIG. 4 is a flowchart of an operation method of a Bluetooth module for implementing a low power consumption standby method of a Bluetooth security device according to Embodiment 2 of the present invention
  • FIG. 5 is a block diagram of a module structure of a Bluetooth security device according to Embodiment 3 of the present invention.
  • FIG. 6 is a block diagram showing the module composition of a Bluetooth security device according to Embodiment 3 of the present invention.
  • the invention provides a method for implementing low-power standby of a Bluetooth security device, which is applicable to a Bluetooth security device including a security module and a Bluetooth module.
  • the method specifically includes an operation method of the security module and an operation method of the Bluetooth module.
  • the operation method of the security module includes the following steps:
  • Step S1 the security module is woken up by the Bluetooth module, and the self state is set to the working mode;
  • Step S2 The security module determines whether the data from the Bluetooth module is received within the fifth preset time, if yes, step S3 is performed, otherwise step S5 is performed;
  • Step S3 The security module performs a corresponding operation according to the received data to obtain an operation result
  • Step S4 The security module returns the operation result to the Bluetooth module, and performs step S5;
  • Step S5 The security module sets its own state to a low power standby mode, waiting to be woken up by the Bluetooth module.
  • the operation method of the Bluetooth module includes the following steps:
  • Step H1 The Bluetooth module waits to receive data from the host computer
  • Step H2 When receiving the data from the upper computer, the Bluetooth module sets its own state to the working mode, and wakes up the security module;
  • the Bluetooth module sets its own state to the working mode, specifically: the Bluetooth module turns on its own irrelevant module. Further, when the Bluetooth module sets its own state to the working mode, the method further includes: the Bluetooth module sets its own clock to the high-speed clock mode. Further, when the Bluetooth module sets its own state to the working mode, the method further includes: the Bluetooth module turns on the peripheral device connected to itself.
  • the Bluetooth module wakes up the security module, specifically: the Bluetooth module pulls down the level of the first control pin connected to the security module.
  • Step H3 After the first preset time, the Bluetooth module sends data from the upper computer to the security module;
  • Step H4 The Bluetooth module determines whether the operation result from the security module is received within the second preset time, if yes, the operation result is sent to the upper computer, and step H5 is performed; otherwise, step H5 is performed;
  • Step H5 the Bluetooth module sets its own state to a low power standby mode, and performs step H1;
  • the method further includes:
  • Step A1 The Bluetooth module determines whether to disconnect the Bluetooth connection, if the organization disconnects the command, wakes up the security module, and performs step A2; otherwise, step H5 is performed;
  • the Bluetooth module wakes up the security module, specifically: the Bluetooth module pulls down the level of the first control pin connected to the security module.
  • Step A2 The Bluetooth module sends a disconnection instruction to the security module after the third preset time
  • Step A3 When the Bluetooth module receives the response of the disconnection command from the security module within the fourth preset time, the Bluetooth state is set to the deep power saving mode.
  • step S2 before step S3, the method further includes: the security module determines whether the received data is the disconnection instruction, if yes, step S6 is performed, otherwise step S3 is performed;
  • Step S6 The security module organizes the response of the disconnection command, and returns the response of the disconnection command to the Bluetooth module.
  • the Bluetooth module sets its own state to a deep power saving mode, specifically: the Bluetooth module sets its own state to a deep sleep mode;
  • the method further includes: the security module sets the self state to the deep sleep mode;
  • the Bluetooth module sets its own state to the deep power saving mode, specifically: the Bluetooth module performs a shutdown operation.
  • the above-mentioned Bluetooth module sets its own state to a deep sleep mode, specifically: the Bluetooth module turns off the peripheral device connected to itself, turns off its own unrelated module, keeps its own wake-up module powered, and puts its own chip under the main core. Electricity;
  • the security module sets its own state to a deep sleep mode, specifically: the security module closes the peripheral device connected to itself and its own unrelated module, keeps its own wake-up module powered, and powers off its own chip core.
  • step A3 specifically includes:
  • Step A31 The Bluetooth module waits for the fourth sub-preset time, determines whether a response to the disconnection command from the security module is received, and sets the self state to the deep power saving mode; otherwise, step A32 is performed;
  • Step A32 The Bluetooth module determines whether the first time is sent from the first time to the security module until the current time exceeds the fourth preset time;
  • Step A33 The Bluetooth module determines to send a disconnection command to the security module again when the disconnection command is sent to the security module for the first time until the current time does not exceed the fourth preset time, and step A31 is performed.
  • the method further includes: the foregoing Bluetooth module determines that when the disconnection command is sent to the security module for the first time until the current time exceeds the fourth preset time, performing step H5 or setting the self state to the deep power saving mode.
  • step H4 specifically includes:
  • Step H41 The Bluetooth module waits for the second sub-preset time, determines whether the operation result from the security module is received, if yes, the operation result is sent to the upper computer, and step H5 is performed; otherwise, step H42 is performed;
  • Step H42 The Bluetooth module determines whether the data from the host computer is sent to the security module for the first time to the current time exceeds the second preset time, if yes, step H5 is performed, otherwise step H43 is performed;
  • Step H43 The Bluetooth module resends data from the host computer to the security module, and performs step H41.
  • the method further includes:
  • Step L The Bluetooth module determines whether the transmission completion flag is set, and if yes, completes the transmission, and performs step H5; otherwise, the judgment is continued.
  • the execution further includes:
  • the Bluetooth module determines whether the operation result from the security module is received until the current time exceeds the sixth preset time, and if yes, step H5 is performed; otherwise, the determination is continued.
  • the security module determines that the data from the Bluetooth module is received within the fifth preset time, and before step S4, the method further includes:
  • the security module determines whether to set the flow control according to the received data. When the judgment result is the set flow control, the security module uses the low power timer setting flow control timer according to the received data.
  • the method further includes: when the security module is awake by the flow controller, setting the self state to the working mode, performing the corresponding operation, obtaining the operation result, and saving the operation result, and setting the self state to the low power standby mode. .
  • the method further includes: when the security module is awake by the button, setting the self state to the working mode, performing the corresponding operation, obtaining the operation result, and saving the operation result, and setting the self state to the low power standby mode.
  • the step S2 specifically includes:
  • Step S21 The security module determines whether data is received, if yes, step S3 is performed, otherwise step S22 is performed;
  • Step S22 The security module determines whether the setting of the self state is the working mode to the current time exceeds the fifth preset time, if yes, step S5 is performed; otherwise, step S21 is performed.
  • the security module sets its own state to the working mode. Specifically, the security module sets its own clock to the high-speed clock mode and turns on its own irrelevant module.
  • the security module may further include: the security module turns on the peripheral device connected to itself.
  • a peripheral device connected to a security module in a Bluetooth security device is a display module.
  • the unrelated module in the security module includes a communication module, an algorithm module, and a storage module.
  • the communication module may be, but not limited to, a UART (Universal Asynchronous Receiver/Transmitter) module/SPI (Serial Peripheral Interface).
  • UART Universal Asynchronous Receiver/Transmitter
  • SPI Serial Peripheral Interface
  • the serial/peripheral interface module/I2C Inter-Integrated Circuit
  • USB Universal Serial Bus
  • the memory module may be specifically a flash memory module.
  • the security module in the present invention may be specifically a security chip and a peripheral circuit connected to the security chip, and the unrelated module (communication module, storage module, and algorithm module) is integrated in the security chip; the security module may also include the security chip.
  • the communication module in the unrelated module is integrated in the security chip, and the unrelated module
  • the algorithm module is a separate structure that is connected to the security chip.
  • the present invention does not specifically define peripheral circuits connected to the security chip.
  • the security module sets its own state to a low power standby mode. Specifically, the security module sets its own clock to a low speed clock mode, and turns off its own irrelevant module and peripheral devices connected to the security module. Set your own chip to sleep mode.
  • the Bluetooth module sets its own state to a low power standby mode, specifically: the Bluetooth module turns off its own irrelevant module.
  • the method further includes: the Bluetooth module sets its own clock to the low speed clock mode, and sets its own chip to the sleep mode.
  • the unrelated module in the Bluetooth module includes a communication module.
  • the communication module can be, but not limited to, a UART (Universal Asynchronous Receiver/Transmitter) module/SPI (Serial Peripheral Interface).
  • UART Universal Asynchronous Receiver/Transmitter
  • SPI Serial Peripheral Interface
  • One or more of the modules/I2C (Inter-Integrated Circuit) modules are examples of the modules/I2C (Inter-Integrated Circuit) modules.
  • the Bluetooth module may be specifically a Bluetooth chip and a peripheral circuit connected to the Bluetooth chip, and the unrelated module (communication module) is integrated in the Bluetooth chip; the Bluetooth module may also include a Bluetooth chip, an unrelated module, and Bluetooth.
  • the peripheral circuit of the chip connection, wherein the irrelevant module can be integrated in the Bluetooth chip, or can be a separate structure connected to the Bluetooth chip.
  • the communication module in the unrelated module is integrated in the Bluetooth chip, and the unrelated module can also be connected to the Bluetooth chip. Independent structure.
  • the peripheral circuit connected to the Bluetooth chip is not specifically limited in the present invention.
  • the chip of the above-mentioned Bluetooth module and the Bluetooth chip belong to the same concept, and the chip of the above security module and the security chip belong to the same concept.
  • the beneficial effects of the present invention compared with the prior art are: in the Bluetooth security device, when the security module determines that no data is received and returns the operation result to the Bluetooth module, the state is immediately set to the low power standby mode, and the prior art Compared with the power saving mode of the Bluetooth security device, the power saving effect is good, and the standby time of the Bluetooth security device is further improved.
  • the security module After the security module processes the corresponding operation, it enters the low-power standby mode at any time. At the same time, the Bluetooth module enters the low-power standby mode immediately after returning the operation result from the security module to the upper computer, and the prior art Bluetooth security device only after the preset time. Compared with the low-power standby mode, the standby time of the Bluetooth security device can be further improved.
  • the security module and the Bluetooth module are in the low power standby mode, the respective clocks are switched to the low speed clock mode, and the peripheral devices connected to the same are turned off, and the low power consumption standby only turns off the peripheral devices with the prior art.
  • the mode has lower power consumption and better power saving effect.
  • the invention provides a method for realizing low power consumption standby of a Bluetooth security device, and the Bluetooth security device comprises a Bluetooth module and a security module.
  • the operation method of the security module specifically includes:
  • Step 101 The security module waits to be woken up.
  • step 102 When the security module is woken up by the Bluetooth module, step 102 is performed; when the security module is awake by the button, step 108 is performed; when the security module is woken up by the flow control timer, step 109 is performed.
  • the security module when the security module waits to be woken up in step 101, it is in the low power standby mode.
  • Step 102 The security module sets its own state to the working mode, and determines whether data from the Bluetooth module is received within the fifth preset time. If yes, step 103 is performed; otherwise, step 107 is performed.
  • the security module determines whether data is received within the fifth preset time, and specifically includes:
  • Step 1021 The security module determines whether data is received, if yes, step 103 is performed; otherwise, step 1022 is performed;
  • Step 1022 The security module determines whether the self-setting state is the working mode until the current time exceeds the fifth preset time. If yes, the self-status is set to the low-power standby mode, waiting to be awakened by the Bluetooth module; otherwise, step 1021 is performed.
  • the fifth preset time is 30 milliseconds.
  • the security module determines that the security module waits for the fifth sub-preset time before performing step 1021 from the setting of the self-state to the working mode until the current time does not exceed the fifth preset time.
  • the fifth sub-preset time is 10 milliseconds.
  • the security module determines whether the data is received, specifically: the security module determines whether the flag of the status register is a preset receipt flag, and if yes, the data is received, otherwise the data is not received.
  • the flag of the status register is automatically set to a preset receipt flag. For example, the preset revenue flag is 1.
  • Step 103 The security module performs a corresponding operation according to the received data to obtain an operation result.
  • step 103 is specifically:
  • the generated random number is 0001001;
  • the saved button state is obtained, and the obtained operation result is the acquired button state.
  • Step 104 The security module determines whether it is necessary to set the flow control according to the received data, if yes, go to step 105, otherwise go to step 106;
  • the security module determines whether it is necessary to set the flow control according to the received data. Specifically, the security module invokes the corresponding application interface according to the received data, and determines whether the flow control needs to be set according to the invoked application interface.
  • the corresponding application interface is invoked, and according to the corresponding application interface, the result is that the flow control is not required to be set, and step 106 is performed.
  • the received data is a modified PIN code instruction or a signature instruction
  • the corresponding application interface is invoked, and according to the corresponding application interface judgment result, the flow control needs to be set, and step 105 is performed.
  • Step 105 The security module uses the low power timer to set the flow control timer according to the received data.
  • the security module uses the low power consumption timer to set the process timer to arrive after the preset time according to the received data.
  • the process timer is reached after 5 seconds using the low power consumption timer; when the data received by the security module is a signature instruction After executing the signature instruction, use the low-power timer to set the process timer to arrive after 5 seconds.
  • Step 106 The security module returns the operation result to the Bluetooth module.
  • the random number is returned to the Bluetooth module
  • the data received by the security module is the modified PIN code instruction
  • the status code of the modified PIN code is returned to the Bluetooth module
  • the security module is When the received data is a signature instruction, the status code of the signature instruction is returned to the Bluetooth module; when the instruction to take the signature result is received, the saved signature result is returned to the Bluetooth module; when the button state command is received, the saved button state is saved. Return to the Bluetooth module.
  • Step 107 The security module sets its own state to a low power standby mode, waiting to be woken up.
  • the security module directly enters the low power standby mode; when the security module in step 102 When the data is received, after the processing of steps 103-105, in step 106, the security module enters the low-power standby mode immediately after returning the operation result to the Bluetooth module. That is, in the present invention, the security module judges that the data is not received, or after the data is processed and the operation result is returned to the Bluetooth module, the low-power standby mode is immediately entered, and the power saving effect is better than the prior art, thereby further improving the Bluetooth.
  • the standby time of the security device is, judges that the data is not received, or after the data is processed and the operation result is returned to the Bluetooth module, the low-power standby mode is immediately entered, and the power saving effect is better than the prior art, thereby further improving the Bluetooth.
  • Step 108 The security module sets its own state to the working mode, performs the corresponding operation, and saves the operation result, and sets its own state to the low power standby mode.
  • step 108 the security module performs a corresponding operation, and saves the operation result, specifically: the security module performs a corresponding operation according to the button, and saves the operation result.
  • the security module is woken up by the Bluetooth module, and when receiving the button state command from the Bluetooth module, the operation result is returned to the Bluetooth module.
  • Step 109 The security module sets its own state to the working mode, performs the corresponding operation, saves the operation result, and sets its own state to the low power standby mode.
  • step 109 the security module performs a corresponding operation, and saves the operation result, specifically: the security module sets a timeout flag, and saves the timeout flag.
  • the step 109 is specifically: the security module sets its own state to the working mode, sets a timeout flag, and saves the timeout flag, and sets its own state to the low power standby mode.
  • the security module is woken up by the Bluetooth module, and when receiving the button state command from the Bluetooth module, the timeout flag is returned to the Bluetooth module.
  • step 102 when the security module receives the signature instruction, step 103 is performed (step 103 is specifically: displaying key data information in the signature instruction) And the status code of the signature instruction is organized, and the obtained operation result is the status code of the signature instruction.
  • step 104 the result of the determination is that the flow control needs to be set. After performing steps 105-107, the security module is in the low power standby mode, waiting for reception.
  • the confirmation signature notification message of the user after performing step 107, includes the following situations: when the security module is awake by the button within the preset time set by the flow control timer, and receives the confirmation signature notification message, step 108 is performed ( Step 108 is specifically as follows: the security module sets its own state to the working mode, performs a signature operation, and saves the signature result, and sets its own state to a low power standby mode); when the security module is within the preset time set by the flow control timer When the button wakes up and receives the cancel signature notification message, step 108 is executed.
  • the security module sets its own state to work mode, organizes the cancellation of the signature response, and saves the cancellation signature response, sets its own state to the low power standby mode); when the security module is set in the flow control timer preset The button is not woken up within the time. When the flow control timer arrives, the security module is woken up by the flow control timer, and step 109 is executed.
  • the security module wakes up the button and receives the confirmation signature notification message; when the user presses the "cancel” button, the security module is woken up by the button and receives the cancellation signature notification. Message; when the user does not press the "confirm” or “cancel” button within the preset time set by the flow control timer, when the flow control timer arrives, the security module is woken up by the flow control timer, and step 109 is performed.
  • step 102 when the data received by the security module is a modified PIN code command, the security module performs step 103 (step 103 is specifically : Performing a modify PIN code operation, and organizing a status code of the PIN code command, and the obtained operation result is a status code for modifying the PIN code command.
  • step 104 the result of the determination is that the flow control needs to be set, and after performing step 105--step 107
  • the security module is in a low-power standby mode, waiting for receiving the user's confirmation to modify the PIN code notification message, and after step 107, the following situations are included: when the security module is activated by the button within the preset time set by the flow control timer, and After receiving the confirmation modification PIN code notification message, step 108 is performed (step 108 is specifically: the security module sets its own state to the working mode, performs a modification PIN code operation, and organizes a state code for modifying the PIN code successfully, and saves the state of modifying the PIN code.
  • step 108 is performed (step 108 is specifically: the security module sets its own state to the working mode, and the organization modifies the PIN code failure status code, After saving the failure status code of the modified PIN code, the security module sets its own state to the low power standby mode); when the security module is not awake by the button within the preset time set by the flow control timer, when the flow control timer arrives The security module is awakened by the flow control timer, and step 109 is performed.
  • the security module when the user presses the "confirm” button, the security module is woken up by the button, and receives a notification message of the user confirming the modification of the PIN code; when the user presses the "cancel” button, the security module is woken up by the button and receives To cancel the modification of the PIN code notification message; when the user does not press the "confirm” or “cancel” button within the preset time set by the flow control timer, the safety module is controlled by the flow control when the flow control timer arrives The device wakes up and performs step 109.
  • the operating method of the Bluetooth module specifically includes:
  • Step 201 The Bluetooth module waits to receive data from the upper computer
  • the Bluetooth module waits to receive data from the host computer, it is in a low power standby mode.
  • the clock is in low speed clock mode.
  • the clock frequency of the Bluetooth module in the low power standby mode is 0.07 MHz.
  • the upper computer is a terminal supporting the Bluetooth function.
  • a terminal supporting the Bluetooth function for example, a mobile terminal or a computer terminal.
  • Step 202 When receiving the data from the upper computer, the Bluetooth module sets its own state to the working mode, and wakes up the security module;
  • the Bluetooth module receives the data of the upper computer as one of a random number instruction, a signature instruction, a signature result instruction, a button state command, and a PIN code modification command.
  • the random number instruction is 0x0084000008.
  • Step 203 The Bluetooth module sends data from the host computer to the security module after the first preset time.
  • the first preset time is 10 milliseconds.
  • Step 204 The Bluetooth module determines whether the operation result from the security module is received within the second preset time, if yes, step 205 is performed, otherwise step 210 is performed;
  • step 204 specifically includes:
  • Step 2041 The Bluetooth module waits for the second sub-preset time to determine whether the operation result from the security module is received. If yes, the operation result is sent to the upper computer, and step 205 is performed; otherwise, step 2042 is performed.
  • the second sub-preset time is 10 milliseconds.
  • Step 2042 The Bluetooth module determines whether the data from the upper computer is sent to the security module for the first time to the current time exceeds the second preset time. If yes, step 210 is performed; otherwise, step 2043 is performed.
  • the second preset time is 30 milliseconds.
  • Step 2043 The Bluetooth module resends data from the host computer to the security module, and step 2041 is performed.
  • Step 205 The Bluetooth module sends an operation result to the upper computer.
  • the method further includes:
  • Step L The Bluetooth module determines whether the transmission completion flag is set, and if yes, the transmission is completed, and step 206 is performed; otherwise, the determination is continued.
  • the method further includes: the Bluetooth module determining whether the operation result from the security module is received until the current time exceeds a sixth preset time, If yes, go to step 210; otherwise continue to judge.
  • Step 206 The Bluetooth module determines whether to disconnect the Bluetooth connection, if yes, go to step 207, otherwise go to step 210;
  • the Bluetooth module determines whether to disconnect the Bluetooth connection, specifically: the Bluetooth chip in the Bluetooth module determines whether the Bluetooth disconnection event is monitored, and then determines to disconnect the Bluetooth connection, otherwise determines that the Bluetooth connection is not disconnected.
  • the Bluetooth protocol stack detects whether the heartbeat packet exists within a preset time. If yes, the Bluetooth chip cannot monitor the Bluetooth disconnection event in the Bluetooth protocol stack, and the Bluetooth module determines that the Bluetooth connection is not disconnected; otherwise, the Bluetooth protocol stack A Bluetooth disconnect event is generated, the Bluetooth chip listens for a Bluetooth disconnect event in the Bluetooth protocol stack, and the Bluetooth module determines to disconnect the Bluetooth connection.
  • Step 207 The Bluetooth module organizes the disconnection instruction, wakes up the security module, and sends a disconnection instruction to the security module after the third preset time.
  • the third preset time is 10 milliseconds.
  • the disconnection command organized by the Bluetooth module is: 6B08000000000103.
  • Step 208 The Bluetooth module determines whether a response to the disconnection command from the security module is received within the fourth preset time. If yes, step 209 is performed; otherwise, step 210 is performed.
  • the method further includes:
  • Step 110 The security module determines whether the received data is a disconnection instruction, if yes, step 111 is performed, otherwise step 103 is performed;
  • Step 111 The security module organizes the response of the disconnection instruction and returns the response of the disconnection instruction to the Bluetooth module.
  • step 208 specifically includes:
  • Step 2081 The Bluetooth module waits for the fourth sub-preset time to determine whether a response to the disconnection command from the security module is received. If yes, step 209 is performed; otherwise, step 2082 is performed; for example, the fourth sub-preset time is 10 milliseconds.
  • Step 2082 The Bluetooth module determines whether the first time is sent from the first time to the security module until the current time exceeds the fourth preset time. If yes, step 210 is performed or step 209 is performed, otherwise step 2083 is performed.
  • the fourth preset time is 30 milliseconds.
  • Step 2083 The Bluetooth module sends a disconnect command to the security module again, and step 2081 is performed.
  • Step 209 The Bluetooth module sets its own state to the deep power saving mode.
  • Step 210 The Bluetooth module sets its own state to a low power standby mode.
  • the foregoing Bluetooth module sets its own state to a deep power saving mode, specifically: the Bluetooth module sets its own state to a deep sleep mode.
  • the security module further includes setting the self state to the deep sleep mode.
  • the security module sets its own state to a deep sleep mode, specifically: the security module closes the peripheral device connected to itself and its own unrelated module, maintains its own wake-up module, and powers the core module of the security module. Electricity;
  • the foregoing Bluetooth module sets its own state to a deep sleep mode, specifically: the Bluetooth module turns off the peripheral device connected to itself, turns off its own unrelated module, keeps its own wake-up module powered, and sets its own chip core. Power off.
  • the peripheral device connected to itself is turned off, and the independent module is turned off.
  • the clock is off, and the current is at the nanoamp level (the power consumption is about 40nA).
  • the power saving effect is better; compared with the shutdown mode, the module can quickly wake up from the deep sleep mode to the working mode, and responds quickly to the peripheral device request, and the user experience is better.
  • the Bluetooth module and the security module of the deep sleep mode only power off the chip in the module, turn off the peripheral device with large power consumption, keep the wake-up module in the module keep power; wake up by wake-up module when wake-up, the chip in the module Power-on, set the clock frequency, do not need to initialize all the devices, the wake-up speed is faster than the switch from the shutdown state to the boot.
  • the Bluetooth module when the Bluetooth module disconnects the Bluetooth connection, the user enters the deep sleep mode, and the Bluetooth module converts from the deep sleep mode to the work when receiving the data from the upper computer when the Bluetooth module is disconnected and directly shuts down.
  • the mode is shorter than the time from the shutdown state to the working mode.
  • the user experience can be improved at boot time, and the power consumption is in the nanoamp (nA) level, which is slightly higher than the power consumption when shutting down.
  • the Bluetooth module sets its own state to a deep power saving mode, specifically: the Bluetooth module performs a shutdown operation.
  • the Bluetooth security device when the Bluetooth module disconnects the Bluetooth connection, the Bluetooth security device is completely powered off after the Bluetooth module performs the shutdown operation, and the power consumption is 0, which can save power to the greatest extent, and the power saving effect is good, but all the power needs to be turned on.
  • the device is initialized and the boot speed is slower than wake-up by deep sleep mode.
  • the Bluetooth module and the security module can share a power supply module.
  • the Bluetooth module receives a response from the disconnection command of the security module, the shutdown operation is performed, the power is turned off, and the security module is also powered off.
  • the Bluetooth module sets its own state to a low power standby mode, specifically: the Bluetooth module turns off the peripheral device connected to itself and its own unrelated module. Further, when the Bluetooth module sets its own state to the low power standby mode, the method further includes: the Bluetooth module sets its own clock to the low speed clock mode, and sets its own chip to the sleep mode.
  • the low-speed clock mode has a clock frequency of 0.7 MHz.
  • the unrelated module in the Bluetooth module in the second embodiment includes but is not limited to a communication module; the communication module in the unrelated module may be, but not limited to, a UART (Universal Asynchronous Receiver/Transmitter) module/SPI. (Serial Peripheral Interface) module / I2C (Inter-Integrated Circuit) module.
  • UART Universal Asynchronous Receiver/Transmitter
  • SPI Serial Peripheral Interface
  • I2C Inter-Integrated Circuit
  • the security module sets its own state to a low-power standby mode. Specifically, the security module sets its own clock to a low-speed clock mode, and turns off its own irrelevant module and peripheral devices connected to the security module. Its own chip is set to sleep mode.
  • the security module sets its own clock frequency from 2.5MHz to 0.07MHz;
  • the security module closes the peripheral device connected thereto, specifically: shutting down the peripheral device with high power consumption connected thereto. For example, close the display module connected to it.
  • the unrelated module in the security module includes a communication module, an algorithm module, and a storage module.
  • the algorithm module may include, but is not limited to, an SM4 algorithm module/SM1 algorithm module/Hash algorithm module/Sha2 algorithm module;
  • the communication module of the security module can be, but is not limited to, a UART (Universal Asynchronous Receiver/Transmitter) module/SPI (Serial Peripheral Interface) module/I2C (Inter-Integrated Circuit) Module / USB (Universal Serial Bus) module.
  • UART Universal Asynchronous Receiver/Transmitter
  • SPI Serial Peripheral Interface
  • I2C Inter-Integrated Circuit
  • USB Universal Serial Bus
  • the security module sets its own state to an operating mode, and specifically, the security module switches its own clock to a high-speed clock mode.
  • the clock frequency is 0.07MHz
  • the security module switches the clock to the high-speed clock mode.
  • the security module switches the clock frequency from 0.07MHz to 2.5MHz.
  • the chip when the Bluetooth module and the security module set their own state to the low power standby mode, the chip is set to the sleep mode, and the clock is turned off, and the power consumption can be further reduced. If the clock is only turned off and the chip is not set to sleep mode, the chip will continue to execute the work program. When the chip is set to sleep mode, the chip stops executing the work program.
  • the security module when the security module sets its own state to the working mode, it further includes: the security module turns on its own irrelevant module. For example, the security module turns on the communication module and the algorithm module.
  • the algorithm module and the communication module in the security module may be built in the chip of the security module or may be connected to the chip in the security module.
  • the method further includes: the security module opening a peripheral device connected to itself, for example, opening a display module connected to itself.
  • the Bluetooth module sets its own state to the working mode, specifically: the Bluetooth module turns on its own communication module.
  • the method further includes: the Bluetooth module switches its own clock to the high-speed clock mode. For example, the Bluetooth module switches the clock frequency from 0.07MHz to 2.5MHz. Further, when the Bluetooth module sets its own state to the working mode, the method further includes: the Bluetooth module turns on the peripheral device connected to itself.
  • the Bluetooth module wake-up security module is specifically configured to: the Bluetooth module pulls down the level of the first control pin connected to the security module.
  • the first control pin of the Bluetooth module connected to the security module is a combus control line.
  • the method further includes: after the Bluetooth module pulls down the level of the first control pin connected to the security module, the Bluetooth module raises the level of the first control pin . For example, within 10 milliseconds after the Bluetooth module pulls down the level of the first control pin connected to the security module, the Bluetooth module pulls the level of the first control pin high.
  • the peripheral device of the Bluetooth security device includes a display module, but is not limited to the display module.
  • the display module is connected to the security module, but is not limited to the connection mode.
  • the display module can be connected to the security module and/or the Bluetooth module.
  • the security module when the security module is in the shutdown mode, the security module is powered off, and when the Bluetooth module wakes up, the power module must be powered on first (specifically, the security module is powered on, specifically, the Bluetooth module supplies power to the security module through the LDO or MOS tube) , set the clock to high-speed clock mode, and initialize the hardware;
  • the security module When the security module is in the deep sleep mode, the main core of the security chip in the security module is powered off, and the peripheral device connected to the security module is turned off, and the algorithm module and the irrelevant module connected to the security module are closed, and only the wake-up module in the security module has power. After being woken up by the Bluetooth module, the security module wakes up through the wake-up module, powers on the chip core of the security module, and sets the clock to a high-speed clock mode;
  • the security module When the security module is in the low-power standby module, the security module only turns off the peripheral device with large power consumption, the chip of the security module has power, the clock is in the low-speed clock mode, and the chip of the security module is set to the sleep mode, and the chip of the security module is received. When data is used, the clock is set to the high speed clock mode.
  • the Bluetooth module when the Bluetooth module is in the shutdown mode, the Bluetooth module is powered off, and when the boot event is received, the Bluetooth chip is powered on.
  • the Bluetooth module receives the boot event specifically: the user presses the power button of the Bluetooth security device.
  • the clock is set to the high-speed clock mode, and the hardware is initialized (the hardware includes devices such as capacitors);
  • the Bluetooth module When the Bluetooth module is in deep sleep mode, the chip core in the Bluetooth module is powered off, the peripheral device connected to the Bluetooth module is turned off, and the unrelated module in the Bluetooth module (such as the communication module SPI/UART/I2C) is turned off, only in the Bluetooth module.
  • the wake-up module has power. When receiving the boot event, the wake-up module wakes up, powers on the main core of the Bluetooth chip, and sets the clock to a high-speed clock mode;
  • the Bluetooth module When the Bluetooth module is in the low-power standby module, the Bluetooth module only turns off the peripheral device with large power consumption.
  • the chip of the Bluetooth module has power, the clock is in the low-speed clock mode, and the chip of the Bluetooth module is in the sleep mode, and the data of the host computer is received. Set the clock to the high speed clock mode.
  • the security module and the Bluetooth module directly enter the low-power standby mode when the corresponding operation is completed, and the Bluetooth security device is awake by the upper computer in the prior art, and must enter the low-power standby mode after the preset time.
  • the power saving effect is better; in addition, in the present invention, when the security module and the Bluetooth module are in the low power standby mode, the respective clocks are switched to the low speed clock mode, and the peripheral device connected to itself and its own unrelated module are turned off, and In the prior art, the low power standby mode in which only the peripheral device is turned off has lower power consumption and better power saving effect.
  • the Bluetooth module determines to disconnect the Bluetooth connection, the security module and the Bluetooth module enter a deep power saving mode, which is better than the ordinary low power standby mode.
  • the present invention provides a Bluetooth security device, including a security module and a Bluetooth module.
  • a block diagram of a module of a Bluetooth security device is provided.
  • the security module includes: a first setting module 11, a first receiving module 12, and a first determining module. 13.
  • the first setting module 11 is configured to set a state of the security module to an operating mode when the security module is awake by the Bluetooth module;
  • a first receiving module 12 configured to receive data from a Bluetooth module
  • the first judging module 13 is configured to determine whether the first receiving module 12 receives the data from the Bluetooth module within the fifth preset time after the state of the first setting module 11 setting the security module is the working mode;
  • the execution module 14 is configured to: when the first determining module 13 determines that the first receiving module 12 receives the data from the Bluetooth module, perform a corresponding operation according to the data received by the first receiving module 12, to obtain an operation result;
  • the first sending module 15 is configured to return the operation result obtained by the execution module 14 to the Bluetooth module;
  • the second setting module 16 is configured to: when the first determining module 13 determines that the first receiving module 12 does not receive data from the Bluetooth module within the fifth preset time, set the state of the security module to a low power standby mode; For setting the status of the security module to a low power standby mode after the first sending module 15 returns the operation result to the Bluetooth module;
  • the waiting module 17 is configured to wait for the security module to be woken up by the Bluetooth module after the second setting module 16 sets the state of the security module to the low power standby mode.
  • FIG. 6 it is a block diagram of a module of a Bluetooth security device, where the Bluetooth module includes: a first waiting receiving module 21 , a third setting module 22 , a wake-up executing module 23 , a second sending module 24 , and a second a receiving module 25, a second determining module 26, a third sending module 27 and a fourth setting module 28;
  • the first waiting receiving module 21 is configured to wait for receiving data from the upper computer
  • the third setting module 22 is configured to set the state of the bluetooth module to the working mode when the first waiting receiving module 21 receives the data from the upper computer;
  • the wake-up execution module 23 is configured to wake up the security module after the third setting module 22 sets the state of the Bluetooth module to the working mode;
  • the second sending module 24 is configured to send the data from the upper computer received by the first waiting receiving module 21 to the security module after the wake-up execution module 23 wakes up the security module for a first preset time;
  • a second receiving module 25 configured to receive an operation result from the security module
  • the second determining module 26 is configured to: after the second sending module 24 sends the data from the upper computer received by the first waiting receiving module 21 to the security module, determine whether the second receiving module 25 receives within the second preset time. To the result of the operation from the security module;
  • the third sending module 27 is configured to: after the second determining module 26 determines that the second receiving module 25 receives the operation result from the security module within the second preset time, send the operation received by the second receiving module 25 to the upper computer. result;
  • the fourth setting module 28 is configured to set the state of the bluetooth module to a low power standby mode after the third sending module 27 sends the operation result received by the second receiving module 25 to the upper computer; for determining by the second determining module 26 After the second receiving module 25 does not receive the operation result from the security module within the second preset time, setting the state of the Bluetooth module to a low power standby mode;
  • the first waiting receiving module 21 is further configured to: after the fourth setting module 28 sets the state of the bluetooth module to the low power standby mode, wait for receiving data from the upper computer.
  • the foregoing Bluetooth module further includes a third determining module, an organization module, a fourth sending module, a second waiting receiving module, and a fifth setting module;
  • a third determining module configured to determine, by the third sending module 27, that the Bluetooth connection is disconnected after the operating result is sent to the upper computer
  • the fourth setting module 28 is configured to: when the third determining module determines that the Bluetooth connection is not broken, setting the state of the Bluetooth module to a low power standby mode;
  • An organization module configured to: when the third determining module determines to disconnect the Bluetooth connection, the organization disconnects the instruction;
  • the wake-up execution module 23 is further configured to wake up the security module after the third determining module determines to disconnect the Bluetooth connection or the organization module organizes the disconnection instruction;
  • a fourth sending module configured to: when the third determining module determines to disconnect the Bluetooth connection, and wakes up the third preset time of the executing module 23 to wake up the security module, sending a disconnection instruction to the security module;
  • a second waiting receiving module configured to receive a response from the disconnection instruction of the security module
  • a fifth setting module configured to be within a fourth preset time after the fourth sending module sends the disconnecting instruction to the security module, and when the second waiting receiving module receives the response from the disconnecting instruction of the security module, setting the Bluetooth module
  • the state is the deep power saving mode
  • the security module further includes: a fourth determining module, a response organization module, and a response sending module;
  • a fourth determining module configured to determine whether the data received by the first receiving module 12 is a disconnection instruction
  • a response organization module configured to: when the fourth determining module determines that the data received by the first receiving module 12 is a disconnection instruction, the organization disconnects the response of the instruction;
  • An answer sending module configured to return a response of the disconnection instruction organized by the response organization module to the Bluetooth module
  • the execution module 14 is specifically configured to: when the fourth determining module determines that the data received by the first receiving module 12 is not a disconnection instruction, perform a corresponding operation according to the data received by the first receiving module 12, to obtain an operation result.
  • the foregoing security module further includes a sixth setting module, including the fourth determining module, the response organization module, and the response sending module;
  • the fifth setting module is specifically configured to: when the fourth sending module receives the disconnection command from the security module within a fourth preset time after the fourth sending module sends the disconnecting command to the security module, Set the state of the Bluetooth module to deep sleep mode;
  • a sixth setting module configured to set the security module state to a deep sleep mode after the response sending module returns a response of the disconnection command to the Bluetooth module.
  • the above-mentioned Bluetooth security device further includes a peripheral device; correspondingly, the fifth setting module is specifically configured to be within a fourth preset time after the fourth sending module sends the disconnection command to the security module, and the second waiting When the receiving module receives the response from the disconnection command of the security module, the peripheral device connected to the Bluetooth module is turned off, the wake-up module of the Bluetooth module is kept powered, and the chip core of the Bluetooth module is powered off;
  • the sixth setting module is specifically configured to: after the response sending module returns the response of the disconnection command to the Bluetooth module, close the peripheral device connected to the security module, close the irrelevant module in the security module, and maintain the wake-up module of the security module. Have power and power off the chip core of the security module.
  • the peripheral device in the Bluetooth security device may be, but not limited to, a display module.
  • the display module may be, but not limited to, connected to the security module, for example, the display module is connected to the security module and/or the Bluetooth module.
  • the fifth setting module is specifically configured to: after the fourth sending module sends a disconnection command to the security module, the second waiting receiving module receives the disconnection from the security module. When the command is answered, the shutdown operation is performed.
  • the fifth setting module may include: a fifth waiting determining submodule, a fifth setting submodule, a fifth timeout judging submodule, and a fifth sending submodule;
  • a fifth waiting judgment sub-module configured to wait for the fourth sub-preset time after the fourth sending module sends the disconnection instruction to the security module, and determine whether the second waiting receiving module receives the response of the disconnection instruction from the security module;
  • a fifth setting sub-module configured to: when the fifth waiting for determining sub-module determines that the second waiting receiving module receives the response of the disconnection command from the security module, setting the state of the bluetooth module to the deep power saving mode;
  • the fifth timeout judging submodule is configured to determine, when the second waiting receiving module does not receive the response of the disconnection command from the security module, the fifth waiting time determining submodule, sending the disconnection from the fourth sending module to the security module for the first time. Whether the command reaches the current time exceeds the fourth preset time;
  • the fifth sending submodule is configured to: when the fourth sending module sends a disconnection command to the security module for the first time, until the current time does not exceed the fourth preset time, the third sending module sends a disconnect command to the security module. ;
  • the fifth waiting judgment sub-module is further configured to wait for the fourth sub-preset time after the fifth sending sub-module re-sends the disconnection instruction to the security module, and determine whether the second waiting receiving module receives the disconnection instruction from the security module. Answer.
  • the fourth setting module 28 is further configured to determine, by the fifth timeout determining submodule, that the fourth sending module sets the Bluetooth module from the first time that the disconnection command is sent to the security module until the current time exceeds the fourth preset time.
  • the state is a low power standby mode
  • the fifth setting submodule is further configured to determine, by the fifth timeout determining submodule, the state of the Bluetooth module when the fourth sending module sends a disconnection command to the security module for the first time until the current time exceeds the fourth preset time. For deep power saving mode.
  • the second determining module 26 may specifically include a second waiting determining submodule, a second timeout determining submodule, and a resending submodule;
  • the second waiting for determining the sub-module after the second sending module 24 sends the data from the upper computer received by the first waiting receiving module 21 to the security module, waits for the second sub-preset time, and determines whether the second receiving module 25 receives the data.
  • the result of the operation from the security module is the result of the operation from the security module;
  • the third sending module 27 is configured to: when the second waiting determining sub-module determines that the second receiving module 25 receives the operation result from the security module within the second preset time, sending the second to the upper computer The operation result received by the receiving module 25;
  • the second timeout judging submodule is configured to: when the second waiting module 25 does not receive the operation result from the security module, determine that the second sending module 24 sends the security module from the host computer for the first time. Whether the data reaches the current time exceeds the second preset time;
  • the fourth setting module 28 is configured to: when the second timeout determining submodule determines that the second sending module 24 sends data to the security module for the first time until the current time exceeds the second preset time, setting the state of the bluetooth module to low power Consumption standby mode;
  • the second waiting judgment sub-module is further configured to: after resending the sub-module to send the data from the upper computer to the security module, wait for the second sub-preset time, and determine whether the second receiving module 25 receives the operation result from the security module. .
  • the third setting module 22 is specifically configured to: when the first waiting receiving module 21 receives the data from the upper computer, turn on the irrelevant module in the bluetooth module. Further, the third setting module 22 is further configured to set the clock of the bluetooth module to the high speed clock mode when the first waiting receiving module 21 receives the data from the upper computer.
  • the fourth setting module 28 is specifically configured to: close an unrelated module in the Bluetooth module. Further, the fourth setting module 28 is further configured to: set a clock of the bluetooth module to a low speed clock mode, and set a chip in the bluetooth module to a sleep mode.
  • the wake-up execution module 23 is specifically configured to lower the level of the first control pin connected to the security module.
  • the foregoing Bluetooth module in the third embodiment includes a first waiting receiving module 21, a third setting module 22, a wake-up executing module 23, a second sending module 24, a second receiving module 25, and a second determining module 26,
  • the third sending module 27 and the fourth setting module 28 further include a completion sending determining module, configured to determine whether the sending completion flag is set when the third sending module 27 sends the operation result received by the second receiving module 25 to the upper computer.
  • the fourth setting module 28 is configured to: when the sending determination module determines that the sending completion flag is set, setting the state of the Bluetooth module to a low power standby mode;
  • the completion of the transmission determination module is further configured to continue to determine whether the transmission completion flag is set when it is determined that the transmission completion flag is not set.
  • the foregoing Bluetooth module further includes a timeout determining module, configured to complete the sending determining module, determining that the sending completion flag is not set, and determining that the security module is received from the second receiving module 25. Whether the current operation time exceeds the sixth preset time;
  • the fourth setting module 28 is further configured to: when the timeout determining module determines that the operation result from the security module is received from the second receiving module 25 until the current time exceeds the sixth preset time, setting the state of the Bluetooth module to low power Consumption standby mode;
  • the sending determination module is configured to determine whether the sending completion flag is set when the timeout determining module determines that the operation result from the security module is received from the second receiving module 25 until the current time does not exceed the sixth preset time.
  • the security module in the foregoing Bluetooth security device includes a module first setting module 11, a first receiving module 12, a first determining module 13, an executing module 14, a first sending module 15, a second setting module 16, and
  • the waiting module 17 further includes a process control judging module and a flow control setting module;
  • the flow control judging module is configured to determine whether the first receiving module 12 receives the data from the Bluetooth module within the fifth preset time, and determines whether to set the flow control according to the data received by the first receiving module 12;
  • the flow control setting module is configured to: when the flow control judgment module determines that the flow control needs to be set, use the low power consumption timer to set the flow control timer according to the data received by the first receiving module 12.
  • the security module further includes an execution save module, including the flow control determination module and the flow control setting module;
  • the first setting module 11 is further configured to: when the security module is awake by the flow control timer set by the flow control setting module, set the state of the security module to the working mode;
  • Executing a saving module when the security module is awake by the flow control timer set by the flow control setting module, and after the first setting module 11 sets the state of the security module to the working mode, performing a corresponding operation to obtain an operation result, and saving the operation result;
  • the second setting module 16 is further configured to: after performing the save module save operation result, set the security module state to a low power standby mode.
  • the foregoing Bluetooth security device further includes a button, where the security module includes a module first setting module 11, a first receiving module 12, a first determining module 13, an executing module 14, a first sending module 15, and a second setting module. 16 and waiting for the module 17, further comprising executing a save module;
  • the first setting module 11 is further configured to set the state of the security module to the working mode when the security module is awake by the button.
  • Executing a saving module when the security module is awake by a button, and after the first setting module 11 sets the state of the security module to the working mode, performing a corresponding operation to obtain an operation result, and saving the operation result;
  • the second setting module 16 is further configured to: after the saving module saves the operation result, set the security module state to a low power standby mode.
  • the first determining module 13 in the security module may specifically include a first determining submodule, a first waiting submodule, and a first timeout determining submodule;
  • a first determining sub-module configured to determine, by the first setting module 11 that the state of the security module is an operating mode, determining whether the first receiving module 12 receives data from the Bluetooth module;
  • the execution module 14 is specifically configured to: when the first determining sub-module determines that the first receiving module 12 receives the data from the Bluetooth module, perform a corresponding operation according to the data received by the first receiving module 12, to obtain an operation result;
  • a first timeout judging submodule configured to determine, by the first judging submodule, that the first receiving module 12 does not receive data from the bluetooth module, determine whether the state of the security module is set from the first setting module 11 to the working mode to the current time. More than the fifth preset time;
  • the second setting module 16 is configured to determine, by the first timeout determining submodule, that the state of the security module is set when the first setting module 11 sets the security module state to the working mode until the current time exceeds the fifth preset time. Low power standby mode;
  • the first determining sub-module is further configured to: when the first setting module 11 sets the security module state to the working mode, when the current time does not exceed the fifth preset time, wait for the fifth sub-preset time, and determine the first Whether the receiving module 12 receives the data.
  • the first setting module 11 is specifically configured to set the clock of the security module to the high-speed clock mode when the security module is awakened, and open the irrelevant module in the security module. Further, when the foregoing Bluetooth includes the peripheral device, the first setting module 11 is further configured to: when the security module is woken up, turn on the peripheral device connected to the security module.
  • the Bluetooth security device further includes a peripheral device
  • the second setting module 16 is specifically configured to set the clock of the security module to the low-speed clock mode, close the irrelevant module in the security module and the peripheral device connected to the security module, and set the chip in the security module to the sleep mode.
  • the beneficial effects of the present invention compared with the prior art are: in the Bluetooth security device, when the security module determines that no data is received and returns the operation result to the Bluetooth module, the state is immediately set to the low power standby mode, and the prior art Compared with the power saving mode of the Bluetooth security device, the power saving effect is good, and the standby time of the Bluetooth security device is further improved.
  • the security module After the security module processes the corresponding operation, it enters the low-power standby mode at any time. At the same time, the Bluetooth module enters the low-power standby mode immediately after returning the operation result from the security module to the upper computer, and the prior art Bluetooth security device only after the preset time. Compared with the low-power standby mode, the standby time of the Bluetooth security device can be further improved.
  • the respective clocks are switched to the low-speed clock mode, and the peripheral device is turned off, compared with the low-power standby mode in which the prior art only turns off the peripheral device. Lower consumption and better power saving effect.

Abstract

一种实现蓝牙安全设备低功耗待机的方法,该方法包括:安全模块被蓝牙模块唤醒,设置自身状态为工作模式;安全模块判断在第五预设时间之内是否接收到来自蓝牙模块的数据,是则根据接收的数据执行相应操作,得到操作结果,将操作结果返回蓝牙模块,设置自身状态为低功耗待机模式,等待被蓝牙模块唤醒;否则设置自身状态为低功耗待机模式,等待被蓝牙模块唤醒。本发明公开的蓝牙安全设备包括安全模块和蓝牙模块,其中,安全模块包括第一设置模块、第一接收模块、第一判断模块、执行模块、第一发送模块、第二设置模块和等待模块。本发明中的方法及蓝牙安全设备的省电效果好,蓝牙安全设备的待机时间长。

Description

一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备 技术领域
本发明涉及一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备,属于电子技术领域。
背景技术
随着移动支付技术的快速发展,在移动支付的技术含量以及设备便携性方面的要求越来越高。现有技术中,为提高便携性,移动支付设备的体积越做越小,但是体积小随之带来的是电池容量不够的问题;现有技术中,为提高电池的待机时长,蓝牙安全设备设置了低功耗待机模式(功耗约为2mA)和工作模式(功耗约为10mA),现有技术中实现低功耗待机模式的技术方案是:蓝牙安全设备被上位机唤醒,当接收到上位机的数据时,根据接收的数据进行处理得到处理结果,将处理结果返回上位机之后仍然处于工作模式,在被上位机唤醒的预设时间之后关闭外围设备,进入低功耗待机模式;当没有接收到上位机的数据时,在被上位机唤醒的预设时间之后蓝牙安全设备关闭外围设备,进入低功耗待机模式。即现有技术中蓝牙安全设备被上位机唤醒后,不论蓝牙安全设备是否接收到数据,在预设时间内都一直处于工作状态。
现有技术存在的缺陷是:蓝牙安全设备低功耗待机模式节省的电能比较有限,延长待机时间的效果并不理想。
发明内容
本发明的目的是提供一种实现蓝牙安全设备低功耗待机的方法以及一种蓝牙安全设备,其省电效果好,蓝牙安全设备的待机时间长。
为此,根据本发明的一个方面,提供了一种实现蓝牙安全设备低功耗待机的方法,包括以下步骤:
步骤S1:安全模块被蓝牙模块唤醒,设置自身状态为工作模式;
步骤S2:所述安全模块判断在第五预设时间之内是否接收到来自所述蓝牙模块的数据,是则执行步骤S3,否则执行步骤S5;
步骤S3:所述安全模块根据接收的数据执行相应操作,得到操作结果;
步骤S4:所述安全模块将所述操作结果返回所述蓝牙模块,执行步骤S5;以及
步骤S5:所述安全模块设置自身状态为低功耗待机模式,等待被所述蓝牙模块唤醒。
优选地,上述方法还包括以下步骤:
步骤H1:所述蓝牙模块等待接收来自上位机的数据;
步骤H2:所述蓝牙模块接收到来自上位机的数据时,设置自身的状态为工作模式,唤醒所述安全模块;
步骤H3:所述蓝牙模块在第一预设时间之后,向所述安全模块发送来自所述上位机的数据;
步骤H4:所述蓝牙模块判断在第二预设时间之内是否接收到来自所述安全模块的所述操作结果,是则向所述上位机发送所述操作结果,执行步骤H5;否则执行步骤H5;
步骤H5:所述蓝牙模块设置自身的状态为低功耗待机模式,执行步骤H1。
根据本发明的另外一个方面,提供了一种蓝牙安全设备,包括安全模块和蓝牙模块,所述安全模块包括:第一设置模块、第一接收模块、第一判断模块、执行模块、第一发送模块、第二设置模块和等待模块;
所述第一设置模块,用于所述安全模块被所述蓝牙模块唤醒时,设置所述安全模块的状态为工作模式;
所述第一接收模块,用于接收来自所述蓝牙模块的数据;
所述第一判断模块,用于所述第一设置模块设置所述安全模块的状态为工作模式之后,判断所述第一接收模块在第五预设时间之内是否接收到来自所述蓝牙模块的数据;
所述执行模块,用于当所述第一判断模块判断所述第一接收模块接收到来自所述蓝牙模块的数据时,根据所述第一接收模块接收的数据执行相应操作,得到操作结果;
所述第一发送模块,用于将所述执行模块得到的所述操作结果返回所述蓝牙模块;
所述第二设置模块,用于当所述第一判断模块判断所述第一接收模块在第五预设时间之内没有接收到来自所述蓝牙模块的数据时,设置所述安全模块的状态为低功耗待机模式;用于当所述第一发送模块将所述操作结果返回所述蓝牙模块之后,设置所述安全模块的状态为低功耗待机模式;
所述等待模块,用于当所述第二设置模块设置所述安全模块的状态为低功耗待机模式之后,等待所述安全模块被所述蓝牙模块唤醒。
优选地,上述蓝牙模块包括:第一等待接收模块、第三设置模块、唤醒执行模块、第二发送模块、第二接收模块、第二判断模块、第三发送模块和第四设置模块;
所述第一等待接收模块,用于等待接收来自上位机的数据;
所述第三设置模块,用于当所述第一等待接收模块接收到来自所述上位机的数据时,设置所述蓝牙模块的状态为工作模式;
所述唤醒执行模块,用于当所述第三设置模块设置所述蓝牙模块的状态为工作模式之后,唤醒所述安全模块;
所述第二发送模块,用于在所述唤醒执行模块唤醒所述安全模块的第一预设时间之后,向所述安全模块发送所述第一等待接收模块接收的来自所述上位机的数据;
所述第二接收模块,用于接收来自所述安全模块的所述操作结果;
所述第二判断模块,用于所述第二发送模块向所述安全模块发送所述第一等待接收模块接收的来自所述上位机的数据之后,判断所述第二接收模块在第二预设时间之内是否接收到来自所述安全模块的所述操作结果;
所述第三发送模块,用于当所述第二判断模块判断所述第二接收模块在第二预设时间之内接收到来自所述安全模块的所述操作结果之后,向所述上位机发送所述第二接收模块接收的所述操作结果;
所述第四设置模块,用于当所述第三发送模块向所述上位机发送所述第二接收模块接收的所述操作结果之后,设置所述蓝牙模块的状态为低功耗待机模式;用于当所述第二判断模块判断所述第二接收模块在第二预设时间之内没有接收到来自所述安全模块的所述操作结果之后,设置所述蓝牙模块的状态为低功耗待机模式;
所述第一等待接收模块,还用于所述第四设置模块设置所述蓝牙模块的状态为低功耗待机模式之后,等待接收来自上位机的数据。
本发明与现有技术相比的有益效果是:蓝牙安全设备中,安全模块判断没有接收到数据时以及将操作结果返回蓝牙模块之后都立即将自身状态设置为低功耗待机模式,与现有技术中蓝牙安全设备被上位机唤醒后一直处于工作状态的方案相比,省电效果好,因此,本发明可以进一步提高蓝牙安全设备的待机时长。
附图说明
图1为本发明实施例1中实现蓝牙安全设备低功耗待机方法的安全模块的操作方法流程图;
图2为本发明实施例1中实现蓝牙安全设备低功耗待机方法的蓝牙模块的操作方法流程图;
图3为本发明实施例2中实现蓝牙安全设备低功耗待机方法的安全模块的操作方法流程图;
图4为本发明实施例2中实现蓝牙安全设备低功耗待机方法的蓝牙模块的操作方法流程图;
图5为本发明实施例3中蓝牙安全设备的模块组成框图;
图6为本发明实施例3中蓝牙安全设备的模块组成框图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
实施例1:
本发明提供一种实现蓝牙安全设备低功耗待机的方法,适用于包括安全模块和蓝牙模块的蓝牙安全设备,方法具体包括安全模块的操作方法和蓝牙模块的操作方法。
如图1所示,安全模块的操作方法包括以下步骤:
步骤S1:安全模块被蓝牙模块唤醒,设置自身状态为工作模式;
步骤S2:安全模块判断在第五预设时间之内是否接收到来自蓝牙模块的数据,是则执行步骤S3,否则执行步骤S5;
步骤S3:安全模块根据接收的数据执行相应操作,得到操作结果;
步骤S4:安全模块将操作结果返回蓝牙模块,执行步骤S5;
步骤S5:安全模块设置自身状态为低功耗待机模式,等待被蓝牙模块唤醒。
蓝牙模块的操作方法,如图2所示,包括以下步骤:
步骤H1:蓝牙模块等待接收来自上位机的数据;
步骤H2:蓝牙模块接收到来自上位机的数据时,设置自身的状态为工作模式,唤醒安全模块;
具体地,蓝牙模块设置自身的状态为工作模式,具体为:蓝牙模块开启自身的无关模块。进一步地,蓝牙模块设置自身的状态为工作模式时,还包括:蓝牙模块将自身的时钟设置为高速时钟模式。更进一步地,蓝牙模块设置自身的状态为工作模式时,还包括:蓝牙模块开启与自身连接的外围设备。
具体地,蓝牙模块唤醒安全模块,具体为:蓝牙模块拉低与安全模块连接的第一控制管脚的电平。
步骤H3:蓝牙模块在第一预设时间之后,向安全模块发送来自上位机的数据;
步骤H4:蓝牙模块判断在第二预设时间之内是否接收到来自安全模块的操作结果,是则向上位机发送操作结果,执行步骤H5;否则执行步骤H5;
步骤H5:蓝牙模块设置自身的状态为低功耗待机模式,执行步骤H1;
进一步地,上述蓝牙模块向上位机发送操作结果之后、执行步骤H5之前,还包括:
步骤A1:蓝牙模块判断是否断开蓝牙连接,是则组织断开指令,唤醒安全模块,执行步骤A2;否则执行步骤H5;
具体地,蓝牙模块唤醒安全模块,具体为:蓝牙模块拉低与安全模块连接的第一控制管脚的电平。
步骤A2:蓝牙模块在第三预设时间之后向安全模块发送断开指令;
步骤A3:蓝牙模块在第四预设时间之内接收到来自安全模块的断开指令的应答时,设置自身状态为深度省电模式。
相应地,上述步骤S2之后、步骤S3之前,还包括:安全模块判断接收的数据是否为所述断开指令,是则执行步骤S6,否则执行步骤S3;
步骤S6:安全模块组织断开指令的应答,将断开指令的应答返回蓝牙模块。
具体地,上述步骤A3中,蓝牙模块设置自身状态为深度省电模式,具体为:蓝牙模块设置自身状态为深度睡眠模式;
相应地,上述步骤S6之后,还包括:安全模块设置自身状态为深度睡眠模式;
或者,上述步骤A3中,蓝牙模块设置自身状态为深度省电模式,具体为:蓝牙模块执行关机操作。
进一步具体地,上述蓝牙模块设置自身状态为深度睡眠模式,具体为:蓝牙模块关闭与自身连接的外围设备、关闭自身的无关模块、保持自身的唤醒模块有电,并将自身的芯片主核下电;
相应地,上述安全模块设置自身状态为深度睡眠模式,具体为:安全模块关闭与自身连接的外围设备和自身的无关模块、保持自身唤醒模块有电,并将自身的芯片主核下电。
可选地,上述步骤A3具体包括:
步骤A31:蓝牙模块等待第四子预设时间,判断是否接收到来自安全模块的断开指令的应答,是则设置自身状态为深度省电模式;否则执行步骤A32;
步骤A32:蓝牙模块判断从第一次向安全模块发送断开指令到当前时间是否超过第四预设时间;
步骤A33:蓝牙模块判断从第一次向所述安全模块发送所述断开指令到当前时间没有超过所述第四预设时间时,重新向安全模块发送断开指令,执行步骤A31。
进一步地,上述方法还包括:上述蓝牙模块判断从第一次向安全模块发送断开指令到当前时间超过第四预设时间时,执行步骤H5或者设置自身状态为深度省电模式。
可选地,上述步骤H4具体包括:
步骤H41:蓝牙模块等待第二子预设时间,判断是否接收到来自安全模块的操作结果,是则向上位机发送操作结果,执行步骤H5;否则执行步骤H42;
步骤H42:蓝牙模块判断从第一次向安全模块发送来自上位机的数据到当前时间是否超过第二预设时间,是则执行步骤H5,否则执行步骤H43;
步骤H43:蓝牙模块重新向安全模块发送来自上位机的数据,执行步骤H41。
可选地,上述步骤H4中,蓝牙模块向上位机发送操作结果时,还包括:
步骤L:蓝牙模块判断发送完成标志是否置位,是则完成发送,执行步骤H5;否则继续判断。
进一步地,上述步骤L中,蓝牙模块判断发送完成标志没有置位时,执行在继续判断之前,还包括:
蓝牙模块判断从接收到来自安全模块的操作结果到当前时间是否超过第六预设时间,是则执行步骤H5;否则继续判断。
在本实施例1的上述方法中,上述步骤S2中,安全模块判断在第五预设时间之内接收到来自蓝牙模块的数据时,步骤S4之前,还包括:
安全模块根据接收的数据判断是否设置流程控制,当判断结果为设置流程控制时,安全模块根据接收的数据使用低功耗定时器设置流程控制定时器。
本实施例1上述方法中,还包括:安全模块被上述流程控制器唤醒时,设置自身状态为工作模式,执行相应操作,得到操作结果,并保存操作结果,设置自身状态为低功耗待机模式。
在本实施例1的上述方法中,还包括:安全模块被按键唤醒时,设置自身状态为工作模式,执行相应操作,得到操作结果,并保存操作结果,设置自身状态为低功耗待机模式。
本实施例1的上述方法中,步骤S2具体包括:
步骤S21:安全模块判断是否接收到数据,是则执行步骤S3,否则执行步骤S22;
步骤S22:安全模块判断从设置自身状态为工作模式到当前时间是否超过第五预设时间,是则执行步骤S5;否则执行步骤S21。
本实施例1的上述方法中,安全模块设置自身状态为工作模式,具体为:安全模块将自身的时钟设置为高速时钟模式,开启自身的无关模块。
进一步地,上述安全模块设置自身状态为工作模式时,还可以包括:安全模块开启与自身连接的外围设备。例如,蓝牙安全设备中与安全模块连接的外围设备为显示模块。
本发明中,安全模块中的无关模块包括通信模块、算法模块和存储模块,例如,通信模块可以但不限于UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)模块/SPI(Serial Peripheral Interface,串行外设接口)模块/I2C(Inter-Integrated Circuit,内部集成电路)/USB(Universal Serial Bus,通用串行总线)模块中的一个或多个,存储模块可以具体为flash存储模块。
需要说明的是,本发明中安全模块可以具体为一个安全芯片以及与安全芯片连接的外围电路,无关模块(通信模块、存储模块、算法模块)集成在安全芯片中;安全模块也可以包括安全芯片、无关模块以及与安全芯片连接的外围电路,其中无关模块可以集成在安全芯片中,也可以是与安全芯片连接的独立结构,例如,无关模块中的通信模块集成在安全芯片中,无关模块中的算法模块为与安全芯片连接的独立结构。本发明不对与安全芯片连接的外围电路进行具体限定。
本实施例1的上述方法中,安全模块设置自身状态为低功耗待机模式,具体为:安全模块将自身的时钟设置为低速时钟模式,关闭自身的无关模块以及与安全模块连接的外围设备,将自身的芯片设置为睡眠模式。
本实施例1中,上述蓝牙模块设置自身状态为低功耗待机模式,具体为:蓝牙模块关闭自身的无关模块。
进一步具体地,上述蓝牙模块设置自身状态为低功耗待机模式时,还包括:蓝牙模块将自身的时钟设置为低速时钟模式,并将自身的芯片设置为睡眠模式。
本发明中,蓝牙模块中的无关模块包括通信模块,例如,通信模块可以但不限于UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)模块/SPI(Serial Peripheral Interface,串行外设接口)模块/I2C(Inter-Integrated Circuit,内部集成电路)模块中的一个或多个。
需要说明的是,本发明中蓝牙模块可以具体为一个蓝牙芯片以及与蓝牙芯片连接的外围电路,无关模块(通信模块)集成在蓝牙芯片中;蓝牙模块也可以包括蓝牙芯片、无关模块以及与蓝牙芯片连接的外围电路,其中无关模块可以集成在蓝牙芯片中,也可以是与蓝牙芯片连接的独立结构,例如,无关模块中的通信模块集成在蓝牙芯片中,无关模块也可以为与蓝牙芯片连接独立结构。本发明中不对与蓝牙芯片连接的外围电路进行具体限定。
本发明中,上述蓝牙模块的芯片和蓝牙芯片属于同一个概念,上述安全模块的芯片和安全芯片属于同一个概念。
本发明与现有技术相比的有益效果是:蓝牙安全设备中,安全模块判断没有接收到数据时以及将操作结果返回蓝牙模块之后都立即将自身状态设置为低功耗待机模式,与现有技术中蓝牙安全设备的省电方式相比,省电效果好,进一步提高蓝牙安全设备的待机时长。
安全模块处理相应操作之后随时进入低功耗待机模式,同时蓝牙模块将来自安全模块的操作结果返回上位机之后也立即进入低功耗待机模式,与现有技术蓝牙安全设备在预设时间之后才进入低功耗待机模式相比,可以进一步提高蓝牙安全设备的待机时长。
另外,本发明中,安全模块和蓝牙模块处于低功耗待机模式时,将各自时钟切换为低速时钟模式,同时关闭与自身连接的外围设备,与现有技术只关闭外围设备的低功耗待机模式相比功耗更低,省电效果更好。
实施例2:
本发明提供一种实现蓝牙安全设备低功耗待机的方法,蓝牙安全设备包括蓝牙模块和安全模块。
如图3所示,安全模块的操作方法具体包括:
步骤101:安全模块等待被唤醒,当安全模块被蓝牙模块唤醒时,执行步骤102;当安全模块被按键唤醒时,执行步骤108;当安全模块被流程控制定时器唤醒时,执行步骤109。
本实施例2中,步骤101中安全模块等待被唤醒时,处于低功耗待机模式。
步骤102:安全模块设置自身状态为工作模式,判断在第五预设时间之内是否接收到来自蓝牙模块的数据,是则执行步骤103,否则执行步骤107。
具体地,安全模块判断在第五预设时间之内是否接收到数据,具体包括:
步骤1021:安全模块判断是否接收到数据,是则执行步骤103,否则执行步骤1022;
步骤1022:安全模块判断从设置自身状态为工作模式到当前时间是否超过第五预设时间,是则设置自身状态为低功耗待机模式,等待被蓝牙模块唤醒;否则执行步骤1021。例如,第五预设时间为30毫秒。
优选地,步骤1022中,安全模块判断从设置自身状态为工作模式到当前时间没有超过第五预设时间时,执行步骤1021之前,还包括:安全模块等待第五子预设时间。例如,第五子预设时间为10毫秒。
具体地,上述安全模块判断是否接收到数据,具体为:安全模块判断状态寄存器的标志位是否为预设的收数标志,是则接收到数据,否则没有接收到数据。本实施例2中,安全模块接收到数据时,会自动将状态寄存器的标志位设置为预设的收数标志,例如,预设的收数标志为1。
步骤103:安全模块根据接收的数据执行相应操作,得到操作结果;
具体地,步骤103具体为:
当接收到取随机数指令时,生成随机数,得到的操作结果为生成的随机数;例如,生成的随机数为00011001;
当接收到修改PIN码指令时,执行修改PIN码操作,并组织修改PIN码指令的状态码,得到的操作结果为修改PIN码指令的状态码;
当接收到签名指令时,显示签名指令中关键数据信息并组织签名指令的状态码,得到的操作结果为签名指令的状态码;
当接收到取签名结果指令时,获取保存的签名结果,得到的操作结果为获取的签名结果;
当接收到取按键状态指令时,获取保存的按键状态,得到的操作结果为获取的按键状态。
步骤104:安全模块根据接收的数据判断是否需要设置流程控制,是则执行步骤105,否则执行步骤106;
具体地,安全模块根据接收的数据判断是否需要设置流程控制,具体为:安全模块根据接收的数据调用相应的应用接口,根据调用的应用接口判断是否需要设置流程控制。
例如,当接收的数据为取随机数指令、取签名结果指令、取按键状态指令中的一种时,调用相应的应用接口,根据相应的应用接口判断结果为不需要设置流程控制,执行步骤106;当接收的数据为修改PIN码指令或签名指令时,调用相应的应用接口,根据相应的应用接口判断结果为需要设置流程控制,执行步骤105。
步骤105:安全模块根据接收的数据使用低功耗定时器设置流程控制定时器。
具体地,安全模块根据接收的数据使用低功耗定时器设置在预设时间之后流程定时器到达。
例如,当安全模块接收的数据为修改PIN码指令时,执行完修改PIN码的指令之后,使用低功耗定时器设置在5秒之后流程定时器到达;当安全模块接收的数据为签名指令时,执行完签名指令之后,使用低功耗定时器设置在5秒之后流程定时器到达
步骤106:安全模块将操作结果返回蓝牙模块。
具体地,当安全模块接收的数据为取随机数指令时,将随机数返回蓝牙模块;当安全模块接收的数据为修改PIN码指令时,将修改PIN码的状态码返回蓝牙模块;当安全模块接收的数据为签名指令时,将签名指令的状态码返回蓝牙模块;当接收到取签名结果指令时,将保存的签名结果返回蓝牙模块;当接收到取按键状态指令时,将保存的按键状态返回蓝牙模块。
步骤107:安全模块设置自身的状态为低功耗待机模式,等待被唤醒。
在本实施例2中,步骤102中当安全模块判断没有接收到数据时以及步骤106中安全模块将操作结果返回蓝牙模块之后,安全模块都直接进入低功耗待机模式;当步骤102中安全模块接收到数据时,经过步骤103-步骤105的处理后,在步骤106中,安全模块将操作结果返回蓝牙模块后立即进入低功耗待机模式。即本发明中安全模块判断没有接收到数据,或者处理完数据并将操作结果返回蓝牙模块之后,都立即进入低功耗待机模式,与现有技术相比,省电效果好,从而进一步提高蓝牙安全设备的待机时长。
步骤108:安全模块设置自身状态为工作模式,执行相应操作,并保存操作结果,设置自身状态为低功耗待机模式。
具体地,步骤108中,安全模块执行相应操作,保存操作结果,具体为:安全模块根据按键执行相应操作,并对操作结果进行保存。步骤108之后,安全模块被蓝牙模块唤醒,并接收到来自蓝牙模块的取按键状态指令时,将操作结果返回蓝牙模块。
步骤109:安全模块设置自身状态为工作模式,执行相应操作,保存操作结果,将自身状态设置为低功耗待机模式。
具体地,步骤109中,安全模块执行相应操作,保存操作结果,具体为:安全模块设置超时标志,并对超时标志进行保存。
具体地,步骤109具体为:安全模块设置自身状态为工作模式,设置超时标志,并对超时标志进行保存,将自身状态设置为低功耗待机模式。步骤109之后,安全模块被蓝牙模块唤醒,并接收到来自蓝牙模块的取按键状态指令时,将超时标志返回蓝牙模块。
以步骤102中安全模块接收的数据为签名指令为例对安全模块的工作方法进行说明,步骤102中安全模块接收到签名指令时,执行步骤103(步骤103具体为:显示签名指令中关键数据信息并组织签名指令的状态码,得到的操作结果为签名指令的状态码),步骤104中判断结果为需要设置流程控制,执行步骤105-步骤107之后,安全模块处于低功耗待机模式,等待接收用户的确认签名通知消息,执行步骤107之后,包括以下几种情况:当安全模块在流程控制定时器设定的预设时间以内被按键唤醒,并接收到确认签名通知消息时,执行步骤108(步骤108具体为:安全模块设置自身状态为工作模式,执行签名操作,并保存签名结果,设置自身状态为低功耗待机模式);当安全模块在流程控制定时器设定的预设时间以内被按键唤醒,并接收到取消签名通知消息时,执行步骤108(步骤108具体为:安全模块设置自身状态为工作模式,组织取消签名的应答,并保存取消签名的应答,设置自身状态为低功耗待机模式);当安全模块在流程控制定时器设定的预设时间以内没有被按键唤醒,在流程控制定时器到达时,安全模块被流程控制定时器唤醒,执行步骤109。
具体地,当用户按下“确认”按键后,安全模块接被按键唤醒,并接收到确认签名通知消息;当用户按下“取消”按键后,安全模块被按键唤醒,并接收到取消签名通知消息;当用户在流程控制定时器设定的预设时间以内没有按下“确认”或“取消”按键时,在流程控制定时器到达时,安全模块被流程控制定时器唤醒,执行步骤109。
以步骤102中安全模块接收的数据为修改PIN码指令为例对安全模块的工作方法进行说明,步骤102中安全模块接收的数据为修改PIN码指令时,安全模块执行步骤103(步骤103具体为:执行修改PIN码操作,并组织修改PIN码指令的状态码,得到的操作结果为修改PIN码指令的状态码),步骤104中判断结果为需要设置流程控制,执行步骤105--步骤107之后,安全模块处于低功耗待机模式,等待接收用户的确认修改PIN码通知消息,步骤107之后包括以下几种情况:当安全模块在流程控制定时器设定的预设时间以内被按键唤醒,并接收到确认修改PIN码通知消息 时,执行步骤108(步骤108具体为:安全模块设置自身状态为工作模式,执行修改PIN码操作,并组织修改PIN码成功的状态码,保存修改PIN码的状态码之后,设置自身状态为低功耗待机模式);当安全模块在流程控制定时器设定的预设时间以内被按键唤醒,并接收到取消修改PIN码的状态码通知消息时,执行步骤108(步骤108具体为:安全模块设置自身状态为工作模式,组织修改PIN码失败的状态码,保存修改PIN码的失败状态码之后,安全模块设置自身状态为低功耗待机模式);当安全模块在流程控制定时器设定的预设时间以内没有被按键唤醒,在流程控制定时器到达时,安全模块被流程控制定时器唤醒,执行步骤109。
具体地,当用户按下“确认”按键后,安全模块被按键唤醒,并接收到用户的确认修改PIN码的通知消息;当用户按下“取消”按键后,安全模块被按键唤醒,并接收到取消修改PIN码的通知消息;当用户在流程控制定时器设定的预设时间以内没有按下“确认”或“取消”按键时,在流程控制定时器到达时,安全模块被流程控制定时器唤醒,执行步骤109。
如图4所示,蓝牙模块的操作方法具体包括:
步骤201:蓝牙模块等待接收来自上位机的数据;
具体地,蓝牙模块等待接收来自上位机的数据时,处于低功耗待机模式。蓝牙模块处于低功耗待机模式时,时钟为低速时钟模式。例如,蓝牙模块处于低功耗待机模式时的时钟频率为0.07MHz。
本实施例2中,上位机为支持蓝牙功能的终端。例如,移动终端或电脑终端。
步骤202:蓝牙模块接收到来自上位机的数据时,设置自身的状态为工作模式,唤醒安全模块;
具体地,蓝牙模块接收到上位机的数据为取随机数指令、签名指令、取签名结果指令、取按键状态指令、修改PIN码指令中的一种。
例如,取随机数指令为0x0084000008。
步骤203:蓝牙模块在第一预设时间之后向安全模块发送来自上位机的数据;
例如,第一预设时间为10毫秒。
步骤204:蓝牙模块判断在第二预设时间之内是否接收到来自安全模块的操作结果,是则执行步骤205,否则执行步骤210;
具体地,步骤204具体包括:
步骤2041:蓝牙模块等待第二子预设时间,判断是否接收到来自安全模块的操作结果,是则向上位机发送操作结果,执行步骤205;否则执行步骤2042。例如,第二子预设时间为10毫秒。
步骤2042:蓝牙模块判断从第一次向安全模块发送来自上位机的数据到当前时间是否超过第二预设时间,是则执行步骤210,否则执行步骤2043。例如,第二预设时间为30毫秒。
步骤2043:蓝牙模块重新向安全模块发送来自上位机的数据,执行步骤2041。
步骤205:蓝牙模块向上位机发送操作结果。
可选地,步骤205中蓝牙模块向上位机发送操作结果时,还包括:
步骤L:蓝牙模块判断发送完成标志是否置位,是则完成发送,执行步骤206;否则继续判断。
可选地,上述步骤L中,蓝牙模块判断发送完成标志没有置位时,继续判断之前,还包括:蓝牙模块判断从接收到来自安全模块的操作结果到当前时间是否超过第六预设时间,是则执行步骤210;否则继续判断。
步骤206:蓝牙模块判断是否断开蓝牙连接,是则执行步骤207,否则执行步骤210;
具体地,蓝牙模块判断是否断开蓝牙连接,具体为:蓝牙模块中的蓝牙芯片判断是否监听到蓝牙断开事件,是则判定断开蓝牙连接,否则判定没有断开蓝牙连接。
更具体地,蓝牙协议栈在预设的时间内检测心跳包是否存在,如果是则蓝牙芯片监听不到蓝牙协议栈中的蓝牙断开事件,蓝牙模块判定没有断开蓝牙连接;否则蓝牙协议栈产生蓝牙断开事件,蓝牙芯片监听到蓝牙协议栈中的蓝牙断开事件,蓝牙模块判定断开蓝牙连接。
步骤207:蓝牙模块组织断开指令,唤醒安全模块,在第三预设时间之后向安全模块发送断开指令。例如,第三预设时间为10毫秒。
例如,蓝牙模块组织的断开指令为:6B08000000000103。
步骤208:蓝牙模块判断在第四预设时间之内是否接收到来自安全模块的断开指令的应答,是则执行步骤209;否则执行步骤210。
相应地,上述步骤102之后,上述步骤103之前,还包括:
步骤110:安全模块判断接收的数据是否为断开指令,是则执行步骤111,否则执行所述步骤103;
步骤111:安全模块组织断开指令的应答,并将断开指令的应答返回蓝牙模块。
具体地,步骤208具体包括:
步骤2081:蓝牙模块等待第四子预设时间,判断是否接收到来自安全模块的断开指令的应答,是则执行步骤209;否则执行步骤2082;例如,第四子预设时间为10毫秒。
步骤2082:蓝牙模块判断从第一次向安全模块发送断开指令到当前时间是否超过第四预设时间,是则执行步骤 210或者执行步骤209,否则执行步骤2083。例如,第四预设时间为30毫秒。
步骤2083:蓝牙模块重新向安全模块发送断开指令,执行步骤2081。
步骤209:蓝牙模块将自身的状态设置为深度省电模式。
步骤210:蓝牙模块设置自身状态为低功耗待机模式。
可选地,上述蓝牙模块将自身的状态设置为深度省电模式,具体为:蓝牙模块将自身的状态设置为深度睡眠模式。
相应地,上述步骤111之后还包括:安全模块设置自身状态为深度睡眠模式。
具体地,上述安全模块设置自身的状态为深度睡眠模式,具体为:安全模块关闭与自身连接的外围设备和自身的无关模块、保持自身的唤醒模块有电,并将安全模块的芯片主核下电;
具体地,上述蓝牙模块将自身的状态设置为深度睡眠模式,具体为:蓝牙模块关闭与自身连接的外围设备、关闭自身的无关模块、保持自身的唤醒模块有电,并将自身的芯片主核下电。
安全模块和蓝牙模块处于深度睡眠模式时,关闭与自身连接的外围设备、关闭自身的无关模块,模块中的芯片主核下电后时钟处于关闭状态,电流在纳安级别(功耗约为40nA),与低速时钟模式相比省电效果更好;与关机模式相比模块能够迅速从深度睡眠模式中唤醒为工作模式,快速响应外围设备请求,用户体验较佳。
深度睡眠模式的蓝牙模块和安全模块只是将模块中的芯片下电,关闭功耗较大的外围设备,保持模块中的唤醒模块保持有电;被唤醒时通过唤醒模块唤醒,对模块中的芯片上电,设置时钟频率,无需对所有的设备进行初始化,唤醒速度比由关机状态转换为开机的速度快。
本实施例2中,当蓝牙模块断开蓝牙连接时,进入深度睡眠模式,与蓝牙断开连接后直接关机的方案相比,蓝牙模块接收到来自上位机的数据时由深度睡眠模式转换为工作模式要比由关机状态转换为工作模式的时间短,开机时可以提升用户体验,功耗处于纳安(nA)级别,比关机时功耗稍高。
可选地,步骤209中,蓝牙模块将自身状态设置为深度省电模式具体为:蓝牙模块执行关机操作。
本实施例2中,当蓝牙模块断开蓝牙连接时,蓝牙模块执行关机操作后蓝牙安全设备完全断电,功耗为0,可以最大程度节省电能,省电效果好,但是开机时需要对所有设备进行初始化,开机速度比由深度睡眠模式唤醒慢。蓝牙模块和安全模块可以共用一个供电模块,当蓝牙模块接收到来自安全模块的断开指令的应答时,执行关机操作,断开电源,与此同时安全模块也断电。
本实施例2中,上述蓝牙模块设置自身状态为低功耗待机模式,具体为:蓝牙模块关闭与自身连接的外围设备和自身的无关模块。进一步地,蓝牙模块设置自身状态为低功耗待机模式时,还包括:蓝牙模块将自身的时钟设置为低速时钟模式,并将自身的芯片设置为睡眠模式。例如,低速时钟模式的时钟频率为0.7MHz。
需要说明的是,本实施例2中蓝牙模块中的无关模块包括但不限于通信模块;无关模块中的通信模块可以但不限于UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)模块/SPI(Serial Peripheral Interface,串行外设接口)模块/I2C(Inter-Integrated Circuit,内部集成电路)模块。
本实施例2中,上述安全模块设置自身的状态为低功耗待机模式,具体为:安全模块将自身的时钟设置为低速时钟模式,关闭自身的无关模块以及与安全模块连接的外围设备,将自身的芯片设置为睡眠模式。
例如,安全模块将自身的时钟频率由2.5MHz设置为0.07MHz;
具体地,安全模块关闭与其连接的外围设备,具体为:关闭与其连接的功耗较大的外围设备。例如,关闭与其连接的显示模块。
具体地,安全模块中的无关模块包括通信模块、算法模块和存储模块。例如,算法模块可以包括但不限于SM4算法模块/SM1算法模块/Hash 算法模块/Sha2算法模块;
安全模块的通信模块可以但不限于UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)模块/SPI(Serial Peripheral Interface,串行外设接口)模块/I2C(Inter-Integrated Circuit,内部集成电路)模块/USB(Universal Serial Bus,通用串行总线)模块。
本实施例2中,上述安全模块设置自身状态为工作模式,具体为:安全模块将自身的时钟切换为高速时钟模式。
例如,当安全模块处于低功耗待机模式,等待被唤醒时,时钟频率为0.07MHz,安全模块将时钟切换为高速时钟模式具体为:安全模块将时钟频率由0.07MHz切换为2.5MHz。
本发明中,蓝牙模块和安全模块设置自身状态为低功耗待机模式时将自身的芯片设置为睡眠模式,同时关闭时钟的,可以进一步降低功耗。如果只关闭时钟,不将芯片设置为睡眠模式,芯片会继续执行工作程序,当将芯片设置为睡眠模式之后,芯片停止执行工作程序。
进一步地,安全模块设置自身状态为工作模式时,还具体包括:安全模块开启自身的无关模块。例如,安全模块开启通信模块和算法模块。本发明中,安全模块中的算法模块和通信模块可以内置在安全模块的芯片中也可以与安全模块中的芯片连接。更进一步地,安全模块设置自身状态为工作模式时,还具体包括:安全模块开启与自身连接的外围设备,例如,开启与自身连接的显示模块。
本实施例2中,上述蓝牙模块设置自身的状态为工作模式,具体为:蓝牙模块开启自身的通信模块。
进一步,蓝牙模块设置自身的状态为工作模式时,还包括:蓝牙模块将自身时钟切换为高速时钟模式。例如,蓝 牙模块将时钟频率由0.07MHz切换成2.5MHz。更进一步地,蓝牙模块设置自身的状态为工作模式时,还包括:蓝牙模块开启与自身连接的外围设备。
本实施例2中,上述蓝牙模块唤醒安全模块具体为:蓝牙模块拉低与安全模块连接的第一控制管脚的电平。例如,蓝牙模块与安全模块连接的第一控制管脚为combus控制线。可选地,本实施例2中,还包括:蓝牙模块拉低与安全模块连接的第一控制管脚的电平之后的预设时间内,蓝牙模块将第一控制管脚的电平拉高。例如,蓝牙模块拉低与安全模块连接的第一控制管脚的电平之后的10毫秒之内,蓝牙模块将第一控制管脚的电平拉高。
本实施例2中,蓝牙安全设备的外围设备包括显示模块,但不限于显示模块,上述显示模块与安全模块连接,但不限于此连接方式。例如,显示模块可以与安全模块和/或蓝牙模块连接。
本实施例2中,安全模块处于关机模式时,安全模块下电,被蓝牙模块唤醒时,首先要上电(具体地,安全模块上电具体为蓝牙模块通过LDO或者MOS管给安全模块供电),将时钟设置为高速时钟模式,并对硬件进行初始化;
安全模块处于深度睡眠模式时,安全模块中的安全芯片的主核下电,与安全模块连接的外围设备关闭,同时安全模块连接的算法模块、无关模块关闭,只有安全模块中的唤醒模块有电,被蓝牙模块唤醒后,安全模块通过唤醒模块唤醒,对安全模块的芯片主核上电,设置时钟为高速时钟模式;
安全模块处于低功耗待机模块时,安全模块只关闭功耗较大的外围设备,安全模块的芯片有电,时钟为低速时钟模式,并且安全模块的芯片设置为睡眠模式,接收到上位机的数据时,将时钟设置为高速时钟模式。
本实施例2中,蓝牙模块处于关机模式时,蓝牙模块下电,接收到开机事件时,蓝牙芯片上电(具体地,蓝牙模块接收到开机事件具体为:用户按下蓝牙安全设备的开机按键后,触发开机事件),将时钟设置为高速时钟模式,对硬件进行初始化(硬件包括电容等器件);
蓝牙模块处于深度睡眠模式时,蓝牙模块中的芯片主核下电,与蓝牙模块连接的外围设备关闭,同时蓝牙模块中的无关模块(如通讯模块SPI/UART/I2C)关闭,只有蓝牙模块中的唤醒模块有电,接收到开机事件时,通过唤醒模块唤醒,对蓝牙芯片的主核上电,设置时钟为高速时钟模式;
蓝牙模块处于低功耗待机模块时,蓝牙模块只关闭功耗较大的外围设备,蓝牙模块的芯片有电,时钟为低速时钟模式,并且蓝牙模块的芯片处于睡眠模式,接收到上位机的数据时,将时钟设置为高速时钟模式。
本发明中,安全模块和蓝牙模块在完成相应操作时直接进入低功耗待机模式,与现有技术中蓝牙安全设备被上位机唤醒必须在预设时间之后才进入低功耗待机模式的方案相比,省电效果更佳;另外本发明中,安全模块和蓝牙模块处于低功耗待机模式时,将各自时钟切换为低速时钟模式,同时关闭与自身连接的外围设备和自身的无关模块,与现有技术中只关闭外围设备的低功耗待机模式相比功耗更低,省电效果更好。当蓝牙模块判断断开蓝牙连接时,安全模块和蓝牙模块进入深度省电模式,如此比普通的低功耗待机模式省电效果更好。
实施例3:
本发明提供一种蓝牙安全设备,包括安全模块和蓝牙模块,如图5所示为蓝牙安全设备的模块组成框图,安全模块包括:第一设置模块11、第一接收模块12、第一判断模块13、执行模块14、第一发送模块15、第二设置模块16和等待模块17;
第一设置模块11,用于安全模块被蓝牙模块唤醒时,设置安全模块的状态为工作模式;
第一接收模块12,用于接收来自蓝牙模块的数据;
第一判断模块13,用于第一设置模11块设置安全模块的状态为工作模式之后,判断第一接收模块12在第五预设时间之内是否接收到来自蓝牙模块的数据;
执行模块14,用于当第一判断模块13判断第一接收模块12接收到来自蓝牙模块的数据时,根据第一接收模块12接收的数据执行相应操作,得到操作结果;
第一发送模块15,用于将执行模块14得到的操作结果返回蓝牙模块;
第二设置模块16,用于当第一判断模块13判断第一接收模块12在第五预设时间之内没有接收到来自蓝牙模块的数据时,设置安全模块的状态为低功耗待机模式;用于当第一发送模块15将操作结果返回蓝牙模块之后,设置安全模块的状态为低功耗待机模式;
等待模块17,用于当第二设置模块16设置安全模块的状态为低功耗待机模式之后,等待安全模块被蓝牙模块唤醒。
进一步地,如图6所示,为蓝牙安全设备的模块组成框图,其中,蓝牙模块包括:第一等待接收模块21、第三设置模块22、唤醒执行模块23、第二发送模块24、第二接收模块25、第二判断模块26、第三发送模块27和第四设置模块28;
第一等待接收模块21,用于等待接收来自上位机的数据;
第三设置模块22,用于当第一等待接收模块21接收到来自上位机的数据时,设置蓝牙模块的状态为工作模式;
唤醒执行模块23,用于当第三设置模块22设置蓝牙模块的状态为工作模式之后,唤醒安全模块;
第二发送模块24,用于在唤醒执行模块23唤醒安全模块的第一预设时间之后,向安全模块发送第一等待接收模块21接收的来自上位机的数据;
第二接收模块25,用于接收来自安全模块的操作结果;
第二判断模块26,用于第二发送模块24向安全模块发送所述第一等待接收模块21接收的来自上位机的数据之后,判断第二接收模块25在第二预设时间之内是否接收到来自安全模块的操作结果;
第三发送模块27,用于当第二判断模块26判断第二接收模块25在第二预设时间之内接收到来自安全模块的操作结果之后,向上位机发送第二接收模块25接收的操作结果;
第四设置模块28,用于当第三发送模块27向上位机发送第二接收模块25接收的操作结果之后,设置蓝牙模块的状态为低功耗待机模式;用于当第二判断模块26判断第二接收模块25在第二预设时间之内没有接收到来自安全模块的操作结果之后,设置蓝牙模块的状态为低功耗待机模式;
第一等待接收模块21,还用于第四设置模块28设置蓝牙模块的状态为低功耗待机模式之后,等待接收来自上位机的数据。
进一步地,上述蓝牙模块还包括第三判断模块、组织模块、第四发送模块、第二等待接收模块和第五设置模块;
第三判断模块,用于第三发送模块27向上位机发送操作结果之后判断是否断开蓝牙连接;
相应地,上述第四设置模块28,具体用于第三判断模块判没有断断开蓝牙连接时,设置蓝牙模块的状态为低功耗待机模式;
组织模块,用于第三判断模块判断断开蓝牙连接时,组织断开指令;
相应地,上述唤醒执行模块23,还用于第三判断模块判断断开蓝牙连接时或者组织模块组织断开指令之后,唤醒安全模块;
第四发送模块,用于第三判断模块判断断开蓝牙连接时,并且唤醒执行模块23唤醒安全模块的第三预设时间之后,向安全模块发送断开指令;
第二等待接收模块,用于接收来自安全模块的断开指令的应答;
第五设置模块,用于第四发送模块向安全模块发送断开指令之后的第四预设时间之内,第二等待接收模块接收到来自安全模块的断开指令的应答时,设置蓝牙模块的状态为深度省电模式;
相对应地,上述安全模块还包括,第四判断模块、应答组织模块、应答发送模块;
第四判断模块,用于判断第一接收模块12接收的数据是否为断开指令;
应答组织模块,用于第四判断模块判断第一接收模块12接收的数据为断开指令时,组织断开指令的应答;
应答发送模块,用于将应答组织模块组织的断开指令的应答返回蓝牙模块;
执行模块14,具体用于第四判断模块判断第一接收模块12接收的数据不是断开指令时,根据第一接收模块12接收的数据执行相应操作,得到操作结果。
进一步地,上述安全模块在包括第四判断模块、应答组织模块、应答发送模块的基础上还包括第六设置模块;
上述第五设置模块,具体用于在上述第四发送模块向安全模块发送断开指令之后的第四预设时间之内,第二等待接收模块接收到来自安全模块的断开指令的应答时,设置蓝牙模块的状态为深度睡眠模式;
第六设置模块,用于当上述应答发送模块将断开指令的应答返回所述蓝牙模块之后,设置安全模块状态为深度睡眠模式。
更进一步地,上述蓝牙安全设备还包括外围设备;相应地,上述第五设置模块,具体用于在第四发送模块向安全模块发送断开指令之后的第四预设时间之内,第二等待接收模块接收到来自安全模块的断开指令的应答时,关闭与蓝牙模块连接的外围设备、保持蓝牙模块的唤醒模块有电,并将蓝牙模块的芯片主核下电;
相应地,上述第六设置模块,具体用于当应答发送模块将断开指令的应答返回蓝牙模块之后,关闭与安全模块连接的外围设备、关闭安全模块中的无关模块、保持安全模块的唤醒模块有电,并将安全模块的芯片主核下电。
本实施例3中,蓝牙安全设备中的外围设备可以但不限于显示模块,显示模块可以但不限于与安全模块连接,例如显示模块与安全模块和/或蓝牙模块连接。
本实施例3中,上述第五设置模块,具体用于在第四发送模块向安全模块发送断开指令之后的第四预设时间之内,第二等待接收模块接收到来自安全模块的断开指令的应答时,执行关机操作。
本实施例3中,上述第五设置模块可以具体包括:第五等待判断子模块、第五设置子模块、第五超时判断子模块、第五发送子模块;
第五等待判断子模块,用于第四发送模块向安全模块发送断开指令之后,等待第四子预设时间,判断第二等待接收模块是否接收到来自安全模块的断开指令的应答;
第五设置子模块,用于第五等待判断子模块判断第二等待接收模块接收到来自安全模块的断开指令的应答时,设置蓝牙模块的状态为深度省电模式;
第五超时判断子模块,用于第五等待判断子模块判断第二等待接收模块没有接收到来自安全模块的断开指令的应答时,判断从第四发送模块第一次向安全模块发送断开指令到当前时间是否超过第四预设时间;
第五发送子模块,用于第五超时判断子模块判断从第四发送模块第一次向安全模块发送断开指令到当前时间没有超过第四预设时间时,重新向安全模块发送断开指令;
第五等待判断子模块,还用于第五发送子模块重新向安全模块发送断开指令之后,等待第四子预设时间,判断第二等待接收模块是否接收到来自安全模块的断开指令的应答。
进一步地,上述第四设置模块28,还用于第五超时判断子模块判断第四发送模块从第一次向安全模块发送断开指令到当前时间超过第四预设时间时,设置蓝牙模块的状态为低功耗待机模式;
或者,上述第五设置子模块,还用于第五超时判断子模块判断从第四发送模块第一次向安全模块发送断开指令到当前时间超过第四预设时间时,设置蓝牙模块的状态为深度省电模式。
本实施例3中,上述第二判断模块26可以具体包括第二等待判断子模块、第二超时判断子模块和重新发送子模块;
第二等待判断子模块,用于第二发送模块24向安全模块发送第一等待接收模块21接收的来自上位机的数据之后,等待第二子预设时间,判断第二接收模块25是否接收到来自安全模块的操作结果;
相应地,上述第三发送模块27,具体用于当第二等待判断子模块判断第二接收模块25在第二预设时间之内接收到来自安全模块的操作结果之后,向上位机发送第二接收模块25接收的操作结果;
第二超时判断子模块,用于第二等待判断子模块判断第二接收模块25没有接收到来自安全模块的操作结果时,判断从第二发送模块24第一次向安全模块发送来自上位机的数据到当前时间是否超过第二预设时间;
第四设置模块28,具体用于当第二超时判断子模块判断从第二发送模块24第一次向安全模块发送数据到当前时间超过第二预设时间时,设置蓝牙模块的状态为低功耗待机模式;
重新发送子模块,用于当第二超时判断子模块判断从第二发送模块24第一次向安全模块发送来自上位机的数据到当前时间没有超过第二预设时间时,重新向安全模块发送第一等待接收模块21接收的来自上位机的数据;
上述第二等待判断子模块,还用于重新发送子模块重新向安全模块发送来自上位机的数据之后,等待第二子预设时间,判断第二接收模块25是否接收到来自安全模块的操作结果。
本实施例3中,上述第三设置模块22,具体用于当第一等待接收模块21接收到来自上位机的数据时,开启蓝牙模块中的无关模块。进一步地,上述第三设置模块22还用于,当第一等待接收模块21接收到来自上位机的数据时,将蓝牙模块的时钟设置为高速时钟模式。
本实施例3中,上述第四设置模块28,具体用于:关闭蓝牙模块中的无关模块。进一步地,上述第四设置模块28,还用于:将蓝牙模块的时钟设置为低速时钟模式,并将蓝牙模块中的芯片设置为睡眠模式。
本实施例3中,上述唤醒执行模块23,具体用于拉低与安全模块连接的第一控制管脚的电平。
可选地,本实施例3中上述蓝牙模块在包括第一等待接收模块21、第三设置模块22、唤醒执行模块23、第二发送模块24、第二接收模块25、第二判断模块26、第三发送模块27和第四设置模块28的基础上,还包括完成发送判断模块,用于第三发送模块27向上位机发送第二接收模块25接收的操作结果时,判断发送完成标志是否置位;
相应地,上述第四设置模块28,具体用于完成发送判断模块判断发送完成标志置位时,设置蓝牙模块的状态为低功耗待机模式;
完成发送判断模块,还用于当判断发送完成标志没有置位时,继续判断发送完成标志是否置位。
进一步地,上述蓝牙模块在包括上述完成发送判断模块的基础上,还包括超时判断模块,用于完成发送判断模块判断发送完成标志没有置位时,判断从第二接收模块25接收到来自安全模块的操作结果到当前时间是否超过第六预设时间;
相应地,上述第四设置模块28,还用于超时判断模块判断从第二接收模块25接收到来自安全模块的操作结果到当前时间超过第六预设时间时,设置蓝牙模块的状态为低功耗待机模式;
完成发送判断模块,具体用于超时判断模块判断从第二接收模块25接收到来自安全模块的操作结果到当前时间没有超过第六预设时间时,判断发送完成标志是否置位。
可选地,上述蓝牙安全设备中的安全模块,在包括模块第一设置模块11、第一接收模块12、第一判断模块13、执行模块14、第一发送模块15、第二设置模块16和等待模块17的基础上,还包括流程控制判断模块和流程控制设置模块;
流程控制判断模块,用于第一判断模块13判断第一接收模块12在第五预设时间之内接收到来自蓝牙模块的数据时,根据第一接收模块12接收的数据判断是否设置流程控制;
流程控制设置模块,用于流程控制判断模块判断需要设置流程控制时,根据第一接收模块12接收的数据使用低功耗定时器设置流程控制定时器。
进一步地,上述安全模块在包括流程控制判断模块和流程控制设置模块的基础上,还包括执行保存模块;
相应地,上述第一设置模块11,还用于安全模块被流程控制设置模块设置的流程控制定时器唤醒时,设置安全模块的状态为工作模式;
执行保存模块,用于安全模块被所述流程控制设置模块设置的流程控制定时器唤醒时,并且第一设置模块11设置安全模块的状态为工作模式之后,执行相应操作得到操作结果,并保存操作结果;
第二设置模块16,还用于执行保存模块保存操作结果之后,设置安全模块状态为低功耗待机模式。
可选地,上述蓝牙安全设备还包括按键,上述安全模块在包括模块第一设置模块11、第一接收模块12、第一判断模块13、执行模块14、第一发送模块15、第二设置模块16和等待模块17的基础上,还包括执行保存模块;
上述第一设置模块11,还用于安全模块被按键唤醒时,设置安全模块的状态为工作模式。
执行保存模块,用于安全模块被按键唤醒时,并且第一设置模块11设置安全模块的状态为工作模式之后,执行相应操作得到操作结果,并保存操作结果;
上述第二设置模块16,还用于执行保存模块保存操作结果之后,设置安全模块状态为低功耗待机模式。
本实施例3的上述蓝牙安全设备中,安全模块中的第一判断模块13可以具体包括第一判断子模块、第一等待子模块和第一超时判断子模块;
第一判断子模块,用于第一设置模块11设置安全模块的状态为工作模式之后,判断第一接收模块12是否接收到来自蓝牙模块的数据;
执行模块14,具体用于第一判断子模块判断第一接收模块12接收到来自蓝牙模块的数据时,根据第一接收模块12接收的数据执行相应操作,得到操作结果;
第一超时判断子模块,用于第一判断子模块判断第一接收模块12没有接收到来自所述蓝牙模块的数据时,判断从第一设置模块11设置安全模块状态为工作模式到当前时间是否超过第五预设时间;
相应地,上述第二设置模块16,具体用于第一超时判断子模块判断从第一设置模块11设置安全模块状态为工作模式到当前时间超过第五预设时间时,设置安全模块的状态为低功耗待机模式;
第一判断子模块,还用于第一超时判断模块判断从第一设置模块11设置安全模块状态为工作模式到当前时间没有超过第五预设时间时,等待第五子预设时间,判断第一接收模块12是否接收到数据。
本实施例3中,上述第一设置模块11,具体用于当安全模块被唤醒时,将安全模块的时钟设置为高速时钟模式,开启安全模块中的无关模块。进一步地,上述蓝牙包括外围设备时,第一设置模块11,还可以具体用于当安全模块被唤醒时,开启与安全模块连接的外围设备。
本实施例3中,蓝牙安全设备还包括外围设备;
上述第二设置模块16,具体用于将安全模块的时钟设置为低速时钟模式,关闭安全模块中的无关模块以及与安全模块连接的外围设备,将安全模块中的芯片设置为睡眠模式。
本发明与现有技术相比的有益效果是:蓝牙安全设备中,安全模块判断没有接收到数据时以及将操作结果返回蓝牙模块之后都立即将自身状态设置为低功耗待机模式,与现有技术中蓝牙安全设备的省电方式相比,省电效果好,进一步提高蓝牙安全设备的待机时长。
安全模块处理相应操作之后随时进入低功耗待机模式,同时蓝牙模块将来自安全模块的操作结果返回上位机之后也立即进入低功耗待机模式,与现有技术蓝牙安全设备在预设时间之后才进入低功耗待机模式相比,可以进一步提高蓝牙安全设备的待机时长。
另外,本发明中,安全模块和蓝牙模块处于低功耗待机模式时,将各自时钟切换为低速时钟模式,同时关闭外围设备,与现有技术只关闭外围设备的低功耗待机模式相比功耗更低,省电效果更好。
以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,本领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所附权利要求书的保护范围为准。

Claims (22)

  1. 一种实现蓝牙安全设备低功耗待机的方法,其特征在于,包括如下步骤:
    步骤S1:安全模块被蓝牙模块唤醒,设置自身状态为工作模式;
    步骤S2:所述安全模块判断在第五预设时间之内是否接收到来自所述蓝牙模块的数据,是则执行步骤S3,否则执行步骤S5;
    步骤S3:所述安全模块根据接收的数据执行相应操作,得到操作结果;
    步骤S4:所述安全模块将所述操作结果返回所述蓝牙模块,执行步骤S5;以及
    步骤S5:所述安全模块设置自身状态为低功耗待机模式,等待被所述蓝牙模块唤醒。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    步骤H1:所述蓝牙模块等待接收来自上位机的数据;
    步骤H2:所述蓝牙模块接收到来自上位机的数据时,设置自身的状态为工作模式,唤醒所述安全模块;
    步骤H3:所述蓝牙模块在第一预设时间之后,向所述安全模块发送来自所述上位机的数据;
    步骤H4:所述蓝牙模块判断在第二预设时间之内是否接收到来自所述安全模块的所述操作结果,是则向所述上位机发送所述操作结果,执行步骤H5;否则执行步骤H5;
    步骤H5:所述蓝牙模块设置自身的状态为低功耗待机模式,执行步骤H1。
  3. 根据权利要求2所述的方法,其特征在于,所述蓝牙模块向所述上位机发送所述操作结果之后、执行步骤H5之前,还包括:
    步骤A1:所述蓝牙模块判断是否断开蓝牙连接,是则组织断开指令,唤醒所述安全模块,执行步骤A2;否则执行所述步骤H5;
    步骤A2:所述蓝牙模块在第三预设时间之后向所述安全模块发送所述断开指令;
    步骤A3:所述蓝牙模块在第四预设时间之内接收到来自所述安全模块的断开指令的应答时,设置自身状态为深度省电模式。
  4. 根据权利要求3所述的方法,其特征在于,所述步骤S2之后、所述步骤S3之前,还包括:所述安全模块判断接收的数据是否为所述断开指令,是则执行步骤S6,否则执行所述步骤S3;
    步骤S6:所述安全模块组织断开指令的应答,将所述断开指令的应答返回所述蓝牙模块。
  5. 根据权利要求4所述的方法,其特征在于,所述蓝牙模块设置自身状态为深度省电模式,具体为:所述蓝牙模块设置自身状态为深度睡眠模式;
    所述步骤S6之后,还包括:所述安全模块设置自身状态为深度睡眠模式。
  6. 根据权利要求3所述的方法,其特征在于,所述蓝牙模块设置自身状态为深度省电模式,具体为:所述蓝牙模块执行关机操作。
  7. 根据权利要求2所述的方法,其特征在于,所述蓝牙模块设置自身的状态为工作模式,具体为:所述蓝牙模块开启自身的无关模块,
    将自身的时钟设置为高速时钟模式;
    所述蓝牙模块设置自身的状态为低功耗待机模式,具体为:所述蓝牙模块关闭自身的无关模块,
    将自身的时钟设置为低速时钟模式,并将自身的芯片设置为睡眠模式。
  8. 根据权利要求1所述的方法,其特征在于,所述步骤S2中,所述安全模块判断在第五预设时间之内接收到来自所述蓝牙模块的数据时,所述步骤S4之前,还包括:
    所述安全模块根据接收的数据判断是否设置流程控制,当判断结果为设置流程控制时,所述安全模块根据接收的数据使用低功耗定时器设置流程控制定时器。
  9. 根据权利要求8所述的方法,其特征在于,还包括:
    所述安全模块被所述流程控制定时器唤醒时,设置自身状态为工作模式,执行相应操作,得到操作结果,并保存所述操作结果,设置自身状态为低功耗待机模式。
  10. 根据权利要求1所述的方法,其特征在于,还包括:
    所述安全模块被按键唤醒时,设置自身状态为工作模式,执行相应操作,得到操作结果,并保存所述操作结果,设置自身状态为低功耗待机模式。
  11. 根据权利要求1所述的方法,其特征在于,所述安全模块设置自身状态为工作模式,具体为:所述安全模块将自身的时钟设置为高速时钟模式,开启自身的无关模块;
    所述安全模块设置自身状态为低功耗待机模式,具体为:所述安全模块将自身的时钟设置为低速时钟模式,关闭自身的无关模块以及与自身连接的外围设备,将自身的芯片设置为睡眠模式。
  12. 一种蓝牙安全设备,包括安全模块和蓝牙模块,其特征在于,所述安全模块包括:第一设置模块、第一接收模块、第一判断模块、执行模块、第一发送模块、第二设置模块和等待模块;
    所述第一设置模块,用于所述安全模块被所述蓝牙模块唤醒时,设置所述安全模块的状态为工作模式;
    所述第一接收模块,用于接收来自所述蓝牙模块的数据;
    所述第一判断模块,用于所述第一设置模块设置所述安全模块的状态为工作模式之后,判断所述第一接收模块在第五预设时间之内是否接收到来自所述蓝牙模块的数据;
    所述执行模块,用于当所述第一判断模块判断所述第一接收模块接收到来自所述蓝牙模块的数据时,根据所述第一接收模块接收的数据执行相应操作,得到操作结果;
    所述第一发送模块,用于将所述执行模块得到的所述操作结果返回所述蓝牙模块;
    所述第二设置模块,用于当所述第一判断模块判断所述第一接收模块在第五预设时间之内没有接收到来自所述蓝牙模块的数据时,设置所述安全模块的状态为低功耗待机模式;用于当所述第一发送模块将所述操作结果返回所述蓝牙模块之后,设置所述安全模块的状态为低功耗待机模式;以及
    所述等待模块,用于当所述第二设置模块设置所述安全模块的状态为低功耗待机模式之后,等待所述安全模块被所述蓝牙模块唤醒。
  13. 根据权利要求12所述的蓝牙安全设备,其特征在于,所述蓝牙模块包括:第一等待接收模块、第三设置模块、唤醒执行模块、第二发送模块、第二接收模块、第二判断模块、第三发送模块和第四设置模块;
    所述第一等待接收模块,用于等待接收来自上位机的数据;
    所述第三设置模块,用于当所述第一等待接收模块接收到来自所述上位机的数据时,设置所述蓝牙模块的状态为工作模式;
    所述唤醒执行模块,用于当所述第三设置模块设置所述蓝牙模块的状态为工作模式之后,唤醒所述安全模块;
    所述第二发送模块,用于在所述唤醒执行模块唤醒所述安全模块的第一预设时间之后,向所述安全模块发送所述第一等待接收模块接收的来自所述上位机的数据;
    所述第二接收模块,用于接收来自所述安全模块的所述操作结果;
    所述第二判断模块,用于所述第二发送模块向所述安全模块发送所述第一等待接收模块接收的来自所述上位机的数据之后,判断所述第二接收模块在第二预设时间之内是否接收到来自所述安全模块的所述操作结果;
    所述第三发送模块,用于当所述第二判断模块判断所述第二接收模块在第二预设时间之内接收到来自所述安全模块的所述操作结果之后,向所述上位机发送所述第二接收模块接收的所述操作结果;
    所述第四设置模块,用于当所述第三发送模块向所述上位机发送所述第二接收模块接收的所述操作结果之后,设置所述蓝牙模块的状态为低功耗待机模式;用于当所述第二判断模块判断所述第二接收模块在第二预设时间之内没有接收到来自所述安全模块的所述操作结果之后,设置所述蓝牙模块的状态为低功耗待机模式;以及
    所述第一等待接收模块,还用于所述第四设置模块设置所述蓝牙模块的状态为低功耗待机模式之后,等待接收来自上位机的数据。
  14. 根据权利要求13所述的蓝牙安全设备,其特征在于,所述蓝牙模块还包括第三判断模块、组织模块、第四发送模块、第二等待接收模块和第五设置模块;
    所述第三判断模块,用于所述第三发送模块向所述上位机发送所述操作结果之后判断是否断开蓝牙连接;
    所述第四设置模块,具体用于所述第三判断模块判没有断断开蓝牙连接时,设置所述蓝牙模块的状态为低功耗待机模式;
    所述组织模块,用于所述第三判断模块判断断开蓝牙连接时,组织断开指令;
    所述唤醒执行模块,还用于所述第三判断模块判断断开蓝牙连接时或者所述组织模块组织断开指令之后,唤醒所述安全模块;
    所述第四发送模块,用于所述第三判断模块判断断开蓝牙连接时,并且所述唤醒执行模块唤醒所述安全模块的第三预设时间之后,向所述安全模块发送所述断开指令;
    所述第二等待接收模块,用于等待接收来自所述安全模块的断开指令的应答;以及
    所述第五设置模块,用于在所述第四发送模块向所述安全模块发送所述断开指令之后的第四预设时间之内,所述第二等待接收模块接收到来自所述安全模块的断开指令的应答时,设置所述蓝牙模块的状态为深度省电模式。
  15. 根据权利要求14所述的蓝牙安全设备,其特征在于,所述安全模块还包括第四判断模块、应答组织模块、应答发送模块;
    所述第四判断模块,用于判断所述第一接收模块接收的数据是否为所述断开指令;
    所述应答组织模块,用于所述第四判断模块判断所述第一接收模块接收的数据为断开指令时,组织断开指令的应答;
    所述应答发送模块,用于将所述应答组织模块组织的所述断开指令的应答返回所述蓝牙模块;以及
    所述执行模块,具体用于所述第四判断模块判断所述第一接收模块接收的数据不是所述断开指令时,根据所述第一接收模块接收的数据执行相应操作,得到操作结果。
  16. 根据权利要求15所述的蓝牙安全设备,其特征在于,所述安全模块还包括第六设置模块;
    所述第五设置模块,具体用于在所述第四发送模块向所述安全模块发送所述断开指令之后的第四预设时间之内,所述第二等待接收模块接收到来自所述安全模块的断开指令的应答时,设置所述蓝牙模块的状态为深度睡眠模式;
    所述第六设置模块,用于当所述应答发送模块将所述断开指令的应答返回所述蓝牙模块之后,设置所述安全模块状态为深度睡眠模式。
  17. 根据权利要求26所述的蓝牙安全设备,其特征在于,所述第五设置模块,具体用于在所述第四发送模块向所述安全模块发送所述断开指令之后的第四预设时间之内,所述第二等待接收模块接收到来自所述安全模块的断开指令的应答时,执行关机操作。
  18. 根据权利要求13所述的蓝牙安全设备,其特征在于,
    所述第三设置模块,具体用于当所述第一等待接收模块接收到来自所述上位机的数据时,开启所述蓝牙模块中的无关模块;
    所述第三设置模块,还用于当所述第一等待接收模块接收到来自所述上位机的数据时,将所述蓝牙模块的时钟设置为高速时钟模式;
    所述第四设置模块,具体用于关闭所述蓝牙模块中的无关模块;以及
    所述第四设置模块,还具体用于将所述蓝牙模块的时钟设置为低速时钟模式,并将所述蓝牙模块中的芯片设置为睡眠模式。
  19. 根据权利要求12所述的蓝牙安全设备,其特征在于,所述安全模块还包括流程控制判断模块和流程控制设置模块;
    所述流程控制判断模块,用于所述第一判断模块判断所述第一接收模块在第五预设时间之内接收到来自所述蓝牙模块的数据时,根据所述第一接收模块接收的数据判断是否设置流程控制;以及
    所述流程控制设置模块,用于所述流程控制判断模块判断需要设置流程控制时,根据所述第一接收模块接收的数据使用低功耗定时器设置流程控制定时器。
  20. 根据权利要求19所述的蓝牙安全设备,其特征在于,所述安全模块还包括执行保存模块;
    所述第一设置模块,还用于所述安全模块被所述流程控制设置模块设置的流程控制定时器唤醒时,设置所述安全模块的状态为工作模式;
    所述执行保存模块,用于所述安全模块被所述流程控制设置模块设置的流程控制定时器唤醒时,并且所述第一设置模块设置所述安全模块的状态为工作模式之后,执行相应操作得到操作结果,并保存所述操作结果;以及
    所述第二设置模块,还用于所述执行保存模块保存所述操作结果之后,设置所述安全模块状态为低功耗待机模式。
  21. 根据权利要求12所述的蓝牙安全设备,其特征在于,还包括按键,所述安全模块还包括执行保存模块;
    所述第一设置模块,还用于所述安全模块被所述按键唤醒时,设置所述安全模块的状态为工作模式;
    所述执行保存模块,用于所述安全模块被所述按键唤醒时,并且所述第一设置模块设置所述安全模块的状态为工作模式之后,执行相应操作得到操作结果,并保存所述操作结果;以及
    所述第二设置模块,还用于所述执行保存模块保存所述操作结果之后,设置所述安全模块状态为低功耗待机模式。
  22. 根据权利要求12所述的蓝牙安全设备,其特征在于,所述第一设置模块,具体用于当所述安全模块被唤醒时,将所述安全模块的时钟设置为高速时钟模式,开启所述安全模块中的无关模块;
    所述蓝牙安全设备还包括外围设备;以及
    所述第二设置模块,具体用于将所述安全模块的时钟设置为低速时钟模式,关闭所述安全模块中的无关模块以及与所述安全模块连接的外围设备,将所述安全模块中的芯片设置为睡眠模式。
PCT/CN2018/074737 2017-02-28 2018-01-31 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备 WO2018157689A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/473,642 US11463955B2 (en) 2017-02-28 2018-01-31 Method for implementing low power consumption on standby for bluetooth security device and bluetooth security device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710114547.8 2017-02-28
CN201710114547.8A CN106793044B (zh) 2017-02-28 2017-02-28 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备

Publications (1)

Publication Number Publication Date
WO2018157689A1 true WO2018157689A1 (zh) 2018-09-07

Family

ID=58959348

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074737 WO2018157689A1 (zh) 2017-02-28 2018-01-31 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备

Country Status (3)

Country Link
US (1) US11463955B2 (zh)
CN (1) CN106793044B (zh)
WO (1) WO2018157689A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106793044B (zh) * 2017-02-28 2018-06-01 飞天诚信科技股份有限公司 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备
CN107396281B (zh) * 2017-06-16 2019-12-06 天地融科技股份有限公司 一种通信模式的切换方法及智能密码设备
CN108170049A (zh) * 2017-12-19 2018-06-15 晶晨半导体(上海)股份有限公司 一种基于蓝牙设备控制智能系统降低功耗的控制系统
CN109523774B (zh) * 2018-11-30 2021-02-02 Oppo广东移动通信有限公司 设备控制方法和电子设备
CN109640304B (zh) * 2018-12-13 2022-04-01 上海移为通信技术股份有限公司 提高低功耗蓝牙连接稳定性的方法
CN113950128A (zh) * 2020-07-16 2022-01-18 珠海市杰理科技股份有限公司 Ble设备控制方法、装置、ble设备、芯片及存储介质
CN116671112A (zh) * 2020-12-04 2023-08-29 三星电子株式会社 控制装置及其操作方法
CN113253644B (zh) * 2021-05-12 2022-09-16 江南造船(集团)有限责任公司 设备工作模式的切换方法、微控制装置及船舶定位系统
CN113783758B (zh) * 2021-11-11 2022-04-15 荣耀终端有限公司 一种用于配置监听周期的方法及相应的电子设备
CN114205758A (zh) * 2021-11-16 2022-03-18 锐捷网络股份有限公司 基于蓝牙的信息处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7672695B1 (en) * 2005-12-06 2010-03-02 Marvell International Ltd. Wearable access point
CN102572119A (zh) * 2011-10-31 2012-07-11 中兴通讯股份有限公司 一种移动终端及其省电方法
CN105516901A (zh) * 2015-12-21 2016-04-20 飞天诚信科技股份有限公司 一种低功耗蓝牙设备及其工作方法
CN106793044A (zh) * 2017-02-28 2017-05-31 飞天诚信科技股份有限公司 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011259172A (ja) * 2010-06-08 2011-12-22 Sony Corp 通信装置、通信システム、モード切替方法、及びプログラム
US9706335B2 (en) * 2014-08-26 2017-07-11 AthenTek Incorporated Cellular devices and pairing server implementing a pairing method
CN104378212A (zh) * 2014-11-26 2015-02-25 上海爱信诺航芯电子科技有限公司 安全蓝牙密匙及其加解密方法
US10182328B1 (en) * 2015-05-23 2019-01-15 Square, Inc. Point of sale (POS) device responsive to detected interference with antenna
CN105406923B (zh) * 2015-12-28 2018-07-17 惠州Tcl移动通信有限公司 一种移动终端的蓝牙互连方法及系统
CN205428046U (zh) * 2016-03-23 2016-08-03 新智控股投资有限公司 一种智能表计

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7672695B1 (en) * 2005-12-06 2010-03-02 Marvell International Ltd. Wearable access point
CN102572119A (zh) * 2011-10-31 2012-07-11 中兴通讯股份有限公司 一种移动终端及其省电方法
CN105516901A (zh) * 2015-12-21 2016-04-20 飞天诚信科技股份有限公司 一种低功耗蓝牙设备及其工作方法
CN106793044A (zh) * 2017-02-28 2017-05-31 飞天诚信科技股份有限公司 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备

Also Published As

Publication number Publication date
CN106793044A (zh) 2017-05-31
US20200359318A1 (en) 2020-11-12
US11463955B2 (en) 2022-10-04
CN106793044B (zh) 2018-06-01

Similar Documents

Publication Publication Date Title
WO2018157689A1 (zh) 一种实现蓝牙安全设备低功耗待机的方法及蓝牙安全设备
JP5900760B2 (ja) ネットワークアクセスモジュールの電源管理方法及び装置
CN105516901A (zh) 一种低功耗蓝牙设备及其工作方法
WO2020168481A1 (zh) 智能锁供电控制方法、智能锁系统及存储介质
TW201133227A (en) Power management method and related power management system
CN106412845B (zh) 无线保真Wi-Fi设备的休眠方法及装置
US20110286504A1 (en) Wireless modem device, wireless modem system, wireless modem device sleep/wake-up method, and terminal
JP5773288B2 (ja) ハイスピードインターチップhsicインタフェースに基づくウェイクアップ方法、ホットスワップ方法、およびデバイス
CN102572119B (zh) 一种移动终端及其省电方法
CN110568919B (zh) 一种降低芯片功耗的装置
CN101539797A (zh) 一种动态时钟与电源的控制方法、系统及装置
TW200921358A (en) Electronic system and power control method thereof
CN109041188B (zh) 无线终端、无线终端节电方法和装置
CN102437917B (zh) 一种网络唤醒方法、网络唤醒装置及计算机
JP2003158561A (ja) 携帯電話機
WO2021078261A1 (zh) 一种供电控制方法、系统及设备
ES2933101T3 (es) Método de ahorro de energía del ordenador y método de reactivación del ordenador
CN103986588A (zh) 电脑系统及电脑装置的远端遥控方法
US20160142526A1 (en) Remote monitoring system and remote monitoring method
CN115442355A (zh) 远程设备控制系统、方法、电子装置和存储介质
TW201012189A (en) Reciprocal wake-up system for handheld devices with insert type wireless communication module and a method therefore
CN213368158U (zh) 一种基于nfc的设备配置及固件升级设备
CN1519679B (zh) 调整中央处理器工作频率的装置及其方法
CN105656846A (zh) 保持远端连接方法、电子装置与服务器
CN113765679B (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: 18760866

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

Country of ref document: EP

Kind code of ref document: A1