WO2019085560A1 - Communication processing method applied to bluetooth shield and bluetooth shield - Google Patents

Communication processing method applied to bluetooth shield and bluetooth shield Download PDF

Info

Publication number
WO2019085560A1
WO2019085560A1 PCT/CN2018/098065 CN2018098065W WO2019085560A1 WO 2019085560 A1 WO2019085560 A1 WO 2019085560A1 CN 2018098065 W CN2018098065 W CN 2018098065W WO 2019085560 A1 WO2019085560 A1 WO 2019085560A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
shield
communication connection
bluetooth shield
usb
Prior art date
Application number
PCT/CN2018/098065
Other languages
French (fr)
Chinese (zh)
Inventor
陈柳章
Original Assignee
深圳市文鼎创数据科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市文鼎创数据科技有限公司 filed Critical 深圳市文鼎创数据科技有限公司
Publication of WO2019085560A1 publication Critical patent/WO2019085560A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/34User authentication involving the use of external additional devices, e.g. dongles or smart cards
    • G06F21/35User authentication involving the use of external additional devices, e.g. dongles or smart cards communicating wirelessly

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The present application provides a communication processing method applied to a Bluetooth shield, a Bluetooth shield and a computer readable storage medium, said communication processing method comprising: when a Bluetooth shield is in a USB communication connection state, monitoring an acquisition event of a Bluetooth connection message, the Bluetooth connection message being related to the Bluetooth shield establishing a Bluetooth communication connection; when the acquisition event of the Bluetooth connection message is detected, controlling the Bluetooth shield to establish a Bluetooth communication connection with a corresponding device on the basis of the Bluetooth connection message, the corresponding device being a sending device of the Bluetooth connection message; if the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device on the basis of the Bluetooth connection message, disconnecting the USB communication connection of the Bluetooth shield, and controlling the Bluetooth shield to enter a Bluetooth communication connection state. The technical solutions provided in the present application can simplify the operation process of switching a Bluetooth shield from a USB communication connection state to a Bluetooth communication connection state.

Description

应用于蓝牙盾的通讯处理方法及蓝牙盾Communication processing method and Bluetooth shield applied to Bluetooth shield
本申请要求于2017年10月30日提交中国专利局、申请号为201711033521.7、发明名称为“应用于蓝牙盾的通讯处理方法及蓝牙盾”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on October 30, 2017, the Chinese Patent Office, Application No. 201711033521.7, the invention titled "Communication Processing Method for Bluetooth Shield and Bluetooth Shield", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及蓝牙盾技术领域,具体涉及一种应用于蓝牙盾的通讯处理方法、蓝牙盾及计算机可读存储介质。The present invention relates to the field of Bluetooth shield technology, and in particular, to a communication processing method applied to a Bluetooth shield, a Bluetooth shield, and a computer readable storage medium.
背景技术Background technique
随着电子商务的深入推广,电子支付的使用越来越普及,用户通过网上银行就可以方便地完成几乎所有的金融理财业务。由于涉及财产安全问题,因此,在通过网上银行进行金融理财业务的过程中,需要嵌入安全身份认证机制。With the in-depth promotion of e-commerce, the use of electronic payment has become more and more popular, and users can easily complete almost all financial management services through online banking. Due to the issue of property security, it is necessary to embed a secure identity authentication mechanism in the process of conducting financial wealth management services through online banking.
U盾是一种提供通用串行总线(USB,Universal Serial Bus)接口和安全身份认证机制的硬件设备,它内置单片机或智能卡芯片,有一定的存储空间,可以存储用户的私钥以及数字证书,利用U盾内置的公钥算法可以实现对用户身份的认证。而蓝牙盾是在U盾的基础上改进而成的设备,可以理解为是一种具备蓝牙功能的U盾。蓝牙盾利用蓝牙技术将U盾的功能扩展到移动终端上,打破了U盾的安全身份认证机制在移动终端上使用的物理限制,从技术上进一步提升了用户移动支付交易的安全性。U shield is a universal serial bus (USB, Universal Serial) Bus) interface and hardware device for secure identity authentication mechanism. It has built-in single-chip or smart card chip, has a certain storage space, can store the user's private key and digital certificate, and can use the public key algorithm built into U shield to realize user identity authentication. . The Bluetooth Shield is a device that has been improved on the basis of the U Shield. It can be understood as a U-Shield with Bluetooth function. The Bluetooth Shield uses Bluetooth technology to extend the function of the U-Shield to the mobile terminal, breaking the physical limitation of the U-Shield's secure identity authentication mechanism on the mobile terminal, and further improving the security of the user's mobile payment transaction.
目前,当蓝牙盾通过USB接口接入诸如个人计算机(即PC机)、笔记本等支持USB通讯的设备时,蓝牙盾会与该设备建立USB通讯连接,以建立USB通讯通道。由于目前蓝牙盾仅支持单通道通讯(即蓝牙盾无法同时采用蓝牙通讯通道和USB通讯通道进行通讯),因此,如果此时用户要采用该蓝牙盾的蓝牙通讯通道进行通讯,则需要该用户先断开该蓝牙盾上已建立的USB通讯连接,之后才能基于该蓝牙盾的蓝牙通讯通道去建立蓝牙通讯连接,操作过程较为繁琐。At present, when the Bluetooth shield accesses a device such as a personal computer (ie, a PC) or a notebook that supports USB communication through a USB interface, the Bluetooth shield establishes a USB communication connection with the device to establish a USB communication channel. Since the current Bluetooth shield only supports single-channel communication (that is, the Bluetooth shield cannot simultaneously use the Bluetooth communication channel and the USB communication channel for communication), if the user wants to use the Bluetooth communication channel of the Bluetooth shield to communicate at this time, the user needs to first Disconnect the established USB communication connection on the Bluetooth shield, and then establish a Bluetooth communication connection based on the Bluetooth communication channel of the Bluetooth shield. The operation process is cumbersome.
技术问题technical problem
有鉴于此,本申请提供一种应用于蓝牙盾的通讯处理方法、蓝牙盾及计算机可读存储介质,用以简化蓝牙盾从USB通讯连接状态切换为蓝牙通讯连接状态的操作过程。In view of this, the present application provides a communication processing method applied to a Bluetooth shield, a Bluetooth shield, and a computer readable storage medium for simplifying the operation process of the Bluetooth shield switching from a USB communication connection state to a Bluetooth communication connection state.
技术解决方案Technical solution
本申请实施例第一方面提供应用于蓝牙盾的通讯处理方法,包括:The first aspect of the embodiments of the present application provides a communication processing method applied to a Bluetooth shield, including:
当蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关;Obtaining an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection with the Bluetooth shield;
当监听到所述蓝牙连接消息的获取事件时,控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述相应设备为所述蓝牙连接消息的发送设备;When the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, where the corresponding device is a sending device of the Bluetooth connection message;
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
基于本申请实施例第一方面,在第一种可能的实现方式中,所述若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态具体为:According to the first aspect of the embodiments of the present application, in a first possible implementation, if the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnecting the USB of the Bluetooth shield The communication connection and controlling the Bluetooth shield to enter the Bluetooth communication connection state are specifically:
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield does not currently process the APDU command through the USB interface, disconnect the USB communication connection of the Bluetooth shield, and control the The Bluetooth shield enters the Bluetooth communication connection state.
基于本申请实施例第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接之后,还包括:According to a first possible implementation manner of the first aspect of the embodiments of the present application, in a second possible implementation manner, after the controlling, the Bluetooth shield establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, include:
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前正在通过USB接口处理APDU命令,则:If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield is currently processing an APDU command through the USB interface, then:
断开所述蓝牙通讯连接,Disconnect the Bluetooth communication connection,
或者,or,
等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。,After waiting for the Bluetooth shield to process the APDU command, disconnect the USB communication connection of the Bluetooth shield and control the Bluetooth shield to enter the Bluetooth communication connection state. ,
基于本申请实施例第一方面,或者本申请实施例第一方面的第一种可能的实现方式,或者本申请实施例第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述通讯处理方法还包括:The third possible implementation is based on the first aspect of the embodiment of the present application, or the first possible implementation manner of the first aspect of the application, or the second possible implementation manner of the first aspect of the application In the mode, the communication processing method further includes:
当所述蓝牙盾断开蓝牙通讯连接时,使能所述蓝牙盾的USB接口,以便当所述蓝牙盾通过所述USB接口与外部可通讯设备连接时,响应所述外部可通讯设备的USB连接请求,其中,所述USB连接请求用以请求与所述蓝牙盾建立USB通讯连接,其中,所述外部可通讯设备是指支持USB通讯的设备。When the Bluetooth shield disconnects the Bluetooth communication connection, enabling the USB interface of the Bluetooth shield to respond to the USB of the external communicable device when the Bluetooth shield is connected to the external communicable device through the USB interface a connection request, wherein the USB connection request is used to request to establish a USB communication connection with the Bluetooth shield, wherein the external communicable device refers to a device that supports USB communication.
基于本申请实施例第一方面,或者本申请实施例第一方面的第一种可能的实现方式,或者本申请实施例第一方面的第二种可能的实现方式,在第四种可能的实现方式中,所述通讯处理方法还包括:The fourth possible implementation is based on the first aspect of the embodiment of the present application, or the first possible implementation manner of the first aspect of the application, or the second possible implementation manner of the first aspect of the application In the mode, the communication processing method further includes:
若所述蓝牙盾的USB接口在所述蓝牙盾断开蓝牙通讯连接时未与外部可通讯设备连接,则控制所述蓝牙盾进入休眠状态或者控制所述蓝牙盾关机,其中,所述外部可通讯设备是指支持USB通讯的设备。If the USB interface of the Bluetooth shield is not connected to the external communicable device when the Bluetooth shield disconnects the Bluetooth communication connection, the Bluetooth shield is controlled to enter a sleep state or the Bluetooth shield is controlled to be shut down, wherein the external A communication device is a device that supports USB communication.
基于本申请实施例第一方面,或者本申请实施例第一方面的第一种可能的实现方式,或者本申请实施例第一方面的第二种可能的实现方式,在第五种可能的实现方式中,所述通讯方法还包括:The fifth possible implementation is based on the first aspect of the embodiment of the present application, or the first possible implementation manner of the first aspect of the application, or the second possible implementation manner of the first aspect of the application In the mode, the communication method further includes:
若在所述蓝牙盾的休眠状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接,则唤醒所述蓝牙盾;If the Bluetooth interface of the Bluetooth shield is detected to be connected to an external communicable device in the sleep state of the Bluetooth shield, the Bluetooth shield is woken up;
和/或,and / or,
若在所述蓝牙盾的关机状态下,检测到所述蓝牙盾的USB接口未与外部可通讯设备连接,则控制所述蓝牙盾开机。If it is detected that the USB interface of the Bluetooth shield is not connected to the external communicable device in the shutdown state of the Bluetooth shield, the Bluetooth shield is controlled to be powered on.
本申请实施例第二方面提供一种蓝牙盾,包括:A second aspect of the embodiment of the present application provides a Bluetooth shield, including:
蓝牙芯片模块和安全芯片模块;Bluetooth chip module and security chip module;
所述蓝牙芯片模块用于在蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,并在监听到所述蓝牙连接消息的获取事件时基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关,所述相应设备为所述蓝牙连接消息的发送设备;The Bluetooth chip module is configured to monitor an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, and establish a Bluetooth communication with the corresponding device based on the Bluetooth connection message when listening to the acquisition event of the Bluetooth connection message. Connecting, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection by the Bluetooth shield, and the corresponding device is a sending device of the Bluetooth connection message;
所述蓝牙芯片模块还用于:当所述蓝牙芯片模块与所述相应设备成功建立蓝牙通讯连接时,向所述安全芯片发送通知消息,其中,所述通知消息用以通知所述安全芯片模块蓝牙通讯连接成功;The Bluetooth chip module is further configured to: when the Bluetooth chip module successfully establishes a Bluetooth communication connection with the corresponding device, send a notification message to the security chip, where the notification message is used to notify the security chip module Bluetooth communication connection is successful;
所述安全芯片模块用于:在接收到所述通知消息时,断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。The security chip module is configured to: when receiving the notification message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
基于本申请实施例第二方面,在第一种可能的实现方式中,所述安全芯片模块具体用于:在接收到所述通知消息时,判断所述蓝牙盾当前是否通过USB接口处理APDU命令;若判定所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。According to the second aspect of the embodiments of the present application, in a first possible implementation, the security chip module is specifically configured to: when receiving the notification message, determine whether the Bluetooth shield currently processes an APDU command through a USB interface. If it is determined that the Bluetooth shield does not currently process the APDU command through the USB interface, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter the Bluetooth communication connection state.
基于本申请实施例第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述安全芯片模块还用于:在判断所述蓝牙盾当前是否通过USB接口处理APDU命令之后,若判定所述蓝牙盾当前正通过USB接口处理APDU命令,则:触发所述蓝牙芯片模块断开所述蓝牙通讯连接,或者,等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。According to a first possible implementation manner of the second aspect of the embodiment of the present application, in a second possible implementation manner, the security chip module is further configured to: determine whether the Bluetooth shield currently processes an APDU command through a USB interface Then, if it is determined that the Bluetooth shield is currently processing the APDU command through the USB interface, the Bluetooth chip module is triggered to disconnect the Bluetooth communication connection, or, after waiting for the Bluetooth shield to process the APDU command, disconnect The Bluetooth communication of the Bluetooth shield connects and controls the Bluetooth shield to enter a Bluetooth communication connection state.
本申请实施例第三方面提供一种蓝牙盾,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,上述处理器执行上述计算机程序时实现上述第一方面或者上述第一方面的任一可能实现方式中提及的通讯处理方法。A third aspect of the embodiments of the present application provides a Bluetooth shield, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the first aspect or the foregoing A communication processing method mentioned in any of the possible implementations of the aspect.
本申请实施例第四方面提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,上述计算机程序被处理器执行时实现上述第一方面或者上述第一方面的任一可能实现方式中提及的通讯处理方法。A fourth aspect of the embodiments of the present application provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, implementing any of the foregoing first aspect or the first aspect The communication processing method mentioned in the implementation.
有益效果Beneficial effect
本申请方案中,当蓝牙盾处于USB通讯连接状态时监听蓝牙连接消息的获取事件,当监听到蓝牙连接消息的获取事件时,控制该蓝牙盾与相应设备建立蓝牙通讯连接,并在成功建立蓝牙通讯连接时断开该蓝牙盾的USB通讯连接,并控制该蓝牙盾进入蓝牙通讯连接状态,从而使得该蓝牙盾从USB通讯连接自动切换到蓝牙通讯连接。由于上述切换的过程无需人为参与,因此有效简化了蓝牙盾从USB通讯连接状态切换为蓝牙通讯连接状态的操作过程。另外,在蓝牙盾与相应设备成功建立蓝牙通讯连接时才断开该蓝牙盾的USB通讯连接,从而可以确保蓝牙盾通讯连接状态的有效切换。In the solution of the present application, when the Bluetooth shield is in the USB communication connection state, the acquisition event of the Bluetooth connection message is monitored, and when the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device, and the Bluetooth is successfully established. When the communication connection is disconnected, the USB communication connection of the Bluetooth shield is disconnected, and the Bluetooth shield is controlled to enter the Bluetooth communication connection state, so that the Bluetooth shield automatically switches from the USB communication connection to the Bluetooth communication connection. Since the above switching process does not require human intervention, the operation process of the Bluetooth shield switching from the USB communication connection state to the Bluetooth communication connection state is effectively simplified. In addition, the USB communication connection of the Bluetooth shield is disconnected when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device, thereby ensuring effective switching of the Bluetooth shield communication connection state.
附图说明DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only the present application. For some embodiments, other drawings may be obtained from those of ordinary skill in the art in light of the inventive workability.
图1为本申请提供的通讯处理方法一个实施例流程示意图;1 is a schematic flow chart of an embodiment of a communication processing method provided by the present application;
图2为本申请提供的通讯处理装置一个实施例结构示意图;2 is a schematic structural diagram of an embodiment of a communication processing apparatus provided by the present application;
图3为本申请提供的蓝牙盾一个实施例结构示意图;3 is a schematic structural diagram of an embodiment of a Bluetooth shield provided by the present application;
图4为本申请提供的蓝牙盾另一个实施例结构示意图。FIG. 4 is a schematic structural diagram of another embodiment of a Bluetooth shield provided by the present application.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for purposes of illustration and description However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to explain the technical solutions described in the present application, the following description will be made by way of specific embodiments.
下面对本申请实施例提供的一种应用于蓝牙盾的通讯处理方法进行描述,请参阅图1,本申请实施例中的通讯处理方法包括:A communication processing method applied to the Bluetooth shield provided by the embodiment of the present application is described. Referring to FIG. 1, the communication processing method in the embodiment of the present application includes:
步骤101、当蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件;Step 101: Listening to an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state;
本申请实施例中,蓝牙盾是指集成蓝牙功能和U盾功能的设备。当蓝牙盾处于USB通讯连接状态时,表明当前该蓝牙盾已通过USB接口插入外部可通讯设备(外部可通讯设备是指支持USB通讯的设备,例如PC机、笔记本等)并建立USB通讯连接,此时,该蓝牙盾采用USB通讯通道进行通讯。In the embodiment of the present application, the Bluetooth shield refers to a device that integrates the Bluetooth function and the U shield function. When the Bluetooth shield is in the USB communication connection state, it indicates that the Bluetooth shield has been inserted into the external communicable device through the USB interface (the external communicable device refers to a device supporting USB communication, such as a PC, a notebook, etc.) and establishes a USB communication connection. At this time, the Bluetooth shield uses the USB communication channel for communication.
上述蓝牙连接消息与述蓝牙盾建立蓝牙通讯连接相关。The above Bluetooth connection message is related to establishing a Bluetooth communication connection with the Bluetooth shield.
在一种应用场景中,上述蓝牙连接消息可以为周边设备发起的,且用以请求与上述蓝牙盾建立蓝牙通讯连接的蓝牙连接请求消息。具体的,当蓝牙盾开启蓝牙功能时,该蓝牙盾广播其蓝牙相关信息,以便位于该蓝牙盾周边的设备可基于蓝牙技术搜索到该蓝牙盾并针对该蓝牙盾发起上述蓝牙连接请求消息。In an application scenario, the Bluetooth connection message may be initiated by a peripheral device and used to request a Bluetooth connection request message for establishing a Bluetooth communication connection with the Bluetooth shield. Specifically, when the Bluetooth shield turns on the Bluetooth function, the Bluetooth shield broadcasts its Bluetooth related information, so that the device located around the Bluetooth shield can search for the Bluetooth shield based on the Bluetooth technology and initiate the Bluetooth connection request message for the Bluetooth shield.
在另一种应用场景中,上述蓝牙连接消息也可以为位于该蓝牙盾周边的设备广播的,且携带上述蓝牙盾的设备标识(例如设备序列号)的消息。具体的,如果某个设备中存在与上述蓝牙盾建立蓝牙通讯连接的历史记录,则在后续该设备开启蓝牙功能时,该设备会广播携带该蓝牙盾的设备标识的蓝牙连接消息。本申请实施例中,当上述蓝牙盾开启蓝牙功能后,可从位于该蓝牙盾周边的设备广播的消息中过滤掉与该蓝牙盾建立蓝牙通讯连接不相关的消息(即未携带上述蓝牙盾的设备标识的消息),从中获取与上述蓝牙盾建立蓝牙通讯连接相关的蓝牙连接消息(即携带有上述蓝牙盾的设备标识的消息)。In another application scenario, the Bluetooth connection message may also be a message that is broadcasted by a device located around the Bluetooth shield and carries the device identifier (eg, device serial number) of the Bluetooth shield. Specifically, if a history record of establishing a Bluetooth communication connection with the Bluetooth shield is present in a device, when the device starts the Bluetooth function, the device broadcasts a Bluetooth connection message carrying the device identifier of the Bluetooth shield. In the embodiment of the present application, after the Bluetooth function is enabled, the message that is not related to establishing a Bluetooth communication connection with the Bluetooth shield may be filtered from a message broadcasted by a device located in the periphery of the Bluetooth shield (ie, the Bluetooth shield is not carried. The message of the device identification) obtains a Bluetooth connection message (ie, a message carrying the device identifier of the Bluetooth shield mentioned above) associated with establishing the Bluetooth communication connection with the Bluetooth shield.
在步骤101中,监听上述蓝牙连接消息的获取事件,以便在获取到上述蓝牙连接消息时可及时获知。In step 101, the acquisition event of the Bluetooth connection message is monitored to be known in time when the Bluetooth connection message is obtained.
步骤102、当监听到上述蓝牙连接消息的获取事件时,控制上述蓝牙盾基于上述蓝牙连接消息与相应设备建立蓝牙通讯连接;Step 102: When listening to the acquisition event of the Bluetooth connection message, controlling the Bluetooth shield to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message;
在步骤102中,当在蓝牙盾的USB通讯连接状态下监听到上述蓝牙连接消息的获取事件时,表明当前上述蓝牙盾有建立蓝牙通讯连接的需求,此时控制上述蓝牙盾基于上述蓝牙连接消息与相应设备建立蓝牙通讯连接。其中,上述相应设备为上述蓝牙连接消息的发送设备。具体地,上述蓝牙盾基于上述蓝牙连接消息与相应设备建立蓝牙通讯连接的过程可以参照已有技术实现,此处不再赘述。In step 102, when the acquisition event of the Bluetooth connection message is monitored in the USB communication connection state of the Bluetooth shield, it indicates that the current Bluetooth shield has a requirement for establishing a Bluetooth communication connection, and the Bluetooth shield is controlled based on the Bluetooth connection message. Establish a Bluetooth communication connection with the corresponding device. The foregoing device is a sending device of the foregoing Bluetooth connection message. Specifically, the process of establishing a Bluetooth communication connection between the Bluetooth Shield and the corresponding device based on the foregoing Bluetooth connection message may be implemented by referring to the prior art, and details are not described herein again.
步骤103、若上述蓝牙盾基于上述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开上述蓝牙盾的USB通讯连接,并控制上述蓝牙盾进入蓝牙通讯连接状态;Step 103: If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state;
在步骤103中,当上述蓝牙盾基于上述蓝牙连接消息与相应设备成功建立蓝牙通讯连接(相当于蓝牙配对成功),此时断开上述蓝牙盾的USB通讯连接,并控制上述蓝牙盾进入蓝牙通讯连接状态。其中,当上述蓝牙盾处于上述蓝牙通讯连接状态时,上述蓝牙盾采用蓝牙通讯通道进行通讯。应理解的是,若上述蓝牙盾在开机且未处于USB通讯连接状态的场景下,与周边的设备成功建立蓝牙通讯连接,此时上述蓝牙盾也将进入上述蓝牙通讯连接状态。In step 103, when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message (equivalent to Bluetooth pairing success), the USB communication connection of the Bluetooth shield is disconnected, and the Bluetooth shield is controlled to enter the Bluetooth communication. Connection Status. Wherein, when the Bluetooth shield is in the Bluetooth communication connection state, the Bluetooth shield uses a Bluetooth communication channel for communication. It should be understood that if the Bluetooth shield is powered on and is not in the USB communication connection state, the Bluetooth communication connection is successfully established with the surrounding device, and the Bluetooth shield will also enter the Bluetooth communication connection state.
具体地,上述断开上述蓝牙盾的USB通讯连接可以为对上述蓝牙盾进行USB软拔除处理。上述USB软拔除处理可以参照已有技术实现,此处不再赘述。Specifically, the USB communication connection for disconnecting the Bluetooth shield may be a USB soft extraction process for the Bluetooth shield. The above USB soft extraction processing can be implemented by referring to the prior art, and details are not described herein again.
为了更好的理解图1所示的通讯处理方法,下面以一具体应用场景例进行说明。本应用场景中的蓝牙盾包括:蓝牙芯片模块(用于提供蓝牙通讯功能)、安全芯片(主要用于进行数字解密以及存放数字证书)和USB接口,其中,蓝牙芯片模块与安全芯片之间可通过串口连接,USB接口与安全芯片之间电气连接,在一种应用场景中,安全芯片和USB接口可集成在安全芯片模块中。当蓝牙盾处于USB通讯连接状态时,如果上述蓝牙芯片模块获取到蓝牙连接消息,则暂不通知上述安全芯片,而先基于上述蓝牙连接消息与相应设备建立蓝牙通讯连接,当基于上述蓝牙连接消息与相应设备成功建立蓝牙通讯连接时,向上述安全芯片发送指示蓝牙通讯连接建立成功的指令(例如通知消息),上述安全芯片在该指令的指示下对上述蓝牙盾进行USB软拔除处理,并将上述蓝牙盾的通讯通道切换为蓝牙通讯通道,以控制上述蓝牙盾进入蓝牙通讯连接状态。In order to better understand the communication processing method shown in FIG. 1, the following describes a specific application scenario. The Bluetooth shield in this application scenario includes: a Bluetooth chip module (for providing Bluetooth communication function), a security chip (mainly used for digital decryption and storing digital certificates), and a USB interface, wherein a Bluetooth chip module and a security chip are available Through the serial port connection, the USB interface and the security chip are electrically connected. In an application scenario, the security chip and the USB interface can be integrated in the security chip module. When the Bluetooth shield is in the USB communication connection state, if the Bluetooth chip module obtains the Bluetooth connection message, the security chip is not notified yet, and the Bluetooth communication connection is established with the corresponding device based on the Bluetooth connection message, when the Bluetooth connection message is based on the Bluetooth connection message. When the Bluetooth communication connection is successfully established with the corresponding device, an instruction (such as a notification message) indicating that the Bluetooth communication connection is successfully established is sent to the security chip, and the security chip performs USB soft extraction processing on the Bluetooth shield under the instruction of the instruction, and The communication channel of the above Bluetooth shield is switched to a Bluetooth communication channel to control the Bluetooth shield to enter the Bluetooth communication connection state.
为了避免当用户通过蓝牙盾的USB接口正在执行交易时,由于蓝牙盾的USB通讯连接被断开而影响交易的进行,可选的,步骤103具体可以表现为:若上述蓝牙盾基于上述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且上述蓝牙盾当前未通过USB接口处理APDU命令,则断开上述蓝牙盾的USB通讯连接,并控制上述蓝牙盾进入蓝牙通讯连接状态。其中,上述APDU(APDU的英文全称为Application Protocol Data Unit)命令也即蓝牙盾与外部通讯设备之间传送的命令,具体的,关于APDU命令可以参照已有说明,此处不再赘述。进一步,步骤102之后还可以包括:若上述蓝牙盾基于上述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且上述蓝牙盾当前正在通过USB接口处理APDU命令,则:断开上述蓝牙通讯连接,或者,等待上述蓝牙盾处理完上述APDU命令后,断开上述蓝牙盾的USB通讯连接并控制上述蓝牙盾进入蓝牙通讯连接状态。可选的,当在上述蓝牙盾的蓝牙通讯连接状态下时关断上述蓝牙盾的USB接口。通过此可选方案,当蓝牙盾处于蓝牙通讯连接状态时,即使该蓝牙盾被再次插入PC机、笔记本等外部可通讯设备的USB接口,也将保持上述蓝牙盾的蓝牙通讯连接状态且不接收USB连接请求(USB连接请求用以请求与蓝牙盾建立USB通讯连接),即不建立上述蓝牙盾与上述外部可通讯设备的USB通讯连接。当然,在蓝牙盾被插入PC机、笔记本等外部可通讯设备的USB接口时,无论是否建立USB通讯连接,上述蓝牙盾均可从该外部可通讯设备获得电源补给。另外,在该蓝牙盾配置有可充电电池的场景下,该可充电电池此时可处于充电状态。In order to prevent the user from performing a transaction through the USB interface of the Bluetooth shield, since the USB communication connection of the Bluetooth shield is disconnected to affect the transaction, optionally, step 103 may be specifically performed as follows: if the Bluetooth shield is based on the Bluetooth connection. The message successfully establishes a Bluetooth communication connection with the corresponding device, and the Bluetooth shield does not currently process the APDU command through the USB interface, then disconnects the USB communication connection of the Bluetooth shield, and controls the Bluetooth shield to enter the Bluetooth communication connection state. The above APDU (the full name of the APDU in English) The Protocol Data Unit command is a command that is transmitted between the Bluetooth shield and the external communication device. Specifically, the APDU command can be referred to the existing description, and is not described here. Further, after the step 102, the method further includes: if the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield is currently processing the APDU command through the USB interface, then: disconnecting the Bluetooth communication connection, or After waiting for the above-mentioned APDU command to be processed by the above-mentioned Bluetooth shield, the USB communication connection of the Bluetooth shield is disconnected and the Bluetooth shield is controlled to enter the Bluetooth communication connection state. Optionally, the USB interface of the Bluetooth shield is turned off when the Bluetooth communication connection state of the Bluetooth shield is above. With this option, when the Bluetooth shield is in the Bluetooth communication connection state, even if the Bluetooth shield is reinserted into the USB interface of an external communicable device such as a PC or a notebook, the Bluetooth communication connection status of the Bluetooth shield will be maintained and not received. The USB connection request (the USB connection request is used to request a USB communication connection with the Bluetooth shield), that is, the USB communication connection between the Bluetooth shield and the external communicable device is not established. Of course, when the Bluetooth shield is inserted into the USB interface of an external communicable device such as a PC or a notebook, the Bluetooth shield can obtain power supply from the external communicable device regardless of whether or not a USB communication connection is established. In addition, in the scenario where the Bluetooth shield is configured with a rechargeable battery, the rechargeable battery can be in a charging state at this time.
进一步,当上述蓝牙盾断开蓝牙通讯连接时,使能上述蓝牙盾的USB接口,以便当上述蓝牙盾通过上述USB接口与外部可通讯设备连接时,响应上述外部可通讯设备的USB连接请求,其中,上述外部可通讯设备是指支持USB通讯的设备。以一具体应用场景进行说明,当上述蓝牙盾处于蓝牙通讯连接状态且已通过USB接口插入外部可通讯设备中时,若此时上述蓝牙盾断开蓝牙通讯连接,则由于上述蓝牙盾的USB接口已插入外部可通讯设备,此时可使能上述蓝牙盾的USB接口,以便上述蓝牙盾可与上述外部可通讯设备建立USB通讯连接,从而实现从蓝牙通讯连接状态自动切换为USB通讯连接状态。Further, when the Bluetooth shield disconnects the Bluetooth communication connection, the USB interface of the Bluetooth shield is enabled, so that when the Bluetooth shield is connected to the external communicable device through the USB interface, the USB connection request of the external communicable device is responded to, The above external communicable device refers to a device that supports USB communication. According to a specific application scenario, when the Bluetooth shield is in the Bluetooth communication connection state and has been inserted into the external communicable device through the USB interface, if the Bluetooth shield disconnects the Bluetooth communication connection at this time, the USB interface of the Bluetooth shield is The external communicable device has been inserted, and the USB interface of the Bluetooth shield can be enabled at this time, so that the Bluetooth shield can establish a USB communication connection with the external communicable device, thereby automatically switching from the Bluetooth communication connection state to the USB communication connection state.
为了节省上述蓝牙盾的功耗,可以在上述蓝牙盾未建立蓝牙通讯连接且上述蓝牙盾的USB接口未与外部可通讯设备连接(即USB接口未插入该外部可通讯设备)时,控制上述蓝牙盾进入休眠状态或者关机。可选的,本申请实施例中的通讯方法可包括:In order to save the power consumption of the above-mentioned Bluetooth shield, the Bluetooth communication can be controlled when the Bluetooth communication connection is not established and the USB interface of the Bluetooth shield is not connected to the external communication device (ie, the USB interface is not inserted into the external communication device). The shield goes to sleep or shuts down. Optionally, the communication method in the embodiment of the present application may include:
若上述蓝牙盾的USB接口在上述蓝牙盾断开蓝牙通讯连接时未与上述外部可通讯设备连接,则控制上述蓝牙盾进入休眠状态或者控制上述蓝牙盾关机。具体的,可以当上述蓝牙盾断开蓝牙通讯连接时,检测上述蓝牙盾的USB接口是否已与外部可通讯设备连接,若检测到上述蓝牙盾的USB接口未与外部可通讯设备连接,则控制上述蓝牙盾进入休眠状态或者关机;和/或,当上述蓝牙盾的USB接口从外部可通讯设备拔出时,检测上述蓝牙盾是否处于蓝牙通讯连接状态,若检测到上述蓝牙盾未处于蓝牙通讯连接状态,则控制上述蓝牙盾进入休眠状态或者关机。If the USB interface of the Bluetooth shield is not connected to the external communicable device when the Bluetooth shield is disconnected from the Bluetooth communication, the Bluetooth shield is controlled to enter a sleep state or the Bluetooth shield is controlled to be shut down. Specifically, when the Bluetooth shield disconnects the Bluetooth communication connection, it is detected whether the USB interface of the Bluetooth shield is connected to the external communication device, and if the USB interface of the Bluetooth shield is detected to be not connected with the external communication device, then the control is performed. The Bluetooth shield enters a sleep state or is turned off; and/or, when the USB interface of the Bluetooth shield is pulled out from the external communicable device, detecting whether the Bluetooth shield is in a Bluetooth communication connection state, and if the Bluetooth shield is detected not to be in Bluetooth communication In the connection state, the above-mentioned Bluetooth shield is controlled to enter a sleep state or shut down.
进一步,在上述蓝牙盾的休眠状态下,可在检测到上述蓝牙盾的USB接口与外部可通讯设备连接或者在接收到预设的第一按键指令时,唤醒上述蓝牙盾。和/或,在上述蓝牙盾的关机状态下,可在检测到上述蓝牙盾的USB接口与外部可通讯设备连接或者在接收到预设的第二按键指令时,控制上述蓝牙盾开机。Further, in the sleep state of the Bluetooth shield, the Bluetooth shield of the Bluetooth shield may be connected to the external communicable device or the preset first button command may be used to wake up the Bluetooth shield. And/or, in the shutdown state of the Bluetooth shield, the Bluetooth shield can be controlled to be connected when the USB interface of the Bluetooth shield is detected to be connected with the external communicable device or when a preset second button command is received.
需要说明的是,本申请实施例中的通讯处理方法可应用于通讯处理装置中,上述通讯处理装置可以为独立的设备,或者也可以集成在上述蓝牙盾中,此处不作限定。It should be noted that the communication processing method in the embodiment of the present application may be applied to the communication processing device, and the communication processing device may be an independent device, or may be integrated into the Bluetooth shield, which is not limited herein.
由上可见,本申请实施例中,当蓝牙盾处于USB通讯连接状态时监听蓝牙连接消息的获取事件,当监听到蓝牙连接消息的获取事件时,控制该蓝牙盾与相应设备建立蓝牙通讯连接,并在成功建立蓝牙通讯连接时断开该蓝牙盾的USB通讯连接,并控制该蓝牙盾进入蓝牙通讯连接状态,从而使得该蓝牙盾从USB通讯连接自动切换到蓝牙通讯连接。由于上述切换的过程无需人为参与,因此有效简化了蓝牙盾从USB通讯连接状态切换为蓝牙通讯连接状态的操作过程。另外,在蓝牙盾与相应设备成功建立蓝牙通讯连接时才断开该蓝牙盾的USB通讯连接,从而可以确保蓝牙盾通讯连接状态的有效切换。It can be seen that, in the embodiment of the present application, when the Bluetooth shield is in the USB communication connection state, the acquisition event of the Bluetooth connection message is monitored, and when the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device. And when the Bluetooth communication connection is successfully established, the USB communication connection of the Bluetooth shield is disconnected, and the Bluetooth shield is controlled to enter the Bluetooth communication connection state, so that the Bluetooth shield automatically switches from the USB communication connection to the Bluetooth communication connection. Since the above switching process does not require human intervention, the operation process of the Bluetooth shield switching from the USB communication connection state to the Bluetooth communication connection state is effectively simplified. In addition, the USB communication connection of the Bluetooth shield is disconnected when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device, thereby ensuring effective switching of the Bluetooth shield communication connection state.
实施例二Embodiment 2
本申请实施例还提供一种应用于蓝牙盾的通讯处理装置,如图2所示,本申请实施例中的通讯处理装置200包括:The embodiment of the present application further provides a communication processing device applied to the Bluetooth shield. As shown in FIG. 2, the communication processing device 200 in the embodiment of the present application includes:
监听单元201,用于在蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关;The monitoring unit 201 is configured to monitor an acquisition event of the Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection with the Bluetooth shield;
第一控制单元202,用于当监听单元201监听到所述蓝牙连接消息的获取事件时,控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述相应设备为所述蓝牙连接消息的发送设备;The first control unit 202 is configured to, when the listening unit 201 monitors the acquisition event of the Bluetooth connection message, control the Bluetooth shield to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, where the corresponding device is a transmitting device of the Bluetooth connection message;
第二控制单元203,用于当所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接时,断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。The second control unit 203 is configured to: when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection. status.
可选的,第二控制单元203具体用于:当所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前未通过USB接口处理APDU命令时,断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。Optionally, the second control unit 203 is specifically configured to: when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield does not currently process the APDU command through the USB interface, disconnecting The Bluetooth communication of the Bluetooth shield is connected, and the Bluetooth shield is controlled to enter a Bluetooth communication connection state.
可选的,本申请实施例中的通讯处理装置还包括:第三控制单元,用于当所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前正在通过USB接口处理APDU命令时,断开所述蓝牙通讯连接,或者,等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。Optionally, the communication processing device in the embodiment of the present application further includes: a third control unit, configured to: when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield is currently being Disconnecting the Bluetooth communication connection when the APDU command is processed through the USB interface, or waiting for the Bluetooth shield to process the APDU command, disconnecting the USB communication connection of the Bluetooth shield and controlling the Bluetooth shield to enter the Bluetooth communication Connection Status.
可选的,本申请实施例中的通讯处理装置还包括:使能单元,用于当所述蓝牙盾断开蓝牙通讯连接时,使能所述蓝牙盾的USB接口,以便当所述蓝牙盾通过所述USB接口与外部可通讯设备连接时,响应所述外部可通讯设备的USB连接请求,其中,所述USB连接请求用以请求与所述蓝牙盾建立USB通讯连接,其中,所述外部可通讯设备是指支持USB通讯的设备。Optionally, the communication processing device in the embodiment of the present application further includes: an enabling unit, configured to enable the USB interface of the Bluetooth shield when the Bluetooth shield disconnects the Bluetooth communication connection, so that when the Bluetooth shield is Responding to a USB connection request of the external communicable device when the USB interface is connected to the external communicable device, wherein the USB connection request is used to request to establish a USB communication connection with the Bluetooth shield, wherein the external A communicable device is a device that supports USB communication.
可选的,本申请实施例中的通讯处理装置还包括:节电控制单元,用于当所述蓝牙盾断开蓝牙通讯连接,且所述蓝牙盾的USB接口未与外部可通讯设备连接时,控制所述蓝牙盾进入休眠状态或控制所述蓝牙盾关机。也即,若上述蓝牙盾的USB接口在上述蓝牙盾断开蓝牙通讯连接时未插入上述外部可通讯设备,则上述节电控制单元控制上述蓝牙盾进入休眠状态或控制上述蓝牙盾关机Optionally, the communication processing device in the embodiment of the present application further includes: a power saving control unit, configured to: when the Bluetooth shield disconnects the Bluetooth communication connection, and the USB interface of the Bluetooth shield is not connected to the external communicable device And controlling the Bluetooth shield to enter a sleep state or controlling the Bluetooth shield to be turned off. That is, if the USB interface of the Bluetooth shield does not insert the external communicable device when the Bluetooth shield disconnects the Bluetooth communication connection, the power saving control unit controls the Bluetooth shield to enter a sleep state or control the Bluetooth shield to be turned off.
可选的,本申请实施例中的通讯处理装置还包括:第一唤醒单元和/或第二唤醒单元。上述第一唤醒单元用于当在所述蓝牙盾的休眠状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接时,唤醒所述蓝牙盾。上述第二唤醒单元用于当在所述蓝牙盾的关机状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接时,控制所述蓝牙盾开机。Optionally, the communications processing apparatus in the embodiment of the present application further includes: a first waking unit and/or a second waking unit. The first wake-up unit is configured to wake up the Bluetooth shield when detecting that the USB interface of the Bluetooth shield is connected to an external communicable device in a sleep state of the Bluetooth shield. The second wake-up unit is configured to control the Bluetooth shield to be powered on when detecting that the USB interface of the Bluetooth shield is connected to an external communicable device in a shutdown state of the Bluetooth shield.
需要说明的是,本申请实施例中的通讯处理方法可应用于通讯处理装置中,上述通讯处理装置可以为独立的设备,或者也可以集成在上述蓝牙盾中,此处不作限定。It should be noted that the communication processing method in the embodiment of the present application may be applied to the communication processing device, and the communication processing device may be an independent device, or may be integrated into the Bluetooth shield, which is not limited herein.
由上可见,本申请实施例中的通讯处理装置在蓝牙盾处于USB通讯连接状态时监听蓝牙连接消息的获取事件,当监听到蓝牙连接消息的获取事件时,控制该蓝牙盾与相应设备建立蓝牙通讯连接,并在成功建立蓝牙通讯连接时断开该蓝牙盾的USB通讯连接,并控制该蓝牙盾进入蓝牙通讯连接状态,从而使得该蓝牙盾从USB通讯连接自动切换到蓝牙通讯连接。由于上述切换的过程无需人为参与,因此有效简化了蓝牙盾从USB通讯连接状态切换为蓝牙通讯连接状态的操作过程。另外,在蓝牙盾与相应设备成功建立蓝牙通讯连接时才断开该蓝牙盾的USB通讯连接,从而可以确保蓝牙盾通讯连接状态的有效切换。It can be seen that the communication processing device in the embodiment of the present application monitors the acquisition event of the Bluetooth connection message when the Bluetooth shield is in the USB communication connection state, and controls the Bluetooth shield to establish the Bluetooth with the corresponding device when the acquisition event of the Bluetooth connection message is monitored. The communication connection disconnects the USB communication connection of the Bluetooth shield when the Bluetooth communication connection is successfully established, and controls the Bluetooth shield to enter the Bluetooth communication connection state, so that the Bluetooth shield automatically switches from the USB communication connection to the Bluetooth communication connection. Since the above switching process does not require human intervention, the operation process of the Bluetooth shield switching from the USB communication connection state to the Bluetooth communication connection state is effectively simplified. In addition, the USB communication connection of the Bluetooth shield is disconnected when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device, thereby ensuring effective switching of the Bluetooth shield communication connection state.
实施例三Embodiment 3
本申请实施例提供一种蓝牙盾,请参阅图3,本申请实施例中的蓝牙盾包括:蓝牙芯片模块301和安全芯片模块302;其中,蓝牙芯片模块301与安全芯片模块302可通过串口连接。蓝牙盾的USB接口(图中未示出)可集成在安全芯片模块302中,或者,也可以独立于安全芯片模块302存在。The embodiment of the present application provides a Bluetooth shield. Referring to FIG. 3, the Bluetooth shield in the embodiment of the present application includes: a Bluetooth chip module 301 and a security chip module 302. The Bluetooth chip module 301 and the security chip module 302 can be connected through a serial port. . The USB interface of the Bluetooth shield (not shown) may be integrated in the security chip module 302 or may exist independently of the security chip module 302.
蓝牙芯片模块301用于在蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,并在监听到所述蓝牙连接消息的获取事件时基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关,所述相应设备为所述蓝牙连接消息的发送设备;The Bluetooth chip module 301 is configured to monitor an acquisition event of the Bluetooth connection message when the Bluetooth shield is in the USB communication connection state, and establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message when the Bluetooth connection message acquisition event is monitored. The Bluetooth connection message is related to establishing a Bluetooth communication connection by the Bluetooth shield, and the corresponding device is a sending device of the Bluetooth connection message;
蓝牙芯片模块301还用于:当所述蓝牙芯片模块与所述相应设备成功建立蓝牙通讯连接时,向所述安全芯片发送通知消息,其中,所述通知消息用以通知所述安全芯片模块蓝牙通讯连接成功;The Bluetooth chip module 301 is further configured to: when the Bluetooth chip module successfully establishes a Bluetooth communication connection with the corresponding device, send a notification message to the security chip, where the notification message is used to notify the security chip module of Bluetooth The communication connection is successful;
安全芯片模块302用于:在接收到所述通知消息时,断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。The security chip module 302 is configured to: when receiving the notification message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
可选的,安全芯片模块302具体用于:在接收到所述通知消息时,判断所述蓝牙盾当前是否通过USB接口处理APDU命令;若判定所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。Optionally, the security chip module 302 is configured to: when receiving the notification message, determine whether the Bluetooth shield currently processes an APDU command through a USB interface; if it is determined that the Bluetooth shield does not currently process an APDU command through a USB interface, Then disconnect the USB communication connection of the Bluetooth shield and control the Bluetooth shield to enter the Bluetooth communication connection state.
进一步,安全芯片模块302还可用于:在判断所述蓝牙盾当前是否通过USB接口处理APDU命令之后,若判定所述蓝牙盾当前正通过USB接口处理APDU命令,则:触发所述蓝牙芯片模块断开所述蓝牙通讯连接,或者,等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。Further, the security chip module 302 is further configured to: after determining whether the Bluetooth shield currently processes the APDU command through the USB interface, if it is determined that the Bluetooth shield is currently processing the APDU command through the USB interface, triggering the Bluetooth chip module to be broken Opening the Bluetooth communication connection, or waiting for the Bluetooth shield to process the APDU command, disconnecting the USB communication connection of the Bluetooth shield and controlling the Bluetooth shield to enter the Bluetooth communication connection state.
可选的,安全芯片模块302还可用于:当所述蓝牙盾断开蓝牙通讯连接时,使能所述蓝牙盾的USB接口,以便当所述蓝牙盾通过所述USB接口与外部可通讯设备连接时,响应所述外部可通讯设备的USB连接请求,其中,所述USB连接请求用以请求与所述蓝牙盾建立USB通讯连接,其中,所述外部可通讯设备是指支持USB通讯的设备。Optionally, the security chip module 302 is further configured to: when the Bluetooth shield disconnects the Bluetooth communication connection, enable the USB interface of the Bluetooth shield, so that when the Bluetooth shield passes the USB interface and the external communication device When connected, responding to the USB connection request of the external communicable device, wherein the USB connection request is used to request to establish a USB communication connection with the Bluetooth shield, wherein the external communicable device refers to a device supporting USB communication .
可选的,安全芯片模块302还可用于:当所述蓝牙盾的USB接口在所述蓝牙盾断开蓝牙通讯连接时未与外部可通讯设备连接时,控制所述蓝牙盾进入休眠状态或者控制所述蓝牙盾关机,其中,所述外部可通讯设备是指支持USB通讯的设备。Optionally, the security chip module 302 is further configured to: when the USB interface of the Bluetooth shield is not connected to the external communicable device when the Bluetooth shield disconnects the Bluetooth communication connection, control the Bluetooth shield to enter a sleep state or control The Bluetooth shield is turned off, wherein the external communicable device refers to a device that supports USB communication.
可选的,安全芯片模块302还可用于:当在所述蓝牙盾的休眠状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接时,唤醒所述蓝牙盾;和/或,当在所述蓝牙盾的关机状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接时,控制所述蓝牙盾开机。Optionally, the security chip module 302 is further configured to: when the USB interface of the Bluetooth shield is detected to be connected to an external communicable device, in the sleep state of the Bluetooth shield, wake up the Bluetooth shield; and/or, When the USB interface of the Bluetooth shield is detected to be connected to the external communicable device in the shutdown state of the Bluetooth shield, the Bluetooth shield is controlled to be powered on.
实施例四Embodiment 4
本申请实施例提供一种蓝牙盾,请参阅图4,本申请实施例中的蓝牙盾包括:存储器401,一个或多个处理器402(图4中仅示出一个)及存储在存储器401上并可在处理器上运行的计算机程序。其中:存储器401用于存储软件程序以及模块,处理器402通过运行存储在存储器401的软件程序以及单元,从而执行各种功能应用以及数据处理。具体地,处理器402通过运行存储在存储器401的上述计算机程序时实现以下步骤:The embodiment of the present application provides a Bluetooth shield. Referring to FIG. 4, the Bluetooth shield in the embodiment of the present application includes: a memory 401, one or more processors 402 (only one is shown in FIG. 4), and stored in the memory 401. A computer program that can be run on a processor. Wherein: the memory 401 is used to store software programs and modules, and the processor 402 executes various functional applications and data processing by running software programs and units stored in the memory 401. Specifically, the processor 402 implements the following steps by running the above computer program stored in the memory 401:
当蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,其中,所述蓝牙连接消息与建立蓝牙通讯连接相关;Obtaining an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection;
当监听到所述蓝牙连接消息的获取事件时,控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述相应设备为所述蓝牙连接消息的发送设备;When the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, where the corresponding device is a sending device of the Bluetooth connection message;
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
假设上述为第一种可能的实施方式,则在第一种可能的实施方式作为基础而提供的第二种可能的实施方式中,所述若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态具体为:It is assumed that the foregoing is a first possible implementation manner, and in a second possible implementation manner provided by the first possible implementation manner, the Bluetooth shield is based on the Bluetooth connection message and the corresponding device. Successfully establishing a Bluetooth communication connection, disconnecting the USB communication connection of the Bluetooth shield, and controlling the Bluetooth shield to enter the Bluetooth communication connection state is specifically:
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield does not currently process the APDU command through the USB interface, disconnect the USB communication connection of the Bluetooth shield, and control the The Bluetooth shield enters the Bluetooth communication connection state.
在上述第二种可能的实施方式作为基础而提供的第三种可能的实施方式中,在控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接之后,处理器402通过运行存储在存储器401的上述计算机程序时还实现以下步骤:In a third possible implementation manner provided by the foregoing second possible implementation manner, after controlling the Bluetooth shield to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, the processor 402 runs the storage. The following steps are also implemented in the above computer program of the memory 401:
若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前正在通过USB接口处理APDU命令,则:If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield is currently processing an APDU command through the USB interface, then:
断开所述蓝牙通讯连接,Disconnect the Bluetooth communication connection,
或者,or,
等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。After waiting for the Bluetooth shield to process the APDU command, disconnect the USB communication connection of the Bluetooth shield and control the Bluetooth shield to enter the Bluetooth communication connection state.
在上述第一种可能的实现方式、或者上述第二种可能的实现方式、或者上述第三种可能的实现方式作为基础而提供的第四种可能的实施方式中,处理器402通过运行存储在存储器401的上述计算机程序时还实现以下步骤:In a fourth possible implementation manner provided by the foregoing first possible implementation manner, or the foregoing second possible implementation manner, or the foregoing third possible implementation manner, the processor 402 is stored by running The above computer program of the memory 401 also implements the following steps:
当所述蓝牙盾断开蓝牙通讯连接时,使能所述蓝牙盾的USB接口,以便当所述蓝牙盾通过所述USB接口与外部可通讯设备连接时,响应所述外部可通讯设备的USB连接请求,其中,所述USB连接请求用以请求与所述蓝牙盾建立USB通讯连接,其中,所述外部可通讯设备是指支持USB通讯的设备。When the Bluetooth shield disconnects the Bluetooth communication connection, enabling the USB interface of the Bluetooth shield to respond to the USB of the external communicable device when the Bluetooth shield is connected to the external communicable device through the USB interface a connection request, wherein the USB connection request is used to request to establish a USB communication connection with the Bluetooth shield, wherein the external communicable device refers to a device that supports USB communication.
在上述第一种可能的实现方式、或者上述第二种可能的实现方式、或者上述第三种可能的实现方式作为基础而提供的第五种可能的实施方式中,处理器402通过运行存储在存储器401的上述计算机程序时还实现以下步骤:In a fifth possible implementation manner provided by the foregoing first possible implementation manner, or the foregoing second possible implementation manner, or the foregoing third possible implementation manner, the processor 402 is stored by running The above computer program of the memory 401 also implements the following steps:
若所述蓝牙盾的USB接口在所述蓝牙盾断开蓝牙通讯连接时未与外部可通讯设备连接,则控制所述蓝牙盾进入休眠状态或者控制所述蓝牙盾关机,其中,所述外部可通讯设备是指支持USB通讯的设备。If the USB interface of the Bluetooth shield is not connected to the external communicable device when the Bluetooth shield disconnects the Bluetooth communication connection, the Bluetooth shield is controlled to enter a sleep state or the Bluetooth shield is controlled to be shut down, wherein the external A communication device is a device that supports USB communication.
在上述第一种可能的实现方式、或者上述第二种可能的实现方式、或者上述第三种可能的实现方式作为基础而提供的第六种可能的实施方式中,处理器402通过运行存储在存储器401的上述计算机程序时还实现以下步骤:In a sixth possible implementation manner provided by the foregoing first possible implementation manner, or the foregoing second possible implementation manner, or the foregoing third possible implementation manner, the processor 402 is stored by running The above computer program of the memory 401 also implements the following steps:
若在所述蓝牙盾的休眠状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接,则唤醒所述蓝牙盾;If the Bluetooth interface of the Bluetooth shield is detected to be connected to an external communicable device in the sleep state of the Bluetooth shield, the Bluetooth shield is woken up;
和/或,and / or,
若在所述蓝牙盾的关机状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接,则控制所述蓝牙盾开机。If the USB interface of the Bluetooth shield is detected to be connected to the external communicable device in the shutdown state of the Bluetooth shield, the Bluetooth shield is controlled to be powered on.
进一步,如图4所示,上述蓝牙盾还可包括:一个或多个输入设备403(图4中仅示出一个)和一个或多个输出设备404(图4中仅示出一个)。存储器401、处理器402、输入设备403和输出设备404通过总线405连接。Further, as shown in FIG. 4, the Bluetooth shield described above may further include one or more input devices 403 (only one shown in FIG. 4) and one or more output devices 404 (only one shown in FIG. 4). The memory 401, the processor 402, the input device 403, and the output device 404 are connected by a bus 405.
应当理解,在本申请实施例中,所称处理器402可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in the embodiment of the present application, the so-called processor 402 may be a central processing unit (Central) Processing Unit (CPU), which can also be other general-purpose processors, digital signal processors (DSPs), and application specific integrated circuits (Application). Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
输入设备403可以包括USB接口、蓝牙芯片、键盘、触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出设备404可以包括显示器、扬声器等。The input device 403 may include a USB interface, a Bluetooth chip, a keyboard, a touchpad, a fingerprint sensor (for collecting fingerprint information of the user and direction information of the fingerprint), a microphone, and the like, and the output device 404 may include a display, a speaker, and the like.
存储器404可以包括只读存储器和随机存取存储器,并向处理器401 提供指令和数据。存储器 404的一部分或全部还可以包括非易失性随机存取存储器。例如,存储器404还可以存储设备类型的信息。Memory 404 can include read only memory and random access memory and provides instructions and data to processor 401. Some or all of memory 404 may also include non-volatile random access memory. For example, the memory 404 can also store information of the device type.
由上可见,本申请实施例中,当蓝牙盾处于USB通讯连接状态时监听蓝牙连接消息的获取事件,当监听到蓝牙连接消息的获取事件时,控制该蓝牙盾与相应设备建立蓝牙通讯连接,并在成功建立蓝牙通讯连接时断开该蓝牙盾的USB通讯连接,并控制该蓝牙盾进入蓝牙通讯连接状态,从而使得该蓝牙盾从USB通讯连接自动切换到蓝牙通讯连接。由于上述切换的过程无需人为参与,因此有效简化了蓝牙盾从USB通讯连接状态切换为蓝牙通讯连接状态的操作过程。另外,在蓝牙盾与相应设备成功建立蓝牙通讯连接时才断开该蓝牙盾的USB通讯连接,从而可以确保蓝牙盾通讯连接状态的有效切换。It can be seen that, in the embodiment of the present application, when the Bluetooth shield is in the USB communication connection state, the acquisition event of the Bluetooth connection message is monitored, and when the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device. And when the Bluetooth communication connection is successfully established, the USB communication connection of the Bluetooth shield is disconnected, and the Bluetooth shield is controlled to enter the Bluetooth communication connection state, so that the Bluetooth shield automatically switches from the USB communication connection to the Bluetooth communication connection. Since the above switching process does not require human intervention, the operation process of the Bluetooth shield switching from the USB communication connection state to the Bluetooth communication connection state is effectively simplified. In addition, the USB communication connection of the Bluetooth shield is disconnected when the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device, thereby ensuring effective switching of the Bluetooth shield communication connection state.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将上述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be apparent to those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units as needed. The module is completed by dividing the internal structure of the above device into different functional units or modules to perform all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be hardware. Formal implementation can also be implemented in the form of software functional units. In addition, the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application. For the specific working process of the unit and the module in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed or described in a certain embodiment can be referred to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,上述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the system embodiments described above are merely illustrative. For example, the division of the above modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,上述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读存储介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括是电载波信号和电信信号。The above-described integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the above embodiments, and may also be completed by a computer program to instruct related hardware. The computer program may be stored in a computer readable storage medium. The steps of the various method embodiments described above may be implemented when executed by a processor. Wherein, the above computer program comprises computer program code, and the computer program code may be in the form of source code, object code form, executable file or some intermediate form. The above computer readable storage medium may include any entity or device capable of carrying the above computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read-Only). Memory), random access memory (RAM, Random) Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the above computer readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable storage The medium does not include electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使对应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing embodiments. The technical solutions described in the examples are modified or equivalently replaced with some of the technical features; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in Within the scope of protection of this application.

Claims (11)

  1. 一种应用于蓝牙盾的通讯处理方法,其特征在于,包括:A communication processing method applied to a Bluetooth shield, characterized in that it comprises:
    当蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关;Obtaining an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection with the Bluetooth shield;
    当监听到所述蓝牙连接消息的获取事件时,控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述相应设备为所述蓝牙连接消息的发送设备;When the acquisition event of the Bluetooth connection message is monitored, the Bluetooth shield is controlled to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, where the corresponding device is a sending device of the Bluetooth connection message;
    若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
  2. 根据权利要求1所述的通讯处理方法,其特征在于,所述若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态具体为:The communication processing method according to claim 1, wherein if the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, disconnecting the USB communication connection of the Bluetooth shield, and Controlling the Bluetooth Shield to enter the Bluetooth communication connection state is specifically:
    若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield does not currently process the APDU command through the USB interface, disconnect the USB communication connection of the Bluetooth shield, and control the The Bluetooth shield enters the Bluetooth communication connection state.
  3. 根据权利要求2所述的通讯处理方法,其特征在于,所述控制所述蓝牙盾基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接之后,还包括:The communication processing method according to claim 2, wherein the controlling the Bluetooth shield to establish a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message further comprises:
    若所述蓝牙盾基于所述蓝牙连接消息与相应设备成功建立蓝牙通讯连接,且所述蓝牙盾当前正在通过USB接口处理APDU命令,则:If the Bluetooth shield successfully establishes a Bluetooth communication connection with the corresponding device based on the Bluetooth connection message, and the Bluetooth shield is currently processing an APDU command through the USB interface, then:
    断开所述蓝牙通讯连接,Disconnect the Bluetooth communication connection,
    或者,or,
    等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。After waiting for the Bluetooth shield to process the APDU command, disconnect the USB communication connection of the Bluetooth shield and control the Bluetooth shield to enter the Bluetooth communication connection state.
  4. 根据权利要求1至3任一项所述的通讯处理方法,其特征在于,所述通讯处理方法还包括:The communication processing method according to any one of claims 1 to 3, wherein the communication processing method further comprises:
    当所述蓝牙盾断开蓝牙通讯连接时,使能所述蓝牙盾的USB接口,以便当所述蓝牙盾通过所述USB接口与外部可通讯设备连接时,响应所述外部可通讯设备的USB连接请求,其中,所述USB连接请求用以请求与所述蓝牙盾建立USB通讯连接,其中,所述外部可通讯设备是指支持USB通讯的设备。When the Bluetooth shield disconnects the Bluetooth communication connection, enabling the USB interface of the Bluetooth shield to respond to the USB of the external communicable device when the Bluetooth shield is connected to the external communicable device through the USB interface a connection request, wherein the USB connection request is used to request to establish a USB communication connection with the Bluetooth shield, wherein the external communicable device refers to a device that supports USB communication.
  5. 根据权利要求1至3任一项所述的通讯处理方法,其特征在于,所述通讯处理方法还包括:The communication processing method according to any one of claims 1 to 3, wherein the communication processing method further comprises:
    若所述蓝牙盾的USB接口在所述蓝牙盾断开蓝牙通讯连接时未与外部可通讯设备连接,则控制所述蓝牙盾进入休眠状态或者控制所述蓝牙盾关机,其中,所述外部可通讯设备是指支持USB通讯的设备。If the USB interface of the Bluetooth shield is not connected to the external communicable device when the Bluetooth shield disconnects the Bluetooth communication connection, the Bluetooth shield is controlled to enter a sleep state or the Bluetooth shield is controlled to be shut down, wherein the external A communication device is a device that supports USB communication.
  6. 根据权利要求1至3任一项所述的通讯处理方法,其特征在于,所述通讯方法还包括:The communication processing method according to any one of claims 1 to 3, wherein the communication method further comprises:
    若在所述蓝牙盾的休眠状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接,则唤醒所述蓝牙盾;If the Bluetooth interface of the Bluetooth shield is detected to be connected to an external communicable device in the sleep state of the Bluetooth shield, the Bluetooth shield is woken up;
    和/或,and / or,
    若在所述蓝牙盾的关机状态下,检测到所述蓝牙盾的USB接口与外部可通讯设备连接,则控制所述蓝牙盾开机。If the USB interface of the Bluetooth shield is detected to be connected to the external communicable device in the shutdown state of the Bluetooth shield, the Bluetooth shield is controlled to be powered on.
  7. 一种蓝牙盾,其特征在于,包括:A Bluetooth shield, characterized in that it comprises:
    蓝牙芯片模块和安全芯片模块;Bluetooth chip module and security chip module;
    所述蓝牙芯片模块用于在蓝牙盾处于USB通讯连接状态时,监听蓝牙连接消息的获取事件,并在监听到所述蓝牙连接消息的获取事件时基于所述蓝牙连接消息与相应设备建立蓝牙通讯连接,其中,所述蓝牙连接消息与所述蓝牙盾建立蓝牙通讯连接相关,所述相应设备为所述蓝牙连接消息的发送设备;The Bluetooth chip module is configured to monitor an acquisition event of a Bluetooth connection message when the Bluetooth shield is in a USB communication connection state, and establish a Bluetooth communication with the corresponding device based on the Bluetooth connection message when listening to the acquisition event of the Bluetooth connection message. Connecting, wherein the Bluetooth connection message is related to establishing a Bluetooth communication connection by the Bluetooth shield, and the corresponding device is a sending device of the Bluetooth connection message;
    所述蓝牙芯片模块还用于:当所述蓝牙芯片模块与所述相应设备成功建立蓝牙通讯连接时,向所述安全芯片发送通知消息,其中,所述通知消息用以通知所述安全芯片模块蓝牙通讯连接成功;The Bluetooth chip module is further configured to: when the Bluetooth chip module successfully establishes a Bluetooth communication connection with the corresponding device, send a notification message to the security chip, where the notification message is used to notify the security chip module Bluetooth communication connection is successful;
    所述安全芯片模块用于:在接收到所述通知消息时,断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。The security chip module is configured to: when receiving the notification message, disconnect the USB communication connection of the Bluetooth shield, and control the Bluetooth shield to enter a Bluetooth communication connection state.
  8. 根据权利要求7所述的蓝牙盾,其特征在于,The Bluetooth shield of claim 7 wherein:
    所述安全芯片模块具体用于:在接收到所述通知消息时,判断所述蓝牙盾当前是否通过USB接口处理APDU命令;若判定所述蓝牙盾当前未通过USB接口处理APDU命令,则断开所述蓝牙盾的USB通讯连接,并控制所述蓝牙盾进入蓝牙通讯连接状态。The security chip module is specifically configured to: when receiving the notification message, determine whether the Bluetooth shield currently processes an APDU command through a USB interface; if it is determined that the Bluetooth shield does not currently process an APDU command through a USB interface, disconnecting The Bluetooth communication of the Bluetooth shield is connected, and the Bluetooth shield is controlled to enter a Bluetooth communication connection state.
  9. 根据权利要求8所述的蓝牙盾,其特征在于,所述安全芯片模块还用于:在判断所述蓝牙盾当前是否通过USB接口处理APDU命令之后,若判定所述蓝牙盾当前正通过USB接口处理APDU命令,则:触发所述蓝牙芯片模块断开所述蓝牙通讯连接,或者,等待所述蓝牙盾处理完所述APDU命令后,断开所述蓝牙盾的USB通讯连接并控制所述蓝牙盾进入蓝牙通讯连接状态。The Bluetooth shield of claim 8, wherein the security chip module is further configured to: after determining whether the Bluetooth shield currently processes the APDU command through the USB interface, if it is determined that the Bluetooth shield is currently passing through the USB interface Processing the APDU command, triggering the Bluetooth chip module to disconnect the Bluetooth communication connection, or waiting for the Bluetooth shield to process the APDU command, disconnecting the USB communication connection of the Bluetooth shield and controlling the Bluetooth The shield enters the Bluetooth communication connection state.
  10. 一种蓝牙盾,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下如权利要求1至6任一项所述方法的步骤。A Bluetooth shield comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program to implement any of the following claims 1 to 6 The steps of the method described.
  11. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述方法的步骤。A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to perform the steps of the method of any one of claims 1 to 6.
PCT/CN2018/098065 2017-10-30 2018-08-01 Communication processing method applied to bluetooth shield and bluetooth shield WO2019085560A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711033521.7 2017-10-30
CN201711033521.7A CN107835507B (en) 2017-10-30 2017-10-30 Communication processing method applied to Bluetooth shield and Bluetooth shield

Publications (1)

Publication Number Publication Date
WO2019085560A1 true WO2019085560A1 (en) 2019-05-09

Family

ID=61650832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/098065 WO2019085560A1 (en) 2017-10-30 2018-08-01 Communication processing method applied to bluetooth shield and bluetooth shield

Country Status (2)

Country Link
CN (1) CN107835507B (en)
WO (1) WO2019085560A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107835507B (en) * 2017-10-30 2020-02-21 北京明华联盟科技有限公司 Communication processing method applied to Bluetooth shield and Bluetooth shield

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203502964U (en) * 2013-08-27 2014-03-26 江艳玲 Bluetooth USB (Universal Serial Bus) key capable of being connected with mobile phone
CN103702323A (en) * 2013-12-19 2014-04-02 北京深思数盾科技有限公司 Wireless information security equipment system and method
CN105700983A (en) * 2014-11-26 2016-06-22 北京握奇智能科技有限公司 USBKey and USBKey working mode judgment method
CN107835507A (en) * 2017-10-30 2018-03-23 北京明华联盟科技有限公司 Communication processing method and bluetooth shield applied to bluetooth shield

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017051429A1 (en) * 2015-09-22 2017-03-30 Smartron India Private Limited System and method for switching communication protocol between two devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203502964U (en) * 2013-08-27 2014-03-26 江艳玲 Bluetooth USB (Universal Serial Bus) key capable of being connected with mobile phone
CN103702323A (en) * 2013-12-19 2014-04-02 北京深思数盾科技有限公司 Wireless information security equipment system and method
CN105700983A (en) * 2014-11-26 2016-06-22 北京握奇智能科技有限公司 USBKey and USBKey working mode judgment method
CN107835507A (en) * 2017-10-30 2018-03-23 北京明华联盟科技有限公司 Communication processing method and bluetooth shield applied to bluetooth shield

Also Published As

Publication number Publication date
CN107835507A (en) 2018-03-23
CN107835507B (en) 2020-02-21

Similar Documents

Publication Publication Date Title
US11467646B2 (en) Context data sharing
EP3468068B1 (en) Method for establishing classic bluetooth connection between dual-mode bluetooth devices, and dual-mode bluetooth device
KR101854929B1 (en) Dynamic configuration of connectors for system level communications
US8255595B2 (en) Enabling access to peripheral resources at a processor
CN110352530A (en) Method and apparatus for managing the battery of electronic equipment
CN110188564B (en) Mobile data storage terminal based on quantum key encryption
WO2012155620A1 (en) Method and mobile communication terminal for protecting near field communication security
CN112580051A (en) Starting-up control method and device
WO2015085501A1 (en) Screen control method, screen control device and touch control terminal
CN107423064B (en) Message processing method and device, terminal equipment and storage medium
CN106228073A (en) Intelligent mobile storage device and the method carrying out data access
CN112955879A (en) Electronic device and method for transceiving control signal
WO2019085761A1 (en) Fingerprint recognition method and terminal device
US11199893B2 (en) Method, device for processing data of bluetooth speaker, and bluetooth speaker
WO2008043270A1 (en) Remote wake -up system, wwan module and terminal
US20210034132A1 (en) Systems And Methods For Waking An Information Handling System From A Wireless Peripheral Device
WO2019085560A1 (en) Communication processing method applied to bluetooth shield and bluetooth shield
US20180342247A1 (en) Audio input activation based on thermal data detection
WO2022002236A1 (en) Data transmission method, multifunction card and electronic device
CN112085872A (en) NFC-based unlocking method, related device and system
CN111538391A (en) Temperature control method and device, storage medium and terminal
EP3680783A1 (en) Electronic apparatus and method and device for reducing power consumption
CN211630171U (en) Hard implementation equipment for SM4 encryption algorithm
CN103020509B (en) A kind of terminal device encryption and decryption method, device and terminal device
WO2017166633A1 (en) Data transmission method, electrical device and data cable

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

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

Country of ref document: EP

Kind code of ref document: A1