A communication method, apparatus, device, and storage medium

By acquiring and determining the network identifier of the wireless module for network formation, the problem of complex device binding in the ZigBee protocol stack is solved, realizing communication between devices in the same network and isolation between different networks, thus improving communication efficiency and real-time performance.

CN116321364BActive Publication Date: 2025-12-23EASYLINKIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310193872.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-12-23
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

The existing device binding process in the ZigBee protocol stack is complex and cannot bind specific devices according to requirements. This results in devices with the same network ID communicating with each other without interference, affecting communication efficiency and real-time performance.

Method used

By obtaining the network identifier of the wireless module, the network identifier of the associated device is determined, and a network is formed based on these identifiers. Request information is received to obtain the address information assigned by the target gateway, enabling the device to access the target network. Conflict avoidance and retransmission mechanisms are used to ensure data transmission reliability.

Benefits of technology

It enables devices on the same network to communicate with each other, while devices on different networks do not interfere with each other, improving communication response speed and meeting the needs of real-time IoT applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116321364B_ABST
    Figure CN116321364B_ABST
Patent Text Reader

Abstract

A communication method, device, equipment and storage medium are disclosed. The method is applied to an Internet of Things system, and includes: obtaining a first identifier of a network to which a first device including a wireless module belongs; determining, according to the first identifier, a second identifier of a network to which a second device associated with the first device belongs; performing networking on the first device and the second device based on the first identifier and the second identifier; receiving first request information sent by the first device; the first request information is used to obtain address information allocated to the wireless module by a target gateway corresponding to the second device; and based on the address information, the first device is accessed to a network in which the target gateway is located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a communication method, apparatus, device, and storage medium. Background Technology

[0002] In related technologies, the node binding process is extremely complex, making it impossible to bind specific devices according to requirements, establish associated devices in the same network, ensure that devices with the same network identity (ID) can communicate with each other, and prevent communication between devices with different network IDs from interfering with each other. Currently, there is no effective solution to this problem. Summary of the Invention

[0003] To address the existing technical problems, the main objective of this invention is to provide a communication method, apparatus, device, and storage medium.

[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0005] In a first aspect, the present invention provides a communication method applied to an Internet of Things (IoT) system, the method comprising:

[0006] Obtain the first identifier of the network to which the first device, including the wireless module, belongs;

[0007] Based on the first identifier, determine the second identifier of the network to which the second device associated with the first device belongs;

[0008] The first device and the second device are networked based on the first identifier and the second identifier;

[0009] The system receives a first request message sent by the first device; the first request message is used to obtain address information allocated to the wireless module by the target gateway corresponding to the second device.

[0010] Based on the address information, the first device is connected to the network where the target gateway is located.

[0011] In the above scheme, the method includes:

[0012] Receive a third identifier sent by the first gateway in at least one of the gateways;

[0013] A second request message is sent to a second gateway among the at least one gateway based on the third identifier; the second gateway is another gateway among the at least one gateway besides the first gateway.

[0014] The second gateway receives a first response based on the second request information; the first response is used to update the third identifier and resend the second request information.

[0015] In the above scheme, it is determined whether the first response information is received within a first preset time period;

[0016] If the first response information is not received within the first preset time, the third identifier will not be updated;

[0017] If the first response information is received within the first preset time, the third identifier is updated.

[0018] In the above scheme, connecting the first device to the network where the target gateway is located based on the address information includes:

[0019] The address information is sent to the first device through the target gateway; the address information is used by the first device to access the network where the target gateway is located.

[0020] In the above scheme, after sending the address information to the first device through the target gateway, the method includes:

[0021] Determine whether a second response message has been received within a second preset time.

[0022] If the second response information is not received within the second preset time, the address information is resent to the first device through the target gateway until the second response information is received.

[0023] If the second response information is received within the second preset time, no changes will be made.

[0024] In the above scheme, the step of resending the address information to the first device through the target gateway until the second response information is received if the second response information is not received within the second preset time period further includes:

[0025] Determine whether the number of times the address information is resent to the first device through the target gateway until the address information is received exceeds a preset threshold;

[0026] If the number of times exceeds a preset threshold, the transmission of the address information to the first device through the target gateway will be stopped.

[0027] In the above scheme, the method further includes:

[0028] The first message is sent to the first device through the target gateway; the first message is used to remove the first device from the network where the target gateway is located.

[0029] Secondly, the present invention also provides a communication device applied to an Internet of Things (IoT) system, the device comprising: an acquisition unit, a determination unit, a networking unit, a receiving unit, and an access unit.

[0030] The acquisition unit is used to acquire the first identifier of the network to which the first device, including the wireless module, belongs;

[0031] The determining unit is configured to determine, based on the first identifier, a second identifier of the network to which the second device associated with the first device belongs;

[0032] The networking unit is used to network the first device and the second device based on the first identifier and the second identifier;

[0033] The receiving unit is configured to receive a first request information sent by the first device; the first request information is used to obtain address information allocated to the wireless module by the target gateway corresponding to the second device;

[0034] The access unit is used to connect the first device to the network where the target gateway is located based on the address information.

[0035] Thirdly, embodiments of the present invention provide a storage medium storing a computer program; when the computer program is executed by a processor, it implements the steps of any of the methods described above.

[0036] Fourthly, embodiments of the present invention provide a communication device, the communication device comprising: a processor and a memory for storing a computer program capable of running on the processor, wherein, when the processor runs the computer program, it executes the steps of any of the methods described above.

[0037] This invention provides a communication method, apparatus, device, and storage medium. The method, applied to an Internet of Things (IoT) system, includes: obtaining a first identifier of a network to which a first device, including a wireless module, belongs; determining a second identifier of a network to which a second device associated with the first device belongs based on the first identifier; networking the first device and the second device based on the first identifier and the second identifier; receiving first request information sent by the first device; the first request information being used to obtain address information allocated to the wireless module by a target gateway corresponding to the second device; and connecting the first device to the network where the target gateway is located based on the address information. Using the technical solution of this invention, the network device achieves communication by receiving the first request information sent by the first device; obtaining address information based on the first request information; and connecting the first device to the network where the target gateway is located based on the address information. This allows for binding of the first device to the network device, enabling devices within the same network to communicate with each other, while preventing devices in different networks from communicating with each other. Attached Figure Description

[0038] Figure 1 A flowchart illustrating a communication method provided in an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of the Internet of Things (IoT) system topology provided in an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the network establishment process of a wireless gateway provided in an embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram illustrating the process of a wireless module joining a network according to an embodiment of the present invention.

[0042] Figure 5 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present invention;

[0043] Figure 6 This is a schematic diagram of a hardware structure of a communication device according to an embodiment of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the specific technical solutions of the invention will be further described in detail below with reference to the accompanying drawings of the embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0045] Among related technologies, ZigBee is a typical wireless communication technology based on relevant standards. ZigBee has a low data transmission rate, only 10kb / s to 250kb / s; a large network capacity, supporting up to 64,435 devices; a small effective range, covering 10 to 100 meters; and low power consumption, with an operating current of 20mA and a minimum sleep current of 2uA. ZigBee is easy to network and is mainly used in short-range, low-power applications with low transmission rates.

[0046] In the current ZigBee protocol stack, binding refers to the establishment of a logical link between two nodes at the application layer. Once a binding is established on the source node, its application service can send data to the target node. The ZigBee protocol supports automatic binding, centralized binding, assisted binding, and application service binding, but its binding process is extremely complex. It cannot be customized to bind specific devices to the same network, ensuring that devices with the same network ID can communicate with each other while devices with different network IDs do not interfere with each other. Furthermore, because the ZigBee protocol stack defines multiple layers—network layer, application support sublayer, and application layer—the application layer tasks associated with the user core have the lowest priority. This can lead to the processor spending most of its time running higher-priority lower-level tasks, while application layer tasks associated with the user are allocated fewer resources. Consequently, the actual effective communication rate falls far short of the theoretical ZigBee data transmission rate, resulting in significant latency, which is detrimental to IoT applications that require real-time speeds and high power consumption.

[0047] In the ZigBee protocol stack, all data reception requires parsing upwards layer by layer, and data transmission requires encapsulation downwards layer by layer. Because there are numerous system tasks within the protocol stack, and user tasks such as serial port data reception and sensor data acquisition reside at the application layer with the lowest priority, the processor spends most of its time processing system tasks, hindering its ability to process wireless data quickly and promptly. Although the air data rate is 250Kbps, the processor's processing speed for RF data cannot keep up, resulting in some wireless data being overwritten and severe packet loss. Furthermore, current ZigBee wireless communication protocols offer terminal binding methods such as automatic binding, centralized binding, assisted binding, and application service binding, making it impossible to selectively bind specific wireless modules in software as needed. These issues severely limit the use of multiple wireless modules, especially the ability to flexibly bind and unbind them.

[0048] Based on this, in various embodiments of this application, wireless modules are bound together through network devices to form multiple communication networks, reducing system tasks, improving communication response rate, and meeting the needs of real-time Internet of Things applications.

[0049] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0050] Figure 1 This is a flowchart illustrating a communication method provided in an embodiment of the present invention. Figure 1 As shown, the method is applied to an Internet of Things (IoT) system, and the method includes:

[0051] S101: Obtain the first identifier of the network to which the first device, including the wireless module, belongs;

[0052] S102: Determine the second identifier of the network to which the second device associated with the first device belongs based on the first identifier;

[0053] S103: Configure the first device and the second device to form a network based on the first identifier and the second identifier;

[0054] S104: Receive the first request information sent by the first device; the first request information is used to obtain the address information allocated to the wireless module by the target gateway corresponding to the second device;

[0055] S105: Connect the first device to the network where the target gateway is located based on the address information.

[0056] It should be noted that the wireless module may include the first device and the second device; the first device may be a sensor module, for example, the first device may be a button module and a knob module; the second device may be an actuator module, for example, the second device may be a colored light module and a motor module.

[0057] In this embodiment, the first identifier can be the identity information of the network to which the first device belongs. As an example, the first identifier can be the network ID of the first device. The second identifier can be the identity information of the network to which the second device belongs. As an example, the second identifier can be the network ID of the second device. The steps of obtaining the first identifier of the network to which the first device (including the wireless module) belongs; determining the second identifier of the network to which the second device associated with the first device belongs based on the first identifier; and networking the first device and the second device based on the first identifier and the second identifier can be understood as the host computer obtaining the ID information of the network to which the first device belongs; determining the ID information of the network to which the second device belongs based on the ID information of the network to which the first device belongs; and networking the first device and the second device based on the ID information of the network to which the first device belongs and the ID information of the network to which the second device belongs.

[0058] The first request information can be binding request information; the address information can be a short network address and a network identifier (Personal Area Network ID, PANID). The network device receives the first request information sent by the first device; the first request information is used to obtain the address information assigned to the wireless module by the target gateway corresponding to the second device; this can be understood as the network device receiving the binding request information sent by the first device, selecting a target gateway based on the binding request information, and assigning a short network address to the first device; the target gateway forwards its own PANID and short network address to the first device and binds to the first device. The network device may include host computer software.

[0059] It should be noted that once the first device is bound, the sending of binding request information will stop.

[0060] To better understand, here are some examples. Figure 2 A schematic diagram of the Internet of Things (IoT) system topology provided in an embodiment of the present invention, such as... Figure 2 As shown, the IoT system includes host computer software, a wireless gateway, and wireless modules. The wireless modules include sensor modules and actuator modules. The sensor modules are responsible for collecting data, and the actuator modules are responsible for receiving data and performing corresponding actions. Commonly used sensor modules include button modules and knob modules, while common actuator modules include LED modules and motor modules. The wireless gateway is used for data and network relay; one wireless gateway can connect to multiple wireless modules. The host computer software supports selecting corresponding modules and binding them to the network where the wireless gateway is located, thus enabling hardware modules within the same network to communicate with each other, while hardware modules in different networks do not interfere with each other. Simultaneously, the host computer software is programmed via wired connections, allowing sensor modules to only collect and report sensor data, and actuator modules to only perform corresponding actions based on the received data, while the intermediate data flow and logic processing are all handled by the host computer software.

[0061] By adopting the technical solution of this embodiment of the invention, by receiving a first request information sent by the first device; the first request information is used to obtain the address information allocated by the target gateway corresponding to the second device to the wireless module; based on the address information, the first device is connected to the network where the target gateway is located; and by selecting the corresponding wireless module through the host computer software and binding it to the network where the wireless gateway is located, devices in the same network can communicate with each other, while devices in different networks cannot communicate with each other.

[0062] In an optional embodiment of the present invention, the method includes: receiving a third identifier sent by a first gateway among at least one gateway; sending second request information to a second gateway among the at least one gateway based on the third identifier; the second gateway being another gateway among the at least one gateway besides the first gateway; receiving first response information from the second gateway based on the second request information; the first response information being used to update the third identifier and resend the second request information.

[0063] In this embodiment, the third identifier is the unique PANID number of the gateway. It should be noted that when the wireless gateway is powered on, it obtains the unique Media Access Control (MAC) address of the CC2530 chip and initializes the PANID of the network based on the last two bytes of the MAC address.

[0064] The second request information can be the gateway's own PANID number. Sending the second request information to the second gateway among the at least one gateway based on the third identifier can be understood as the wireless gateway broadcasting data containing its own PANID number to other gateways. Updating the third identifier can be understood as incrementing its own PANID by 1.

[0065] In this embodiment, the first response information received by the second gateway based on the second request information is used to update the third identifier and resend the second request information. This can be understood as receiving response information sent by other gateways, modifying its own PANID number, and then rebroadcasting the modified PANID number to other gateways.

[0066] In an optional embodiment of the present invention, the method includes: determining whether the first response information is received within a first preset time period; if the first response information is not received within the first preset time period, then not updating the third identifier; if the first response information is received within the first preset time period, then updating the third identifier.

[0067] In this embodiment, the first preset time is pre-set and is not limited here. As an example, the first preset time can be 10 seconds.

[0068] If the first response information is not received within the first preset time, the third identifier will not be updated; if the first response information is received within the first preset time, the third identifier will be updated. This can be understood as modifying its own PANID number if a response information from another gateway is received within 10 seconds, and making no changes if no response information from another gateway is received within 10 seconds, and the network is established.

[0069] To better understand the embodiments of the present invention, Figure 3 This is a schematic diagram of the network establishment process of the wireless gateway provided in an embodiment of the present invention, as shown below. Figure 3 As shown. Initialize the gateway PANID, start the network establishment timer, and broadcast data containing the PANID to other gateways to request network establishment. If a response is received from other gateways, modify the PANID and request network establishment again. The process continues until no response is received within a preset period (e.g., 10 seconds), at which point network establishment is complete.

[0070] In an optional embodiment of the present invention, the step of connecting the first device to the network where the target gateway is located based on the address information includes: sending the address information to the first device through the target gateway; the address information is used for the first device to access the network where the target gateway is located.

[0071] In this embodiment, sending the address information to the first device through the target gateway can be understood as the host computer software sending the address information to the wireless gateway, and the wireless gateway then forwarding the address information to the first device for binding.

[0072] In an optional embodiment of the present invention, after sending the address information to the first device through the target gateway, the method includes: determining whether a second response information is received within a second preset time; if the second response information is not received within the second preset time, then resending the address information to the first device through the target gateway until the second response information is received; if the second response information is received within the second preset time, then no changes are made.

[0073] In this embodiment, the second preset time is pre-set and is not limited here. As an example, the second preset time can be 3ms.

[0074] If the second response information is not received within the second preset time, the address information is resent to the first device through the target gateway until the second response information is received. If the second response information is received within the second preset time, no changes are made. This can be understood as the host computer entering an acknowledgment (ACK) mode after sending information. Once the device receives the ACK, it exits the waiting mode and runs other programs. If an ACK is not received within a fixed time (e.g., 3ms), the device will resend the data.

[0075] In an optional embodiment of the present invention, the step of resending the address information to the first device through the target gateway until the second response information is received if the second response information is not received within the second preset time further includes: determining whether the number of times the address information is resent to the first device through the target gateway until the address information is received exceeds a preset threshold; if the number of times exceeds the preset threshold, stopping the sending of the address information to the first device through the target gateway.

[0076] In this embodiment, the preset threshold is pre-set and is not limited here. As an example, the preset threshold can be 3 times.

[0077] It should be noted that if the number of times exceeds a preset threshold, the transmission of the address information to the first device through the target gateway will be stopped. This can be understood as follows: if no ACK is received after three transmissions, it is considered that the current network communication is very congested or the data receiving device does not exist, and the transmission of the frame is abandoned.

[0078] It should be noted that, to ensure reliable transmission of wireless module data, a Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA) mechanism and a three-time network retransmission mechanism are used for packet loss data transmission. In the CSMA-CA mechanism, the module and gateway listen to the channel to check if it is idle before sending wireless data. CSMA-CA is based on the Received Signal Strength Indication (RSSI) value and a programmable threshold. In this invention, the wireless signal threshold is set to -80dBm according to the actual communication conditions. When the wireless signal strength in the air is lower than this threshold, it indicates that there is no wireless data being transmitted in the air.

[0079] Because wireless signals have a center frequency, the radio wave strength varies with each data transmission, making it impossible to completely avoid air collisions using the CSMA-CA mechanism. When a collision occurs, a message retransmission mechanism is needed to ensure reliable data transmission and guarantee that each transmitted data is received by the target module.

[0080] In the protocol design, whenever a device receives wireless data, it sends an ACK frame to the sending device. A ZigBee device takes about 1ms to send a 32-byte data frame, a very short time. Therefore, we use a simple method of continuously waiting for an ACK to confirm successful data transmission. After sending data, the device enters ACK-waiting mode. Once it receives an ACK, it exits the waiting state and runs other programs. If an ACK is not received within a fixed time (e.g., 3ms), the device will resend the data. If no ACK is received after three resends, it is assumed that the network is severely congested or the receiving device does not exist, and the transmission of that frame is abandoned.

[0081] In an optional embodiment of the present invention, the method further includes: sending a first message to the first device through the target gateway; the first message is used to remove the first device from the network where the target gateway is located.

[0082] In this embodiment, the first message can be an unbinding request message. The first message is sent to the first device through the target gateway; the first message is used to remove the first device from the network where the target gateway is located. This can be understood as the host computer unbinding the wireless module by sending an unbinding request message to the first device through the target gateway.

[0083] To better understand the present invention, Figure 4 This is a schematic diagram illustrating the process of a wireless module joining a network according to an embodiment of the present invention, as shown below. Figure 4 As shown,

[0084] S1. The wireless module will broadcast a binding request to all wireless gateways.

[0085] S2. The gateway forwards the binding request to the software;

[0086] S3. Users can manually select the binding module in the graphical software, and the software will assign a short network address to the wireless module according to a specific algorithm.

[0087] S4. The gateway will send the network short address and network PANID to the wireless module to achieve binding;

[0088] S5. Once the wireless module is bound, it stops sending binding requests.

[0089] To better understand this invention, the communication content is described below. In the terminal device, the control module includes data acquisition, action execution, and power detection. The control module is responsible for controlling the wireless module to acquire data and execute actions. The communication module is responsible for the node's network access, data transmission and reception, and heartbeat processing, which is used to realize the communication between the wireless module and the wireless gateway.

[0090] This invention presents a lightweight communication protocol that reduces runtime by minimizing unnecessary system tasks and simplifies data encapsulation and parsing while maintaining a certain level of security. Furthermore, the process of data acquisition by the sensor module and action execution by the actuator module is layered according to requirements, with unused functions removed entirely. This significantly reduces the number of lines of code and improves readability and understandability. The wireless protocol of this product is built upon the Media Access Layer, simplifying the network and application layers based on a layered approach.

[0091] In the entire wireless network system, there are three types of data involved: numeric, Boolean, and array, as detailed in Table 1. Table 1 shows the specific information of the data types. Since all data in wireless communication is transmitted byte by byte, using integer data for communication is the most convenient. Therefore, when selecting the module data type, numeric types should be used as much as possible, and the module data should be normalized to 0-1000 (numeric type), requiring 2 bytes in length. Array data contains three numeric or Boolean elements, requiring 6 bytes.

[0092]

[0093] Table 1

[0094] The sensor module collects and transmits data, while the actuator module parses commands and executes actions; this is part of the module control section. This control section uses the `handleRfData()` and `handleModule()` functions. The `handleRfData()` function parses the radio frequency data and sets the parameter values ​​of the wireless module, while the `handleModule()` function controls the wireless module based on these parameter values.

[0095] The principle followed by sensor modules in transmitting wireless data is to maximize the data transmission interval and reduce airborne wireless interference without affecting data real-time performance and user experience. In this invention, some sensor modules read data via interrupts, while those that cannot be interrupted are collected every 100ms. Boolean data is transmitted whenever it changes, while numerical data transmission is determined based on changes in the data value, significantly reducing airborne wireless data transmission.

[0096] The actuator module receives data from the wireless gateway, needs to parse the data, and then executes the corresponding action. For example, a color light module might receive three types of instructions: changing the on / off state of the light, changing the brightness of the light, and changing the color of the light. Furthermore, for the same module, it might receive multiple data of the same data type but with different meanings. For instance, when a buzzer receives numerical data, it might indicate either changing the volume of the buzzer or changing the tone of the buzzer. A data index can be added to the wireless data to distinguish between them. The specific data function definition is determined by the communication protocol.

[0097] The wireless communication section of the module includes network access processing, data transmission and reception, heartbeat processing, and ACK transmission and reception. The communication module describes the communication between the wireless module and the wireless gateway. Communication between gateways, between the gateway and the host computer, and between the module and the gateway are similar and will not be described here. Communication data is transmitted in frames at the network layer. Each frame contains a frame control field and a data payload. The frame control field includes a frame header (0xAA), a frame trailer (0xDD), and a protocol version number (version). The current version number is 0x01 (version 1). The frame data structure is shown in Table 2.

[0098]

[0099] Table 2

[0100] 1) Network Entry Processing: Upon power-up, the wireless module broadcasts a network entry binding request to the wireless gateway, requesting to join the network. The binding request includes the module's unique ID (6 bytes), module type, and a {r, g, b} combination of the module binding indicator light. When {r, g, b} is {1, 0, 0}, the corresponding indicator light is red, facilitating the differentiation and binding of multiple identical modules in the host computer's graphical programming software. `len` represents the length of the payload data. The payload data for the binding request is shown in Table 3, which illustrates the structure of the payload data for the binding request.

[0101] len 0x21 ID(6) type red green blue

[0102] Table 3

[0103] When the host computer binds or unbinds the module, the gateway will forward the corresponding binding information to the wireless module, as shown in Table 4. Table 4 shows the structure of the binding information, which specifically includes the binding command, the module's unique ID, the network short address assigned to the module (2 bytes), and the wireless network's PANID (2 bytes). 0x81 represents the binding command, and 0x82 represents the unbinding command. SA(2) represents the network short address (2 bytes).

[0104] len 0x81 / 0x82 ID(6) SA(2) PANID(2)

[0105] Table 4

[0106] 2) Data transmission and reception: The sensor module collects information about the environment or the status of the module. When the data collected by the module changes, it will send data to the gateway, as shown in Table 5. Table 5 shows the structure of the data sent to the gateway when the data collected by the module changes. Specifically, it includes the module address, data type, data sequence number and specific data information. data.type is the data type, data.index is the data index, and Data is the actual useful data.

[0107] len 0x22 SA(2) data.type data.index Data(data.length)

[0108] Table 5

[0109] The wireless module also receives data sent by the gateway. Its data format is basically the same as the data format sent by the wireless module, as shown in Table 6. Table 6 shows the structure of the data sent by the gateway to the wireless module.

[0110] len 0x01 SA(2) data.type data.index Data(data.length)

[0111] Table 6

[0112] 3) Heartbeat Processing: After the wireless module is bound to the host computer software, it needs to maintain a persistent connection with the software to inform the host computer that the module is still online. Otherwise, the host computer cannot determine whether the wireless module is online and cannot provide user-friendly prompts in the host computer software interface. This invention uses a heartbeat mechanism to achieve a persistent connection. The module sends heartbeat data to the host computer every 2-3 seconds at random intervals. The heartbeat data only includes the module's network address, as shown in Table 7. Table 7 shows the structure of the heartbeat data.

[0113] len 0x23 SA(2)

[0114] Table 7

[0115] 4) ACK Transmission and Reception: When the wireless module and wireless gateway receive data, they must send an ACK response to each other to indicate that the wireless data has been successfully received and does not need to be retransmitted, thus reducing the occupancy of the air channel. When the second byte of the payload data is 0xFF, it indicates that the frame data is an ACK.

[0116] Based on the same inventive concept as described above Figure 5 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present invention. The device 500 includes: an acquisition unit 501, a determination unit 502, a networking unit 503, a receiving unit 504, and an access unit 505.

[0117] The acquisition unit 501 is used to acquire the first identifier of the network to which the first device, including the wireless module, belongs.

[0118] The determining unit 502 is configured to determine, based on the first identifier, a second identifier of the network to which the second device associated with the first device belongs;

[0119] The networking unit 503 is used to network the first device and the second device based on the first identifier and the second identifier;

[0120] The receiving unit 504 is used to receive first request information sent by the first device; the first request information is used to obtain address information allocated to the wireless module by the target gateway corresponding to the second device;

[0121] The access unit 505 is used to connect the first device to the network where the target gateway is located based on the address information.

[0122] In some embodiments, the receiving unit 504 is further configured to receive a third identifier sent by a first gateway among at least one gateway; send second request information to a second gateway among the at least one gateway based on the third identifier; the second gateway is another gateway among the at least one gateway besides the first gateway; receive first response information from the second gateway based on the second request information; the first response information is used to update the third identifier and resend the second request information.

[0123] In some embodiments, the device 500 further includes a determination unit, configured to determine whether the first response information is received within a first preset time; if the first response information is not received within the first preset time, the third identifier is not updated; if the first response information is received within the first preset time, the third identifier is updated.

[0124] In some embodiments, the apparatus 500 further includes a sending unit for sending the address information to the first device through the target gateway; the address information is used by the first device to access the network where the target gateway is located.

[0125] In some embodiments, the determining unit is further configured to determine whether a second response information is received within a second preset time; if the second response information is not received within the second preset time, the address information is resent to the first device through the target gateway until the second response information is received; if the second response information is received within the second preset time, no changes are made.

[0126] In some embodiments, the determining unit is further configured to determine whether the number of times the address information is resent to the first device through the target gateway until the address information is received exceeds a preset threshold; if the number of times exceeds the preset threshold, the unit stops sending the address information to the first device through the target gateway.

[0127] In some embodiments, the sending unit is further configured to send a first message to the first device through the target gateway; the first message is used to remove the first device from the network where the target gateway is located.

[0128] It should be noted that the communication device provided in the embodiments of the present invention and the communication method provided in the aforementioned embodiments of the present invention belong to the same inventive concept. The meanings of the terms appearing here have been explained in detail above and will not be repeated here.

[0129] This invention also provides a storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] This invention also provides a communication device, which includes a processor and a memory for storing a computer program that can run on the processor, wherein when the processor runs the computer program, it executes the steps of the method embodiments described above stored in the memory.

[0131] Figure 6 This is a schematic diagram of a hardware structure of a communication device according to an embodiment of the present invention. The communication device 600 includes at least one processor 601 and a memory 602. Optionally, the communication device 600 may further include at least one communication interface 603. The various components in the communication device 600 are coupled together through a bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6 The general designated all buses as Bus System 604.

[0132] It is understood that memory 602 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), magnetic 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), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 602 described in this embodiment of the invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0133] The memory 602 in this embodiment of the invention is used to store various types of data to support the operation of the communication device 600. Examples of such data include any computer program for operation on the communication device 600, and programs implementing the methods of this embodiment of the invention may be included in the memory 602.

[0134] The methods disclosed in the above embodiments of the present invention can be applied to processor 601, or implemented by processor 601. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present invention can be directly manifested as execution by a hardware decoding processor, or execution 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. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method.

[0135] In an exemplary embodiment, the communication device 600 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the methods described above.

[0136] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods 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 components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described above as separate components may or may not be physically separated, and 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 can be selected to achieve the purpose of this embodiment according to actual needs. In addition, all functional units in the various embodiments of this invention 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.

[0137] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.

Claims

1. A communication method, characterized in that, Applied to Internet of Things (IoT) systems, the method includes: The host computer obtains the first identifier of the network to which the first device, including the wireless module, belongs; Based on the first identifier, determine the second identifier of the network to which the second device associated with the first device belongs; The first device and the second device are networked based on the first identifier and the second identifier; The system receives a first request message sent by the first device through at least one gateway; the first request message is used to obtain address information assigned to the wireless module by the target gateway corresponding to the second device. Based on the address information, the first device is connected to the network where the target gateway is located; The method includes: Receive a third identifier sent by the first gateway in at least one of the gateways; A second request message is sent to a second gateway among the at least one gateway based on the third identifier; the second gateway is another gateway among the at least one gateway besides the first gateway. The second gateway receives a first response based on the second request information; the first response is used to update the third identifier and resend the second request information.

2. The method according to claim 1, characterized in that, The method includes: Determine whether the first response information is received within a first preset time period; If the first response information is not received within the first preset time, the third identifier will not be updated; If the first response information is received within the first preset time, the third identifier is updated.

3. The method according to claim 1, characterized in that, The step of connecting the first device to the network where the target gateway is located based on the address information includes: The address information is sent to the first device through the target gateway; the address information is used by the first device to access the network where the target gateway is located.

4. The method according to claim 3, characterized in that, After sending the address information to the first device through the target gateway, the method includes: Determine whether a second response message has been received within a second preset time. If the second response information is not received within the second preset time, the address information is resent to the first device through the target gateway until the second response information is received. If the second response information is received within the second preset time, no changes will be made.

5. The method according to claim 4, characterized in that, The step of resending the address information to the first device through the target gateway until the second response information is received if the second response information is not received within the second preset time also includes: Determine whether the number of times the address information is resent to the first device through the target gateway until the address information is received exceeds a preset threshold; If the number of times exceeds a preset threshold, the transmission of the address information to the first device through the target gateway will be stopped.

6. The method according to claim 1, characterized in that, The method further includes: The first message is sent to the first device through the target gateway; the first message is used to remove the first device from the network where the target gateway is located.

7. A communication device, characterized in that, The device, applicable to Internet of Things (IoT) systems, includes: an acquisition unit, a determination unit, a networking unit, a receiving unit, and an access unit. The acquisition unit is used by the host computer to acquire the first identifier of the network to which the first device, including the wireless module, belongs. The determining unit is configured to determine, based on the first identifier, a second identifier of the network to which the second device associated with the first device belongs; The networking unit is used to network the first device and the second device based on the first identifier and the second identifier; The receiving unit is configured to receive a first request information sent by the first device; the first request information is used to obtain address information allocated to the wireless module by the target gateway corresponding to the second device; The access unit is used to connect the first device to the network where the target gateway is located based on the address information; The receiving unit is further configured to receive a third identifier sent by a first gateway among at least one gateway; send a second request message to a second gateway among at least one gateway based on the third identifier; the second gateway is another gateway among at least one gateway besides the first gateway; receive a first response message from the second gateway based on the second request message; the first response message is used to update the third identifier and resend the second request message.

8. A storage medium, characterized in that, The storage medium stores a computer program; when the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

9. A communication device, characterized in that, The communication device includes: a processor and a memory for storing a computer program capable of running on the processor, wherein, when the processor runs the computer program, it performs the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Equipment binding method and device of smart home system and storage medium

    CN110971495A

  • Multi-agent management method and architecture based on Internet of Things, equipment and storage medium

    CN113194012A