[go: up one dir, main page]

CN103684938B - A kind of industrial bluetooth network system and network-building method - Google Patents

A kind of industrial bluetooth network system and network-building method Download PDF

Info

Publication number
CN103684938B
CN103684938B CN201310566493.0A CN201310566493A CN103684938B CN 103684938 B CN103684938 B CN 103684938B CN 201310566493 A CN201310566493 A CN 201310566493A CN 103684938 B CN103684938 B CN 103684938B
Authority
CN
China
Prior art keywords
bluetooth
station
slave
master station
network
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.)
Expired - Fee Related
Application number
CN201310566493.0A
Other languages
Chinese (zh)
Other versions
CN103684938A (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201310566493.0A priority Critical patent/CN103684938B/en
Publication of CN103684938A publication Critical patent/CN103684938A/en
Application granted granted Critical
Publication of CN103684938B publication Critical patent/CN103684938B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种工业蓝牙网络系统及组网方法,其中一个蓝牙网络系统包括一个主站和多个从站,每个从站拥有一个网络密钥装置,用于存储加密的蓝牙安全组网过滤参数。组网前,蓝牙主站根据微微网ID设置搜索过滤参数,确保只有符合要求的从站才能被搜索到;蓝牙从站将微微网ID设置为自身的设备类型,并根据主站的蓝牙地址设置连接过滤参数,确保能被自己隶属的主站搜索到并只允许该主站与自己建立连接。组网中,蓝牙主从站根据设置的组网过滤参数建立ACL链路,防止未授权或非法的蓝牙设备加入网络。组网后,蓝牙微微网内的数据通信采用序列密码算法进行加密,防止非法设备的监听。本发明提高了网络的安全性、健壮性、可维护性及灵活性。

The invention discloses an industrial bluetooth network system and a networking method, wherein a bluetooth network system includes a master station and a plurality of slave stations, and each slave station has a network key device for storing encrypted bluetooth security networking filter parameters. Before networking, the Bluetooth master station sets the search and filter parameters according to the piconet ID to ensure that only slave stations that meet the requirements can be searched; the Bluetooth slave station sets the piconet ID as its own device type, and sets Connection filtering parameters to ensure that it can be searched by the master station to which it belongs and only allow the master station to establish a connection with itself. In the networking, the Bluetooth master and slave stations establish ACL links according to the set networking filtering parameters to prevent unauthorized or illegal Bluetooth devices from joining the network. After networking, the data communication in the Bluetooth piconet is encrypted with a sequence cipher algorithm to prevent illegal devices from monitoring. The invention improves the safety, robustness, maintainability and flexibility of the network.

Description

一种工业蓝牙网络系统及组网方法An industrial bluetooth network system and networking method

技术领域technical field

本发明涉及无线网络组网技术,具体涉及一种适用于工业环境的蓝牙网络系统及组网方法。The invention relates to a wireless network networking technology, in particular to a bluetooth network system and a networking method suitable for industrial environments.

背景技术Background technique

随着无线技术的飞速发展和日趋成熟,越来越多的工业场所采用无线技术作为有线技术的补充,特别在一些布线不方便的场合,如移动或旋转的设备之间的通信,河沟对面、公路或铁路对面的设备之间的通信等,无线技术得到了广泛的应用。采用无线技术有着如下的优点:布线简单、系统使用期长、可靠性高。目前应用于工业场合的无线技术有WIFI、蓝牙、ZigBee等等,WIFI适用于远距离高速率的数据传输,蓝牙适用于短距离中速率的可靠性要求较高的数据传输,而ZigBee则适用于低速率多节点的数据传输,工程师可以根据不同应用场景的需求采用不同的无线技术。With the rapid development and maturity of wireless technology, more and more industrial sites use wireless technology as a supplement to wired technology, especially in some occasions where wiring is inconvenient, such as communication between moving or rotating equipment, across rivers, Wireless technology is widely used for communication between devices across roads or railways. The use of wireless technology has the following advantages: simple wiring, long system life, and high reliability. The wireless technologies currently used in industrial occasions include WIFI, Bluetooth, ZigBee, etc. WIFI is suitable for long-distance high-speed data transmission, Bluetooth is suitable for short-distance medium-speed data transmission with high reliability requirements, and ZigBee is suitable for For low-speed multi-node data transmission, engineers can use different wireless technologies according to the needs of different application scenarios.

蓝牙是一种全球通用的短距离无线通信技术,其设备类型按照通信距离分成两类:Class1以及Class2,分别对应100米和10米的通信距离,不同的应用场合采用不同类型的蓝牙设备。蓝牙工作在2.4GHz频段,该频段免费供工业、医学以及科研领域使用。一个蓝牙主站可以同时和七个活动的蓝牙从站之间保持异步无连接链路(AsynchronousConnectionless Link,ACL),即蓝牙主站可以同与与七个从站进行通信,一个主站及多个从站构成了一个蓝牙微微网。对于ACL链路通信的可靠性,蓝牙物理层采用了跳频策略、前向纠错、编码优化等机制,使得蓝牙通信链路抗干扰性好、可靠性高。以上的机制保证了蓝牙技术能满足工业应用的集中式控制及可靠性要求。然而,将蓝牙应用于工业生产还需要解决以下问题:如何 设计蓝牙设备组网机制以保证蓝牙通信的安全性,以及如何提高网络的健壮性和可维护性。Bluetooth is a global short-range wireless communication technology. Its device types are divided into two categories according to the communication distance: Class1 and Class2, corresponding to the communication distance of 100 meters and 10 meters respectively. Different applications use different types of Bluetooth devices. Bluetooth works in the 2.4GHz frequency band, which is free for industrial, medical and scientific research fields. A Bluetooth master station can maintain an asynchronous connectionless link (Asynchronous Connectionless Link, ACL) between seven active Bluetooth slave stations at the same time, that is, the Bluetooth master station can communicate with seven slave stations at the same time, one master station and multiple slave stations The slave stations form a Bluetooth piconet. For the reliability of ACL link communication, the Bluetooth physical layer adopts frequency hopping strategy, forward error correction, coding optimization and other mechanisms to make the Bluetooth communication link have good anti-interference and high reliability. The above mechanisms ensure that Bluetooth technology can meet the centralized control and reliability requirements of industrial applications. However, the application of Bluetooth in industrial production also needs to solve the following problems: how to design the networking mechanism of Bluetooth devices to ensure the security of Bluetooth communication, and how to improve the robustness and maintainability of the network.

发明内容Contents of the invention

本发明的目的是提供一种蓝牙网络的组网方法和系统,旨在满足工业生产的安全性、健壮性和可维护性的需求。The object of the present invention is to provide a bluetooth network networking method and system, aiming at meeting the requirements of safety, robustness and maintainability of industrial production.

按照本发明的一个方面,提供一种工业蓝牙网络系统,用于工业场所中的通信,其包括蓝牙主站和由其管理的多个蓝牙从站,并且每个蓝牙从站都具备一个相应的网络密钥装置(NETWORK_KEY,简称N_K),其中,According to one aspect of the present invention, an industrial bluetooth network system is provided for communication in industrial places, which includes a bluetooth master station and a plurality of bluetooth slave stations managed by it, and each bluetooth slave station has a corresponding Network key device (NETWORK_KEY, referred to as N_K), wherein,

所述网络密钥装置用于实现所述蓝牙主站与其管理的多个蓝牙从站之间的组网过滤参数的交互;The network key device is used to realize the interaction of networking filtering parameters between the Bluetooth master station and multiple Bluetooth slave stations managed by it;

所述蓝牙主站、从站均包括:Described bluetooth master station, slave station all comprise:

中央控制单元(MCU),通过所述网络密钥装置中存储的过滤参数控制蓝牙模块进行网络管理和无线数据收发;以及The central control unit (MCU) controls the bluetooth module to perform network management and wireless data transmission and reception through the filtering parameters stored in the network key device; and

蓝牙模块,用来运行蓝牙协议栈,并通过主机控制接口(Host ControllerInterface,HCI)接受所述中央控制单元的控制命令以及接收其它蓝牙主站或从站发送过来的无线帧;The bluetooth module is used to run the bluetooth protocol stack, and accept the control commands of the central control unit and receive the wireless frames sent by other bluetooth master stations or slave stations through the host control interface (Host Controller Interface, HCI);

并且,所述蓝牙主站还包括:And, the bluetooth master station also includes:

网络配置接口电路,用来设置当前微微网ID、从站的逻辑地址以及主站管理的从站数目;以及RS485/CAN总线接口电路,用于该蓝牙主站与网络内的其他微微网主站组建成有线网络。The network configuration interface circuit is used to set the current piconet ID, the logical address of the slave station and the number of slave stations managed by the master station; and the RS485/CAN bus interface circuit is used for the bluetooth master station and other piconet master stations in the network Formed into a wired network.

作为本发明的改进,所述N_K为非易失存储器,通过总线与所述蓝牙主站或从站进行通信,其存储有加密后的组网过滤参数,包括当前微微网ID、主站蓝牙地址及从站逻辑地址。As an improvement of the present invention, the N_K is a non-volatile memory, communicates with the Bluetooth master station or slave station through the bus, and stores encrypted network filtering parameters, including the current piconet ID, master station Bluetooth address And the logical address of the slave station.

按照本发明的另一方面,提供一种应用上述的工业蓝牙网络系统进行组网的方法,其中,所述蓝牙主站执行如下步骤:According to another aspect of the present invention, a method of applying the above-mentioned industrial bluetooth network system for networking is provided, wherein the bluetooth master station performs the following steps:

1)配置与该蓝牙主站所管理的所有蓝牙从站相应的N_K,将主站蓝牙 地址、当前微微网ID和从站逻辑地址加密写入各蓝牙从站对应的N_K;1) Configure the N_K corresponding to all the Bluetooth slave stations managed by the Bluetooth master station, encrypt and write the Bluetooth address of the master station, the current piconet ID and the logical address of the slave station into the corresponding N_K of each Bluetooth slave station;

2)中央控制单元将蓝牙模块的搜索过滤参数设置为当前微微网ID,命令其执行搜索操作:若蓝牙模块搜索到的从站设备类型(CLASS_of_DEVICE)信息不符合搜索过滤参数,则不将该从站的蓝牙地址信息上传到中央控制单元;蓝牙模块搜索完毕后,若中央控制单元得到的从站蓝牙地址信息个数少于蓝牙主站应管理的从站数目,则命令蓝牙模块重新执行搜索操作,否则执行第3)步;2) The central control unit sets the search and filter parameters of the Bluetooth module as the current piconet ID, and orders it to perform a search operation: if the slave device type (CLASS_of_DEVICE) information found by the Bluetooth module does not meet the search filter parameters, the slave will not be The Bluetooth address information of the station is uploaded to the central control unit; after the Bluetooth module searches, if the number of slave station Bluetooth address information obtained by the central control unit is less than the number of slave stations that the Bluetooth master station should manage, the Bluetooth module is ordered to perform the search operation again , otherwise go to step 3);

3)所述蓝牙主站向搜索到的所有从站逐一发送ACL链路建立请求帧,等待所有从站接收该请求并建立与它之间的ACL链路,由此主站与从站组成一个微微网。3) The Bluetooth master station sends ACL link establishment request frames to all the searched slave stations one by one, and waits for all the slave stations to receive the request and establish an ACL link with it, so that the master station and the slave station form a piconet.

作为本发明的改进,所述步骤1)具体为:As an improvement of the present invention, said step 1) is specifically:

1a)上电后,中央控制单元和蓝牙模块之间建立BCSP链路;1a) After power on, a BCSP link is established between the central control unit and the Bluetooth module;

1b)所述蓝牙主站检测其本身是否插入了N_K,若是,执行第1c)步,否则执行第2)步;1b) The Bluetooth master station detects whether it has inserted N_K, if so, execute step 1c), otherwise execute step 2);

1c)中央控制单元通过HCI指令读取蓝牙模块的主站蓝牙地址,并读取通过所述网络配置接口电路设置的当前微微网ID和为与所述插入的N_K相应的蓝牙从站设置的逻辑地址,将这些信息加密存储到所述插入的N_K,然后等待用户断电操作,拔下该插入的N_K,若该蓝牙主站应管理的其他蓝牙从站相应的N_K尚未配置完毕,则继续插入其他蓝牙从站相应的N_K,最后返回步骤1a)。1c) The central control unit reads the bluetooth address of the master station of the bluetooth module through the HCI instruction, and reads the current piconet ID set by the network configuration interface circuit and the logic set for the bluetooth slave station corresponding to the inserted N_K Address, encrypt and store these information to the inserted N_K, and then wait for the user to power off and unplug the inserted N_K. If the corresponding N_K of other Bluetooth slave stations that the Bluetooth master station should manage has not been configured, continue to insert The corresponding N_K of other bluetooth slave stations, and finally return to step 1a).

作为本发明的改进,所述多个蓝牙从站中的每一个均执行如下步骤:As an improvement of the present invention, each of the plurality of bluetooth slave stations performs the following steps:

1)将与该蓝牙从站相应的N_K插入该从站,上电初始化,中央控制单元检测是否有N_K插入,若无,则不执行任何操作,否则执行第2)步;1) Insert the N_K corresponding to the Bluetooth slave station into the slave station, power on and initialize, the central control unit detects whether there is N_K inserted, if not, do not perform any operation, otherwise perform step 2);

2)中央控制单元与蓝牙模块建立BCSP链路,读取并解密所述插入的N_K中的组网过滤信息,并通过一系列的HCI指令对蓝牙模块执行参数配置,包括将该从站的设备类型(CLASS_of_DEVICE)设置为所述N_K中的当前微 微网ID,将连接请求的过滤参数设置为所述插入的N_K中的主站蓝牙地址;2) The central control unit establishes a BCSP link with the Bluetooth module, reads and decrypts the network filtering information in the inserted N_K, and performs parameter configuration on the Bluetooth module through a series of HCI commands, including the device of the slave station The type (CLASS_of_DEVICE) is set to the current piconet ID in the N_K, and the filter parameter of the connection request is set to the Bluetooth address of the master station in the inserted N_K;

3)所述蓝牙从站进入等待状态,响应主站的搜索操作和链路建立请求;若接收到链路建立请求帧,则判断该帧的来源地址与所述连接请求的过滤参数(即主站的蓝牙地址)是否一致,若一致,与主站建立ACL链路;否则丢弃该帧。3) The Bluetooth slave station enters the waiting state and responds to the search operation and link establishment request of the master station; if a link establishment request frame is received, it judges the source address of the frame and the filtering parameters of the connection request (ie, the master station’s Bluetooth address) are consistent, if they are consistent, establish an ACL link with the master station; otherwise, discard the frame.

作为本发明的改进,采用分组加密算法对所述N_K中存储的当前微微网ID、蓝牙从站的逻辑地址以及主站蓝牙地址进行加密;采用序列密码算法对所述ACL链路上的传输数据进行加密。As an improvement of the present invention, the current piconet ID stored in the N_K, the logical address of the bluetooth slave station, and the bluetooth address of the master station are encrypted by using a group encryption algorithm; to encrypt.

作为本发明的改进,在所述蓝牙主站上设置ACL链路保障机制:蓝牙主站监测与从站的断链事件,启动设备搜索操作,当断链原因消除时,主站重新搜索到该从站并执行相应的重连操作,以恢复与其的ACL链路。As an improvement of the present invention, an ACL link guarantee mechanism is set on the Bluetooth master station: the Bluetooth master station monitors the disconnection event with the slave station, starts a device search operation, and when the cause of the disconnection is eliminated, the master station searches for the link again. The slave station performs corresponding reconnection operations to restore its ACL link.

作为本发明的改进,通过以下步骤实现从站更换的即插即用:将原从站上的N_K拔出并插入到更换后的新从站,新从站上电之后自动执行所述参数配置,使得自身能被所述蓝牙主站搜索到并与其建立ACL链路。As an improvement of the present invention, the plug-and-play of slave station replacement is realized through the following steps: the N_K on the original slave station is pulled out and inserted into the replaced new slave station, and the parameter configuration is automatically performed after the new slave station is powered on , so that it can be searched by the Bluetooth master station and establish an ACL link with it.

作为本发明的改进,两个蓝牙从站在不断电的前提下,通过交换彼此相应的N_K实现微微网隶属关系的交换。As an improvement of the present invention, under the premise of uninterrupted power supply, the two bluetooth slave stations realize the exchange of piconet affiliation by exchanging corresponding N_K with each other.

作为本发明的改进,微微网隶属关系交换的具体步骤为:从站带电运行时,若更换N_K,该从站将来自于新的N_K中的信息与原先的信息相比较,若一致,不执行任何操作;若不一致,则该从站主动断开当前的链路,并根据新的N_K中的信息来进行初始化并设置设备类型(CLASS_of_DEVICE),随后等待来自主站的链路建立请求帧。As an improvement of the present invention, the specific steps of piconet membership exchange are: when the slave station is powered on, if N_K is replaced, the slave station will compare the information from the new N_K with the original information, and if they are consistent, do not execute Any operation; if inconsistent, the slave station actively disconnects the current link, initializes and sets the device type (CLASS_of_DEVICE) according to the information in the new N_K, and then waits for the link establishment request frame from the master station.

本发明能够在同一工作区域内组建多个并存的主从微微网,各微微网从站具有明确的隶属关系,能够防止未授权或非法的蓝牙设备加入网络;对于N_K中重要信息及蓝牙微微网中传输的数据进行加密处理,预防外部设备的窃听和解读,满足工业通信的安全性要求;组建的网络具有的链路保障机制和即插即用特性,提高了网络的健壮性、可维护性及灵活性。The invention can set up a plurality of co-existing master-slave piconets in the same working area, and each piconet slave station has a clear affiliation relationship, which can prevent unauthorized or illegal bluetooth devices from joining the network; important information in N_K and bluetooth piconets The data transmitted in the network is encrypted to prevent eavesdropping and interpretation of external devices, and meet the security requirements of industrial communications; the established network has a link guarantee mechanism and plug-and-play features, which improve the robustness and maintainability of the network and flexibility.

附图说明Description of drawings

图1显示了蓝牙主站的硬件结构图。Figure 1 shows the hardware structure diagram of the Bluetooth master station.

图2显示了蓝牙主站及从站采用的协议栈。Figure 2 shows the protocol stack used by the Bluetooth master station and slave station.

图3显示了蓝牙主站及从站的主程序流程图。Figure 3 shows the main program flow chart of the Bluetooth master station and slave station.

图4显示了蓝牙主站及从站中特殊机制流程图。Figure 4 shows the flow chart of the special mechanisms in the Bluetooth master and slave stations.

图5显示了多微微网并存的应用场景。Figure 5 shows an application scenario where multiple piconets coexist.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

1蓝牙设备硬件结构及采用的协议栈1 Bluetooth device hardware structure and protocol stack adopted

本发明设计的蓝牙设备有蓝牙主站、蓝牙从站以及N_K,下面首先对这些设备的硬件结构及其功能进行介绍。The bluetooth device designed by the present invention includes a bluetooth master station, a bluetooth slave station and N_K, and the hardware structure and functions of these devices are firstly introduced below.

参考图1,其中虚线部分为蓝牙主站的硬件结构示意图,它包括以下几个部分:Referring to Figure 1, the dotted line part is a schematic diagram of the hardware structure of the Bluetooth master station, which includes the following parts:

1)中央控制单元(MCU),用来控制蓝牙模块的操作以及与主站其它组件进行信息的交互。在本实施例中,MCU可以采用单片机。1) The central control unit (MCU), used to control the operation of the Bluetooth module and exchange information with other components of the master station. In this embodiment, the MCU may be a single chip microcomputer.

2)蓝牙模块,用来运行蓝牙协议栈,与其它站点的蓝牙模块和本站点的MCU进行信息的交互,为主站的MCU提供主机控制接口(Host Controller Interface,HCI)。2) The Bluetooth module is used to run the Bluetooth protocol stack, exchange information with the Bluetooth modules of other sites and the MCU of this site, and provide the host control interface (Host Controller Interface, HCI) for the MCU of the main site.

3)网络配置接口电路,用来设置当前微微网ID、从站的逻辑地址以及 主站管理的从站数目。在本实施例中,该配置接口电路可以为拨码开关。3) The network configuration interface circuit is used to set the current piconet ID, the logical address of the slave station and the number of slave stations managed by the master station. In this embodiment, the configuration interface circuit may be a dial switch.

4)RS485/CAN总线接口电路,用于与其他微微网主站组建成一个有线网络,实现有线通信与无线通信的融合。4) The RS485/CAN bus interface circuit is used to form a wired network with other piconet master stations to realize the integration of wired communication and wireless communication.

5)电源管理模块,用于为蓝牙模块、MCU以及其它组件供电。5) The power management module is used to supply power to the Bluetooth module, MCU and other components.

蓝牙从站与主站的差别在于:从站没有网络配置接口电路以及RS485/CAN总线接口电路。也即,蓝牙从站同样包括:The difference between the Bluetooth slave station and the master station is that the slave station has no network configuration interface circuit and RS485/CAN bus interface circuit. That is, the Bluetooth slave station also includes:

中央控制单元(MCU),用来控制蓝牙模块的操作,以及与从站其它组件进行信息的交互;以及Central Control Unit (MCU), used to control the operation of the Bluetooth module, and to interact with other components of the slave station; and

蓝牙模块,用来运行蓝牙协议栈,与其它站点的蓝牙模块和本站点的中央控制单元进行信息的交互,为所述中央控制单元提供主机控制接口(Host ControllerInterface,HCI)。The Bluetooth module is used to run the Bluetooth protocol stack, exchange information with the Bluetooth modules of other sites and the central control unit of this site, and provide the host control interface (Host Controller Interface, HCI) for the central control unit.

至于网络密钥装置(NETWORK_KEY),其存储芯片为非易失存储器,例如可断电保存数据的FLASH或EEPROM。网络密钥装置通过I2C总线与蓝牙设备的MCU相连。所述N_K用于实现所述蓝牙主站与其管理的多个蓝牙从站之间的组网过滤参数的交互。As for the network key device (NETWORK_KEY), its storage chip is a non-volatile memory, such as FLASH or EEPROM that can save data when power is turned off. The network key device is connected with the MCU of the bluetooth device through the I2C bus. The N_K is used to realize the interaction of networking filtering parameters between the Bluetooth master station and multiple Bluetooth slave stations managed by it.

图2为蓝牙设备采用的协议栈示意图。在该图中,蓝牙主机是指MCU,蓝牙控制器是指蓝牙模块,两者之间通过HCI接口进行交互,所谓的HCI是指蓝牙提供的一个访问其硬件的统一指令方式,通过该指令,用户可以控制本地蓝牙硬件的操作以及控制其与其它蓝牙设备的链路层的连接。在本发明中,蓝牙主机通过一系列的HCI指令实现特殊的网络组网以及数据传输功能。FIG. 2 is a schematic diagram of a protocol stack adopted by a Bluetooth device. In this figure, the Bluetooth host refers to the MCU, and the Bluetooth controller refers to the Bluetooth module. The two interact through the HCI interface. The so-called HCI refers to a unified instruction method provided by Bluetooth to access its hardware. Through this instruction, The user can control the operation of the local Bluetooth hardware and control its link layer connections with other Bluetooth devices. In the present invention, the Bluetooth host implements special network networking and data transmission functions through a series of HCI commands.

图2中,MCU与蓝牙模块是通过UART线相连的,在UART线路上传送的为BCSP格式(BlueCore Serial Protocol,为Bluetooth设备和系统之间传输HCI数据分组的一种可用协议)的数据帧,MCU与蓝牙模块相互交流的控制帧以及数据帧都是以BCSP格式封包。蓝牙网络建立完毕,MCU以及蓝牙模块以L2CAP(Logical Link Control and AdaptationProtocol,是蓝 牙系统中的核心协议,负责适配基带中的上层协议)格式封包数据帧,再将数据通过蓝牙模块发送出去或将从蓝牙模块接收到数据上传到MCU。In Figure 2, the MCU and the Bluetooth module are connected through the UART line, and the data frames transmitted on the UART line are in the BCSP format (BlueCore Serial Protocol, an available protocol for transmitting HCI data packets between the Bluetooth device and the system). The control frames and data frames communicated between the MCU and the Bluetooth module are packaged in BCSP format. After the Bluetooth network is established, the MCU and the Bluetooth module package data frames in the format of L2CAP (Logical Link Control and Adaptation Protocol, which is the core protocol in the Bluetooth system and is responsible for adapting the upper layer protocol in the baseband), and then send the data through the Bluetooth module. The data received from the Bluetooth module is uploaded to the MCU.

2蓝牙组网过程介绍2 Bluetooth networking process introduction

本发明设计的所有程序都运行在MCU上,并通过HCI接口对蓝牙模块进行操作。蓝牙主从站中的程序流程图如图3所示。All the programs designed by the present invention run on the MCU, and operate the bluetooth module through the HCI interface. The flow chart of the program in the Bluetooth master-slave station is shown in Figure 3.

在图5所描述的场景中,存在着两个蓝牙主站(BS1,BS2),六个蓝牙从站(C1_1,C1_2,C1_3,C2_1,C2_2,C2_3),每个蓝牙从站拥有一个相应的N_K。利用本发明提出的组网方法,这些蓝牙设备可以组成两个互不干扰的安全的微微网。以微微网N1为例,具体的组网步骤如下:In the scenario described in Figure 5, there are two Bluetooth master stations (BS1, BS2), six Bluetooth slave stations (C1_1, C1_2, C1_3, C2_1, C2_2, C2_3), each Bluetooth slave station has a corresponding N_K. Utilizing the networking method proposed by the invention, these bluetooth devices can form two secure piconets that do not interfere with each other. Taking piconet N1 as an example, the specific networking steps are as follows:

其中BS1的执行步骤如下:The execution steps of BS1 are as follows:

1)按照需求设置好BS1上的网络配置接口电路(拨码开关),再对其上电,此时MCU和蓝牙模块之间按照一定的机制建立BCSP链路,接着执行第二步。1) Set up the network configuration interface circuit (dip switch) on BS1 according to the requirements, and then power it on. At this time, a BCSP link is established between the MCU and the Bluetooth module according to a certain mechanism, and then perform the second step.

2)BS1检测其本身是否插入了N_K,若是,执行第三步,否则执行第四步。2) BS1 detects whether it has inserted N_K, if so, execute the third step, otherwise execute the fourth step.

3)MCU执行以下操作:通过HCI指令读取蓝牙模块的本地地址;读取拨码开关设置的从站C1_1的逻辑地址;读取拨码开关设置的当前微微网ID;将这些信息加密存储到与从站C1_1相应的N_K11;程序进行空循环,等待用户断电操作。3) The MCU performs the following operations: read the local address of the Bluetooth module through the HCI command; read the logical address of the slave station C1_1 set by the DIP switch; read the current piconet ID set by the DIP switch; store these information encrypted in N_K11 corresponding to the slave station C1_1; the program performs an empty cycle, waiting for the user to power off the operation.

采用同样的步骤将信息存储到N_K12,N_K13,其中从站逻辑地址不同,其他信息相同。Use the same steps to store the information to N_K12 and N_K13, where the logical address of the slave station is different, and other information is the same.

4)BS1通过MCU初始化蓝牙模块,将微微网ID作为蓝牙模块的搜索过滤参数,命令其执行搜索操作。若蓝牙模块搜索到的从站设备类型(CLASS_of_DEVICE)信息不符合搜索过滤参数,则不将该从站的蓝牙地址信息上传到MCU;蓝牙模块搜索完毕,若MCU得到的地址信息个数少于主站应管理的从站数目,则MCU命令蓝牙模块重新执行搜索操作,否则执行第五步。4) BS1 initializes the Bluetooth module through the MCU, uses the piconet ID as a search filter parameter of the Bluetooth module, and commands it to perform a search operation. If the slave station device type (CLASS_of_DEVICE) information searched by the Bluetooth module does not meet the search filter parameters, the Bluetooth address information of the slave station will not be uploaded to the MCU; after the Bluetooth module searches, if the number of address information obtained by the MCU is less than that of the master If the number of slave stations that the station should manage, the MCU commands the Bluetooth module to perform the search operation again, otherwise, perform the fifth step.

5)BS1向搜索到的所有从站逐一发送ACL链路建立请求帧,等待所有从站接收该请求并建立与它之间的链路,由此主站与从站组成一个微微网,此时蓝牙主站和从站之间可以进行数据交换。5) BS1 sends an ACL link establishment request frame to all the slave stations found one by one, and waits for all the slave stations to receive the request and establish a link with it, so that the master station and the slave stations form a piconet, at this time Data exchange can be carried out between the Bluetooth master station and the slave station.

蓝牙从站C1_1的执行步骤如下(C1_2与C1_3采用同样的步骤):The execution steps of Bluetooth slave station C1_1 are as follows (C1_2 and C1_3 adopt the same steps):

1)将存储信息的N_K11插入C1_1,再上电,此时MCU与蓝牙模块之间建立BCSP链路,接着C1_1开始进行初始化操作,即执行第二步操作。若其上电时检测到没有连接N_K11,则不执行任何操作。1) Insert the N_K11 storing information into C1_1, and then power on. At this time, a BCSP link is established between the MCU and the Bluetooth module, and then C1_1 starts the initialization operation, that is, executes the second step. If it detects that N_K11 is not connected when it is powered on, it will not perform any operation.

2)初始化操作是指:MCU通过一系列的HCI指令对蓝牙模块进行操作,包括将从站的CLASS_of_DEVICE设置为N_K11中的微微网ID,将连接请求的过滤参数设置为主站蓝牙地址。2) The initialization operation refers to: the MCU operates the Bluetooth module through a series of HCI instructions, including setting the CLASS_of_DEVICE of the slave station to the piconet ID in N_K11, and setting the filter parameters of the connection request to the Bluetooth address of the master station.

3)初始化完毕后,C1_1处于等待状态,响应主站的搜索操作和链路建立请求。若接收到链路建立请求帧,则判断该帧的来源地址与自身连接请求的过滤参数(即BS1蓝牙地址)是否一致,若一致,与主站建立ACL链路;否则丢弃该帧。3) After the initialization is completed, C1_1 is in a waiting state, responding to the search operation and link establishment request of the master station. If a link establishment request frame is received, it is judged whether the source address of the frame is consistent with the filtering parameters of its own connection request (ie BS1 Bluetooth address), and if they are consistent, an ACL link is established with the master station; otherwise, the frame is discarded.

通过上述步骤使BS1仅与符合要求的C1_1、C1_2、C1_3组建一个蓝牙微微网,阻止了同一场景内其它蓝牙节点的加入,实现了蓝牙组网的排它性。Through the above steps, BS1 only forms a Bluetooth piconet with C1_1, C1_2, and C1_3 that meet the requirements, preventing other Bluetooth nodes from joining in the same scene, and realizing the exclusiveness of Bluetooth networking.

3网络的安全性机制3 Network Security Mechanisms

通过上述操作使得蓝牙主站与其下属所有从站之间分别建立了一条ACL链路,从而组成了一个蓝牙微微网。本发明还设计了两种机制来保证该网络的安全性,满足工业无线通信需求。这两种机制如下:Through the above operations, an ACL link is respectively established between the Bluetooth master station and all its subordinate slave stations, thereby forming a Bluetooth piconet. The present invention also designs two mechanisms to ensure the security of the network and meet the requirements of industrial wireless communication. The two mechanisms are as follows:

3.1网络组建的排它性3.1 Exclusivity of Network Formation

由于跳频机制的存在,使得只有建立了链路的从站才能与其主站时钟同步并获取主站的跳频序列表,从而实现与主站的数据交换。未加入网络的设备则由于不知道网络在任意时刻所使用的通信频道而无法对网络通信 进行监听或干扰。因此,本发明提出的排它性组网方法能够提高微微网的安全性。Due to the existence of the frequency hopping mechanism, only the slave station that has established a link can synchronize with the clock of the master station and obtain the frequency hopping sequence list of the master station, thereby realizing data exchange with the master station. Devices that are not part of the network cannot monitor or interfere with network communications because they do not know the communication channels used by the network at any time. Therefore, the exclusive networking method proposed by the present invention can improve the security of the piconet.

所谓蓝牙组网的排它性,是指只有符合特定要求的蓝牙主站和从站才能组建成一个微微网。对照图5,假设需要实现以下的功能:同一现场中存在着两个微微网,微微网N1由主站BS1和从站C1_1,C1_2,C1_3组成,微微网N2由主站BS2和从站C2_1,C2_2,C2_3组成。其中每个蓝牙从站在运行时自身都带有一个相应的N_K。The so-called exclusivity of Bluetooth networking means that only Bluetooth master stations and slave stations that meet specific requirements can form a piconet. Referring to Figure 5, it is assumed that the following functions need to be realized: there are two piconets in the same site, the piconet N1 is composed of the master station BS1 and the slave stations C1_1, C1_2, C1_3, the piconet N2 is composed of the master station BS2 and the slave station C2_1, C2_2, C2_3 composition. Each of these Bluetooth slaves has its own corresponding N_K at runtime.

根据图3中所描述的步骤可知,在蓝牙主站和从站都上电组建微微网之前,具有如下特点:According to the steps described in Figure 3, before the Bluetooth master station and the slave station are both powered on to form a piconet, it has the following characteristics:

1)蓝牙主站的查询过滤参数与蓝牙从站本身的CLASS_of_DEVICE是一致的,其值为通过主站上拨码开关设置,写入到N_K之中的微微网ID数值。1) The query filter parameters of the Bluetooth master station are consistent with the CLASS_of_DEVICE of the Bluetooth slave station itself, and its value is set by the dial switch on the master station and written into the piconet ID value in N_K.

2)蓝牙从站的连接过滤参数与蓝牙主站本身的蓝牙地址是一致的,其值也写入了N_K。2) The connection filter parameters of the Bluetooth slave station are consistent with the Bluetooth address of the Bluetooth master station itself, and its value is also written into N_K.

根据上述特点,下面分析如何实现网络组网的排它性:According to the above characteristics, the following analyzes how to realize the exclusivity of network networking:

1)蓝牙主站选择从站:蓝牙主站的查询过滤参数值与蓝牙从站的CLASS_of_DEVICE是完全一致的。在图5中,虽然C1_1与C2_3都处于BS1的通信范围内,但只有C1_1的CLASS_of_DEVICE符合BS1查询的过滤条件,因此,BS1在查询过程中,只会获得C1_1的地址,BS1组建网络时只会向C1_1发送链路建立请求帧。因此实现了主站选择从站。1) The Bluetooth master station selects the slave station: the query filter parameter value of the Bluetooth master station is completely consistent with the CLASS_of_DEVICE of the Bluetooth slave station. In Figure 5, although both C1_1 and C2_3 are within the communication range of BS1, only the CLASS_of_DEVICE of C1_1 meets the filtering conditions of BS1's query. Therefore, BS1 will only obtain the address of C1_1 during the query process, and BS1 will only obtain the address of C1_1 when building a network. Send a link establishment request frame to C1_1. Therefore, the master station selects the slave station.

2)蓝牙从站选择主站,组网过程中,蓝牙从站的连接过滤参数与主站的蓝牙地址完全一致。以图5为例,假设由于意外情况而导致C1_1接收到BS1的链路建立请求帧的同时,还接收到BS2的链路建立请求帧。C1_1将判断请求帧的来源地址是否与其连接过滤参数一致,由于C1_1的连接过滤参数为BS1的蓝牙地址。C1_1将会丢弃BS2发送的链路请求帧,接收BS1的链路请求帧。因此实现了从站选择主站的功能。2) The Bluetooth slave station selects the master station. During the networking process, the connection filter parameters of the Bluetooth slave station are exactly the same as the Bluetooth address of the master station. Taking FIG. 5 as an example, assume that C1_1 receives the link establishment request frame of BS1 and simultaneously receives the link establishment request frame of BS2 due to an unexpected situation. C1_1 will judge whether the source address of the request frame is consistent with its connection filtering parameter, because the connection filtering parameter of C1_1 is the Bluetooth address of BS1. C1_1 will discard the link request frame sent by BS2 and receive the link request frame from BS1. Therefore, the function of selecting the master station from the station is realized.

从上面分析可以看出,操作员可以通过N_K以及设置主站的拨码开关 来实现组网的排它性,使得未得到授权和认证的蓝牙设备无法加入到蓝牙网络中去,以提高网络的安全性。From the above analysis, it can be seen that the operator can realize the exclusivity of the network through N_K and setting the DIP switch of the master station, so that the Bluetooth devices that have not been authorized and certified cannot join the Bluetooth network, so as to improve the security of the network. safety.

3.2加密机制3.2 Encryption mechanism

通过组网排它性提高了蓝牙网络的安全性,但是在网络中仍然存在以下两点安全性隐患:首先,N_K中存储的重要信息未做任何处理,外部人员若获取了N_K设备,通过N_K中信息可能分析出微微网的组网机制及参数;其次,在ACL链路上传输的数据也未作任何加密,这些数据仍有可能会被外部设备所窃取。对此,本发明提出了相应的解决方法。The security of the Bluetooth network is improved through networking exclusivity, but there are still two potential security risks in the network: First, the important information stored in N_K has not been processed. The information in the network may analyze the networking mechanism and parameters of the piconet; secondly, the data transmitted on the ACL link is not encrypted, and these data may still be stolen by external devices. To this end, the present invention proposes a corresponding solution.

1)N_K中存储的信息为当前微微网ID、从节点的逻辑地址以及蓝牙主站的蓝牙地址,这些信息的长度是固定的,因此,采用加密算法中的分组密码算法对其加密,将加密后的数据存储到N_K中,从站读取N_K中参数并解密,再将这些参数用于网络组建操作中。本发明中N_K信息长度为11字节,将其扩充为16字节,采用DES算法即可将其加密成新的16字节的密文。对N_K进行加密和解密要求蓝牙主站和从站采用同一密钥。1) The information stored in N_K is the current piconet ID, the logical address of the slave node and the Bluetooth address of the Bluetooth master. The final data is stored in N_K, and the slave station reads and decrypts the parameters in N_K, and then uses these parameters in the network construction operation. In the present invention, the N_K information length is 11 bytes, which is expanded to 16 bytes, and can be encrypted into a new 16-byte ciphertext by using the DES algorithm. Encrypting and decrypting N_K requires the Bluetooth master and slave to use the same key.

2)对于传输在ACL链路上的数据,由于这些数据长度是不固定的,所以不能采用分组算法对其进行加密,因此利用序列密码算法(也称流密码算法)对传送的数据流进行加密。本发明中采用了面向字节的RC4算法,该算法由于其结构简单、处理高效等特点被广泛应用于无线通信领域。主从站只需采用同一密钥即可实现对数据的加密和解密。2) For the data transmitted on the ACL link, since the length of these data is not fixed, it cannot be encrypted by the block algorithm, so the sequence cipher algorithm (also known as the stream cipher algorithm) is used to encrypt the transmitted data stream . The present invention adopts the byte-oriented RC4 algorithm, which is widely used in the field of wireless communication due to its simple structure and high processing efficiency. The master and slave stations only need to use the same key to realize the encryption and decryption of data.

在本发明中,通过组网前对N_K存储信息进行加密、组网中利用N_K信息进行排它式组网、组网后对网络中传输的数据进行加密这三层安全策略,能够防止未授权和非法的设备窃取蓝牙微微网的信息及其传输的数据,极大的提高了网络的安全性。In the present invention, through the three-layer security strategy of encrypting N_K storage information before networking, using N_K information in networking for exclusive networking, and encrypting data transmitted in the network after networking, unauthorized access can be prevented. And illegal equipment steals the information of Bluetooth piconet and the data transmitted, which greatly improves the security of the network.

由于跳频机制的存在,使得相邻微微网间的数据通信互不干扰,再加上本发明设计的排它性组网机制和相应的加密机制,实现了在同一场景内组建多个并存的安全的微微网的功能。Due to the existence of the frequency hopping mechanism, the data communication between adjacent piconets does not interfere with each other. In addition, the exclusive networking mechanism and corresponding encryption mechanism designed by the present invention realize the establishment of multiple coexisting networks in the same scene. Secure piconet functionality.

4网络的可维护性及灵活性分析4 Network maintainability and flexibility analysis

在提高了微微网通信的安全性之后,需要进一步改善系统的健壮性及可维护性,具体是指能实现断链自动重连且该操作不对其它完好链路的通信造成影响、易于更换故障从站以及在不断电前提下通过N_K的热插拔来实现蓝牙从站隶属微微网的变更。下面结合图5解释上述机制的实现。After improving the security of piconet communication, it is necessary to further improve the robustness and maintainability of the system. Specifically, it refers to the automatic reconnection of broken links without affecting the communication of other intact links, and the ease of replacement of faulty slaves. Station and under the premise of uninterrupted power supply, the change of the bluetooth slave station belonging to the piconet is realized through the hot plugging of N_K. The implementation of the above mechanism is explained below in conjunction with FIG. 5 .

1)蓝牙主站设计有ACL链路保障机制,例如若由于瞬时电磁干扰或从站断电,造成了BS1与C1_1之间的ACL链路断开,主站能够监测到这一断链事件,并启动设备搜索操作,当干扰消失或从站重新上电,则主站可以重新搜索到该从站并执行相应的重连操作,以恢复BS1与C1_1之间的ACL链路。主站在执行扫描和连接操作时,不会影响到其与C1_2、C1_3之间的ACL链路通信。具体的保障机制流程图如图4(a)所示,这种链路保障机制提高了蓝牙微微网的健壮性,增强了系统的抗干扰能力和故障恢复能力。1) The Bluetooth master station is designed with an ACL link guarantee mechanism. For example, if the ACL link between BS1 and C1_1 is disconnected due to instantaneous electromagnetic interference or power failure of the slave station, the master station can monitor this link disconnection event, And start the device search operation. When the interference disappears or the slave station is powered on again, the master station can search for the slave station again and perform the corresponding reconnection operation to restore the ACL link between BS1 and C1_1. When the master station performs scanning and connection operations, it will not affect the ACL link communication between it and C1_2 and C1_3. The specific guarantee mechanism flow chart is shown in Figure 4(a). This link guarantee mechanism improves the robustness of the Bluetooth piconet, and enhances the system's anti-interference ability and fault recovery ability.

2)上述链路保障机制能够提高网络的可维护性,例如图5中C1_1出现了永久性故障,需要更换新的从站,BS1侦测到该ACL链路的断开,则启动搜索操作并通过相应的状态指示提醒操作员进行网络维护,操作员此时只需将故障从站上的N_K拔出并插入更换后的新从站之中,新从站上电之后可自动执行参数配置,使得自己能被BS1扫描到并与其建立ACL链路,实现从站更换的即插即用。2) The above link guarantee mechanism can improve the maintainability of the network. For example, C1_1 in Figure 5 has a permanent fault and needs to be replaced with a new slave station. When BS1 detects that the ACL link is disconnected, it starts the search operation and Remind the operator to perform network maintenance through the corresponding status indication. At this time, the operator only needs to pull out the N_K on the faulty slave station and insert it into the replaced new slave station. After the new slave station is powered on, the parameter configuration can be performed automatically. So that it can be scanned by BS1 and establish an ACL link with it, so as to realize the plug-and-play of slave station replacement.

3)在从站处设计了一种提高组网灵活性的机制:如图5所示,若C1_3与C2_1同时处于BS1和BS2的有效通信范围内,则两从站可在不断电的前提下通过交换彼此的N_K实现微微网隶属关系的交换。该机制的流程图如图4(b)所示,具体过程如下:从站带电运行时,若更换N_K,在插入N_K时刻,MCU产生中断信号,在中断服务程序中,从站将来自于新的N_K中的信息与原先的信息相比较,若一致,不执行任何操作;若不一致,则从站主动断开当前的链路,并根据新的N_K中的信息来进行初始化和设置CLASS_of_DEVICE,随后等待来自主站的链路建立请求帧。而当前主站接收 到链路断开信息之后,就执行链路保障机制中的操作来恢复链路,通过上述的操作过程,C1_3与C2_1实现所属微微网的交换,这些操作并不影响N1与N2中其它正常链路的通信,提高了组网的灵活性。3) A mechanism to improve the flexibility of networking is designed at the slave station: as shown in Figure 5, if C1_3 and C2_1 are within the effective communication range of BS1 and BS2 at the same time, the two slave stations can The exchange of piconet affiliation is realized by exchanging each other's N_K. The flow chart of this mechanism is shown in Figure 4(b), and the specific process is as follows: When the slave station is running with electricity, if N_K is replaced, the MCU will generate an interrupt signal at the moment of inserting N_K, and in the interrupt service routine, the slave station will come from the new The information in the N_K is compared with the original information. If it is consistent, no operation is performed; if it is inconsistent, the slave station actively disconnects the current link, and initializes and sets CLASS_of_DEVICE according to the information in the new N_K, and then Wait for a link establishment request frame from the master station. After the current master station receives the link disconnection information, it executes the operation in the link guarantee mechanism to restore the link. Through the above operation process, C1_3 and C2_1 realize the exchange of the piconets they belong to. These operations do not affect N1 and C2_1. The communication of other normal links in N2 improves the flexibility of networking.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (8)

1.一种工业蓝牙网络系统,用于工业场所中的网络通信,其包括蓝牙主站和由其管理的多个蓝牙从站,并且每个蓝牙从站都具备一个相应的网络密钥装置(NETWORK_KEY),其中,1. An industrial bluetooth network system used for network communication in industrial places, which includes a bluetooth master station and a plurality of bluetooth slave stations managed by it, and each bluetooth slave station has a corresponding network key device ( NETWORK_KEY), where, 所述网络密钥装置为非易失存储器,通过总线与所述蓝牙主站或从站进行通信,其存储有加密后的组网过滤参数,包括当前微微网ID、主站蓝牙地址及从站逻辑地址,该网络密钥装置用于实现所述蓝牙主站与其管理的多个蓝牙从站之间的组网过滤参数的交互;The network key device is a non-volatile memory, which communicates with the Bluetooth master station or slave station through a bus, and stores encrypted network filtering parameters, including the current piconet ID, master station Bluetooth address and slave station Logical address, the network key device is used to realize the interaction of networking filtering parameters between the Bluetooth master station and multiple Bluetooth slave stations managed by it; 所述蓝牙主站、从站均包括:Described bluetooth master station, slave station all comprise: 中央控制单元(MCU),通过所述网络密钥装置中存储的组网过滤参数控制蓝牙模块进行网络管理和无线数据收发,包括:蓝牙主站上的中央控制单元将搜索过滤参数设置为当前微微网ID,命令其执行搜索操作以及向搜索到的所有从站逐一发送ACL链路建立请求帧;蓝牙从站上的中央控制单元与蓝牙模块建立BCSP链路,读取并解密插入的网络密钥装置中的组网过滤信息,并通过一系列的HCI指令对蓝牙模块执行参数配置,包括将该从站的设备类型设置为所述网络密钥装置中的当前微微网ID,将连接请求的过滤参数设置为所述插入的网络密钥装置中的主站蓝牙地址;以及The central control unit (MCU) controls the bluetooth module to perform network management and wireless data transmission and reception through the network filtering parameters stored in the network key device, including: the central control unit on the bluetooth master station sets the search filtering parameters to the current pico Network ID, order it to perform search operations and send ACL link establishment request frames to all searched slave stations one by one; the central control unit on the Bluetooth slave station establishes a BCSP link with the Bluetooth module, reads and decrypts the inserted network key The networking in the device filters information, and performs parameter configuration on the Bluetooth module through a series of HCI instructions, including setting the device type of the slave station as the current piconet ID in the network key device, and filtering the connection request The parameter is set to the Bluetooth address of the master station in the inserted network key device; and 蓝牙模块,用来运行蓝牙协议栈,并通过主机控制接口(Host Controller Interface,HCI)接受所述中央控制单元的控制命令以及其它主站或从站发送过来的无线帧;The bluetooth module is used to run the bluetooth protocol stack, and accepts the control commands of the central control unit and the wireless frames sent by other master stations or slave stations through the host control interface (Host Controller Interface, HCI); 并且,所述蓝牙主站还包括:And, the bluetooth master station also includes: 网络配置接口电路,用来设置当前微微网ID、从站的逻辑地址以及主站管理的从站数目;以及The network configuration interface circuit is used to set the current piconet ID, the logical address of the slave station and the number of slave stations managed by the master station; and RS485/CAN总线接口电路,用于该蓝牙主站与网络内的其他微微网主站组建成有线网络。The RS485/CAN bus interface circuit is used for the bluetooth master station to form a wired network with other piconet master stations in the network. 2.一种应用于权利要求1所述的工业蓝牙网络系统的组网方法,其中,所述蓝牙主站执行如下步骤:2. A networking method applied to the industrial bluetooth network system according to claim 1, wherein the bluetooth master station performs the following steps: 1)配置与该蓝牙主站所管理的所有蓝牙从站相应的网络密钥装置,将主站蓝牙地址、当前微微网ID和从站逻辑地址加密写入各蓝牙从站对应的网络密钥装置;1) Configure the network key device corresponding to all the Bluetooth slave stations managed by the Bluetooth master station, encrypt and write the Bluetooth address of the master station, the current piconet ID and the logical address of the slave station into the network key device corresponding to each Bluetooth slave station ; 2)中央控制单元将蓝牙模块的搜索过滤参数设置为当前微微网ID,命令其执行搜索操作:若蓝牙模块搜索到的从站设备类型(CLASS_of_DEVICE)信息不符合搜索过滤参数,则不将该从站的蓝牙地址信息上传到中央控制单元;蓝牙模块搜索完毕后,若中央控制单元得到的从站蓝牙地址信息个数少于蓝牙主站应管理的从站数目,则命令蓝牙模块重新执行搜索操作,否则执行第3)步;2) The central control unit sets the search and filter parameters of the Bluetooth module as the current piconet ID, and orders it to perform a search operation: if the slave station device type (CLASS_of_DEVICE) information searched by the Bluetooth module does not meet the search filter parameters, the slave will not be The Bluetooth address information of the station is uploaded to the central control unit; after the Bluetooth module searches, if the number of slave station Bluetooth address information obtained by the central control unit is less than the number of slave stations that the Bluetooth master station should manage, the Bluetooth module is ordered to perform the search operation again , otherwise execute step 3); 3)所述蓝牙主站向搜索到的所有从站逐一发送ACL链路建立请求帧,等待所有从站接收该请求并建立与它之间的ACL链路,由此主站与从站组成一个微微网;3) The Bluetooth master station sends an ACL link establishment request frame to all the slave stations searched one by one, waiting for all the slave stations to receive the request and establish an ACL link with it, thus the master station and the slave station form a piconet; 其中,所述多个蓝牙从站中的每一个均执行如下步骤:Wherein, each of the plurality of bluetooth slave stations performs the following steps: A)将与该蓝牙从站相应的网络密钥装置插入该从站,上电初始化,中央控制单元检测是否有网络密钥装置插入,若无,则不执行任何操作,否则执行第B)步;A) Insert the network key device corresponding to the Bluetooth slave station into the slave station, power on and initialize, the central control unit detects whether there is a network key device inserted, if not, then do not perform any operation, otherwise perform step B) ; B)中央控制单元与蓝牙模块建立BCSP链路,读取并解密所述插入的网络密钥装置中的组网过滤信息,并通过一系列的HCI指令对蓝牙模块执行参数配置,包括将该从站的设备类型(CLASS_of_DEVICE)设置为所述网络密钥装置中的当前微微网ID,将连接请求的过滤参数设置为所述插入的网络密钥装置中的主站蓝牙地址;B) The central control unit establishes a BCSP link with the Bluetooth module, reads and decrypts the network filtering information in the inserted network key device, and performs parameter configuration on the Bluetooth module through a series of HCI instructions, including the slave The device type (CLASS_of_DEVICE) of the station is set to the current piconet ID in the network key device, and the filter parameter of the connection request is set to the master station bluetooth address in the inserted network key device; C)所述蓝牙从站进入等待状态,响应主站的搜索操作和链路建立请求;若接收到链路建立请求帧,则判断该帧的来源地址与所述连接请求的过滤参数是否一致,若一致,与主站建立ACL链路;否则丢弃该帧。C) the bluetooth slave station enters a waiting state, and responds to a search operation and a link establishment request of the master station; if a link establishment request frame is received, it is judged whether the source address of the frame is consistent with the filter parameters of the connection request, If they are consistent, establish an ACL link with the master station; otherwise, discard the frame. 3.根据权利要求2所述的组网方法,其中,所述步骤1)具体为:3. The networking method according to claim 2, wherein the step 1) is specifically: 1a)上电后,中央控制单元和蓝牙模块之间建立BCSP链路;1a) After power-on, a BCSP link is established between the central control unit and the Bluetooth module; 1b)所述蓝牙主站检测其本身是否插入了网络密钥装置,若是,执行第1c)步,否则执行第2)步;1b) The bluetooth master station detects whether it has inserted a network key device, if so, executes step 1c), otherwise executes step 2); 1c)中央控制单元通过HCI指令读取蓝牙模块的主站蓝牙地址,并读取通过所述网络配置接口电路设置的当前微微网ID和为与所述插入的网络密钥装置相应的蓝牙从站设置的逻辑地址,将这些信息加密存储到所述插入的网络密钥装置,然后等待用户断电操作,拔下该插入的网络密钥装置,若该蓝牙主站应管理的其他蓝牙从站相应的网络密钥装置尚未配置完毕,则继续插入其他蓝牙从站相应的网络密钥装置,最后返回步骤1a)。1c) The central control unit reads the bluetooth address of the master station of the bluetooth module through the HCI instruction, and reads the current piconet ID set by the network configuration interface circuit and the bluetooth slave station corresponding to the inserted network key device Set the logical address, encrypt and store these information to the inserted network key device, and then wait for the user to power off and unplug the inserted network key device, if the other Bluetooth slave stations that the Bluetooth master station should manage correspond to If the configuration of the network key device has not been completed, continue to insert the corresponding network key devices of other Bluetooth slave stations, and finally return to step 1a). 4.根据权利要求2或3所述的组网方法,其中,采用分组加密算法对所述网络密钥装置中存储的当前微微网ID、蓝牙从站的逻辑地址以及主站蓝牙地址进行加密;采用序列密码算法对所述ACL链路上的传输数据进行加密。4. The networking method according to claim 2 or 3, wherein, the current piconet ID stored in the network key device, the logical address of the bluetooth slave station and the bluetooth address of the master station are encrypted by using a packet encryption algorithm; A sequence cipher algorithm is used to encrypt the transmission data on the ACL link. 5.根据权利要求2或3所述的组网方法,其中,在所述蓝牙主站上设置ACL链路保障机制:蓝牙主站监测与从站的断链事件,启动设备搜索操作,当断链原因消除时,主站重新搜索到该从站并执行相应的重连操作,以恢复与其的ACL链路。5. The networking method according to claim 2 or 3, wherein, an ACL link guarantee mechanism is set on the bluetooth master station: the bluetooth master station monitors the disconnection event with the slave station, starts a device search operation, and when the disconnection When the cause of the link is eliminated, the master station searches for the slave station again and performs the corresponding reconnection operation to restore the ACL link with it. 6.根据权利要求2或3所述的组网方法,其中,通过以下步骤实现从站更换的即插即用:将原从站上的网络密钥装置拔出并插入到更换后的新从站,新从站上电之后自动执行所述参数配置,使得自身能被所述蓝牙主站搜索到并与其建立ACL链路。6. The networking method according to claim 2 or 3, wherein the plug-and-play of slave station replacement is realized through the following steps: pull out the network key device on the original slave station and insert it into the new slave station after replacement station, after the new slave station is powered on, it automatically executes the parameter configuration, so that it can be searched by the Bluetooth master station and establish an ACL link with it. 7.根据权利要求2或3所述的组网方法,其中,两个蓝牙从站在不断电的前提下,通过交换彼此相应的网络密钥装置实现微微网隶属关系的交换。7. The networking method according to claim 2 or 3, wherein, under the premise of uninterrupted power supply, the two bluetooth slave stations realize the exchange of piconet affiliation by exchanging corresponding network key devices. 8.根据权利要求7所述的组网方法,其中,微微网隶属关系交换的具体步骤为:8. The networking method according to claim 7, wherein the specific steps of piconet affiliation exchange are: 从站带电运行时,若更换网络密钥装置,该从站将来自于新的网络密钥装置中的信息与原先的信息相比较,若一致,不执行任何操作;若不一致,则该从站主动断开当前的链路,并根据新的网络密钥装置中的信息来进行初始化并设置设备类型(CLASS_of_DEVICE),随后主站根据所述ACL链路保障机制重新与该从站建立链接。When the slave station is running with electricity, if the network key device is replaced, the slave station will compare the information from the new network key device with the original information, and if they are consistent, no operation will be performed; Actively disconnect the current link, initialize and set the device type (CLASS_of_DEVICE) according to the information in the new network key device, and then the master station re-establishes a link with the slave station according to the ACL link guarantee mechanism.
CN201310566493.0A 2014-01-26 2014-01-26 A kind of industrial bluetooth network system and network-building method Expired - Fee Related CN103684938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310566493.0A CN103684938B (en) 2014-01-26 2014-01-26 A kind of industrial bluetooth network system and network-building method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310566493.0A CN103684938B (en) 2014-01-26 2014-01-26 A kind of industrial bluetooth network system and network-building method

Publications (2)

Publication Number Publication Date
CN103684938A CN103684938A (en) 2014-03-26
CN103684938B true CN103684938B (en) 2017-03-08

Family

ID=50321317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310566493.0A Expired - Fee Related CN103684938B (en) 2014-01-26 2014-01-26 A kind of industrial bluetooth network system and network-building method

Country Status (1)

Country Link
CN (1) CN103684938B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202299A (en) * 2014-08-06 2014-12-10 北京中金国信科技有限公司 System and method of identity authentication based on Bluetooth
CN104637262A (en) * 2014-12-31 2015-05-20 华中科技大学 Loss preventing system and loss preventing method based on Bluetooth device and intelligent mobile terminal
CN105050033A (en) * 2015-07-01 2015-11-11 惠州Tcl移动通信有限公司 Piconet networking interconnection method and system based on low-power-dissipation Bluetooth and traditional Bluetooth
CN105050035A (en) * 2015-08-26 2015-11-11 苏州佩林网络科技有限公司 Dynamic infinite networking method based on Bluetooth BLE4.0
CN105228085A (en) * 2015-08-26 2016-01-06 苏州佩林网络科技有限公司 A kind of unlimited group network system based on bluetooth BLE4.0 and information transmitting methods
CN109150681B (en) * 2018-09-07 2021-03-16 深圳市雷赛控制技术有限公司 RTEX bus networking method and system
CN111223285B (en) * 2020-03-13 2024-10-18 昆明理工大学 Wireless vortex detection system and method based on sparse representation
CN113068163B (en) * 2021-02-20 2023-07-07 麒盛科技股份有限公司 Bluetooth networking method and system thereof
CN117997675A (en) * 2024-02-07 2024-05-07 奉加科技(上海)股份有限公司 Network access communication method, gateway equipment and peripheral equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003054574A1 (en) * 2001-12-21 2003-07-03 Nokia Corporation A method for identifying an individual module for short range wireless communication
CN1631004A (en) * 2001-10-16 2005-06-22 索尼株式会社 Communication system and method, and information processing apparatus and method
CN101232425A (en) * 2007-01-26 2008-07-30 京信通信系统(中国)有限公司 Bus type distributed control system master-salve station opposite terminal control method
CN102684753A (en) * 2011-03-07 2012-09-19 中兴通讯股份有限公司 Wireless terminal, short-range SNS (social networking services) system and implementation method based on Bluetooth technology
CN202720043U (en) * 2012-07-25 2013-02-06 贵州省计量测试院 Weight automatic verification device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1631004A (en) * 2001-10-16 2005-06-22 索尼株式会社 Communication system and method, and information processing apparatus and method
WO2003054574A1 (en) * 2001-12-21 2003-07-03 Nokia Corporation A method for identifying an individual module for short range wireless communication
CN101232425A (en) * 2007-01-26 2008-07-30 京信通信系统(中国)有限公司 Bus type distributed control system master-salve station opposite terminal control method
CN102684753A (en) * 2011-03-07 2012-09-19 中兴通讯股份有限公司 Wireless terminal, short-range SNS (social networking services) system and implementation method based on Bluetooth technology
CN202720043U (en) * 2012-07-25 2013-02-06 贵州省计量测试院 Weight automatic verification device

Also Published As

Publication number Publication date
CN103684938A (en) 2014-03-26

Similar Documents

Publication Publication Date Title
CN103684938B (en) A kind of industrial bluetooth network system and network-building method
US10455640B2 (en) IoT networking extension with bi-directional packet relay
CN110430014B (en) Hardware encryption gateway and encryption method for field bus channel encryption
CN105657639B (en) Dual-mode equipment and its method realized while communicated
CN110061989B (en) Data acquisition gateway full-isolation method
CN110024478A (en) Adaptivity network topology structure
CN102857956B (en) Master-slave communication method and device
CN104994014A (en) Communication method between power line carrier wave IPv and wireless ZigBee in smart grid communication
CN103763187A (en) IP gateway of EnOcean and KNX and communication network and method
CN103209318A (en) Internet protocol camera
Gazis et al. Wireless sensor networking, automation technologies and machine to machine developments on the path to the internet of things
CN101834913A (en) Wireless sensor network, mobile terminal and interconnection method and system thereof
CN104618899A (en) ZigBee router with built-in safety module
CN103944756A (en) Method for controlling wireless access point equipment based on OpenFlow protocol
CN204887482U (en) Control system based on router is connected to thing networking WIFI chip
CN202617367U (en) Wireless transmission module
CN104348523B (en) Data transmission method for wireless sensor node
CN207732991U (en) Internet of things data acquisition transmitter based on LoRa
CN101296145A (en) Embedded Wireless Mesh Network Router
CN111600378B (en) Communication method and system applied to communication assembly of master station and terminal
WO2012152070A1 (en) Method for communication between gateways in wsn, initiator gateway, and target gateway
CN105162253A (en) Wireless communication system for intellectualization of primary equipment
CN110266652A (en) A smart home security system
CN214591486U (en) An IoT device integration gateway
CN201450510U (en) A Mine Intrinsically Safe Wireless Ad Hoc Network Convergence Device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170308

CF01 Termination of patent right due to non-payment of annual fee