[go: up one dir, main page]

CN111866998A - Bluetooth distribution network method, device and storage medium - Google Patents

Bluetooth distribution network method, device and storage medium Download PDF

Info

Publication number
CN111866998A
CN111866998A CN202010728734.7A CN202010728734A CN111866998A CN 111866998 A CN111866998 A CN 111866998A CN 202010728734 A CN202010728734 A CN 202010728734A CN 111866998 A CN111866998 A CN 111866998A
Authority
CN
China
Prior art keywords
bluetooth
network
distribution
information
password
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
CN202010728734.7A
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.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital 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 Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN202010728734.7A priority Critical patent/CN111866998A/en
Priority to PCT/CN2020/113022 priority patent/WO2022016669A1/en
Publication of CN111866998A publication Critical patent/CN111866998A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • 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
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/14Access restriction or access information delivery, e.g. discovery data delivery using user query or user detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

本发明公开了一种蓝牙配网方法、设备及存储介质,所述方法包括:发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道;接收所述终端设备通过所述GATT连接通道发送的配网指令;从所述配网指令中提取配网信息,并基于所述配网信息进行配网。从而通过低功耗蓝牙广播来建立终端设备与蓝牙配网设备之间的GATT连接通道,以传输配网指令,并通过配网指令中的配网信息来进行配网,提高了蓝牙配网的效率。

Figure 202010728734

The invention discloses a bluetooth network distribution method, device and storage medium. The method includes: sending low-power bluetooth broadcasts, so that when a terminal device scans the low-power bluetooth broadcasts, it establishes a connection with a bluetooth network distribution device A GATT connection channel between them; receiving a network distribution command sent by the terminal device through the GATT connection channel; extracting network distribution information from the network distribution command, and performing network distribution based on the network distribution information. Therefore, the GATT connection channel between the terminal device and the Bluetooth distribution network device is established through the low-power Bluetooth broadcast to transmit the distribution network command, and the network distribution is carried out through the distribution network information in the distribution network command, which improves the Bluetooth distribution network. efficiency.

Figure 202010728734

Description

蓝牙配网方法、设备及存储介质Bluetooth distribution network method, device and storage medium

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种蓝牙配网方法、设备及存储介质。The invention relates to the field of communication technologies, and in particular, to a method, device and storage medium for Bluetooth network distribution.

背景技术Background technique

目前,例如故事机、智能机器人等很多设备,都没有界面显示和输入,导致要给这些设备配网非常困难。存在使用经典蓝牙为这些设备进行配网的配网方式,但是经典蓝牙的工作信道为79个,扫描和配对、连接就要占用大量的时间,效率低下。At present, many devices, such as story machines and intelligent robots, do not have interface display and input, which makes it very difficult to distribute the network to these devices. There is a network distribution method that uses classic Bluetooth to configure the network for these devices, but the number of working channels of classic Bluetooth is 79. Scanning, pairing, and connection take a lot of time, and the efficiency is low.

发明内容SUMMARY OF THE INVENTION

本发明的主要目的在于提出一种蓝牙配网方法、设备及存储介质,旨在解决如何提高蓝牙配网效率的技术问题。The main purpose of the present invention is to propose a method, device and storage medium for Bluetooth network distribution, aiming at solving the technical problem of how to improve the efficiency of Bluetooth network distribution.

为实现上述目的,本发明提供一种蓝牙配网方法,所述蓝牙配网方法包括以下步骤:In order to achieve the above object, the present invention provides a Bluetooth network distribution method, and the Bluetooth network distribution method includes the following steps:

发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道;Sending a low-power bluetooth broadcast, so that the terminal device establishes a GATT connection channel with the bluetooth distribution network device when scanning the low-power bluetooth broadcast;

接收所述终端设备通过所述GATT连接通道发送的配网指令;receiving a network configuration command sent by the terminal device through the GATT connection channel;

从所述配网指令中提取配网信息,并基于所述配网信息进行配网。The distribution network information is extracted from the distribution network instruction, and the network distribution is performed based on the distribution network information.

进一步地,所述从所述配网指令中提取配网信息,并基于所述配网信息进行配网,具体包括:Further, the extracting network distribution information from the network distribution instruction, and performing network distribution based on the network distribution information, specifically includes:

从所述配网指令中提取配网信息,并从所述配网信息中提取服务集标识和待匹配密码;extracting network distribution information from the network distribution instruction, and extracting a service set identifier and a password to be matched from the network distribution information;

判断本地是否存储有所述服务集标识;Determine whether the service set identifier is stored locally;

在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码;When the service set identifier is stored locally, searching for a target password corresponding to the service set identifier;

基于所述服务集标识、所述待匹配密码以及所述目标密码进行配网。Network configuration is performed based on the service set identifier, the password to be matched, and the target password.

进一步地,所述基于所述服务集标识、所述待匹配密码以及所述目标密码进行配网,具体包括:Further, the performing network configuration based on the service set identifier, the password to be matched and the target password specifically includes:

判断所述待匹配密码与所述目标密码是否一致;Determine whether the password to be matched is consistent with the target password;

在所述待匹配密码与所述目标密码一致时,根据所述服务集标识确定目标路由器;When the password to be matched is consistent with the target password, determining a target router according to the service set identifier;

根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。Establish a network connection with the target router according to the service set identifier and the password to be matched.

进一步地,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道之前,还包括:Further, the sending low-power bluetooth broadcast, so that when the terminal device scans the low-power bluetooth broadcast, before establishing a GATT connection channel with the bluetooth distribution network device, further includes:

在接收到广播指令时,根据所述广播指令确定第一当前设备状态;When receiving the broadcast instruction, determine the first current device state according to the broadcast instruction;

判断所述第一当前设备状态是否为第一预设状态;judging whether the first current device state is the first preset state;

在所述第一当前设备状态为所述第一预设状态时,执行所述发送低功耗蓝牙广播的步骤。When the first current device state is the first preset state, the step of sending the Bluetooth low energy consumption broadcast is performed.

进一步地,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道之前,还包括:Further, the sending low-power bluetooth broadcast, so that when the terminal device scans the low-power bluetooth broadcast, before establishing a GATT connection channel with the bluetooth distribution network device, further includes:

获取设备信息,并根据所述设备信息生成设备标识;Obtain device information, and generate a device identifier according to the device information;

根据所述设备标识生成蓝牙广播信息;generating Bluetooth broadcast information according to the device identification;

相应地,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道,具体包括:Correspondingly, the sending low-power bluetooth broadcast, so that when the terminal device scans the low-power bluetooth broadcast, establishes a GATT connection channel with the bluetooth distribution network device, specifically including:

基于所述蓝牙广播信息发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,根据所述蓝牙广播信息确定设备标识,并根据所述设备标识建立与蓝牙配网设备之间的GATT连接通道。Send low-power bluetooth broadcasts based on the bluetooth broadcast information, so that when the terminal device scans the low-power bluetooth broadcasts, it determines a device identity according to the bluetooth broadcast information, and establishes a network with Bluetooth according to the device identity. GATT connection channel between devices.

进一步地,所述获取设备信息,并根据所述设备信息生成设备标识,具体包括:Further, the acquiring device information and generating a device identifier according to the device information specifically includes:

从所述设备信息中提取设备标识信息;extracting device identification information from the device information;

根据所述设备标识信息确定设备标识。The device identification is determined according to the device identification information.

进一步地,所述设备标识信息包括:设备ID、蓝牙MAC地址、设备序列号和厂商ID中的至少一项。Further, the device identification information includes: at least one of a device ID, a Bluetooth MAC address, a device serial number, and a manufacturer ID.

进一步地,所述蓝牙配网方法包括以下步骤:Further, the Bluetooth network distribution method includes the following steps:

进行蓝牙扫描,在扫描到蓝牙配网设备发送的低功耗蓝牙广播时,建立与所述蓝牙配网设备之间的GATT连接通道;Perform Bluetooth scanning, and establish a GATT connection channel with the Bluetooth distribution device when scanning the low-power Bluetooth broadcast sent by the Bluetooth distribution device;

生成配网指令,通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取配网信息,并基于所述配网信息进行配网。Generate a network distribution instruction, and send the network distribution instruction to the Bluetooth network distribution device through the GATT connection channel, so that the Bluetooth network distribution device extracts network distribution information from the network distribution instruction, and based on the Distribution network information for distribution network.

为实现上述目的,本发明提供一种设备,所述蓝牙配网设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的蓝牙配网程序,所述蓝牙配网程序配置为实现如上文所述的蓝牙配网方法的步骤。In order to achieve the above object, the present invention provides a device, the Bluetooth network configuration device includes: a memory, a processor and a Bluetooth network configuration program stored in the memory and running on the processor, the Bluetooth configuration The network program is configured to implement the steps of the Bluetooth network distribution method as described above.

为实现上述目的,本发明提供一种存储介质,所述存储介质上存储有蓝牙配网程序,所述蓝牙配网程序被处理器执行时实现如上文所述的蓝牙配网方法的步骤。In order to achieve the above object, the present invention provides a storage medium on which a Bluetooth network configuration program is stored, and when the Bluetooth network configuration program is executed by a processor, the steps of the Bluetooth network configuration method described above are implemented.

本发明提出的蓝牙配网方法,通过发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道;接收所述终端设备通过所述GATT连接通道发送的配网指令;从所述配网指令中提取配网信息,并基于所述配网信息进行配网。从而通过低功耗蓝牙广播来建立终端设备与蓝牙配网设备之间的GATT连接通道,以传输配网指令,并通过配网指令中的配网信息来进行配网,提高了蓝牙配网的效率。The bluetooth network distribution method proposed by the present invention sends low-power bluetooth broadcasts, so that when the terminal equipment scans the low-power bluetooth broadcasts, it establishes a GATT connection channel with the bluetooth network distribution equipment; receives the terminal equipment The network distribution command sent by the device through the GATT connection channel; the network distribution information is extracted from the network distribution command, and the network distribution is performed based on the network distribution information. Thereby, the GATT connection channel between the terminal device and the Bluetooth distribution network device is established through the low-power Bluetooth broadcast to transmit the distribution network command, and the network distribution is carried out through the distribution network information in the distribution network command, which improves the Bluetooth distribution network. efficiency.

附图说明Description of drawings

图1是本发明实施例方案涉及的硬件运行环境的设备结构示意图;1 is a schematic diagram of a device structure of a hardware operating environment involved in an embodiment of the present invention;

图2为本发明蓝牙配网方法第一实施例的流程示意图;FIG. 2 is a schematic flowchart of the first embodiment of the Bluetooth network distribution method according to the present invention;

图3为本发明蓝牙配网方法第二实施例的流程示意图;3 is a schematic flowchart of a second embodiment of a Bluetooth network distribution method according to the present invention;

图4为本发明蓝牙配网方法第三实施例的流程示意图;4 is a schematic flowchart of a third embodiment of a Bluetooth network distribution method according to the present invention;

图5为本发明蓝牙配网方法第四实施例的流程示意图。FIG. 5 is a schematic flowchart of a fourth embodiment of a Bluetooth network distribution method according to the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

参照图1,图1为本发明实施例方案涉及的硬件运行环境的蓝牙配网设备结构示意图。Referring to FIG. 1 , FIG. 1 is a schematic structural diagram of a Bluetooth distribution network device of a hardware operating environment involved in an embodiment of the present invention.

如图1所示,该蓝牙配网设备可以包括:处理器1001,例如中央处理器(CentralProcessing Unit,CPU),通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如按键,可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速随机存取存储器(Random Access Memory,RAM)存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the Bluetooth network configuration device may include: a processor 1001 , such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 . Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a button, and the optional user interface 1003 may also include a standard wired interface and a wireless interface. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (eg, a WI-FI interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or may be a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .

本领域技术人员可以理解,图1中示出的设备结构并不构成对蓝牙配网设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the device structure shown in FIG. 1 does not constitute a limitation on the Bluetooth distribution network device, and may include more or less components than the one shown, or combine some components, or arrange different components .

如图1所示,作为一种存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及蓝牙配网程序。As shown in FIG. 1 , the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module and a Bluetooth network configuration program.

在图1所示的蓝牙配网设备中,网络接口1004主要用于连接外网,与其他网络设备进行数据通信;用户接口1003主要用于连接用户设备,与所述用户设备进行数据通信;本发明设备通过处理器1001调用存储器1005中存储的蓝牙配网程序,并执行本发明实施例提供的蓝牙配网方法。In the Bluetooth distribution network device shown in FIG. 1, the network interface 1004 is mainly used to connect to the external network and perform data communication with other network devices; the user interface 1003 is mainly used to connect user equipment and perform data communication with the user equipment; this The inventive device invokes the Bluetooth network configuration program stored in the memory 1005 through the processor 1001, and executes the Bluetooth network configuration method provided by the embodiment of the present invention.

基于图1的硬件结构,提出本发明蓝牙配网方法实施例。Based on the hardware structure of FIG. 1 , an embodiment of the Bluetooth network distribution method of the present invention is proposed.

参照图2,图2为本发明蓝牙配网方法第一实施例的流程示意图。Referring to FIG. 2 , FIG. 2 is a schematic flowchart of a first embodiment of a Bluetooth network distribution method according to the present invention.

在第一实施例中,所述蓝牙配网方法包括以下步骤:In the first embodiment, the Bluetooth network distribution method includes the following steps:

步骤S10,发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道。Step S10, sending a low-power bluetooth broadcast, so that the terminal device establishes a GATT connection channel with a bluetooth network distribution device when scanning the low-power bluetooth broadcast.

需要说明的是,本实施例的执行主体可为蓝牙配网设备,还可为其他可实现相同或相似功能的设备,本实施例对此不作限制,在本实施例中,以蓝牙配网设备为例进行说明。其中,所述蓝牙配网设备包含处理器和wifi蓝牙模块,还可包含其他模块,本实施例对此不作限制。It should be noted that the executive body of this embodiment may be a Bluetooth network distribution device, or other devices that can implement the same or similar functions, which are not limited in this embodiment. In this embodiment, a Bluetooth network distribution device is used. Take an example to illustrate. Wherein, the bluetooth network distribution device includes a processor and a wifi bluetooth module, and may also include other modules, which are not limited in this embodiment.

需要说明的是,蓝牙配网设备可为具有广播功能的设备,终端设备可为具有扫描功能的设备,由蓝牙配网设备发送低功耗蓝牙(Bluetooth Low Energy,BLE)广播,终端设备进行扫描。当然,蓝牙配网设备也可具有扫描功能,终端设备也可具有广播功能,由终端设备发送BLE广播,蓝牙配网设备进行扫描,本实施例对此不作限制。It should be noted that the Bluetooth distribution network device may be a device with a broadcast function, and the terminal device may be a device with a scanning function. The Bluetooth distribution network device sends a Bluetooth Low Energy (BLE ) broadcast, and the terminal device scans . Of course, the Bluetooth network configuration device may also have a scanning function, and the terminal device may also have a broadcast function. The terminal device sends BLE broadcast, and the Bluetooth network configuration device scans, which is not limited in this embodiment.

应当理解的是,蓝牙配网设备发送BLE广播,然后在蓝牙配网设备发送BLE广播的同时,或者在蓝牙配网设备发送BLE广播之后,进行蓝牙扫描,具体地,所述蓝牙扫描为BLE扫描。It should be understood that the Bluetooth network configuration device sends a BLE broadcast, and then performs a Bluetooth scan while the Bluetooth network configuration device sends a BLE broadcast, or after the Bluetooth network configuration device sends a BLE broadcast. Specifically, the Bluetooth scan is a BLE scan. .

需要说明的是,经典蓝牙的工作信道为79个,而BLE的工作信道为3个,因此BLE扫描相较于经典蓝牙扫描,扫描以及连接的效率提升了很多倍,而且,正是因为扫描以及连接的效率的提升,也进一步提升了蓝牙配网的效率。It should be noted that the working channels of classic Bluetooth are 79, while the working channels of BLE are 3. Therefore, BLE scanning is much more efficient than classical Bluetooth scanning, scanning and connection. Moreover, it is precisely because of scanning and The improvement of connection efficiency also further improves the efficiency of Bluetooth distribution network.

可以理解的是,进行蓝牙扫描,获得扫描列表,判断扫描列表中是否存在蓝牙配网设备发送的BLE广播,若扫描列表中存在蓝牙配网设备发送的BLE广播,说明此时扫描到了所述BLE广播,基于所述BLE广播建立与所述蓝牙配网设备之间的GATT连接通道。It is understandable that, perform a Bluetooth scan, obtain a scan list, and determine whether there is a BLE broadcast sent by a Bluetooth network configuration device in the scan list. If there is a BLE broadcast sent by a Bluetooth network configuration device in the scan list, it means that the BLE has been scanned at this time. Broadcast, establish a GATT connection channel with the Bluetooth distribution network device based on the BLE broadcast.

应当理解的是,现在BLE连接都是建立在GATT(Generic Attribute Profile)协议之上的,GATT是一个在蓝牙连接之上的发送和接收很短的数据段的通用规范,因此,可根据GATT协议建立蓝牙配网设备与终端设备之间的GATT连接通道,蓝牙配网设备与终端设备根据GATT连接通道来进行数据传输。It should be understood that BLE connections are now based on the GATT (Generic Attribute Profile) protocol. GATT is a general specification for sending and receiving short data segments over a Bluetooth connection. Therefore, according to the GATT protocol A GATT connection channel between the Bluetooth distribution network device and the terminal device is established, and the Bluetooth distribution network device and the terminal device perform data transmission according to the GATT connection channel.

需要说明的是,GATT连接是独占的,也就是说一个蓝牙配网设备同时只能被一个终端设备连接,一旦蓝牙配网设备被连接,它就会马上停止广播,这样它就对其他设备不可见了,当连接断开时,蓝牙配网设备就又可开始广播。在蓝牙配网设备与终端设备需要双向通信时,建立GATT连接通道进行通信是一种比较好的方式。It should be noted that the GATT connection is exclusive, that is to say, a Bluetooth network configuration device can only be connected by one terminal device at the same time. Once the Bluetooth network configuration device is connected, it will stop broadcasting immediately, so that it is not available to other devices. It can be seen that when the connection is disconnected, the Bluetooth distribution network device can start broadcasting again. When the Bluetooth distribution network device and the terminal device need two-way communication, it is a better way to establish a GATT connection channel for communication.

进一步地,所述步骤S10之前,还包括:Further, before the step S10, it also includes:

蓝牙配网设备在接收到广播指令时,根据所述广播指令确定第一当前设备状态;判断所述第一当前设备状态是否为第一预设状态;在所述第一当前设备状态为所述第一预设状态时,执行所述发送低功耗蓝牙广播的步骤。When the Bluetooth distribution network device receives the broadcast instruction, it determines the first current device state according to the broadcast instruction; judges whether the first current device state is the first preset state; when the first current device state is the In the first preset state, the step of sending low-power bluetooth broadcast is performed.

需要说明的是,由于一直进行广播比较耗费电量,因此,一般情况下用户会在使用蓝牙功能时开启广播。在用户使用蓝牙配网功能时,会输入广播指令,蓝牙配网设备在接收到用户输入的广播指令时,根据广播指令确定第一当前设备状态,所述第一当前设备状态为蓝牙配网设备的当前设备状态,包括开启广播状态和未开启广播状态,第一预设状态可为未开启广播状态,本实施例对此不作限制。It should be noted that since broadcasting all the time consumes more power, in general, users will turn on broadcasting when using the Bluetooth function. When the user uses the Bluetooth network configuration function, a broadcast command will be input. When the Bluetooth network configuration device receives the broadcast command input by the user, it determines the first current device state according to the broadcast command, and the first current device state is the Bluetooth network configuration device. The current device state of the device includes a broadcast-on state and a broadcast-off state. The first preset state may be a broadcast-off state, which is not limited in this embodiment.

也就是说,在蓝牙配网设备的当前设备状态为未开启广播状态时,执行发送低功耗蓝牙广播的步骤,从而进行广播;而在蓝牙配网设备的当前设备状态为开启广播状态时,则说明其已经在进行广播了。That is to say, when the current device state of the Bluetooth distribution network device is in the broadcast state not enabled, the step of sending low-power Bluetooth broadcast is performed to broadcast; and when the current device state of the Bluetooth distribution network device is in the broadcast state, It means that it is already broadcasting.

步骤S20,接收所述终端设备通过所述GATT连接通道发送的配网指令。Step S20: Receive a network configuration instruction sent by the terminal device through the GATT connection channel.

需要说明的是,在建立了蓝牙配网设备与终端设备之间的GATT连接通道之后,终端设备会通过GATT连接通道发送配网指令给蓝牙配网设备,蓝牙配网设备接收所述配网指令。It should be noted that after establishing the GATT connection channel between the Bluetooth network configuration device and the terminal device, the terminal device will send a network configuration command to the Bluetooth network configuration device through the GATT connection channel, and the Bluetooth network configuration device will receive the network configuration command. .

步骤S30,从所述配网指令中提取配网信息,并基于所述配网信息进行配网。Step S30, extracting network distribution information from the network distribution instruction, and performing network distribution based on the network distribution information.

需要说明的是,可从配网指令中提取配网信息,配网信息包括服务集标识和待匹配密码等信息,还可包含其他信息,本实施例对此不作限制。在获得配网信息后,可基于配网信息进行蓝牙配网。It should be noted that the network distribution information may be extracted from the network distribution instruction, and the network distribution information includes information such as the service set identifier and the password to be matched, and may also include other information, which is not limited in this embodiment. After obtaining the distribution network information, the Bluetooth distribution network can be performed based on the distribution network information.

应当理解的是,蓝牙配网设备可在获得配网信息后,可直接基于配网信息进行配网,也可将配网信息存储在本地数据库,在需要进行配网时,从本地数据库调用所述配网信息进行配网,本实施例对此不作限制。It should be understood that after obtaining the distribution network information, the Bluetooth distribution network device can directly perform network distribution based on the distribution network information, or store the distribution network information in the local database. The distribution network information is used for network distribution, which is not limited in this embodiment.

在本实施例中,通过发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道;接收所述终端设备通过所述GATT连接通道发送的配网指令;从所述配网指令中提取配网信息,并基于所述配网信息进行配网。从而通过低功耗蓝牙广播来建立终端设备与蓝牙配网设备之间的GATT连接通道,以传输配网指令,并通过配网指令中的配网信息来进行配网,提高了蓝牙配网的效率。In this embodiment, by sending the low-power bluetooth broadcast, the terminal device can establish a GATT connection channel with the bluetooth distribution network device when scanning the low-power bluetooth broadcast; The distribution network instruction sent by the GATT connection channel; the distribution network information is extracted from the distribution network instruction, and the network distribution is performed based on the distribution network information. Thereby, the GATT connection channel between the terminal device and the Bluetooth distribution network device is established through the low-power Bluetooth broadcast to transmit the distribution network command, and the network distribution is carried out through the distribution network information in the distribution network command, which improves the Bluetooth distribution network. efficiency.

在一实施例中,如图3所示,基于第一实施例提出本发明蓝牙配网方法第二实施例,所述步骤S30,包括:In one embodiment, as shown in FIG. 3 , based on the first embodiment, a second embodiment of the Bluetooth network distribution method of the present invention is proposed. The step S30 includes:

步骤S301,从所述配网指令中提取配网信息,并从所述配网信息中提取服务集标识和待匹配密码。Step S301, extracting network distribution information from the network distribution instruction, and extracting a service set identifier and a password to be matched from the network distribution information.

需要说明的是,从配网指令中提取配网信息后,可从配网信息中提取服务集标识(Service Set Identifier,SSID)和待匹配密码,通过服务集标识和待匹配密码进行配网。It should be noted that, after the network configuration information is extracted from the network configuration command, a service set identifier (SSID) and a password to be matched can be extracted from the network configuration information, and network configuration is performed through the service set identifier and the password to be matched.

步骤S302,判断本地是否存储有所述服务集标识。Step S302, it is judged whether the service set identifier is stored locally.

应当理解的是,由于蓝牙配网设备之前可能已经连接过服务集标识对应的路由器,因此需要判断本地是否存储有所述服务集标识,在本地存储有所述服务集标识时,说明之前连接过服务集标识对应的路由器;在本地没有存储所述服务集标识时,说明之前没有连接过服务集标识对应的路由器。It should be understood that since the Bluetooth distribution network device may have been connected to the router corresponding to the service set identifier before, it is necessary to determine whether the service set identifier is stored locally. When the service set identifier is stored locally, it means that it has been connected before. The router corresponding to the service set identifier; when the service set identifier is not stored locally, it means that the router corresponding to the service set identifier has not been connected before.

可以理解的是,在本地没有存储所述服务集标识时,根据所述服务集标识确定目标路由器,并根据所述服务集标识与所述待匹配密码与所述目标路由器建立网络连接。It can be understood that, when the service set identifier is not stored locally, a target router is determined according to the service set identifier, and a network connection is established with the target router according to the service set identifier and the password to be matched.

应当理解的是,因为蓝牙配网设备没有与目标路由器建立过连接,因此本地也没有存储相关的信息,此时只能根据终端设备发送的配网指令中的服务集标识和待匹配密码与目标路由器建立网络连接,可以理解为蓝牙配网设备第一次与目标路由器建立网络连接。It should be understood that because the Bluetooth distribution network device has not established a connection with the target router, there is no relevant information stored locally. At this time, only the service set identifier and the password to be matched in the distribution command sent by the terminal device can be used. The router establishes a network connection, which can be understood as the first time that the Bluetooth distribution network device establishes a network connection with the target router.

步骤S303,在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码。Step S303, when the service set identifier is stored locally, search for a target password corresponding to the service set identifier.

应当理解的是,在本地存储有服务集标识时,说明蓝牙配网设备与服务集标识对应的路由器在之前建立过网络连接,或者,之前接收过终端设备发送的配网指令,但不管是哪种情况,本地在存储有服务集标识的同时,也存储有服务集标识对应的目标密码,所述目标密码为之前与服务集标识对应的路由器建立网络连接的过程中使用的密码,或者,从之前接收的配网指令中提取的密码,本实施例对此不作限制。It should be understood that when the service set identifier is stored locally, it means that the Bluetooth network configuration device and the router corresponding to the service set identifier have established a network connection before, or have received the network configuration command sent by the terminal device before, but no matter which In this case, when the service set ID is stored locally, it also stores the target password corresponding to the service set ID, and the target password is the password used in the process of establishing a network connection with the router corresponding to the service set ID before, or, from This embodiment does not limit the password extracted from the previously received network configuration instruction.

步骤S304,基于所述服务集标识、所述待匹配密码以及所述目标密码进行配网。Step S304: Perform network configuration based on the service set identifier, the password to be matched, and the target password.

进一步地,所述步骤S304,包括:Further, the step S304 includes:

判断所述待匹配密码与所述目标密码是否一致。Determine whether the password to be matched is consistent with the target password.

可以理解的是,由于当前获取到了服务集标识和待匹配密码,而又从本地查找到了与服务集标识对应的目标密码,因此,可将待匹配密码与所述目标密码进行比较,判断待匹配密码与所述目标密码是否一致。It can be understood that since the service set identifier and the password to be matched are currently obtained, and the target password corresponding to the service set identifier is found locally, the password to be matched can be compared with the target password to determine the password to be matched. Whether the password is the same as the target password.

应当理解的是,此步骤起到一个验证的作用,通过判断待匹配密码与目标密码是否一致,来避免因用户由于失误,输入错误密码,导致连接失败的情况,从而保障了待匹配密码的准确性,也进一步提高了配网的效率。It should be understood that this step plays a role of verification. By judging whether the password to be matched is consistent with the target password, it avoids the connection failure caused by the user entering the wrong password due to mistakes, thus ensuring the accuracy of the password to be matched. It also further improves the efficiency of the distribution network.

在所述待匹配密码与所述目标密码一致时,根据所述服务集标识确定目标路由器。When the password to be matched is consistent with the target password, the target router is determined according to the service set identifier.

可以理解的是,可根据服务集标识确定目标路由器,在待匹配密码与目标密码一致时,说明此时待匹配密码的精度较高,即通过待匹配密码与目标路由器建立网络连接的成功率较高。It can be understood that the target router can be determined according to the service set identifier. When the password to be matched is the same as the target password, it means that the password to be matched has a high accuracy at this time, that is, the success rate of establishing a network connection with the target router through the password to be matched is relatively high. high.

应当理解的是,每个路由器都有其对应的服务集标识,因此,在确定服务集标识后,便可根据服务集标识确定目标路由器。It should be understood that each router has its corresponding service set identifier. Therefore, after the service set identifier is determined, the target router can be determined according to the service set identifier.

在具体实现中,例如,有D1、D2、D3三个路由器,它们的服务集标识分别为A1、A2、A3,那么,当获得的服务集标识为A1时,目标路由器显然为D1;同理,当获得的服务集标识为A2时,目标路由器为D2。In the specific implementation, for example, there are three routers D1, D2, and D3, and their service set IDs are A1, A2, and A3, respectively. Then, when the obtained service set ID is A1, the target router is obviously D1; , when the obtained service set ID is A2, the target router is D2.

但是,由于一个路由器可能并不只具有一个服务集标识,可能同时具有多个服务集标识,因此,可能存在的情况是,有D1、D2、D3三个路由器,D1对应的服务集标识为A1,D2对应的服务集标识为A2,D3对应的服务集标识为A3和A4,此时,当获得的服务集标识为A3或A4时,目标路由器都为D3,但不管怎样,都可根据服务集标识与路由器之间的对应关系确定目标路由器。However, since a router may not only have one service set ID, but may have multiple service set IDs at the same time, there may be three routers D1, D2, and D3, and the service set ID corresponding to D1 is A1. The service set ID corresponding to D2 is A2, and the service set ID corresponding to D3 is A3 and A4. At this time, when the obtained service set ID is A3 or A4, the target router is D3, but in any case, according to the service set The correspondence between the identity and the router determines the target router.

根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。Establish a network connection with the target router according to the service set identifier and the password to be matched.

在具体实现中,例如,蓝牙配网设备从配网指令中提取的服务集标识为A,待匹配密码为B,此时,需要查找本地是否存储有A,在本地存储有A时,查找本地存储的A对应的目标密码C,判断B与C是否一致,在B与C一致时,根据A确定目标服务器D,并根据A、B与D建立网络连接。In a specific implementation, for example, the service set identifier extracted by the Bluetooth distribution network device from the network distribution command is A, and the password to be matched is B. At this time, it is necessary to find out whether A is stored locally, and when A is stored locally, find the local The stored target password C corresponding to A is used to determine whether B and C are consistent. When B and C are consistent, target server D is determined according to A, and a network connection is established according to A, B, and D.

在本实施例中,通过从所述配网指令中提取配网信息,并从所述配网信息中提取服务集标识和待匹配密码;判断本地是否存储有所述服务集标识;在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码;判断所述待匹配密码与所述目标密码是否一致;在所述待匹配密码与所述目标密码一致时,根据所述服务集标识确定目标路由器;根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。从而在本地存储有服务集标识时,先对待匹配密码进行验证,在验证通过之后再基于服务集标识和待匹配密码与目标路由器建立网络连接,提高了配网的成功率,也进一步提升了配网效率。In this embodiment, by extracting the distribution network information from the network distribution instruction, and extracting the service set identifier and the password to be matched from the network distribution information; it is determined whether the service set identifier is stored locally; When there is the service set identifier, look up the target password corresponding to the service set identifier; judge whether the password to be matched is consistent with the target password; when the password to be matched is consistent with the target password, according to the The service set identifier is used to determine a target router; and a network connection is established with the target router according to the service set identifier and the password to be matched. Therefore, when the service set ID is stored locally, the password to be matched is verified first, and after the verification is passed, a network connection is established with the target router based on the service set ID and the password to be matched, which improves the success rate of the distribution network and further improves the distribution network. network efficiency.

在一实施例中,如图4所示,基于第一实施例提出本发明蓝牙配网方法第三实施例,所述步骤S10之前,还包括:In an embodiment, as shown in FIG. 4 , based on the first embodiment, a third embodiment of the Bluetooth network distribution method of the present invention is proposed. Before the step S10, the method further includes:

步骤S001,获取设备信息,并根据所述设备信息生成设备标识。Step S001, acquiring device information, and generating a device identifier according to the device information.

需要说明的是,在发送低功耗蓝牙广播之前,还可获取设备信息,应当理解的是,所述设备信息可为蓝牙配网设备的设备信息,其中,设备信息可包括设备名称、设备ID、蓝牙MAC地址、设备序列号和厂商ID中至少一项关于本设备的信息,还可包括其他信息,本实施例对此不作限制。It should be noted that, before sending the Bluetooth low energy broadcast, device information can also be obtained. It should be understood that the device information may be the device information of the Bluetooth distribution network device, wherein the device information may include the device name, device ID , Bluetooth MAC address, device serial number, and manufacturer ID at least one item of information about the device, and may also include other information, which is not limited in this embodiment.

进一步地,所述步骤S001,包括:Further, the step S001 includes:

从所述设备信息中提取设备标识信息;根据所述设备标识信息确定设备标识。Extracting device identification information from the device information; determining a device identification according to the device identification information.

应当理解的是,蓝牙配网设备在发送低功耗蓝牙广播之前,可获取本设备的设备信息,获取本设备的设备信息的方式可为从本地数据库查找,或者从云端数据库查找,本实施例对此不作限制。It should be understood that the Bluetooth distribution network device can obtain the device information of the device before sending the low-power Bluetooth broadcast, and the method of obtaining the device information of the device can be searched from the local database or the cloud database. There is no restriction on this.

可以理解的是,可从设备信息中提取设备标识信息,然后将提取出的设备标识信息作为设备标识,根据设备标识生成蓝牙广播信息,在终端设备扫描到低功耗蓝牙广播时,根据设备标识来确定需要连接的蓝牙配网设备。It can be understood that the device identification information can be extracted from the device information, and then the extracted device identification information can be used as the device identification, and the Bluetooth broadcast information can be generated according to the device identification. To determine the Bluetooth distribution network device that needs to be connected.

应当理解的是,终端设备可通过NFC、二维码扫码或其他传输方式获得蓝牙配网设备的设备标识信息,得到设备标识后,便可根据之前获得的设备标识信息和扫描得到的设备标识来确定需要连接的蓝牙配网设备。It should be understood that the terminal device can obtain the device identification information of the Bluetooth distribution network device through NFC, QR code scanning or other transmission methods. To determine the Bluetooth distribution network device that needs to be connected.

在具体实现中,以设备标识信息为设备ID为例来进行说明。终端设备已经提前通过上述方式获得了多个蓝牙配网设备的设备ID,可分别为ID1、ID2、ID3,分别对应蓝牙配网设备1、蓝牙配网设备2、蓝牙配网设备3。蓝牙配网设备1查找本设备的ID1,并将ID1作为设备标识,根据设备标识生成蓝牙广播信息进行低功耗蓝牙广播。终端设备在扫描到低功耗蓝牙广播时,从中获得设备标识为ID1,然后将ID1与之前获得的多个蓝牙配网设备ID进行匹配,根据匹配结果可知需要连接的蓝牙配网设备为蓝牙配网设备1。In a specific implementation, the device identification information is taken as an example of a device ID for description. The terminal device has obtained the device IDs of multiple Bluetooth network configuration devices in advance through the above method, which can be ID1, ID2, and ID3, respectively, corresponding to Bluetooth network configuration device 1, Bluetooth network configuration device 2, and Bluetooth network configuration device 3. The Bluetooth distribution network device 1 searches for the ID1 of the device, uses the ID1 as the device identification, and generates Bluetooth broadcast information according to the device identification for low-power Bluetooth broadcast. When the terminal device scans the low-power Bluetooth broadcast, it obtains the device identification as ID1, and then matches ID1 with the IDs of multiple Bluetooth distribution network devices obtained before. According to the matching result, it can be known that the Bluetooth distribution network device that needs to be connected is a Bluetooth distribution network device. network device 1.

步骤S002,根据所述设备标识生成蓝牙广播信息。Step S002, generating Bluetooth broadcast information according to the device identifier.

应当理解的是,在确定蓝牙配网设备对应的设备标识后,可根据设备标识生成蓝牙广播信息,基于蓝牙广播信息进行蓝牙广播。It should be understood that, after determining the device identifier corresponding to the Bluetooth distribution network device, the Bluetooth broadcast information can be generated according to the device identifier, and the Bluetooth broadcast can be performed based on the Bluetooth broadcast information.

相应地,所述步骤S10,包括:Correspondingly, the step S10 includes:

步骤S101,基于所述蓝牙广播信息发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,根据所述蓝牙广播信息确定设备标识,并根据所述设备标识建立与蓝牙配网设备之间的GATT连接通道。Step S101, sending low-power bluetooth broadcast based on the bluetooth broadcast information, so that when the terminal device scans the low-power bluetooth broadcast, it determines a device identifier according to the bluetooth broadcast information, and establishes a connection with the device identifier according to the device identifier. GATT connection channel between Bluetooth distribution network devices.

应当理解的是,蓝牙配网设备基于蓝牙广播信息发送低功耗蓝牙广播进行蓝牙广播,终端设备进行蓝牙扫描,在扫描到低功耗蓝牙广播时,可获取蓝牙广播信息,并从蓝牙广播信息中提取设备标识。It should be understood that the bluetooth distribution network device sends low-power bluetooth broadcast based on the bluetooth broadcast information for bluetooth broadcast, and the terminal device performs bluetooth scanning. Extract the device ID from the .

可以理解的是,终端设备根据设备标识确定所述设备标识对应的蓝牙配网设备,然后建立与蓝牙配网设备之间的GATT连接通道。It can be understood that the terminal device determines the Bluetooth network configuration device corresponding to the device identification according to the device identification, and then establishes a GATT connection channel with the Bluetooth network configuration device.

在具体实现中,例如,在终端设备根据上述步骤确定需要连接的终端设备为蓝牙配网设备1时,建立与蓝牙配网设备1之间的GATT通道连接。In a specific implementation, for example, when the terminal device determines that the terminal device to be connected is the Bluetooth network configuration device 1 according to the above steps, a GATT channel connection with the Bluetooth network configuration device 1 is established.

在本实施例中,通过获取设备信息,并根据所述设备信息生成设备标识;根据所述设备标识生成蓝牙广播信息;基于所述蓝牙广播信息发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,根据所述蓝牙广播信息确定设备标识,并根据所述设备标识建立与蓝牙配网设备之间的GATT连接通道。从而生成设备标识,根据设备标识生成蓝牙广播信息进行蓝牙广播,终端设备根据设备标识建立与蓝牙配网设备之间的GATT连接通道,提高了建立GATT连接通道的效率。In this embodiment, by acquiring device information, and generating a device identifier according to the device information; generating Bluetooth broadcast information according to the device identifier; sending low-power Bluetooth broadcast based on the Bluetooth broadcast information, so that the terminal device is scanning When the low-power bluetooth broadcasts, the device identifier is determined according to the bluetooth broadcast information, and the GATT connection channel with the bluetooth distribution network device is established according to the device identifier. Thereby, the device identification is generated, the Bluetooth broadcast information is generated according to the device identification for Bluetooth broadcasting, and the terminal device establishes a GATT connection channel with the Bluetooth distribution network device according to the device identification, which improves the efficiency of establishing the GATT connection channel.

参照图5,图5为本发明蓝牙配网方法第四实施例的流程示意图。Referring to FIG. 5, FIG. 5 is a schematic flowchart of a fourth embodiment of a Bluetooth network distribution method according to the present invention.

如图5所示,在第四实施例中,所述蓝牙配网方法包括以下步骤:As shown in FIG. 5 , in the fourth embodiment, the Bluetooth network distribution method includes the following steps:

步骤S10',进行蓝牙扫描,在扫描到蓝牙配网设备发送的低功耗蓝牙广播时,建立与所述蓝牙配网设备之间的GATT连接通道。。Step S10', performing Bluetooth scanning, and establishing a GATT connection channel with the Bluetooth network configuration device when scanning the low-power Bluetooth broadcast sent by the Bluetooth network configuration device. .

需要说明的是,本实施例的执行主体可为终端设备,还可为其他可实现相同或相似功能的设备,本实施例对此不作限制,在本实施例中,以蓝牙配网设备为例进行说明。其中,所述终端设备包含处理器和wifi蓝牙模块,还可包含其他模块,本实施例对此不作限制。It should be noted that the executive body of this embodiment may be a terminal device, or other devices that can implement the same or similar functions, which is not limited in this embodiment. In this embodiment, a Bluetooth network distribution device is used as an example Be explained. The terminal device includes a processor and a wifi Bluetooth module, and may also include other modules, which are not limited in this embodiment.

需要说明的是,蓝牙配网设备可为具有广播功能的设备,终端设备可为具有扫描功能的设备,由蓝牙配网设备发送低功耗蓝牙(Bluetooth Low Energy,BLE)广播,终端设备进行扫描。当然,蓝牙配网设备也可具有扫描功能,终端设备也可具有广播功能,由终端设备发送BLE广播,蓝牙配网设备进行扫描,本实施例对此不作限制。It should be noted that the Bluetooth distribution network device may be a device with a broadcast function, and the terminal device may be a device with a scanning function. The Bluetooth distribution network device sends a Bluetooth Low Energy (BLE ) broadcast, and the terminal device scans . Of course, the Bluetooth network configuration device may also have a scanning function, and the terminal device may also have a broadcast function. The terminal device sends BLE broadcast, and the Bluetooth network configuration device scans, which is not limited in this embodiment.

应当理解的是,蓝牙配网设备发送BLE广播,然后在蓝牙配网设备发送BLE广播的同时,或者在蓝牙配网设备发送BLE广播之后,进行蓝牙扫描,具体地,所述蓝牙扫描为BLE扫描。It should be understood that the Bluetooth network configuration device sends a BLE broadcast, and then performs a Bluetooth scan while the Bluetooth network configuration device sends a BLE broadcast, or after the Bluetooth network configuration device sends a BLE broadcast. Specifically, the Bluetooth scan is a BLE scan. .

需要说明的是,经典蓝牙的工作信道为79个,而BLE的工作信道为3个,因此BLE扫描相较于经典蓝牙扫描,扫描以及连接的效率提升了很多倍,而且,正是因为扫描以及连接的效率的提升,也进一步提升了蓝牙配网的效率。It should be noted that the working channels of classic Bluetooth are 79, while the working channels of BLE are 3. Therefore, BLE scanning is much more efficient than classical Bluetooth scanning, scanning and connection. Moreover, it is precisely because of scanning and The improvement of connection efficiency also further improves the efficiency of Bluetooth distribution network.

可以理解的是,进行蓝牙扫描,获得扫描列表,判断扫描列表中是否存在蓝牙配网设备发送的BLE广播,若扫描列表中存在蓝牙配网设备发送的BLE广播,说明此时扫描到了所述BLE广播,基于所述BLE广播建立与所述蓝牙配网设备之间的GATT连接通道。It is understandable that, perform a Bluetooth scan, obtain a scan list, and determine whether there is a BLE broadcast sent by a Bluetooth network configuration device in the scan list. If there is a BLE broadcast sent by a Bluetooth network configuration device in the scan list, it means that the BLE has been scanned at this time. Broadcast, establish a GATT connection channel with the Bluetooth distribution network device based on the BLE broadcast.

应当理解的是,现在BLE连接都是建立在GATT(Generic Attribute Profile)协议之上的,GATT是一个在蓝牙连接之上的发送和接收很短的数据段的通用规范,因此,可根据GATT协议建立蓝牙配网设备与终端设备之间的GATT连接通道,蓝牙配网设备与终端设备根据GATT连接通道来进行数据传输。It should be understood that BLE connections are now based on the GATT (Generic Attribute Profile) protocol. GATT is a general specification for sending and receiving short data segments over a Bluetooth connection. Therefore, according to the GATT protocol A GATT connection channel between the Bluetooth distribution network device and the terminal device is established, and the Bluetooth distribution network device and the terminal device perform data transmission according to the GATT connection channel.

需要说明的是,GATT连接是独占的,也就是说一个蓝牙配网设备同时只能被一个终端设备连接,一旦蓝牙配网设备被连接,它就会马上停止广播,这样它就对其他设备不可见了,当连接断开时,蓝牙配网设备就又可开始广播。在蓝牙配网设备与终端设备需要双向通信时,建立GATT连接通道进行通信是一种比较好的方式。It should be noted that the GATT connection is exclusive, that is to say, a Bluetooth network configuration device can only be connected by one terminal device at the same time. Once the Bluetooth network configuration device is connected, it will stop broadcasting immediately, so that it is not available to other devices. It can be seen that when the connection is disconnected, the Bluetooth distribution network device can start broadcasting again. When the Bluetooth distribution network device and the terminal device need two-way communication, it is a better way to establish a GATT connection channel for communication.

进一步地,所述进行蓝牙扫描的步骤,包括:Further, the step of performing bluetooth scanning includes:

所述终端设备在获取到配网请求指令时,根据所述配网请求指令获取第二当前设备状态;判断所述第二当前设备状态是否为第二预设状态;在所述第二当前设备状态为所述第二预设状态时,启动蓝牙扫描程序;通过所述蓝牙扫描程序进行蓝牙扫描。When the terminal device acquires the network distribution request instruction, it acquires the second current device state according to the network distribution request instruction; judges whether the second current device state is the second preset state; When the state is the second preset state, the Bluetooth scanning program is started; the Bluetooth scanning program is performed through the Bluetooth scanning program.

需要说明的是,终端设备在接收到用户输入的配网请求指令时,根据配网请求指令获取第二当前设备状态,所述第二当前设备状态为终端设备的当前设备状态,包括扫描状态和未扫描状态,第二预设状态可为为未扫描状态,其中,所述扫描状态为开启扫描功能的状态,未扫描状态为未开启扫描功能的状态。判断第二当前设备状态是否为第二预设状态,在第二当前设备状态为未扫描状态时,启动蓝牙扫描程序,通过蓝牙扫描程序进行蓝牙扫描,其中,蓝牙扫描程序为具有蓝牙扫描功能的程序,本实施例对此不作限制。It should be noted that when the terminal device receives the network configuration request command input by the user, it obtains the second current device state according to the network configuration request command, and the second current device state is the current device state of the terminal device, including the scan state and In the unscanned state, the second preset state may be an unscanned state, wherein the scanning state is a state in which the scanning function is turned on, and the unscanned state is a state in which the scanning function is not turned on. Determine whether the second current device state is the second preset state, and when the second current device state is the unscanned state, start the Bluetooth scanning program, and perform Bluetooth scanning through the Bluetooth scanning program, wherein the Bluetooth scanning program is a Bluetooth scanning program. program, which is not limited in this embodiment.

需要说明的是,进行蓝牙扫描,在扫描到蓝牙配网设备发送的BLE广播时,根据所述BLE广播和GATT协议建立与蓝牙配网设备之间的GATT连接通道,通过GATT连接通道来与蓝牙配网设备进行通信。It should be noted that when performing Bluetooth scanning, when scanning the BLE broadcast sent by the Bluetooth distribution network device, establish a GATT connection channel with the Bluetooth distribution network device according to the BLE broadcast and the GATT protocol, and use the GATT connection channel to communicate with Bluetooth. Communication with distribution network equipment.

步骤S20',生成配网指令,通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取配网信息,并基于所述配网信息进行配网。Step S20', generating a network distribution instruction, and sending the network distribution instruction to the Bluetooth network distribution device through the GATT connection channel, so that the Bluetooth network distribution device extracts network distribution information from the network distribution instruction, And the distribution network is performed based on the distribution network information.

需要说明的是,在建立了终端设备与蓝牙配网设备之间的GATT通道之后,终端设备生成配网指令,通过GATT通道将配网指令发送至蓝牙配网设备,由蓝牙配网设备从配网指令中提取配网信息,并基于配网信息进行配网。It should be noted that after establishing the GATT channel between the terminal device and the Bluetooth network configuration device, the terminal device generates a network configuration command, and sends the network configuration command to the Bluetooth network configuration device through the GATT channel. The distribution network information is extracted from the network command, and the distribution network is carried out based on the distribution network information.

应当理解的是,蓝牙配网设备可在获取配网信息后,可直接基于配网信息进行蓝牙配网,也可将配网信息存储在本地数据库,在需要进行配网时,从本地数据库调用所述配网信息进行配网,本实施例对此不作限制。It should be understood that after obtaining the network distribution information, the Bluetooth network configuration device can directly perform the Bluetooth network distribution based on the network distribution information, or store the network distribution information in the local database, and call it from the local database when network distribution needs to be performed. The network distribution information is used for network distribution, which is not limited in this embodiment.

在本实施例中,通过进行蓝牙扫描;在扫描到蓝牙配网设备发送的低功耗蓝牙广播时,建立与所述蓝牙配网设备之间的GATT连接通道;生成配网指令,通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取配网信息,并基于所述配网信息进行配网。从而通过低功耗蓝牙广播来建立终端设备与蓝牙配网设备之间的GATT连接通道,以传输配网指令,并通过配网指令中的配网信息来进行配网,提高了蓝牙配网的效率。In this embodiment, by performing bluetooth scanning; when scanning the low-power bluetooth broadcast sent by the bluetooth network distribution device, establish a GATT connection channel with the bluetooth network distribution device; The GATT connection channel sends the network distribution instruction to the Bluetooth network distribution device, so that the Bluetooth network distribution device extracts network distribution information from the network distribution instruction, and performs network distribution based on the network distribution information. Thereby, the GATT connection channel between the terminal device and the Bluetooth distribution network device is established through the low-power Bluetooth broadcast to transmit the distribution network command, and the network distribution is carried out through the distribution network information in the distribution network command, which improves the Bluetooth distribution network. efficiency.

应当理解的是,低功耗蓝牙广播中携带有蓝牙配网设备的设备标识,终端设备可根据设备标识确定蓝牙配网设备,因此,终端设备在扫描到低功耗蓝牙广播时,可根据蓝牙广播信息确定设备标识,并根据设备标识建立与蓝牙配网设备之间的GATT连接通道。It should be understood that the low-power Bluetooth broadcast carries the device identification of the Bluetooth network configuration device, and the terminal device can determine the Bluetooth network configuration device according to the device identification. Therefore, when the terminal device scans the low-power Bluetooth broadcast, it can be based on Bluetooth. The broadcast information determines the device identification, and establishes a GATT connection channel with the Bluetooth distribution network device according to the device identification.

进一步地,所述步骤S20',包括:Further, the step S20' includes:

接收用户输入的服务集标识和待匹配密码,根据所述服务集标识和所述待匹配密码生成配网信息,并根据所述配网信息生成配网指令。Receive the service set identifier and the password to be matched input by the user, generate network distribution information according to the service set identifier and the to-be-matched password, and generate a network distribution instruction according to the network distribution information.

需要说明的是,用户在终端设备上输入服务集标识和待匹配密码,终端设备接收用户输入的服务集标识和待匹配密码,根据服务集标识和待匹配密码生成配网信息,其中,除了以上方式外,还可从终端设备的本地数据中获取预先存储的服务集标识和待匹配密码,还可为其他方式,本实施例对此不作限制。It should be noted that the user enters the service set identifier and the password to be matched on the terminal device, and the terminal device receives the service set identifier and the password to be matched entered by the user, and generates network distribution information according to the service set identifier and the password to be matched. In addition to the method, the pre-stored service set identifier and the password to be matched can also be obtained from the local data of the terminal device, or other methods, which are not limited in this embodiment.

应当理解的是,在根据服务集标识和待匹配密码生成配网信息后,可根据配网信息生成配网指令,将配网指令发送至蓝牙配网设备。It should be understood that, after the network configuration information is generated according to the service set identifier and the password to be matched, a network configuration instruction can be generated according to the network configuration information, and the network configuration instruction can be sent to the Bluetooth network configuration device.

通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取所述配网信息,从所述配网信息中提取所述服务集标识和所述待匹配密码,判断本地是否存储有所述服务集标识,在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码,判断所述待选密码与所述目标密码是否一致,在所述待匹配密码与所述目标密码一致时,根据服务器标识确定目标路由器,根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。The network configuration command is sent to the Bluetooth network configuration device through the GATT connection channel, so that the Bluetooth network configuration device extracts the network configuration information from the network configuration command, and extracts the network configuration information from the network configuration information. Extract the service set identifier and the password to be matched, determine whether the service set identifier is stored locally, and when the service set identifier is stored locally, search for the target password corresponding to the service set identifier, and determine the Whether the password to be selected is consistent with the target password, when the password to be matched is consistent with the target password, the target router is determined according to the server identifier, and the target router is established according to the service set identifier and the password to be matched. Internet connection.

需要说明的是,在生成配网指令后,通过之前建立的GATT通道将配网指令发送至蓝牙配网设备,蓝牙配网设备在接收到配网指令后,可从配网指令中提取配网信息,然后从配网信息中提取服务集标识和待匹配密码,然后由蓝牙配网设备查找与服务集标识对应的目标密码,然后将待匹配密码与目标密码进行比较,判断待匹配密码与目标密码是否一致,在待匹配密码与目标密码一致时,对待匹配密码的验证通过,在验证通过后可基于服务集标识和待匹配密码进行配网。It should be noted that after generating the network distribution command, the network configuration command is sent to the Bluetooth network configuration device through the previously established GATT channel. After receiving the network configuration command, the Bluetooth network configuration device can extract the network distribution command from the network configuration command. information, and then extract the service set identifier and the password to be matched from the distribution network information, and then the Bluetooth distribution network device searches for the target password corresponding to the service set identifier, and then compares the password to be matched with the target password to determine the password to be matched and the target password. Whether the passwords are the same, when the password to be matched is the same as the target password, the verification of the password to be matched is passed. After the verification is passed, the network can be configured based on the service set identifier and the password to be matched.

应当理解的是,由于蓝牙配网设备之前可能已经连接过服务集标识对应的路由器,因此需要判断本地是否存储有所述服务集标识,在本地存储有所述服务集标识时,说明之前连接过服务集标识对应的路由器;在本地没有存储所述服务集标识时,说明之前没有连接过服务集标识对应的路由器。It should be understood that since the Bluetooth distribution network device may have been connected to the router corresponding to the service set identifier before, it is necessary to determine whether the service set identifier is stored locally. When the service set identifier is stored locally, it means that it has been connected before. The router corresponding to the service set identifier; when the service set identifier is not stored locally, it means that the router corresponding to the service set identifier has not been connected before.

可以理解的是,在本地没有存储所述服务集标识时,根据所述服务集标识确定目标路由器,并根据所述服务集标识与所述待匹配密码与所述目标路由器建立网络连接。It can be understood that, when the service set identifier is not stored locally, a target router is determined according to the service set identifier, and a network connection is established with the target router according to the service set identifier and the password to be matched.

应当理解的是,因为蓝牙配网设备没有与目标路由器建立过连接,因此本地也没有存储相关的信息,此时只能根据终端设备发送的配网指令中的服务集标识和待匹配密码与目标路由器建立网络连接,可以理解为蓝牙配网设备第一次与目标路由器建立网络连接。It should be understood that because the Bluetooth distribution network device has not established a connection with the target router, there is no relevant information stored locally. At this time, only the service set identifier and the password to be matched in the distribution command sent by the terminal device can be used. The router establishes a network connection, which can be understood as the first time that the Bluetooth distribution network device establishes a network connection with the target router.

应当理解的是,在本地存储有服务集标识时,说明蓝牙配网设备与服务集标识对应的路由器在之前建立过网络连接,或者,之前接收过终端设备发送的配网指令,但不管是哪种情况,本地在存储有服务集标识的同时,也存储有服务集标识对应的目标密码,所述目标密码为之前与服务集标识对应的路由器建立网络连接的过程中使用的密码,或者,从之前接收的配网指令中提取的密码,本实施例对此不作限制。It should be understood that when the service set identifier is stored locally, it means that the Bluetooth network configuration device and the router corresponding to the service set identifier have established a network connection before, or have received the network configuration command sent by the terminal device before, but no matter which In this case, while the service set ID is stored locally, the target password corresponding to the service set ID is also stored, and the target password is the password used in the process of establishing a network connection with the router corresponding to the service set ID before, or, from This embodiment does not limit the password extracted from the previously received network configuration instruction.

可以理解的是,由于当前获取到了服务集标识和待匹配密码,而又从本地查找到了与服务集标识对应的目标密码,因此,可将待匹配密码与所述目标密码进行比较,判断待匹配密码与所述目标密码是否一致。It can be understood that since the service set identifier and the password to be matched are currently obtained, and the target password corresponding to the service set identifier is found locally, the password to be matched can be compared with the target password to determine the password to be matched. Whether the password is the same as the target password.

应当理解的是,此步骤起到一个验证的作用,通过判断待匹配密码与目标密码是否一致,来避免因用户由于失误,输入错误密码,导致连接失败的情况,从而保障了待匹配密码的准确性,也进一步提高了配网的效率。It should be understood that this step plays a role of verification. By judging whether the password to be matched is consistent with the target password, it avoids the connection failure caused by the user entering the wrong password due to mistakes, thus ensuring the accuracy of the password to be matched. It also further improves the efficiency of the distribution network.

可以理解的是,可根据服务集标识确定目标路由器,在待匹配密码与目标密码一致时,说明此时待匹配密码的精度较高,即通过待匹配密码与目标路由器建立网络连接的成功率较高。It can be understood that the target router can be determined according to the service set identifier. When the password to be matched is the same as the target password, it means that the password to be matched has a high accuracy at this time, that is, the success rate of establishing a network connection with the target router through the password to be matched is relatively high. high.

应当理解的是,每个路由器都有其对应的服务集标识,因此,在确定服务集标识后,便可根据服务集标识确定目标路由器。It should be understood that each router has its corresponding service set identifier. Therefore, after the service set identifier is determined, the target router can be determined according to the service set identifier.

在具体实现中,例如,有D1、D2、D3三个路由器,它们的服务集标识分别为A1、A2、A3,那么,当获得的服务集标识为A1时,目标路由器显然为D1;同理,当获得的服务集标识为A2时,目标路由器为D2。In the specific implementation, for example, there are three routers D1, D2, and D3, and their service set IDs are A1, A2, and A3, respectively. Then, when the obtained service set ID is A1, the target router is obviously D1; , when the obtained service set ID is A2, the target router is D2.

但是,由于一个路由器可能并不只具有一个服务集标识,可能同时具有多个服务集标识,因此,可能存在的情况是,有D1、D2、D3三个路由器,D1对应的服务集标识为A1,D2对应的服务集标识为A2,D3对应的服务集标识为A3和A4,此时,当获得的服务集标识为A3或A4时,目标路由器都为D3,但不管怎样,都可根据服务集标识与路由器之间的对应关系确定目标路由器。However, since a router may not only have one service set ID, but may have multiple service set IDs at the same time, there may be three routers D1, D2, and D3, and the service set ID corresponding to D1 is A1. The service set ID corresponding to D2 is A2, and the service set ID corresponding to D3 is A3 and A4. At this time, when the obtained service set ID is A3 or A4, the target router is D3, but in any case, according to the service set The correspondence between the identity and the router determines the target router.

在具体实现中,例如,蓝牙配网设备从配网指令中提取的服务集标识为A,待匹配密码为B,此时,需要查找本地是否存储有A,在本地存储有A时,查找本地存储的A对应的目标密码C,判断B与C是否一致,在B与C一致时,根据A确定目标服务器D,并根据A、B与D建立网络连接。In a specific implementation, for example, the service set identifier extracted by the Bluetooth distribution network device from the network distribution command is A, and the password to be matched is B. At this time, it is necessary to find out whether A is stored locally, and when A is stored locally, find the local The stored target password C corresponding to A is used to determine whether B and C are consistent. When B and C are consistent, target server D is determined according to A, and a network connection is established according to A, B, and D.

在本实施例中,通过接收用户输入的服务集标识和待匹配密码,并根据所述服务集标识和所述待匹配密码生成配网信息;根据所述配网信息生成配网指令;通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取所述配网信息,从所述配网信息中提取所述服务集标识和所述待匹配密码,判断本地是否存储有所述服务集标识,在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码,判断所述待选密码与所述目标密码是否一致,在所述待匹配密码与所述目标密码一致时,根据服务器标识确定目标路由器,根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。从而在根据服务集标识和待匹配密码生成配网指令发送至蓝牙配网设备,在蓝牙配网设备的本地存储有服务集标识时,先对待匹配密码进行验证,在验证通过之后再基于服务集标识和待匹配密码与目标路由器建立网络连接,提高了配网的成功率,也进一步提升了配网效率。In this embodiment, by receiving the service set identifier and the password to be matched input by the user, and generating network distribution information according to the service set identifier and the password to be matched; generating network distribution instructions according to the network distribution information; The GATT connection channel sends the network distribution instruction to the Bluetooth network distribution device, so that the Bluetooth network distribution device extracts the network distribution information from the network distribution instruction, and extracts all the network distribution information from the network distribution information. The service set identifier and the password to be matched are determined, whether the service set identifier is stored locally, and when the service set identifier is stored locally, the target password corresponding to the service set identifier is searched, and the candidate password is determined. Whether the password is consistent with the target password, when the password to be matched is consistent with the target password, determine the target router according to the server ID, and establish a network connection with the target router according to the service set ID and the password to be matched. . Therefore, according to the service set identifier and the password to be matched, the network distribution command is generated and sent to the Bluetooth distribution device. When the service set identifier is stored locally in the Bluetooth distribution device, the password to be matched is verified first, and then based on the service set after the verification is passed. The identification and the password to be matched establish a network connection with the target router, which improves the success rate of the distribution network and further improves the distribution efficiency.

此外,为实现上述目的,本发明还提出一种终端设备,所述终端设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的蓝牙配网程序,所述蓝牙配网程序配置为实现如上文所述的蓝牙配网方法的步骤。In addition, in order to achieve the above object, the present invention also provides a terminal device, the terminal device includes: a memory, a processor, and a Bluetooth network configuration program stored in the memory and running on the processor, the The Bluetooth network configuration program is configured to implement the steps of the Bluetooth network configuration method described above.

此外,本发明实施例还提出一种存储介质,所述存储介质上存储有蓝牙配网程序,所述蓝牙配网程序被处理器执行如上文所述的蓝牙配网方法的步骤。In addition, an embodiment of the present invention also provides a storage medium, where a Bluetooth network configuration program is stored on the storage medium, and the Bluetooth network configuration program is executed by a processor to perform the steps of the Bluetooth network configuration method described above.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。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.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该估算机软件产品存储在如上所述的一个估算机可读存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台智能设备(可以是手机,估算机,蓝牙配网设备,空调器,或者网络蓝牙配网设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on such understanding, the technical solution of the present invention essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the estimator software product is stored in an estimator-readable storage medium as described above. (such as ROM/RAM, magnetic disk, optical disk), including several instructions to make a smart device (which can be a mobile phone, an estimator, a Bluetooth distribution network device, an air conditioner, or a network Bluetooth distribution network device, etc.) to implement the present invention The methods described in the various examples.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.

Claims (10)

1.一种蓝牙配网方法,其特征在于,所述蓝牙配网方法包括以下步骤:1. A bluetooth network distribution method, characterized in that, the bluetooth network distribution method comprises the following steps: 发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道;Sending a low-power bluetooth broadcast, so that the terminal device establishes a GATT connection channel with the bluetooth distribution network device when scanning the low-power bluetooth broadcast; 接收所述终端设备通过所述GATT连接通道发送的配网指令;receiving a network configuration command sent by the terminal device through the GATT connection channel; 从所述配网指令中提取配网信息,并基于所述配网信息进行配网。The distribution network information is extracted from the distribution network instruction, and the network distribution is performed based on the distribution network information. 2.如权利要求1所述的蓝牙配网方法,其特征在于,所述从所述配网指令中提取配网信息,并基于所述配网信息进行配网,具体包括:2 . The Bluetooth network distribution method according to claim 1 , wherein the extracting network distribution information from the network distribution instruction, and performing network distribution based on the network distribution information, specifically comprising: 2 . 从所述配网指令中提取配网信息,并从所述配网信息中提取服务集标识和待匹配密码;extracting network distribution information from the network distribution instruction, and extracting a service set identifier and a password to be matched from the network distribution information; 判断本地是否存储有所述服务集标识;Determine whether the service set identifier is stored locally; 在本地存储有所述服务集标识时,查找与所述服务集标识对应的目标密码;When the service set identifier is stored locally, searching for a target password corresponding to the service set identifier; 基于所述服务集标识、所述待匹配密码以及所述目标密码进行配网。Network configuration is performed based on the service set identifier, the password to be matched, and the target password. 3.如权利要求2所述的蓝牙配网方法,其特征在于,所述基于所述服务集标识、所述待匹配密码以及所述目标密码进行配网,具体包括:3 . The Bluetooth network distribution method according to claim 2 , wherein the performing network distribution based on the service set identifier, the password to be matched and the target password, specifically comprising: 3 . 判断所述待匹配密码与所述目标密码是否一致;Determine whether the password to be matched is consistent with the target password; 在所述待匹配密码与所述目标密码一致时,根据所述服务集标识确定目标路由器;When the password to be matched is consistent with the target password, determining a target router according to the service set identifier; 根据所述服务集标识和所述待匹配密码与所述目标路由器建立网络连接。Establish a network connection with the target router according to the service set identifier and the password to be matched. 4.如权利要求1~3中任一项所述的蓝牙配网方法,其特征在于,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道之前,还包括:4. The Bluetooth network distribution method according to any one of claims 1 to 3, wherein the sending low-power bluetooth broadcast, so that the terminal device, when scanning the low-power bluetooth broadcast, establishes a Before the GATT connection channel with the Bluetooth distribution network device, it also includes: 在接收到广播指令时,根据所述广播指令确定第一当前设备状态;When receiving the broadcast instruction, determine the first current device state according to the broadcast instruction; 判断所述第一当前设备状态是否为第一预设状态;judging whether the first current device state is the first preset state; 在所述第一当前设备状态为所述第一预设状态时,执行所述发送低功耗蓝牙广播的步骤。When the first current device state is the first preset state, the step of sending the Bluetooth low energy consumption broadcast is performed. 5.如权利要求1~3中任一项所述的蓝牙配网方法,其特征在于,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道之前,还包括:5. The Bluetooth network distribution method according to any one of claims 1 to 3, wherein the sending low-power bluetooth broadcast, so that the terminal device, when scanning the low-power bluetooth broadcast, establishes a Before the GATT connection channel with the Bluetooth distribution network device, it also includes: 获取设备信息,并根据所述设备信息生成设备标识;Obtain device information, and generate a device identifier according to the device information; 根据所述设备标识生成蓝牙广播信息;generating Bluetooth broadcast information according to the device identification; 相应地,所述发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,建立与蓝牙配网设备之间的GATT连接通道,具体包括:Correspondingly, the sending low-power bluetooth broadcast, so that when the terminal device scans the low-power bluetooth broadcast, establishes a GATT connection channel with the bluetooth distribution network device, specifically including: 基于所述蓝牙广播信息发送低功耗蓝牙广播,以使终端设备在扫描到所述低功耗蓝牙广播时,根据所述蓝牙广播信息确定设备标识,并根据所述设备标识建立与蓝牙配网设备之间的GATT连接通道。Send low-power bluetooth broadcasts based on the bluetooth broadcast information, so that when the terminal device scans the low-power bluetooth broadcasts, it determines a device identity according to the bluetooth broadcast information, and establishes a network with Bluetooth according to the device identity. GATT connection channel between devices. 6.如权利要求5所述的蓝牙配网方法,其特征在于,所述获取设备信息,并根据所述设备信息生成设备标识,具体包括:6. The Bluetooth network distribution method according to claim 5, wherein the acquiring device information and generating a device identifier according to the device information specifically include: 从所述设备信息中提取设备标识信息;extracting device identification information from the device information; 根据所述设备标识信息确定设备标识。The device identification is determined according to the device identification information. 7.如权利要求6所述的蓝牙配网方法,其特征在于,所述设备标识信息包括:设备ID、蓝牙MAC地址、设备序列号和厂商ID中的至少一项。7 . The Bluetooth network distribution method according to claim 6 , wherein the device identification information comprises: at least one of a device ID, a Bluetooth MAC address, a device serial number and a manufacturer ID. 8 . 8.一种蓝牙配网方法,其特征在于,所述蓝牙配网方法包括以下步骤:8. A Bluetooth network distribution method, characterized in that the Bluetooth network distribution method comprises the following steps: 进行蓝牙扫描,在扫描到蓝牙配网设备发送的低功耗蓝牙广播时,建立与所述蓝牙配网设备之间的GATT连接通道;Perform Bluetooth scanning, and establish a GATT connection channel with the Bluetooth distribution device when scanning the low-power Bluetooth broadcast sent by the Bluetooth distribution device; 生成配网指令,通过所述GATT连接通道将所述配网指令发送至所述蓝牙配网设备,以使所述蓝牙配网设备从所述配网指令中提取配网信息,并基于所述配网信息进行配网。Generate a network distribution instruction, and send the network distribution instruction to the Bluetooth network distribution device through the GATT connection channel, so that the Bluetooth network distribution device extracts network distribution information from the network distribution instruction, and based on the Distribution network information for distribution network. 9.一种设备,其特征在于,所述设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的蓝牙配网程序,所述蓝牙配网程序配为实现如权利要求1至8中任一项所述的蓝牙配网方法的步骤。9. A device, characterized in that the device comprises: a memory, a processor, and a Bluetooth network configuration program stored on the memory and running on the processor, and the Bluetooth network configuration program is configured to implement The steps of the Bluetooth network distribution method according to any one of claims 1 to 8. 10.一种存储介质,其特征在于,所述存储介质上存储有蓝牙配网程序,所述蓝牙配网程序被处理器执行时实现如权利要求1至8中任一项所述的蓝牙配网方法的步骤。10. A storage medium, characterized in that, a Bluetooth network configuration program is stored on the storage medium, and when the Bluetooth network configuration program is executed by a processor, the Bluetooth configuration according to any one of claims 1 to 8 is implemented. steps of the net method.
CN202010728734.7A 2020-07-24 2020-07-24 Bluetooth distribution network method, device and storage medium Pending CN111866998A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010728734.7A CN111866998A (en) 2020-07-24 2020-07-24 Bluetooth distribution network method, device and storage medium
PCT/CN2020/113022 WO2022016669A1 (en) 2020-07-24 2020-09-02 Bluetooth network configuration method, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010728734.7A CN111866998A (en) 2020-07-24 2020-07-24 Bluetooth distribution network method, device and storage medium

Publications (1)

Publication Number Publication Date
CN111866998A true CN111866998A (en) 2020-10-30

Family

ID=72946977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010728734.7A Pending CN111866998A (en) 2020-07-24 2020-07-24 Bluetooth distribution network method, device and storage medium

Country Status (2)

Country Link
CN (1) CN111866998A (en)
WO (1) WO2022016669A1 (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112399358A (en) * 2020-11-05 2021-02-23 北京小米移动软件有限公司 Telephone notification method, device, system, equipment and medium
CN112637827A (en) * 2020-12-22 2021-04-09 珠海格力电器股份有限公司 Network distribution method, device, computer equipment and storage medium
CN113055867A (en) * 2021-03-08 2021-06-29 Oppo广东移动通信有限公司 Method and device for auxiliary network distribution of terminal and electronic equipment
CN113573289A (en) * 2021-06-30 2021-10-29 杭州博联智能科技股份有限公司 Method and system for adding equipment to client based on Bluetooth
CN114302383A (en) * 2021-12-30 2022-04-08 上海富瀚微电子股份有限公司 Method and system for network camera Bluetooth broadcast distribution network
CN114339787A (en) * 2021-12-31 2022-04-12 深圳市优必选科技股份有限公司 Network distribution method of intelligent device, terminal device and computer readable storage medium
CN114567870A (en) * 2022-02-28 2022-05-31 海信视像科技股份有限公司 GATT-based distribution network account allocation method, control terminal and display device
CN114615650A (en) * 2020-12-09 2022-06-10 深圳Tcl新技术有限公司 Connection binding method and device of Bluetooth equipment, terminal equipment and storage medium
CN114650522A (en) * 2020-12-17 2022-06-21 广东朝歌智慧互联科技有限公司 Method and device for realizing wireless network connection based on low-power-consumption Bluetooth broadcast
CN114650520A (en) * 2020-12-17 2022-06-21 广东朝歌智慧互联科技有限公司 Method and device for realizing wireless network connection based on standard Bluetooth broadcast
WO2022247802A1 (en) * 2021-05-27 2022-12-01 Oppo广东移动通信有限公司 Connection establishment method and apparatus, electronic device, and storage medium
CN115499895A (en) * 2022-08-15 2022-12-20 浙江猫精人工智能科技有限公司 A network distribution method, terminal equipment and storage medium
CN115567905A (en) * 2022-08-31 2023-01-03 岚图汽车科技有限公司 Bluetooth communication connection establishment method, device and equipment
CN115696637A (en) * 2022-10-21 2023-02-03 Oppo广东移动通信有限公司 Information acquisition method, device, bluetooth device, terminal device and storage medium
CN115767446A (en) * 2022-11-01 2023-03-07 美的集团股份有限公司 Bluetooth broadcast two-way communication method and device, electronic equipment and storage medium
CN116017314A (en) * 2022-12-13 2023-04-25 北京小米移动软件有限公司 Smart device network distribution method and device thereof
CN116528174A (en) * 2022-12-08 2023-08-01 珠海奔图电子有限公司 Distribution network method, distribution network device, image forming apparatus, terminal, and medium
CN116709272A (en) * 2022-02-25 2023-09-05 Oppo广东移动通信有限公司 LE-Audio connection method, device, terminal, storage medium and program product
WO2023179137A1 (en) * 2022-03-25 2023-09-28 Oppo广东移动通信有限公司 Device communication method and related product
WO2024036815A1 (en) * 2022-08-15 2024-02-22 浙江艾克斯精灵人工智能科技有限公司 Provisioning system and method for devices, and related device and storage medium

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900798A (en) * 2022-03-25 2022-08-12 深圳市蓝科迅通科技有限公司 Bluetooth headset searching method, system intelligent device and storage medium
CN114786279A (en) * 2022-03-30 2022-07-22 青岛海尔空调器有限总公司 Method, device and system for directly connecting control of air conditioner and storage medium
CN114895974B (en) * 2022-04-24 2024-03-26 支付宝(杭州)信息技术有限公司 Method and device for improving opening speed of applet
CN115038045B (en) * 2022-06-09 2024-12-17 南京创维信息技术研究院有限公司 Site reservation method, apparatus, device and computer readable storage medium
CN117319104A (en) * 2022-06-21 2023-12-29 珠海格力电器股份有限公司 Network distribution method of intelligent household equipment, terminal equipment and processor
CN115278622B (en) * 2022-07-13 2025-05-02 深圳拓邦股份有限公司 Method and device for accessing a kinetic switch to a wireless mesh network, and terminal equipment
CN115468283B (en) * 2022-08-23 2025-12-12 青岛海信日立空调系统有限公司 An air conditioning system and its control method
CN115665771B (en) * 2022-10-21 2025-12-16 海能达通信股份有限公司 Frequency writing method, equipment management end and storage medium
CN115884102A (en) * 2022-11-24 2023-03-31 上海仪电(集团)有限公司中央研究院 An adaptive anti-collision Bluetooth fixed-frequency broadcast transmission method and device
CN116193416A (en) * 2023-02-28 2023-05-30 联想(北京)有限公司 Control method and electronic equipment
CN116614867A (en) * 2023-04-14 2023-08-18 深圳开鸿数字产业发展有限公司 Data transmission method, data transmission device, equipment and storage medium
CN116546444A (en) * 2023-05-15 2023-08-04 昱能科技股份有限公司 Bluetooth locking method and device for micro inverter and medium thereof
CN116743568B (en) * 2023-07-28 2025-11-25 美智光电科技股份有限公司 A method, apparatus, device, and storage medium for network distribution.
CN116743567B (en) * 2023-07-28 2025-11-21 美智光电科技股份有限公司 Equipment network distribution method, device, equipment and storage medium
CN117880928A (en) * 2024-01-18 2024-04-12 北京维普无限智能技术有限公司 A networking method, device and system based on Bluetooth broadcast
CN118474713A (en) * 2024-04-23 2024-08-09 深圳比瓦特科技有限公司 Bluetooth connection method and Bluetooth communication system
CN118828382A (en) * 2024-08-01 2024-10-22 深圳市万为物联科技有限公司 A method for positioning and tracking electric vehicles without network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104735670A (en) * 2015-03-30 2015-06-24 小米科技有限责任公司 Network access method and device
CN105873182A (en) * 2015-12-18 2016-08-17 乐视移动智能信息技术(北京)有限公司 Communication method and device
CN106535092A (en) * 2016-11-01 2017-03-22 惠州Tcl移动通信有限公司 Network sharing method, network accessing method and system
CN106792472A (en) * 2016-12-30 2017-05-31 杭州士兰微电子股份有限公司 The Wi Fi of intelligent hardware devices match somebody with somebody network method
CN107231627A (en) * 2017-08-10 2017-10-03 乐鑫信息科技(上海)有限公司 A kind of blueteeth network and with network method
CN109041036A (en) * 2018-10-29 2018-12-18 青岛海信传媒网络技术有限公司 WIFI connection method and equipment
CN110621055A (en) * 2018-06-19 2019-12-27 中移(杭州)信息技术有限公司 Network distribution method, device, terminal, equipment, storage medium and system
CN110868707A (en) * 2019-09-29 2020-03-06 厦门阳光恩耐照明有限公司 BLE MESH-based intelligent device network distribution method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190230408A1 (en) * 2018-01-22 2019-07-25 Qualcomm Incorporated System, method, and apparatus for temporary wireless connection

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104735670A (en) * 2015-03-30 2015-06-24 小米科技有限责任公司 Network access method and device
CN105873182A (en) * 2015-12-18 2016-08-17 乐视移动智能信息技术(北京)有限公司 Communication method and device
CN106535092A (en) * 2016-11-01 2017-03-22 惠州Tcl移动通信有限公司 Network sharing method, network accessing method and system
CN106792472A (en) * 2016-12-30 2017-05-31 杭州士兰微电子股份有限公司 The Wi Fi of intelligent hardware devices match somebody with somebody network method
CN107231627A (en) * 2017-08-10 2017-10-03 乐鑫信息科技(上海)有限公司 A kind of blueteeth network and with network method
CN110621055A (en) * 2018-06-19 2019-12-27 中移(杭州)信息技术有限公司 Network distribution method, device, terminal, equipment, storage medium and system
CN109041036A (en) * 2018-10-29 2018-12-18 青岛海信传媒网络技术有限公司 WIFI connection method and equipment
CN110868707A (en) * 2019-09-29 2020-03-06 厦门阳光恩耐照明有限公司 BLE MESH-based intelligent device network distribution method

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112399358A (en) * 2020-11-05 2021-02-23 北京小米移动软件有限公司 Telephone notification method, device, system, equipment and medium
CN114615650A (en) * 2020-12-09 2022-06-10 深圳Tcl新技术有限公司 Connection binding method and device of Bluetooth equipment, terminal equipment and storage medium
CN114650520A (en) * 2020-12-17 2022-06-21 广东朝歌智慧互联科技有限公司 Method and device for realizing wireless network connection based on standard Bluetooth broadcast
CN114650522A (en) * 2020-12-17 2022-06-21 广东朝歌智慧互联科技有限公司 Method and device for realizing wireless network connection based on low-power-consumption Bluetooth broadcast
CN112637827A (en) * 2020-12-22 2021-04-09 珠海格力电器股份有限公司 Network distribution method, device, computer equipment and storage medium
CN113055867A (en) * 2021-03-08 2021-06-29 Oppo广东移动通信有限公司 Method and device for auxiliary network distribution of terminal and electronic equipment
WO2022247802A1 (en) * 2021-05-27 2022-12-01 Oppo广东移动通信有限公司 Connection establishment method and apparatus, electronic device, and storage medium
CN113573289A (en) * 2021-06-30 2021-10-29 杭州博联智能科技股份有限公司 Method and system for adding equipment to client based on Bluetooth
CN113573289B (en) * 2021-06-30 2024-03-26 杭州博联智能科技股份有限公司 Method and system for adding devices based on Bluetooth client
CN114302383A (en) * 2021-12-30 2022-04-08 上海富瀚微电子股份有限公司 Method and system for network camera Bluetooth broadcast distribution network
CN114339787A (en) * 2021-12-31 2022-04-12 深圳市优必选科技股份有限公司 Network distribution method of intelligent device, terminal device and computer readable storage medium
CN116709272A (en) * 2022-02-25 2023-09-05 Oppo广东移动通信有限公司 LE-Audio connection method, device, terminal, storage medium and program product
CN114567870A (en) * 2022-02-28 2022-05-31 海信视像科技股份有限公司 GATT-based distribution network account allocation method, control terminal and display device
CN114567870B (en) * 2022-02-28 2024-04-16 海信视像科技股份有限公司 GATT-based network and account number distribution method, control terminal and display device
WO2023179137A1 (en) * 2022-03-25 2023-09-28 Oppo广东移动通信有限公司 Device communication method and related product
WO2024036815A1 (en) * 2022-08-15 2024-02-22 浙江艾克斯精灵人工智能科技有限公司 Provisioning system and method for devices, and related device and storage medium
CN115499895A (en) * 2022-08-15 2022-12-20 浙江猫精人工智能科技有限公司 A network distribution method, terminal equipment and storage medium
CN115567905A (en) * 2022-08-31 2023-01-03 岚图汽车科技有限公司 Bluetooth communication connection establishment method, device and equipment
CN115567905B (en) * 2022-08-31 2024-07-02 岚图汽车科技有限公司 Bluetooth communication connection establishment method, device and equipment
CN115696637A (en) * 2022-10-21 2023-02-03 Oppo广东移动通信有限公司 Information acquisition method, device, bluetooth device, terminal device and storage medium
WO2024082906A1 (en) * 2022-10-21 2024-04-25 Oppo广东移动通信有限公司 Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium
CN115767446A (en) * 2022-11-01 2023-03-07 美的集团股份有限公司 Bluetooth broadcast two-way communication method and device, electronic equipment and storage medium
CN116528174A (en) * 2022-12-08 2023-08-01 珠海奔图电子有限公司 Distribution network method, distribution network device, image forming apparatus, terminal, and medium
CN116017314A (en) * 2022-12-13 2023-04-25 北京小米移动软件有限公司 Smart device network distribution method and device thereof

Also Published As

Publication number Publication date
WO2022016669A1 (en) 2022-01-27

Similar Documents

Publication Publication Date Title
CN111866998A (en) Bluetooth distribution network method, device and storage medium
CN106878923B (en) Quick networking method for ultra-low power consumption intelligent equipment and intelligent home system
US12047872B2 (en) Method for provisioning of smart device, system, and readable medium
EP3253080B1 (en) Data sharing method and system
CN108781473B (en) A method and device for sharing files between different terminals
US20090271709A1 (en) Method and apparatus for setting up wireless lan of device
US11452156B2 (en) Configuration system, client device, embedded device configuration method, and storage medium
KR20130079839A (en) Method for wi-fi direct connection
CN103929748A (en) Internet of things wireless terminal, configuration method thereof and wireless network access point
CN113271578A (en) Network distribution method, device, equipment and computer readable storage medium
CN106789470B (en) Terminal resource sharing method, device and system
JP2014175822A (en) Radio communication device, radio communication terminal, re-connection program, radio communication method, and radio communication system
CN112448873A (en) Equipment binding method and device and computer readable storage medium
CN111901151A (en) Method, device, equipment and medium for gateway equipment to manage IOT equipment
JP6366113B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND COMMUNICATION METHOD
CN105959188B (en) Method and device for controlling user terminal to go online
CN107306388B (en) A kind of configuration method and device of access point name APN
CN104918296A (en) Network connection assistance system and method
CN108307479A (en) Communication module, network distribution method and device thereof, storage medium, equipment and terminal
CN111818613A (en) Wireless network configuration method, device and storage medium
US10187796B2 (en) Authentication and association method and system
CN107659933B (en) Bidirectional pairing connection method for wireless equipment, wireless equipment and storage medium
CN108541078B (en) Terminal binding method, system, terminal and server
CN106789843B (en) Method, PORTAL server and system for sharing internet access
CN111182512B (en) Terminal connection method, device, terminal and computer readable storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201030