Bluetooth communication method and communication device of intelligent equipment and intelligent equipment

By obtaining and parsing the topological relationship network and preset marking numbers of Bluetooth peripherals in smart devices, the problem of high complexity in existing Bluetooth systems when managing multiple smart devices is solved, and the optimization of hardware resources and the simplification of software architecture is achieved.

CN119603662AInactive Publication Date: 2025-03-11SHENZHEN FEASYCOM TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510134335.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing Bluetooth systems are highly complex when managing and controlling multiple smart devices, resulting in increased hardware resource usage and complex software architecture.

Method used

By obtaining the topological relationship network of smart devices and multiple Bluetooth peripherals, identifying the preset marking number of each Bluetooth peripheral, and transmitting and parsing Bluetooth data packets based on these marking numbers to determine the peripheral type and generate corresponding device data, and finally transmitting the data to the corresponding Bluetooth peripheral synchronously.

Benefits of technology

Without affecting performance, the use of hardware resources is reduced, the software architecture is simplified, and the system management and control efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603662A_ABST
    Figure CN119603662A_ABST
Patent Text Reader

Abstract

The invention provides a Bluetooth communication method and device of an intelligent device and the intelligent device, and relates to the technical field of Bluetooth communication, and the Bluetooth communication method of the intelligent device comprises the steps: obtaining a current topological relation network between the intelligent device and a plurality of Bluetooth peripherals; identifying a corresponding preset tag number for each Bluetooth peripheral in the topological relation network; based on the identified Bluetooth peripheral, transmitting a Bluetooth data packet with a preset tag number to a Bluetooth protocol stack through a topological relation network, and analyzing the Bluetooth data packet in the Bluetooth protocol stack to determine a peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet; generating corresponding equipment data according to the peripheral type; and controlling the intelligent equipment to transmit the equipment data with the preset tag number to the Bluetooth protocol stack, and synchronously transmitting the equipment data with the preset tag number to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack. According to the application, occupation of hardware resources can be reduced, and a software architecture is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Bluetooth communication, and in particular to a Bluetooth communication method, a communication device and a smart device for smart devices. Background Art

[0002] With the continuous advancement of Internet of Things (IoT) technology, the demand for connection and communication via Bluetooth is growing among many devices. In application scenarios such as smart homes and industrial automation, multiple smart devices usually need to be managed and controlled in a unified manner. In the past, each Bluetooth chip was equipped with an independent driver module for one-to-one connection and individual control, which greatly increased the complexity of the Bluetooth system. Summary of the invention

[0003] The main purpose of the present invention is to provide a Bluetooth communication method for an intelligent device, aiming to reduce the occupation of hardware resources and simplify the software architecture without affecting the performance.

[0004] To achieve the above object, the present invention provides a Bluetooth communication method for a smart device, wherein the smart device is connected to multiple Bluetooth peripherals at the same time, and the Bluetooth communication method for the smart device comprises: Obtaining a current topological relationship network between the smart device and the plurality of Bluetooth peripherals; A preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network; Based on the identified Bluetooth peripheral, transmitting the Bluetooth data packet with the preset mark number to the Bluetooth protocol stack through the topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset mark number of each Bluetooth data packet; According to the peripheral type, generating corresponding device data; The smart device is controlled to transmit the device data with the preset mark number to the Bluetooth protocol stack, and the device data with the preset mark number is synchronously transmitted to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack.

[0005] Optionally, the Bluetooth peripheral device after identification transmits a Bluetooth data packet with the preset tag number to a Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral device corresponding to the preset tag number of each Bluetooth data packet, including: In case that the Bluetooth peripheral device identifier corresponds to the preset mark number, sending a broadcast data packet to the Bluetooth peripheral device through the broadcast mechanism of the Bluetooth protocol stack, the broadcast data packet having the preset mark number; Receive a Bluetooth data packet returned by the Bluetooth peripheral device, wherein the Bluetooth data packet has model data and operating status data corresponding to the Bluetooth peripheral device; The Bluetooth data packet is parsed by the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral, and the identified peripheral type is associated with a preset tag number to generate a corresponding tag-peripheral mapping relationship table.

[0006] Optionally, the parsing of the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral is specifically: Disassembling the Bluetooth data packet through the Bluetooth protocol stack to generate multiple data bytes; Performing cluster analysis on the plurality of data bytes based on a clustering algorithm to identify patterns and features in the data bytes, and outputting corresponding clustering results; grouping the data bytes according to the clustering result, each group representing a specific peripheral type; By comparing the similarity between each group of data bytes and the preset peripheral type data bytes, the closest peripheral type is matched.

[0007] Optionally, the preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes: Determine the location information of each of the Bluetooth peripherals in the topological network; the location information includes the location of each of the Bluetooth peripherals in space and the connection relationship between the front-end and back-end networks of each of the Bluetooth peripherals; Obtaining the access time of each of the Bluetooth peripherals to the topological relationship network; A unique preset identification number is allocated to each of the Bluetooth peripherals according to the access time and the position relationship.

[0008] Optionally, the smart device includes a multi-Bluetooth driver module, the multiple Bluetooth peripherals include a first Bluetooth peripheral, a second Bluetooth peripheral and a third Bluetooth peripheral, and multiple communication links are established between the multi-Bluetooth driver module, the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral; The obtaining of the current topological relationship network between the smart device and the plurality of Bluetooth peripherals comprises: Acquire a topological relationship network constructed by the smart device, the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral through the plurality of communication links; The preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes: Determine current location information of the first Bluetooth peripheral device, the second Bluetooth peripheral device, and the third Bluetooth peripheral device in the topological relationship network; Respectively obtain current access time of the first Bluetooth peripheral, the second Bluetooth peripheral, and the third Bluetooth peripheral to the topological relationship network; Allocate the preset marking number according to the current access time and the corresponding current location information of each Bluetooth peripheral; The Bluetooth peripheral device after identification transmits the Bluetooth data packet with the preset tag number to the Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral device corresponding to the preset tag number of each Bluetooth data packet, including: Based on the identified first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, synchronously transmitting the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet and the third Bluetooth peripheral data packet with the preset marking number to the Bluetooth protocol stack through the topological relationship network; Synchronously parsing the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet in the Bluetooth protocol stack to determine the peripheral types of the Bluetooth peripherals corresponding to the preset mark numbers of the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet, wherein the peripheral types include sensor types or actuator types; The generating corresponding device data according to the peripheral type includes: According to the peripheral device types corresponding to the first Bluetooth peripheral device, the second Bluetooth peripheral device and the third Bluetooth peripheral device, generating device data with a preset tag number for each of the Bluetooth peripheral devices; The controlling the smart device to transmit the device data with the preset mark number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset mark number to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack includes: Control the smart device to synchronously transmit the device data corresponding to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral through the Bluetooth protocol stack having a preset tag number associated with the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, so as to transmit the corresponding device data to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral respectively.

[0009] Optionally, the allocating a unique preset identification number to each of the Bluetooth peripherals according to the access time and the position relationship includes: Determining the order in which each of the Bluetooth peripherals accesses the network according to the access time; According to the position relationship, determining the hierarchical information of each Bluetooth peripheral in the topological relationship network and the layout position in space; Generate corresponding sequence identifiers in sequence according to the sequence, the level information and the layout positions in the space, and combine them to form a corresponding unique identifier sequence; The identification sequence is transmitted to the storage chip of the corresponding Bluetooth peripheral device, and the identification sequence information is locked to determine it as the unique preset mark number of the corresponding Bluetooth peripheral device.

[0010] Optionally, controlling the smart device to transmit the device data with the preset mark number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset mark number to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack includes: Encapsulating the device data into a Bluetooth data packet, wherein the Bluetooth data packet includes the preset marking number; Sending the Bluetooth data packet to the Bluetooth peripheral device via a Bluetooth protocol stack; After receiving the Bluetooth data packet, the Bluetooth peripheral device identifies the corresponding device data according to the preset tag number; The Bluetooth peripheral device performs corresponding operations according to the identified device data.

[0011] Optionally, the multiple Bluetooth peripherals include a fourth Bluetooth peripheral, a fifth Bluetooth peripheral and a sixth Bluetooth peripheral, and the fourth Bluetooth peripheral, the fifth Bluetooth peripheral and the sixth Bluetooth peripheral are sequentially arranged at multiple positions in the space; The Bluetooth communication method of the smart device also includes: Control the smart device, the fourth Bluetooth peripheral, the fifth Bluetooth peripheral and the sixth Bluetooth peripheral to be connected in series in sequence, and control the fourth Bluetooth peripheral and the fifth Bluetooth peripheral to be set to a relay mode and to be connected in series as a relay link; Control the smart device to transmit data to the sixth Bluetooth peripheral device through the relay link, or receive data from the sixth Bluetooth peripheral device through the relay link and transmit the data to the smart device.

[0012] In addition, to achieve the above-mentioned purpose, the present invention also provides a communication device, which includes: a memory, a processor, and a Bluetooth communication program stored in the memory and executable on the processor, wherein the Bluetooth communication program is configured to implement the Bluetooth communication method of the smart device as described above.

[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides a smart device, including the communication device as described above, the smart device includes a smart phone, a tablet computer or a wearable device, the Bluetooth peripheral includes a Bluetooth headset, a smart watch or a smart home gateway, and the smart device is connected to multiple Bluetooth peripherals to form the topological relationship network.

[0014] The embodiment of the present invention obtains the current topological relationship network between a smart device and multiple Bluetooth peripherals, identifies a preset tag number corresponding to each Bluetooth peripheral in the topological relationship network, and then based on the identified Bluetooth peripheral, transmits a Bluetooth data packet with a preset tag number to a Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet, and then generates device data corresponding to the peripheral type, and finally controls the smart device to transmit the device data with the preset tag number to the Bluetooth protocol stack, and synchronously transmits the device data with the preset tag number to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack, thereby reducing the occupation of hardware resources and simplifying the software architecture without affecting performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0017] Figure 1 It is a schematic diagram of a flow chart of a Bluetooth communication method of an intelligent device according to an embodiment of the present invention; Figure 2 A schematic diagram of a flow chart of a Bluetooth communication method for a smart device according to another embodiment of the present invention; Figure 3 A schematic diagram of a Bluetooth communication method flow of a smart device according to another embodiment of the present invention; Figure 4 A schematic diagram of a flow chart of a Bluetooth communication method for a smart device according to another embodiment of the present invention; Figure 5 A schematic diagram of a Bluetooth communication method flow of a smart device according to another embodiment of the present invention; Figure 6 A schematic diagram of a flow chart of a Bluetooth communication method for a smart device according to another embodiment of the present invention; Figure 7 A schematic diagram of a Bluetooth communication method flow of a smart device according to another embodiment of the present invention; Figure 8 This is a schematic flow chart of a Bluetooth communication method for a smart device according to another embodiment of the present invention.

[0018] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the well-known modules, units and their connections, links, communications or operations are not shown or described in detail. In addition, the described features, architectures or functions can be combined in any way in one or more embodiments. It should be understood by those skilled in the art that the various embodiments described below are only for illustration and not for limiting the scope of protection of the present invention. It can also be easily understood that the modules or units or processing methods in the various embodiments described herein and shown in the drawings can be combined and designed according to various different configurations. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0020] The limitations of various nouns or methods referred to in the following embodiments, except for those that are logically untenable, are generally based on the broad concepts that can be implemented under the premise of the disclosure in the embodiments. Under such understanding, the various specific subordinate specific limitations of the nouns or methods should be regarded as the inventive content of the present invention, and should not be understood narrowly or interpreted in a biased manner on the grounds that the specification does not disclose the specific limitations. Similarly, under the premise that it can be implemented logically, the order of the steps in the method is flexible and changeable, and the specific subordinate specific limitations in the broad concepts of various nouns or methods all fall within the scope of protection of the present invention.

[0021] With the continuous advancement of Internet of Things (IoT) technology, the demand for connection and communication via Bluetooth is growing among many devices. In application scenarios such as smart homes and industrial automation, it is usually necessary to uniformly manage and control multiple smart devices. The existing technology is to equip each Bluetooth chip with an independent driver module. However, this approach not only increases the complexity of the Bluetooth system, but also leads to an increase in hardware costs and software development and maintenance costs.

[0022] The main solution of the embodiment of the present application is: by obtaining the current topological relationship network between the smart device and multiple Bluetooth peripherals, and identifying a preset mark number corresponding to each Bluetooth peripheral in the topological relationship network, and then based on the identified Bluetooth peripherals, transmitting a Bluetooth data packet with a preset mark number to the Bluetooth protocol stack through the topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset mark number of each Bluetooth data packet, and then generating device data corresponding to the peripheral type, and finally controlling the smart device to transmit the device data with the preset mark number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset mark number to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack.

[0023] In this embodiment, for the convenience of description, the following description is made with the communication device as the execution subject.

[0024] This application provides a solution that can reduce the occupation of hardware resources and simplify the software architecture without affecting performance.

[0025] To this end, the present invention proposes a Bluetooth communication method for a smart device; it can be understood that a communication device for storing and executing the following method is provided in the smart device, and the communication device can be implemented by a main controller, such as MCU (Micro controller Unit), DSP (Digital Signal Process), FPGA (Field Programmable Gate Array), SOC (System OnChip), etc.

[0026] It should be understood that a smart device is connected to multiple Bluetooth peripherals at the same time, wherein the smart device includes multiple Bluetooth driver chips, and the multiple Bluetooth driver chips are connected to multiple Bluetooth peripherals one-to-one, or multiple communication links are established between the multiple Bluetooth driver chips and multiple Bluetooth peripherals, and a topological relationship network is formed by combining multiple communication links. Among them, smart devices may include smart phones, tablets or wearable devices. Bluetooth peripherals may include Bluetooth headsets, smart watches, health monitoring devices or smart home control devices.

[0027] Reference Figure 1 In one embodiment of the present invention, the Bluetooth communication method of the smart device includes steps S100-S500, wherein: S100, obtaining the current topological relationship network between the smart device and multiple Bluetooth peripherals; S200, identifying a preset mark number corresponding to each Bluetooth peripheral in the topological relationship network; S300, based on the identified Bluetooth peripheral, transmitting a Bluetooth data packet with a preset tag number to a Bluetooth protocol stack through a topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet; S400, generating corresponding device data according to the peripheral type; S500, controlling the smart device to transmit device data with a preset tag number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset tag number to the Bluetooth peripheral device corresponding to the preset tag number through the Bluetooth protocol stack.

[0028] In this embodiment, the topological relationship network is a connection network established between the smart device and multiple Bluetooth peripherals through its multiple Bluetooth driver chips. The smart device identifies and manages the Bluetooth peripherals connected to it through the Bluetooth driver chip to ensure the accuracy and efficiency of data transmission.

[0029] The preset marking numbers may include the device type identification of the Bluetooth peripheral, the connection status identification of the Bluetooth peripheral, and the priority identification of the Bluetooth peripheral, and can be adjusted and set according to the actual needs of the user. Through these preset marking numbers, the communication device can quickly identify and distinguish different Bluetooth peripherals, thereby achieving efficient data transmission and management. For example, the device type identification can distinguish whether it is an audio device, an input device, or other types of peripherals; the connection status identification can show whether the Bluetooth peripheral is currently connected or disconnected; the priority identification is used when multiple peripherals request data transmission at the same time, and the communication device can process the data packet in the established priority order to ensure the timely transmission of key data. In addition, Bluetooth peripherals can also be scanned periodically to update the connection status and performance parameters of the peripherals in real time to improve the reliability of communication and the user experience of smart devices.

[0030] The Bluetooth protocol stack is the core component of Bluetooth communication, responsible for handling the reception, transmission, routing and protocol implementation of Bluetooth data packets. It includes multiple layers, such as the host controller interface (HCI), logical link control and adaptation protocol (L2CAP), radio frequency communication (RFCOMM), etc. These layers work together to ensure the correct transmission of data packets. Through the Bluetooth protocol stack, communication devices can achieve seamless connection and data exchange with Bluetooth peripherals. In the Bluetooth protocol stack, the parsing and processing of Bluetooth data packets are key steps, which ensure that Bluetooth data packets can be correctly identified and classified, thereby achieving efficient communication between smart devices and peripherals.

[0031] Bluetooth data packets can include various types of data, such as device data, control commands, and status information. During data transmission between smart devices and Bluetooth peripherals, the format and content of Bluetooth data packets must strictly follow the provisions of the Bluetooth communication protocol to ensure the integrity and correctness of the data. For example, Bluetooth data packets may contain sensor readings, user input information, or other data generated by smart devices, or control commands used to instruct Bluetooth peripherals to perform specific operations, such as adjusting the volume, switching input sources, etc. This information is critical for smart devices because it can be used to optimize user experience and communication efficiency.

[0032] In this embodiment, it is assumed that the smart device is a user's smart phone, and multiple Bluetooth peripherals include a Bluetooth headset, a smart watch, and a smart home gateway. After the device is started, the smart phone is connected to the Bluetooth headset, the smart watch, and the smart home gateway through a multi-Bluetooth driver module, and there may also be corresponding communication links between the Bluetooth headset, the smart watch, and the smart home gateway, and a corresponding current topological relationship network is formed. Then, a corresponding preset mark number is set for each Bluetooth peripheral in the current topological relationship network, that is, the Bluetooth headset, the smart watch, and the smart home gateway, which can be a combination of numbers or letters, for identifying a specific Bluetooth peripheral during data transmission. For example, a Bluetooth headset may be assigned a mark number "A1", a smart watch is "B2", and a smart home gateway is "C3". In this way, the smart phone can identify and distinguish each Bluetooth peripheral connected to it, and send the corresponding device data to the correct peripheral according to the preset mark number. For example, when a user controls a smart home gateway through a smart phone, the communication device will mark the Bluetooth data packet containing the control command as "C3" to ensure that the data packet is sent to the smart home gateway instead of other peripherals.

[0033] After each Bluetooth peripheral is identified, a Bluetooth data packet with a preset tag number is transmitted to the Bluetooth protocol stack through the topological relationship network, for example, a Bluetooth data packet with a tag number "A1" is transmitted to the Bluetooth protocol stack, and the protocol stack will parse the data packet to determine that the peripheral type corresponding to the Bluetooth data packet is an audio device. Similarly, if the data packet has a tag number "B2", the peripheral type corresponding to the Bluetooth data packet is determined to be a wearable device, and the corresponding device data is generated according to the device data generation rule corresponding to the peripheral type. For example, for a Bluetooth headset with a tag number "A1", the device data may include audio stream data, while for a smart watch with a tag number "B2", the device data may include heart rate monitoring data or step information. After the device data is generated, the smart device, i.e., the smart phone, is controlled to transmit the device data with a preset tag number to the Bluetooth protocol stack. The protocol stack synchronously transmits these device data to the Bluetooth peripheral corresponding to the preset tag number. For example, when the smart phone generates audio stream data, it will encapsulate these data in a Bluetooth data packet with a tag number "A1" and send it to the Bluetooth headset through the Bluetooth protocol stack. This way, users can listen to the audio content played on their smartphones through Bluetooth headphones.

[0034] In addition, the communication device can also dynamically adjust the connection status between the smartphone and the Bluetooth peripheral according to the user's operating instructions. For example, when the user wants to switch to the smart watch to view the heart rate data, the communication device will control the smartphone to send a control command with the tag number "B2" to the Bluetooth protocol stack, and the protocol stack will transmit the command to the smart watch, thereby realizing the switching between devices, achieving accurate data exchange and correct execution of functions. This marking method not only improves the accuracy of data transmission, but also enhances the scalability and flexibility of the system, so that when more Bluetooth peripherals are added in the future, the communication device can still easily adapt and effectively manage them.

[0035] This embodiment obtains the current topological relationship network between the smart device and multiple Bluetooth peripherals, and identifies a preset tag number corresponding to each Bluetooth peripheral in the topological relationship network, and then based on the identified Bluetooth peripheral, transmits a Bluetooth data packet with a preset tag number to the Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet, and then generates device data corresponding to the peripheral type, and finally controls the smart device to transmit the device data with the preset tag number to the Bluetooth protocol stack, and synchronously transmits the device data with the preset tag number to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack, thereby reducing the occupation of hardware resources and simplifying the software architecture without affecting performance.

[0036] In addition, smart devices can also be connected to multiple host computers at the same time, where the host computers can be computer devices, smart phones or servers, etc. These host computers communicate with smart devices through the multi-Bluetooth driver chip of the smart device, which is used to remotely control, transmit data or monitor the status of the smart device. Through its built-in multi-Bluetooth driver chip, the smart device can efficiently manage the connection of multiple Bluetooth peripherals or the connection with the host computer to ensure real-time transmission and synchronization of data.

[0037] The network of the host computer has a main switch, which is used to control the on and off of the network path between the smart device and multiple host computers. The main switch can be an electronic switch such as a switch tube. In the linkage process with the host computer, the Bluetooth communication method of the smart device also includes steps S800-S1200, wherein: S800, controlling the main switch to close, so as to control the network path between the intelligent device and multiple host computers to be connected; S900, obtaining a topological relationship network between the smart device and multiple host computers, and setting a corresponding command switch to control the on and off of the network path between the smart device and the multiple host computers; S1000: When the network paths between the smart device and the multiple host computers are connected, the topological relationship network between the smart device and the multiple host computers and the current topological relationship network between the smart device and the multiple Bluetooth peripherals are merged into a host computer-smart device-Bluetooth peripheral topological relationship network; S1100, controlling the intelligent device to set a corresponding host computer mark number according to the access time and the level to which the host computer belongs, and transmitting the host computer mark number to the Bluetooth protocol stack; S1200, control the intelligent device to transmit a control data packet with a host computer mark number to the Bluetooth protocol stack through the topological relationship network between the intelligent device and multiple host computers, and determine at least one host computer corresponding to the control data packet in the Bluetooth protocol stack, and output the control data packet to the corresponding host computer, and wait for the information reception status reply signal of the host computer.

[0038] Among them, after the network path of the host computer and the smart device is connected, the smart device will become an intermediate device, and through its multi-Bluetooth driver modules, it will be connected to multiple host computers and multiple Bluetooth peripherals respectively. It can communicate with the host computer, that is, receive control signals from the host computer, or feedback monitoring signals to the host computer, and it can also communicate with Bluetooth peripherals, that is, it can control the opening and closing of Bluetooth peripherals or set the parameters of Bluetooth peripherals. It can also obtain the data monitored in the Bluetooth peripherals according to actual needs, thereby realizing two-way communication between the smart device and the host computer.

[0039] Among them, step S800 can be executed before step S500, and steps S900-S1200 can correspond to each step in steps S100-S500 and run synchronously to realize the data communication process between the smart device and the host computer and the Bluetooth peripheral device respectively.

[0040] In the process of communication with the host computer, the smart device not only serves as a bridge for data transmission, but also has the functions of data processing and decision support. For example, when the host computer is a computer device, the user can remotely monitor and control the smart device and its connected Bluetooth peripherals through the application on the computer device. After receiving the control instruction from the computer device, the smart device will parse the instruction content and adjust the working status or parameter settings of the Bluetooth peripheral according to the instruction requirements. In addition, the smart device can also upload the real-time monitoring data of the Bluetooth peripheral to the computer device for the user to analyze and process.

[0041] In the process of linkage with the host computer, the smart device can efficiently manage the connection between multiple Bluetooth peripherals and the host computer through its built-in multi-Bluetooth driver chip to ensure real-time data transmission and synchronization. In addition, the smart device can also dynamically adjust the connection status with the Bluetooth peripherals according to the instructions of the host computer to meet the needs of different application scenarios. For example, in the smart home scenario, users can use smart phones as the host computer and smart home gateways as smart devices. Bluetooth peripherals include smart lighting equipment, smart air conditioning equipment, smart humidifiers, etc. Users can remotely control the smart home gateway through smart phones to achieve control and parameter setting of Bluetooth peripherals such as smart lighting equipment, smart air conditioning equipment or smart humidifiers, thereby realizing intelligent management of smart homes. By adopting multi-Bluetooth driver chips and preset tag numbers, efficient and accurate communication between smart devices and multiple Bluetooth peripherals and host computers is achieved, which not only improves the accuracy and efficiency of data transmission, but also enhances the scalability and flexibility of the system.

[0042] Optionally, refer to Figure 2 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figure 1 In the illustrated embodiment, based on the identified Bluetooth peripheral, transmitting a Bluetooth data packet with a preset tag number to a Bluetooth protocol stack through a topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet includes steps S310-S330, wherein: S310, when the Bluetooth peripheral identifier corresponds to the preset mark number, sending a broadcast data packet to the Bluetooth peripheral through the broadcast mechanism of the Bluetooth protocol stack; S320, receiving a Bluetooth data packet returned by the Bluetooth peripheral, where the Bluetooth data packet has model data and operating status data of the corresponding Bluetooth peripheral; S330, parsing the Bluetooth data packet through the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral, and associating the identified peripheral type with a preset tag number to generate a corresponding tag-peripheral mapping relationship table.

[0043] In this embodiment, the broadcast data packet has a preset tag number, which is sent to the Bluetooth peripheral device through the broadcast mechanism, so that each peripheral device can receive the broadcast data packet corresponding to its preset tag number. After receiving the broadcast data packet, the Bluetooth peripheral device will return a Bluetooth data packet containing its own model and operating status information to the smart device according to its own model and operating status information. The Bluetooth protocol stack of the smart device is responsible for receiving these returned data packets and parsing the model data and operating status data therein. Through parsing, the smart device can identify the specific type of each Bluetooth peripheral device, and associate the specific type of these Bluetooth peripheral devices with the preset tag number set before, thereby establishing a tag-peripheral mapping relationship table. This tag-peripheral mapping relationship table is very important for the communication device, because it can help the communication device quickly identify and manage the connected Bluetooth peripheral devices, and ensure the accuracy and efficiency of data transmission. For example, when the smart device needs to send data to a specific type of peripheral device, the corresponding preset tag number can be directly found by the communication device through the mapping relationship table, and the data packet is sent to the correct Bluetooth peripheral device. This mechanism not only improves the efficiency of data transmission, but also enhances the stability of the system and user experience.

[0044] Optionally, refer to Figure 3 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figure 2 In the embodiment shown, the Bluetooth protocol stack parses the Bluetooth data packet to determine the peripheral type of the Bluetooth peripheral device, specifically steps S331-S334, wherein: S331, disassembling the Bluetooth data packet through the Bluetooth protocol stack to generate multiple data bytes; S332, clustering and analyzing the multiple data bytes based on a clustering algorithm to identify patterns and features in the data bytes, and outputting corresponding clustering results; S333, grouping the data bytes according to the clustering result, each group representing a specific peripheral type; S334: Match the closest peripheral type by comparing the similarity between each group of data bytes and the preset peripheral type data bytes.

[0045] In this embodiment, the Bluetooth protocol stack disassembles the Bluetooth data packet to generate multiple data bytes, which contain detailed information of the Bluetooth peripheral. The clustering algorithm is an unsupervised learning method that can group data bytes according to patterns and features in them. Through cluster analysis, data bytes with similar features can be grouped into the same group, and each group represents a specific peripheral type. For example, one group of data bytes may correspond to an audio device, while another group may correspond to an input device.

[0046] After cluster analysis, the communication device will compare the grouped data bytes with the preset peripheral type data bytes. The preset peripheral type data bytes are pre-set based on known Bluetooth peripheral types, and they represent the characteristic byte patterns of different peripheral types. By comparing the similarity, the communication device can match the closest peripheral type, thereby accurately identifying the type of the Bluetooth peripheral. For example, if a group of data bytes has the highest similarity with the preset audio device data bytes, then it can be determined that the Bluetooth peripheral is an audio device. Among them, the similarity of the data bytes can be set according to actual needs, for example, a similarity of 80% is classified into one category, or a similarity of 75% is classified into one category.

[0047] This method based on clustering algorithm and similarity matching not only improves the accuracy of smart devices in identifying the types of Bluetooth peripherals, but also enhances the adaptability and flexibility of communication devices to different types of peripherals. In this way, even when facing new or unknown Bluetooth peripherals, the communication device can quickly and accurately identify the type of peripheral by analyzing the pattern and characteristics of the data bytes, and perform effective data transmission and management, ensuring the convenience and reliability of users when using various Bluetooth peripherals.

[0048] It should be understood that in the process of marking Bluetooth peripherals, if the identification is simply set by time or access level, the problem of weak signal or signal loss of Bluetooth peripherals will occur. In order to more conveniently control the access of Bluetooth peripherals and ensure that the signal of each Bluetooth peripheral can be stably connected to the topological relationship network of smart devices and multiple Bluetooth devices, it can be obtained through the spatial position of the Bluetooth peripheral. The acquisition method can include obtaining the indoor / outdoor space layout drawings of the area where the topological relationship network of smart devices and multiple Bluetooth devices is located, and combining the signal data of the GPS sensor to locate each Bluetooth peripheral and smart device, and according to the position of each Bluetooth peripheral, adjust the topological relationship network of smart devices and multiple Bluetooth devices to enhance the signal strength of Bluetooth peripherals with weak signals to ensure that each Bluetooth peripheral can be stably connected. To achieve this purpose, it is necessary to assign a unique preset marking number to each Bluetooth peripheral, combined with the location information of each Bluetooth peripheral in the topological relationship network, when the signal of any Bluetooth peripheral in the topological relationship network is weak, its location can be determined by the unique preset marking number, and another signal connection path or signal bridge channel can be provided for the Bluetooth peripheral.

[0049] In order to achieve the above purpose, refer to Figure 4 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figure 3 In the embodiment shown, the preset mark number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes steps S210-S230, wherein: S210, determining the location information of each Bluetooth peripheral in the topological relationship network; S220, obtaining the access time of each Bluetooth peripheral device to the topological relationship network; S230: Allocate a unique preset tag number to each Bluetooth peripheral according to the access time and location relationship.

[0050] In this embodiment, the location information includes the location of each Bluetooth peripheral in space and the front-end and back-end network connection relationship of each Bluetooth peripheral; for example, the location in a specific area in the room, and whether the Bluetooth peripheral is directly connected to the smart device or connected through other Bluetooth peripherals. Access time refers to the time point when the Bluetooth peripheral is first connected to the smart device, or the time point when it is reconnected in the network. Through this information, the communication device can construct a detailed topological relationship network diagram, in which the location and access time of each Bluetooth peripheral are unique, so as to assign a unique preset tag number to each peripheral. For example, if a Bluetooth peripheral is located in the living room and the access time is 8 am, it may be assigned a tag number, such as "L1-0800", where "L1" represents the living room area and "0800" represents the access time. Such a tag number not only helps the communication device distinguish peripherals in different locations, but can also be set to manage the priority of peripherals according to the access time to ensure the timely processing of key tasks. In addition, this marking method can also help users quickly identify and locate their Bluetooth peripherals, improving the efficiency and convenience of device management.

[0051] It should be understood that the smart device includes multiple Bluetooth driver modules, the multiple Bluetooth peripherals include a first Bluetooth peripheral, a second Bluetooth peripheral and a third Bluetooth peripheral, and multiple communication links are established between the multiple Bluetooth driver modules, the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral.

[0052] Optionally, refer to Figure 5 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figure 4 In the illustrated embodiment, obtaining the current topological relationship network between the smart device and the plurality of Bluetooth peripherals includes step S110, wherein: S110, obtaining a topological relationship network constructed by the smart device, the first Bluetooth peripheral device, the second Bluetooth peripheral device, and the third Bluetooth peripheral device through multiple communication links.

[0053] The preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes steps S240-S260, wherein: S240, determining current location information of the first Bluetooth peripheral device, the second Bluetooth peripheral device, and the third Bluetooth peripheral device in the topological relationship network; S250, respectively obtaining the current access time of the first Bluetooth peripheral, the second Bluetooth peripheral, and the third Bluetooth peripheral to the topological relationship network; S260: Allocate a preset tag number according to the current access time and the corresponding current location information of each Bluetooth peripheral.

[0054] Based on the identified Bluetooth peripheral, transmitting a Bluetooth data packet with a preset tag number to a Bluetooth protocol stack through a topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each Bluetooth data packet includes steps S340-S350, wherein: S340, based on the identified first Bluetooth peripheral, second Bluetooth peripheral and third Bluetooth peripheral, synchronously transmit the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet and the third Bluetooth peripheral data packet with a preset mark number to the Bluetooth protocol stack through the topological relationship network; S350. Synchronously parse the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet in the Bluetooth protocol stack to determine the peripheral types of the Bluetooth peripherals corresponding to the preset mark numbers of the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet, wherein the peripheral types include sensor types or actuator types.

[0055] Generating corresponding device data according to the peripheral type includes step S410, wherein: S410: Generate device data with a preset tag number for each Bluetooth peripheral according to the peripheral types corresponding to the first Bluetooth peripheral, the second Bluetooth peripheral, and the third Bluetooth peripheral.

[0056] Controlling the smart device to transmit device data with a preset tag number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset tag number to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack includes step S510, wherein: S510, control the smart device to synchronously transmit the device data corresponding to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral through the Bluetooth protocol stack with the preset tag numbers associated with the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, so as to transmit the corresponding device data to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, respectively.

[0057] In the present embodiment, the smart device can be a smart phone, and the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral can be a Bluetooth headset, a smart watch and a smart home gateway, respectively. Through the multi-Bluetooth driver module, the smart device can establish a communication link with multiple Bluetooth peripherals at the same time to achieve synchronous transmission and processing of data. For example, when a user is using a smart watch for motion monitoring, the smart phone can receive motion data from the smart watch in real time, and transmit these data synchronously to the smart home gateway through the Bluetooth protocol stack, so that the user can view the motion data at home through the device controlled by the gateway. At the same time, the smart device can also receive audio data from the Bluetooth headset to realize the music playback function. The design of this multi-Bluetooth driver module not only improves the communication efficiency of the smart device, but also enhances the consistency and convenience of the user experience. Through this design, users can control and use various Bluetooth peripherals more flexibly to achieve a more intelligent lifestyle.

[0058] Among them, smartphones can establish multiple communication links with Bluetooth headsets, smart watches, and smart home gateways, and multiple communication links can also be established between Bluetooth headsets, smart watches, and smart home gateways. For example, after a smartphone is connected to a smart watch, the smart watch connects to the smart home gateway at the next level, thus forming a multi-level Bluetooth communication network. In this network, each Bluetooth peripheral can be assigned a different preset tag number according to its role and function in the network. For example, as a central node, a smart home gateway may be assigned a special tag number to facilitate smart devices to identify and prioritize data related to home automation. As devices that users interact directly with, Bluetooth headsets and smart watches may have their tag numbers used to distinguish audio streams from health monitoring data.

[0059] In practical applications, this multi-level Bluetooth communication network can provide more flexible and powerful functions. For example, when a user is exercising outdoors, a smart watch can monitor heart rate and steps in real time and send the data to a smartphone via Bluetooth. The smartphone then sends this data to smart devices at home, such as smart light bulbs or air conditioners, through a smart home gateway, which automatically adjusts the indoor environment according to the user's exercise status. This seamless communication and data exchange between smart devices not only improves the user experience, but also makes smart devices more intelligent and personalized.

[0060] Among them, the current location information of the Bluetooth headset, smart watch and smart home gateway in the topological relationship network is determined, for example, the Bluetooth headset is worn on the user's left ear, the smart watch is worn on the user's right wrist, and the smart home gateway is installed in the center of the living room. By obtaining this location information, smart devices can more accurately identify and manage each Bluetooth peripheral to ensure the accuracy and efficiency of data transmission. For example, when a user moves around the home, the smartphone can automatically adjust the connection strategy with the Bluetooth peripheral according to the location information, optimize the data transmission path, reduce delays and interference, and provide a smoother user experience.

[0061] In addition, the access time of each Bluetooth peripheral to the topological network is obtained, such as the Bluetooth headset first connected to the smartphone at 8 am, the smart watch connected at 2 pm, and the smart home gateway remains connected 24 hours a day. Access time information helps smart devices establish a time series of communication priorities to ensure priority processing at critical moments, such as emergency notifications or important data transmission. This time and location-based intelligent management not only improves the efficiency of communication, but also enhances the reliability of the system, ensuring that users can obtain timely and accurate services when using smart devices.

[0062] In addition, the communication device will assign a unique preset tag number to each Bluetooth peripheral according to the access time of each Bluetooth peripheral to the topological relationship network and the corresponding position when it is accessed. For example, if the Bluetooth headset is first connected at 8 o'clock in the morning and is located on the user's left ear, it may be assigned a tag number such as "E1-0800", where "E1" represents the Bluetooth headset and "0800" represents the access time. Similarly, smart watches and smart home gateways will also be assigned corresponding tag numbers according to their access time and location. This tagging method not only helps smart devices distinguish and manage different Bluetooth peripherals, but also ensures the timely processing of critical tasks.

[0063] After the Bluetooth headset, smart watch and smart home gateway are identified, the Bluetooth headset, smart watch and smart home gateway will synchronously transmit the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet and the third Bluetooth peripheral data packet with a preset tag number to the Bluetooth protocol stack through the topological relationship network, and the Bluetooth protocol stack will synchronously parse these data packets to determine the peripheral type of the Bluetooth peripheral corresponding to the preset tag number of each data packet. For example, if the tag number of the data packet matches the tag number of the smart watch, then the Bluetooth protocol stack will recognize that the data packet comes from the smart watch, and can determine that the peripheral type of the smart watch is a sensor type for sending user motion data. Similarly, if the tag number of the data packet matches the tag number of the Bluetooth headset, then the Bluetooth protocol stack will recognize that the data packet comes from the Bluetooth headset, and can determine that its peripheral type is an actuator type for receiving audio data.

[0064] According to the recognized peripheral type, the smartphone will generate corresponding device data. For example, for sports data from a smartwatch, the smartphone will generate device data containing information such as heart rate and number of steps; for audio data from a Bluetooth headset, the smartphone will generate device data containing audio stream information. These device data will be transmitted to the Bluetooth protocol stack by the communication device controlling the smartphone, and the device data with a preset tag number will be synchronously transmitted to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack.

[0065] For example, the communication device will control the smart device to transmit heart rate and step data to the Bluetooth protocol stack, and synchronously transmit these data to the smart home gateway through the Bluetooth protocol stack, so that users can view exercise data at home through the devices controlled by the gateway. At the same time, the communication device will also control the smart device to transmit audio stream data to the Bluetooth protocol stack, and synchronously transmit the audio data to the Bluetooth headset through the Bluetooth protocol stack to realize the music playback function.

[0066] Optionally, refer to Figure 6 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figure 4 In the embodiment shown, assigning a unique preset tag number to each Bluetooth peripheral according to the access time and location relationship includes steps S231-S234, wherein: S231, determining the order in which each Bluetooth peripheral accesses the network according to the access time; S232, determining the hierarchical information of each Bluetooth peripheral in the topological relationship network and the layout location in space according to the position relationship; S233, according to the sequence, level information and the layout position in the space, generate corresponding sequence identifiers in sequence, and combine them to form a corresponding unique identifier sequence; S234: Transmit the identification sequence to the storage chip of the corresponding Bluetooth peripheral device, and lock the identification sequence information to determine it as the unique preset mark number of the corresponding Bluetooth peripheral device.

[0067] In this embodiment, the access time can be the time point when the Bluetooth peripheral is first connected to the smart device, or it can be the time point when the Bluetooth peripheral is reconnected to the network. By recording the access time, the communication device can track the usage history and activity of the peripheral, which is essential for managing the life cycle of the device and maintaining the stability of the network. For example, if a Bluetooth peripheral is not connected for a long time, the communication device can automatically mark it as offline, or when new peripherals are found to be connected, the communication device can give priority to the connection requests of these devices to ensure the dynamic balance of the network and the rational allocation of resources.

[0068] The determination of the position relationship involves the specific location of the Bluetooth peripherals in the physical space and their levels in the network topology. For example, a smart home gateway located at the center of the home network may be assigned a higher level, while a Bluetooth light bulb located at the edge may be assigned a lower level. The level information helps smart devices to select routes during data transmission, optimize network traffic, and reduce latency. Among them, the specific location of the physical space where the Bluetooth peripherals are located can be imported by the user into the indoor / outdoor space layout drawings of each Bluetooth peripheral in the area where it is located, and the communication device controls each Bluetooth peripheral to obtain its own GPS location signal to locate each Bluetooth peripheral and smart device. Among them, the position relationship of the Bluetooth peripherals is generally fixed. If it is a smart wearable device, the position will change with the user's action. If the smart device is a smart home gateway, it is also fixed, but if it is a smart phone, the position is also variable. When the position of the Bluetooth peripheral or smart device in the space changes, the preset mark number will also be updated during the data transmission process to adjust the level and spatial position coding.

[0069] By combining the access time and location relationship, the communication device can generate a unique serial identifier, which not only reflects the access history and level information of the peripheral, but also helps the communication device quickly identify and locate the peripheral. For example, a serial identifier may contain the type, access time, level and spatial location information of the peripheral, such as "SW-0800-1-NE", where "SW" represents the smart watch, "0800" represents the access time, "1" represents the level, and "NE" represents the northeast direction. Such a serial identifier not only provides a unique identifier for each peripheral, but also helps users quickly identify and manage peripherals.

[0070] The generated identification sequence is transmitted to the storage chip of the corresponding Bluetooth peripheral and the identification sequence information is locked to ensure that the uniqueness of the peripheral is not tampered with. Once the identification sequence is locked, any attempt to modify or forge the identification will be detected by the communication device, thereby protecting the security of the network and the integrity of the data. In addition, this mechanism can also prevent conflicts and duplications between devices, ensuring the stable operation of the network.

[0071] In summary, by acquiring the access time and location information of the Bluetooth peripheral, the communication device can effectively build and maintain an efficient, stable and secure Bluetooth communication network.

[0072] Optionally, refer to Figure 7 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figures 1 to 6In any of the embodiments shown, controlling the smart device to transmit device data with a preset tag number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset tag number to the Bluetooth peripheral corresponding to the preset tag number through the Bluetooth protocol stack includes steps S520-S550, wherein: S520, encapsulating the device data into a Bluetooth data packet, wherein the Bluetooth data packet includes a preset tag number; S530, sending a Bluetooth data packet to a Bluetooth peripheral device through a Bluetooth protocol stack; S540, after receiving the Bluetooth data packet, the Bluetooth peripheral device identifies the corresponding device data according to the preset tag number; S550: The Bluetooth peripheral device performs corresponding operations according to the identified device data.

[0073] In this embodiment, the device data can be various types of data, such as audio data, video data, sensor data, control commands, etc. By encapsulating these data into a Bluetooth data packet and including a preset tag number in the data packet, the communication device can ensure that the output data packet is correctly sent to the target Bluetooth peripheral. For example, when a user wants to control a smart light bulb at home through a smart watch, the smart device generates a device data packet containing a control command and adds the preset tag number of the smart watch to it. After receiving this data packet, the Bluetooth protocol stack will send the data packet to the correct Bluetooth peripheral, i.e., the smart watch, according to the tag number. After receiving the data packet, the smart watch will recognize that this is a control command from the smart device according to the preset tag number therein, and perform corresponding operations, such as turning on or off the smart light bulb.

[0074] In addition, the encapsulation and transmission process of Bluetooth data packets also involves the verification and confirmation mechanism of data packets to ensure the integrity and reliability of the data. When the Bluetooth peripheral receives a Bluetooth data packet, it will check to confirm that the data packet has not been damaged during transmission, and send a confirmation signal to the smart device, indicating that the data packet has been successfully received. If an error occurs during the transmission of the data packet, the Bluetooth protocol stack will resend the data packet until a confirmation signal is received. This mechanism ensures that data transmission can maintain high reliability and stability even in complex wireless environments.

[0075] It should be understood that the multiple Bluetooth peripherals include a fourth Bluetooth peripheral, a fifth Bluetooth peripheral and a sixth Bluetooth peripheral, and the fourth Bluetooth peripheral, the fifth Bluetooth peripheral and the sixth Bluetooth peripheral are sequentially arranged at multiple positions in the space.

[0076] Optionally, refer to Figure 8 Another embodiment of the present invention provides a Bluetooth communication method for an intelligent device, based on the above Figures 1 to 6 In any of the embodiments shown, the Bluetooth communication method of the smart device further includes steps S600-S700, wherein: S600, controlling the smart device, the fourth Bluetooth peripheral, the fifth Bluetooth peripheral, and the sixth Bluetooth peripheral to be connected in series in sequence, and controlling the fourth Bluetooth peripheral and the fifth Bluetooth peripheral to be set to a relay mode, and to be connected in series as a relay link; S700: Control the smart device to transmit data to the sixth Bluetooth peripheral device through the relay link, or receive data from the sixth Bluetooth peripheral device through the relay link and transmit the data to the smart device.

[0077] In this embodiment, the relay link is a solution to enhance signal coverage and stability. By setting the fourth Bluetooth peripheral and the fifth Bluetooth peripheral to relay mode, the transmission distance of the Bluetooth signal can be effectively extended to overcome the signal attenuation problem caused by physical obstacles. For example, when the smart device is located in room A, and the sixth Bluetooth peripheral is located in another room B that is far away or blocked by a wall, the smart device can establish a stable communication connection with the sixth Bluetooth peripheral through the relay link of the fourth Bluetooth peripheral and the fifth Bluetooth peripheral.

[0078] In the relay link setting, the smart device first establishes a connection with the fourth Bluetooth peripheral, then the fourth Bluetooth peripheral establishes a connection with the fifth Bluetooth peripheral, and finally the fifth Bluetooth peripheral establishes a connection with the sixth Bluetooth peripheral. In this way, the data packet can be transmitted from the smart device to the sixth Bluetooth peripheral through this relay link, or vice versa. After receiving the data packet, the Bluetooth peripheral in relay mode will forward it to the next node until the data packet reaches the final destination.

[0079] In addition, the establishment and maintenance of relay links require smart devices to have certain intelligent judgment and management capabilities. Smart devices need to be able to detect signal strength and quality, automatically select the best relay node, and reconfigure the relay link in time when any node in the link has problems, to ensure the continuity and stability of communication. For example, if it is detected that the signal quality of the fifth Bluetooth peripheral has deteriorated, the communication device will control the smart device to try to switch to another better relay node, or directly disconnect from the fifth Bluetooth peripheral and re-establish the connection.

[0080] The use of relay links not only improves the reliability of Bluetooth communication, but also provides more possibilities for the application of smart devices in complex environments. For example, in large shopping malls, factories or hospitals, by setting up multiple relay nodes, Bluetooth signal coverage of the entire area can be achieved, allowing smart devices to communicate with more Bluetooth peripherals, thereby providing richer and more convenient smart services.

[0081] The present invention also proposes a communication device, which includes: the communication device includes: a memory, a processor, and a Bluetooth communication program stored in the memory and executable on the processor, wherein the Bluetooth communication program is configured to implement the Bluetooth communication method of the smart device as described above.

[0082] It is worth noting that since the communication device of the present invention is based on the Bluetooth communication method of the above-mentioned smart device, the embodiments of the communication device of the present invention include all technical solutions of all embodiments of the Bluetooth communication method of the above-mentioned smart device, and the technical effects achieved are also exactly the same, which will not be repeated here.

[0083] The present invention also proposes a smart device, which includes a communication device as described in the above embodiment, the smart device includes a smart phone, a tablet computer or a wearable device, and the Bluetooth peripheral includes a Bluetooth headset, a smart watch or a smart home gateway. The smart device is connected to multiple Bluetooth peripherals to form a topological relationship network.

[0084] It is worth noting that since the smart device of the present invention is based on the above-mentioned communication device, the embodiments of the smart device of the present invention include all technical solutions of all embodiments of the above-mentioned communication device, and the technical effects achieved are also exactly the same, which will not be repeated here.

[0085] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0086] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0088] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A Bluetooth communication method for a smart device, wherein the smart device is connected to multiple Bluetooth peripherals at the same time, characterized in that: The Bluetooth communication method of the smart device includes: Obtaining a current topological relationship network between the smart device and the plurality of Bluetooth peripherals; A preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network; Based on the identified Bluetooth peripheral, transmitting the Bluetooth data packet with the preset mark number to the Bluetooth protocol stack through the topological relationship network, and parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral corresponding to the preset mark number of each Bluetooth data packet; According to the peripheral type, generating corresponding device data; The smart device is controlled to transmit the device data with the preset mark number to the Bluetooth protocol stack, and the device data with the preset mark number is synchronously transmitted to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack.

2. The Bluetooth communication method of the smart device according to claim 1, characterized in that: The Bluetooth peripheral device after identification transmits the Bluetooth data packet with the preset tag number to the Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral device corresponding to the preset tag number of each Bluetooth data packet, including: In case that the Bluetooth peripheral device identifier corresponds to the preset mark number, sending a broadcast data packet to the Bluetooth peripheral device through the broadcast mechanism of the Bluetooth protocol stack, wherein the broadcast data packet has the preset mark number; Receive a Bluetooth data packet returned by the Bluetooth peripheral device, wherein the Bluetooth data packet has model data and operating status data corresponding to the Bluetooth peripheral device; The Bluetooth data packet is parsed by the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral, and the identified peripheral type is associated with a preset tag number to generate a corresponding tag-peripheral mapping relationship table.

3. The Bluetooth communication method of the smart device as claimed in claim 2, characterized in that: The step of parsing the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral is specifically: Disassembling the Bluetooth data packet through the Bluetooth protocol stack to generate multiple data bytes; Performing cluster analysis on the plurality of data bytes based on a clustering algorithm to identify patterns and features in the data bytes, and outputting corresponding clustering results; grouping the data bytes according to the clustering result, each group representing a specific peripheral type; By comparing the similarity between each group of data bytes and the preset peripheral type data bytes, the closest peripheral type is matched.

4. The Bluetooth communication method of the smart device as claimed in claim 3, characterized in that: The preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes: Determine the location information of each of the Bluetooth peripherals in the topological network; the location information includes the location of each of the Bluetooth peripherals in space and the connection relationship between the front-end and back-end networks of each of the Bluetooth peripherals; Obtaining the access time of each of the Bluetooth peripherals to the topological relationship network; A unique preset identification number is allocated to each of the Bluetooth peripherals according to the access time and the position relationship.

5. The Bluetooth communication method of the smart device as claimed in claim 4, characterized in that: The smart device includes a multi-Bluetooth driver module, the multiple Bluetooth peripherals include a first Bluetooth peripheral, a second Bluetooth peripheral and a third Bluetooth peripheral, and multiple communication links are established between the multi-Bluetooth driver module, the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral; The obtaining of the current topological relationship network between the smart device and the plurality of Bluetooth peripherals comprises: Acquire a topological relationship network constructed by the smart device, the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral through the plurality of communication links; The preset marking number corresponding to each Bluetooth peripheral identifier in the topological relationship network includes: Determine current location information of the first Bluetooth peripheral device, the second Bluetooth peripheral device, and the third Bluetooth peripheral device in the topological relationship network; Respectively obtain current access time of the first Bluetooth peripheral, the second Bluetooth peripheral, and the third Bluetooth peripheral to the topological relationship network; Allocate the preset marking number according to the current access time and the corresponding current location information of each Bluetooth peripheral; The Bluetooth peripheral device after identification transmits the Bluetooth data packet with the preset tag number to the Bluetooth protocol stack through the topological relationship network, and parses the Bluetooth data packet in the Bluetooth protocol stack to determine the peripheral type of the Bluetooth peripheral device corresponding to the preset tag number of each Bluetooth data packet, including: Based on the identified first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, synchronously transmitting the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet and the third Bluetooth peripheral data packet with the preset marking number to the Bluetooth protocol stack through the topological relationship network; Synchronously parsing the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet in the Bluetooth protocol stack to determine the peripheral types of the Bluetooth peripherals corresponding to the preset mark numbers of the first Bluetooth peripheral data packet, the second Bluetooth peripheral data packet, and the third Bluetooth peripheral data packet, wherein the peripheral types include sensor types or actuator types; The generating corresponding device data according to the peripheral type includes: According to the peripheral device types corresponding to the first Bluetooth peripheral device, the second Bluetooth peripheral device and the third Bluetooth peripheral device, generating device data with a preset tag number for each of the Bluetooth peripheral devices; The controlling the smart device to transmit the device data with the preset mark number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset mark number to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack includes: Control the smart device to synchronously transmit the device data corresponding to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral through the Bluetooth protocol stack having a preset tag number associated with the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral, so as to transmit the corresponding device data to the first Bluetooth peripheral, the second Bluetooth peripheral and the third Bluetooth peripheral respectively.

6. The Bluetooth communication method of the smart device as claimed in claim 4, characterized in that: The allocating a unique preset identification number to each of the Bluetooth peripherals according to the access time and the position relationship comprises: Determining the order in which each of the Bluetooth peripherals accesses the network according to the access time; According to the position relationship, determining the hierarchical information of each Bluetooth peripheral in the topological relationship network and the layout position in space; Generate corresponding sequence identifiers in sequence according to the sequence, the level information and the layout positions in the space, and combine them to form a corresponding unique identifier sequence; The identification sequence is transmitted to the storage chip of the corresponding Bluetooth peripheral device, and the identification sequence information is locked to determine it as the unique preset mark number of the corresponding Bluetooth peripheral device.

7. The Bluetooth communication method for a smart device according to any one of claims 1 to 6, characterized in that: The controlling the smart device to transmit the device data with the preset mark number to the Bluetooth protocol stack, and synchronously transmitting the device data with the preset mark number to the Bluetooth peripheral corresponding to the preset mark number through the Bluetooth protocol stack includes: Encapsulating the device data into a Bluetooth data packet, wherein the Bluetooth data packet includes the preset marking number; Sending the Bluetooth data packet to the Bluetooth peripheral device via a Bluetooth protocol stack; After receiving the Bluetooth data packet, the Bluetooth peripheral device identifies the corresponding device data according to the preset tag number; The Bluetooth peripheral device performs corresponding operations according to the identified device data.

8. The Bluetooth communication method for a smart device according to any one of claims 1 to 6, characterized in that: The plurality of Bluetooth peripherals include a fourth Bluetooth peripheral, a fifth Bluetooth peripheral and a sixth Bluetooth peripheral, and the fourth Bluetooth peripheral, the fifth Bluetooth peripheral and the sixth Bluetooth peripheral are sequentially arranged at a plurality of positions in the space; The Bluetooth communication method of the smart device also includes: Control the smart device, the fourth Bluetooth peripheral, the fifth Bluetooth peripheral and the sixth Bluetooth peripheral to be connected in series in sequence, and control the fourth Bluetooth peripheral and the fifth Bluetooth peripheral to be set to a relay mode and to be connected in series as a relay link; Control the smart device to transmit data to the sixth Bluetooth peripheral device through the relay link, or receive data from the sixth Bluetooth peripheral device through the relay link and transmit the data to the smart device.

9. A communication device, characterized in that: The communication device comprises: a memory, a processor, and a Bluetooth communication program stored in the memory and executable on the processor, wherein the Bluetooth communication program is configured to implement the Bluetooth communication method for the smart device according to any one of claims 1 to 8.

10. A smart device, characterized in that: Including the communication device as described in claim 9, the smart device includes a smart phone, a tablet computer or a wearable device, the Bluetooth peripheral includes a Bluetooth headset, a smart watch or a smart home gateway, and the smart device is connected to multiple Bluetooth peripherals to form the topological relationship network.

Citation Information

Patent Citations

  • Method for separating host identifier (HID) mark from locator based on IPV6 (Internet Protocol Version 6) address

    CN102123182A

  • Network identifier mapping method and system, terminal and identifier gateway

    CN110071984A

  • Equipment network access method based on Bluetooth Mesh network and device thereof and storage medium

    CN111641996A

  • Data transmission method and related equipment and device

    CN111711941A

  • Bluetooth-based data transmission method, intelligent system and storage medium

    CN112333678A