WO2021108964A1 - 消息发布的方法和ble设备 - Google Patents

消息发布的方法和ble设备 Download PDF

Info

Publication number
WO2021108964A1
WO2021108964A1 PCT/CN2019/122475 CN2019122475W WO2021108964A1 WO 2021108964 A1 WO2021108964 A1 WO 2021108964A1 CN 2019122475 W CN2019122475 W CN 2019122475W WO 2021108964 A1 WO2021108964 A1 WO 2021108964A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
publishing
terminal
address
subscribing
Prior art date
Application number
PCT/CN2019/122475
Other languages
English (en)
French (fr)
Inventor
李明飞
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2019/122475 priority Critical patent/WO2021108964A1/zh
Priority to CN201980005118.4A priority patent/CN111247817B/zh
Publication of WO2021108964A1 publication Critical patent/WO2021108964A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/04Error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the embodiments of the present application relate to the field of information technology, and more specifically, to a method for publishing a message and a BLE device.
  • Bluetooth Low Energy (BLE) MESH network technology has been widely used.
  • the MESH network uses a publish-subscribe (publish-subscribe) mechanism for communication. Nodes generate messages and send these messages to the publishing address. , Nodes interested in these messages can subscribe to the publishing address. Due to the inherent characteristics of the Bluetooth MESH protocol, the publisher of the message only knows the information of the publication address, and does not know which subscribers have subscribed to this publication address. Therefore, the publisher cannot guarantee that all subscribers that subscribe to the publication address can do so. Reliably receive messages posted to this posting address.
  • the embodiments of the present application provide a method for publishing a message and a BLE device, which can improve the reliability of publishing a message.
  • a method for publishing messages is provided.
  • the method is applicable to a MESH network of Bluetooth Low Energy BLE.
  • the MESH network includes multiple nodes, each node includes at least one element, and each element includes At least one model for controlling the state of nodes, the method includes: the publishing end in the MESH network sends a query request message to the distribution network end in the MESH network, the query request message includes a first publishing address, so The query request message is used to obtain subscription information of the first publishing address, and the subscription information includes information of at least one subscribing terminal that has subscribed to the publishing message corresponding to the first publishing address, the publishing terminal, the distribution network
  • the terminal and the at least one subscribing terminal are models in the MESH network; the publishing terminal sends a publishing message corresponding to the first publishing address; the publishing terminal receives a response message in response to the publishing message; The number of the response messages is less than the number of the at least one subscribing end, and the publishing end performs retransmission processing on the published
  • the publishing terminal sends a query request message to the distribution network terminal to obtain the information of at least one subscribing terminal that has subscribed to the first publishing address.
  • the number of the at least one subscribing terminal can determine whether the at least one subscribing terminal has all received the published message, and if not all have been received, the retransmission process can be performed. Therefore, the technical solutions of the embodiments of the present application can improve the reliability of message publishing.
  • the retransmission processing of the publishing message by the publishing end includes: the publishing end resending the publishing message.
  • the retransmission processing of the publishing message by the publishing end includes: the publishing end determines that the subscription for the publishing message has not been received according to the subscription information and the response message End; the publishing end sends the publishing message to the subscribing end that has not received the publishing message.
  • the subscription information includes the ID of the at least one subscribing terminal and the element address of the element where the at least one subscribing terminal is located, and the response message includes the ID of the subscribing terminal that has received the publish message.
  • the method further includes: the publishing end determines whether the at least one subscribing end receives the publish message; in at least one of the following situations, the publishing end stops responding to the Sending of a published message: The publishing end receives response messages sent by all of the at least one subscribing end; after the publishing end retransmits the published message for the first time for a preset period of time; the publishing end retransmits The number of times the publication message is transmitted reaches the maximum number of retransmissions.
  • the retransmission processing of the publishing message by the publishing end includes: the publishing end uses any one of the following communication methods to send a message to the person who has not received the publishing message.
  • the subscriber sends the publication message: wireless fidelity Wi-Fi communication, near field communication NFC, and ZigBee communication.
  • the first publishing address includes: a unicast address, a multicast address, or a label UUID.
  • a low-power Bluetooth BLE device is provided.
  • the BLE device is a node in a MESH network.
  • the MESH network includes multiple nodes, each node includes at least one element, and each element includes at least one element.
  • a model for controlling the state of a node, the BLE device includes: a transceiver module, configured to send a query request message to the distribution network terminal in the MESH network, the query request message including a first publishing address, and the query request message Used to obtain subscription information of the first publishing address, where the subscription information includes information of at least one subscribing terminal that has subscribed to the first publishing address, and the publishing terminal, the distribution network terminal, and the subscription terminal are all
  • the transceiving module is also used to send the publishing message corresponding to the first publishing address;
  • the transceiving module is also used to receive a response message in response to the publishing message;
  • the processing module is used In order to determine whether all the published messages are delivered according to the number
  • the transceiver module is specifically configured to: resend the publication message.
  • the processing module is specifically configured to: determine, according to the subscription information and the response message, the subscriber that has not received the publication message; the transceiver module is specifically configured to: The subscriber that receives the publish message sends the publish message.
  • the subscription information includes the ID of the at least one subscribing terminal and the element address of the element where the at least one subscribing terminal is located, and the response message includes the ID of the subscribing terminal that has received the publish message.
  • the processing module is further configured to: determine whether the at least one subscribing terminal receives the publish message; in at least one of the following situations, control the transceiver module to stop publishing the message Message sending: the transceiving module receives response messages sent by all of the at least one subscribing end; the transceiving module retransmits the published message for the first time after the preset period of time; the transceiving module retransmits The number of times the message is posted reaches the maximum number of retransmissions.
  • the transceiver module is specifically configured to: use any one of the following communication methods to send the publication message to the subscriber that has not received the publication message: Wi-Fi communication , NFC communication, ZigBee communication.
  • the publishing address includes: a unicast address, a multicast address, or a label UUID.
  • a BLE chip including: a memory for storing executable instructions; a processor for calling and running the executable instructions in the memory to execute the first aspect or the first aspect The method described in any one of the possible implementation modes.
  • a computer-readable storage medium is provided, the computer-readable storage medium is used to store a computer program, wherein when the computer program is executed by a processor, the processor is caused to execute the first aspect or The method described in any one of the possible implementation manners in the first aspect.
  • FIG. 1 is a schematic diagram of the MESH network.
  • Figure 2 is a schematic diagram of the relationship between nodes, elements and models.
  • Fig. 3 is a flow interaction diagram of a method for publishing a message according to an embodiment of the present application.
  • Figure 4 is a schematic diagram of the publishing end and the distribution network end establishing communication through security authentication.
  • Fig. 5 is a schematic block diagram of a BLE device according to an embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of a BLE chip according to an embodiment of the present application.
  • the MESH network is used to establish a many-to-many relationship between wireless devices.
  • Each node in the MESH network can communicate with any other node. Communication is based on the use of messages, and a node can relay messages to other nodes, which expands the range of end-to-end communication far beyond the radio range of each individual node. In practical applications, these nodes can be distributed in manufacturing plants, office buildings, shopping centers, business parks, homes, and other environments.
  • Figure 1 is a schematic diagram of a possible MESH network.
  • the MESH network can include any number of nodes. In Figure 1, only nodes A to G are taken as an example.
  • data packets are transmitted based on advertising in BLE, and can also be transmitted through other communication methods, such as classic Bluetooth communication. After a node receives a data packet sent by another node, it can forward the data packet, thereby forwarding the data packet to other nearby nodes.
  • a device becomes part of the MESH network, we call it a node. On the contrary, we call it “unprovisioned devices”.
  • provisioning The process of turning unprovisioned devices into nodes is called “provisioning”.
  • Network configuration is a secure process. After the network is configured, the equipment that has not been configured will have a series of encrypted passwords and be identified by the distribution network. All nodes in the MESH network have at least one network key (Net Key), and the device must have this key to successfully join the corresponding network and become a node. Every node can send and receive messages.
  • Network Key network key
  • a node can have multiple components, and each component can be independently controlled. These components are called elements. Each node has at least one main element and may also include other elements. Each element in the node has a unique address, called a unicast address (unicast address), so that each element has an address to be found.
  • each node in the MESH network in Figure 1 can be all the headlights in the home. Take one of the headlights as an example. This headlight can be composed of three sub-lights, each of which can be accessed by addressing. The headlight is the node, and the sublights in the headlight are the elements.
  • nodes are defined and implemented by models, which are located in elements, and each element has at least one model.
  • Each model has a unique identifier, which ensures that the address of each model is unique and can be addressed.
  • the node 200 includes an element 210 and an element 220, the element 210 includes a model 211 and a model 212, and the element 220 includes a model 221.
  • the number of elements included in each node in FIG. 2 and the number of models included in the elements are just examples. In practical applications, a node can include one or more elements, and an element can include one or more models.
  • a headlight is composed of two sub-lights, the headlight corresponds to the node 200 shown in FIG. 2, and the two sub-lights respectively correspond to the element 210 and the element 220 shown in FIG. 2.
  • the sub-lamp 210 includes two models, namely the switch model 211 and the brightness model 212 of the sub-lamp 210.
  • the switch model 211 has two states, namely, on and off; the brightness model has multiple states, such as three states of low brightness, medium brightness, and high brightness.
  • the sub-lamp 220 includes a switch model 221, and the switch model 221 includes two states of on and off.
  • the function of the model 211 and the model 221 is to control the switching of the sub lights 210 and 220, and the function of the model 212 is to adjust the brightness of the sub lights 210.
  • the publish-subscribe mechanism is used in the MESH network, and the publishing end and the subscribing end of the message can be models in the same or different nodes in the MESH network.
  • the publishing message is generated by the publishing terminal, and the publishing terminal can publish the publishing message to the publishing address, and models interested in publishing the message subscribe to these publishing addresses.
  • the publishing address can be a unicast address, a multicast address (group address), or a label universally unique identifier (Label UUID).
  • the unicast address is the address of an element. When distributing the network, the distributing network end will assign a unicast address to each element.
  • a multicast address is a group address of multiple elements in one or more nodes, and can also be called a broadcast address.
  • the multicast address represents one or more elements, which can be dynamically allocated.
  • Label UUID is the address assigned to one or more elements spanning one or more nodes, and any element can be connected to it, which can be considered as an extension of the multicast
  • the message publisher Due to the inherent characteristics of the Bluetooth MESH protocol, the message publisher usually only knows the information of the publishing address, but does not know which models have subscribed to the publishing address. After the publisher sends a publication message to the publication address, it cannot be determined whether all models subscribed to the publication address have received the publication message. In other words, the publisher cannot guarantee that all models that have subscribed to the publishing address can reliably receive the messages published to the publishing address. Therefore, this message publishing mechanism is not reliable.
  • an embodiment of the present application proposes a method for message publishing, which can improve the reliability of message publishing.
  • FIG. 3 shows a flow interaction diagram of a message publishing method 300 according to an embodiment of the present application.
  • the method is applicable to a BLE MESH network, the MESH network includes multiple nodes, each node includes at least one element, and each element includes at least one model for controlling the state of the node.
  • the method is executed by the publishing terminal, the network distribution terminal and the subscribing terminal, wherein the publishing terminal, the network distribution terminal and the subscribing terminal are all models in the MESH network.
  • the publishing end sends a query request message to the distribution network end.
  • the query request message includes a first publishing address, and the query request message is used to obtain subscription information of the first publishing address.
  • the subscription information includes information of at least one subscribing terminal that has subscribed to the publication message corresponding to the first publication address.
  • the distribution network terminal queries the subscription information of the first publishing address.
  • the network distribution terminal sends the subscription information of the first publishing address to the publishing terminal.
  • the publishing terminal receives and obtains the subscription information.
  • the first publishing address may be a unicast address, a multicast address, or a Label UUID.
  • Table 1 shows the subscription information of different subscribers in the MESH network stored at the distribution network end.
  • the subscription information includes the identification of the different subscribers, namely the model identifier (IDentity, ID), each The unicast address (element address) of the element where a subscriber is located and the subscription list corresponding to each subscriber.
  • the publishing end can obtain the subscription information of the first publishing address by querying the subscription information stored on the distribution network end, as shown in Table 2.
  • the subscription information of each publishing address includes the identification of the subscriber that subscribes to the publish message corresponding to the publishing address, that is, the model ID of the subscriber, and the element address of the element where the subscriber is located.
  • the publisher queries the model ID of the subscriber in Table 1 , You can get the number of subscribers that have subscribed to the first publishing address.
  • the distribution network terminal Before the distribution network terminal processes the query request message sent by the publishing terminal, the distribution network terminal and the publishing terminal need to establish communication through security authentication to prevent interaction with false nodes.
  • the equipment on the network distribution terminal can establish communication with the nodes in the MESH network, and security information such as the network key (NetKey), application key (AppKey) and device key (DevKey) have been allocated to the nodes when the network distribution terminal configures the network.
  • the messages sent by nodes in the MESH network are encrypted by NetKey.
  • Network layer (network) messages are protected by NetKey
  • application layer (access layer) messages are protected by AppKey or DevKey.
  • Nodes with NetKey can decrypt and verify messages at the network layer, but messages at the application layer cannot be decrypted.
  • DevKey is the unique special application key for each node, only the node and the distribution network terminal know it, and it is used to protect the communication between the node and the distribution network terminal.
  • FIG. 4 shows a schematic diagram of the publishing terminal 402 and the distribution network terminal 401 establishing communication through security authentication.
  • the publishing terminal 402 sends a query request message to the distribution network terminal 401.
  • the node 410 where the distribution network terminal 401 is located decrypts the query request message through NetKey, it sends the query request message to the element 411 where the distribution network terminal 401 is located. address.
  • the network distribution terminal 401 uses a single AppKey or DevKey to decrypt the query request message, and obtains the first publishing address included in the query request message.
  • the network distribution terminal 401 queries the corresponding subscription information according to the first publishing address included in the query request message, encrypts the message including the subscription information, and sends it to the publishing terminal 402.
  • the message including the subscription information is sent to the element address of the element 421 where the publishing terminal 402 is located.
  • the publishing terminal 402 uses a separate AppKey or DevKey to decrypt and obtain the subscription information .
  • the publishing end sends a publishing message corresponding to the first publishing address.
  • the first publishing address when the first publishing address is a unicast address, the first publishing address is the element address of the element of the subscribing end subscribed to the publishing address, and the publishing end sends the publishing message to the element address of the element .
  • the first publishing address is a multicast address, the publishing end sends the publishing message to the multicast addresses of multiple elements.
  • the at least one subscriber replies with a reply message.
  • the subscriber that has not received the publication message will not reply with a response message.
  • Fig. 3 shows only one subscribing terminal, and for the specific operations of other subscriptions, please refer to the relevant description of the subscribing terminal.
  • a node In the MESH network, when a node needs to query the status of other nodes or control other nodes, it will send a corresponding type of publication message. All communications in the MESH network are centered on publishing messages, and multiple types of publishing messages are defined. Messages can be divided into two categories: messages with response or without response. A response message needs to receive a response from the receiver. The response has two purposes: one is to confirm that the message related to it has been received, and the other is to return data related to the message receiver to the message sender. If the message sent by the sender with a response does not receive a response, the sender can resend the message, and the message that does not require a response does not need a response.
  • the message can be sent as a response to other messages, or it can be an unsolicited message.
  • the model sends a response message, it uses the source address of the message initiator as the target address; when the model sends an unsolicited message, it uses the model's publishing address as the target address.
  • the subscribing terminal can subscribe to one or more publishing addresses, and when the received publishing message carries its subscribed publishing address, the publishing message is processed.
  • the publishing end receives a response message in response to the publishing message.
  • the publishing end may receive the response message within a period of time after sending the publishing message and count the number of the response messages.
  • the publishing end may determine whether the at least one subscribing end has all received the publishing message according to the number of the response messages and the number of the at least one subscribing end.
  • the publishing end can execute 380.
  • the publishing end retransmits the publishing message.
  • the publishing terminal sends a query request message to the distribution network terminal to obtain information of at least one subscribing terminal that has subscribed to the first publishing address. According to the number of reply messages in response to the publication message and the number of the at least one subscribing terminal, it can be determined whether the at least one subscribing terminal has all received the publication message, and if not all have been received, the retransmission process can be performed. Therefore, the reliability of the news release can be improved.
  • the retransmission processing of the publishing message by the publishing end includes: the publishing end resending the publishing message.
  • the publishing terminal resends the publishing message to the first publishing address, and re-determines the number of response messages, and determines whether the at least one subscriber terminal receives the publishing message according to the number of response messages , That is, re-execute the aforementioned 330 to 370. If the number of response messages is less than the number of the at least one subscriber, it can be retransmitted again.
  • model A, model B, subscriber C, and subscriber D subscribe to the first publishing address, and after the publishing end sends the publish message corresponding to the first publishing address, only the response message from subscribing end A is received, then The publishing end retransmits the publishing message to the first publishing address. After the first retransmission, if only the response messages from the subscribing end A and the subscribing end D are received, it needs to be retransmitted again.
  • the retransmission processing of the publishing message by the publishing end includes: the publishing end determines, according to the subscription information and the response message, the subscribing end that has not received the publishing message ; The publishing end sends the publishing message to the subscribing end that has not received the publishing message.
  • the subscription information includes the model ID of the at least one subscribing terminal and the element address of the element where the at least one subscribing terminal is located, and the response message includes the ID of the subscribing terminal that receives the publish message.
  • the publisher can know which subscribers have received the publication message published to the first publication address. At this time, the publisher can only resend the publication message to the subscriber that has not received the publication message. Further, the publishing end may determine, according to the number of response messages, whether the subscribing end that has not received the publishing message before has received the publishing message during retransmission. If there are still subscribers that have not received the published message, the publisher can retransmit it again. Wherein, when the publishing terminal retransmits again, the publishing message may only be sent to the subscriber terminal that has not received the publishing message.
  • Subscriber A, Subscriber B, Subscriber C, and Subscriber D subscribe to the first publishing address, and after the publishing end sends the publish message corresponding to the first publishing address, only the response message from the subscribing end A is received , The publisher retransmits the publication message to the element addresses of subscriber B, subscriber C, and subscriber D that have not received the publication message.
  • subscriber A, subscriber B, subscriber C and Subscriber D can be a model in the same or different elements.
  • the publication message needs to be retransmitted to the element addresses of the respective elements of the subscriber B and the subscriber C that have not received the publication message.
  • the publishing end can stop sending the publishing message when at least one of the following situations occurs:
  • the publishing end receives response messages sent by all the subscribing ends of the at least one subscribing end;
  • the number of times the publishing end retransmits the published message reaches the maximum number of retransmissions.
  • the preset duration may also be the time from the first time the publishing end publishes the message to the end of multiple retransmissions.
  • the embodiment of the present invention does not limit this.
  • the publishing end may stop retransmission of the publishing message when all the subscribing ends of the at least one subscribing end have received the publishing message.
  • the nodes in the MESH network may fail or be removed from the MESH network.
  • the publisher sets the preset duration or the maximum number of retransmissions during the process of retransmission of the published message, so as to prevent the publisher from constantly retransmitting.
  • the failed or removed subscriber sends the publication message. Therefore, the publishing end may also stop the retransmission of the published message after a preset period of time after the first retransmission starts, or stop the retransmission of the published message when the number of retransmissions of the published message reaches the maximum number of retransmissions.
  • the retransmission processing by the publishing end on the published message includes: the publishing end uses any one of the following communication methods to subscribe to the subscription that has not received the published message
  • the terminal sends the release message: Wireless-Fidelity (Wi-Fi), Near Field Communication (NFC), and ZigBee.
  • Wi-Fi Wireless-Fidelity
  • NFC Near Field Communication
  • ZigBee ZigBee
  • the node where the publisher is located and the node where the subscriber is located may also have the ability to communicate using other communication methods.
  • this embodiment of the application does not Make a limit.
  • the embodiment of the present application provides a low-power Bluetooth BLE device 500.
  • the BLE device 500 is a node in a MESH network.
  • the MESH network includes multiple nodes, each node includes at least one element, and each element includes at least one model for controlling the state of the node.
  • the BLE device 500 includes:
  • the transceiver module 510 is configured to send a query request message to the distribution network terminal in the MESH network, the query request message includes a first publishing address, and the query request message is used to obtain subscription information of the first publishing address,
  • the subscription information includes information of at least one subscribing terminal that has subscribed to the first publishing address, and the publishing terminal, the distribution network terminal, and the subscription terminal are models in the MESH network;
  • the transceiver module 510 is further configured to send a publishing message corresponding to the first publishing address
  • the transceiver module 510 is further configured to receive a response message in response to the publish message;
  • the processing module 520 is configured to determine whether all the published messages are delivered according to the number of the response messages and the number of the at least one subscriber;
  • the transceiving module 510 is further configured to, if the processing module 520 determines that the number of response messages is less than the number of the at least one subscriber, perform retransmission processing on the published message.
  • the technical solutions of the embodiments of the present application can improve the reliability of message publishing.
  • the processing module is specifically configured to: resend the publication message.
  • the processing module 520 is specifically configured to: determine, according to the subscription information and the response message, the subscribing end that has not received the publication message; the transceiver module 510 is specifically configured to: The subscriber of the published message sends the published message.
  • the subscription information includes the ID of the at least one subscribing terminal and the element address of the element where the at least one subscribing terminal is located, and the response message includes the ID of the subscribing terminal that has received the publish message.
  • the transceiving module 510 may stop sending the publication message: the transceiving module 510 receives response messages sent by all of the at least one subscribing end, that is, the at least one subscribing end All the subscribing ends of the subscribing ends have received the publish message; after the transceiver module 510 retransmits the publish message for the first time, the preset duration is the first retransmission from the transceiver module 510 The time from the start to the end of multiple retransmissions; the number of retransmissions of the published message by the transceiver module 510 reaches the maximum number of retransmissions.
  • the transceiver module 510 is specifically configured to use any one of the following communication methods to send the publication message to the subscriber that has not received the publication message: Wi-Fi communication, NFC communication, ZigBee Communication.
  • FIG. 6 is a schematic structural diagram of a BLE chip 600 according to an embodiment of the present application.
  • the BLE chip 600 shown in FIG. 6 includes a memory 610 and a processor 620.
  • the memory 610 is used to store executable instructions; the processor 620 is used to call and run the executable instructions in the memory 610 to implement the method in the embodiment of the present application.
  • the aforementioned processor may be an integrated circuit chip with signal processing capabilities.
  • the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC application specific integrated circuit
  • FPGA ready-made programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the aforementioned memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
  • DR RAM Direct Rambus RAM
  • the embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
  • the computer-readable storage medium may be applied to the BLE device in the embodiment of the present application, and when the computer program is executed by the processor, the processor is caused to execute the method in the embodiment of the present application.

Landscapes

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

Abstract

本申请实施例公开了一种消息发布的方法和BLE设备,能够提高消息发布的可靠性。该方法包括:所述MESH网络中的发布端向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址对应的发布消息的至少一个订阅端的信息,所述发布端、所述配网端和所述至少一个订阅端为所述MESH网络中的模型;所述发布端发送所述第一发布地址对应的发布消息;所述发布端接收响应于所述发布消息的应答消息;若所述应答消息的数量小于所述至少一个订阅端的数量,所述发布端对所述发布消息进行重传处理。

Description

消息发布的方法和BLE设备 技术领域
本申请实施例涉及信息技术领域,并且更具体地,涉及一种消息发布的方法和BLE设备。
背景技术
目前,低功耗蓝牙(Bluetooth Low Energy,BLE)的MESH网络技术得到了广泛的应用,MESH网络采用消息发布-订阅(publish-subscribe)机制进行通信,节点产生消息并将这些消息发送至发布地址,对这些消息感兴趣的节点可以订阅该发布地址。由于蓝牙MESH协议固有的特性,消息的发布端只知道发布地址的信息,并不知道订阅了此发布地址的订阅端有哪些,因此,发布端不能保证所有订阅了该发布地址的订阅端都可以可靠地接收到发布至此发布地址上的消息。
发明内容
本申请实施例提供了一种消息发布的方法和BLE设备,能够提高消息发布的可靠性。
第一方面,提供了一种消息发布的方法,所述方法适用于低功耗蓝牙BLE的MESH网络中,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型,所述方法包括:所述MESH网络中的发布端向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址对应的发布消息的至少一个订阅端的信息,所述发布端、所述配网端和所述至少一个订阅端为所述MESH网络中的模型;所述发布端发送所述第一发布地址对应的发布消息;所述发布端接收响应于所述发布消息的应答消息;若所述应答消息的数量小于所述至少一个订阅端的数量,所述发布端对所述发布消息进行重传处理。
本申请实施例的技术方案,发布端向配网端发送查询请求消息,便可以获取订阅了所述第一发布地址的至少一个订阅端的信息,根据响应于所述发 布消息的应答消息的数量和所述至少一个订阅端的数量,就可以确定所述至少一个订阅端是否全部收到所述发布消息,若没有全部收到,可以进行重传处理。因此,本申请实施例的技术方案可以提高消息发布的可靠性。
在一种可能的实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端重新发送所述发布消息。
在一种可能的实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;所述发布端向未接收到所述发布消息的订阅端发送所述发布消息。
在一种可能的实现方式中,所述订阅信息包括所述至少一个订阅端的ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
在一种可能的实现方式中,所述方法还包括:所述发布端确定所述至少一个订阅端是否接收到所述发布消息;在以下至少一种情况时,所述发布端停止对所述发布消息的发送:所述发布端接收到所述至少一个订阅端中全部订阅端发送的应答消息;所述发布端第一次重传所述发布消息的预设时长之后;所述发布端重传所述发布消息的次数达到最大重传次数。
在一种可能的实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:无线保真Wi-Fi通信、近场通信NFC、紫蜂ZigBee通信。
在一种可能的实现方式中,所述第一发布地址包括:单播地址、组播地址或者标签通用唯一标识符Label UUID。
第二方面,提供了一种低功耗蓝牙BLE设备,所述BLE设备为MESH网络中的节点,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型,所述BLE设备包括:收发模块,用于向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址的至少一个订阅端的信息,所述发布端、所述配网端和所述订阅端为所述MESH网络中的模型;所述收发模块还用于,发送所述第一发布地址对应的发布消息;所述收发模 块还用于,接收响应于所述发布消息的应答消息;处理模块,用于根据所述应答消息的数量和所述至少一个订阅端的数量确定所述发布消息是否全部送达;所述收发模块还用于,若所述处理模块确定所述应答消息的数量小于所述至少一个订阅端的数量,对所述发布消息进行重传处理。
在一种可能的实现方式中,所述收发模块具体用于:重新发送所述发布消息。
在一种可能的实现方式中,所述处理模块具体用于:根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;所述收发模块具体用于:向未接收到所述发布消息的订阅端发送所述发布消息。
在一种可能的实现方式中,所述订阅信息包括所述至少一个订阅端的ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
在一种可能的实现方式中,所述处理模块还用于:确定所述至少一个订阅端是否接收到所述发布消息;在以下至少一种情况时,控制所述收发模块停止对所述发布消息的发送:所述收发模块接收到所述至少一个订阅端中全部订阅端发送的应答消息;所述收发模块第一次重传所述发布消息的预设时长之后;所述收发模块重传所述发布消息的次数达到最大重传次数。
在一种可能的实现方式中,所述收发模块具体用于:利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:Wi-Fi通信、NFC通信、ZigBee通信。
在一种可能的实现方式中,所述发布地址包括:单播地址、组播地址或者标签通用唯一标识符Label UUID。
第三方面,提供了一种BLE芯片,包括:存储器,用于存储可执行指令;处理器,用于调用并运行所述存储器中的所述可执行指令,以执行第一方面或第一方面中任一种可能实现的方式中所述的方法。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,其中,当所述计算机程序被处理器执行时,使得所述处理器执行第一方面或第一方面中任一种可能实现的方式中所述的方法。
附图说明
图1是MESH网络的示意图。
图2是节点、元素和模型之间的关系示意图。
图3是本申请实施例的一种消息发布的方法的流程交互图。
图4是发布端和配网端通过安全认证建立通信的示意图。
图5是本申请实施例的BLE设备的示意性框图。
图6本申请实施例的BLE芯片的示意性结构图。
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。
为了更清楚地理解本申请实施例的方案,下面首先对MESH网络进行简单描述。
MESH网络用于建立无线设备之间多对多的关系。MESH网络中的每个节点可以与任何其他节点进行通信。通信是基于消息的使用,且一个节点能够将消息中继至其他节点,使端对端的通信的范围得到扩展,远远超过每个单独节点的无线电范围。在实际应用中,这些节点可以被分布在制造工厂、办公楼、购物中心、商业园区、家庭以及其他环境中。图1是一种可能的MESH网络的示意图。该MESH网络中可以包括任意数量的节点,图1中仅以节点A至节点G为例。在MESH网络中,数据包基于BLE中广播(advertising)的方式进行传输,也可以或通过其他通信方式,比如经典蓝牙通信的方式进行传输。一个节点接收另一节点发送的数据包后,可以对该数据包进行转发,从而将该数据包转发给附近其他节点。
如果一个设备成为了MESH网络的一部分,我们就把它叫做节点(node)。反之,我们就把它叫做“未配网的设备”(unprovisioned devices)。把未配网的设备变成节点的过程我们把它叫做“配网”(provisioning)。配网是一个安全的过程,未配网的设备经过配网后会拥有一系列加密密码,并被配网端识别。MESH网络中的所有节点都具有至少一个网络密钥(Net Key),设备必须拥有该密钥才能成功加入相应的网络,并成为节点。每个节点都能发送和接收消息。
节点可以具有多个组成部分,每个组成部分都能独立进行控制,这些组成部分被称为元素(element)。每个节点至少拥有一个主元素,同时还可能包括其他元素。节点中的每个元素都有一个唯一的地址,称为单播地址(unicast address),使每个元素都有址可寻。例如,图1中的MESH网络中 的各个节点可以为家庭中的全部大灯。以其中的一个大灯为例进行说明。这个大灯可以由三个子灯组成,每个子灯都可以通过寻址访问。大灯为节点,而该大灯中的子灯即为元素。
节点的基本功能都由模型(model)来定义和实施,模型位于元素内,每个元素具有至少一个模型。每个模型都有唯一的标识符,这确保了每个模型的地址都独一无二并且能确定被寻址到。
例如图2所示的节点、元素和模型之间的关系。节点200包括元素210和元素220,元素210包括模型211和模型212,元素220包括模型221。图2中的每个节点中包括的元素的数量,以及元素中包括的模型的数量仅仅为示例。在实际应用中,一个节点可以包括一个或多个元素,一个元素可以包括一个或多个模型。
仍以灯为例,由两个子灯组成一个大灯,大灯对应于图2中所示的节点200,两个子灯分别对应于图2中所示的元素210和元素220。子灯210包括两个模型,分别为子灯210的开关模型211和亮度模型212。开关模型211具有两种状态,即开和关;亮度模型具有多种状态,例如低亮度、中等亮度和高亮度这三种状态。类似地,子灯220包括开关模型221,开关模型221包括开与关两种状态。模型211和模型221的功能为控制子灯210和220开关,模型212的功能为调节子灯210的亮度。
MESH网络中使用发布-订阅机制,消息的发布端和订阅端可以是该MESH网络中相同或不同节点内的模型。发布消息由发布端产生,发布端可以将该发布消息发布至发布地址,对发布消息感兴趣的模型订阅这些发布地址。发布地址可以是单播地址、组播地址(group address)或者标签通用唯一标识符(Label Universally Unique Identifier,Label UUID)。单播地址为一个元素的地址。在配网时,配网端会分配给每个元素一个单播地址。组播地址是一个或多个节点中的多个元素的组地址,也可以称广播地址,该组播地址表示是一个或多个元素的,其可以动态分配。Label UUID是分配给跨越一个或多个节点的一个或多个元素的地址,任何元素都可与之相连,可以认为是组播地址的一个扩展。
由于蓝牙MESH协议的固有的特性,消息发布端通常只知道发布地址的信息,但是并不知道有哪些模型订阅了该发布地址。发布端向该发布地址发送发布消息后,不能确定订阅了该发布地址的所有模型是否都接收到了该发 布消息。也就是说,发布端无法保证所有订阅了该发布地址的模型,都能够可靠地接收到其发布至该发布地址上的消息。因此,这种消息发布机制并不可靠。
为此,本申请实施例提出了一种消息发布的方法,该方法可以提高消息发布的可靠性。
图3出示了本申请实施例的消息发布方法300的流程交互图。所述方法适用于BLE的MESH网络中,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型。所述方法由发布端、配网端和订阅端执行,其中,发布端、配网端和订阅端都为该MESH网络中的模型。
310,所述发布端向所述配网端发送查询请求消息。
所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息。所述订阅信息包括订阅了所述第一发布地址对应的发布消息的至少一个订阅端的信息。
320,响应于发布端发送的查询请求消息,所述配网端查询所述第一发布地址的订阅信息。
330,所述配网端将所述第一发布地址的订阅信息发送至所述发布端。
340,发布端接收并获取所述订阅信息。
所述第一发布地址可以为单播地址、组播地址或者Label UUID。
以第一发布地址为组播地址为例,表1示出了配网端保存的MESH网络中不同订阅端的订阅信息,所述订阅信息包括不同订阅端的标识即模型标识(IDentity,ID)、每一个订阅端所在元素的单播地址(元素地址)以及每一个订阅端对应的订阅列表。
表1
Figure PCTCN2019122475-appb-000001
Figure PCTCN2019122475-appb-000002
发布端通过查询配网端保存的订阅信息,可以得到第一发布地址的订阅信息,如表2所示。每个发布地址的订阅信息包括订阅了该发布地址对应的发布消息的订阅端的标识即订阅端的模型ID、以及所述订阅端所在元素的元素地址,发布端通过在表1中查询订阅端的模型ID,便可获得订阅了第一发布地址的订阅端的数量。
表2
Figure PCTCN2019122475-appb-000003
在配网端处理所述发布端发送的查询请求消息之前,配网端与所述发布端之间需要通过安全认证建立通信,防止与虚假节点的交互。
配网端设备可以与MESH网络中的节点建立通信,配网端配网时已经给节点分配了网络密钥(NetKey)、应用密钥(AppKey)和设备密钥(DevKey)等安全信息。MESH网络中的节点发送的消息本身是通过NetKey加密的。网络层(network)消息使用NetKey进行保护,应用层(access layer)消息通过AppKey或DevKey进行保护。拥有NetKey的节点能够对网络层的消息进行解密和验证,但应用层消息不可被解密。DevKey是每个节点唯一的特殊应用密钥,只有节点和配网端知道,并用于保护节点和配网端之间的通信。
图4示出了发布端402和配网端401通过安全认证建立通信的示意图。
发布端402向配网端401发送一条查询请求消息,配网端401所在节点410通过NetKey对所述查询请求消息进行解密后,将所述查询请求消息发送至配网端401所在元素411的元素地址。配网端401利用一个单独的 AppKey或DevKey对所述查询请求消息进行解密,并获取所述查询请求消息包括的第一发布地址。配网端401根据所述查询请求消息中包括的第一发布地址,查询相应的订阅信息,并将包括订阅信息的消息加密后发送给所述发布端402。发布端402所在节点420通过NetKey解密后,将包括订阅信息的消息发送至发布端402所在元素421的元素地址,所述发布端402利用一个单独的AppKey或DevKey进行解密,并获取所述订阅信息。
350,所述发布端发送所述第一发布地址对应的发布消息。
应理解,所述第一发布地址为单播地址时,所述第一发布地址为订阅了此发布地址的订阅端所在元素的元素地址,所述发布端向该元素的元素地址发送该发布消息。所述第一发布地址为组播地址时,所述发布端向多个元素的组播地址发送所述发布消息。
360,响应于所述发布消息,所述至少一个订阅端回复应答消息。
其中,未接收到所述发布消息的订阅端不会回复应答消息。
图3中仅示出了一个订阅端,其他订阅的具体操作可以参考该订阅端的相关描述。
在MESH网络中,当一个节点需要查询其他节点的状态或者控制其他节点的时候,会发送对应类型的发布消息。MESH网络中的所有通信均以发布消息为中心,且定义了多种发布消息的类型。消息可以分为两类:有应答或无须应答的消息。有应答的消息需要收到接收方的响应,该响应有两个目的:一是确认与其相关的消息已被接收,二是将消息接收方有关的数据返回给消息发送方。如果发送方发送的有应答的消息没有收到响应,则发送方可以重新发送消息,无须应答的消息则无需响应。
消息可以作为对其他消息的响应发送,也可以是未经请求的消息。当模型发送应答消息时,它使用消息发起者的源地址作为目标地址;当模型发送未经请求的消息时,它使用模型的发布地址作为目标地址。订阅端可以订阅一个或多个发布地址,当接收到的发布消息中携带自己订阅的发布地址时,就对该发布消息进行处理。
370,所述发布端接收响应于所述发布消息的应答消息。
所述发布端可以在发送所述发布消息后的一段时间内接收所述应答消息并统计所述应答消息的数量。发布端可以根据所述应答消息的数量和所述至少一个订阅端的数量,确定所述至少一个订阅端是否全部收到所述发布消 息。
若所述应答消息的数量等于所述至少一个订阅端的数量,则认为该发布消息被全部订阅端接收到了。若所述应答消息的数量小于所述至少一个订阅端的数量,则认为该发布消息没有被全部订阅端接收,这时发布端可以执行380。
380,所述发布端对所述发布消息进行重传处理。
在本申请实施例的技术方案中,发布端向配网端发送查询请求消息,便可以获取订阅了所述第一发布地址的至少一个订阅端的信息。根据响应于所述发布消息的应答消息的数量和所述至少一个订阅端的数量,可以确定所述至少一个订阅端是否全部收到所述发布消息,若没有全部收到,可以进行重传处理。因此可以提高消息发布的可靠性。
在一种实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端重新发送所述发布消息。
具体而言,所述发布端重新发送所述发布消息至所述第一发布地址,并重新确定应答消息的数量,并且根据应答消息的数量确定所述至少一个订阅端是否接收到所述发布消息,即重新执行前述330至370。若应答消息的数量小于所述至少一个订阅端的数量,可以进行再次重传。
例如,模型A、模型B、订阅端C和订阅端D订阅了第一发布地址,发布端将所述第一发布地址对应的发布消息发送后,只接收到来自订阅端A的应答消息,则发布端将所述发布消息重传至所述第一发布地址。第一次重传之后,如果只收到了来自订阅端A和订阅端D的应答消息,则需要再次重传。
在另一种实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;所述发布端向未接收到所述发布消息的订阅端发送所述发布消息。
其中,所述订阅信息包括所述至少一个订阅端的模型ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
由于应答消息中包括所述发布消息的订阅端的ID,因此发布端可以知道哪些订阅端接收到了其发布至第一发布地址的发布消息。这时,发布端可 以仅向未接收到发布消息的订阅端重新发送该发布消息。进一步地,发布端可以根据应答消息的数量确定此前未接收到该发布消息的订阅端是否在重传时接收到了所述发布消息。如果仍有未接收到该发布消息的订阅端,发布端可以进行再次重传。其中,所述发布端再次重传时,可以仅仅向未接收到所述发布消息的订阅端发送所述发布消息。
例如,订阅端A、订阅端B、订阅端C和订阅端D订阅了第一发布地址,发布端将所述第一发布地址对应的发布消息发送后,只接收到来自订阅端A的应答消息,则发布端向未接收到所述发布消息的订阅端B、订阅端C和订阅端D各自所在的元素地址重传所述发布消息,其中,订阅端A、订阅端B、订阅端C和订阅端D可以是相同或不同元素中的模型。第一次重传之后,如果只收到了订阅端D的应答消息,则需要再次向未接收到所述发布消息的订阅端B和订阅端C各自所在元素的元素地址重传所述发布消息。
无论采用上述哪种重传方式,可选地,发布端可以在发生以下至少一种情况时,停止对所述发布消息的发送:
所述发布端接收到所述至少一个订阅端中全部订阅端发送的应答消息;
所述发布端第一次重传所述发布消息的预设时长之后;
所述发布端重传所述发布消息的次数达到最大重传次数。
应理解,所述预设时长也可以为从发布端第一次发布消息开始至多次重传结束所用的时间。本发明实施例对此不做限定。
发布端可以在所述至少一个订阅端中全部订阅端都接收到所述发布消息时,停止发布消息的重传。但是,MESH网络中的节点有可能发生故障或者被移除MESH网络,所述发布端对发布消息进行重传处理的过程中设定预设时长或者最大重传次数,从而避免发布端一直给发生故障或者被移除的订阅端发送所述发布消息。因此,发布端还可以在第一次重传开始的预设时长后,停止发布消息的重传,或者在发布消息的重传次数达到最大重传次数时,停止发布消息的重传。
在另一种实现方式中,所述发布端对所述发布消息进行重传处理,包括:所述发布端利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:无线保真通信(Wireless-Fidelity,Wi-Fi)、近场通信(Near Field Communication,NFC)、紫蜂通信(ZigBee)。
应理解,除了蓝牙MESH网络外,发布端所在的节点和订阅端所在的节 点还可能具有采用其他通信方式进行通信的能力,对于除BLE通信之外的其他通信方式,本申请实施例对此不做限定。
本申请实施例提供了一种低功耗蓝牙BLE设备500。如图5所示,所述BLE设备500为MESH网络中的节点,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型,所述BLE设备500包括:
收发模块510,用于向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址的至少一个订阅端的信息,所述发布端、所述配网端和所述订阅端为所述MESH网络中的模型;
所述收发模块510还用于,发送所述第一发布地址对应的发布消息;
所述收发模块510还用于,接收响应于所述发布消息的应答消息;
处理模块520,用于根据所述应答消息的数量和所述至少一个订阅端的数量确定所述发布消息是否全部送达;
所述收发模块510还用于,若所述处理模块520确定所述应答消息的数量小于所述至少一个订阅端的数量,对所述发布消息进行重传处理。
本申请实施例的技术方案,根据订阅了所述第一发布地址对应的发布消息的至少一个订阅端的数量和应答消息的数量,便可以确定所述至少一个订阅端是否全部收到所述发布消息,若没有全部收到,可以进行重传处理。因此,本申请实施例的技术方案可以提高消息发布的可靠性。
可选的,所述处理模块具体用于:重新发送所述发布消息。
可选的,所述处理模块520具体用于:根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;所述收发模块510具体用于:向未接收到所述发布消息的订阅端发送所述发布消息。
其中,所述订阅信息包括所述至少一个订阅端的ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
在以下至少一种情况时,所述收发模块510可以停止对所述发布消息的发送:所述收发模块510接收到所述至少一个订阅端中全部订阅端发送的应答消息,即所述至少一个订阅端中全部订阅端都接收到所述发布消息;所述 收发模块510第一次重传所述发布消息的预设时长之后,即所述预设时长为从收发模块510第一次重传开始至多次重传结束所用的时间;所述收发模块510重传所述发布消息的次数达到最大重传次数。
可选的,所述收发模块510具体用于利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:Wi-Fi通信、NFC通信、ZigBee通信。
图6是本申请实施例的一种BLE芯片600的示意性结构图。图6所示的BLE芯片600包括存储器610、处理器620。
其中,存储器610,用于存储可执行指令;处理器620,用于调用并运行所述存储器中610的所述可执行指令,以实现本申请实施例中的方法。
上述的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
上述的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic  RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。该计算机可读存储介质可应用于本申请实施例中的BLE设备,当所述计算机程序被处理器执行时,使得所述处理器执行本申请实施例中的方法。
需要说明的是,在不冲突的前提下,本申请描述的各个实施例和/或各个实施例中的技术特征可以任意的相互组合,组合之后得到的技术方案也应落入本申请的保护范围。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的制备方法,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例中的具体的例子只是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围,本领域技术人员可以在上述实施例的基础上进行各种改进和变形,而这些改进或者变形均落在本申请的保护范围内。
以上所述,仅为本申请的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请适合私利的保护范围之内。因此,本申请实施例的保护范围应该以权利要求的保护范围为准。

Claims (16)

  1. 一种消息发布的方法,其特征在于,所述方法适用于低功耗蓝牙BLE的MESH网络中,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型,所述方法包括:
    所述MESH网络中的发布端向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址对应的发布消息的至少一个订阅端的信息,所述发布端、所述配网端和所述至少一个订阅端为所述MESH网络中的模型;
    所述发布端发送所述第一发布地址对应的发布消息;
    所述发布端接收响应于所述发布消息的应答消息;
    若所述应答消息的数量小于所述至少一个订阅端的数量,所述发布端对所述发布消息进行重传处理。
  2. 根据权利要求1所述的方法,其特征在于,所述发布端对所述发布消息进行重传处理,包括:
    所述发布端重新发送所述发布消息。
  3. 根据权利要求1所述的方法,其特征在于,所述发布端对所述发布消息进行重传处理,包括:
    所述发布端根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;
    所述发布端向未接收到所述发布消息的订阅端发送所述发布消息。
  4. 根据权利要求3所述的方法,其特征在于,所述订阅信息包括所述至少一个订阅端的ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
  5. 根据权利要求2至4中任一项所述的方法,其特征在于,所述方法还包括:
    所述发布端确定所述至少一个订阅端是否接收到所述发布消息;
    在以下至少一种情况时,所述发布端停止对所述发布消息的发送:
    所述发布端接收到所述至少一个订阅端中全部订阅端发送的应答消息;
    所述发布端第一次重传所述发布消息的预设时长之后;或者
    所述发布端重传所述发布消息的次数达到最大重传次数。
  6. 根据权利要求1所述的方法,其特征在于,所述发布端对所述发布消息进行重传处理,包括:
    所述发布端利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:
    无线保真Wi-Fi通信、近场通信NFC、紫蜂ZigBee通信。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述第一发布地址包括:单播地址、组播地址或者标签通用唯一标识符Label UUID。
  8. 一种低功耗蓝牙BLE设备,其特征在于,所述BLE设备为MESH网络中的节点,所述MESH网络中包括多个节点,每个节点包括至少一个元素,每个元素包括至少一个用于控制节点状态的模型,所述BLE设备包括:
    收发模块,用于向所述MESH网络中的配网端发送查询请求消息,所述查询请求消息包括第一发布地址,所述查询请求消息用于获取所述第一发布地址的订阅信息,所述订阅信息包括订阅了所述第一发布地址的至少一个订阅端的信息,所述发布端、所述配网端和所述订阅端为所述MESH网络中的模型;
    所述收发模块还用于,发送所述第一发布地址对应的发布消息;
    所述收发模块还用于,接收响应于所述发布消息的应答消息;
    处理模块,用于根据所述应答消息的数量和所述至少一个订阅端的数量确定所述发布消息是否全部送达;
    所述收发模块还用于,若所述处理模块确定所述应答消息的数量小于所述至少一个订阅端的数量,对所述发布消息进行重传处理。
  9. 根据权利要求8所述的BLE设备,其特征在于,所述收发模块具体用于:
    重新发送所述发布消息。
  10. 根据权利要求8所述的BLE设备,其特征在于,所述处理模块具体用于:
    根据所述订阅信息和所述应答消息,确定未接收到所述发布消息的订阅端;
    所述收发模块具体用于:向未接收到所述发布消息的订阅端发送所述发布消息。
  11. 根据权利要求10所述的BLE设备,其特征在于,所述订阅信息包 括所述至少一个订阅端的ID和所述至少一个订阅端所在元素的元素地址,所述应答消息包括接收到所述发布消息的订阅端的ID。
  12. 根据权利要求9至11中任一项所述的BLE设备,其特征在于,所述处理模块还用于:
    确定所述至少一个订阅端是否接收到所述发布消息;
    在以下至少一种情况时,控制所述收发模块停止对所述发布消息的发送:所述收发模块接收到所述至少一个订阅端中全部订阅端发送的应答消息;所述收发模块第一次重传所述发布消息的预设时长之后;所述收发模块重传所述发布消息的次数达到最大重传次数。
  13. 根据权利要求8所述的BLE设备,其特征在于,所述收发模块具体用于:
    利用以下通信方式中的任意一种,向所述未接收到所述发布消息的订阅端发送所述发布消息:无线保真Wi-Fi通信、近场通信NFC、紫蜂ZigBee通信。
  14. 根据权利要求8至13中任一项所述的BLE设备,其特征在于,所述发布地址包括:单播地址、组播地址或者标签通用唯一标识符Label UUID。
  15. 一种低功耗蓝牙BLE芯片,其特征在于,包括:
    存储器,用于存储可执行指令;
    处理器,用于调用并运行所述存储器中的所述可执行指令,以执行权利要求1至7中任一项所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储计算机程序,其中,当所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至7中任一项所述的方法。
PCT/CN2019/122475 2019-12-02 2019-12-02 消息发布的方法和ble设备 WO2021108964A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/122475 WO2021108964A1 (zh) 2019-12-02 2019-12-02 消息发布的方法和ble设备
CN201980005118.4A CN111247817B (zh) 2019-12-02 2019-12-02 消息发布的方法和ble设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/122475 WO2021108964A1 (zh) 2019-12-02 2019-12-02 消息发布的方法和ble设备

Publications (1)

Publication Number Publication Date
WO2021108964A1 true WO2021108964A1 (zh) 2021-06-10

Family

ID=70865210

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122475 WO2021108964A1 (zh) 2019-12-02 2019-12-02 消息发布的方法和ble设备

Country Status (2)

Country Link
CN (1) CN111247817B (zh)
WO (1) WO2021108964A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163381B (zh) * 2021-04-16 2024-04-12 横店集团得邦照明股份有限公司 一种支持快速配网的智能灯及其实现方法
CN113596803B (zh) * 2021-09-30 2021-12-10 南京沁恒微电子股份有限公司 一种蓝牙mesh低功耗节点与伙伴节点的数据交互方法
CN114237111B (zh) * 2021-12-14 2024-01-30 四川启睿克科技有限公司 一种基于蓝牙mesh协议的设备稳定性控制方法及系统
CN115296989B (zh) * 2022-07-01 2024-04-16 浙江艾克斯精灵人工智能科技有限公司 订阅地址的配置方法、相关设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180160284A1 (en) * 2015-04-30 2018-06-07 Lg Electronics Inc. Method and device for transmitting/receiving data using bluetooth mesh network
CN108173966A (zh) * 2018-01-23 2018-06-15 南京邮电大学 基于用户协作的BLEMesh自动组网方法
CN109151096A (zh) * 2018-11-15 2019-01-04 南京邮电大学 基于坐标信息的低功耗蓝牙网状网络IPv6地址生成配置方法
WO2019154481A1 (en) * 2018-02-07 2019-08-15 Telefonaktiebolaget Lm Ericsson (Publ) A method for updating a number of hops that is to be used for communication between a publisher mesh node and a subscriber mesh node in a wireless mesh network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102892105B (zh) * 2012-10-31 2016-02-10 东莞宇龙通信科技有限公司 通信装置和数据通信方法
CN107566437B (zh) * 2016-07-01 2020-04-14 大唐移动通信设备有限公司 信息传输方法及装置
CN106604257A (zh) * 2016-12-15 2017-04-26 中国科学院沈阳自动化研究所 一种无线Mesh网络的发布/订阅信息传输方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180160284A1 (en) * 2015-04-30 2018-06-07 Lg Electronics Inc. Method and device for transmitting/receiving data using bluetooth mesh network
CN108173966A (zh) * 2018-01-23 2018-06-15 南京邮电大学 基于用户协作的BLEMesh自动组网方法
WO2019154481A1 (en) * 2018-02-07 2019-08-15 Telefonaktiebolaget Lm Ericsson (Publ) A method for updating a number of hops that is to be used for communication between a publisher mesh node and a subscriber mesh node in a wireless mesh network
CN109151096A (zh) * 2018-11-15 2019-01-04 南京邮电大学 基于坐标信息的低功耗蓝牙网状网络IPv6地址生成配置方法

Also Published As

Publication number Publication date
CN111247817B (zh) 2023-05-02
CN111247817A (zh) 2020-06-05

Similar Documents

Publication Publication Date Title
WO2021108964A1 (zh) 消息发布的方法和ble设备
Hui et al. Multicast protocol for low-power and lossy networks (MPL)
Pusateri Distance vector multicast routing protocol
KR102166992B1 (ko) 서비스 계층 그룹 동작을 위한 멀티캐스트의 인에이블
US7573881B2 (en) System, device, and method for receiver access control in a multicast communication system
KR102456859B1 (ko) 5g 시스템에서 제공하는 서비스 파라미터를 단말과 네트워크에 프로비져닝하는 방법
US20020150094A1 (en) Hierarchical level-based internet protocol multicasting
JP2010531586A (ja) マルチキャストグループを管理する方法と装置
KR102074916B1 (ko) Rpl 기반 분산 mqtt 브로커 구조
CN100583776C (zh) 网络设备内部节点可靠组播的方法、系统及设备
US20150043578A1 (en) Home Network Packet Delivery
KR20170124073A (ko) 멀티캐스트 프로토콜을 위한 피드백 메커니즘
US10498632B2 (en) Constrained reliable multicast in a directed acyclic graph based on deferred contention to higher devices
WO2020118633A1 (zh) 订阅消息的处理方法、装置、计算机设备和存储介质
Moll et al. Resilient brokerless publish-subscribe over ndn
US10348518B2 (en) Method, apparatus, system and media for transmitting messages between networked devices in data communication with a local network access point
US20220015096A1 (en) Method and device for repeatedly transmitting message in m2m system
WO2019109960A1 (zh) 一种多播组信息的传递方法、装置和系统
ES2658288T3 (es) Un procedimiento para distribuir datos a través de una red móvil de área amplia ad-hoc
EP3127353A1 (en) Machine-to-machine domain proxy
JP7247356B2 (ja) 無線通信における不必要なメッセージの送信を回避するための方法、ならびに関連したネットワークおよびネットワークノード
CN111314477A (zh) P2p通信方法、系统、家庭网关、电子设备和存储介质
KR100922139B1 (ko) Pim 멀티캐스트 프로토콜에서의 멀티캐스트 스팸 차단시스템 및 방법
KR101425215B1 (ko) IPv6 네트워크에서 호스트 장치 차단 방법, 그리고 이를 구현한 네트워크 관리장치
JP4242752B2 (ja) アドレス表管理方法、及び、端末

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19955044

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19955044

Country of ref document: EP

Kind code of ref document: A1