[go: up one dir, main page]

CN111800774A - Bluetooth device control method and device and storage medium - Google Patents

Bluetooth device control method and device and storage medium Download PDF

Info

Publication number
CN111800774A
CN111800774A CN202010632579.9A CN202010632579A CN111800774A CN 111800774 A CN111800774 A CN 111800774A CN 202010632579 A CN202010632579 A CN 202010632579A CN 111800774 A CN111800774 A CN 111800774A
Authority
CN
China
Prior art keywords
bluetooth
target
application program
program interface
instruction
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202010632579.9A
Other languages
Chinese (zh)
Inventor
李佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Second Picket Network Technology Co ltd
Original Assignee
Shanghai Fengzhi Technology Co ltd
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 Shanghai Fengzhi Technology Co ltd filed Critical Shanghai Fengzhi Technology Co ltd
Priority to CN202010632579.9A priority Critical patent/CN111800774A/en
Publication of CN111800774A publication Critical patent/CN111800774A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

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

Abstract

The invention discloses a control method and a control device of Bluetooth equipment and a storage medium. Wherein, the method comprises the following steps: triggering a Bluetooth control instruction in a target webpage displayed by a browser running on target equipment; responding to the Bluetooth control instruction, and calling a first application program interface used for connecting Bluetooth equipment in a control program of a target webpage; establishing communication connection between the target equipment and the Bluetooth equipment through a first application program interface; and sending a control instruction to the Bluetooth device based on the communication connection, wherein the control instruction is used for controlling the Bluetooth device to execute the operation. The invention solves the technical problem of poor control compatibility of the Bluetooth equipment.

Description

蓝牙设备的控制方法和装置及存储介质Bluetooth device control method and device and storage medium

技术领域technical field

本发明涉及计算机领域,具体而言,涉及一种蓝牙设备的控制方法和装置及存储介质。The present invention relates to the field of computers, and in particular, to a control method and device of a Bluetooth device and a storage medium.

背景技术Background technique

目前世面上手机与蓝牙设备交互基本都是基于Android或IOS系统原生应用实现,具体的,手机与蓝牙设备通信方式均为直连式的,但这样的连接方式的弊端非常明显,如果控制逻辑发生改变,则两种操作系统对应的APP均需要对应开发,提升了维护成本,不利于维护升级。因此,存在蓝牙设备的控制兼容性较差的问题。At present, the interaction between mobile phones and Bluetooth devices in the world is basically based on the native application of Android or IOS system. Specifically, the communication methods between mobile phones and Bluetooth devices are all directly connected, but the disadvantages of this connection method are very obvious. If the control logic occurs If it is changed, the APPs corresponding to the two operating systems need to be developed accordingly, which increases maintenance costs and is not conducive to maintenance and upgrades. Therefore, there is a problem that the control compatibility of the Bluetooth device is poor.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种蓝牙设备的控制方法和装置及存储介质,以至少解决蓝牙设备的控制兼容性差的技术问题。Embodiments of the present invention provide a method and device for controlling a Bluetooth device, and a storage medium, so as to at least solve the technical problem of poor control compatibility of the Bluetooth device.

根据本发明实施例的一个方面,提供了一种蓝牙设备的控制方法,包括:在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应上述蓝牙控制指令,调用上述目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过上述第一应用程序接口,建立上述目标设备与上述蓝牙设备之间的通信连接;基于上述通信连接向上述蓝牙设备发送控制指令,其中,上述控制指令用于控制上述蓝牙设备执行操作。According to an aspect of the embodiments of the present invention, a method for controlling a Bluetooth device is provided, including: triggering a Bluetooth control instruction in a target web page displayed by a browser running on the target device; in response to the Bluetooth control instruction, calling the target web page The first application program interface for connecting the Bluetooth device in the control program of Wherein, the above-mentioned control instruction is used to control the above-mentioned Bluetooth device to perform an operation.

作为一种可选的方案,在上述调用用于与蓝牙设备建立连接的第一应用程序接口之前,包括:将第二应用程序接口封装成上述第一应用程序接口,其中,上述第二应用程序接口为上述目标设备的控制程序中调用的程序接口,上述第二应用程序接口用于与上述蓝牙设备建立连接。As an optional solution, before invoking the first application program interface for establishing a connection with the Bluetooth device, the method includes: encapsulating the second application program interface into the first application program interface, wherein the second application program interface The interface is a program interface called in the control program of the target device, and the second application program interface is used to establish a connection with the Bluetooth device.

作为一种可选的方案,上述通过上述第一应用程序接口,建立上述目标设备与上述蓝牙设备之间的通信连接包括:获取上述目标网页上检测到的建立指令,其中,上述建立指令用于建立上述目标设备中的蓝牙适配器与上述蓝牙设备之间的通信连接。As an optional solution, the above-mentioned establishing a communication connection between the above-mentioned target device and the above-mentioned Bluetooth device through the above-mentioned first application program interface includes: obtaining the establishment instruction detected on the above-mentioned target webpage, wherein the above-mentioned establishment instruction is used for Establish a communication connection between the Bluetooth adapter in the target device and the Bluetooth device.

作为一种可选的方案,上述通过上述第一应用程序接口,建立上述目标设备与上述蓝牙设备之间的通信连接包括以下至少之一:获取上述目标网页上检测到的开启指令,其中,上述开启指令用于指示开启上述蓝牙适配器;获取上述目标网页上检测到的扫描指令,其中,上述扫描指令用于指示上述蓝牙适配器扫描上述目标设备范围内的上述蓝牙设备;获取上述目标网页上检测到的连接指令,其中,上述连接指令用于指示上述蓝牙适配器与目标蓝牙设备建立通信连接,其中,上述蓝牙设备包括上述目标蓝牙设备。As an optional solution, establishing a communication connection between the target device and the Bluetooth device through the first application program interface includes at least one of the following: acquiring an opening instruction detected on the target webpage, wherein the above The opening instruction is used to instruct to open the above-mentioned Bluetooth adapter; obtain the scanning instruction detected on the above-mentioned target webpage, wherein the above-mentioned scanning instruction is used to instruct the above-mentioned bluetooth adapter to scan the above-mentioned bluetooth device within the range of the above-mentioned target device; obtain the detection on the above-mentioned target webpage. The connection instruction, wherein the connection instruction is used to instruct the Bluetooth adapter to establish a communication connection with the target Bluetooth device, wherein the Bluetooth device includes the target Bluetooth device.

作为一种可选的方案,在上述获取上述目标网页上检测到的连接指令之后,包括:在上述蓝牙适配器与上述目标蓝牙设备建立连接的情况下,获取上述目标蓝牙设备的状态值;在上述状态值指示上述目标蓝牙设备已开启的情况下,向上述目标蓝牙设备写入数据。As an optional solution, after obtaining the connection instruction detected on the target webpage, the method includes: when the Bluetooth adapter establishes a connection with the target Bluetooth device, obtaining the status value of the target Bluetooth device; When the status value indicates that the target Bluetooth device is turned on, data is written to the target Bluetooth device.

作为一种可选的方案,在上述获取上述目标网页上检测到的连接指令之后,包括:获取上述目标网页上检测到的断开指令,其中,上述断开指令用于指示断开上述蓝牙适配器与上述目标蓝牙设备的通信连接。As an optional solution, after obtaining the connection instruction detected on the target webpage, the method includes: obtaining the disconnection instruction detected on the target webpage, wherein the disconnection instruction is used to instruct disconnection of the Bluetooth adapter A communication connection with the above target Bluetooth device.

根据本发明实施例的另一方面,还提供了一种蓝牙设备的控制装置,包括:触发单元,用于在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应单元,用于响应上述蓝牙控制指令,调用上述目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;建立单元,用于通过上述第一应用程序接口,建立上述目标设备与上述蓝牙设备之间的通信连接;发送单元,用于基于上述通信连接向上述蓝牙设备发送控制指令,其中,上述控制指令用于控制上述蓝牙设备执行操作。According to another aspect of the embodiments of the present invention, a control device for a Bluetooth device is further provided, including: a triggering unit for triggering a Bluetooth control instruction in a target web page displayed by a browser running on the target device; a response unit, In response to the above-mentioned bluetooth control instruction, call the first application program interface used to connect the bluetooth device in the control program of the above-mentioned target webpage; the establishment unit is used to establish the connection between the above-mentioned target device and the above-mentioned bluetooth device through the above-mentioned first application program interface. The sending unit is configured to send a control instruction to the above-mentioned Bluetooth device based on the above-mentioned communication connection, wherein the above-mentioned control instruction is used to control the above-mentioned Bluetooth device to perform an operation.

作为一种可选的方案,包括:封装单元,用于在上述调用用于与蓝牙设备建立连接的第一应用程序接口之前,将第二应用程序接口封装成上述第一应用程序接口,其中,上述第二应用程序接口为上述目标设备的控制程序中调用的程序接口,上述第二应用程序接口用于与上述蓝牙设备建立连接。As an optional solution, it includes: an encapsulation unit, configured to encapsulate the second application program interface into the above-mentioned first application program interface before calling the first application program interface for establishing a connection with the Bluetooth device, wherein, The above-mentioned second application program interface is a program interface called in the control program of the above-mentioned target device, and the above-mentioned second application program interface is used to establish a connection with the above-mentioned Bluetooth device.

作为一种可选的方案,上述建立单元包括:第一获取模块,用于获取上述目标网页上检测到的建立指令,其中,上述建立指令用于建立上述目标设备中的蓝牙适配器与上述蓝牙设备之间的通信连接。As an optional solution, the establishment unit includes: a first acquisition module, configured to obtain the establishment instruction detected on the target webpage, wherein the establishment instruction is used to establish the Bluetooth adapter in the target device and the Bluetooth device. communication connection between.

作为一种可选的方案,上述建立单元包括以下至少之一:第二获取模块,用于获取上述目标网页上检测到的开启指令,其中,上述开启指令用于指示开启上述蓝牙适配器;第三获取模块,用于获取上述目标网页上检测到的扫描指令,其中,上述扫描指令用于指示上述蓝牙适配器扫描上述目标设备范围内的上述蓝牙设备;第四获取模块,用于获取上述目标网页上检测到的连接指令,其中,上述连接指令用于指示上述蓝牙适配器与目标蓝牙设备建立通信连接,其中,上述蓝牙设备包括上述目标蓝牙设备。As an optional solution, the establishment unit includes at least one of the following: a second acquisition module, configured to acquire an opening instruction detected on the target webpage, wherein the opening instruction is used to instruct to open the Bluetooth adapter; a third an acquisition module, used to acquire the scan instruction detected on the target webpage, wherein the scan instruction is used to instruct the Bluetooth adapter to scan the above-mentioned Bluetooth device within the range of the above-mentioned target device; the fourth acquisition module is used to acquire the above-mentioned target webpage. The detected connection instruction, wherein the connection instruction is used to instruct the Bluetooth adapter to establish a communication connection with a target Bluetooth device, wherein the Bluetooth device includes the target Bluetooth device.

作为一种可选的方案,包括:第五获取模块,用于在上述获取上述目标网页上检测到的连接指令之后,在上述蓝牙适配器与上述目标蓝牙设备建立连接的情况下,获取上述目标蓝牙设备的状态值;写入模块,用于在上述获取上述目标网页上检测到的连接指令之后,在上述状态值指示上述目标蓝牙设备已开启的情况下,向上述目标蓝牙设备写入数据。As an optional solution, it includes: a fifth obtaining module, configured to obtain the target Bluetooth when the Bluetooth adapter establishes a connection with the target Bluetooth device after obtaining the connection instruction detected on the target webpage. The state value of the device; the writing module is used to write data to the target Bluetooth device when the state value indicates that the target Bluetooth device is turned on after obtaining the connection instruction detected on the target webpage.

作为一种可选的方案,包括:第六获取模块,用于在上述获取上述目标网页上检测到的连接指令之后,获取上述目标网页上检测到的断开指令,其中,上述断开指令用于指示断开上述蓝牙适配器与上述目标蓝牙设备的通信连接。As an optional solution, it includes: a sixth obtaining module, configured to obtain the disconnection instruction detected on the target webpage after obtaining the connection instruction detected on the target webpage, wherein the disconnection instruction uses instructing to disconnect the communication connection between the Bluetooth adapter and the target Bluetooth device.

根据本发明实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述蓝牙设备的控制方法。According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the above-mentioned Bluetooth device when running. Control Method.

根据本发明实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的蓝牙设备的控制方法。According to another aspect of the embodiments of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the above-mentioned computer program through the computer program Control method of bluetooth device.

在本发明实施例中,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应上述蓝牙控制指令,调用上述目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过上述第一应用程序接口,建立上述目标设备与上述蓝牙设备之间的通信连接;基于上述通信连接向上述蓝牙设备发送控制指令,其中,上述控制指令用于控制上述蓝牙设备执行操作,通过中间件“目标网页”,将目标设备与蓝牙设备的连接转化为基于目标网页的间接连接,那么即使在目标设备原生系统(IOS/安卓)的控制蓝牙逻辑发生改变的情况下,也并不影响目标设备根据目标网页的控制逻辑去实现蓝牙设备的控制逻辑,进而达到了降低目标设备原生系统对蓝牙设备的控制影响力的技术目的,从而实现了提高蓝牙设备的控制兼容性的技术效果,进而解决了蓝牙设备的控制兼容性差的技术问题。In the embodiment of the present invention, a bluetooth control instruction is triggered in the target webpage displayed by the browser running on the target device; in response to the above-mentioned bluetooth control instruction, the first application program for connecting the bluetooth device in the control program of the above-mentioned target webpage is called interface; establish a communication connection between the target device and the Bluetooth device through the first application program interface; send a control command to the Bluetooth device based on the communication connection, wherein the control command is used to control the Bluetooth device to perform operations, Through the middleware "target web page", the connection between the target device and the Bluetooth device is converted into an indirect connection based on the target web page, so even if the control Bluetooth logic of the target device's native system (IOS/Android) changes, it is not Influence the target device to realize the control logic of the Bluetooth device according to the control logic of the target web page, thereby achieving the technical purpose of reducing the control influence of the native system of the target device on the Bluetooth device, thereby achieving the technical effect of improving the control compatibility of the Bluetooth device, Further, the technical problem of poor control compatibility of the Bluetooth device is solved.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:

图1是根据本发明实施例的一种可选的蓝牙设备的控制方法的应用环境的示意图;1 is a schematic diagram of an application environment of an optional control method for a Bluetooth device according to an embodiment of the present invention;

图2是根据本发明实施例的一种可选的蓝牙设备的控制方法的流程图的示意图;2 is a schematic diagram of a flowchart of an optional control method for a Bluetooth device according to an embodiment of the present invention;

图3是根据本发明实施例的一种可选的蓝牙设备的控制方法的示意图;3 is a schematic diagram of an optional control method of a Bluetooth device according to an embodiment of the present invention;

图4是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;4 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图5是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;5 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图6是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;6 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图7是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;7 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图8是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;8 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图9是根据本发明实施例的另一种可选的蓝牙设备的控制方法的示意图;9 is a schematic diagram of another optional control method of a Bluetooth device according to an embodiment of the present invention;

图10是根据本发明实施例的一种可选的蓝牙设备的控制装置的示意图;10 is a schematic diagram of an optional control apparatus for a Bluetooth device according to an embodiment of the present invention;

图11是根据本发明实施例的一种可选的电子装置的结构示意图。FIG. 11 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

根据本发明实施例的一个方面,提供了一种蓝牙设备的控制方法,可选地,作为一种可选的实施方式,上述蓝牙设备的控制方法可以但不限于应用于如图1所示的环境中。其中,可以但不限于包括用户设备102、网络110及服务器112,其中,该用户设备102上可以但不限于包括显示器108、处理器106及存储器104,显示器108上显示浏览器1022、以及浏览器1022上显示的目标网页1024。According to an aspect of the embodiments of the present invention, a method for controlling a Bluetooth device is provided. Optionally, as an optional implementation manner, the above-mentioned method for controlling a Bluetooth device may be applied to, but not limited to, the method shown in FIG. 1 . Environment. Among them, the user equipment 102, the network 110 and the server 112 may be, but not limited to, the user equipment 102 may but not be limited to include the display 108, the processor 106 and the memory 104, and the display 108 displays the browser 1022 and the browser Landing page 1024 displayed on 1022.

具体过程可如下步骤:步骤S102,用户设备102通过显示器108中浏览器1022上显示的目标网页1024的对应位置,检测出蓝牙控制指令,如图中“开启蓝牙连接”;The specific process can be as follows: step S102, the user equipment 102 detects the Bluetooth control command through the corresponding position of the target webpage 1024 displayed on the browser 1022 in the display 108, as shown in the figure "Turn on the Bluetooth connection";

步骤S104-S106,用户设备102通过网络110将蓝牙控制指令发送给服务器112;Steps S104-S106, the user equipment 102 sends the Bluetooth control instruction to the server 112 through the network 110;

步骤S108,服务器112通过数据库114查找蓝牙控制指令对应的程序,并通过处理引擎116调用第一应用程序接口;Step S108, the server 112 searches the program corresponding to the Bluetooth control instruction through the database 114, and invokes the first application program interface through the processing engine 116;

步骤S110-S112,服务器112通过网络110将第一应用程序接口发送给用户设备102;Steps S110-S112, the server 112 sends the first application program interface to the user equipment 102 through the network 110;

步骤S114,用户设备102中的处理器106通过第一应用程序接口,建立用户设备102与蓝牙设备之间的通信连接,并显示在目标网页1024上。Step S114 , the processor 106 in the user equipment 102 establishes a communication connection between the user equipment 102 and the Bluetooth device through the first application program interface, and displays it on the target webpage 1024 .

可选地,作为一种可选的实施方式,如图2所示,蓝牙设备的控制方法包括:Optionally, as an optional implementation manner, as shown in FIG. 2 , the control method of the Bluetooth device includes:

S202,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;S202, triggering a Bluetooth control instruction in the target webpage displayed by the browser running on the target device;

S204,响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;S204, in response to the bluetooth control instruction, call the first application program interface for connecting the bluetooth device in the control program of the target webpage;

S206,通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;S206, establishing a communication connection between the target device and the Bluetooth device through the first application program interface;

S208,基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。S208: Send a control instruction to the Bluetooth device based on the communication connection, where the control instruction is used to control the Bluetooth device to perform an operation.

可选的,在本实施例中,蓝牙设备的控制方法可以但不限于应用在终端设备建立与蓝牙设备的通信连接,并控制蓝牙设备执行进一步的控制指令的场景下。目标设备可以但不限于为智能手机、平板电脑、游戏机等。蓝牙设备可以但不限于为蓝牙耳机、蓝牙音箱、蓝牙遥控车等。浏览器可以但不限于为目标设备自带的浏览器应用程序。目标网页可以但不限于为H5网页。应用程序接口(Application Programing Interface,简称API)可以但不限于预先定义的函数,或为软件系统不同组成部分衔接的约定,用于提供应用成语与开发人员基于某软件或硬件得以访问的一组历程,而无需访问源码,或理解内部工作机制细节。Optionally, in this embodiment, the method for controlling a Bluetooth device may be applied, but not limited to, in a scenario where a terminal device establishes a communication connection with a Bluetooth device and controls the Bluetooth device to execute further control instructions. The target device can be, but is not limited to, a smartphone, a tablet computer, a game console, and the like. The Bluetooth device can be, but is not limited to, a Bluetooth headset, a Bluetooth speaker, a Bluetooth remote control car, and the like. The browser can be, but is not limited to, a browser application that comes with the target device. The landing page can be, but is not limited to, an H5 page. Application Programing Interface (API) can be, but is not limited to, pre-defined functions, or a convention for connecting different components of a software system, and is used to provide application idioms and a set of processes that developers can access based on a certain software or hardware. , without having access to the source code, or understanding the details of the inner workings.

需要说明的是,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。It should be noted that the bluetooth control command is triggered in the target webpage displayed by the browser running on the target device; in response to the bluetooth control command, the first application program interface for connecting the bluetooth device in the control program of the target webpage is called; An application program interface establishes a communication connection between the target device and the Bluetooth device; based on the communication connection, a control instruction is sent to the Bluetooth device, wherein the control instruction is used to control the Bluetooth device to perform operations.

进一步举例说明,可选的例如图3所示,包括目标设备302,以及在目标设备302预设范围内的蓝牙设备304,假设蓝牙设备304的蓝牙连接权限已打开,则可在目标设备302中的浏览器306的目标网页308上的指令触发位置310处,触发蓝牙控制指令,进而建立目标设备302与蓝牙设备304之间的通信连接。For further illustration, an optional example shown in FIG. 3 includes the target device 302 and the Bluetooth device 304 within the preset range of the target device 302 . Assuming that the Bluetooth connection permission of the Bluetooth device 304 is enabled, the target device 302 can The command trigger position 310 on the target webpage 308 of the browser 306 triggers the Bluetooth control command, thereby establishing a communication connection between the target device 302 and the Bluetooth device 304 .

通过本申请提供的实施例,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作,达到了降低目标设备原生系统对蓝牙设备的控制影响力的目的,实现了提高蓝牙设备的控制兼容性的效果。Through the embodiments provided in this application, a Bluetooth control instruction is triggered in a target web page displayed by a browser running on the target device; in response to the Bluetooth control instruction, a first application program interface for connecting a Bluetooth device in a control program of the target web page is invoked ; Establish a communication connection between the target device and the bluetooth device through the first application program interface; send a control command to the bluetooth device based on the communication connection, wherein the control command is used to control the bluetooth device to perform operations, so as to reduce the native system of the target device. The purpose of controlling the influence of the Bluetooth device achieves the effect of improving the control compatibility of the Bluetooth device.

作为一种可选的方案,在调用用于与蓝牙设备建立连接的第一应用程序接口之前,包括:As an optional solution, before invoking the first application program interface for establishing a connection with the Bluetooth device, the method includes:

将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接。The second application program interface is encapsulated into a first application program interface, wherein the second application program interface is a program interface called in the control program of the target device, and the second application program interface is used to establish a connection with the Bluetooth device.

需要说明的是,将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接。可选的,第二应用程序接口可以但不限于为Android与IOS系统原生的蓝牙相关API。第一应用程序接口可以但不限于为Java Script应用程序接口(Java Script API,简称JSAPI)。It should be noted that the second application program interface is encapsulated into the first application program interface, wherein the second application program interface is the program interface called in the control program of the target device, and the second application program interface is used to establish a connection with the Bluetooth device. . Optionally, the second application program interface may be, but not limited to, a native Bluetooth-related API of Android and IOS systems. The first application program interface may be, but is not limited to, a Java Script application program interface (Java Script API, JSAPI for short).

进一步举例说明,可选的例如图4所示,包括目标设备402以及蓝牙设备406,其中,目标设备402通过调用第一应用程序接口404与蓝牙设备406建立连接,并执行进一步的控制指令,具体的,目标设备402中的应用程序控制蓝牙设备406的控制逻辑,需与目标设备402原生系统的控制逻辑一致;For further illustration, optional, such as shown in FIG. 4, includes the target device 402 and the Bluetooth device 406, wherein the target device 402 establishes a connection with the Bluetooth device 406 by calling the first application program interface 404, and executes further control instructions, specifically Yes, the application program in the target device 402 controls the control logic of the Bluetooth device 406, which needs to be consistent with the control logic of the native system of the target device 402;

进一步举例说明,可选的例如图5所示,包括目标设备502、第二应用程序接口504、目标网页506以及蓝牙设备508,其中,目标设备502通过目标网页506调用第二应用程序接口504与蓝牙设备508建立连接,并执行进一步的控制指令,具体的,目标设备502中的应用程序控制蓝牙设备508的控制逻辑,需与控制目标网页506的控制逻辑一致,而与目标设备502原生系统的控制逻辑无关。For further illustration, an optional example shown in FIG. 5 includes a target device 502, a second application program interface 504, a target web page 506, and a Bluetooth device 508, wherein the target device 502 calls the second application program interface 504 through the target web page 506 to communicate with The Bluetooth device 508 establishes a connection and executes further control instructions. Specifically, the control logic of the application program in the target device 502 to control the Bluetooth device 508 needs to be consistent with the control logic of the control target web page 506, and the control logic of the native system of the target device 502. Control logic is irrelevant.

通过本申请提供的实施例,将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接,达到了修改应用程序的控制逻辑依赖源的目的,实现了降低原生系统对蓝牙设备的控制影响的效果。According to the embodiments provided in this application, the second application program interface is encapsulated into the first application program interface, wherein the second application program interface is the program interface called in the control program of the target device, and the second application program interface is used to communicate with Bluetooth The device establishes a connection, which achieves the purpose of modifying the control logic dependence source of the application, and achieves the effect of reducing the control influence of the native system on the Bluetooth device.

作为一种可选的方案,通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接包括:As an optional solution, establishing a communication connection between the target device and the Bluetooth device through the first application program interface includes:

获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接。The establishment instruction detected on the target webpage is acquired, wherein the establishment instruction is used to establish a communication connection between the Bluetooth adapter in the target device and the Bluetooth device.

需要说明的是,获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接。可选的,蓝牙适配器可以但不限于为数码产品使用蓝牙设备的接口转换器,采用全球通用的短距离无线连接技术。It should be noted that the establishment instruction detected on the target webpage is acquired, wherein the establishment instruction is used to establish a communication connection between the Bluetooth adapter in the target device and the Bluetooth device. Optionally, the Bluetooth adapter may, but is not limited to, use an interface converter of a Bluetooth device for digital products, and use a global short-range wireless connection technology.

进一步举例说明,可选的例如图6所示,假设在建立指令触发位置602处检测到触控操作,进而生成建立指令,其中,建立指令用于建立目标设备302中的蓝牙适配器(图中未示出)与蓝牙设备304之间的通信连接。For further illustration, as an optional example shown in FIG. 6 , it is assumed that a touch operation is detected at the trigger position 602 of the establishment instruction, and then an establishment instruction is generated, wherein the establishment instruction is used to establish a Bluetooth adapter (not shown in the figure) in the target device 302 shown) and a communication connection between the Bluetooth device 304.

通过本申请提供的实施例,获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接,达到了通过目标网页实现通信连接的建立的目的,实现了提高通信连接的建立效率的效果。Through the embodiment provided in the present application, the establishment instruction detected on the target webpage is obtained, wherein the establishment instruction is used to establish the communication connection between the Bluetooth adapter in the target device and the Bluetooth device, so as to achieve the establishment of the communication connection through the target webpage The purpose of this is to achieve the effect of improving the establishment efficiency of the communication connection.

作为一种可选的方案,通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接包括以下至少之一:As an optional solution, establishing a communication connection between the target device and the Bluetooth device through the first application program interface includes at least one of the following:

S1,获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;S1, obtaining an opening instruction detected on the target webpage, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter;

S2,获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;S2, acquiring the scan instruction detected on the target webpage, wherein the scan instruction is used to instruct the Bluetooth adapter to scan for Bluetooth devices within the range of the target device;

S3,获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备。S3: Acquire a connection instruction detected on the target webpage, where the connection instruction is used to instruct the Bluetooth adapter to establish a communication connection with the target Bluetooth device, where the Bluetooth device includes the target Bluetooth device.

需要说明的是,获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备。It should be noted that, obtain the opening instruction detected on the target webpage, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter; obtain the scanning instruction detected on the target webpage, wherein the scanning instruction is used to instruct the Bluetooth adapter to scan the range of the target device the bluetooth device; obtain the connection instruction detected on the target webpage, wherein the connection instruction is used to instruct the bluetooth adapter to establish a communication connection with the target bluetooth device, wherein the bluetooth device includes the target bluetooth device.

进一步举例说明,可选的例如图7所示,在目标设备302的蓝牙适配器已开启并扫描中的情况下,在目标网页308上显示蓝牙设备列表702,其中,蓝牙设备列表702中的蓝牙设备为与目标设备302距离满足连接条件的蓝牙设备;进一步,例如连接指令指示连接设备M3,则建立目标设备302与设备M3之间的通信连接。For further illustration, optionally, as shown in FIG. 7 , when the Bluetooth adapter of the target device 302 has been turned on and is being scanned, a Bluetooth device list 702 is displayed on the target web page 308 , wherein the Bluetooth devices in the Bluetooth device list 702 It is a Bluetooth device whose distance from the target device 302 satisfies the connection conditions; further, for example, if the connection instruction instructs the device M3 to be connected, the communication connection between the target device 302 and the device M3 is established.

通过本申请提供的实施例,获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备,达到了灵活选取建立通信连接对象的目的,实现了提高与蓝牙设备建立通信连接的灵活性的效果。Through the embodiments provided in the present application, the opening instruction detected on the target webpage is obtained, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter; the scanning instruction detected on the target webpage is obtained, wherein the scanning instruction is used to instruct the Bluetooth adapter to scan the target A Bluetooth device within the range of the device; obtains the connection command detected on the target webpage, wherein the connection command is used to instruct the Bluetooth adapter to establish a communication connection with the target Bluetooth device, wherein the Bluetooth device includes the target Bluetooth device, which achieves flexible selection and establishment of communication connection The purpose of the object is to achieve the effect of improving the flexibility of establishing a communication connection with a Bluetooth device.

作为一种可选的方案,在获取目标网页上检测到的连接指令之后,包括:As an optional solution, after obtaining the connection instruction detected on the target webpage, include:

S1,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;S1, in the case of establishing a connection between the Bluetooth adapter and the target Bluetooth device, obtain the status value of the target Bluetooth device;

S2,在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据。S2, in the case that the state value indicates that the target Bluetooth device is turned on, write data to the target Bluetooth device.

需要说明的是,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据。It should be noted that when the Bluetooth adapter establishes a connection with the target Bluetooth device, the status value of the target Bluetooth device is obtained; when the status value indicates that the target Bluetooth device is turned on, data is written to the target Bluetooth device.

进一步举例说明,可选的例如图8所示,假设目标设备302不具备蓝牙设备列表802中的设备M1的连接权限,则设备M1在蓝牙设备列表702中显示无法连接设备M1(阴影);假设目标设备302设备M2、M3的连接权限,,则设备M1在蓝牙设备列表802中显示可连接设备M2、M3。For further illustration, as an optional example shown in FIG. 8, assuming that the target device 302 does not have the connection authority of the device M1 in the Bluetooth device list 802, the device M1 displays in the Bluetooth device list 702 that the device M1 cannot be connected (shaded); If the target device 302 has the connection authority of the devices M2 and M3 , the device M1 displays the connectable devices M2 and M3 in the Bluetooth device list 802 .

通过本申请提供的实施例,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据,达到了实时获取蓝牙设备的状态值的目的,实现了提高了向蓝牙设备写入数据的效率的效果。Through the embodiments provided in this application, when the Bluetooth adapter establishes a connection with the target Bluetooth device, the state value of the target Bluetooth device is obtained; when the state value indicates that the target Bluetooth device is turned on, data is written to the target Bluetooth device, The purpose of obtaining the state value of the bluetooth device in real time is achieved, and the effect of improving the efficiency of writing data to the bluetooth device is achieved.

作为一种可选的方案,在获取目标网页上检测到的连接指令之后,包括:As an optional solution, after obtaining the connection instruction detected on the target webpage, include:

获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接。The disconnection instruction detected on the target webpage is obtained, wherein the disconnection instruction is used to instruct to disconnect the communication connection between the Bluetooth adapter and the target Bluetooth device.

需要说明的是,获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接。It should be noted that the disconnection instruction detected on the target webpage is obtained, wherein the disconnection instruction is used to instruct disconnection of the communication connection between the Bluetooth adapter and the target Bluetooth device.

进一步举例说明,可选的例如图9所示,假设目标设备302与蓝牙设备304已建立通信连接,那么在断开指令触发位置902检测出触控操作的情况下,断开目标设备302与蓝牙设备304之间的通信连接。For further illustration, as an optional example shown in FIG. 9 , assuming that the target device 302 and the Bluetooth device 304 have established a communication connection, then in the case where a touch operation is detected at the disconnect command trigger position 902 , the target device 302 is disconnected from the Bluetooth device 304 . Communication connections between devices 304 .

通过本申请提供的实施例,获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接,达到了可随时断开目标设备与蓝牙设备之间的通信连接的目的,实现了提高通信连接的控制力的效果。Through the embodiments provided in this application, the disconnection instruction detected on the target webpage is obtained, wherein the disconnection instruction is used to instruct to disconnect the communication connection between the Bluetooth adapter and the target Bluetooth device, so that the target device and the Bluetooth device can be disconnected at any time. The purpose of the communication connection between them is to achieve the effect of improving the controllability of the communication connection.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. As in accordance with the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

根据本发明实施例的另一个方面,还提供了一种用于实施上述蓝牙设备的控制方法的蓝牙设备的控制装置。如图10所示,该装置包括:According to another aspect of the embodiments of the present invention, a control apparatus for a Bluetooth device for implementing the above-mentioned control method for a Bluetooth device is also provided. As shown in Figure 10, the device includes:

触发单元1002,用于在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;Triggering unit 1002, for triggering a Bluetooth control instruction in a target web page displayed by a browser running on the target device;

响应单元1004,用于响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;The response unit 1004 is used to respond to the Bluetooth control instruction and call the first application program interface for connecting the Bluetooth device in the control program of the target webpage;

建立单元1006,用于通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;establishing unit 1006, configured to establish a communication connection between the target device and the Bluetooth device through the first application program interface;

发送单元1008,用于基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。The sending unit 1008 is configured to send a control instruction to the Bluetooth device based on the communication connection, wherein the control instruction is used to control the Bluetooth device to perform an operation.

可选的,在本实施例中,蓝牙设备的控制装置可以但不限于应用在终端设备建立与蓝牙设备的通信连接,并控制蓝牙设备执行进一步的控制指令的场景下。目标设备可以但不限于为智能手机、平板电脑、游戏机等。蓝牙设备可以但不限于为蓝牙耳机、蓝牙音箱、蓝牙遥控车等。浏览器可以但不限于为目标设备自带的浏览器应用程序。目标网页可以但不限于为H5网页。应用程序接口(Application Programing Interface,简称API)可以但不限于预先定义的函数,或为软件系统不同组成部分衔接的约定,用于提供应用成语与开发人员基于某软件或硬件得以访问的一组历程,而无需访问源码,或理解内部工作机制细节。Optionally, in this embodiment, the control apparatus of the Bluetooth device may be applied, but not limited to, in a scenario where the terminal device establishes a communication connection with the Bluetooth device and controls the Bluetooth device to execute further control instructions. The target device can be, but is not limited to, a smartphone, a tablet computer, a game console, and the like. The Bluetooth device can be, but is not limited to, a Bluetooth headset, a Bluetooth speaker, a Bluetooth remote control car, and the like. The browser can be, but is not limited to, a browser application that comes with the target device. The landing page can be, but is not limited to, an H5 page. Application Programing Interface (API) can be, but is not limited to, pre-defined functions, or a convention for connecting different components of a software system, and is used to provide application idioms and a set of processes that developers can access based on a certain software or hardware. , without having access to the source code, or understanding the details of the inner workings.

需要说明的是,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。It should be noted that the bluetooth control command is triggered in the target webpage displayed by the browser running on the target device; in response to the bluetooth control command, the first application program interface for connecting the bluetooth device in the control program of the target webpage is called; An application program interface establishes a communication connection between the target device and the Bluetooth device; based on the communication connection, a control instruction is sent to the Bluetooth device, wherein the control instruction is used to control the Bluetooth device to perform operations.

进一步举例说明,可选的例如图3所示,包括目标设备302,以及在目标设备302预设范围内的蓝牙设备304,假设蓝牙设备304的蓝牙连接权限已打开,则可在目标设备302中的浏览器306的目标网页308上的指令触发位置310处,触发蓝牙控制指令,进而建立目标设备302与蓝牙设备304之间的通信连接。For further illustration, an optional example shown in FIG. 3 includes the target device 302 and the Bluetooth device 304 within the preset range of the target device 302 . Assuming that the Bluetooth connection permission of the Bluetooth device 304 is enabled, the target device 302 can The command trigger position 310 on the target webpage 308 of the browser 306 triggers the Bluetooth control command, thereby establishing a communication connection between the target device 302 and the Bluetooth device 304 .

通过本申请提供的实施例,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作,达到了降低目标设备原生系统对蓝牙设备的控制影响力的目的,实现了提高蓝牙设备的控制兼容性的效果。Through the embodiments provided in this application, a Bluetooth control instruction is triggered in a target web page displayed by a browser running on the target device; in response to the Bluetooth control instruction, a first application program interface for connecting a Bluetooth device in a control program of the target web page is invoked ; Establish a communication connection between the target device and the bluetooth device through the first application program interface; send a control command to the bluetooth device based on the communication connection, wherein the control command is used to control the bluetooth device to perform operations, so as to reduce the native system of the target device. The purpose of controlling the influence of the Bluetooth device achieves the effect of improving the control compatibility of the Bluetooth device.

作为一种可选的方案,包括:As an option, include:

封装单元,用于在调用用于与蓝牙设备建立连接的第一应用程序接口之前,将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接。an encapsulation unit, configured to encapsulate the second application program interface into a first application program interface before calling the first application program interface for establishing a connection with the Bluetooth device, wherein the second application program interface is in the control program of the target device The called program interface, the second application program interface is used to establish a connection with the Bluetooth device.

需要说明的是,将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接。可选的,第二应用程序接口可以但不限于为Android与IOS系统原生的蓝牙相关API。第一应用程序接口可以但不限于为Java Script应用程序接口(Java Script API,简称JSAPI)。It should be noted that the second application program interface is encapsulated into the first application program interface, wherein the second application program interface is the program interface called in the control program of the target device, and the second application program interface is used to establish a connection with the Bluetooth device. . Optionally, the second application program interface may be, but not limited to, a native Bluetooth-related API of Android and IOS systems. The first application program interface may be, but is not limited to, a Java Script application program interface (Java Script API, JSAPI for short).

进一步举例说明,可选的例如图4所示,包括目标设备402以及蓝牙设备406,其中,目标设备402通过调用第一应用程序接口404与蓝牙设备406建立连接,并执行进一步的控制指令,具体的,目标设备402中的应用程序控制蓝牙设备406的控制逻辑,需与目标设备402原生系统的控制逻辑一致;For further illustration, optional, such as shown in FIG. 4, includes the target device 402 and the Bluetooth device 406, wherein the target device 402 establishes a connection with the Bluetooth device 406 by calling the first application program interface 404, and executes further control instructions, specifically Yes, the application program in the target device 402 controls the control logic of the Bluetooth device 406, which needs to be consistent with the control logic of the native system of the target device 402;

进一步举例说明,可选的例如图5所示,包括目标设备502、第二应用程序接口504、目标网页506以及蓝牙设备508,其中,目标设备502通过目标网页506调用第二应用程序接口504与蓝牙设备508建立连接,并执行进一步的控制指令,具体的,目标设备502中的应用程序控制蓝牙设备508的控制逻辑,需与控制目标网页506的控制逻辑一致,而与目标设备502原生系统的控制逻辑无关。For further illustration, an optional example shown in FIG. 5 includes a target device 502, a second application program interface 504, a target web page 506, and a Bluetooth device 508, wherein the target device 502 calls the second application program interface 504 through the target web page 506 to communicate with The Bluetooth device 508 establishes a connection and executes further control instructions. Specifically, the control logic of the application program in the target device 502 to control the Bluetooth device 508 needs to be consistent with the control logic of the control target web page 506, and the control logic of the native system of the target device 502. Control logic is irrelevant.

通过本申请提供的实施例,将第二应用程序接口封装成第一应用程序接口,其中,第二应用程序接口为目标设备的控制程序中调用的程序接口,第二应用程序接口用于与蓝牙设备建立连接,达到了修改应用程序的控制逻辑依赖源的目的,实现了降低原生系统对蓝牙设备的控制影响的效果。According to the embodiments provided in this application, the second application program interface is encapsulated into the first application program interface, wherein the second application program interface is the program interface called in the control program of the target device, and the second application program interface is used to communicate with Bluetooth The device establishes a connection, which achieves the purpose of modifying the control logic dependence source of the application, and achieves the effect of reducing the control influence of the native system on the Bluetooth device.

作为一种可选的方案,建立单元1006包括:As an optional solution, the establishment unit 1006 includes:

第一获取模块,用于获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接。The first acquiring module is configured to acquire the establishment instruction detected on the target webpage, wherein the establishment instruction is used to establish the communication connection between the Bluetooth adapter in the target device and the Bluetooth device.

需要说明的是,获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接。可选的,蓝牙适配器可以但不限于为数码产品使用蓝牙设备的接口转换器,采用全球通用的短距离无线连接技术。It should be noted that the establishment instruction detected on the target webpage is acquired, wherein the establishment instruction is used to establish a communication connection between the Bluetooth adapter in the target device and the Bluetooth device. Optionally, the Bluetooth adapter may, but is not limited to, use an interface converter of a Bluetooth device for digital products, and use a global short-range wireless connection technology.

进一步举例说明,可选的例如图6所示,假设在建立指令触发位置602处检测到触控操作,进而生成建立指令,其中,建立指令用于建立目标设备302中的蓝牙适配器(图中未示出)与蓝牙设备304之间的通信连接。For further illustration, as an optional example shown in FIG. 6 , it is assumed that a touch operation is detected at the trigger position 602 of the establishment instruction, and then an establishment instruction is generated, wherein the establishment instruction is used to establish a Bluetooth adapter (not shown in the figure) in the target device 302 shown) and a communication connection between the Bluetooth device 304.

通过本申请提供的实施例,获取目标网页上检测到的建立指令,其中,建立指令用于建立目标设备中的蓝牙适配器与蓝牙设备之间的通信连接,达到了通过目标网页实现通信连接的建立的目的,实现了提高通信连接的建立效率的效果。Through the embodiment provided in the present application, the establishment instruction detected on the target webpage is obtained, wherein the establishment instruction is used to establish the communication connection between the Bluetooth adapter in the target device and the Bluetooth device, so as to achieve the establishment of the communication connection through the target webpage The purpose of this is to achieve the effect of improving the establishment efficiency of the communication connection.

作为一种可选的方案,建立单元1006包括以下至少之一:As an optional solution, the establishing unit 1006 includes at least one of the following:

第二获取模块,用于获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;The second obtaining module is used to obtain the opening instruction detected on the target webpage, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter;

第三获取模块,用于获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;a third acquisition module, configured to acquire a scan instruction detected on the target webpage, wherein the scan instruction is used to instruct the Bluetooth adapter to scan for Bluetooth devices within the range of the target device;

第四获取模块,用于获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备。The fourth acquiring module is used for acquiring the connection instruction detected on the target webpage, wherein the connection instruction is used to instruct the Bluetooth adapter to establish a communication connection with the target Bluetooth device, wherein the Bluetooth device includes the target Bluetooth device.

需要说明的是,获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备。It should be noted that, obtain the opening instruction detected on the target webpage, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter; obtain the scanning instruction detected on the target webpage, wherein the scanning instruction is used to instruct the Bluetooth adapter to scan the range of the target device the bluetooth device; obtain the connection instruction detected on the target webpage, wherein the connection instruction is used to instruct the bluetooth adapter to establish a communication connection with the target bluetooth device, wherein the bluetooth device includes the target bluetooth device.

进一步举例说明,可选的例如图7所示,在目标设备302的蓝牙适配器已开启并扫描中的情况下,在目标网页308上显示蓝牙设备列表702,其中,蓝牙设备列表702中的蓝牙设备为与目标设备302距离满足连接条件的蓝牙设备;进一步,例如连接指令指示连接设备M3,则建立目标设备302与设备M3之间的通信连接。For further illustration, optionally, as shown in FIG. 7 , when the Bluetooth adapter of the target device 302 has been turned on and is being scanned, a Bluetooth device list 702 is displayed on the target web page 308 , wherein the Bluetooth devices in the Bluetooth device list 702 It is a Bluetooth device whose distance from the target device 302 satisfies the connection conditions; further, for example, if the connection instruction instructs the device M3 to be connected, the communication connection between the target device 302 and the device M3 is established.

通过本申请提供的实施例,获取目标网页上检测到的开启指令,其中,开启指令用于指示开启蓝牙适配器;获取目标网页上检测到的扫描指令,其中,扫描指令用于指示蓝牙适配器扫描目标设备范围内的蓝牙设备;获取目标网页上检测到的连接指令,其中,连接指令用于指示蓝牙适配器与目标蓝牙设备建立通信连接,其中,蓝牙设备包括目标蓝牙设备,达到了灵活选取建立通信连接对象的目的,实现了提高与蓝牙设备建立通信连接的灵活性的效果。Through the embodiments provided in the present application, the opening instruction detected on the target webpage is obtained, wherein the opening instruction is used to instruct to turn on the Bluetooth adapter; the scanning instruction detected on the target webpage is obtained, wherein the scanning instruction is used to instruct the Bluetooth adapter to scan the target A Bluetooth device within the range of the device; obtains the connection command detected on the target webpage, wherein the connection command is used to instruct the Bluetooth adapter to establish a communication connection with the target Bluetooth device, wherein the Bluetooth device includes the target Bluetooth device, which achieves flexible selection and establishment of communication connection The purpose of the object is to achieve the effect of improving the flexibility of establishing a communication connection with a Bluetooth device.

作为一种可选的方案,包括:As an option, include:

第五获取模块,用于在获取目标网页上检测到的连接指令之后,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;a fifth acquisition module, configured to acquire the status value of the target Bluetooth device when the Bluetooth adapter establishes a connection with the target Bluetooth device after acquiring the connection instruction detected on the target webpage;

写入模块,用于在获取目标网页上检测到的连接指令之后,在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据。The writing module is used to write data to the target Bluetooth device under the condition that the state value indicates that the target Bluetooth device is turned on after acquiring the connection instruction detected on the target webpage.

需要说明的是,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据。It should be noted that when the Bluetooth adapter establishes a connection with the target Bluetooth device, the status value of the target Bluetooth device is obtained; when the status value indicates that the target Bluetooth device is turned on, data is written to the target Bluetooth device.

进一步举例说明,可选的例如图8所示,假设目标设备302不具备蓝牙设备列表802中的设备M1的连接权限,则设备M1在蓝牙设备列表702中显示无法连接设备M1(阴影);假设目标设备302设备M2、M3的连接权限,,则设备M1在蓝牙设备列表802中显示可连接设备M2、M3。For further illustration, as an optional example shown in FIG. 8, assuming that the target device 302 does not have the connection authority of the device M1 in the Bluetooth device list 802, the device M1 displays in the Bluetooth device list 702 that the device M1 cannot be connected (shaded); If the target device 302 has the connection authority of the devices M2 and M3 , the device M1 displays the connectable devices M2 and M3 in the Bluetooth device list 802 .

通过本申请提供的实施例,在蓝牙适配器与目标蓝牙设备建立连接的情况下,获取目标蓝牙设备的状态值;在状态值指示目标蓝牙设备已开启的情况下,向目标蓝牙设备写入数据,达到了实时获取蓝牙设备的状态值的目的,实现了提高了向蓝牙设备写入数据的效率的效果。Through the embodiments provided in this application, when the Bluetooth adapter establishes a connection with the target Bluetooth device, the state value of the target Bluetooth device is obtained; when the state value indicates that the target Bluetooth device is turned on, data is written to the target Bluetooth device, The purpose of obtaining the state value of the bluetooth device in real time is achieved, and the effect of improving the efficiency of writing data to the bluetooth device is achieved.

作为一种可选的方案,包括:As an option, include:

第六获取模块,用于在获取目标网页上检测到的连接指令之后,获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接。The sixth obtaining module is configured to obtain the disconnection instruction detected on the target webpage after obtaining the connection instruction detected on the target webpage, wherein the disconnection instruction is used to instruct to disconnect the communication connection between the bluetooth adapter and the target bluetooth device.

需要说明的是,获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接。It should be noted that the disconnection instruction detected on the target webpage is obtained, wherein the disconnection instruction is used to instruct disconnection of the communication connection between the Bluetooth adapter and the target Bluetooth device.

进一步举例说明,可选的例如图9所示,假设目标设备302与蓝牙设备304已建立通信连接,那么在断开指令触发位置902检测出触控操作的情况下,断开目标设备302与蓝牙设备304之间的通信连接。For further illustration, as an optional example shown in FIG. 9 , assuming that the target device 302 and the Bluetooth device 304 have established a communication connection, then in the case where a touch operation is detected at the disconnect command trigger position 902 , the target device 302 is disconnected from the Bluetooth device 304 . Communication connections between devices 304 .

通过本申请提供的实施例,获取目标网页上检测到的断开指令,其中,断开指令用于指示断开蓝牙适配器与目标蓝牙设备的通信连接,达到了可随时断开目标设备与蓝牙设备之间的通信连接的目的,实现了提高通信连接的控制力的效果。Through the embodiments provided in this application, the disconnection instruction detected on the target webpage is obtained, wherein the disconnection instruction is used to instruct to disconnect the communication connection between the Bluetooth adapter and the target Bluetooth device, so that the target device and the Bluetooth device can be disconnected at any time. The purpose of the communication connection between them is to achieve the effect of improving the controllability of the communication connection.

根据本发明实施例的又一个方面,还提供了一种用于实施上述蓝牙设备的控制方法的电子装置,如图11所示,该电子装置包括存储器1102和处理器1104,该存储器1102中存储有计算机程序,该处理器1104被设置为通过计算机程序执行上述任一项方法实施例中的步骤。According to yet another aspect of the embodiments of the present invention, an electronic device for implementing the above-mentioned control method for a Bluetooth device is also provided. As shown in FIG. 11 , the electronic device includes a memory 1102 and a processor 1104, and the memory 1102 stores There is a computer program, and the processor 1104 is configured to perform the steps in any of the above method embodiments by the computer program.

可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the above-mentioned electronic apparatus may be located in at least one network device among multiple network devices of a computer network.

可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:

S1,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;S1, triggering the Bluetooth control command in the target web page displayed by the browser running on the target device;

S2,响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;S2, in response to the bluetooth control instruction, call the first application program interface for connecting the bluetooth device in the control program of the target webpage;

S3,通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;S3, through the first application program interface, establish a communication connection between the target device and the Bluetooth device;

S4,基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。S4: Send a control instruction to the Bluetooth device based on the communication connection, where the control instruction is used to control the Bluetooth device to perform an operation.

可选地,本领域普通技术人员可以理解,图11所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图11其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图11中所示更多或者更少的组件(如网络接口等),或者具有与图11所示不同的配置。Optionally, those of ordinary skill in the art can understand that the structure shown in FIG. 11 is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (Mobile Internet device). Internet Devices, MID), PAD and other terminal equipment. FIG. 11 does not limit the structure of the above electronic device. For example, the electronic device may also include more or fewer components than those shown in FIG. 11 (eg, network interfaces, etc.), or have a different configuration than that shown in FIG. 11 .

其中,存储器1102可用于存储软件程序以及模块,如本发明实施例中的蓝牙设备的控制方法和装置对应的程序指令/模块,处理器1104通过运行存储在存储器1102内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的蓝牙设备的控制方法。存储器1102可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1102可进一步包括相对于处理器1104远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。其中,存储器1102具体可以但不限于用于存储第一应用程序接口、蓝牙控制指令以及控制指令等信息。作为一种示例,如图11所示,上述存储器1102中可以但不限于包括上述蓝牙设备的控制装置中的触发单元1002、响应单元1004、建立单元1006及发送单元1008。此外,还可以包括但不限于上述蓝牙设备的控制装置中的其他模块单元,本示例中不再赘述。The memory 1102 may be used to store software programs and modules, such as program instructions/modules corresponding to the Bluetooth device control method and device in the embodiment of the present invention, and the processor 1104 runs the software programs and modules stored in the memory 1102, thereby Execute various functional applications and data processing, that is, to realize the above-mentioned control method of the Bluetooth device. Memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1102 may further include memory located remotely from the processor 1104, and these remote memories may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Wherein, the memory 1102 may specifically, but not be limited to, be used to store information such as the first application program interface, the Bluetooth control instruction, and the control instruction. As an example, as shown in FIG. 11 , the memory 1102 may include, but is not limited to, the trigger unit 1002 , the response unit 1004 , the establishment unit 1006 , and the sending unit 1008 in the control device of the Bluetooth device. In addition, it may also include but is not limited to other module units in the control device of the above-mentioned Bluetooth device, which will not be repeated in this example.

可选地,上述的传输装置1106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置1106包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置1106为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。Optionally, the above-mentioned transmission device 1106 is configured to receive or send data via a network. Specific examples of the above-mentioned networks may include wired networks and wireless networks. In one example, the transmission device 1106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1106 is a radio frequency (RF) module, which is used for wirelessly communicating with the Internet.

此外,上述电子装置还包括:显示器1108,用于显示上述第一应用程序接口、蓝牙控制指令以及控制指令等信息;和连接总线1110,用于连接上述电子装置中的各个模块部件。In addition, the above electronic device further includes: a display 1108 for displaying information such as the above-mentioned first application program interface, Bluetooth control commands and control commands; and a connection bus 1110 for connecting various module components in the above electronic device.

根据本发明的实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above when running steps in a method embodiment.

可选地,在本实施例中,上述计算机可读的存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the following steps:

S1,在目标设备上运行的浏览器所显示的目标网页中触发蓝牙控制指令;S1, triggering the Bluetooth control command in the target web page displayed by the browser running on the target device;

S2,响应蓝牙控制指令,调用目标网页的控制程序中用于连接蓝牙设备的第一应用程序接口;S2, in response to the bluetooth control instruction, call the first application program interface for connecting the bluetooth device in the control program of the target webpage;

S3,通过第一应用程序接口,建立目标设备与蓝牙设备之间的通信连接;S3, through the first application program interface, establish a communication connection between the target device and the Bluetooth device;

S4,基于通信连接向蓝牙设备发送控制指令,其中,控制指令用于控制蓝牙设备执行操作。S4: Send a control instruction to the Bluetooth device based on the communication connection, where the control instruction is used to control the Bluetooth device to perform an operation.

可选地,在本实施例中,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a In the computer-readable storage medium, the storage medium may include: a flash disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。If the integrated units in the above-mentioned embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, Several instructions are included to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.

在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed client may be implemented in other manners. The device embodiments described above are only illustrative, for example, the division of units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or integrated into Another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown 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 in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made. It should be regarded as the protection scope of the present invention.

Claims (10)

1. A method for controlling a bluetooth device, comprising:
triggering a Bluetooth control instruction in a target webpage displayed by a browser running on target equipment;
responding to the Bluetooth control instruction, and calling a first application program interface used for connecting Bluetooth equipment in a control program of the target webpage;
establishing communication connection between the target device and the Bluetooth device through the first application program interface;
and sending a control instruction to the Bluetooth device based on the communication connection, wherein the control instruction is used for controlling the Bluetooth device to execute operation.
2. The method of claim 1, wherein prior to said invoking the first application program interface for establishing a connection with a Bluetooth device, comprising:
and packaging a second application program interface into the first application program interface, wherein the second application program interface is a program interface called in a control program of the target equipment, and the second application program interface is used for establishing connection with the Bluetooth equipment.
3. The method of claim 1, wherein establishing, via the first application program interface, a communication connection between the target device and the Bluetooth device comprises:
and acquiring a building instruction detected on the target webpage, wherein the building instruction is used for building communication connection between a Bluetooth adapter in the target equipment and the Bluetooth equipment.
4. The method of claim 3, wherein establishing, via the first application program interface, a communication connection between the target device and the Bluetooth device comprises at least one of:
acquiring a starting instruction detected on the target webpage, wherein the starting instruction is used for indicating to start the Bluetooth adapter;
acquiring a scanning instruction detected on the target webpage, wherein the scanning instruction is used for indicating the Bluetooth adapter to scan the Bluetooth equipment in the range of the target equipment;
and acquiring a connection instruction detected on the target webpage, wherein the connection instruction is used for indicating the Bluetooth adapter to establish communication connection with target Bluetooth equipment, and the Bluetooth equipment comprises the target Bluetooth equipment.
5. The method according to claim 4, wherein after the obtaining of the connection instruction detected on the target webpage, the method comprises:
acquiring a state value of the target Bluetooth equipment under the condition that the Bluetooth adapter establishes connection with the target Bluetooth equipment;
and writing data into the target Bluetooth device under the condition that the state value indicates that the target Bluetooth device is started.
6. The method according to claim 4, wherein after the obtaining of the connection instruction detected on the target webpage, the method comprises:
and acquiring a disconnection instruction detected on the target webpage, wherein the disconnection instruction is used for indicating that the communication connection between the Bluetooth adapter and the target Bluetooth device is disconnected.
7. A control apparatus of a bluetooth device, comprising:
the triggering unit is used for triggering a Bluetooth control instruction in a target webpage displayed by a browser running on target equipment;
the response unit is used for responding to the Bluetooth control instruction and calling a first application program interface used for connecting Bluetooth equipment in the control program of the target webpage;
the establishing unit is used for establishing communication connection between the target equipment and the Bluetooth equipment through the first application program interface;
and the sending unit is used for sending a control instruction to the Bluetooth equipment based on the communication connection, wherein the control instruction is used for controlling the Bluetooth equipment to execute operation.
8. The apparatus of claim 7, comprising:
and the packaging unit is used for packaging a second application program interface into the first application program interface before the first application program interface used for establishing connection with the Bluetooth equipment is called, wherein the second application program interface is a program interface called in a control program of the target equipment, and the second application program interface is used for establishing connection with the Bluetooth equipment.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 6.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 by means of the computer program.
CN202010632579.9A 2020-07-03 2020-07-03 Bluetooth device control method and device and storage medium Pending CN111800774A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010632579.9A CN111800774A (en) 2020-07-03 2020-07-03 Bluetooth device control method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010632579.9A CN111800774A (en) 2020-07-03 2020-07-03 Bluetooth device control method and device and storage medium

Publications (1)

Publication Number Publication Date
CN111800774A true CN111800774A (en) 2020-10-20

Family

ID=72810013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010632579.9A Pending CN111800774A (en) 2020-07-03 2020-07-03 Bluetooth device control method and device and storage medium

Country Status (1)

Country Link
CN (1) CN111800774A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416617A (en) * 2020-11-19 2021-02-26 青岛海尔科技有限公司 Bluetooth device control method and device, storage medium, and electronic device
CN113453205A (en) * 2021-05-25 2021-09-28 当趣网络科技(杭州)有限公司 Bluetooth remote controller recovery method, system and computer storage medium
CN116798167A (en) * 2023-08-25 2023-09-22 广东星云开物科技股份有限公司 Shared entertainment equipment starting method, system and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090282345A1 (en) * 2008-05-07 2009-11-12 Christopher Smith Interaction between web pages and local applications
US20120151372A1 (en) * 2010-12-10 2012-06-14 Wyse Technology Inc. Methods and systems for facilitating a remote desktop session utilizing a remote desktop client common interface
US20150223006A1 (en) * 2011-09-23 2015-08-06 Google Inc. Mobile device activation
US20160330266A1 (en) * 2014-04-09 2016-11-10 Yandex Europe Ag Remotely controlling a device via a web browser
CN206162487U (en) * 2016-08-08 2017-05-10 廖克顺 Webpage remote control device
WO2017076269A1 (en) * 2015-11-03 2017-05-11 国民技术股份有限公司 Smart device, and method and apparatus for establishing bluetooth connection between devices therefor
WO2018053970A1 (en) * 2016-09-23 2018-03-29 歌尔科技有限公司 Connection method and connection device for bluetooth device
CN108230501A (en) * 2017-12-29 2018-06-29 广州斯马特信息科技有限公司 Bluetooth method for unlocking and device
CN109769230A (en) * 2017-11-09 2019-05-17 北京君正集成电路股份有限公司 Bluetooth pairing connection method and device
CN109769231A (en) * 2017-11-09 2019-05-17 北京君正集成电路股份有限公司 Bluetooth pairing connection method and device
CN111262890A (en) * 2018-11-30 2020-06-09 云丁网络技术(北京)有限公司 Electronic device control method, electronic device and web server

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090282345A1 (en) * 2008-05-07 2009-11-12 Christopher Smith Interaction between web pages and local applications
US20120151372A1 (en) * 2010-12-10 2012-06-14 Wyse Technology Inc. Methods and systems for facilitating a remote desktop session utilizing a remote desktop client common interface
US20150223006A1 (en) * 2011-09-23 2015-08-06 Google Inc. Mobile device activation
US20160330266A1 (en) * 2014-04-09 2016-11-10 Yandex Europe Ag Remotely controlling a device via a web browser
WO2017076269A1 (en) * 2015-11-03 2017-05-11 国民技术股份有限公司 Smart device, and method and apparatus for establishing bluetooth connection between devices therefor
CN206162487U (en) * 2016-08-08 2017-05-10 廖克顺 Webpage remote control device
WO2018053970A1 (en) * 2016-09-23 2018-03-29 歌尔科技有限公司 Connection method and connection device for bluetooth device
CN109769230A (en) * 2017-11-09 2019-05-17 北京君正集成电路股份有限公司 Bluetooth pairing connection method and device
CN109769231A (en) * 2017-11-09 2019-05-17 北京君正集成电路股份有限公司 Bluetooth pairing connection method and device
CN108230501A (en) * 2017-12-29 2018-06-29 广州斯马特信息科技有限公司 Bluetooth method for unlocking and device
CN111262890A (en) * 2018-11-30 2020-06-09 云丁网络技术(北京)有限公司 Electronic device control method, electronic device and web server

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416617A (en) * 2020-11-19 2021-02-26 青岛海尔科技有限公司 Bluetooth device control method and device, storage medium, and electronic device
CN113453205A (en) * 2021-05-25 2021-09-28 当趣网络科技(杭州)有限公司 Bluetooth remote controller recovery method, system and computer storage medium
CN113453205B (en) * 2021-05-25 2022-05-20 当趣网络科技(杭州)有限公司 Bluetooth remote controller recovery method, system and computer storage medium
CN116798167A (en) * 2023-08-25 2023-09-22 广东星云开物科技股份有限公司 Shared entertainment equipment starting method, system and storage medium

Similar Documents

Publication Publication Date Title
RU2523964C2 (en) Method for inter-process interaction between different applications in mobile terminal and corresponding device
JP5307276B2 (en) USB device remote control method and system for executing the same
CN111552274B (en) Automotive diagnostic method, apparatus, apparatus, system, and diagnostic connection device
KR101842559B1 (en) Terminal, server, and terminal control method
CN111800774A (en) Bluetooth device control method and device and storage medium
JP5945916B2 (en) Information processing system, information processing method, portable terminal, server, control method and control program thereof
CN102932695A (en) Remote control method, intelligent terminal and intelligent remote control system
CN103298147B (en) Realize the methods, devices and systems at computing equipment side radio management mobile terminal
WO2013149491A1 (en) Wireless routing device, mobile terminal, and management system and method
CN105992066B (en) Character input method and character input device applied to intelligent equipment
WO2017004982A1 (en) Smart system and implementation method therefor, and peripheral for smart device
WO2020168567A1 (en) Data processing method and device, and mobile terminal
CN104461581B (en) A kind of hardware calling, sharing method and system based on virtualization technology
CN108052401B (en) System attribute monitoring method, terminal device and computer readable storage medium
WO2013146413A1 (en) Information processing system, information processing method, and mobile telephone, server, and control method and control program therefor
CN114374959B (en) Bluetooth connection method, device, electronic device and storage medium
CN107077378B (en) Communication method, device, electronic equipment and program product
KR102458299B1 (en) Electronic device and method for operation thereof
JP6374666B2 (en) COMMUNICATION DEVICE, ITS CONTROL METHOD, AND PROGRAM
CN104869129B (en) A kind of application management method, equipment and system
CN108406781A (en) A kind of Remote Robot Control System and control method
WO2016119623A1 (en) Method and device for realizing network sharing
KR101368966B1 (en) Portable Terminal and IVI for Interworking Application, Method thereof for Operating Application
EP3700169A1 (en) Electronic device for communicating with external electronic device
WO2025113357A1 (en) Communication method, first communication device, and remote diagnostic system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231201

Address after: Unit 5B03, 5th Floor, Building 2, No. 277 Longlan Road, Xuhui District, Shanghai, 200000

Applicant after: SHANGHAI SECOND PICKET NETWORK TECHNOLOGY CO.,LTD.

Address before: Floors 4, 5 and 6, No. 3, Lane 1473, Zhenguang Road, Putuo District, Shanghai, 200333

Applicant before: Shanghai Fengzhi Technology Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20201020

RJ01 Rejection of invention patent application after publication