CN114364000A - Single-fire switch control method and device - Google Patents

Single-fire switch control method and device Download PDF

Info

Publication number
CN114364000A
CN114364000A CN202111506277.8A CN202111506277A CN114364000A CN 114364000 A CN114364000 A CN 114364000A CN 202111506277 A CN202111506277 A CN 202111506277A CN 114364000 A CN114364000 A CN 114364000A
Authority
CN
China
Prior art keywords
data
fire switch
single fire
preset
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111506277.8A
Other languages
Chinese (zh)
Other versions
CN114364000B (en
Inventor
钟晨
聂仙忠
张丞鑫
曹佳丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Green Carbon Intelligent Building Hangzhou Co ltd
Zhejiang Huiju Intelligent Internet Of Things Co ltd
Original Assignee
Zhejiang Huiju Intelligent Internet Of Things Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huiju Intelligent Internet Of Things Co ltd filed Critical Zhejiang Huiju Intelligent Internet Of Things Co ltd
Priority to CN202111506277.8A priority Critical patent/CN114364000B/en
Publication of CN114364000A publication Critical patent/CN114364000A/en
Application granted granted Critical
Publication of CN114364000B publication Critical patent/CN114364000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application discloses a single fire switch control method and a single fire switch control device, which comprise the following steps: receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval; if the single fire switch is in a receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the report data. The problem of prior art can't realize that single fire switch whole house intelligent transformation and LoRaWAN low-power consumption and real-time can not directly be applied to single fire intelligence switch and LoRaWAN interactive response control time overlength is solved in this application.

Description

Single-fire switch control method and device
Technical Field
The application relates to the technical field of battery switches, in particular to a single-fire switch control method and device.
Background
At present, wireless single-fire intelligent switches on the market can only be subjected to small-range and localized intelligent transformation, and because of the defect of the communication distance of the applied existing communication technology, the whole-house intelligent transformation is realized by relays, the adopted technology is realized by taking the intelligent switches as relays, but the power consumption requirements of the intelligent switches as the relays can not be met under the condition of single-fire power supply, and the intelligent transformation and upgrading of the whole-house wireless single-fire intelligent switches can not be realized.
Because the LoRa physical layer coverage is wide, the communication stability is good, and LoRaWAN protocol architecture is simple moreover, satisfies most thing networking application, so LoRaWAN has covered a plurality of countries and regions as low-power consumption wide area network communication protocol.
However, currently, CLASS a of LoRaWAN cannot be applied to a system requiring a real-time control response, and CLASS C cannot be applied to a system requiring low power consumption. And the current LoRaWAN interactive response control time is too long, so that the LoRaWAN interactive response control method is not suitable for being directly applied to the field of wireless intelligent single-fire switches.
Therefore, the problem that the prior art cannot realize full-house intelligent transformation of the single-fire switch, the low power consumption and the real-time performance of LoRaWAN cannot be directly applied to the single-fire intelligent switch and the problem that the interaction response control time of LoRaWAN is too long is urgently needed.
Disclosure of Invention
The application provides a single-fire switch control method and a single-fire switch control device, which are used for solving the problems that the prior art cannot realize the whole-house intelligent transformation of a single-fire switch, the LoRaWAN low power consumption and the instantaneity cannot be directly applied to the single-fire intelligent switch, and the LoRaWAN interactive response control time is too long.
In view of the above, a first aspect of the present application provides a single fire switch control method, including:
receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
and if the single fire switch is in the receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters the dormant state after returning the confirmation character and the report data.
Optionally, the method further includes:
if the single fire switch cannot receive the downlink data in the preset second time interval of the whole receiving state, the gateway continuously sends the downlink data to the single fire switch until the single fire switch enters the receiving state again;
and the single fire switch immediately returns the confirmation character and the reported data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the reported data.
Optionally, if the interval time from the end of the receiving state is less than a preset third time interval when the downlink data is received by the single fire switch, extending the preset second time interval of the current receiving state to a preset fourth time interval;
after the single fire switch replies the confirmation character and the reported data within the preset fourth time interval, immediately entering the dormant state after replying the confirmation character and the reported data;
and if the confirmation character and the reported data are not replied by the single fire switch in the preset fourth time interval, immediately entering the dormant state after the preset fourth time interval is finished.
Optionally, the single fire switch uploads the reported data to the gateway;
the gateway replies a confirmation character to the single fire switch after receiving the reported data and sends the reported data to a server;
the single live switch enters a dormant state after receiving the confirmation character replied by the gateway, and waits for uploading the reported data next time;
and when the gateway receives the downlink data issued by the server, the gateway stores the downlink data until the reported data uploaded by the single fire switch is received again, and the confirmation characters and the downlink data are packaged and replied to the single fire switch.
Optionally, detecting a current network state;
when network congestion is detected, a newly generated data mark to be uploaded is inquired in real time;
if a newly generated data mark to be uploaded is inquired and the temporary storage queue is not fully loaded, storing the newly generated data to be uploaded into the temporary storage queue according to a first-in first-out sequence and updating the state of the temporary storage queue;
and if the to-be-uploaded data mark is inquired and the queue is fully loaded, stopping the ongoing retransmission timeout timing, clearing the waiting confirmation character, and covering the to-be-uploaded data with the earliest data in the temporary storage queue.
Optionally, the method further includes:
401. inquiring whether a data sending mark exists;
402. if the data to be uploaded exists in the temporary storage queue, popping the data to be uploaded out of the temporary storage queue according to a first-in first-out principle, sending the data to be uploaded to a gateway, and updating the state of the current temporary storage queue;
403. inquiring whether the confirmation character is received, if the confirmation character is received, returning to the step 401;
404. if the confirmation character is not received, inquiring an overtime retransmission mark;
405. if receiving the overtime retransmission mark, judging whether the current retransmission times reach the preset uploading times or not;
406. if the retransmission times do not reach the preset uploading times, retransmitting the data to be uploaded to the gateway, and updating the state of the temporary storage queue; and when the retransmission times reach the preset uploading times, stopping sending the current pop-up data, and returning to the step 401.
A second aspect of the present application provides a single fire switch control device, the device comprising:
the first receiving unit is used for receiving downlink data issued by the server through the gateway, and if the single fire switch is in a dormant state, the downlink data cannot be received; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
and the second receiving unit is used for returning the confirmation characters and the report data to the gateway immediately after the single fire switch receives the downlink data and entering the dormant state immediately after returning the confirmation characters and the report data when the single fire switch is in the receiving state.
Optionally, the method further includes:
the issuing unit is used for continuously sending the downlink data to the single fire switch by the gateway when the single fire switch cannot receive the downlink data in the preset second time interval of the whole receiving state until the single fire switch enters the receiving state again;
and the return unit is used for immediately returning the confirmation character and the report data to the gateway after the single fire switch receives the downlink data, and immediately entering a dormant state after returning the confirmation character and the report data.
Optionally, the method further includes:
the extension unit is used for extending the preset second time interval of the current receiving state to a preset fourth time interval when the interval time from the end of the receiving state is less than a preset third time interval when the single fire switch finishes receiving the downlink data;
the reply unit is used for entering the dormant state immediately after the confirmation character and the reported data are replied after the single fire switch replies the confirmation character and the reported data within the preset fourth time interval;
and the dormancy unit is used for entering the dormant state immediately after the preset fourth time interval is finished when the single fire switch does not finish replying the confirmation character and the reported data in the preset fourth time interval.
According to the technical scheme, the method has the following advantages:
the application provides a single fire switch control method, which comprises the following steps: receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval; if the single fire switch is in a receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the report data.
This application is through the dormant state and the receipt state of rational distribution single fire switch for, single fire switch can maintain shorter receipt state and longer dormant state always, when making single fire switch can guarantee the long continuation of the journey of low-power consumption, maintains higher real-time, thereby guarantees single fire switch's use satisfaction.
Drawings
FIG. 1 is a method flow diagram of one embodiment of a single fire switch control method of the present application;
FIG. 2 is a method flow diagram of another embodiment of a single fire switch control method of the present application;
FIG. 3 is an interaction timing diagram of another embodiment of a single hot switch control method of the present application;
FIG. 4 is an interaction timing diagram illustrating the uploading of data to a server by a single hot switch according to an embodiment of the present disclosure;
FIG. 5 is an interaction timing diagram of an embodiment of the present application;
FIG. 6 is a program flow diagram of one embodiment of the present application;
FIG. 7 is a flowchart of a process for combining low power consumption and real-time control in one embodiment of the present application;
FIG. 8 is a flow chart illustrating data enqueuing in a FIFO queue according to an embodiment of a single fire switch control method of the present application;
FIG. 9 is a flow chart illustrating dequeuing of FIFO queue data according to an embodiment of a single fire switch control method of the present application;
fig. 10 is a schematic diagram of a system framework based on a modified LoRaWAN battery switch in an embodiment of the present application;
fig. 11 is a schematic structural diagram of an embodiment of a single fire switch control device according to the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of a method of an embodiment of a single fire switch control method according to the present application, as shown in fig. 1, where fig. 1 includes:
101. receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
it should be noted that, when the server issues data to the single fire switch, the server first issues data to the gateway, and the gateway sends the data to the single fire switch, if the single fire switch is in a dormant state, downlink data cannot be received, and the data cannot be received until the single fire switch is in a receiving state.
102. If the single fire switch is in a receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the report data.
It should be noted that, when the single fire switch is in the receiving state, the single fire switch receives the downlink data, immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters the sleep state after returning the confirmation character and the report data, so that the single fire switch can reduce the receiving time, thereby reducing the power consumption of the battery of the single fire switch, and ensuring the long endurance of the single fire switch with low power consumption. And because the single live switch has a receiving state for a certain time after each sleep period, the single live switch can ensure the real-time interaction between the single live switch and the server.
This application is through the dormant state and the receipt state of rational distribution single fire switch for, single fire switch can maintain shorter receipt state and longer dormant state always, when making single fire switch can guarantee the long continuation of the journey of low-power consumption, maintains higher real-time, thereby guarantees single fire switch's use satisfaction.
Fig. 2 is another embodiment of a single fire switch control method according to the present application, where fig. 2 includes:
201. receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
202. if the single fire switch is in a receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the report data.
203. If the single fire switch cannot receive the downlink data within the preset second time interval of the whole receiving state, the gateway continuously sends the downlink data to the single fire switch until the single fire switch enters the receiving state again;
it should be noted that, when the gateway issues downlink data to the single fire switch, if the single fire switch is in the dormant state, the gateway may continuously issue data to the single fire switch (at this time, the single fire switch does not consume power, and the data issued by the gateway is quickly received after the dormant state is ended), and when the single fire switch enters the receiving state, the downlink data is immediately received, so that the real-time performance of data interaction between the single fire switch and the server is ensured.
204. And the single fire switch immediately returns the confirmation character and the reported data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the reported data.
It should be noted that the one-fire switch can immediately return the confirmation character and the report data to the gateway after receiving the downlink data, so that the one-fire switch can complete the data reception and feedback in the reception state, and immediately enter the sleep state after returning the confirmation character and the report data, thereby ensuring the long endurance of the one-fire switch battery.
205. If the interval time from the end of the receiving state is less than the preset third time interval when the single fire switch finishes receiving the downlink data, the preset second time interval of the current receiving state is prolonged to the preset fourth time interval;
it should be noted that, in order to ensure that the one fire switch can feed back data in time to ensure real-time data interaction, a difference between a time point when the one fire switch finishes receiving the downlink data and a time point when the receiving state ends may be determined, and the difference may be compared with a preset third time interval (the preset third time interval may be set according to a time required for data reporting), and when the difference is smaller than the preset third time interval, the preset second time interval of the current receiving state is extended to a preset fourth time interval, for example, from 100ms to 150ms, so that the one fire switch may finish uploading the reported data in the preset fourth time interval.
206. After the single fire switch finishes replying the confirmation character and the report data in the preset fourth time interval, immediately entering a dormant state after finishing replying the confirmation character and the report data;
it should be noted that, in order to reduce the battery consumption, the one-fire switch may enter the sleep state immediately after the confirmation character and the report data are replied within the preset fourth time interval.
207. And if the single fire switch does not finish replying the confirmation character and the reported data in the preset fourth time interval, immediately entering a dormant state after the preset fourth time interval is finished.
It should be noted that, if the one-fire switch still does not complete sending of the reported data within the preset fourth time interval, the one-fire switch needs to be forced to enter the sleep state at this time, so as to ensure the continuous working performance of the one-fire switch.
This application is through the dormant state and the receipt state of rational distribution single fire switch for, single fire switch can maintain shorter receipt state and longer dormant state always, when making single fire switch can guarantee the long continuation of the journey of low-power consumption, maintains higher real-time, thereby guarantees single fire switch's use satisfaction.
An interaction timing diagram of another embodiment of a single fire switch control method of the present application is shown in fig. 3.
The above is an embodiment in which the server issues data to the single fire switch, and the present application also includes an embodiment in which the single fire switch uploads reported data to the server, and an interaction timing chart of the embodiment is shown in fig. 4, and includes: uploading reported data to a gateway by a single fire switch, and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies a confirmation character and downlink data to the single fire switch; the single fire switch receives the confirmation character and the downlink data in the receiving window, enters a dormant state and waits for uploading the reported data next time; if the confirmation characters and the downlink data are not received in the receiving window, uploading the reported data again after the preset time length is exceeded; after the reported data is uploaded twice, the single fire switch can enter a dormant state no matter the confirmation character and the downlink data are not received.
In a specific embodiment, the application adopts a modified LoRaWAN-based simplex switch control method, and implements an interaction process between a server and a simplex switch by using CLASS a and CLASS C modes modified by LoRaWAN, as specifically shown in fig. 5. In this embodiment, the modulation spreading factor SF may be set to 7, and the bandwidth BW may be set to 500 KHz. In the data reporting stage of the single fire switch, the response time of waiting for the gateway to reply the confirmation characters after the single fire switch sends the uploaded data is 30 ms; if the confirmation character replied by the gateway is received within 30ms after the single fire switch reports the data again, the gateway enters a dormant state; if the confirmation character is not received within 30ms, the reported data is sent to the gateway again after 30ms, and the gateway enters a sleep state after 30 ms. And after the gateway receives the reported data of the single fire switch again, the gateway packs the downlink data and the confirmation characters and replies.
And a stage of sending downlink data to a single fire switch at a server: the receiving state time of the single fire switch is 100ms between the receiving state and the sleep state. When downlink data sent by a server is transmitted to a single fire switch through a gateway, if the single fire switch is in a receiving state, the single fire switch immediately returns a confirmation character after receiving the downlink data and enters a sleep state after returning the confirmation character, wherein the duration time of the sleep state is 320 ms; if the downlink data sent by the server is transmitted to the single fire switch through the gateway, the single fire switch is in a dormant state, and the single fire switch cannot receive the downlink data; if the single fire switch cannot receive the downlink data within the interval of the preset receiving time of the whole receiving state, the gateway continuously sends the downlink data to the single fire switch until the single fire switch enters the receiving state again, after the single fire switch receives the downlink data, the single fire switch returns the confirmation characters and reports the data to the gateway, and after the confirmation characters are returned, the gateway immediately enters the dormant state.
In a specific implementation mode, when the fact that the dormant state of the single fire switch is about to end is detected, the single fire switch is still in a stage of returning confirmation characters and reported data, the receiving state is prolonged by 50ms, and if the confirmation characters and the reported data are uploaded within 50ms, the single fire switch immediately enters the dormant state after the confirmation characters and the reported data are uploaded; if the character is confirmed and the reported data are not uploaded within 50ms, the mobile terminal enters a dormant state after the 50ms is finished.
A program flow diagram of one embodiment of the present application is shown in fig. 6, and includes:
and the single fire switch inquires whether a key is pressed down or whether downlink data issued by the server is received in real time. If the key is detected to be pressed, the shaking is removed for 100ms, whether the key is pressed is detected again, if the key is still pressed, the key is pressed effectively, and otherwise, the key is invalid. And when the key is effective, triggering and judging whether the scene key is triggered or the entity loop key is triggered or the linkage double-control key is triggered. If the linkage double-control key is triggered, the physical loop relay is not actuated, because the relay consumes power. Judging whether the key is pressed for a long time or pressed for a short time, and if the key is pressed for the long time, canceling the current linkage state; and if the short press is carried out, the data is packaged and uploaded to the server at the moment, and then the terminal equipment responding to the data is controlled in a linkage mode. If the key is an entity loop key, firstly judging whether the switch is pressed for a long time or pressed for a short time, and if the key is pressed for the long time, judging to cancel the current entity loop so that the key switch is switched to a linkage control switch; if the short press is detected, the relay of the physical loop is actuated to perform on and off actions, and the current state of the loop is reported to the server, so that the data synchronization of the local switch and the server is realized. If the scene key is pressed, judging whether the key is pressed for a long time or pressed for a short time, and if the scene key is pressed for a long time, resetting the whole switch; and if the short press is carried out, directly packaging the corresponding scene loop data and reporting the scene loop data to a server, and then triggering the previously set scene control. If the data reception is detected, the data is analyzed according to a specific protocol and whether the switch is operated or not is determined, and corresponding response data is sent to the server. Therefore, switch linkage control and direct local switching of the entity loop are realized, and remote linkage and switching of the entity loop are supported according to the corresponding protocol.
In one embodiment of the present application, a low power consumption and real-time control combined program flow diagram; as shown in fig. 7, includes:
when the single fire switch is in a receiving state (wakeup)100ms state, whether data needs to be sent or not is inquired all the time, and if not, the state is up to a state that a sleep state (sleep) is needed to be entered 320 ms. If the data is found to be transmitted at this time, the type of the data is inquired. If the data type is keying data, sending confirmation data (confirm data), and if receiving a confirmation character ACK replied by the gateway, waiting to enter a dormant state; if not, the single fire switch retransmits the data, and if the retransmission data reaches twice, the sleep state is waited to enter. And if the data bit response server controls the query data, sending unconfirmed data, and directly entering a state waiting for entering a sleep state without retransmitting after the sending is finished. In order to ensure that data can respond to the server in time, the data needs to be replied immediately after the server data is received, unlike the situation that the key data can be transferred to the next report. Therefore, in order to ensure that data can be normally transmitted without being limited by 100ms wakeup time and 320ms sleep time, 50ms wakeup time needs to be added to the original 100ms wakeup time. Of course, the increase of 50ms requires consideration of the power supply capability of the one-fire switch, so that once transmission is completed within 50ms, the sleep state is directly entered, and the lamp 50ms is not required to be completely completed. If the transmission is still not finished after 50ms, the one-fire switch needs to be forced to enter a sleep state at the moment so as to ensure the continuous working performance of the one-fire switch. The diagram shows the whole single live switch data transmission process and the implementation process of low power consumption and real-time response receiving.
In a specific embodiment, the system framework of the modified LoRaWAN battery switch is shown in fig. 10, where fig. 10 includes:
STM32G030C8T6, ASR6500SLC driver, key driver, LED driver, UART driver, receiving and transmitting mechanism for correcting CLASS A mode in LoRaWAN and receiving and transmitting mechanism for correcting CLASS C mode are combined, LLCC68 (Internet of things wireless communication spread spectrum module) of SEMTECH company or ASR6500SLC (LoRa wireless communication radio frequency chip) of ASR is adopted, the performance is superior to SX1278, the sending distance is longer, the sending power consumption and the receiving power consumption are lower, and the service life of the battery switch product is longer. Wherein PWM-pulse width modulation; UART-asynchronous transceiver transmitter, SPI-serial peripheral interface protocol, RTC-real time clock. The keys comprise entity loop keys and scene keys, and comprise various combination modes, such as a 1 entity loop +1 scene, a 2 entity loop +2 scene, a 3 entity loop +3 scene, a 3 entity loop +1 scene and the like. The entity loop can be set as a linkage double-control switch, and the switch has various combinations, so that various combination modes of the linkage double-control switch, the entity loop switch and a scene key are realized, the specific combination mode is not particularly specified, and the linkage double-control switch, the entity loop switch and the scene key can be set through a server according to a predefined communication protocol, so that the remote setting of functions of linkage double control and scene increase, deletion, modification and lamp searching is realized. Local switching and remote switching between the local linkage key and the entity loop key are also realized.
The present application further provides a method for controlling a battery switch, which is based on a CLASS a transceiving mechanism modified by a LoRaWAN protocol, wherein a flow chart of data enqueuing is shown in fig. 8, where fig. 8 includes:
301. detecting a current network state;
it should be noted that, when the data sent by the battery switch is blocked due to factors such as waiting for the gateway to reply an acknowledgment character or retransmitting the acknowledgment character after time out, and the like, and at this time, when the key is pressed again or another key is pressed, newly generated data needs to be temporarily stored to ensure the continuity and reliability of the data. Therefore, the current network state needs to be detected.
302. When network congestion is detected, a newly generated data mark to be uploaded is inquired in real time;
it should be noted that when network congestion is detected, at this time, when a key is pressed again or another key is pressed, newly generated data caused by the key can be queried in real time, and since the network congestion is at this time, data of a trusted product can be stored locally.
303. If the newly generated data mark to be uploaded is inquired and the temporary storage queue is not fully loaded, storing the newly generated data to be uploaded into the temporary storage queue according to the first-in first-out sequence and updating the state of the temporary storage queue;
it should be noted that a plurality of temporary storage queues may be locally constructed, and are used to store newly generated data to be uploaded, and to eject the stored data in time when the network is restored. Specifically, when a mark of newly generated data to be uploaded is detected, whether the temporary storage queue is fully loaded at the moment is detected, if the mark is not fully loaded, the newly generated data to be uploaded are stored into the temporary storage queue according to a first-in first-out sequence, and the temporary storage queue after the newly stored data is updated.
304. If the data to be uploaded mark is inquired and the queue is full, stopping the ongoing retransmission timeout timing, clearing the waiting confirmation character, and covering the data to be uploaded with the earliest data in the temporary storage queue.
It should be noted that, when the to-be-uploaded data flag is found, if the temporary storage queue is fully loaded at this time, the ongoing retransmission timeout is stopped, the waiting acknowledgement character is cleared, and the to-be-uploaded data is overwritten on the earliest data in the temporary storage queue. Specifically, the method can set a temporary storage first-in first-out queue QueueA with the length of 5, and enqueue newly generated data. The maximum 5 times can be carried out in sequence, and when the number of times of data needing to be enqueued exceeds the set maximum number of times, a mode of covering old data is adopted at the moment so as to ensure the accuracy of the latest state of the data.
In a specific embodiment, based on the CLASS a transceiving mechanism modified by the LoRaWAN protocol, a flow chart of dequeuing data is shown in fig. 9, where fig. 9 includes:
401. inquiring whether a data sending mark exists;
it should be noted that, when the network condition is recovered, it may be queried whether a data transmission flag exists.
402. If the data to be uploaded exists, popping the data to be uploaded out of a temporary storage queue according to a first-in first-out principle, sending the data to be uploaded to a gateway, and updating the state of the current temporary storage queue;
it should be noted that, when there is a data sending flag, data to be uploaded may be popped out of the temporary storage queue according to a first-in first-out principle, that is, the earliest queued data in the temporary storage queue is popped out of the temporary storage queue and sent to the gateway; updating the state of the current temporary storage queue; at this time, the data in the temporary storage queue can be sequentially sent, and the data in the temporary storage queue is sequentially popped up and sent according to the first-in first-out principle, so that the fact that all the data in the temporary storage queue are sent is known.
403. Inquiring whether a confirmation character is received, if so, returning to the step 401;
it should be noted that, whether the battery switch receives the confirmation character returned by the gateway may be queried, and if the confirmation character is returned, step 401 may be returned to prepare for the next data transmission.
404. If the confirmation character is not received, inquiring an overtime retransmission mark;
405. if receiving the overtime retransmission mark, judging whether the current retransmission times reach the preset uploading times or not;
it should be noted that, when the confirmation character is not received, the timeout retransmission flag is queried, at this time, reference may be made to steps 401 to 403, when the timeout retransmission flag is received, it is determined whether the current retransmission number reaches the preset upload number, if the preset upload number is reached, the battery switch enters the sleep state, in this application, the maximum upload number may be set to 3, and when the number exceeds three, the upload is stopped.
406. If the retransmission times do not reach the preset uploading times, retransmitting the data to be uploaded to the gateway, and updating the state of the temporary storage queue; and when the retransmission times reach the preset uploading times, stopping sending the current pop-up data, and returning to the step 401.
It should be noted that, when the retransmission times do not reach the preset uploading times, the data to be uploaded is retransmitted to the gateway, and the state of the temporary storage queue is updated; and when the retransmission times reach the preset uploading times, stopping sending the current pop-up data, and returning to the step 401 to prepare for next data sending.
The above is an embodiment of the method of the present application, and the present application further provides an embodiment of a single fire switch control device, as shown in fig. 11, where fig. 11 includes:
a first receiving unit 501, configured to receive downlink data sent by a server through a gateway, where the downlink data is not received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
the second receiving unit 502 is configured to, when the one-fire switch is in a receiving state, immediately return the confirmation character and the report data to the gateway after the one-fire switch receives the downlink data, and immediately enter the sleep state after the confirmation character and the report data are returned.
In a specific embodiment, the method further comprises the following steps:
the gateway is used for continuously sending downlink data to the single fire switch when the single fire switch cannot receive the downlink data in a preset second time interval in which the whole receiving state is located until the single fire switch enters the receiving state again;
and the return unit is used for immediately returning the confirmation characters and the reported data to the gateway after the single fire switch receives the downlink data, and immediately entering a dormant state after the confirmation characters and the reported data are returned.
In a specific embodiment, the method further comprises the following steps:
the extension unit is used for extending the preset second time interval of the current receiving state to a preset fourth time interval when the interval time from the end of the receiving state is less than the preset third time interval when the single fire switch finishes receiving the downlink data;
the reply unit is used for entering a dormant state immediately after the confirmation character and the reported data are replied after the single fire switch replies the confirmation character and the reported data within a preset fourth time interval;
and the dormancy unit is used for entering a dormant state immediately after the preset fourth time interval is finished when the one-fire switch does not finish replying the confirmation character and reporting data in the preset fourth time interval.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (9)

1. A single fire switch control method, comprising:
receiving downlink data issued by a server through a gateway, wherein the downlink data cannot be received if a single fire switch is in a dormant state; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
and if the single fire switch is in the receiving state, the single fire switch immediately returns the confirmation character and the report data to the gateway after receiving the downlink data, and immediately enters the dormant state after returning the confirmation character and the report data.
2. The single fire switch control method according to claim 1, further comprising:
if the single fire switch cannot receive the downlink data in the preset second time interval of the whole receiving state, the gateway continuously sends the downlink data to the single fire switch until the single fire switch enters the receiving state again;
and the single fire switch immediately returns the confirmation character and the reported data to the gateway after receiving the downlink data, and immediately enters a dormant state after returning the confirmation character and the reported data.
3. The single fire switch control method according to claim 1, further comprising:
if the interval time from the end of the receiving state is less than a preset third time interval when the single fire switch finishes receiving the downlink data, the preset second time interval of the current receiving state is prolonged to a preset fourth time interval;
after the single fire switch replies the confirmation character and the reported data within the preset fourth time interval, immediately entering the dormant state after replying the confirmation character and the reported data;
and if the confirmation character and the reported data are not replied by the single fire switch in the preset fourth time interval, immediately entering the dormant state after the preset fourth time interval is finished.
4. The single fire switch control method according to claim 1, further comprising:
the single live switch uploads reported data to a gateway;
the gateway replies a confirmation character to the single fire switch after receiving the reported data and sends the reported data to a server;
the single live switch enters a dormant state after receiving the confirmation character replied by the gateway, and waits for uploading the reported data next time;
and when the gateway receives the downlink data issued by the server, the gateway stores the downlink data until the reported data uploaded by the single fire switch is received again, and the confirmation characters and the downlink data are packaged and replied to the single fire switch.
5. The single fire switch control method according to claim 1, further comprising:
detecting a current network state;
when network congestion is detected, a newly generated data mark to be uploaded is inquired in real time;
if a newly generated data mark to be uploaded is inquired and the temporary storage queue is not fully loaded, storing the newly generated data to be uploaded into the temporary storage queue according to a first-in first-out sequence and updating the state of the temporary storage queue;
and if the to-be-uploaded data mark is inquired and the queue is fully loaded, stopping the ongoing retransmission timeout timing, clearing the waiting confirmation character, and covering the to-be-uploaded data with the earliest data in the temporary storage queue.
6. The single fire switch control method according to claim 1, further comprising:
401. inquiring whether a data sending mark exists;
402. if the data to be uploaded exists in the temporary storage queue, popping the data to be uploaded out of the temporary storage queue according to a first-in first-out principle, sending the data to be uploaded to a gateway, and updating the state of the current temporary storage queue;
403. inquiring whether the confirmation character is received, if the confirmation character is received, returning to the step 401;
404. if the confirmation character is not received, inquiring an overtime retransmission mark;
405. if receiving the overtime retransmission mark, judging whether the current retransmission times reach the preset uploading times or not;
406. if the retransmission times do not reach the preset uploading times, retransmitting the data to be uploaded to the gateway, and updating the state of the temporary storage queue; and when the retransmission times reach the preset uploading times, stopping sending the current pop-up data, and returning to the step 401.
7. A single fire switch control device, comprising:
the first receiving unit is used for receiving downlink data issued by the server through the gateway, and if the single fire switch is in a dormant state, the downlink data cannot be received; the single-fire switch enters a receiving state of a preset second time interval after entering a dormant state of the preset first time interval;
and the second receiving unit is used for returning the confirmation characters and the report data to the gateway immediately after the single fire switch receives the downlink data and entering the dormant state immediately after returning the confirmation characters and the report data when the single fire switch is in the receiving state.
8. A single fire switch control device according to claim 7 further comprising:
the issuing unit is used for continuously sending the downlink data to the single fire switch by the gateway when the single fire switch cannot receive the downlink data in the preset second time interval of the whole receiving state until the single fire switch enters the receiving state again;
and the return unit is used for immediately returning the confirmation character and the report data to the gateway after the single fire switch receives the downlink data, and immediately entering a dormant state after returning the confirmation character and the report data.
9. A single fire switch control device according to claim 7 further comprising:
the extension unit is used for extending the preset second time interval of the current receiving state to a preset fourth time interval when the interval time from the end of the receiving state is less than a preset third time interval when the single fire switch finishes receiving the downlink data;
the reply unit is used for entering the dormant state immediately after the confirmation character and the reported data are replied after the single fire switch replies the confirmation character and the reported data within the preset fourth time interval;
and the dormancy unit is used for entering the dormant state immediately after the preset fourth time interval is finished when the single fire switch does not finish replying the confirmation character and the reported data in the preset fourth time interval.
CN202111506277.8A 2021-12-10 2021-12-10 Single-fire switch control method and device Active CN114364000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111506277.8A CN114364000B (en) 2021-12-10 2021-12-10 Single-fire switch control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111506277.8A CN114364000B (en) 2021-12-10 2021-12-10 Single-fire switch control method and device

Publications (2)

Publication Number Publication Date
CN114364000A true CN114364000A (en) 2022-04-15
CN114364000B CN114364000B (en) 2024-04-02

Family

ID=81099802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111506277.8A Active CN114364000B (en) 2021-12-10 2021-12-10 Single-fire switch control method and device

Country Status (1)

Country Link
CN (1) CN114364000B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150071139A1 (en) * 2013-09-10 2015-03-12 John A. Nix Power Management and Security for Wireless Modules in "Machine-to-Machine" Communications
CN106961776A (en) * 2017-04-28 2017-07-18 上海紫光乐联物联网科技有限公司 Intelligent single live wire switchs long-range control method
CN107656487A (en) * 2017-09-18 2018-02-02 美的智慧家居科技有限公司 Time management method, equipment and the readable storage medium storing program for executing of the single fire switch of intelligence
CN109041179A (en) * 2017-06-09 2018-12-18 珠海市魅族科技有限公司 Communication means and communication device, the communication equipment of WLAN
CN211557555U (en) * 2019-12-06 2020-09-22 浙江慧居智能家居有限公司 Intelligence house list fire switch
CN112469171A (en) * 2020-11-27 2021-03-09 北京如影智能科技有限公司 Intelligent single-fire switch and sleep time management method and device thereof
CN113433841A (en) * 2021-05-16 2021-09-24 武汉领普科技有限公司 Self-generating wireless switch, controlled equipment and control system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150071139A1 (en) * 2013-09-10 2015-03-12 John A. Nix Power Management and Security for Wireless Modules in "Machine-to-Machine" Communications
CN106961776A (en) * 2017-04-28 2017-07-18 上海紫光乐联物联网科技有限公司 Intelligent single live wire switchs long-range control method
CN109041179A (en) * 2017-06-09 2018-12-18 珠海市魅族科技有限公司 Communication means and communication device, the communication equipment of WLAN
CN107656487A (en) * 2017-09-18 2018-02-02 美的智慧家居科技有限公司 Time management method, equipment and the readable storage medium storing program for executing of the single fire switch of intelligence
CN211557555U (en) * 2019-12-06 2020-09-22 浙江慧居智能家居有限公司 Intelligence house list fire switch
CN112469171A (en) * 2020-11-27 2021-03-09 北京如影智能科技有限公司 Intelligent single-fire switch and sleep time management method and device thereof
CN113433841A (en) * 2021-05-16 2021-09-24 武汉领普科技有限公司 Self-generating wireless switch, controlled equipment and control system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MCC SUPPORT: "Draft Report of 3GPP TSG RAN WG1 #98 v0.1.0", 3GPP TSG RAN WG1 MEETING #98BIS *
秦乐乐;黄涛;刘畅;: "基于物联网技术的高校智慧实验室架构", 河北工业科技, no. 06 *

Also Published As

Publication number Publication date
CN114364000B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN101449475B (en) Radio transmission scheduling according to multiradio control in radio modem
CN100479359C (en) Method and apparatus for polling transmission status in a wireless communication system
CN101658062B (en) Multiradio power aware traffic management
CA2398468A1 (en) A method of controlling email delivery and an email server
JP2008072415A (en) Sensor network system and sensor node
EP1006689A3 (en) Packet retransmission control using priority information
US7697890B2 (en) Communication device and communication system
CN102572939B (en) Heartbeat packet sending method, device thereof and system thereof
CN101202608B (en) Method and system for transmitting of affirmation mode data
US8165051B2 (en) Radio terminal, radio communication system, and radio communication method
CN100361481C (en) Data transmission protocol
CN110505039B (en) Data transmission control method, device, equipment and medium
CN114364000A (en) Single-fire switch control method and device
RU2005102111A (en) SYSTEM AND METHOD FOR MANAGING THE TRANSITION FROM STATE TO STATE IN THE SLEEP MODE AND THE ACTIVE MODE IN A COMMUNICATION SYSTEM WITH A WIDE-BAND WIRELESS ACCESS
Nosovic et al. Scheduled rendezvous and RFID wakeup in embedded wireless networks
CN100559765C (en) The method and bridge terminal and the described communication network that connect the subnet of communication network
KR20030030892A (en) System for transmitting sequences of packets between a server and a mobile terminal
JP2006279832A (en) Communications device, communication method, and communication control program
JP2001196990A (en) Relay transmission method, relay transmission system and device used for them
US10798654B2 (en) Method to decrease energy consumption for sensor nodes in a wireless sensor network
CN110912831B (en) TCP transmission method, device and storage medium
JP2635703B2 (en) Wireless telephone system
CN114333276A (en) Control method and device for battery switch
JP2004128616A (en) Radio communications terminal, its controlling unit, and communication control program
JP2006050244A (en) Radio communication equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230106

Address after: 311121 Room 711-3, Building 7, No. 1, Cangxing Street, Cangqian Street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant after: Green Carbon Intelligent Building (Hangzhou) Co.,Ltd.

Applicant after: Zhejiang Huiju intelligent Internet of things Co.,Ltd.

Address before: 310000 room 206, building 15, No. 1818-2, Wenyi West Road, Yuhang street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant before: Zhejiang Huiju intelligent Internet of things Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant