Message sending method and device, electronic equipment and storage medium

By selecting the optimal gateway in the Bluetooth Mesh network for message transmission, the problem of communication failure caused by excessive communication distance is solved, thus improving the communication success rate and transmission efficiency.

CN115623428BActive Publication Date: 2026-02-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110785347.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-12
Publication Date
2026-02-03
Estimated Expiration
2041-07-12

AI Technical Summary

Technical Problem

In a Bluetooth network, when the main gateway communicates with the node device, excessively long communication distances can lead to excessively long communication times or communication failures.

Method used

By obtaining the set of hop counts between the target node device and each gateway in the Bluetooth Mesh network, the target gateway with the best network communication quality is selected for message transmission, and the transmission path is optimized to improve the communication success rate.

Benefits of technology

Dynamically selecting the target gateway with the best network communication quality optimizes the communication path, improving communication success rate and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115623428B_ABST
    Figure CN115623428B_ABST
Patent Text Reader

Abstract

The application discloses a message sending method and device, electronic equipment and storage medium. The method is applied to a server, and the method comprises the following steps: acquiring a message to be sent to a target node device in a Bluetooth Mesh network; determining a target gateway from a first gateway set in the Bluetooth Mesh network according to a first hop number set between the target node device and each gateway in the first gateway set, wherein the first hop number set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set; and sending the message to the target gateway, so as to forward the message to the target node device through the target gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Bluetooth technology, and in particular to a message sending method, apparatus, electronic device, and storage medium. Background Technology

[0002] In related technologies, when the main gateway and node devices communicate in a Bluetooth network, if the communication distance between the main gateway and the node devices is too long, there may be a phenomenon of excessively long communication time or even communication failure. Summary of the Invention

[0003] In view of this, embodiments of this application provide a message sending method, apparatus, electronic device, and storage medium to at least solve the problems of excessively long communication times or even communication failures in related technologies.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a message sending method applied to a server, the method comprising:

[0006] Retrieve messages sent to target node devices in the Bluetooth Mesh network;

[0007] The target gateway is determined from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set.

[0008] The message is sent to the target gateway to forward the message to the target node device through the target gateway.

[0009] This application embodiment also provides another message sending method applied to a gateway device, wherein the Bluetooth Mesh network includes at least two gateways, and the method includes:

[0010] Determine a second hop count set between each first node device in the first node set of the Bluetooth Mesh network and the gateway device; the second hop count set represents the number of devices through which each first node device in the first node set passes when sending a message to the gateway device;

[0011] Report the second hop count set to the server.

[0012] This application embodiment also provides a message sending device, including:

[0013] The first receiving unit is used to acquire messages sent to the target node device in the Bluetooth Mesh network;

[0014] The first determining unit is configured to determine a target gateway from the first gateway set based on a first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set;

[0015] The first sending unit is configured to send the message to the target gateway so as to forward the message to the target node device through the target gateway.

[0016] This application embodiment also provides another message sending device, including:

[0017] The second determining unit is used to determine a second hop count set between each first node device in the first node set of the Bluetooth Mesh network and the gateway device; the second hop count set represents the number of devices that each first node device in the first node set passes through when sending a message to the gateway device;

[0018] The second sending unit is used to report the second hop count set to the server.

[0019] This application also provides an electronic device, including:

[0020] The processor and the memory used to store computer programs that can run on the processor.

[0021] When the processor runs the computer program, it executes the steps of any of the above methods.

[0022] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0023] In this embodiment of the invention, the server can reflect the quality of wireless network communication between the surrounding node devices and different gateways in the Bluetooth Mesh network by using the hop count set between the node devices and different gateways in the Bluetooth Mesh network. This allows the server to dynamically select the gateway with the best network communication quality for the node devices, thereby improving the communication quality between the gateways and the node devices. Attached Figure Description

[0024] Figure 1 A schematic diagram illustrating the implementation flow of a message sending method provided in an embodiment of this application;

[0025] Figure 2 A schematic diagram illustrating the implementation flow of a message sending method provided in another embodiment of this application;

[0026] Figure 3A schematic diagram illustrating the implementation flow of a message sending method provided in another embodiment of this application;

[0027] Figure 4 A schematic diagram illustrating the implementation flow of a message sending method provided in another embodiment of this application.

[0028] Figure 5 A schematic diagram of the structure of a message sending device provided in an embodiment of this application;

[0029] Figure 6 A schematic diagram of the structure of a message sending device provided in another embodiment of this application;

[0030] Figure 7 This application provides a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Detailed Implementation

[0031] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0032] It should be noted that the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0033] In addition, in the embodiments of this application, "first," "second," etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0034] This application provides a message sending method. Figure 1 This is a flowchart illustrating a message sending method according to an embodiment of this application. Figure 1 As shown, the method is applied to a server, and the method includes:

[0035] S101: Obtain messages sent to target node devices in the Bluetooth Mesh network.

[0036] Here, the server retrieves messages sent to target node devices in the Bluetooth Mesh network. These messages can be of different types, such as control messages and query messages. The recipient of the messages is the target node device in the Bluetooth Mesh network, which can be different IoT devices. In practical applications, the messages can be sent by users through applications. After retrieving the messages, the server can select a gateway with high network communication quality in the Bluetooth Mesh network for the target node device, enabling the target node device to successfully receive the messages.

[0037] S102: Determine the target gateway from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set.

[0038] Here, the server can determine the network communication quality of each gateway in the first set of gateways in the Bluetooth Mesh network based on the first hop count between the target node device and each gateway in the first set of gateways. This allows the server to select a gateway with better performance for communication with the target node device. The first hop count represents the number of devices through which a message sent from the target node device to each gateway in the first set of gateways passes. The first hop count determines the length of the transmission path during message transmission, and the length of the transmission path easily affects the wireless network communication quality. Therefore, the first hop count between the target node device and each gateway in the first set of gateways in the Bluetooth Mesh network reflects the wireless network communication quality between the target node device and each gateway. The lower the hop count between the target node device and the gateway device, the better the wireless network communication quality between them. The first hop count can be obtained by statistically analyzing the heartbeat messages sent by the target node device to the gateway device. For example, when a message can be sent directly from node device A to node device B, the corresponding hop count is 1. When a message sent from node device A needs to be forwarded by node device C before reaching node device B, the corresponding hop count is 2. In practical applications, the first gateway set in a Bluetooth Mesh network reports the first hop count between the node device and each gateway in the first gateway set to the server. The server can then determine the hop count between the target node device and each gateway in the first gateway set from the reported first hop count set. The first hop count set can be reported periodically by the first gateway set or it can be reported automatically by the first gateway set. Furthermore, the server can also perform deduplication on the received first hop count set, thereby further improving data processing efficiency.

[0039] In one embodiment, determining the target gateway from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network includes:

[0040] From the first set of gateways, the gateway corresponding to the first hop count with the smallest value in the first hop count set is determined as the target gateway.

[0041] In order to improve the communication success rate between the target gateway and the target node device, when determining the target gateway, the gateway corresponding to the smallest first hop number in the first hop number set can be determined as the target gateway of the target node device, thereby ensuring the best wireless network communication quality between the target node device and the target gateway.

[0042] In one embodiment, determining the gateway corresponding to the first hop count with the smallest value in the first hop count set as the target gateway includes:

[0043] The gateway corresponding to the highest proportion in the first hop count set is determined as the target gateway; the proportion represents the percentage of the smallest first hop count among the first hop counts of each gateway in the first gateway set and the target node device.

[0044] In practical applications, the first hop count set between the target node device and each gateway in the first gateway set is obtained based on the statistics of heartbeat messages received by the gateway from the target node device. Network fluctuations can affect the transmission path between the target node device and the gateway device. Therefore, to more accurately determine the target gateway, the hop count ratio between the target node and the gateway device can be further considered. The hop count ratio reflects the proportion of different hop count values ​​among all heartbeat messages received by the gateway device from the target node device. For example, if the target node device sends 100 heartbeat messages to the gateway device, and 90 of these heartbeat messages are sent directly from the target node device to the gateway device, while 10 heartbeat messages may be forwarded by other node devices once or multiple times before reaching the gateway device, then the proportion of hop count values ​​of 1 is 90%, and the proportion of other hop count values ​​is 10%. Thus, by using the hop count values ​​and the corresponding hop count ratios, the gateway with the best network performance among the multiple gateway devices in the first gateway set can be determined as the target gateway. In practical applications, as long as the target gateway device does not go offline, the gateway device can continuously count the number of heartbeats between the gateway device and the target node device and the corresponding ratio based on the heartbeat messages sent by the target node device. Therefore, the ratio of the number of heartbeats between the target node device and the gateway device may change.

[0045] In one embodiment, before determining the target gateway from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network, the process includes:

[0046] The first gateway set is determined from the second gateway set; the second gateway set represents all gateways in the Bluetooth Mesh network; the first gateway set represents gateways in the Bluetooth Mesh network that are online.

[0047] To improve the efficiency of identifying the target gateway, the selection range can be further narrowed down by limiting the first gateway set to online gateways in the Bluetooth Mesh network. In practical applications, due to network quality limitations, gateways in the Bluetooth Mesh network may be online or offline. When a gateway in the Bluetooth Mesh network is online, it can achieve wireless network communication with the target node device. When a gateway in the Bluetooth Mesh network is offline, it means that the gateway cannot work properly and cannot achieve wireless network communication with the target node device. Therefore, the online gateways can be identified from all gateways in the Bluetooth Mesh network to form the first gateway set. The target gateway for the target node device can then be identified from the first gateway set, thus ensuring that the identified target gateway can communicate normally with the target node device.

[0048] In one embodiment, determining the first gateway set in the second gateway set includes:

[0049] The gateway that reports the first heartbeat message in the second gateway set during the first time interval is determined as the first gateway set.

[0050] Here, when the gateway device in the Bluetooth mesh network is online, it can communicate wirelessly with the server. In other words, the gateway device can transmit data with the server. Therefore, the gateway device can report a first heartbeat message to the server to determine that the current gateway device is online. If the server can receive the first heartbeat message reported by the gateway device in the Bluetooth mesh network within the first time interval, it indicates that the gateway can communicate wirelessly with the server, which means that the gateway device that reported the first heartbeat message is online. Thus, the server can determine that the gateway device is the gateway device of the first set of gateways. For example, the server will determine the gateway device in the Bluetooth mesh network that reported the first heartbeat message as the gateway of the first set within 15 seconds.

[0051] In one embodiment, such as Figure 2 As shown, the method further includes:

[0052] S201: Determine the gateways in the second gateway set that have not reported the first heartbeat message within a set time period as the third gateway set; the third gateway set represents the gateways in the Bluetooth Mesh network that are in a disconnected state.

[0053] Here, when a gateway device in a Bluetooth mesh network is offline, it cannot communicate wirelessly with the server. In other words, the gateway device cannot transmit data with the server, and the server cannot receive the first heartbeat message reported by the gateway device. In practical applications, the server can identify gateway devices in the second gateway set that have not reported a first heartbeat message within a set time period as belonging to the third gateway set that are offline. The set time period is longer than the first time interval. In practice, the first time interval is the period during which a gateway device should report a first heartbeat message. However, gateway devices may temporarily go offline due to network fluctuations. When a gateway device attempts to reconnect, it may successfully reconnect and return to online status. Therefore, by setting a time period longer than the first time interval, the server can avoid incorrectly judging the connection status of gateway devices due to temporary network fluctuations. For example, under normal circumstances, the server receives the first heartbeat message reported by gateway devices in the second gateway set every 15 seconds. If the server has not received the first heartbeat message reported by gateway devices in the second gateway set within 45 seconds, it can determine that the gateway device is currently offline. In practical applications, the set duration can be set to the maximum time to wait for the gateway to reconnect. If the gateway fails to reconnect within this time, it can be considered that the gateway is offline.

[0054] S202: Delete the hop count data between each gateway in the third gateway set and each node device in the Bluetooth Mesh network.

[0055] Here, after determining the third gateway set, the hop count data between each gateway in the third gateway set and each node device in the Bluetooth Mesh network is deleted. In practical applications, since the gateways in the third gateway set are already offline, the server will not consider them as target gateways. Therefore, it is not necessary to obtain the hop count data between each node device in the Bluetooth Mesh network and each gateway in the third gateway set reported to the server by each gateway in the third gateway set before it went offline. This allows for the rapid determination of the first gateway set that is online in the Bluetooth Mesh network.

[0056] S103: Send the message to the target gateway to forward the message to the target node device through the target gateway.

[0057] Here, a message is sent to the target gateway, which can then forward it to the target node device, thus enabling the message to reach the target node device via the shortest transmission path. In practical applications, after receiving the message, the target node device processes it to perform corresponding operations, thereby improving the target node device's message response speed.

[0058] In the above embodiments, the heartbeat data between the target node device and each gateway in the Bluetooth Mesh network can reflect the quality of wireless network communication between the surrounding target node devices and each gateway in the Bluetooth Mesh network. This allows the target node device to dynamically select the target gateway with the best network communication quality, thereby improving the communication quality between the target gateway and the target node device. This optimizes the transmission time required for communication and increases the success rate of communication between the target gateway and the target node device.

[0059] This application also provides another message sending method, such as Figure 3 As shown, the method is applied to a gateway device, and the method includes:

[0060] S301: Determine a second hop count set between each first node device in the first node set of the Bluetooth Mesh network and the gateway device; the second hop count set represents the number of devices that each first node device in the first node set passes through when sending a message to the gateway device.

[0061] Here, the gateway device counts the second hop count between each first node device in the first node set of the Bluetooth Mesh network and the gateway device. The second hop count represents the number of devices that each first node device in the first node set passes through when sending a message to the gateway device. Thus, the length of the transmission path between each first node device in the first node set and the gateway device can be determined by the second hop count. Furthermore, the quality of wireless network communication between each first node device in the first node set and the gateway device can be further determined by the length of the transmission path. In practical applications, the gateway device can receive heartbeat messages sent by each first node device in the first node set. The gateway device determines the second hop count between each first node device and the gateway device by statistically analyzing the heartbeat messages sent by each first node device in the first node set. Specifically, each first node device in the first node set sends a heartbeat message to the gateway device. The heartbeat message can carry parameters, and the second hop count between the first node device and the gateway device can be obtained from the parameters carried in the heartbeat message. For example, if the heartbeat message sent by the first node device carries a parameter of 8, the gateway device will subtract the parameter carried in the heartbeat message after receiving it, obtaining a parameter of 7. The difference between parameter 8 and parameter 7 is 1, so the second hop count between the first node device and the gateway device is 1. In practical applications, the second hop count set can be used to determine the length of the transmission path between each first node device in the first node set and the gateway device. Therefore, the wireless network communication quality between the gateway device and each first node device in the first node set can be determined using the second hop count set. For example, when a message can be sent directly from first node device A to first node device B in the first node set, the second hop count value of the corresponding second hop count set is 1. When a message sent from first node device A in the first node set needs to be forwarded by first node device C in the first node set before reaching first node device B, the second hop count value of the corresponding second hop count set is 2. In practical applications, the lower the second hop count value of the second hop count set, the better the wireless network communication quality between the first node device and the gateway device.

[0062] S302: Report the second hop count set to the server.

[0063] Here, the gateway device reports the second-hop count to the server, enabling the server to determine the wireless network communication quality between the gateway device and the node device based on the reported second-hop count. In practical applications, when new node device information is added, node device information is modified, or network data is updated, the gateway device needs to upload the changed information to the server for updating.

[0064] In one embodiment, the method further includes:

[0065] The gateway device, acting as the target gateway, receives the message sent by the server and sends the message to the target node device; wherein...

[0066] The target gateway is determined based on the set of third hops between the target node device and each gateway in the fourth set of gateways in the Bluetooth Mesh network.

[0067] Here, users send messages through the application. These messages can be of different types, such as control messages and query messages. The recipients of these messages are the target node devices in the Bluetooth Mesh network. The gateway device, acting as the target gateway, receives messages from the server. The target gateway is determined based on the set of third hop counts between the target node device and each gateway in the fourth set of gateways in the Bluetooth Mesh network. In practice, the gateway device with the smallest third hop count in the set can be used as the target gateway. Furthermore, the proportion of the smallest third hop count can be combined to further determine the target gateway within the Bluetooth Mesh network. The target gateway sends messages to the target node device using the shortest communication path, improving message transmission efficiency.

[0068] In one embodiment, such as Figure 4 As shown, the method further includes:

[0069] S401: The node devices in the first node set that did not report the second heartbeat message during the second time interval are determined as the second node set, and the second node set represents the node devices that have abnormal communication with the gateway device.

[0070] Here, the gateway device can periodically receive second heartbeat messages reported by each first node device in the first node set. The gateway device can determine the existence of communication between the first node device and the gateway device based on these second heartbeat messages, and can also determine the second hop count set between the first node devices and the gateway device in the first node set based on the second heartbeat information. Node devices in the first node set that fail to report second heartbeat messages within the second time interval are defined as the second node set. The wireless network communication between the node devices in the second node set and the gateway device is abnormal; the node devices in the second node set cannot receive messages from other node devices, nor can they send messages to other node devices.

[0071] S402: Delete the hop count data between each node device in the second node set and the gateway device.

[0072] Here, due to anomalies in the wireless network communication between the node devices in the second node set and the gateway device, the hop count data between each node device in the second node set and the gateway device can no longer represent the number of devices traversed by the node device when sending a message to the gateway device. Specifically, the hop count data between each node device in the second node set and the gateway device is calculated by the gateway device based on the second heartbeat information previously reported by the node devices in the second node set. Therefore, it is necessary to delete the hop count data between each node device in the second node set and the gateway device. Furthermore, due to the anomalies in the wireless network communication between the node devices in the second node set and the gateway device, the server cannot select a target gateway for the node devices in the second node set. Therefore, the gateway device no longer needs to calculate the hop count data for the node devices in the second node set, further cleaning up the invalid hop count data stored on the gateway device.

[0073] In one embodiment, the method further includes:

[0074] A third heartbeat message is reported to the server according to the third time interval.

[0075] Here, to allow the server to determine the gateway device's connection status, the gateway device reports a third heartbeat message to the server at a third time interval. This third heartbeat message determines the gateway device's connection status. In practical applications, when the gateway device is online, it indicates that it can communicate with the server. Therefore, the gateway device can report a third heartbeat message to the server to confirm its online status. Conversely, when the gateway device is offline, it indicates that it cannot communicate with the server. In this case, the gateway device fails to report a third heartbeat message. When the server does not receive the third heartbeat message reported by the gateway device, it confirms that the gateway device is currently offline. Therefore, the server can determine the current connection status of the gateway device based on the reported third heartbeat message, thus avoiding the server selecting a target gateway for the target node device from among the offline gateway devices.

[0076] In the above embodiments, the gateway device counts the second hop count between each first node device in the first node set and the gateway device, and reports the counted second hop count to the server. This enables the server to dynamically select the best-performing target gateway for communication with the target node device based on the wireless network communication quality between the gateway device and the target node device, thereby improving message sending efficiency.

[0077] To implement the method of the embodiments of this application, the embodiments of this application also provide a message sending device, such as... Figure 5 As shown, the device includes:

[0078] The first receiving unit 501 is used to acquire messages sent to target node devices in the Bluetooth Mesh network;

[0079] The first determining unit 502 is configured to determine a target gateway from the first gateway set based on a first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set;

[0080] The first sending unit 503 is used to send the message to the target gateway so as to forward the message to the target node device through the target gateway.

[0081] In one embodiment, when the first determining unit 502 determines the target gateway from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network, it is further configured to:

[0082] From the first set of gateways, the gateway corresponding to the first hop count with the smallest value in the first hop count set is determined as the target gateway.

[0083] In one embodiment, when the first determining unit 502 determines the gateway corresponding to the first hop count with the smallest value in the first hop count set as the target gateway, it is further configured to:

[0084] The gateway corresponding to the highest proportion in the first hop count set is determined as the target gateway; the proportion represents the percentage of the smallest first hop count among the first hop counts of each gateway in the first gateway set and the target node device.

[0085] In one embodiment, before determining the target gateway from the first gateway set based on the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network, the first determining unit 502 is further configured to:

[0086] The first gateway set is determined from the second gateway set; the second gateway set represents all gateways in the Bluetooth Mesh network; the first gateway set represents gateways in the Bluetooth Mesh network that are online.

[0087] In one embodiment, when the first determining unit 502 determines the first gateway set in the second gateway set, it is further configured to:

[0088] The gateway that reports the first heartbeat message in the second gateway set during the first time interval is determined as the first gateway set.

[0089] In one embodiment, the device is further configured to:

[0090] The gateways in the second gateway set that do not report the first heartbeat message within a set time period are identified as the third gateway set; the third gateway set represents the gateways in the Bluetooth Mesh network that are in a disconnected state.

[0091] Delete the hop count data between each gateway in the third gateway set and each node device in the Bluetooth Mesh network.

[0092] In practical applications, the first receiving unit 501, the first determining unit 502, and the first sending unit 503 can be implemented by the processor in the message sending device. Of course, the processor needs to run the programs stored in the memory to implement the functions of the above-mentioned program modules.

[0093] It should be noted that the above Figure 5 The message sending device provided in this embodiment is illustrated using the above-described division of program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the message sending device and message sending method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0094] This application also provides another message sending device, such as... Figure 6 As shown, the device includes:

[0095] The second determining unit 601 is used to determine a second hop count set between each first node device in the first node set of the Bluetooth Mesh network and the gateway device; the second hop count set represents the number of devices that each first node device in the first node set passes through when sending a message to the gateway device.

[0096] The second sending unit 602 is used to report the second hop count set to the server.

[0097] In one embodiment, the device is further configured to:

[0098] The gateway device, acting as the target gateway, receives the message sent by the server and sends the message to the target node device; wherein...

[0099] The target gateway is determined based on the set of third hops between the target node device and each gateway in the fourth set of gateways in the Bluetooth Mesh network.

[0100] In one embodiment, the device is further configured to:

[0101] The node devices in the first node set that did not report the second heartbeat message during the second time interval are determined as the second node set, and the second node set represents the node devices that have abnormal communication with the gateway device;

[0102] Delete the hop count data between each node device in the second node set and the gateway device.

[0103] In one embodiment, the device is further configured to:

[0104] A third heartbeat message is reported to the server according to the third time interval.

[0105] In practical applications, the second determining unit 601 and the second sending unit 602 can be implemented by the processor in the message sending device. Of course, the processor needs to run the programs stored in the memory to implement the functions of the above-mentioned program modules.

[0106] It should be noted that the above Figure 6 The message sending device provided in this embodiment is illustrated only by the division of the above-described program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the message sending device and message sending method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0107] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device. Figure 7 This is a schematic diagram of the hardware structure of the electronic device according to an embodiment of this application, as shown below. Figure 7 As shown, the electronic device includes:

[0108] Communication interface 1 enables information exchange with other devices, such as network devices;

[0109] Processor 2 is connected to communication interface 1 to enable information interaction with other devices. When running a computer program, it executes the Bluetooth gateway selection method provided by one or more of the above-mentioned technical solutions. The computer program is stored in memory 3.

[0110] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 7 The general will label all buses as Bus System 4.

[0111] The memory 3 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0112] It is understood that memory 3 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 3 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0113] The methods disclosed in the embodiments of this application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 2 or by instructions in the form of software. The processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the aforementioned method in combination with its hardware.

[0114] When processor 2 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0115] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 that stores a computer program, which can be executed by a processor 2 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed apparatus, terminal, and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0117] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0118] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0119] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0120] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0121] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A message sending method, applied to a server, characterized in that, The method includes: Retrieve messages sent to target node devices in the Bluetooth Mesh network; The first gateway set is determined from the second gateway set; the second gateway set represents all gateways in the Bluetooth Mesh network; the first gateway set represents gateways in the Bluetooth Mesh network that are online. The gateway with the highest proportion in the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network is determined as the target gateway; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set; the proportion represents the percentage of the smallest first hop count among the first hop counts between each gateway in the first gateway set and the target node device; The message is sent to the target gateway to forward the message to the target node device through the target gateway; A third gateway set is determined from the second gateway set; the third gateway set represents the gateways in the Bluetooth Mesh network that are in a disconnected state. Delete the hop count data between each gateway in the third gateway set and each node device in the Bluetooth Mesh network.

2. The method according to claim 1, characterized in that, Determining the first gateway set from the second gateway set includes: The gateway that reports the first heartbeat message in the second gateway set during the first time interval is determined as the first gateway set.

3. The method according to claim 1, characterized in that, Determining the third gateway set from the second gateway set includes: Gateways in the second gateway set that have not reported the first heartbeat message within a set time period are identified as the third gateway set.

4. A message sending method, characterized in that, Applied to a gateway device, the method includes: Determine a second hop count set between each first node device in the first node set of the Bluetooth Mesh network and the gateway device; the second hop count set represents the number of devices through which each first node device in the first node set passes when sending a message to the gateway device; The second hop count set is reported to the server so that the server performs the method according to any one of claims 1 to 3.

5. The method according to claim 4, characterized in that, The method further includes: The gateway device, acting as the target gateway, receives the message sent by the server and sends the message to the target node device; wherein... The target gateway is determined based on the set of third hops between the target node device and each gateway in the fourth set of gateways in the Bluetooth Mesh network.

6. The method according to claim 4, characterized in that, The method further includes: The node devices in the first node set that did not report the second heartbeat message during the second time interval are determined as the second node set, and the second node set represents the node devices that have abnormal communication with the gateway device; Delete the hop count data between each node device in the second node set and the gateway device.

7. The method according to claim 4, characterized in that, The method further includes: A third heartbeat message is reported to the server according to the third time interval.

8. A message sending device, characterized in that, include: The first receiving unit is used to acquire messages sent to the target node device in the Bluetooth Mesh network; The first determining unit is configured to determine a first gateway set from the second gateway set; the second gateway set represents all gateways in the Bluetooth Mesh network; the first gateway set represents gateways in the Bluetooth Mesh network that are in an online state. The first determining unit is further configured to determine the gateway corresponding to the highest proportion in the first hop count set between the target node device and each gateway in the first gateway set in the Bluetooth Mesh network as the target gateway; the first hop count set represents the number of devices through which the target node device sends a message to each gateway in the first gateway set; The ratio represents the proportion of the smallest first hop number among the first hop numbers of each gateway in the first gateway set and the target node device; The first sending unit is configured to send the message to the target gateway so as to forward the message to the target node device through the target gateway; The device is also used for: A third gateway set is determined from the second gateway set; the third gateway set represents the gateways in the Bluetooth Mesh network that are offline; hop count data between each gateway in the third gateway set and each node device in the Bluetooth Mesh network is deleted.

9. A message sending device, characterized in that, include: The second determining unit is used to determine the set of second hop counts between each first node device and the gateway device in the first node set of the Bluetooth Mesh network. The second hop count set represents the number of devices that each first node device in the first node set passes through when sending a message to the gateway device; The second sending unit is configured to report the second hop count set to the server so that the server executes the method according to any one of claims 1 to 3.

10. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 3 or 4 to 7.

11. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3 or 4 to 7.

Citation Information

Patent Citations

  • ZigBee network based multi-gateway transmission system

    CN102857992A