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

Single-fire switch control method and device Download PDF

Info

Publication number
CN114364000B
CN114364000B CN202111506277.8A CN202111506277A CN114364000B CN 114364000 B CN114364000 B CN 114364000B CN 202111506277 A CN202111506277 A CN 202111506277A CN 114364000 B CN114364000 B CN 114364000B
Authority
CN
China
Prior art keywords
data
fire switch
receiving
state
preset
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.)
Active
Application number
CN202111506277.8A
Other languages
Chinese (zh)
Other versions
CN114364000A (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
Green Carbon Intelligent Building Hangzhou 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, Green Carbon Intelligent Building Hangzhou 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

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

Landscapes

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

Abstract

The application discloses a single fire switch control method and device, comprising the following steps: receiving downlink data sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; after the single fire is started Guan Meige and the sleep state of the first time interval is preset, the receiving state of the second time interval is preset; if the single fire switch is in the receiving state, the single fire switch returns the confirmation character and the report data to the gateway immediately after receiving the downlink data, and enters the dormant state immediately after returning the confirmation character and the report data. The intelligent transformation of the whole house of single fire switch and the problem that LoRaWAN low power consumption and real-time can not be directly applied to single fire intelligent switch and LoRaWAN interactive response control time overlength can not be realized to prior art are solved to 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
The wireless single-fire intelligent switch on the market at present can only carry out intelligent transformation in a small range and in a localized way, because of the defect of the communication distance of the applied prior communication technology, the intelligent transformation of the whole house must be realized through a relay, the adopted technology is used as the relay through the intelligent switch, but the power consumption requirement of the relay through the intelligent switch cannot be met under the condition of single-fire power supply, and the intelligent transformation and upgrading of the wireless single-fire switch of the whole house cannot be realized.
The LoRa physical layer has wide coverage range and good communication stability, and the LoRaWAN protocol has simple architecture and meets most application fields of the Internet of things, so that the LoRaWAN is used as a low-power consumption wide area network communication protocol and covers a plurality of countries and regions.
However, currently, the CLASS a of the lorewan cannot be applied to a system requiring real-time control response, and the CLASS C cannot be applied to a system requiring low power consumption. And the existing LoRaWAN interaction response control time is too long, and is not suitable for being directly applied to the field of wireless intelligent single-fire switches.
Therefore, the problems that the intelligent transformation of a single-fire switch whole house cannot be realized, the LoRaWAN low power consumption and the real-time performance cannot be directly applied to the single-fire intelligent switch and the LoRaWAN interaction response control time is too long in the prior art are solved.
Disclosure of Invention
The application provides a single fire switch control method and device, which solve the problems that the prior art cannot realize intelligent transformation of a single fire switch whole house and LoRaWAN low power consumption and real-time performance cannot be directly applied to a single fire intelligent switch and LoRaWAN interaction response control time is too long.
In view of this, the first aspect of the present application provides a single fire switch control method, the method comprising:
receiving downlink data sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; the single fire switch Guan Meige is used for presetting a dormant state of a first time interval and then entering a receiving state of a second time interval;
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 comprises:
if the Shan Huo switch cannot receive the downlink data in the preset second time interval where the whole receiving state is located, the gateway continuously transmits the downlink data to the Shan Huo switch until the single fire switch enters the receiving state again;
and the single fire switch returns the confirmation character and the reported data to the gateway immediately after receiving the downlink data, and enters a dormant state immediately after returning the confirmation character and the reported data.
Optionally, if the interval time from the end of the receiving state is smaller 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;
when the single-fire switch replies the confirmation character and the reported data in the preset fourth time interval, the single-fire switch immediately enters the dormant state after replying the confirmation character and the reported data;
and if the single fire switch does not reply the confirmation character and the reported data 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 Shan Huo switch after receiving the reported data, and sends the reported data to a server;
the Shan Huo switch enters a dormant state after receiving a confirmation character replied by the gateway and waits for the next uploading and reporting of data;
and when the gateway receives the downlink data issued by the server, the gateway stores the downlink data until the gateway receives the report data uploaded by the single fire switch again, and packages the confirmation character and the downlink data to return to the single fire switch.
Optionally, detecting a current network state;
when network congestion is detected, inquiring a newly generated data mark to be uploaded in real time;
if the newly generated data to be uploaded mark 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;
and if the data to be uploaded is queried and the queue is full, stopping the time-out timing of the retransmission in progress, clearing the waiting acknowledgement character, and covering the earliest data in the temporary storage queue with the data to be uploaded.
Optionally, the method further comprises:
401. inquiring whether a data transmission mark exists or not;
402. if yes, 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 current state of the temporary storage queue;
403. inquiring whether the confirmation character is received, and returning to step 401 if the confirmation character is received;
404. if the confirmation character is not received, inquiring a timeout retransmission mark;
405. if the overtime retransmission mark is received, 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 a gateway, and updating the temporary storage queue state; when the number of retransmissions reaches the preset number of uploads, the transmission of the current popup data is stopped, and step 401 is returned.
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 sent 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 Guan Meige is used for presetting a dormant state of a first time interval and then entering a receiving state of a second time interval;
and the second receiving unit is used for returning the confirmation character and the report data to the gateway immediately after the single fire switch receives the downlink data when the single fire switch is in the receiving state, and entering the dormant state immediately after the confirmation character and the report data are returned.
Optionally, the method further comprises:
a transmitting unit, configured to, when the Shan Huo switch does not receive downlink data in the preset second time interval where the entire receiving state is located, continuously transmit the downlink data to the Shan Huo switch by using a gateway until the single fire switch enters the receiving state again;
and the return unit is used for returning the confirmation character and the reported data to the gateway immediately after the single fire switch receives the downlink data, and entering a dormant state immediately after returning the confirmation character and the reported data.
Optionally, the method further comprises:
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 smaller than a preset third time interval when the single fire switch receives downlink data;
the replying unit is used for immediately entering the dormant state after the single fire switch replies the confirmation character and the reported data in the preset fourth time interval;
and the dormant unit is used for entering the dormant state immediately after the preset fourth time interval is finished when the single fire switch does not reply the confirmation character and the reported data in the preset fourth time interval.
From the above technical scheme, the application has the following advantages:
in the application, a single fire switch control method is provided, which comprises the following steps: receiving downlink data sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; after the single fire is started Guan Meige and the sleep state of the first time interval is preset, the receiving state of the second time interval is preset; if the single fire switch is in the receiving state, the single fire switch returns the confirmation character and the report data to the gateway immediately after receiving the downlink data, and enters the dormant state immediately after returning the confirmation character and the report data.
According to the method and the device, the dormant state and the receiving state of the single-fire switch are reasonably distributed, so that the single-fire switch can always maintain the shorter receiving state and the longer dormant state, and the single-fire switch can maintain higher instantaneity when guaranteeing low-power consumption long-time endurance, so that the use satisfaction degree of the single-fire switch is guaranteed.
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 interactive timing diagram of another embodiment of a single fire switch control method of the present application;
FIG. 4 is an interactive timing chart of uploading data to a server by a single fire switch according to an embodiment of the present application;
FIG. 5 is an interactive timing diagram of one 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 combining low power consumption and real-time control in one embodiment of the present application;
FIG. 8 is a flow chart of data enqueuing for a FIFO queue in one embodiment of a single fire switch control method of the present application;
FIG. 9 is a flow chart of dequeuing data from a FIFO queue in one embodiment of a method of single fire switch control according to 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 view of an embodiment of a single fire switch control device of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Fig. 1 is a method flowchart 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 sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; after the single fire is started Guan Meige and the sleep state of the first time interval is preset, the receiving state of the second time interval is preset;
it should be noted that, when the server issues data to the single fire switch, the server issues data to the gateway first, the gateway sends the data to the single fire switch again, if the single fire switch is in a dormant state, downlink data cannot be received until the single fire switch is in a receiving state, data can be received, in order to enable the single fire switch to save electric quantity of a battery as much as possible, a preset second time interval can be set every preset first time interval for receiving the data transmitted by the server through the gateway, in the application, the single fire switch is in the dormant state in the preset first time interval, and is in the receiving state in the preset second time interval, wherein the length of the preset first time interval can be set to be greater than that of the preset second time interval, so that the single fire switch can be in the dormant state in most of cases.
102. If the single fire switch is in the receiving state, the single fire switch returns the confirmation character and the report data to the gateway immediately after receiving the downlink data, and enters the dormant state immediately after returning the confirmation character and the report data.
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 dormant state after returning the confirmation character and the report data, so that the single fire switch can reduce the receiving time, thereby reducing the electric quantity consumption of the single fire switch battery, and ensuring the low-power consumption long-duration endurance of the single fire switch. The single fire switch has a receiving state with a certain time after each dormancy time period, so that the single fire switch can ensure the real-time interaction with the server.
According to the method and the device, the dormant state and the receiving state of the single-fire switch are reasonably distributed, so that the single-fire switch can always maintain the shorter receiving state and the longer dormant state, and the single-fire switch can maintain higher instantaneity when guaranteeing low-power consumption long-time endurance, so that the use satisfaction degree of the single-fire switch is guaranteed.
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 sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; after the single fire is started Guan Meige and the sleep state of the first time interval is preset, the receiving state of the second time interval is preset;
202. if the single fire switch is in the receiving state, the single fire switch returns the confirmation character and the report data to the gateway immediately after receiving the downlink data, and enters the dormant state immediately after returning the confirmation character and the report data.
203. If the single fire switch cannot receive the downlink data in the preset second time interval where the whole receiving state is located, the gateway continuously transmits 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 a dormant state, the gateway can continuously issue data to the single fire switch (at this time, the single fire switch does not consume power, and rapidly receives the data issued by the gateway after the dormant state is finished), and when the single fire switch enters a 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 single fire switch can immediately return the confirmation character and the report data to the gateway after receiving the downlink data, so that the single fire switch can complete the data receiving and the data feedback in the receiving state, and immediately enter the dormant state after returning the confirmation character and the report data, thereby ensuring the long endurance capacity of the single fire switch battery.
205. If the interval time from the end of the receiving state is smaller 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 a preset fourth time interval;
it should be noted that, in order to ensure that the single fire switch can timely feed back data to ensure the real-time performance of data interaction, the difference between the time point when the single fire switch receives the downlink data and the time point when the receiving state ends can be judged, and the difference is compared with a preset third time interval (the preset third time interval can be set according to the time required by the data reporting), when the difference is smaller than the preset third time interval, the preset second time interval of the current receiving state is prolonged to a preset fourth time interval, for example, from 100ms to 150ms, so that the single fire switch can finish uploading the reported data in the preset fourth time interval.
206. When the single fire switch replies the confirmation character and the reported data in a preset fourth time interval, the single fire switch immediately enters a dormant state after replying the confirmation character and the reported data;
in order to reduce the battery consumption, the single fire switch may immediately enter the sleep state after replying the confirmation character and reporting the data within a preset fourth time interval.
207. If the single fire switch does not reply the confirmation character and report the data in the preset fourth time interval, the single fire switch enters a dormant state immediately after the preset fourth time interval is finished.
It should be noted that, if the single fire switch still does not complete the sending of the report data within the preset fourth time interval, the single fire switch needs to be forced to enter the sleep state at this time so as to ensure the continuous working performance of the single fire switch.
According to the method and the device, the dormant state and the receiving state of the single-fire switch are reasonably distributed, so that the single-fire switch can always maintain the shorter receiving state and the longer dormant state, and the single-fire switch can maintain higher instantaneity when guaranteeing low-power consumption long-time endurance, so that the use satisfaction degree of the single-fire switch is guaranteed.
An interactive timing diagram of another embodiment of a single fire switch control method of the present application is shown in fig. 3.
The foregoing is an embodiment of the server sending data to the single fire switch, and the present application further includes an embodiment of the single fire switch uploading and reporting data to the server, where an interaction timing diagram is shown in fig. 4, and includes: the single fire switch uploads the reported data to the gateway and opens a receiving window with preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data to the single fire switch; the single fire switch receives the confirmation character and the downlink data in the receiving window, and enters a dormant state to wait for the next uploading and reporting of the data; if the confirmation character and the downlink data are not received in the receiving window, uploading the reported data again after exceeding the preset time length; after the data is uploaded twice, no matter whether the confirmation character and the downlink data are received, the single fire switch can enter a dormant state.
In a specific embodiment, the application adopts a modified LoRaWAN single fire switch control method, and uses CLASS A and CLASS C modes after LoRaWAN modification to realize the interaction process of a server and a single fire switch, as shown in fig. 5. In this embodiment, the modulation spreading factor sf=7 and the bandwidth bw=500 KHz may be set. In the data reporting stage of the single fire switch, the response time of waiting for the gateway to reply the confirmation character after the single fire switch transmits the uploading data is 30ms; if the single fire switch receives the acknowledgement character replied by the gateway within 30ms after reporting the data, entering a dormant state; if the acknowledgement character is not received within 30ms, the reported data is retransmitted to the gateway after 30ms, and the gateway enters a sleep state after 30 ms. And after the gateway receives the report data of the single fire switch again, packaging the downlink data and the confirmation character and replying.
A stage of transmitting downlink data to the single fire switch at the server: the receiving state time of the single fire switch is 100ms, and a dormant state is arranged between the receiving state and the receiving state. When the server transmits downlink data to the single fire switch through the 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 dormant state after returning the confirmation character, wherein the duration time of the dormant state is 320ms; if the server transmits downlink data 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 in the preset receiving time interval where the whole receiving state is located, the gateway continuously transmits the downlink data to the single fire switch until the single fire switch enters the receiving state again, after receiving the downlink data, the single fire switch returns a confirmation character and reports the data to the gateway, and immediately enters the dormant state after returning the confirmation character.
In a specific embodiment, when the sleep state of the single fire switch is detected to be near the end, the single fire switch is still in a stage of returning the confirmation character and the report data, the receiving state is prolonged by 50ms, and if the confirmation character and the report data are uploaded in 50ms, the single fire switch immediately enters the sleep state after the confirmation character and the report data are uploaded; if the character and the reported data are not completely uploaded within 50ms, the user still waits until the 50ms is finished and then enters a dormant state.
A program flow diagram of one embodiment of the present application is shown in fig. 6, and includes:
the single fire switch inquires whether a key is pressed or whether downlink data issued by the server is received in real time. If the key is detected to be pressed, the key is trembled for 100ms, at the moment, whether the key is pressed is detected again, if the key is still pressed, the key is indicated to be pressed effectively, and otherwise, the key is not effective. Triggering when the key is effective to judge 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 a short time, and canceling the current linkage state if the key is pressed for a long time; and if the data is short pressed, packing the data and uploading the data to a server, and then controlling the terminal equipment in linkage response. If the key is a physical loop key, judging whether the switch is pressed for a long time or a short time, and if the key is pressed for a long time, judging that the current physical loop is canceled to enable the key switch to be switched into a linkage control switch; if the current state of the loop is reported to the server, the data synchronization of the local switch and the server is realized. If the key is a scene key, judging whether the key is pressed for a long time or a short time at the moment, and resetting the whole switch if the key is pressed for a long time; if the short press is detected, the corresponding scene loop data is directly packed and reported to the server, and then the scene control set before is triggered. If the data is detected to be received, the data is analyzed according to a specific protocol, whether the switch is operated or not is determined, and corresponding response data is sent to the server. The remote linkage control and the physical circuit direct local switching are realized, and the remote linkage and the physical circuit switching are also supported according to the corresponding protocol.
In one embodiment of the present application, a program flow diagram combining low power consumption and real-time control is provided; as shown in fig. 7, includes:
when the single fire switch is in a receiving state (wakeup) for 100ms, whether data need to be sent is always inquired, and if not, the single fire switch is in a sleep state (sleep) for 320 ms. If it is found that data need to be transmitted at this time, the type of the data is queried. If the data type is key data, sending acknowledgement data (acknowledgement data), and if acknowledgement character ACK replied by the gateway is received, waiting to enter a dormant state; if not, the single fire switch retransmits the data, and if the retransmitted data reaches twice, the data waits to enter a dormant state. If the data bit responds to the inquiry data controlled by the server, unconfirmed data is sent, and the data bit is not retransmitted after being sent, and directly enters a state of waiting to enter dormancy. In order to ensure that the data can respond to the server in time, the data needs to be replied immediately after the server data is received, and the data can be transferred to the next report unlike key data. So in order to ensure that the data can be normally transmitted without being limited by 100ms wakeup time and 320ms sleep time, a wakeup time of 50ms is needed to be added to the original 100ms wakeup time. Of course, the power supply capability of the single fire switch needs to be considered for increasing 50ms, so once the transmission is completed within 50ms, the sleep state is directly entered, and the complete execution of the whole 50ms is not needed. If the transmission is not completed after 50ms arrives, the forced single-fire switch needs to enter a sleep state at the moment so as to ensure the continuous working performance of the single-fire switch. The diagram shows the whole single fire switch data transmitting process and the realization process of low power consumption and real-time response receiving.
In a specific embodiment, a system framework of the modified lorewan battery switch-based system of the present application is shown in fig. 10, and fig. 10 includes:
STM32G030C8T6, ASR6500SLC driver, button driver, LED driver, UART driver, the transceiver mechanism that corrects the CLASS A mode in LoRaWAN and the transceiver mechanism that corrects the CLASS C mode combine together, adopt SEMTECH company LLCC68 (thing networking wireless communication spread spectrum module) or ASR6500SLC (LoRa wireless communication radio frequency chip), the performance is better than SX1278, the transmission distance is farther, the transmission power consumption and the receiving power consumption are lower, make battery switch product life-span longer. Wherein PWM-pulse width modulation; UART-asynchronous transceiver, SPI-serial peripheral interface protocol, RTC-real time clock. The keys comprise physical circuit keys and scene keys, and comprise various combination modes, such as a 1 physical circuit+1 scene, a 2 physical circuit+2 scene, a 3 physical circuit+3 scene, a 3 physical circuit+1 scene and the like. The physical circuit can be set as a linkage double-control switch, and as the switch has various combinations, various combination modes of the linkage double-control switch, the physical circuit switch and the scene key are realized, the specific combination mode is not particularly specified, and the linkage double-control switch can be set through a server according to a predefined communication protocol, so that the functions of remote setting of linkage double control, scene addition, deletion, modification and lamp searching are realized. Local switching and remote switching between the local linkage key and the physical loop key are also realized.
The application also provides a control method of the battery switch, which is based on the CLASS A transceiver mechanism modified by the LoRaWAN protocol, wherein a flow chart of data enqueuing is shown in fig. 8, and fig. 8 comprises:
301. detecting a current network state;
when the battery switch sends data and waits for the gateway to reply the confirmation character or resend the character to cause blockage due to overtime, the newly generated data needs to be temporarily stored when the gateway is pressed again or other presses are performed, so that the continuity and the reliability of the data are ensured. Thus, a need exists for detecting the current network state.
302. When network congestion is detected, inquiring a newly generated data mark to be uploaded in real time;
when the network congestion is detected, the newly generated data caused by the key can be queried in real time when the key is pressed again or other keys are pressed, and the data of the trust product can be stored locally because the network congestion is detected.
303. If the newly generated data to be uploaded mark 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 constructed locally to store newly generated data to be uploaded, so as to pop up the stored data in time when the network is restored. Specifically, when the new generation of the data to be uploaded flag is detected, whether the temporary storage queue is full is detected, if not, the new generation of the data to be uploaded is stored in the temporary storage queue according to the first-in first-out sequence, and the temporary storage queue after the data is stored is updated.
304. If the data to be uploaded is queried and the queue is full, stopping the retransmission timeout timing in progress, clearing the waiting acknowledgement character, and covering the data to be uploaded with the earliest data in the temporary storage queue.
When the data to be uploaded is queried, if the temporary storage queue is full at this time, stopping the retransmission timeout timing in progress, clearing the waiting acknowledgement character, and covering the earliest data in the temporary storage queue with the data to be uploaded. Specifically, the application may set up a temporary storage fifo queue a with a length of 5, and enqueue the newly generated data. The method can be sequentially carried out for 5 times at maximum, and when the number of times of data needing to be enqueued exceeds the set maximum number of times, the method 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, the CLASS a transceiver mechanism is modified based on the lorewan protocol, wherein a flow chart of data dequeuing is shown in fig. 9, and fig. 9 includes:
401. inquiring whether a data transmission mark exists or not;
when the network condition is restored, it may be queried whether the data transmission flag is present.
402. If the data to be uploaded exists, 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 current state of the temporary storage queue;
when the data transmission mark exists, the data to be uploaded can be popped up to the temporary storage queue according to the first-in first-out principle, namely, the earliest enqueued data in the temporary storage queue is popped up to the temporary storage queue and is transmitted to the gateway; updating the current state of the temporary storage queue; at this time, the data in the temporary storage queue can be sequentially sent again, the data in the temporary storage queue is sequentially popped up and sent according to the first-in first-out principle, and the fact that all the data in the temporary storage queue are sent is known.
403. Inquiring whether the confirmation character is received, and returning to the step 401 if the confirmation character is received;
it should be noted that, it may be queried whether the battery switch receives the acknowledgement character replied by the gateway, and if the acknowledgement character is replied, it may return to step 401 to prepare for the next data transmission.
404. If the confirmation character is not received, inquiring a timeout retransmission mark;
405. if the overtime retransmission mark is received, judging whether the current retransmission times reach the preset uploading times or not;
it should be noted that, when no acknowledgement character is received, the timeout retransmission flag is queried, and at this time, the steps 401 to 403 may be referred to, when the timeout retransmission flag is received, whether the current retransmission number reaches the preset upload number is judged, if the current retransmission number reaches the preset upload number, the battery switch enters the sleep state, the maximum upload number may be set to 3, and when the maximum upload number exceeds three, the uploading 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 temporary storage queue state; when the number of retransmissions reaches the preset number of uploads, the transmission of the current popup data is stopped, and step 401 is returned.
If the retransmission times do not reach the preset uploading times, retransmitting the data to be uploaded to the gateway, and updating the temporary storage queue state; when the number of retransmissions reaches the preset number of uploads, the transmission of the current pop-up data is stopped, and step 401 is returned to prepare for the next data transmission.
The foregoing is an embodiment of a 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 if a single fire switch is in a dormant state, the downlink data cannot be received; after the single fire is started Guan Meige and the sleep state of the first time interval is preset, the receiving state of the second time interval is preset;
the second receiving unit 502 is configured to return the acknowledgement character and the report data to the gateway immediately after the single fire switch receives the downlink data when the single fire switch is in the receiving state, and enter the sleep state immediately after the acknowledgement character and the report data are returned.
In a specific embodiment, the method further comprises:
the transmitting unit is used for continuously transmitting downlink data to the single fire switch by the gateway when the single fire switch cannot receive the downlink data in a preset second time interval where 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 character and the reported 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 reported data.
In a specific embodiment, the method further comprises:
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 smaller than the preset third time interval when the single-fire switch finishes receiving the downlink data;
the replying unit is used for replying the confirmation character and the reported data in a preset fourth time interval when the single fire switch is in a dormant state immediately after replying the confirmation character and the reported data;
and the dormancy unit is used for entering a dormancy state immediately after the preset fourth time interval is finished when the single fire switch does not reply the confirmation character and the reported data in the preset fourth time interval.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise 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 this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). 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 this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The above embodiments are merely for illustrating the technical solution 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (3)

1. A single fire switch control method, comprising:
receiving downlink data sent by a server through a gateway, and if a single-fire switch is in a dormant state, not receiving the downlink data; the single fire switch Guan Meige is used for presetting a dormant state of a first time interval and then entering a receiving state of a second time interval;
if the single fire switch is in the receiving state, the single fire switch immediately returns a confirmation character and reported data to the gateway after receiving downlink data, and immediately enters a dormant state after returning the confirmation character and the reported data;
further comprises:
if the Shan Huo switch cannot receive the downlink data in the preset second time interval where the whole receiving state is located, the gateway continuously transmits the downlink data to the Shan Huo switch until the single fire switch enters the receiving state again;
the single fire switch returns the confirmation character and the report data to the gateway immediately after receiving the downlink data, and enters a dormant state immediately after returning the confirmation character and the report data;
further comprises:
if the interval time from the end of the receiving state is smaller than a preset third time interval when the single fire switch finishes receiving the downlink data, extending the preset second time interval of the current receiving state to a preset fourth time interval;
when the single-fire switch replies the confirmation character and the reported data in the preset fourth time interval, the single-fire switch immediately enters the dormant state after replying the confirmation character and the reported data;
if the single fire switch does not reply the confirmation character and the reported data in the preset fourth time interval, immediately entering the dormant state after the preset fourth time interval is finished;
further comprises:
detecting a current network state;
when network congestion is detected, inquiring a newly generated data mark to be uploaded in real time;
if the newly generated data to be uploaded mark 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;
and if the data to be uploaded is queried and the queue is full, stopping the time-out timing of the retransmission in progress, clearing the waiting acknowledgement character, and covering the earliest data in the temporary storage queue with the data to be uploaded.
2. A single fire switch control method, comprising:
the single fire switch uploads the reported data to the gateway;
the gateway replies a confirmation character to the Shan Huo switch after receiving the reported data, and sends the reported data to a server;
the Shan Huo switch enters a dormant state after receiving a confirmation character replied by the gateway and waits for the next uploading and reporting of data;
when the gateway receives the downlink data issued by the server, the gateway stores the downlink data until the gateway receives the report data uploaded by the single-fire switch again, and packages the confirmation character and the downlink data and replies to the Shan Huo switch;
further comprises:
401. inquiring whether a data transmission mark exists or not;
402. if so, 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 current state of the temporary storage queue;
403. inquiring whether the confirmation character is received, and returning to step 401 if the confirmation character is received;
404. if the confirmation character is not received, inquiring a timeout retransmission mark;
405. if the overtime retransmission mark is received, 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 a gateway, and updating the temporary storage queue state; when the number of retransmissions reaches the preset number of uploads, the transmission of the current popup data is stopped, and step 401 is returned.
3. A single fire switch control device, comprising:
the first receiving unit is used for receiving downlink data sent 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 Guan Meige is used for presetting a dormant state of a first time interval and then entering a receiving state of a second time interval;
the second receiving unit is used for returning the confirmation character and the report data to the gateway immediately after the single fire switch receives the downlink data when the single fire switch is in the receiving state, and entering the dormant state immediately after the confirmation character and the report data are returned;
further comprises:
a transmitting unit, configured to, when the Shan Huo switch does not receive downlink data in the preset second time interval where the entire receiving state is located, continuously transmit the downlink data to the Shan Huo switch by using a gateway until the single fire switch enters the receiving state again;
the return unit is used for immediately returning the confirmation character and the reported 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 reported data;
further comprises:
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 smaller than a preset third time interval when the single fire switch receives downlink data;
the replying unit is used for immediately entering the dormant state after the single fire switch replies the confirmation character and the reported data in the preset fourth time interval;
the sleep unit is used for entering the sleep state immediately after the preset fourth time interval is finished when the single-fire switch does not reply the confirmation character and the reported data in the preset fourth time interval;
the detection unit is used for detecting the current network state;
the inquiring unit is used for inquiring the newly generated data mark to be uploaded in real time when the network congestion is detected;
the storage unit is used for 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 when the newly generated data to be uploaded mark is inquired and the temporary storage queue is not fully loaded;
and the clearing unit is used for stopping the retransmission timeout timing in progress when the data mark to be uploaded is inquired and the queue is full, clearing the confirmation character in progress and covering the earliest data in the temporary storage queue with the data to be uploaded.
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 CN114364000A (en) 2022-04-15
CN114364000B true 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 (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9350550B2 (en) * 2013-09-10 2016-05-24 M2M And Iot Technologies, Llc Power management and security for wireless modules in “machine-to-machine” communications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
Draft Report of 3GPP TSG RAN WG1 #98 v0.1.0;MCC Support;3GPP TSG RAN WG1 Meeting #98bis;全文 *
基于物联网技术的高校智慧实验室架构;秦乐乐;黄涛;刘畅;;河北工业科技(第06期);全文 *

Also Published As

Publication number Publication date
CN114364000A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN1319303C (en) Communication device, transmission control method and program product
CN110505039B (en) Data transmission control method, device, equipment and medium
JP2008072415A (en) Sensor network system and sensor node
US20070268920A1 (en) Communication gateway between wireless communication networks
CA2604479A1 (en) Wirless communication system with collision avoidance protocol
GB2483057A (en) Managing data buffering for transmission
TW200835256A (en) Managing unscheduled wireless communication in a multiradio device
CN102090023A (en) TCP transmission control device and TCP transmission control method
US7697890B2 (en) Communication device and communication system
CN102790913A (en) Audio/video transmission method on basis of 3G network
CN102469026A (en) Communication device, communication system, program, and communication method
WO2020144010A1 (en) Signal-repeater device operable in low-power repeater-operation mode
CN109587023A (en) A kind of LoRa ad hoc network method and system
EP2111077A2 (en) Radio terminal, radio communication system and radio communication method
CN101202608B (en) Method and system for transmitting of affirmation mode data
CN101610587B (en) Data transmission method based on TDD standard and device thereof
EP1966778B1 (en) Remote control extension with limited command duration
CN114364000B (en) Single-fire switch control method and device
CN101765004B (en) Method for optimizing wireless video TCP transmission
JP7328177B2 (en) Data transmission method and communication system
KR20030030892A (en) System for transmitting sequences of packets between a server and a mobile terminal
KR20130088180A (en) Wireless digital communication method and system
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
JP2635703B2 (en) Wireless telephone system

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