Gateway instruction retransmission method based on ZigBee communication

By querying the status of wake-up controlled devices in the gateway and processing data transmission according to set conditions, it solves the problem of invalid overhead and resource competition caused by signal instability, and improves data processing efficiency and user experience.

CN118694623APending Publication Date: 2024-09-24ULTIMATE IOT (HENAN) TECHNOLOGY LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310299462.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the existing technology, the retransmission mechanism for wake-up controlled devices with unstable signals may increase the ineffective overhead of the gateway and cause resource competition problems for other controlled devices with normal communication.

Method used

When the gateway needs to send data to a wake-up controlled device, it first queries its wake-up status, and only performs data transmission and reply processing in the wake-up status to avoid invalid re-transmission; delete the corresponding control data after receiving the reply data; if it needs to be repeated Send, determine the device wake-up status and then resend; at the same time, process multiple pieces of data according to the set interval, perform frame type analysis and data accumulation processing, and optimize data transmission and storage.

Benefits of technology

It reduces the gateway's ineffective overhead and resource competition, improves data processing efficiency and user experience, and reduces equipment damage and storage pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694623A
    Figure CN118694623A
Patent Text Reader

Abstract

The invention discloses a gateway instruction retransmission method based on ZigBee communication, and the method comprises the following steps: S1, when a gateway has data which needs to be issued to controlled equipment, if the controlled equipment to which the data needs to be issued is awakening type controlled equipment, querying the awakening state of the awakening type controlled equipment, and if the controlled equipment is awakened, issuing the data; otherwise, waiting for waking up and then issuing data. S2, after the data are issued, the gateway receives reply data of the equipment within T1 time, and corresponding data are deleted; otherwise, the awakening state is judged again, and retransmission is correspondingly carried out. If the retransmitted data aims at the awakening type controlled equipment, whether the awakening type controlled equipment is in the awakening state needs to be judged again, so that the situation that the control data is sent to the awakening type controlled equipment which is awakened to be closed all the time is avoided; the invalid overhead of the gateway is increased, and unnecessary resource competition between the awakening type controlled device which is awakened and closed and other controlled devices which communicate normally is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of smart home, and in particular relates to a gateway instruction retransmission method based on ZigBee communication. Background Art

[0002] In the process of controlling the controlled devices in the smart home system, there is always the situation that the controlled devices receive unstable signals. For ZigBee controlled devices with unstable signals, the gateway generally resends the data.

[0003] When the gateway receives control data from the APP or the cloud, it stores and forwards it to the ZigBee controlled device coordinator. If the gateway receives reply data forwarded by the ZigBee coordinator within a certain period of time, the corresponding control data will be discarded; otherwise, the control data will be resent to the ZigBee coordinator until the reply data is received. However, if the controlled device controlled by the control data is a wake-up type controlled device (the controlled device receives and processes messages during the window period, and does not receive messages during the non-window period), the gateway keeps resending the control data, which increases the invalid overhead of the gateway, and this situation will cause resource competition for other controlled devices with normal communication.

[0004] In summary, the existing technology has the problem that the retransmission mechanism for the wake-up type controlled device with unstable signal may increase the invalid overhead of the gateway and cause resource competition for other controlled devices with normal communication. Summary of the invention

[0005] The purpose of the present invention is to provide a gateway instruction retransmission method based on ZigBee communication to solve the technical problem in the prior art that the retransmission mechanism for wake-up controlled devices with unstable signals may increase the invalid overhead of the gateway and cause resource competition for other controlled devices with normal communication.

[0006] To achieve the above object, the present invention provides a technical solution for a gateway instruction retransmission method based on ZigBee communication: a gateway instruction retransmission method based on ZigBee communication comprises the following steps:

[0007] Step S1, when the gateway has data to be sent to the controlled device, if the controlled device to which the data needs to be sent is a wake-up type controlled device, the sent data is cached and the wake-up state of the wake-up type controlled device is queried. If it has been awakened, the data is sent. Otherwise, when the wake-up type controlled device is in the awakened state, the data is sent;

[0008] Step S2: After sending the data, if the gateway receives the reply data from the wake-up type controlled device within T1, the corresponding control data will be deleted from the gateway; otherwise, the data will be stopped and resent first. If resent is required, it will be determined again whether the wake-up type controlled device is in the awakened state. If it is awakened, the gateway will resend the corresponding data. Otherwise, it will wait until the controlled device is in the awakened state before resending.

[0009] If the resent data is for a wake-up controlled device, it is necessary to determine again whether the wake-up controlled device is in the wake-up state, to avoid sending control data to the wake-up controlled device with the wake-up function turned off, which increases the invalid overhead of the gateway and avoids unnecessary resource competition between the wake-up controlled device with the wake-up function turned off and other controlled devices with normal communication. When the gateway receives the reply data, the corresponding control data is deleted from the gateway, reducing the storage requirements of the gateway.

[0010] As a further improvement, the wake-up state of the wake-up type controlled device is determined by the gateway according to the wake-up signal reported by the wake-up type controlled device.

[0011] The beneficial effect is that the state of the gateway wake-up controlled device is determined by judging whether the device has been actively or passively awakened according to the wake-up signal reported by the wake-up controlled device, thereby solving the problem of how the gateway queries the state of the wake-up controlled device.

[0012] As a further improvement, when the gateway receives two or more pieces of data that need to be sent, the gateway needs to send them to the controlled device in sequence according to an interval time that is greater than or equal to a set time interval.

[0013] The beneficial effect is that when the interval between two or more data received by the gateway is less than the set interval, the gateway sends them according to the set interval. This avoids the problem of the controlled device receiving multiple data in a short period of time and being difficult to process, causing damage to the device, and also ensures that the device can accurately process each data sent.

[0014] As a further improvement, when the gateway receives data that needs to be reported, it is necessary to parse the frame type according to the subject carried by the reported data to classify the reported data, and report the data through different data ports.

[0015] The beneficial effect is that frame type analysis is to classify frame data according to the identification data contained in the frame header of the data frame. Classifying the data and uploading it from different ports reduces the need for the receiving party to classify each received data. The receiving party can also preset data processing modes according to different data types, thereby improving the receiving party's ability to process data and shortening the time it takes to process data.

[0016] As a further improvement, when the data accumulation of a certain data port exceeds a fixed value of X pieces, the gateway extracts the frame content of Y pieces of reported data in the same topic, and combines the Y frame contents with a frame header to form a frame of data for reporting.

[0017] The beneficial effect is that when a large amount of data is received within a period of time and cannot be processed in time, the data response time is affected and the user experience is reduced. In view of the above situation, judging whether the data accumulation exceeds X is to judge whether a large amount of data has been accumulated at present. If it exceeds, it is necessary to combine Y frame contents with a frame header to form a frame of data for reporting, which improves the data processing capability of the gateway and reduces the pressure of data storage on the gateway.

[0018] As a further improvement, the judgment of stopping retransmission is: when the number of retransmissions of a certain sent data exceeds a preset number, the gateway deletes the data and does not retransmit it. Determining whether to stop retransmission based on the number of retransmissions and deleting unsuccessful retransmission data reduces the memory and running memory overhead of the gateway.

[0019] As a further improvement, the judgment of stopping retransmission is: when the retransmission time of a certain sent data exceeds a predetermined time, the gateway deletes the data and does not retransmit it. Whether to stop retransmission is determined based on the retransmission time length, and deleting the data that is not successfully retransmitted reduces the memory and running memory overhead of the gateway.

[0020] As a further improvement, when the moment when the gateway receives the wake-up signal + the wake-up window time preset for the wake-up type controlled device is greater than the current moment, the wake-up type controlled device is in the wake-up state at the current moment; when the moment when the gateway receives the wake-up signal + the wake-up window time preset for the wake-up type controlled device is less than or equal to the current moment, the wake-up type controlled device is in the wake-up closed state at the current moment.

[0021] The problem of whether the gateway determines whether the wake-up type controlled device is in the wake-up state is solved. Based on the time when the gateway receives the wake-up signal and the preset wake-up window time of the wake-up type controlled device, the gateway can determine the state of the wake-up type controlled device by receiving a signal combined with its own stored data. This ensures that the gateway can know the time when the wake-up type controlled device wakes up and closes in advance.

[0022] As a further improvement, when the gateway receives a wake-up signal, the wake-up type controlled device is in the wake-up state; when the gateway receives a wake-up shutdown signal, the wake-up type controlled device is in the wake-up shutdown state.

[0023] The gateway determines the wake-up and shut-down time of the wake-up type controlled device based on the wake-up signal and the wake-up shut-down signal. The gateway receives the two data in real time and determines whether the wake-up type controlled device is in the wake-up state relative to the previous gateway. There is no need to store preset data to reduce the gateway storage overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 The present invention is a flow chart of a gateway instruction retransmission method based on ZigBee communication. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0026] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0027] An embodiment of a gateway instruction retransmission method based on ZigBee communication:

[0028] like Figure 1 The gateway instruction resending method based on ZigBee communication shown includes the following steps:

[0029] Step S1: When the user sends the control data of the ZigBee device through the APP or the cloud, the gateway receives the sent data through MQTT and puts the sent data into the data buffer to be sent. At this time, if the controlled device to which the data needs to be sent is a wake-up type controlled device, the sent data is cached and the wake-up status of the wake-up type controlled device is queried. The wake-up status of the wake-up type controlled device is determined by the gateway based on the wake-up signal reported by the wake-up type controlled device. The controlled device corresponding to the sent data is determined by the identifier and device address carried by the data frame header.

[0030] If the controlled device has been awakened, the gateway sends the control data to the controlled device through the ZigBee coordinator;

[0031] If the controlled device sent down is not awake, the gateway waits until the awakening type controlled device is in the awake state, and then the gateway sends the control data to the controlled device through the ZigBee coordinator.

[0032] Step S2, after sending data, when the data sending time is more than the set time threshold T1 from the current time, if the gateway receives the reply data of the wake-up type controlled device, it determines whether it is corresponding data by comparing the identifiers of the reply data and the control data. If the identifiers are consistent, the two data are corresponding data to each other, otherwise, continue to compare the identifiers of other data to find the corresponding control data of the reply data, and delete the corresponding control data from the gateway; if no reply data is received, the gateway determines whether the stop retransmission condition is met. If it is determined not to stop retransmission, first determine the type of control device corresponding to the retransmitted data. If the retransmitted data is for the wake-up type controlled device, it is necessary to determine again whether the wake-up type controlled device is in the wake-up state, so as to avoid sending control data to the wake-up type controlled device with the wake-up turned off all the time, increase the invalid overhead of the gateway and avoid unnecessary resource competition between the wake-up type controlled device with the wake-up turned off and other controlled devices with normal communication; if the retransmitted data is for a conventional device, the data is sent directly. If it is determined to stop retransmission, the gateway deletes the corresponding control data. Preferably, the time threshold T1 is set to 1s.

[0033] When the gateway receives two or more pieces of data to be sent, the gateway needs to send them to the controlled devices in sequence according to the set interval time. Preferably, the interval data is 100ms.

[0034] When the gateway receives data that needs to be reported, it needs to parse the frame type according to the subject carried by the reported data to classify the reported data, and report the data through different data ports. When data is reported through different data ports, each frame of data may contain multiple frames of the same type of data at a time, so as to reduce the number of data encryption and decryption and the number of transmissions, reduce system consumption and improve efficiency.

[0035] When the data accumulation of a certain data port exceeds the fixed value of X pieces, the gateway extracts the frame content of Y pieces of reported data in the same topic, and combines the Y frame contents with a frame header to form a frame of data for reporting. Combining to form a frame of data for reporting reduces the number of data encryption and decryption times and the number of MQTT sending times, reduces system consumption, and improves efficiency.

[0036] The above embodiments involve the gateway determining to stop retransmission and the gateway determining the state of the awakened controlled device, and one of the following methods can be selected for data processing according to the scenario.

[0037] The gateway determines how to stop retransmission:

[0038] Method 1: When the number of retransmissions of a certain sent data exceeds the preset number, the gateway deletes the data in the data buffer and does not retransmit it.

[0039] Method 2: When the retransmission time of a certain sent data exceeds the preset time, the gateway deletes the data in the data buffer and does not retransmit it.

[0040] Method 1 is based on the number of retransmissions; method 2 is based on the retransmission time.

[0041] The method by which the gateway determines the status of the wake-up controlled device:

[0042] Method 1: When the time when the gateway receives the wake-up signal + the preset wake-up window time of the wake-up type controlled device is greater than the current time, the wake-up type controlled device is in the wake-up state at the current time; when the time when the gateway receives the wake-up signal + the preset wake-up window time of the wake-up type controlled device is less than or equal to the current time, the wake-up type controlled device is in the wake-up closed state at the current time.

[0043] Method 2: When the gateway receives a wake-up signal, the wake-up type controlled device is in the wake-up state; when the gateway receives a wake-up shutdown signal, the wake-up type controlled device is in the wake-up shutdown state.

[0044] Method 1 can predict the non-awakening shutdown time of the wake-up type controlled device in advance; Method 2 does not need to cache the wake-up window time of the wake-up type controlled device in the gateway.

[0045] The above method solves the problem that the retransmission mechanism of the wake-up controlled device with unstable signal may increase the invalid overhead of the gateway and cause resource competition for other controlled devices with normal communication, thereby reducing the gateway overhead and the probability of failure to send messages to devices with unstable signals.

[0046] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments without creative work, or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A gateway instruction retransmission method based on ZigBee communication, characterized in that: The method comprises the following steps: Step S1, when the gateway has data to be sent to the controlled device, if the controlled device to which the data needs to be sent is a wake-up type controlled device, the sent data is cached and the wake-up state of the wake-up type controlled device is queried. If it has been awakened, the data is sent. Otherwise, when the wake-up type controlled device is in the awakened state, the data is sent; Step S2: After sending the data, if the gateway receives the reply data from the wake-up type controlled device within T1, the corresponding control data will be deleted from the gateway; otherwise, the data will be stopped and resent first. If resent is required, it will be determined again whether the wake-up type controlled device is in the awakened state. If it is awakened, the gateway will resend the corresponding data. Otherwise, it will wait until the controlled device is in the awakened state before resending.

2. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: The wake-up state of the wake-up type controlled device is determined by the gateway according to the wake-up signal reported by the wake-up type controlled device.

3. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: When the gateway receives two or more pieces of data that need to be sent, the gateway needs to send them to the controlled devices in sequence according to the set interval time.

4. The gateway instruction retransmission method based on ZigBee communication according to claim 2, characterized in that: When the gateway receives data that needs to be reported, it needs to parse the frame type according to the subject carried by the reported data to classify the reported data, and report the data through different data ports.

5. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: When the data accumulation of a certain data port exceeds a fixed value of X pieces, the gateway extracts the frame content of Y pieces of reported data in the same topic, and combines the Y frame contents with a frame header to form a frame of data for reporting.

6. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: The judgment of stopping retransmission is: when the number of retransmissions of a certain sent data exceeds a preset number, the gateway deletes the data and does not retransmit it.

7. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: The judgment of stopping retransmission is: when the retransmission time of a certain sent data exceeds a predetermined time, the gateway deletes the data and does not retransmit it.

8. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: When the time when the gateway receives the wake-up signal + the preset wake-up window time of the wake-up type controlled device is greater than the current time, the wake-up type controlled device is in the wake-up state at the current time; when the time when the gateway receives the wake-up signal + the preset wake-up window time of the wake-up type controlled device is less than or equal to the current time, the wake-up type controlled device is in the wake-up closed state at the current time.

9. The gateway instruction retransmission method based on ZigBee communication according to claim 1, characterized in that: When the gateway receives a wake-up signal, the wake-up type controlled device is in the wake-up state; when the gateway receives a wake-up shutdown signal, the wake-up type controlled device is in the wake-up shutdown state.