CN116170787A - Bluetooth communication method and device - Google Patents
Bluetooth communication method and device Download PDFInfo
- Publication number
- CN116170787A CN116170787A CN202310173746.1A CN202310173746A CN116170787A CN 116170787 A CN116170787 A CN 116170787A CN 202310173746 A CN202310173746 A CN 202310173746A CN 116170787 A CN116170787 A CN 116170787A
- Authority
- CN
- China
- Prior art keywords
- target
- data message
- address
- equipment
- bluetooth communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application relates to a Bluetooth communication method and device, in particular to the technical field of Bluetooth communication. The method is applied to target master equipment in each master equipment in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. The method comprises the following steps: receiving a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. Based on the scheme, when the Bluetooth communication function is realized, the communication mode among all the devices is more flexible.
Description
Technical Field
The application relates to the technical field of bluetooth communication, in particular to a bluetooth communication method and device.
Background
Bluetooth is a global standard for wireless data and voice communications, which is a special short-range wireless technology connection that establishes a communication environment for fixed and mobile devices based on low-cost short-range wireless connections. With further development of wireless bluetooth technology, product scale is continuously enlarged, technology is mature and price is reduced, and bluetooth technology is gradually applied to industrial fields and families.
At present, the Bluetooth smart home generally adopts Mesh networking, but the Mesh networking only realizes scale application in intelligent lighting, and the main reason is that the Bluetooth Mesh has the following serious defects: the 2.4G product Bluetooth has 40 communication channels, interference among devices can be avoided through frequency hopping, and Mesh networking only uses 3 broadcast channels, so that a large amount of interference can be generated due to the fact that the number of terminals is large, and therefore the number of the terminals is limited.
Disclosure of Invention
The application provides a Bluetooth communication method and device, which enable the communication mode among all devices to be more flexible when the Bluetooth communication function is realized.
In one aspect, a bluetooth communication method is provided, the method being applied to a target master device among respective master devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is connected with at least one slave device in a Bluetooth mode;
The method comprises the following steps:
receiving a first data message sent by the gateway equipment according to a first target address; the first data message comprises the first target address;
when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message;
and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address.
In yet another aspect, a bluetooth communication method is provided, the method being applied to a target slave device of respective slave devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device;
the method comprises the following steps:
receiving a first data message forwarded by the target master device according to the first target address; the first data message comprises the first target address; the first data message is sent to the target main equipment by the gateway equipment according to a first target address;
And executing the corresponding function according to the first data message.
In yet another aspect, a bluetooth communication method is provided, the method being applied to a gateway device in a bluetooth communication network; the Bluetooth communication network further comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each master device is connected with at least one slave device;
the method comprises the following steps:
sending a first data message to a target main device according to the first target address, so that when the first target address is the network address of the target main device, the target main device executes a corresponding function according to the first data message, and when the first target address is not the network address of the target main device, the target main device forwards the first data message to a corresponding target auxiliary device according to the first target address; the first data message includes the first target address.
In yet another aspect, a bluetooth communication device is provided, the device being applied to a target master device among respective master devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is connected with at least one slave device in a Bluetooth mode;
The device comprises:
the first receiving module is used for receiving a first data message sent by the gateway equipment according to a first target address; the first data message comprises the first target address;
the first execution module is used for executing corresponding functions according to the first data message when the first target address is the network address of the target main equipment;
and the first forwarding module is used for forwarding the first data message to the corresponding target slave device according to the first target address when the first target address is not the network address of the target master device.
In one possible implementation manner, the performing, according to the first data packet, a corresponding function includes:
analyzing the first data message to obtain a first instruction;
and according to the first instruction, at least one operation of scanning the new equipment, connecting the new equipment, disconnecting the new equipment from the equipment and executing the preset function of the target main equipment is executed.
In one possible implementation manner, the target master device includes a first routing table;
the forwarding the first data packet to the corresponding target slave device according to the first target address includes:
And inquiring the first routing table according to the first target address, determining target slave equipment corresponding to the first target address, and forwarding the first data message to the target slave equipment corresponding to the first target address.
In yet another aspect, a bluetooth communication apparatus is provided, the apparatus being applied to a target slave device among respective slave devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device;
the device comprises:
the second receiving module is used for receiving a first data message forwarded by the target main equipment according to the first target address; the first data message comprises the first target address; the first data message is sent to the target main equipment by the gateway equipment according to a first target address;
and the second execution module is used for executing corresponding functions according to the first data message.
In one possible implementation manner, the performing, according to the first data packet, a corresponding function includes:
Analyzing the first data message to obtain a first instruction;
and according to the first instruction, at least one operation of scanning the new equipment, connecting the new equipment, disconnecting the new equipment from the equipment and executing the preset function of the target main equipment is executed.
In one possible implementation, the target slave device is further connected with at least one slave device bluetooth;
the executing the corresponding function according to the first data message includes:
when the first target address is the network address of the target slave device, executing a corresponding function according to the first data message;
the apparatus further comprises:
and when the first target address is not the network address of the target slave device, inquiring a second routing table in the target slave device according to the first target address, obtaining the slave device of the next hop, and forwarding the first data message to the slave device of the next hop.
In yet another aspect, a bluetooth communication device is provided, the device being applied to a gateway apparatus in a bluetooth communication network; the Bluetooth communication network further comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each master device is connected with at least one slave device;
The device comprises:
the third sending module is used for sending a first data message to a target main device according to the first target address, so that when the first target address is the network address of the target main device, the target main device executes a corresponding function according to the first data message, and when the first target address is not the network address of the target main device, the target main device forwards the first data message to a corresponding target auxiliary device according to the first target address; the first data message includes the first target address.
In yet another aspect, a computer device is provided that includes a processor and a memory having at least one instruction stored therein, the at least one instruction loaded and executed by the processor to implement the bluetooth communication method described above.
In yet another aspect, a computer readable storage medium having stored therein at least one instruction loaded and executed by a processor to implement the above described bluetooth communication method is provided.
In yet another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform the bluetooth communication method described above.
The technical scheme that this application provided can include following beneficial effect:
the Bluetooth communication method is applied to target master equipment in each master equipment in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram illustrating a structure of a bluetooth communication system according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment.
Fig. 3 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment.
Fig. 4 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment.
Fig. 5 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment.
Fig. 6 is a schematic diagram of an operation procedure of the gateway device according to the embodiment of the present application.
Fig. 7 is an exemplary diagram of a bluetooth communication network according to an embodiment of the present application.
Fig. 8 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment.
Fig. 9 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment.
Fig. 10 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment.
FIG. 11 is a block diagram illustrating a computer device according to an exemplary embodiment.
Detailed Description
The following description of the embodiments of the present application will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be understood that, in the embodiments of the present application, the "indication" may be a direct indication, an indirect indication, or an indication having an association relationship. For example, a indicates B, which may mean that a indicates B directly, e.g., B may be obtained by a; it may also indicate that a indicates B indirectly, e.g. a indicates C, B may be obtained by C; it may also be indicated that there is an association between a and B.
In the description of the embodiments of the present application, the term "corresponding" may indicate that there is a direct correspondence or an indirect correspondence between the two, or may indicate that there is an association between the two, or may indicate a relationship between the two and the indicated, configured, or the like.
In the embodiment of the present application, the "predefining" may be implemented by pre-storing corresponding codes, tables or other manners that may be used to indicate relevant information in devices (including, for example, terminal devices and network devices), and the specific implementation of the present application is not limited.
Fig. 1 is a schematic diagram of a bluetooth communication network according to an exemplary embodiment. The bluetooth communication network comprises a gateway device 101, a first master device 111, a second master device 112, a third master device 113, a first slave device 121, a second slave device 122, a third slave device 123, a fourth slave device 124, a fifth slave device 131, a sixth slave device 132, a seventh slave device 133, an eighth slave device 134, a ninth slave device 141, a tenth slave device 142, an eleventh slave device 143 and a twelfth slave device 144. The gateway device 101 is configured to send a data packet to a target master device of the respective master devices. The target master device is used for executing related functions according to the received data message or sending the data message to the target slave device in each slave device. The target slave device is configured to perform a related function according to the received data message.
Optionally, the bluetooth communication network adopts connection-oriented communication, adopts connection-oriented tree networking, and uses 37 communication channels for frequency hopping communication.
Optionally, each master device and each slave device includes an uplink port for receiving data issued from a gateway or a device of a previous hop (e.g., a master device to a slave device), and a downlink port for forwarding data not of the device (i.e., a target address is not an address of the device).
It should be noted that the bluetooth communication network further includes a node device, which is only connected to the gateway device, and is not connected to any master device or slave device. The gateway device directly controls various functions of the node device.
It should be noted that, connected to the slave device, is the slave device of the next hop, and the slave device of the next hop is not connected to the master device corresponding to the slave device.
It should be noted that each device in the bluetooth communication network may simultaneously maintain communication with the other devices by time division multiplexing, e.g., the target master device may communicate with the gateway for a first second and then with the slave device for the next hop.
It should be noted that the bluetooth communication network as shown in fig. 1 is an exemplary structure, and optionally, the number of (at least one) master devices in the bluetooth communication network related to the present application may be adjusted according to actual requirements, and the number of (at least one) slave devices corresponding to each master device may also be adjusted according to actual requirements. The number of layers (at least three layers) of the bluetooth communication network related to the application can also be adjusted according to actual requirements.
It should be noted that, the gateway device 101 may be implemented by an MCU (Microcontroller Unit, micro control unit), which is also called a single-chip microcomputer (Single Chip Microcomputer) or a single-chip microcomputer, where the frequency and the specification of a central processing unit (CPU, central Process Unit) are properly reduced, and peripheral interfaces such as a memory (Timer), a USB, an a/D conversion, a UART (Universal Asynchronous Receiver/Transmitter, an asynchronous transceiver), a PLC (Programmable Logic Controller, a programmable logic controller), a DMA (Direct Memory Access ) and even LCD (Liquid Crystal Display, liquid crystal display) driving circuits are integrated on a single chip to form a chip-level computer, so as to perform different combination control for different application occasions.
Fig. 2 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment. The method is applied to target master equipment in each master equipment in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is bluetooth connected with at least one of the slave devices. As shown in fig. 2, the bluetooth communication method may include the steps of:
The bluetooth communication network adopted by the application is based on BLE (Bluetooth Low Energy, low-power consumption bluetooth communication technology), which is a wireless communication standard working in the 2.4G ISM frequency band, and BLE has become the most widely applied low-cost low-power consumption short-distance wireless communication technology through years of development, and BLE gradually replaces other similar communication technologies (such as ZigBee) by virtue of cost and coverage advantages brought by mass markets formed by mobile phones and bluetooth headsets and becomes the only technical standard of short-distance low-power consumption wireless communication.
In BLE, the messages are divided into broadcast messages and data messages, and devices in the bluetooth communication network discover and connect other devices by using the broadcast messages, and once connection is established, use of the data messages is started. Data messages can only be understood by two devices (master and slave) in the connection, while broadcast messages can be broadcast to multiple listening devices or sent only to a particular device. Whether the message is a broadcast message or a data message is determined by a channel where the message is transmitted, wherein BLE prescribes 3 broadcast channels and 37 data channels, if the message is transmitted on the broadcast channel, the message is a broadcast message, and if the message is transmitted on the data channel, the message is a data message.
Optionally, the first data packet is divided into a preamble part, an access address part (i.e. a first destination address), a PDU (Protocol Data Unit ) part and a CRC (Cyclic Redundancy Check, cyclic redundancy check) part.
Alternatively, the respective master devices may be devices of different functions, such as a bulb, thermometer, switch, etc.
Further, after the target master device receives the first data packet including the first target address through the data channel, the target master device may determine and execute the following operation according to the first target address.
When the first target address is the network address of the target master device, it is indicated that the instruction information transmitted by the gateway device is specific to the target master device, so that the target master device executes the corresponding function according to the instruction information in the first data message. The instruction information may be issued by the user through the gateway device, and the corresponding function may be a function of the target host device itself, for example, the target host device is a light bulb, and then the light bulb lighting function may be performed.
When the first target address is not the network address of the target master device, it is indicated that the instruction information transmitted by the gateway device is not specific to the target master device, so that the target master device forwards the first data message to the corresponding target slave device according to the first target address, and the target slave device performs an operation according to the first data message.
Alternatively, the at least one slave device may be a device of a different function, such as a bulb, thermometer, switch, etc.
In summary, the bluetooth communication method according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 3 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment. The method is applied to target slave devices in all slave devices in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device; as shown in fig. 3, the bluetooth communication method may include the steps of:
Optionally, the first data packet is divided into a preamble part, an access address part (i.e. a first destination address), a PDU (Protocol Data Unit ) part and a CRC (Cyclic Redundancy Check, cyclic redundancy check) part.
Alternatively, the respective master devices may be devices of different functions, such as a bulb, thermometer, switch, etc.
Alternatively, the at least one slave device may be a device of a different function, such as a bulb, thermometer, switch, etc.
Further, when the target slave device receives the first data message forwarded by the target master device according to the first target address, it indicates that the first target address is specific to the target slave device, so that the target slave device can execute the following operation according to the first data message.
The target slave device executes a corresponding function according to the instruction information in the first data message. The instruction information may be issued by the user through the gateway device, and the corresponding function may be a function of the target slave device itself, for example, the target slave device is a switch, and then the on or off function of the switch may be performed.
In summary, the bluetooth communication method according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 4 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment. The method is applied to gateway equipment in the Bluetooth communication network; the Bluetooth communication network also comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each of the master devices is connected with at least one slave device; as shown in fig. 4, the bluetooth communication method may include the steps of:
Optionally, the first data packet is divided into a preamble part, an access address part (i.e. a first destination address), a PDU (Protocol Data Unit ) part and a CRC (Cyclic Redundancy Check, cyclic redundancy check) part.
Alternatively, the respective master devices may be devices of different functions, such as a bulb, thermometer, switch, etc.
Alternatively, the at least one slave device may be a device of a different function, such as a bulb, thermometer, switch, etc.
In an actual application scene, a user can give an instruction to a terminal device according to requirements to generate a first data message, and the gateway device can send the first data message to a target main device according to the first target address.
In summary, the bluetooth communication method according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 5 is a flow chart illustrating a method of bluetooth communication according to an exemplary embodiment. The method is performed jointly by a target master device, a target slave device and a gateway device in a messaging network as described in fig. 1. As shown in fig. 5, the bluetooth communication method may include the steps of:
in step 501, the gateway device sends a first data packet to the target host device according to the first target address.
The first data message includes the first target address.
A Gateway (Gateway), also known as Gateway, protocol converter, is a "Gateway" where one network connects to another network. The gateway device is responsible for maintaining all device connections in the bluetooth communication network, managing connections between all devices in the bluetooth communication network, e.g. adding device connections, deleting device connections, scanning for discovery devices. The gateway device can monitor wireless signals, judge whether there is a connectable device, establish a connection relationship by exchanging negotiation parameters with the connectable device, and establish a new transfer line in the bluetooth communication network. Fig. 6 is a schematic diagram of an operation process of a gateway device according to an embodiment of the present application, in which a child device, that is, each device that can be managed by the gateway device, MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) is a message transmission protocol based on a publish/subscribe mode of a client server architecture.
In an actual application scenario, when a user needs to make a certain device (a target master device or a target slave device) in the bluetooth communication network execute a certain function, the user may connect with the bluetooth communication network through a terminal device, for example, a mobile phone or a computer with a bluetooth function, and issue an instruction through corresponding use software (for example, APP), where the instruction includes address information (a first target address) of the target device and information for executing a related function. After receiving the instruction of the user, the gateway device sends a first data message to the target main device according to the first target address, where the target main device is not necessarily the device where the first target address is located, but the device where the first target address is located has a complete transmission line with the target main device in the bluetooth communication network, for example, the device where the first target address is located in the slave device of the target main device, or the device where the first target address is located in the slave device of the next hop of the slave device of the target main device.
In step 502, the target host device receives a first data packet sent by the gateway device according to a first target address.
Optionally, each master device and each slave device has a routing function, and each master device and each slave device contains a routing table. Routing is the process of determining how devices communicate with each other between different networks, i.e. the activity of transmitting information from a source address to a destination address over an interconnected network. By using the routing table, each master device and each slave device can plan a transfer line to the device where the respective target address is located. When each master device and each slave device plan a transfer line to the device where the respective target address is located, a transfer line with the lowest number of hops (i.e., the shortest transfer line) is selected.
In step 503A, when the first destination address is the network address of the target host device, a corresponding function is executed according to the first data packet.
Optionally, the target host device parses the first data packet to obtain a first instruction.
Further, the target host device performs at least one of scanning the new device, connecting the new device, disconnecting the new device from the device, and performing a function preset by the target host device according to the first instruction.
In step 503B, when the first destination address is not the network address of the target master device, the first data packet is forwarded to the corresponding target slave device according to the first destination address.
Optionally, the target master device includes a first routing table. After receiving a first data message sent by the gateway device according to a first target address, the target master device can query the first routing table according to the first target address, determine a target slave device corresponding to the first target address, and forward the first data message to the target slave device corresponding to the first target address.
In step 504, the target slave device receives the first data packet forwarded by the target master device according to the first target address.
Optionally, the target slave device is the last device of the transfer line, that is to say the target slave device has no next hop slave device.
Optionally, the target slave device has a slave device of the next hop, and the target slave device is further connected with at least one slave device bluetooth.
In step 505A, when the first target address is the network address of the target slave device, a corresponding function is executed according to the first data packet.
Optionally, the target slave device parses the first data packet to obtain a first instruction;
further, according to the first instruction, at least one of scanning a new device, connecting the new device, disconnecting the new device from the device, and performing a function preset by the target host device is performed.
And after the slave device of the next hop receives the first data message, executing a corresponding function according to the first data message.
It should be noted that, each master device and each slave device are driven by bluetooth data, and each master device and each slave device are in a dormant state when no data exists, so as to meet the requirement of low power consumption.
Fig. 7 is an exemplary diagram of a bluetooth communication network according to an embodiment of the present application, where a target master device is a light bulb, and the diagram includes two transmission lines.
In summary, the bluetooth communication method according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 8 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment. The device is applied to target master equipment in each master equipment in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is connected with at least one slave device in a Bluetooth mode;
the device comprises:
a first receiving module 801, configured to receive a first data packet sent by the gateway device according to a first target address; the first data message includes the first target address;
a first execution module 802, configured to execute a corresponding function according to the first data packet when the first target address is the network address of the target master device;
and the first forwarding module 803 is configured to forward the first data packet to a corresponding target slave device according to the first target address when the first target address is not the network address of the target master device.
In one possible implementation manner, the performing a corresponding function according to the first data packet includes:
analyzing the first data message to obtain a first instruction;
according to the first instruction, at least one of scanning a new device, connecting the new device, disconnecting the new device from the device, and performing a function preset by the target host device is performed.
In one possible implementation, the target master device includes a first routing table;
forwarding the first data message to a corresponding target slave device according to the first target address, including:
and inquiring the first routing table according to the first target address, determining target slave equipment corresponding to the first target address, and forwarding the first data message to the target slave equipment corresponding to the first target address.
In summary, the bluetooth communication device according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 9 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment. The device is applied to target slave equipment in each slave equipment in the Bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device;
the device comprises:
a second receiving module 901, configured to receive a first data packet forwarded by the target master device according to the first target address; the first data message includes the first target address; the first data message is sent to the target main equipment by the gateway equipment according to a first target address;
and a second execution module 902, configured to execute a corresponding function according to the first data packet.
In one possible implementation manner, the performing a corresponding function according to the first data packet includes:
analyzing the first data message to obtain a first instruction;
according to the first instruction, at least one of scanning a new device, connecting the new device, disconnecting the new device from the device, and performing a function preset by the target host device is performed.
In one possible implementation, the target slave device is also bluetooth connected with at least one slave device;
the executing the corresponding function according to the first data message includes:
when the first target address is the network address of the target slave device, executing a corresponding function according to the first data message;
the apparatus further comprises:
and when the first target address is not the network address of the target slave device, inquiring a second routing table in the target slave device according to the first target address, obtaining the slave device of the next hop, and forwarding the first data message to the slave device of the next hop.
In summary, the bluetooth communication device according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 10 is a block diagram illustrating a structure of a bluetooth communication device according to an exemplary embodiment. The device is applied to gateway equipment in a Bluetooth communication network; the Bluetooth communication network also comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each of the master devices is connected with at least one slave device;
the device comprises:
a third sending module 1001, configured to send a first data packet to a target master device according to the first target address, so that when the first target address is the network address of the target master device, the target master device executes a corresponding function according to the first data packet, and when the first target address is not the network address of the target master device, the target master device forwards the first data packet to a corresponding target slave device according to the first target address; the first data message includes the first target address.
In summary, the bluetooth communication device according to the present application is applied to a target master device in each master device in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway equipment is connected with each main equipment Bluetooth; the target master device is bluetooth connected with at least one slave device. In the application, a target main device firstly receives a first data message sent by gateway equipment according to a first target address; the first data message comprises a first target address; when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message; and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address. According to the scheme, the gateway equipment, the master equipment and the slave equipment form the Bluetooth communication network, and the data messages are transmitted through the formed Bluetooth communication network, so that the communication mode among the equipment is more flexible.
Fig. 11 illustrates a block diagram of a computer device 1100, as shown in an exemplary embodiment of the present application. The computer device may be implemented as a server in the above-described aspects of the present application. The computer apparatus 1100 includes a central processing unit (Central Processing Unit, CPU) 1101, a system Memory 1104 including a random access Memory (Random Access Memory, RAM) 1102 and a Read-Only Memory (ROM) 1103, and a system bus 1105 connecting the system Memory 1104 and the central processing unit 1101. The computer device 1100 also includes a mass storage device 1106 for storing an operating system 1109, application programs 1110, and other program modules 1111.
The mass storage device 1106 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1106 and its associated computer-readable media provide non-volatile storage for the computer device 1100. That is, the mass storage device 1106 may include a computer readable medium (not shown) such as a hard disk or a compact disk-Only (CD-ROM) drive.
The computer readable medium may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read-Only register (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-Only Memory (EEPROM) flash Memory or other solid state Memory technology, CD-ROM, digital versatile disks (Digital Versatile Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 1104 and mass storage 1106 described above may be collectively referred to as memory.
The computer device 1100 may also operate via a network, such as the internet, to a remote computer on the network, according to various embodiments of the present disclosure. That is, the computer device 1100 may be connected to the network 1108 via a network interface unit 1107 coupled to the system bus 1105, or alternatively, the network interface unit 1107 may be used to connect to other types of networks or remote computer systems (not shown).
The memory further comprises at least one computer program stored in the memory, and the central processing unit 1101 implements all or part of the steps of the method shown in the above embodiments by executing the at least one computer program.
In an exemplary embodiment, a computer readable storage medium is also provided for storing at least one computer program that is loaded and executed by a processor to implement all or part of the steps of the above method. For example, the computer readable storage medium may be Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), compact disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform all or part of the steps of the method shown in any of the embodiments of fig. 2, 3, 4 or 5 described above.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. A bluetooth communication method, characterized in that the method is applied to a target master device among respective master devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is connected with at least one slave device in a Bluetooth mode;
The method comprises the following steps:
receiving a first data message sent by the gateway equipment according to a first target address; the first data message comprises the first target address;
when the first target address is the network address of the target main equipment, executing a corresponding function according to the first data message;
and when the first target address is not the network address of the target master device, forwarding the first data message to the corresponding target slave device according to the first target address.
2. The method of claim 1, wherein the performing the corresponding function according to the first data message comprises:
analyzing the first data message to obtain a first instruction;
and according to the first instruction, at least one operation of scanning the new equipment, connecting the new equipment, disconnecting the new equipment from the equipment and executing the preset function of the target main equipment is executed.
3. The method of claim 1, wherein the target host device includes a first routing table;
the forwarding the first data packet to the corresponding target slave device according to the first target address includes:
and inquiring the first routing table according to the first target address, determining target slave equipment corresponding to the first target address, and forwarding the first data message to the target slave equipment corresponding to the first target address.
4. A bluetooth communication method, characterized in that the method is applied to a target slave device among slave devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device;
the method comprises the following steps:
receiving a first data message forwarded by the target master device according to a first target address; the first data message comprises the first target address; the first data message is sent to the target main equipment by the gateway equipment according to a first target address;
and executing the corresponding function according to the first data message.
5. The method of claim 4, wherein the performing the corresponding function according to the first data message comprises:
analyzing the first data message to obtain a first instruction;
and according to the first instruction, at least one operation of scanning the new equipment, connecting the new equipment, disconnecting the new equipment from the equipment and executing the preset function of the target main equipment is executed.
6. The method of claim 4, wherein the target slave device is further bluetooth connected to at least one slave device;
The executing the corresponding function according to the first data message includes:
when the first target address is the network address of the target slave device, executing a corresponding function according to the first data message;
the method further comprises the steps of:
and when the first target address is not the network address of the target slave device, inquiring a second routing table in the target slave device according to the first target address, obtaining the slave device of the next hop, and forwarding the first data message to the slave device of the next hop.
7. A bluetooth communication method, characterized in that the method is applied to a gateway device in a bluetooth communication network; the Bluetooth communication network further comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each master device is connected with at least one slave device;
the method comprises the following steps:
sending a first data message to a target main device according to a first target address, so that when the first target address is the network address of the target main device, the target main device executes a corresponding function according to the first data message, and when the first target address is not the network address of the target main device, the target main device forwards the first data message to a corresponding target auxiliary device according to the first target address; the first data message includes the first target address.
8. A bluetooth communication device, characterized in that the device is applied to a target master device among respective master devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one slave equipment; the gateway device is connected with each main device Bluetooth; the target master device is connected with at least one slave device in a Bluetooth mode;
the device comprises:
the first receiving module is used for receiving a first data message sent by the gateway equipment according to a first target address; the first data message comprises the first target address;
the first execution module is used for executing corresponding functions according to the first data message when the first target address is the network address of the target main equipment;
and the first forwarding module is used for forwarding the first data message to the corresponding target slave device according to the first target address when the first target address is not the network address of the target master device.
9. A bluetooth communication device, characterized in that the device is applied to a target slave device among slave devices in a bluetooth communication network; the Bluetooth communication network also comprises gateway equipment and at least one main equipment; the gateway device is connected with each main device Bluetooth; the target slave device is connected with a target master device in the at least one master device;
The device comprises:
the second receiving module is used for receiving a first data message forwarded by the target main equipment according to a first target address; the first data message comprises the first target address; the first data message is sent to the target main equipment by the gateway equipment according to a first target address;
and the second execution module is used for executing corresponding functions according to the first data message.
10. A bluetooth communication device, characterized in that the device is applied to a gateway apparatus in a bluetooth communication network; the Bluetooth communication network further comprises at least one slave device and at least one master device; the gateway device is connected with each main device Bluetooth; each master device is connected with at least one slave device;
the device comprises:
the third sending module is used for sending a first data message to a target main device according to a first target address, so that when the first target address is the network address of the target main device, the target main device executes a corresponding function according to the first data message, and when the first target address is not the network address of the target main device, the target main device forwards the first data message to a corresponding target auxiliary device according to the first target address; the first data message includes the first target address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310173746.1A CN116170787A (en) | 2023-02-23 | 2023-02-23 | Bluetooth communication method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310173746.1A CN116170787A (en) | 2023-02-23 | 2023-02-23 | Bluetooth communication method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116170787A true CN116170787A (en) | 2023-05-26 |
Family
ID=86411155
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310173746.1A Pending CN116170787A (en) | 2023-02-23 | 2023-02-23 | Bluetooth communication method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116170787A (en) |
-
2023
- 2023-02-23 CN CN202310173746.1A patent/CN116170787A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6760804B1 (en) | Apparatus and method for providing an interface between legacy applications and a wireless communication network | |
US11337274B2 (en) | Method, apparatus and device for controlling dual-mode communication, and computer readable storage medium | |
CN108494414B (en) | Ultra-low power consumption multimode wireless module of internet of things | |
CN107196964B (en) | System and method for implementing multi-band service discovery | |
JP2002319948A (en) | Dual mode wireless data communication | |
US7542760B2 (en) | Wireless communication system, wireless communication control method, wireless communication apparatus, method of controlling the wireless communication apparatus, and computer program | |
WO2018227494A1 (en) | Measurement gap configuration method, apparatus, device, terminal and system | |
CN110267358A (en) | Establish the system, method and blue-tooth device of bluetooth connection | |
JP2004523981A (en) | Communication adapter and method | |
US10098180B2 (en) | Portable wireless signal transfer system, method and terminal | |
US11233540B2 (en) | Apparatus and methods for G3-PLC bootstrap in a hybrid network | |
WO2021203354A1 (en) | Electronic tag and data reading device | |
CN108684021A (en) | A kind of Bluetooth Low Energy communication means and device | |
CN210444487U (en) | Intelligent device based on Bluetooth broadcast communication | |
CN116170787A (en) | Bluetooth communication method and device | |
US20230403735A1 (en) | Message Transmission Method, Terminal and Storage Medium | |
CN117242801A (en) | Method, device and system for configuring side link DRX | |
CN110719580B (en) | Communication method, device, terminal, gateway and computer storage medium | |
RU2677643C9 (en) | Method of communication of wearable device, communication system and corresponding device | |
CN115968543A (en) | Resource mapping method, device, equipment and storage medium | |
CN102546086B (en) | Microwave communication data transmission method and microwave communication node | |
WO2023050332A1 (en) | Ranging rate switching control method and communication apparatus | |
CN111372285B (en) | Frame sending method and device and frame receiving method and device | |
CN103139861A (en) | Wireless communication terminal based on Internet of things and connecting method thereof | |
CN113891352B (en) | Carrier wave routing method, device, system and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |