[go: up one dir, main page]

CN106878926B - Data transmission method based on low-power-consumption Bluetooth, slave master device and system - Google Patents

Data transmission method based on low-power-consumption Bluetooth, slave master device and system Download PDF

Info

Publication number
CN106878926B
CN106878926B CN201710068976.6A CN201710068976A CN106878926B CN 106878926 B CN106878926 B CN 106878926B CN 201710068976 A CN201710068976 A CN 201710068976A CN 106878926 B CN106878926 B CN 106878926B
Authority
CN
China
Prior art keywords
broadcast
type
slave
slave device
master device
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.)
Active
Application number
CN201710068976.6A
Other languages
Chinese (zh)
Other versions
CN106878926A (en
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.)
TAILING MICROELECTRONICS (SHANGHAI) CO Ltd
Zhejiang Yankon Group Co Ltd
Original Assignee
Zhejiang Yankon Group Co Ltd
Telink Semiconductor Shanghai 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 Zhejiang Yankon Group Co Ltd, Telink Semiconductor Shanghai Co Ltd filed Critical Zhejiang Yankon Group Co Ltd
Priority to CN201710068976.6A priority Critical patent/CN106878926B/en
Publication of CN106878926A publication Critical patent/CN106878926A/en
Application granted granted Critical
Publication of CN106878926B publication Critical patent/CN106878926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W74/00Wireless channel access
    • H04W74/04Scheduled access
    • H04W74/06Scheduled access using polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • H04W84/20Leader-follower arrangements
    • 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

本发明涉及蓝牙技术领域,公开了一种基于低功耗蓝牙的数据传输方法、从主设备及系统。本发明实施方式中,提供了一种基于低功耗蓝牙的数据传输方法,包括:从设备发送第一类广播,该第一类广播中包括:从设备名称;利用接收到的来自主设备的连接请求,实现与该主设备的配对连接,该连接请求中包括该主设备的地址;记录该地址;断开与所述主设备的连接;向该地址发送第二类广播,该第二类广播中包括待传输的有效载荷。本发明实施方式,使得在一主设备与多个从设备通信时,扩展了从设备的数量,通信延时小,稳定,成本低,同时,适用于现有低功耗蓝牙(BLE)设备,更利于推广。

Figure 201710068976

The invention relates to the technical field of bluetooth, and discloses a data transmission method based on low-power bluetooth, a slave-master device and a system. In an embodiment of the present invention, a data transmission method based on low-power bluetooth is provided, including: sending a first type of broadcast from a slave device, where the first type of broadcast includes: the name of the slave device; connection request to realize the pairing connection with the master device, the connection request includes the address of the master device; record the address; disconnect the connection with the master device; send the second type of broadcast to the address, the second type of broadcast The broadcast includes the payload to be transmitted. The embodiment of the present invention makes the number of slave devices expanded when a master device communicates with multiple slave devices, the communication delay is small, stable, and the cost is low, and at the same time, it is suitable for existing Bluetooth Low Energy (BLE) devices, more conducive to promotion.

Figure 201710068976

Description

一种基于低功耗蓝牙的数据传输方法、从主设备及系统A data transmission method, slave master device and system based on low-power bluetooth

技术领域technical field

本发明涉及蓝牙技术领域,特别涉及一种基于低功耗蓝牙的数据传输方法、从主设备及系统。The present invention relates to the field of Bluetooth technology, in particular to a data transmission method, slave-master device and system based on low-power bluetooth.

背景技术Background technique

随着电子技术的快速发展,无线连接技术已经越来越广泛地应用在人们的生活和工作中。例如,智能手机通过无线连接控制智能电视。蓝牙技术是目前发展较为迅速且应用广泛的一种无线连接技术。With the rapid development of electronic technology, wireless connection technology has been more and more widely used in people's life and work. For example, a smartphone controls a smart TV via a wireless connection. Bluetooth technology is a wireless connection technology that develops rapidly and is widely used.

蓝牙的数据传输方法一般基于蓝牙协议,而目前使用较为广泛的是低功耗蓝牙(BLE)协议。传统低功耗蓝牙的数据交互过程为:从设备(Slave)在广播信道中发起设备广播(connectable undirected advertising event),其中,设备广播中包含设备名称、服务类型等信息;主设备(Master)在监测从设备(Slave)的广播后,如果需要和该从设备(Slave)进行数据交换,则发起连接请求,其中,连接请求中包含连接间隔、跳频参数等参数。从设备(Slave)响应连接请求,并根据连接请求中的连接间隔、跳频参数与主设备(Master)建立连接,通常低功耗蓝牙协议中的连接是指在约定的时间段内,双方都到一个指定的物理信道,该连接仅存在于与广播信道相对的数据信道中,从设备(Slave)根据连接间隔、跳频参数等参数保持和主设备(Master)的同步跳频,从而保持连接;主设备(Master)与从设备(Slave)在建立的连接通道中完成数据通信,数据通信完成后,主设备(Master)或从设备(Slave)断开连接。The data transmission method of Bluetooth is generally based on the Bluetooth protocol, and currently, the Bluetooth Low Energy (BLE) protocol is widely used. The data interaction process of traditional low-power Bluetooth is: the slave device (Slave) initiates a device broadcast (connectable undirected advertising event) in the broadcast channel, where the device broadcast contains information such as the device name, service type, etc.; the master device (Master) in After monitoring the broadcast of the slave device (Slave), if it is necessary to exchange data with the slave device (Slave), a connection request is initiated, wherein the connection request includes parameters such as connection interval and frequency hopping parameters. The slave device (Slave) responds to the connection request, and establishes a connection with the master device (Master) according to the connection interval and frequency hopping parameters in the connection request. Usually, the connection in the Bluetooth low energy protocol means that within the agreed time period, both parties are connected. To a specified physical channel, the connection only exists in the data channel opposite to the broadcast channel. The slave device (Slave) maintains the synchronization frequency hopping with the master device (Master) according to the connection interval, frequency hopping parameters and other parameters, thereby maintaining the connection. ; The master device (Master) and the slave device (Slave) complete data communication in the established connection channel. After the data communication is completed, the master device (Master) or the slave device (Slave) is disconnected.

发明人在实现本发明的过程中发现,目前常用的低功耗蓝牙(BLE)协议标准中一个中心节点最多可以和七个从节点进行通信,因此,当一个主设备(Master)与多个从设备(Slave)通信时,从设备的数量有限,主设备(Master)轮流与各从设备(Master)建立通信连接,通过周期轮询的方式获取各从设备(Slave)的有效载荷,但是这种通信方式的时延长;并且通常低功耗蓝牙的主设备(Master)一般是智能设备,例如手机、机顶盒等,智能设备上通常使用的应用软件无法实现对底层低功耗蓝牙设备时序上的精确控制,当一个主设备(Master)和超过四个从设备(Slave)通信时,出现通信失败的概率大大增加。虽然蓝牙自组网(BLE MESH)的方式可以解决从设备数量的限制,但是,在通信中的设备既要作为主设备也要作为从设备使用,增加了设备的硬件成本,且不能和其他的不具有蓝牙自组网(BLEMESH)功能的设备进行通信,通信受到限制,不利于推广。In the process of implementing the present invention, the inventor found that in the currently commonly used Bluetooth Low Energy (BLE) protocol standard, a central node can communicate with up to seven slave nodes. Therefore, when a master device (Master) communicates with multiple slave nodes, When the device (Slave) communicates, the number of slave devices is limited. The master device (Master) takes turns to establish a communication connection with each slave device (Master), and obtains the payload of each slave device (Slave) through periodic polling, but this The communication mode is prolonged; and usually the master device of low-power bluetooth is generally a smart device, such as a mobile phone, set-top box, etc., the application software usually used on smart devices cannot achieve accurate timing of the underlying low-power bluetooth device. Control, when a master device (Master) communicates with more than four slave devices (Slave), the probability of communication failure is greatly increased. Although the bluetooth ad hoc network (BLE MESH) method can solve the limitation of the number of slave devices, the device in communication must be used as both a master device and a slave device, which increases the hardware cost of the device, and cannot be used with other devices. If a device without the Bluetooth Ad Hoc Network (BLEMESH) function communicates, the communication is limited, which is not conducive to promotion.

发明内容SUMMARY OF THE INVENTION

本发明实施方式的目的在于提供一种基于低功耗蓝牙的数据传输方法、从主设备及系统,在一主设备与多个从设备通信时,扩展了从设备的数量,通信延时小,稳定,成本低,利于推广。The purpose of the embodiments of the present invention is to provide a data transmission method based on low-power bluetooth, a slave master device and a system. When a master device communicates with multiple slave devices, the number of slave devices is expanded, and the communication delay is small. Stable, low cost, conducive to promotion.

为解决上述技术问题,本发明的实施方式提供了一种基于低功耗蓝牙的数据传输方法,包括:从设备发送第一类广播,所述第一类广播中包括:从设备名称;分别接收来自主设备的连接请求和虚拟连接参数,实现与所述主设备的配对连接;断开与所述主设备的连接;根据所述虚拟连接参数,向所述主设备发送第二类广播,所述第二类广播中包括待传输的有效载荷。In order to solve the above technical problems, embodiments of the present invention provide a data transmission method based on low-power bluetooth, including: sending a first type of broadcast from a device, and the first type of broadcast includes: the name of the slave device; The connection request and virtual connection parameters from the master device realize the pairing connection with the master device; disconnect the connection with the master device; send the second type of broadcast to the master device according to the virtual connection parameters, so The second type of broadcast includes the payload to be transmitted.

本发明的实施方式还提供了一种基于低功耗蓝牙的数据传输方法,包括:主设备接收来自从设备的第一类广播,所述第一类广播中包括:从设备名称;根据所述从设备名称,向所述从设备发送连接请求和虚拟连接参数;在接收到来自所述从设备的针对所述虚拟连接参数的确认后,根据所述虚拟连接参数接收来自所述从设备的第二类广播;从所述第二类广播中解析出所述有效载荷。Embodiments of the present invention also provide a data transmission method based on low-power Bluetooth, including: a master device receives a first type of broadcast from a slave device, where the first type of broadcast includes: the name of the slave device; From the device name, send a connection request and virtual connection parameters to the slave device; after receiving the confirmation for the virtual connection parameters from the slave device, receive the first request from the slave device according to the virtual connection parameters. Class II broadcast; parsing the payload from the second class broadcast.

本发明的实施方式还提供了一种从设备,包括:第一发送模块,用于发送第一类广播,所述第一类广播中包括:从设备名称;第一接收模块,用于分别接收来自主设备的连接请求和虚拟连接参数,实现与所述主设备的配对连接;断开模块,用于断开与所述主设备的连接;所述第一发送模块,还用于根据所述虚拟连接参数,向所述主设备发送第二类广播,所述第二类广播中包括待传输的有效载荷。An embodiment of the present invention further provides a slave device, comprising: a first sending module for sending a first type of broadcast, where the first type of broadcast includes: a slave device name; a first receiving module for respectively receiving The connection request and virtual connection parameters from the master device realize the pairing connection with the master device; the disconnection module is used to disconnect the connection with the master device; the first sending module is also used for according to the virtual connection parameters, and send a second type of broadcast to the master device, where the second type of broadcast includes the payload to be transmitted.

本发明的实施方式还提供了一种主设备,包括:第二接收模块,用于接收来自从设备的第一类广播,所述第一类广播中包括:从设备名称;第二发送模块,用于根据所述从设备名称,向所述从设备发送连接请求和虚拟连接参数;所述第二接收模块,还用于在接收到来自所述从设备的针对所述虚拟连接参数的确认后,根据所述虚拟连接参数接收来自所述从设备的第二类广播;处理模块,用于从所述第二类广播中解析出所述有效载荷。An embodiment of the present invention further provides a master device, comprising: a second receiving module for receiving a first type of broadcast from a slave device, where the first type of broadcast includes: the name of the slave device; a second sending module, is configured to send a connection request and virtual connection parameters to the slave device according to the name of the slave device; the second receiving module is further configured to, after receiving the confirmation for the virtual connection parameter from the slave device, , receiving the second-type broadcast from the slave device according to the virtual connection parameter; the processing module is configured to parse the payload from the second-type broadcast.

本发明的实施方式还提供了一种基于低功耗蓝牙的数据传输系统,包括:上述提到的从设备,和上述提到的主设备。Embodiments of the present invention further provide a data transmission system based on Bluetooth low energy consumption, including: the above-mentioned slave device and the above-mentioned master device.

本发明实施方式相对于现有技术而言,在多台从设备与主设备通信时,从设备利用发送定时广播的方式与主设备进行有效载荷的传输,主从设备间只需建立短期连接,主设备无需通过轮询的方式与从设备进行数据通信,从而不受低功耗蓝牙(BLE)协议中一主设备与有限个从设备通信的限制,使得一主设备可以同时与多台从设备进行通信,直接扩展了主设备可通信的从设备的数量。上述过程中主从设备只有短暂的连接,之后有效载荷的传输可看作是虚拟连接,使得BLE设备无需为数据传输保持专用通信通道的连接,减小了BLE设备的功耗,同时,从设备通过第二类广播传输数据,使得数据通信响应的速度快,减小了通信时延,通信稳定;并且广播通信的方式适用于所有遵守低功耗蓝牙(BLE)协议的设备,降低了对设备改进的成本。Compared with the prior art, in the embodiment of the present invention, when multiple slave devices communicate with the master device, the slave devices transmit the payload with the master device by sending a timed broadcast, and only a short-term connection needs to be established between the master and slave devices. The master device does not need to communicate with the slave devices through polling, so it is not limited by the communication between a master device and a limited number of slave devices in the Bluetooth Low Energy (BLE) protocol, so that a master device can communicate with multiple slave devices at the same time. For communication, it directly expands the number of slave devices that the master device can communicate with. In the above process, the master and slave devices have only a short-term connection, and then the transmission of the payload can be regarded as a virtual connection, so that the BLE device does not need to maintain a dedicated communication channel connection for data transmission, which reduces the power consumption of the BLE device. At the same time, the slave device Transmission of data through the second type of broadcast makes the response speed of data communication fast, reduces the communication delay, and stabilizes communication; and the broadcast communication method is suitable for all devices that comply with the Bluetooth Low Energy (BLE) protocol, reducing the need for equipment. cost of improvement.

另外,所述虚拟连接参数中包括:主设备密钥;向所述主设备发送的所述有效载荷为利用目标密钥加密后的有效载荷,所述目标密钥根据预存的从设备密钥和所述主设备密钥生成。由主从设备各自的密钥生成目标密钥,并通过目标密钥加密第二类广播中的有效载荷,增强了有效载荷传输的安全性。In addition, the virtual connection parameters include: a master device key; the payload sent to the master device is a payload encrypted with a target key, and the target key is based on the pre-stored slave device key and The master device key is generated. The target key is generated by the respective keys of the master and slave devices, and the payload in the second type of broadcast is encrypted by the target key, which enhances the security of payload transmission.

另外,所述虚拟连接参数中包括:传送周期和传送信道。通过主从设备间约定的传送周期和传送信道发送第二类广播,由于主设备获知数据接收的时间,可以只在需要接收数据的时间工作,进一步减少了主设备与从设备的功耗,由于预知了传送信道,可以使得主从更准确地传送有效载荷,避免遗漏。In addition, the virtual connection parameters include: a transmission period and a transmission channel. The second type of broadcast is sent through the transmission period and transmission channel agreed between the master and slave devices. Since the master device knows the time of data reception, it can only work when it needs to receive data, which further reduces the power consumption of the master device and the slave device. By predicting the transmission channel, the master and slave can transmit the payload more accurately and avoid omission.

附图说明Description of drawings

图1是根据本发明第一实施方式的一种基于低功耗蓝牙的数据传输方法的流程图;FIG. 1 is a flowchart of a data transmission method based on Bluetooth low energy consumption according to a first embodiment of the present invention;

图2是根据本发明第一实施方式的从设备与主设备的数据传输交互过程示意图;2 is a schematic diagram of a data transmission interaction process between a slave device and a master device according to the first embodiment of the present invention;

图3是根据本发明第二实施方式的一种基于低功耗蓝牙的数据传输方法的流程图;FIG. 3 is a flowchart of a data transmission method based on Bluetooth low energy consumption according to a second embodiment of the present invention;

图4是根据本发明第三实施方式的一种从设备的结构示意图;4 is a schematic structural diagram of a slave device according to a third embodiment of the present invention;

图5a是根据本发明第四实施方式的一种主设备的结构示意图;5a is a schematic structural diagram of a master device according to a fourth embodiment of the present invention;

图5b是根据本发明第四实施方式的另一种主设备的结构示意图;5b is a schematic structural diagram of another master device according to the fourth embodiment of the present invention;

图6是根据本发明第五实施方式的一种基于低功耗蓝牙的数据传输系统的结构示意图;6 is a schematic structural diagram of a data transmission system based on Bluetooth low energy consumption according to a fifth embodiment of the present invention;

图7是根据本发明第一实施方式中的第一类广播的内容示意图;7 is a schematic diagram of the content of the first type of broadcast according to the first embodiment of the present invention;

图8是根据本发明第一实施方式中的虚拟连接参数的内容示意图;8 is a schematic diagram of the content of virtual connection parameters according to the first embodiment of the present invention;

图9是根据本发明第一实施方式中的第二类广播的内容示意图。FIG. 9 is a schematic diagram of the content of the second type of broadcast according to the first embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the objectives, technical solutions and advantages of the present invention clearer, each embodiment of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can appreciate that, in the various embodiments of the present invention, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized.

本发明的第一实施方式涉及一种基于低功耗蓝牙的数据传输方法。该方法主要应用于低功耗蓝牙数据传输的从设备。具体流程如图1所示,包括:The first embodiment of the present invention relates to a data transmission method based on Bluetooth low energy consumption. The method is mainly applied to the slave device of low energy bluetooth data transmission. The specific process is shown in Figure 1, including:

步骤101:从设备发送第一类广播。Step 101: The slave device sends the first type of broadcast.

具体的说,如图7所示,第一类广播中可以包含:从设备名称702,还可以包括:从设备地址701、服务类型703、广播间隔704和从设备密钥705。从设备以一定的周期(即第一类广播周期)在低功耗蓝牙(BLE)标准定义的三个广播信道上发送第一类广播。其中,从设备的数量不做限制,可以多台从设备在三个广播信道上发送第一类广播,也可以一台从设备在三个广播信道上发送第一广播;主设备在三个广播信道中可以根据接收到的第一类广播中的设备名称搜索符合需求的从设备,当主设备搜索到需要的从设备时,主设备向从设备发起连接请求。Specifically, as shown in FIG. 7 , the first type of broadcast may include: slave device name 702 , and may also include: slave device address 701 , service type 703 , broadcast interval 704 and slave device key 705 . The slave device sends the first type of broadcast on three broadcast channels defined by the Bluetooth Low Energy (BLE) standard with a certain period (ie, the first type of broadcast period). Among them, the number of slave devices is not limited. Multiple slave devices can send the first broadcast on three broadcast channels, or one slave device can send the first broadcast on three broadcast channels; the master device can send the first broadcast on three broadcast channels. The channel can search for a slave device that meets the requirements according to the device name in the received first type of broadcast. When the master device searches for the required slave device, the master device initiates a connection request to the slave device.

例如,现有从设备A,从设备B,主设备C,从设备A和从设备B每隔125ms发送一次第一类广播,从设备A的第一类广播中包含设备名称“从设备A”,从设备B的第一类广播中包含设备名称为“从设备B”。主设备C监听到从设备A和从设备B发送的第一类广播,现主设备C需要连接设备名称为“从设备B”的设备,则主设备C向从设备B发起连接请求。For example, the existing slave device A, slave device B, master device C, slave device A and slave device B send the first type of broadcast every 125ms, and the first type of broadcast of slave device A contains the device name "slave device A" , the first type of broadcast from device B contains the device name "slave device B". Master device C listens to the first type of broadcast sent by slave device A and slave device B. Now master device C needs to connect to the device whose device name is "slave device B", then master device C initiates a connection request to slave device B.

其中值得一提的是,第一类广播中的从设备密钥可以为随机密钥,如利用随机数生成的随机密钥。也就是说,可以每隔一个周期,利用随机数生成一次从设备密钥;也可以每隔两个或两个以上的周期,利用随机数生成一次从设备密钥。It is worth mentioning that the key of the slave device in the first type of broadcast can be a random key, such as a random key generated by using a random number. That is to say, the slave device key can be generated by using a random number every other cycle; the slave device key can also be generated using a random number every two or more cycles.

步骤102:接收来自主设备的连接请求和虚拟连接参数。Step 102: Receive a connection request and virtual connection parameters from the master device.

具体的说,连接请求中包含有跳频信息和时间间隔,从设备根据连接请求中的跳频信息和时间间隔与主设备建立通信连接。该连接请求及其后续构成连接的配对过程在低功耗蓝牙(BLE)标准中有详细描述,故此处不再详述。Specifically, the connection request includes frequency hopping information and time interval, and the slave device establishes a communication connection with the master device according to the frequency hopping information and time interval in the connection request. The connection request and the subsequent pairing process for forming a connection are described in detail in the Bluetooth Low Energy (BLE) standard, so they will not be described in detail here.

步骤103:接收来自主设备的虚拟连接参数。Step 103: Receive virtual connection parameters from the master device.

具体的说,如图8所示,虚拟连接参数包括:主设备地址801、从设备地址701、连接间隔802(即第二类广播周期)、主设备密钥803和广播信道选择804(即虚拟连接所将采用的广播信道),该广播信道可以是BLE协议中定义的三个广播信道中的一个或多个。Specifically, as shown in Figure 8, the virtual connection parameters include: master device address 801, slave device address 701, connection interval 802 (ie the second type of broadcast period), master device key 803 and broadcast channel selection 804 (ie virtual The broadcast channel to be used for the connection), which can be one or more of the three broadcast channels defined in the BLE protocol.

值得一提的是,由于主设备在发出连接请求后并不会收到确认信息,所以无法确认是否连接成功,需要在特定信道和从设备进行数据交互才能确认是否连接成功,所以主设备会在数据信道向从设备发送虚拟连接参数。It is worth mentioning that since the master device does not receive confirmation information after sending a connection request, it cannot confirm whether the connection is successful. The data channel sends virtual connection parameters to the slave device.

步骤104:断开与主设备的连接。Step 104: Disconnect from the master device.

具体的说,在经典低功耗蓝牙协议中,保持实际连接是一个相当消耗能量和带宽的过程,因此,为了减小主设备、从设备的使用功耗,在从设备保存建立虚拟连接的必要数据(主设备地址、第二类广播周期、主设备密钥、虚拟连接的广播信道)后,就立即断开与主设备的连接,使得从设备与主设备的直接连接只维持很短的时间,一般实际连接的过程维持100ms以内。主设备与从设备建立短暂的实际连接,之后数据传输的过程可看作是“虚拟连接”,“虚拟连接”指的是,从设备和主设备间并不存在低功耗蓝牙(BLE)标准中所定义存在于数据通信信道的连接,但主从设备间通过复用广播信道,主设备可以实时获取从设备有效载荷数据,并在需要的时间随时建立标准的连接。Specifically, in the classic Bluetooth low energy protocol, maintaining the actual connection is a process that consumes a lot of energy and bandwidth. Therefore, in order to reduce the power consumption of the master device and the slave device, the need for establishing a virtual connection is saved in the slave device. After the data (master device address, second type of broadcast period, master device key, virtual connected broadcast channel), the connection with the master device is immediately disconnected, so that the direct connection between the slave device and the master device is only maintained for a short time. , the actual connection process is generally maintained within 100ms. The master device establishes a short actual connection with the slave device, and then the process of data transmission can be regarded as a "virtual connection". "Virtual connection" means that there is no Bluetooth Low Energy (BLE) standard between the slave device and the master device. The connection exists in the data communication channel as defined in , but by multiplexing the broadcast channel between the master and slave devices, the master device can obtain the payload data of the slave device in real time, and establish a standard connection at any time when needed.

步骤105:向该主设备发送第二类广播。Step 105: Send the second type of broadcast to the master device.

具体的说,从设备根据接收到的虚拟连接参数,向主设备发送第二类广播。其中,由于虚拟连接参数中可以包括:传送周期(即第二类广播周期)和传送信道(即虚拟连接的广播信道)。从设备则以传送周期,在传送信道上发送第二类广播,同时广播周期中的随机延时(advDelay)固定为“0”。Specifically, the slave device sends the second type of broadcast to the master device according to the received virtual connection parameters. Among them, because the virtual connection parameters may include: a transmission period (ie, the second type of broadcast period) and a transmission channel (ie, the broadcast channel of the virtual connection). The slave device sends the second type of broadcast on the transmission channel with the transmission period, and the random delay (advDelay) in the broadcast period is fixed to "0".

更具体的说,第二类广播如图9所示,包含待传输的有效载荷901、主设备地址801和从设备地址701。例如,现有从设备A,主设备B,第二类广播周期为125ms,则从设备A每隔125ms向主设备发送一次第二类广播。More specifically, the second type of broadcast, as shown in FIG. 9 , includes a payload 901 to be transmitted, a master device address 801 and a slave device address 701 . For example, if the existing slave device A, master device B, and the second type of broadcast cycle is 125ms, the slave device A sends the second type of broadcast to the master device every 125ms.

值得一提的是,第二类广播中的有效载荷可以是利用目标密钥加密后的有效载荷,其中,目标密钥根据预存的从设备密钥和虚拟连接参数中的主设备密钥生成。更进一步说,生成规则可以由主从设备预先约定。由主从设备各自的密钥生成目标密钥,并通过目标密钥加密第二类广播中的有效载荷,增强了有效载荷传输的安全性。It is worth mentioning that the payload in the second type of broadcast may be a payload encrypted with a target key, wherein the target key is generated according to the pre-stored slave key and the master key in the virtual connection parameters. Furthermore, the generation rules can be pre-agreed by the master and slave devices. The target key is generated by the respective keys of the master and slave devices, and the payload in the second type of broadcast is encrypted by the target key, which enhances the security of payload transmission.

另外,从设备可以根据用户的指令确定是执行配对过程(步骤101和步骤104),或是执行数据传输过程(步骤105)。In addition, the slave device may determine whether to perform the pairing process (step 101 and step 104 ) or the data transmission process (step 105 ) according to the user's instruction.

需要说明的是,当从设备发送完第二类广播后,可以选择不监听主设备的响应数据,减小BLE设备的使用功耗。主设备在和从设备的连接断开后,恢复广播信道的监听(Scanning),在收到从设备含有有效载荷的广播后,一方面根据“虚拟连接”参数中的第二类广播周期计算出下一次该从设备的有效载荷发送时间,从而及时获取新的有效载荷并在需要的时候恢复传统连接通道,另一方面根据之前保存的目标密钥完成有效载荷数据包的解析。It should be noted that after the slave device sends the second type of broadcast, it can choose not to monitor the response data of the master device to reduce the power consumption of the BLE device. After the master device is disconnected from the slave device, it resumes the monitoring of the broadcast channel (Scanning). After receiving the broadcast containing the payload from the slave device, on the one hand, it is calculated according to the second type of broadcast cycle in the "virtual connection" parameter. The next time the payload of the slave device is sent, so as to obtain a new payload in time and restore the traditional connection channel when needed. On the other hand, the payload data packet is parsed according to the previously saved target key.

而一台从设备也可以与多台主设备通信,从设备与多台主设备建立虚拟连接后,用户可以利用软件自由选择连接配对的主设备,在进行数据通信;用户也可以直接选择与已连接配对的主设备进行数据通信。One slave device can also communicate with multiple master devices. After the slave device establishes a virtual connection with multiple master devices, the user can use the software to freely select the paired master device for data communication; the user can also directly choose to communicate with the master device. Connect the paired master device for data communication.

值得一提的是,还可以有多台从设备向主设备地址发送第二类广播,其中,从设备的数量不做限制,例如,有2台从设备,分别为从设备1号和2号,以及主设备A,从设备1号和从设备2号在广播信道1号上向主设备A发送第二类广播,从设备1号的发送时长为1.25ms,从设备2号的发送时长为1.1ms,若第二类广播中的有效载荷的广播间隔为150ms,则从设备的数量可以过百,在实际中,从设备数量可以不少以30个。It is worth mentioning that there can also be multiple slave devices that can send the second type of broadcast to the master device address. The number of slave devices is not limited. For example, there are 2 slave devices, which are slave device No. 1 and No. 2 respectively. , and the master device A, the slave device No. 1 and the slave device No. 2 send the second type of broadcast to the master device A on the broadcast channel No. 1, the sending time of the slave device No. 1 is 1.25ms, and the sending time of the slave device No. 2 is 1.1ms, if the broadcast interval of the payload in the second type of broadcast is 150ms, the number of slave devices can exceed 100, and in practice, the number of slave devices can be at least 30.

本实施方式中的基于低功耗蓝牙的数据传输方法是基于从设备进行描述的,从整体系统来说,一台从设备与主设备的数据传输交互过程如图2所示:The data transmission method based on low-power bluetooth in this embodiment is described based on the slave device. From the overall system, the data transmission interaction process between a slave device and the master device is shown in Figure 2:

从设备在低功耗蓝牙(BLE)标准定义的三个广播信道上发送第一类广播,如图2中的S21,发送第一类广播;第一类广播中可以包括设备名称,还可以包括从设备地址、服务类型、第一类广播周期以及从设备密钥;从设备密钥可以为随机密钥;从设备每个周期发送的第一类广播中的从设备密钥都重新生成,如图2中的S22,生成从设备密钥并更新;从设备再次发送第一类广播,如图2中的S23,发送第一类广播;主设备监听到从设备发送的第一类广播,根据第一类广播中的从设备名称,向从设备发送连接请求,连接请求中包括主设备的地址,如图2中S24,发送连接请求;主设备在发送连接请求后生成主设备密钥和传送周期,如图2中S25;从设备接收来自主设备的连接请求,从设备根据连接请求在连接请求所设定的信道上接收主设备发送的虚拟连接参数,其中,虚拟连接参数包括:主设备地址,从设备地址、第二类广播周期、主设备密钥和虚拟连接的广播信道,如图2中的S26,发送虚拟连接参数。从设备根据接收到的虚拟连接参数,确认为配对成功,如图2中的S27,发送虚拟连接参数的确认;从设备记录主设备地址,从设备密钥,传送信道,第二类广播周期后,立即断开与主设备的实际连接,如图2中的S28,保存虚拟连接参数,断开连接;从设备利用保存的从设备密钥和收到的主设备密钥生成目标密钥并利用该目标密钥加密第二类广播中的有效载荷,如图2中的S29,加密有效载荷;从设备以保存的第二类周期发送第二类广播,如图2中的S30,发送第二类广播;主设备利用保存的从设备密钥和主设备密钥生成目标密钥并利用该目标密钥解密第二类广播中的有效载荷,如图2中的S31,解密有效载荷。The slave device sends the first type of broadcast on the three broadcast channels defined by the Bluetooth Low Energy (BLE) standard, such as S21 in Figure 2, to send the first type of broadcast; the first type of broadcast may include the name of the device, and may also include The slave device address, service type, the first type of broadcast period and the slave device key; the slave device key can be a random key; the slave device key in the first type of broadcast sent by the slave device every cycle is regenerated, such as S22 in Figure 2, generate and update the slave device key; the slave device sends the first type of broadcast again, such as S23 in Figure 2, sends the first type of broadcast; the master device listens to the first type of broadcast sent by the slave device, according to The name of the slave device in the first type of broadcast sends a connection request to the slave device, and the connection request includes the address of the master device, as shown in S24 in Figure 2, sends a connection request; the master device generates the master device key after sending the connection request and transmits Period, as shown in S25 in Figure 2; the slave device receives the connection request from the master device, and the slave device receives the virtual connection parameters sent by the master device on the channel set by the connection request according to the connection request, wherein the virtual connection parameters include: the master device The address, the slave device address, the second type of broadcast period, the master device key and the broadcast channel of the virtual connection, such as S26 in Figure 2, send the virtual connection parameters. The slave device confirms that the pairing is successful according to the received virtual connection parameters, as shown in S27 in Figure 2, and sends the confirmation of the virtual connection parameters; the slave device records the master device address, slave device key, transmission channel, and after the second type of broadcast period , immediately disconnect the actual connection with the master device, as shown in S28 in Figure 2, save the virtual connection parameters, and disconnect; the slave device uses the saved slave device key and the received master device key to generate the target key and use The target key encrypts the payload in the second type of broadcast, as shown in S29 in Figure 2, encrypts the payload; the slave device sends the second type of broadcast at the saved second type of cycle, such as S30 in Figure 2, sends the second type of broadcast Class broadcast; the master device uses the saved slave device key and master device key to generate a target key and uses the target key to decrypt the payload in the second type of broadcast, such as S31 in Figure 2, to decrypt the payload.

相对于现有技术而言,本实施方式提供的基于低功耗蓝牙的数据传输方法,在多台从设备与主设备通信时,从设备利用发送定时广播的方式与主设备进行有效载荷的传输,主从设备间只需建立短期连接,主设备无需通过轮询的方式与从设备进行数据通信,从而不受低功耗蓝牙(BLE)协议中一主设备与有限个从设备通信的限制,使得一主设备可以同时与多台从设备进行通信,直接扩展了主设备可通信的从设备的数量。上述过程中主从设备只有短暂的连接,之后有效载荷的传输可看作是虚拟连接,使得BLE设备无需为数据传输保持专用通信通道的连接,减小了BLE设备的功耗,同时,从设备通过第二类广播传输数据,使得数据通信响应的速度快,减小了通信时延,通信稳定;并且广播通信的方式适用于所有遵守低功耗蓝牙(BLE)协议的设备,降低了对设备改进的成本。Compared with the prior art, in the data transmission method based on low-power bluetooth provided by this embodiment, when multiple slave devices communicate with the master device, the slave device transmits the payload with the master device by sending a timed broadcast. , the master and slave devices only need to establish a short-term connection, and the master device does not need to communicate with the slave device through polling, so it is not limited by the communication between a master device and a limited number of slave devices in the Bluetooth Low Energy (BLE) protocol. A master device can communicate with multiple slave devices at the same time, which directly expands the number of slave devices that the master device can communicate with. In the above process, the master and slave devices have only a short-term connection, and then the transmission of the payload can be regarded as a virtual connection, so that the BLE device does not need to maintain a dedicated communication channel connection for data transmission, which reduces the power consumption of the BLE device. At the same time, the slave device Transmission of data through the second type of broadcast makes the response speed of data communication fast, reduces the communication delay, and stabilizes communication; and the broadcast communication method is suitable for all devices that comply with the Bluetooth Low Energy (BLE) protocol, reducing the need for equipment. cost of improvement.

本发明第二实施方式涉及一种基于低功耗蓝牙的数据传输方法,该方法主要应用于低功耗蓝牙数据传输中的主设备。具体流程如图3所示,包括:The second embodiment of the present invention relates to a data transmission method based on low-power bluetooth, and the method is mainly applied to a master device in low-power bluetooth data transmission. The specific process is shown in Figure 3, including:

步骤301:主设备接收来自从设备的第一类广播。Step 301: The master device receives the first type of broadcast from the slave device.

具体的说,第一类广播中可以包含从设备名称。主设备在一个或几个低功耗蓝牙(BLE)标准定义的广播信道上监听广播数据,当从设备在主设备监听的广播信道上发送广播时,主设备可以接收到该从设备发送的第一类广播,并且可以获取到第一类广播中的信息。Specifically, the first type of broadcast may contain the slave device name. The master device monitors broadcast data on one or several broadcast channels defined by the Bluetooth Low Energy (BLE) standard. When the slave device sends a broadcast on the broadcast channel monitored by the master device, the master device can receive the first broadcast data sent by the slave device. One type of broadcast, and the information in the first type of broadcast can be obtained.

需要说明的是,可以由多个从设备发送第一类广播,主设备在固定的一个或多个频道上监听第一类广播,只要无线信道不冲突,主设备可接收多个从设备发送的第一类广播,其中,从设备的数量不限制。It should be noted that the first type of broadcast can be sent by multiple slave devices, and the master device monitors the first type of broadcast on one or more fixed channels. As long as the wireless channels do not conflict, the master device can receive multiple slave devices. The first type of broadcast, in which the number of slave devices is not limited.

步骤302:根据从设备名称向该从设备发送连接请求和虚拟连接参数。Step 302: Send a connection request and virtual connection parameters to the slave device according to the name of the slave device.

具体的说,主设备在接收到第一类广播后,可以根据需求和第一类广播中的从设备名称,确定发起连接的从设备,向该从设备发起连接请求,例如,一主设备A,3个从设备,为从设备1号至3号,从设备1号的从设备名称为:从设备B,从设备2号的从设备名称为:从设备C,从设备3号的从设备名称为:从设备D,现主设备接收到3个从设备发送的第一类广播,需要配对的设备名称为:从设备A的设备名称,主设备A根据搜索第一类广播中的从设备名称,根据名称确定配对从设备为从设备1号,则向从设备1号发送连接请求。其中,连接请求中包含主设备的地址,从设备根据连接请求,与主设备建立通信连接,在通信连接建立时,主设备向从设发送虚拟连接的参数,配对的参数包括:主设备地址,从设备地址、第二类广播周期,主设备密钥和虚拟连接的广播信道;从设备根据接收的参数,确认配对成功,从设备保存主设备的地址、第二类广播周期、连接的广播信道及主设备密钥,然后,从设备断开与主设备的实际连接。Specifically, after receiving the first type of broadcast, the master device can determine the slave device that initiates the connection according to the requirements and the name of the slave device in the first type of broadcast, and initiate a connection request to the slave device. For example, a master device A , 3 slave devices, from device No. 1 to No. 3, the slave device name of slave device No. 1 is: slave device B, the slave device name of slave device No. 2 is: slave device C, the slave device of slave device No. 3 The name is: slave device D. Now the master device has received the first type of broadcast sent by 3 slave devices. The name of the device to be paired is: the device name of slave device A. The master device A searches for the slave device in the first type of broadcast according to Name, according to the name, the paired slave device is determined as slave device No. 1, and a connection request is sent to slave device No. 1. The connection request includes the address of the master device, and the slave device establishes a communication connection with the master device according to the connection request. When the communication connection is established, the master device sends virtual connection parameters to the slave device. The paired parameters include: master device address, The slave device address, the second type of broadcast cycle, the master device key and the broadcast channel of the virtual connection; the slave device confirms that the pairing is successful according to the received parameters, and the slave device saves the master device's address, the second type of broadcast cycle, and the connected broadcast channel. and the master key, then disconnect the slave from the actual connection to the master.

更具体的说,虚拟连接参数中包括传送周期(即第二类广播的传送周期)和传送信道(第二类广播的传送信道)。More specifically, the virtual connection parameters include a transmission period (ie, the transmission period of the second type of broadcast) and the transmission channel (the transmission channel of the second type of broadcast).

需要说明的是,主设备与从设备建立短暂的实际连接,配对完成后的过程看作本实施方式中所说的虚拟连接。It should be noted that the master device and the slave device establish a short-lived actual connection, and the process after the pairing is completed is regarded as a virtual connection in this embodiment.

步骤303:接收来自从设备的第二类广播。Step 303: Receive the second type of broadcast from the slave device.

具体的说,在接收到来自从设备的针对虚拟连接参数的确认后,根据所述虚拟连接参数,接收来自从设备的第二类广播。主设备在收到针对虚拟连接参数的确定后,可以确定连接已建立,此后就根据传送周期和传送信道接收第二类广播。Specifically, after receiving the confirmation for the virtual connection parameter from the slave device, the second type of broadcast from the slave device is received according to the virtual connection parameter. After receiving the determination of the virtual connection parameters, the master device can determine that the connection has been established, and then receives the second type of broadcast according to the transmission period and the transmission channel.

主设备将根据保存的第二类广播周期获知接收第二类广播的时间,主设备可以只在第二类广播周期时工作,接收第二类广播。在配对完成后,从设备根据保存的主设备地址信息,以第二类广播周期向主设备发送第二类广播,其中,第二类广播中包含有效载荷,有效载荷为待传输数据。The master device will know the time to receive the second type of broadcast according to the saved second type of broadcast cycle, and the master device can only work during the second type of broadcast cycle to receive the second type of broadcast. After the pairing is completed, the slave device sends the second type of broadcast to the master device in the second type of broadcast cycle according to the stored master device address information, wherein the second type of broadcast includes a payload, and the payload is the data to be transmitted.

步骤304:从第二类广播中解析出有效载荷。Step 304: Parse the payload from the second type of broadcast.

具体的说,主设备可以根据第二类广播格式解析出有效载荷。Specifically, the master device can parse out the payload according to the second type of broadcast format.

值得一提的是,为了保证数据传输的安全性,本实施方式中的有效载荷由从设备在发送之前利用目标密钥进行了加密,所以相应的,主设备要利用目标密钥解密第二类广播中的有效载荷。其中,所述目标密钥根据预生成的主设备密钥和所述从设备密钥生成。It is worth mentioning that, in order to ensure the security of data transmission, the payload in this embodiment is encrypted by the slave device using the target key before sending, so correspondingly, the master device needs to use the target key to decrypt the second type. The payload in the broadcast. Wherein, the target key is generated according to the pre-generated master device key and the slave device key.

相对于现有技术而言,本实施方式提供的基于低功耗蓝牙的数据传输方法,在多台从设备与主设备通信时,从设备利用发送定时广播的方式与主设备进行有效载荷的传输,主从设备间只需建立短期连接,主设备无需通过轮询的方式与从设备进行数据通信,从而不受低功耗蓝牙(BLE)协议中一主设备与有限个从设备通信的限制,使得一主设备可以同时与多台从设备进行通信,直接扩展了主设备可通信的从设备的数量。上述过程中主从设备只有短暂的连接,之后有效载荷的传输可看作是虚拟连接,使得BLE设备无需为数据传输保持专用通信通道的连接,减小了BLE设备的功耗,同时,从设备通过第二类广播传输数据,使得数据通信响应的速度快,减小了通信时延,通信稳定;并且广播通信的方式适用于所有遵守低功耗蓝牙(BLE)协议的设备,降低了对设备改进的成本。Compared with the prior art, in the data transmission method based on low-power bluetooth provided by this embodiment, when multiple slave devices communicate with the master device, the slave device transmits the payload with the master device by sending a timed broadcast. , the master and slave devices only need to establish a short-term connection, and the master device does not need to communicate with the slave device through polling, so it is not limited by the communication between a master device and a limited number of slave devices in the Bluetooth Low Energy (BLE) protocol. A master device can communicate with multiple slave devices at the same time, which directly expands the number of slave devices that the master device can communicate with. In the above process, the master and slave devices have only a short-term connection, and then the transmission of the payload can be regarded as a virtual connection, so that the BLE device does not need to maintain a dedicated communication channel connection for data transmission, which reduces the power consumption of the BLE device. At the same time, the slave device Transmission of data through the second type of broadcast makes the response speed of data communication fast, reduces the communication delay, and stabilizes communication; and the broadcast communication method is suitable for all devices that comply with the Bluetooth Low Energy (BLE) protocol, reducing the need for equipment. cost of improvement.

本发明的第三实施方式涉及一种从设备。具体如图4所示,包括但不限于,第一发送模块41、第一接收模块42和断开模块43。A third embodiment of the present invention relates to a slave device. Specifically, as shown in FIG. 4 , it includes, but is not limited to, a first sending module 41 , a first receiving module 42 and a disconnecting module 43 .

第一发送模块41,用于发送第一类广播。还用于根据所述虚拟连接参数,向所述主设备发送第二类广播,所述第二类广播中包括待传输的有效载荷。The first sending module 41 is used for sending the first type of broadcast. It is further configured to send a second type of broadcast to the master device according to the virtual connection parameter, where the second type of broadcast includes the payload to be transmitted.

第一接收模块42,用于分别接收来自主设备的连接请求和虚拟连接参数。The first receiving module 42 is configured to respectively receive the connection request and the virtual connection parameter from the master device.

断开模块43,用于断开与主设备的连接。The disconnecting module 43 is used to disconnect the connection with the main device.

具体的说,从设备4中的第一发送模块41以一定的周期在的低功耗蓝牙(BLE)标准定义的广播信道上发送第一类广播,第一类广播中可以包括:从设备名称、第一类广播周期及从设备地址信息。当主设备接收到第一广播后,主设备会根据从设备4的设备名称向从设备4发送连接请求,从设备4中的第一接收模块42,接收来自主设备的连接请求,其中,连接请求中包含主设备的地址信息、和跳频参数;配对模块43根据连接请求中的跳频参数建立连接,同时,从设备4在建立连接的数据信道接收配对参数即虚拟连接参数,配对模块43接收到主设备发送的配对参数,配对参数中包含,主设备地址、从设备地址、第二类广播周期、主设备密钥和虚拟连接的广播信道;配对模块43成功接收到虚拟连接参数后,确认配对成功。记录模块44,记录主设备的地址信息,还记录从设备4最后一次发送的第一类广播中的信息,比如,从设备密钥。当记录模块44完成主设备的地址记录后,配对模块43将断开从设备4与主设备之间的连接,从设备4中的第一发送模块41将以记录模块44中记录的第二类广播周期,向记录模块44记录的主设备地址发送第二类广播,其中,第二类广播中包含待传输的有效载荷。Specifically, the first sending module 41 in the slave device 4 sends the first type of broadcast on the broadcast channel defined by the Bluetooth Low Energy (BLE) standard at a certain period, and the first type of broadcast may include: the name of the slave device , the first type of broadcast cycle and slave device address information. After the master device receives the first broadcast, the master device will send a connection request to the slave device 4 according to the device name of the slave device 4, and the first receiving module 42 in the slave device 4 receives the connection request from the master device, wherein the connection request contains the address information of the master device and the frequency hopping parameter; the pairing module 43 establishes a connection according to the frequency hopping parameter in the connection request, and at the same time, the slave device 4 receives the pairing parameter, that is, the virtual connection parameter, in the data channel for establishing the connection, and the pairing module 43 receives The pairing parameters sent to the master device, the pairing parameters include the master device address, the slave device address, the second type of broadcast period, the master device key and the broadcast channel of the virtual connection; after the pairing module 43 successfully receives the virtual connection parameters, it confirms Pairing is successful. The recording module 44 records the address information of the master device, and also records the information in the first type of broadcast sent by the slave device 4 for the last time, for example, the key of the slave device. After the recording module 44 completes the address recording of the master device, the pairing module 43 will disconnect the connection between the slave device 4 and the master device, and the first sending module 41 in the slave device 4 will use the second type recorded in the recording module 44 In the broadcast period, the second type of broadcast is sent to the master device address recorded by the recording module 44, wherein the second type of broadcast includes the payload to be transmitted.

需要说明的是,第一类广播中还可以包含从设备密钥,从设备密钥可以是随机密钥,利用随机数生成。需要说明的是,第一发送模块41发送的所述有效载荷为利用目标密钥加密后的有效载荷,所述目标密钥根据预存的从设备密钥和所述主设备密钥生成。It should be noted that the first type of broadcast may also include a slave device key, and the slave device key may be a random key generated by using a random number. It should be noted that, the payload sent by the first sending module 41 is a payload encrypted with a target key, and the target key is generated according to the pre-stored slave key and the master key.

第一类广播中可以包含:从设备名称,第一类广播周期和从设备密钥,其中,第一类广播的数量大于1,至少有2次发送的第一类广播中的从设备密钥不同。也就是说,可以每隔一个周期,利用随机数生成一次从设备密钥,从设备4中的第一发送模块41以一定的周期发送第一类广播,主设备在监听到从设备4发送的第一类广播后,向从设备4发起连接请求,从设备4中的第一接收模块42,接收来自主设备的连接请求,其中,连接请求中可以包含主设备的地址信息和跳频参数;配对模块43根据连接请求中的跳频参数建立连接,记录模块44,记录主设备的地址信息,还记录从设备4最后一次发送的第一类广播中的信息,比如,从设备密钥。当记录模块44完成主设备的地址记录后,配对模块43将断开从设备4与主设备之间的连接,从设备4中的第一发送模块41利用目标密钥对第二类广播中的待传输的有效载荷进行加密,加密完成后第一发送模块41将以第二类周期,向主设备发送第二类广播。The first type of broadcast can include: the name of the slave device, the first type of broadcast period and the slave device key, where the number of the first type of broadcast is greater than 1, and the slave device key in the first type of broadcast sent at least 2 times different. That is to say, a random number can be used to generate the key of the slave device every other cycle, the first sending module 41 in the slave device 4 sends the first type of broadcast at a certain cycle, and the master device is listening to the data sent by the slave device 4. After the first type of broadcast, a connection request is initiated to the slave device 4, and the first receiving module 42 in the slave device 4 receives the connection request from the master device, wherein the connection request can include the address information and frequency hopping parameters of the master device; The pairing module 43 establishes a connection according to the frequency hopping parameter in the connection request, and the recording module 44 records the address information of the master device, and also records the information in the first type of broadcast sent by the slave device 4 last time, such as the slave device key. After the recording module 44 completes the address recording of the master device, the pairing module 43 will disconnect the connection between the slave device 4 and the master device, and the first sending module 41 in the slave device 4 uses the target key to pair the The payload to be transmitted is encrypted, and after the encryption is completed, the first sending module 41 will send the second-type broadcast to the master device at the second-type period.

相对于现有技术而言,本实施方式提供的从设备,在多台从设备与主设备通信时,从设备利用发送定时广播的方式与主设备进行有效载荷的传输,主从设备间只需建立短期连接,主设备无需通过轮询的方式与从设备进行数据通信,从而不受低功耗蓝牙(BLE)协议中一主设备与有限个从设备通信的限制,使得一主设备可以同时与多台从设备进行通信,直接扩展了主设备可通信的从设备的数量。上述过程中主从设备只有短暂的连接,之后有效载荷的传输可看作是虚拟连接,使得BLE设备无需为数据传输保持专用通信通道的连接,减小了BLE设备的功耗,同时,从设备通过第二类广播传输数据,使得数据通信响应的速度快,减小了通信时延,通信稳定;并且广播通信的方式适用于所有遵守低功耗蓝牙(BLE)协议的设备,降低了对设备改进的成本。Compared with the prior art, in the slave device provided in this embodiment, when multiple slave devices communicate with the master device, the slave device transmits the payload with the master device by sending a timed broadcast. To establish a short-term connection, the master device does not need to communicate with the slave device through polling, so it is not limited by the communication between a master device and a limited number of slave devices in the Bluetooth Low Energy (BLE) protocol, so that a master device can communicate with the slave device at the same time. Communication with multiple slave devices directly expands the number of slave devices that the master device can communicate with. In the above process, the master and slave devices have only a short-term connection, and then the transmission of the payload can be regarded as a virtual connection, so that the BLE device does not need to maintain a dedicated communication channel connection for data transmission, which reduces the power consumption of the BLE device. At the same time, the slave device Transmission of data through the second type of broadcast makes the response speed of data communication fast, reduces the communication delay, and stabilizes communication; and the broadcast communication method is suitable for all devices that comply with the Bluetooth Low Energy (BLE) protocol, reducing the need for equipment. cost of improvement.

不难发现,本实施方式为与第一实施方式相对应的设备实施例,本实施方式可与第一实施方式互相配合实施。第一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中。It is not difficult to find that this embodiment is a device example corresponding to the first embodiment, and this embodiment can be implemented in cooperation with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and are not repeated here in order to reduce repetition. Correspondingly, the related technical details mentioned in this embodiment can also be applied to the first embodiment.

本发明的第四实施方式涉及一种主设备。具体如图5a所示,包括但不限于,第二接收模块61、第二发送模块62和处理模块63。A fourth embodiment of the present invention relates to a master device. Specifically, as shown in FIG. 5 a , it includes, but is not limited to, a second receiving module 61 , a second sending module 62 and a processing module 63 .

第二接收模块61,用于接收来自从设备的第一类广播。还用于在接收到来自所述从设备的针对所述虚拟连接参数的确认后,根据所述虚拟连接参数接收来自所述从设备的第二类广播。The second receiving module 61 is configured to receive the first type of broadcast from the slave device. The method is further configured to receive the second type of broadcast from the slave device according to the virtual connection parameter after receiving the confirmation for the virtual connection parameter from the slave device.

第二发送模块62,用于根据该从设备名称,向该从设备发送连接请求和虚拟连接参数。The second sending module 62 is configured to send a connection request and virtual connection parameters to the slave device according to the name of the slave device.

处理模块63,用于从该第二类广播中解析出该有效载荷。The processing module 63 is configured to parse out the payload from the second type of broadcast.

具体的说,主设备6中的第二接收模块61在主设备在一个或几个低功耗蓝牙(BLE)标准定义的广播信道上监听从设备的第一类广播,第一类广播中可以包含:从设备名称、第一类广播周期,其中,从设备的数量不做限制。第二接收模块61在接收到第一类广播后,第二发送模块62根据从设备名称获取从设备的地址信息,向该地址信息的从设备发送连接请求,连接请求中包含主设备的地址信息,在从设备接收连接请求后,完成虚拟连接参数接收,保存主设备的地址信息后,从设备断开与设备6的连接,从设备向主设备6发送第二类广播,主设备6中的第二接收模块接收来自从设备的第二类广播,其中,第二类广播中包括待传输的有效载荷,处理模块63根据第二类广播格式解析出有效载荷。Specifically, the second receiving module 61 in the master device 6 monitors the first type of broadcast from the slave device on one or several broadcast channels defined by the Bluetooth Low Energy (BLE) standard on the master device. Including: slave device name, first type of broadcast period, among which, the number of slave devices is not limited. After the second receiving module 61 receives the first type of broadcast, the second sending module 62 obtains the address information of the slave device according to the name of the slave device, and sends a connection request to the slave device of the address information, where the connection request includes the address information of the master device , after the slave device receives the connection request, completes the reception of virtual connection parameters, saves the address information of the master device, the slave device disconnects the connection with the device 6, and the slave device sends the second type of broadcast to the master device 6. The second receiving module receives the second type of broadcast from the slave device, wherein the second type of broadcast includes the payload to be transmitted, and the processing module 63 parses the payload according to the second type of broadcast format.

需要说明的是,第一类广播中还可以包含从设备密钥,从设备密钥可以是随机从设备密钥,利用随机数生成。本实施方式中的主设备还可以如图5b所示,除了包括图5a中的模块之外,处理模块63包括:解密子模块631。It should be noted that the first type of broadcast may also include a slave device key, and the slave device key may be a random slave device key generated by using a random number. The master device in this embodiment may also be shown in FIG. 5 b , in addition to the modules in FIG. 5 a , the processing module 63 includes: a decryption sub-module 631 .

解密子模块631,用于利用目标密钥解密解析出的所述有效载荷,所述目标密钥根据预存的主设备密钥和所述从设备密钥生成。The decryption sub-module 631 is configured to decrypt the parsed payload using a target key, where the target key is generated according to the pre-stored master key and the slave key.

第一类广播中可以包括:从设备名称,第一类广播周期和从设备密钥。可以每隔一个周期,利用随机数生成一次从设备密钥,主设备6中的第二接收模块61在一个或多个低功耗蓝牙(BLE)广播信道上接收来自从设备的第一类广播,主设备6中的第二接收模块61在接收到第一类广播,并保存第一类广播中的从设备地址和从设备密钥,第二发送模块62根据从设备名称获取从设备的地址信息,向该地址信息的从设备发送连接请求,连接请求中包含主设备的地址信息,在从设备成功接收虚拟连接参数后,从设备向主设备6发送第二类广播,主设备6中的第二接收模块接收来自从设备的第二类广播,其中,第二类广播中包括待传输的有效载荷,处理模块63利用目标密钥,对第二类广播中的有效载荷进行解密。The first type of broadcast may include: the slave device name, the first type of broadcast period and the slave device key. The slave device key can be generated every other cycle by using a random number, and the second receiving module 61 in the master device 6 receives the first type of broadcast from the slave device on one or more Bluetooth Low Energy (BLE) broadcast channels. , the second receiving module 61 in the master device 6 receives the first type of broadcast and saves the slave device address and the slave device key in the first type of broadcast, and the second sending module 62 obtains the slave device address according to the slave device name information, send a connection request to the slave device of the address information, and the connection request contains the address information of the master device. After the slave device successfully receives the virtual connection parameters, the slave device sends the second type of broadcast to the master device 6. The second receiving module receives the second type of broadcast from the slave device, wherein the second type of broadcast includes the payload to be transmitted, and the processing module 63 uses the target key to decrypt the payload in the second type of broadcast.

相对于现有技术而言,本实施方式中提供的主设备与从设备进行数据通信时,在多台从设备与主设备通信时,从设备利用发送定时广播的方式与主设备进行有效载荷的传输,主从设备间只需建立短期连接,主设备无需通过轮询的方式与从设备进行数据通信,从而不受低功耗蓝牙(BLE)协议中一主设备与有限个从设备通信的限制,使得一主设备可以同时与多台从设备进行通信,直接扩展了主设备可通信的从设备的数量。上述过程中主从设备只有短暂的连接,之后有效载荷的传输可看作是虚拟连接,使得BLE设备无需为数据传输保持专用通信通道的连接,减小了BLE设备的功耗,同时,从设备通过第二类广播传输数据,使得数据通信响应的速度快,减小了通信时延,通信稳定;并且广播通信的方式适用于所有遵守低功耗蓝牙(BLE)协议的设备,降低了对设备改进的成本。Compared with the prior art, when the master device and the slave device provided in this embodiment communicate with each other, when multiple slave devices communicate with the master device, the slave device uses the method of sending timed broadcasts to communicate with the master device. For transmission, only a short-term connection needs to be established between the master and slave devices, and the master device does not need to communicate with the slave device through polling, so it is not limited by the communication between a master device and a limited number of slave devices in the Bluetooth Low Energy (BLE) protocol. , so that a master device can communicate with multiple slave devices at the same time, which directly expands the number of slave devices that the master device can communicate with. In the above process, the master and slave devices have only a short-term connection, and then the transmission of the payload can be regarded as a virtual connection, so that the BLE device does not need to maintain a dedicated communication channel connection for data transmission, which reduces the power consumption of the BLE device. At the same time, the slave device Transmission of data through the second type of broadcast makes the response speed of data communication fast, reduces the communication delay, and stabilizes communication; and the broadcast communication method is suitable for all devices that comply with the Bluetooth Low Energy (BLE) protocol, reducing the need for equipment. cost of improvement.

不难发现,本实施方式为与第二实施方式相对应的设备实施例,本实施方式可与第二实施方式互相配合实施。第二实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第二实施方式中。It is not difficult to find that this embodiment is a device example corresponding to the second embodiment, and this embodiment can be implemented in cooperation with the second embodiment. The related technical details mentioned in the second embodiment are still valid in this embodiment, and are not repeated here in order to reduce repetition. Correspondingly, the related technical details mentioned in this embodiment can also be applied to the second embodiment.

本发明的第五实施方式涉及一种基于低功耗蓝牙的数据传输系统,包括如第三实施方式中提到的从设备,和如第四实施方式中的提到的主设备,在该系统中从设备的数量不做限制,主设备至少有一台。The fifth embodiment of the present invention relates to a data transmission system based on Bluetooth low energy consumption, including a slave device as mentioned in the third embodiment, and a master device as mentioned in the fourth embodiment, in the system There is no limit to the number of slave devices, and there is at least one master device.

如图6所示,在本实施方式中,以5台从设备(分别为BLE设备2、BLE设备3、BLE设备4、BLE设备5),1台主设备(BLE设备1)为例进行说明。As shown in FIG. 6 , in this embodiment, five slave devices (respectively, BLE device 2, BLE device 3, BLE device 4, and BLE device 5) and one master device (BLE device 1) are used as examples for description. .

在该系统中,BLE设备2在低功耗蓝牙(BLE)标准定义的三个广播信道上发送第一类广播,BLE设备1接收来自BLE设备2发送的第一类广播,BLE设备1还可以在特定的广播信道上接收配对成功的BLE设备6发送的第二类广播,其中,BLE设备1和BLE设备2交互时间与BLE设备1和BLE设备6交互时间不重叠。In this system, BLE device 2 sends the first type of broadcast on the three broadcast channels defined by the Bluetooth Low Energy (BLE) standard, BLE device 1 receives the first type of broadcast sent from BLE device 2, and BLE device 1 can also The second type of broadcast sent by the successfully paired BLE device 6 is received on a specific broadcast channel, wherein the interaction time between BLE device 1 and BLE device 2 does not overlap with the interaction time between BLE device 1 and BLE device 6 .

BLE设备1在接收来自BLE设备2和BLE设备6的广播信息时,BLE设备1还可以在广播信道上向BLE设备3发起连接请求,其中,连接请求中包含BLE设备1的地址信息;还可以与已经建立了实际连接的BLE设备4发送虚拟连接参数,其中,虚拟连接参数可以包含BLE设备1的地址、BLE设备4的地址、第二类广播周期、BLE设备1的主设备密钥和虚拟连接的广播信道。其中,BLE设备1和BLE设备3交互时间与BLE设备1和BLE设备4交互时间不重叠。When BLE device 1 receives the broadcast information from BLE device 2 and BLE device 6, BLE device 1 can also initiate a connection request to BLE device 3 on the broadcast channel, where the connection request includes the address information of BLE device 1; Send virtual connection parameters with the BLE device 4 that has established an actual connection, where the virtual connection parameters can include the address of the BLE device 1, the address of the BLE device 4, the second type of broadcast period, the master key of the BLE device 1 and the virtual The connected broadcast channel. The interaction time between BLE device 1 and BLE device 3 does not overlap with the interaction time between BLE device 1 and BLE device 4.

BLE设备1与BLE设备5两设备为虚拟连接状态,此时,BLE设备5可以向BLE设备1发送第二类广播,也可以不发送第二类广播,可以在需要传输数据时,BLE设备2可直接通过指定的广播信道发送数据。BLE device 1 and BLE device 5 are in a virtual connection state. At this time, BLE device 5 can send the second type of broadcast to BLE device 1, or it can not send the second type of broadcast. When data transmission is required, BLE device 2 Data can be sent directly through the specified broadcast channel.

需要说明的是,在基于低功耗蓝牙的数据传输系统中,一个从设备还可以与多个主设备进行通信。It should be noted that, in a data transmission system based on Bluetooth low energy consumption, one slave device can also communicate with multiple master devices.

值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. A composite implementation of the unit. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.

本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps in the method of the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device (which may be a single-chip microcomputer) , chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.

本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those skilled in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes in form and details can be made without departing from the spirit and the spirit of the present invention. scope.

Claims (9)

1.一种基于低功耗蓝牙的数据传输方法,其特征在于,包括:1. a data transmission method based on low-power bluetooth, is characterized in that, comprises: 从设备发送第一类广播,所述第一类广播中包括:从设备名称;The slave device sends the first type of broadcast, and the first type of broadcast includes: the name of the slave device; 分别接收来自主设备的连接请求和虚拟连接参数,实现与所述主设备的配对连接,其中,所述虚拟连接参数中包括:传送周期和传送信道;Respectively receive a connection request and a virtual connection parameter from the master device, and implement a paired connection with the master device, wherein the virtual connection parameter includes: a transmission period and a transmission channel; 断开与所述主设备的连接;disconnecting from the master device; 根据所述虚拟连接参数,向所述主设备发送第二类广播,所述第二类广播中包括有效载荷,所述有效载荷为待传输数据。According to the virtual connection parameter, a second type of broadcast is sent to the master device, where the second type of broadcast includes a payload, and the payload is data to be transmitted. 2.根据权利要求1中所述的基于低功耗蓝牙的数据传输方法,其特征在于,所述虚拟连接参数中包括:主设备密钥;2. The data transmission method based on low-power bluetooth according to claim 1, wherein the virtual connection parameter comprises: a master device key; 向所述主设备发送的所述有效载荷为利用目标密钥加密后的有效载荷,所述目标密钥根据预存的从设备密钥和所述主设备密钥生成。The payload sent to the master device is a payload encrypted with a target key, and the target key is generated according to a pre-stored slave device key and the master device key. 3.一种基于低功耗蓝牙的数据传输方法,其特征在于,包括:3. a data transmission method based on low-power bluetooth, is characterized in that, comprises: 主设备接收来自从设备的第一类广播,所述第一类广播中包括:从设备名称;The master device receives the first type of broadcast from the slave device, and the first type of broadcast includes: the name of the slave device; 根据所述从设备名称,向所述从设备发送连接请求和虚拟连接参数,其中,所述虚拟连接参数中包括:传送周期和传送信道;According to the name of the slave device, send a connection request and virtual connection parameters to the slave device, wherein the virtual connection parameters include: a transmission period and a transmission channel; 在接收到来自所述从设备的针对所述虚拟连接参数的确认后,根据所述虚拟连接参数接收来自所述从设备的第二类广播;After receiving the confirmation for the virtual connection parameter from the slave device, receive the second type of broadcast from the slave device according to the virtual connection parameter; 从所述第二类广播中解析出有效载荷,所述有效载荷为待传输数据。A payload is parsed from the second type of broadcast, and the payload is the data to be transmitted. 4.根据权利要求3中所述的基于低功耗蓝牙的数据传输方法,其特征在于,所述第一类广播中还包括:从设备密钥;4. The data transmission method based on low-power bluetooth according to claim 3, wherein the first type of broadcast further comprises: a slave device key; 从所述第二类广播中解析出所述有效载荷,具体包括:利用目标密钥解密解析出的所述有效载荷,所述目标密钥根据预生成的主设备密钥和所述从设备密钥生成。Parsing the payload from the second type of broadcast specifically includes: decrypting the parsed payload with a target key, the target key based on the pre-generated master key and the slave key key generation. 5.一种从设备,其特征在于,包括:5. A slave device, characterized in that, comprising: 第一发送模块,用于发送第一类广播,所述第一类广播中包括:从设备名称;a first sending module, configured to send a first type of broadcast, where the first type of broadcast includes: a slave device name; 第一接收模块,用于分别接收来自主设备的连接请求和虚拟连接参数,实现与所述主设备的配对连接,其中,所述虚拟连接参数中包括:传送周期和传送信道;a first receiving module, configured to respectively receive a connection request and a virtual connection parameter from a master device, and implement a paired connection with the master device, wherein the virtual connection parameter includes: a transmission period and a transmission channel; 断开模块,用于断开与所述主设备的连接;A disconnecting module for disconnecting the main device; 所述第一发送模块,还用于根据所述虚拟连接参数,向所述主设备发送第二类广播,所述第二类广播中包括有效载荷,所述有效载荷为待传输数据。The first sending module is further configured to send a second type of broadcast to the master device according to the virtual connection parameter, where the second type of broadcast includes a payload, and the payload is data to be transmitted. 6.根据权利要求5所述的从设备,其特征在于,所述虚拟连接参数包括:主设备密钥;6. The slave device according to claim 5, wherein the virtual connection parameter comprises: a master device key; 所述第一发送模块发送的所述有效载荷为利用目标密钥加密后的有效载荷,所述目标密钥根据预存的从设备密钥和所述主设备密钥生成。The payload sent by the first sending module is a payload encrypted with a target key, and the target key is generated according to a pre-stored slave key and the master key. 7.一种主设备,其特征在于,包括:7. A main device, characterized in that, comprising: 第二接收模块,用于接收来自从设备的第一类广播,所述第一类广播中包括:从设备名称;The second receiving module is configured to receive the first type of broadcast from the slave device, where the first type of broadcast includes: the name of the slave device; 第二发送模块,用于根据所述从设备名称,向所述从设备发送连接请求和虚拟连接参数,其中,所述虚拟连接参数中包括:传送周期和传送信道;A second sending module, configured to send a connection request and virtual connection parameters to the slave device according to the slave device name, wherein the virtual connection parameters include: a transmission period and a transmission channel; 所述第二接收模块,还用于在接收到来自所述从设备的针对所述虚拟连接参数的确认后,根据所述虚拟连接参数接收来自所述从设备的第二类广播;The second receiving module is further configured to receive the second type of broadcast from the slave device according to the virtual connection parameter after receiving the confirmation for the virtual connection parameter from the slave device; 处理模块,用于从所述第二类广播中解析出有效载荷,所述有效载荷为待传输数据。A processing module, configured to parse out a payload from the second type of broadcast, where the payload is data to be transmitted. 8.根据权利要求7所述的主设备,其特征在于,所述第一类广播中还包括:从设备密钥;8. The master device according to claim 7, wherein the first type of broadcast further comprises: a slave device key; 所述处理模块,具体包括:解密子模块,用于利用目标密钥解密解析出的所述有效载荷,所述目标密钥根据预存的主设备密钥和所述从设备密钥生成。The processing module specifically includes: a decryption sub-module for decrypting the parsed payload by using a target key, where the target key is generated according to the pre-stored master key and the slave key. 9.一种基于低功耗蓝牙的数据传输系统,其特征在于,包括:如权利要求5或6中所述的从设备,和如权利要求7或8中所述的主设备。9 . A data transmission system based on Bluetooth low energy consumption, comprising: a slave device as claimed in claim 5 or 6 , and a master device as claimed in claim 7 or 8 .
CN201710068976.6A 2017-02-08 2017-02-08 Data transmission method based on low-power-consumption Bluetooth, slave master device and system Active CN106878926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710068976.6A CN106878926B (en) 2017-02-08 2017-02-08 Data transmission method based on low-power-consumption Bluetooth, slave master device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710068976.6A CN106878926B (en) 2017-02-08 2017-02-08 Data transmission method based on low-power-consumption Bluetooth, slave master device and system

Publications (2)

Publication Number Publication Date
CN106878926A CN106878926A (en) 2017-06-20
CN106878926B true CN106878926B (en) 2020-11-06

Family

ID=59167508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710068976.6A Active CN106878926B (en) 2017-02-08 2017-02-08 Data transmission method based on low-power-consumption Bluetooth, slave master device and system

Country Status (1)

Country Link
CN (1) CN106878926B (en)

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109327808B (en) * 2017-07-31 2021-04-20 华为技术有限公司 A method and device for transmitting data
CN107635215A (en) * 2017-08-25 2018-01-26 西安电子科技大学 Mesh networking method based on low energy bluetooth
CN107508714B (en) * 2017-09-26 2020-09-15 深圳市微智电子有限公司 Method and device for carrying out network configuration on Bluetooth equipment based on Bluetooth mesh
WO2019144351A1 (en) * 2018-01-25 2019-08-01 深圳市为通博科技有限责任公司 Master-slave role conversion method, chip, and data transmission system
DE102018202176B4 (en) * 2018-02-13 2025-06-12 Bayerische Motoren Werke Aktiengesellschaft Master-slave system for communication via a Bluetooth Low Energy connection
CN110519731A (en) * 2018-05-22 2019-11-29 袁功胜 Data communications method and system, BLE Bluetooth gateway based on BLE bluetooth, BLE equipment
CN108924806A (en) * 2018-07-19 2018-11-30 廊坊新奥燃气设备有限公司 A kind of family's internet of things data communication means and system using BLE technology
CN110839053B (en) * 2018-08-16 2022-05-27 阿里巴巴集团控股有限公司 Device communication method, device and storage medium
CN113906773B (en) * 2019-06-20 2023-11-28 华为技术有限公司 Channel selection method and device for low-power consumption Bluetooth equipment
CN112449328B (en) * 2019-08-30 2023-08-22 华为技术有限公司 A Bluetooth search method, system and related device
CN111107528B (en) * 2019-10-09 2023-05-02 珠海市杰理科技股份有限公司 Bluetooth testing method and testing machine
CN111132100B (en) * 2019-10-09 2023-05-02 珠海市杰理科技股份有限公司 Bluetooth connection method and device, Bluetooth device and Bluetooth system
CN111436039B (en) * 2019-10-23 2023-05-09 珠海市杰理科技股份有限公司 Bluetooth reconnection method and system, bluetooth master and slave equipment reconnection method and Bluetooth master and slave equipment
CN114830699B (en) * 2019-11-14 2024-10-22 深圳市汇顶科技股份有限公司 Method and BLE device for establishing ISO link
WO2021155482A1 (en) * 2020-02-03 2021-08-12 深圳市汇顶科技股份有限公司 Data transmission method and ble device
CN111246399B (en) * 2020-02-18 2022-07-22 Oppo(重庆)智能科技有限公司 Method for discovering Bluetooth device and related product
CN111556476B (en) * 2020-04-17 2021-01-19 炬力(珠海)微电子有限公司 Data transmission method between Bluetooth TWS (two way communication) devices and Bluetooth TWS devices
CN111683354B (en) * 2020-05-11 2023-05-12 杭州寰星电子科技有限公司 Event scheduling method and device for one master and multiple slaves in low-power consumption Bluetooth connection
CN111614459B (en) * 2020-05-29 2021-08-06 上海交通大学 Side-channel analysis method for BLE key agreement protocol
CN114040341B (en) * 2020-07-21 2023-03-24 海信视像科技股份有限公司 Bluetooth broadcast packet reporting processing method and display device
CN112333058B (en) * 2020-09-15 2023-06-30 深圳Tcl新技术有限公司 Device monitoring method, device, system and computer readable storage medium
CN112738779B (en) * 2020-12-25 2023-06-23 西安中星测控有限公司 Bluetooth transmission device
CN114765743B (en) * 2021-01-13 2025-01-10 阿里巴巴集团控股有限公司 Bluetooth communication method, electronic device and storage medium
CN113316131B (en) * 2021-05-27 2023-07-07 Oppo广东移动通信有限公司 Connection establishment method, device, electronic equipment and storage medium
CN113873589B (en) * 2021-09-18 2024-11-26 深圳市爱都科技有限公司 A Bluetooth connection switching method, Bluetooth headset and computer-readable storage medium
CN114007278B (en) * 2021-10-29 2024-06-07 歌尔科技有限公司 Multi-device pairing method, system, device and computer readable storage medium
CN114205758A (en) * 2021-11-16 2022-03-18 锐捷网络股份有限公司 Information processing method and device based on Bluetooth
CN115550895B (en) * 2022-09-30 2024-10-22 浙江大华技术股份有限公司 A Bluetooth connection method, device, system, equipment and medium
CN116095655B (en) * 2023-01-16 2025-07-25 广州国芯微技术有限公司 Main and auxiliary equipment communication method of TWS Bluetooth system
CN116405893A (en) * 2023-03-28 2023-07-07 山东浪潮科学研究院有限公司 A long-distance low-power consumption information collection method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10110855B2 (en) * 2012-08-10 2018-10-23 Logitech Europe S.A. Wireless video camera and connection methods including a USB emulation
CN104348522B (en) * 2013-07-23 2016-09-21 普天信息技术研究院有限公司 A kind of method that heart beating being applicable to low-power consumption bluetooth equipment keeps
US9693127B2 (en) * 2014-05-14 2017-06-27 Samsung Electronics Co., Ltd Method and apparatus for communicating audio data
CN106358137B (en) * 2015-07-14 2019-09-17 普天信息技术有限公司 From equipment cut-in method, from equipment and Bluetooth communication system in bluetooth group

Also Published As

Publication number Publication date
CN106878926A (en) 2017-06-20

Similar Documents

Publication Publication Date Title
CN106878926B (en) Data transmission method based on low-power-consumption Bluetooth, slave master device and system
CN109417758B (en) Bluetooth connection method and terminal
US9392525B2 (en) Establishing reliable routes without expensive mesh peering
CN116017377B (en) Method for establishing SLB connection, electronic equipment and communication system
CN111263338B (en) Network distribution method of Bluetooth Mesh network, related network distribution equipment and system
CN111698794B (en) Wireless audio sharing method
TW202112101A (en) Key generation and terminal network distribution method, device and equipment
JP2015525520A (en) Immediate connection after device discovery
US20210352458A1 (en) Method and apparatus for establishing bluetooth data channel
CN105657040B (en) intranet communication method and system between devices
CN107432043B (en) A paging method between NAN equipment and NAN equipment
US20240236568A1 (en) Wireless audio monitoring method and wireless audio system
CN113676880B (en) Key update method, network device, system and storage medium
US11882533B2 (en) Method for transmitting audio data using short-range wireless communication in wireless communication system, and apparatus therefor
CN108684021B (en) Bluetooth low-power-consumption communication method and device
EP4109234B1 (en) Wireless device monitoring method and apparatus
WO2023051082A1 (en) Data transmission method based on wireless network (wi-fi), and electronic device
JP7522871B2 (en) COMMUNICATION METHOD, USER DEVICE, BASE STATION DEVICE AND COMPUTER STORAGE MEDIUM
CN120935539A (en) Key updating method, network device, system and storage medium
KR20220033337A (en) Method for performing exposure notification service in bluetooth and apparatus supporting the same
CN116709281A (en) Audio transmission method, device, equipment, system and storage medium based on bluetooth
CN116647827A (en) Bluetooth communication method, device, equipment, system and storage medium
CN113259949B (en) Network configuration system and method, electronic equipment, and method and equipment for constructing network configuration system
EP3624356B1 (en) Wireless headset and signal transmission method for the same
CN118139214B (en) A connection method for a device

Legal Events

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

Effective date of registration: 20171229

Address after: 201203 Shanghai city Pudong New Area Zu Road No. 1500 building 3

Applicant after: Micro electronics (Shanghai) Co., Ltd.

Applicant after: Zhejiang Yankon Lighting Electrical Group Co., Ltd.

Address before: 201203 Shanghai city Pudong New Area Zu Road No. 1500 building 3

Applicant before: Micro electronics (Shanghai) Co., Ltd.

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 201203 building 3, no.1500 Zuchongzhi Road, Pudong New Area, Shanghai

Patentee after: Tailing Microelectronics (Shanghai) Co.,Ltd.

Patentee after: ZHEJIANG YANKON GROUP Co.,Ltd.

Address before: 201203 building 3, no.1500 Zuchongzhi Road, Pudong New Area, Shanghai

Patentee before: TELINK SEMICONDUCTOR (SHANGHAI) Co.,Ltd.

Patentee before: ZHEJIANG YANKON GROUP Co.,Ltd.