CN114333276A - Control method and device for battery switch - Google Patents

Control method and device for battery switch Download PDF

Info

Publication number
CN114333276A
CN114333276A CN202111506276.3A CN202111506276A CN114333276A CN 114333276 A CN114333276 A CN 114333276A CN 202111506276 A CN202111506276 A CN 202111506276A CN 114333276 A CN114333276 A CN 114333276A
Authority
CN
China
Prior art keywords
data
gateway
uploading
uploaded
unit
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.)
Pending
Application number
CN202111506276.3A
Other languages
Chinese (zh)
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 CN202111506276.3A priority Critical patent/CN114333276A/en
Publication of CN114333276A publication Critical patent/CN114333276A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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 control method and a device of a battery switch, wherein the method comprises the following steps: uploading the reported data to a gateway; the gateway replies a confirmation character after receiving the reported data and sends the reported data to the server; entering a dormant state after receiving the confirmation character, and waiting for uploading 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 is received again, and the gateway packs and replies the confirmation characters and the downlink data. The wireless intelligent transformation technology of the wiring-free scheme is realized, and the compatibility and the response speed of the battery switch are improved.

Description

Control method and device for battery switch
Technical Field
The present application relates to the field of battery switch technologies, and in particular, to a method and an apparatus for controlling a battery switch.
Background
At present, in the process of upgrading and transforming the intelligent home, since the previous mechanical switches are all single-fire mechanical switches, the situation that no power supply line or no loop load line exists in certain switch positions can be met in the process of transforming and transforming the intelligent home switch, so that the normal intelligent zero-fire switch or the intelligent single-fire switch cannot be used for upgrading and transforming.
Other single fire switches in the current market have short communication distance, poor diffraction capability and poor wall penetrating capability, and cannot receive signals in real time, so that many occasions cannot be upgraded and reformed. Most products have high power consumption and cannot meet the service condition of long service life.
The existing market also has the client that is unsatisfied with original wired intelligent switch function, needs to reform transform the upgrading with original traditional wired intelligent switch, but original wired part wiring is complicated, is difficult for reforming transform the upgrading.
At present, the traditional wireless intelligent transformation needs wiring, and the wiring can be consumed by a large amount of manpower, material resources and financial resources. Retrofit upgrades using a wiring-free solution are required.
Disclosure of Invention
The embodiment of the application provides a control method and device of a battery switch, realizes a wireless intelligent transformation technology of a wiring-free scheme, and improves the compatibility and response speed of the battery switch.
In view of the above, a first aspect of the present application provides a method for controlling a battery switch, the method including:
uploading the reported data to a gateway;
the gateway replies a confirmation character after receiving the reported data and sends the reported data to a server;
entering a dormant state after receiving the confirmation character, and waiting for uploading reported data next time;
and when the gateway receives downlink data issued by the server, the gateway stores the downlink data until the gateway receives the reported data again, and the gateway packs and replies the confirmation character and the downlink data.
Optionally, when the gateway receives downlink data sent by the server, the gateway stores the downlink data, and until the report data is received again, the gateway packages and replies the confirmation character and the downlink data, and then the method further includes:
201. uploading the reported data to a gateway, and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data;
202. if the confirmation character and the downlink data are received in the receiving window, entering a dormant state, and waiting for uploading the reported data next time; if the confirmation character and the downlink data are not received in the receiving window, uploading the reported data again after the preset time length is exceeded;
203. step 201 and step 202 are repeated, if the confirmation character and the downlink data are not received within the preset uploading times, it indicates that the communication interaction fails, and the communication system directly enters into the sleep state.
Optionally, uploading the reported data to a gateway, and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data, and then the method further comprises the following steps:
and the gateway uploads the reported data to a server, so that the server identifies that the gateway replies the confirmation character and the downlink data.
Optionally, the method further includes:
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:
501. inquiring whether a data sending mark exists;
502. 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;
503. inquiring whether the confirmation character is received, if the confirmation character is received, returning to the step 501;
504. if the confirmation character is not received, inquiring an overtime retransmission mark;
505. if receiving the overtime retransmission mark, judging whether the current retransmission times reach the preset uploading times or not;
506. 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; when the retransmission times reaches the preset uploading times, the sending of the current pop-up data is stopped, and the step 501 is returned.
A second aspect of the present application provides a control apparatus for a battery switch, the apparatus comprising:
the first uploading unit is used for uploading the reported data to the gateway;
the gateway unit is used for replying a confirmation character after receiving the reported data and sending the reported data to a server;
the first dormancy unit is used for entering a dormant state after receiving the confirmation character and waiting for uploading the reported data next time;
and the storage and packaging unit is used for storing the downlink data by the gateway when the gateway receives the downlink data issued by the server, and packaging and replying the confirmation characters and the downlink data by the gateway until the reported data is received again.
Optionally, the method further includes:
the second uploading unit is used for uploading the reported data to the gateway and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data;
a second sleep unit, configured to enter a sleep state if the acknowledgment character and the downlink data are received in the receiving window, and wait for uploading the reported data next time; if the confirmation character and the downlink data are not received in the receiving window, uploading the reported data again after the preset time length is exceeded;
and the repeated execution unit is used for repeatedly executing the steps of the second uploading unit and the second dormancy unit, and if the confirmation character and the downlink data are not received within the preset uploading times, the communication interaction fails at the time, and the communication system directly enters a dormancy state.
Optionally, the method further includes:
and the gateway uploading unit is used for uploading the reported data to a server, so that the server identifies that the gateway replies the confirmation character and the downlink data.
Optionally, the method further includes:
the detection unit is used for detecting the current network state;
the first query unit is used for querying a newly generated data mark to be uploaded in real time when 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 a first-in first-out sequence and updating the state of the temporary storage queue if the newly generated data to be uploaded mark is inquired and the temporary storage queue is not fully loaded;
and the covering unit is used for 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 if the to-be-uploaded data mark is inquired and the queue is fully loaded.
Optionally, the method further includes:
the second inquiry unit is used for inquiring whether a data sending mark exists or not;
the popping unit is used for popping the data to be uploaded out of the temporary storage queue according to a first-in first-out principle when the data sending mark is inquired, sending the data to be uploaded to the gateway and updating the state of the current temporary storage queue;
a third query unit, configured to query whether the confirmation character is received, and if the confirmation character is received, return to the second query unit;
a fourth query unit, configured to query a timeout retransmission flag when the acknowledgment character is not received;
the judging unit is used for judging whether the current retransmission times reach the preset uploading times or not when the overtime retransmission mark is received;
the updating unit is used for resending the data to be uploaded to the gateway when the retransmission times do not reach the preset uploading times and updating the state of the temporary storage queue; and stopping sending the current pop-up data when the retransmission times reach the preset uploading times, and returning to the second query unit.
According to the technical scheme, the method has the following advantages:
in the present application, a method for controlling a battery switch is provided, including: uploading the reported data to a gateway; the gateway replies a confirmation character after receiving the reported data and sends the reported data to the server; entering a dormant state after receiving the confirmation character, and waiting for uploading 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 is received again, and the gateway packs and replies the confirmation characters and the downlink data.
This application discerns the interaction that realizes battery switch and gateway through the affirmation character of battery switch to the gateway feedback, when the battery switch triggers the report data once more, the gateway sends the instruction data and the affirmation character packing of server feedback for battery switch, and at this in-process, battery switch most time maintains dormant state for reduce battery switch's energy consumption, increase battery switch's life. In addition, the problem that traditional wired intelligence switch reforms transform difficultly has been solved to the wireless transmission scheme of exempting from to lay wire of this application.
Drawings
FIG. 1 is a method flow diagram of one embodiment of a method for controlling a battery switch of the present application;
FIG. 2 is a timing diagram illustrating interaction in an embodiment of a method for controlling a battery switch according to the present application;
FIG. 3 is a method flow diagram of another embodiment of a method for controlling a battery switch of the present application;
FIG. 4 is an interaction timing diagram of another embodiment of a method for controlling a battery switch according to the present application;
FIG. 5 is a sequence diagram of the interaction after the application is modified using the CLASS A mode in LoRaWAN;
FIG. 6 is a flow chart illustrating a data enqueue of a FIFO queue according to an embodiment of the present invention;
FIG. 7 is a flow chart illustrating a data dequeue of a FIFO queue according to an embodiment of a method for controlling a battery switch of the present application;
fig. 8 is a schematic diagram of a system framework based on a modified LoRaWAN battery switch in an embodiment of the present application;
fig. 9 is a schematic structural diagram of an embodiment of a control device of a battery switch according to the present application.
Detailed Description
This application discerns the interaction that realizes battery switch and gateway through the affirmation character of battery switch to the gateway feedback, when the battery switch triggers the report data once more, the gateway sends the instruction data and the affirmation character packing of server feedback for battery switch, and at this in-process, battery switch most time maintains dormant state for reduce battery switch's energy consumption, increase battery switch's life. In addition, the problem that traditional wired intelligence switch reforms transform difficultly has been solved to the wireless transmission scheme of exempting from to lay wire of this application.
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 control method of a battery switch according to the present application, as shown in fig. 1, where fig. 1 includes:
101. uploading the reported data to a gateway;
it should be noted that, in the present application, a battery switch with low power consumption may be adopted, and a wireless transmission technology is adopted to implement interaction between the battery switch and the server. The interaction process between the battery switch and the gateway and the server is specifically as follows: firstly, the battery switch sends the reported data to the gateway, wherein the gateway and the battery switch as well as the gateway and the server do not need to be relayed.
102. The gateway replies a confirmation character after receiving the reported data and sends the reported data to the server;
it should be noted that, after the gateway receives the reported data uploaded by the battery switch, the gateway can reply a confirmation character to the battery switch, so that the battery switch recognizes that the gateway has received the data; meanwhile, the gateway can upload the reported data to the server, so that the server feeds back corresponding instruction data according to the reported data.
103. Entering a dormant state after receiving the confirmation character, and waiting for uploading reported data next time;
it should be noted that the switch battery enters the sleep state after receiving the confirmation character fed back by the gateway, so that the battery switch can save energy and power as much as possible, the service life of the switch battery is prolonged, the battery switch sends the report data to the gateway again until the next trigger data appears in the switch battery, and at this time, the battery switch is activated again. The trigger data in the present application may be trigger data of a switch scene key.
104. And when the gateway receives the downlink data issued by the server, the gateway stores the downlink data until the reported data is received again, and the gateway packs and replies the confirmation characters and the downlink data.
It should be noted that, when the gateway receives downlink data (the downlink data may be instruction data corresponding to reported data, for example, instruction data corresponding to key trigger data) sent by the server, the gateway first stores the downlink data; and when the battery switch is activated and the report data is sent, the gateway packs the downlink data and the confirmation characters and feeds the packed downlink data and the confirmation characters back to the battery switch to complete the interaction process between the battery switch and the server. The interaction process of the specific battery switch and the server can refer to the content shown in fig. 2.
This application discerns the interaction that realizes battery switch and gateway through the affirmation character of battery switch to the gateway feedback, when the battery switch triggers the report data once more, the gateway sends the instruction data and the affirmation character packing of server feedback for battery switch, and at this in-process, battery switch most time maintains dormant state for reduce battery switch's energy consumption, increase battery switch's life. In addition, the problem that traditional wired intelligence switch reforms transform difficultly has been solved to the wireless transmission scheme of exempting from to lay wire of this application.
The present application also provides another embodiment of a control method of a battery switch, as shown in fig. 3, where fig. 3 includes:
201. uploading the reported data to a gateway, and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies a confirmation character and downlink data;
it should be noted that, in the present application, a time window with a preset time length may be set, so as to wait for the gateway to feed back the confirmation character and the downlink data, and avoid waiting for the battery switch for a long time, so that the battery switch is in a sleep state for most of the time, and avoid power consumption.
202. If the receiving window receives the confirmation character and the downlink data, entering a dormant state and waiting 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;
it should be noted that, when the battery switch receives the confirmation character and the downlink data in the receiving window with the preset time length, it indicates that the interaction between the battery switch and the server is completed, and at this time, the battery switch enters a sleep state, so that the consumption of electric energy is reduced; if the battery switch does not receive the confirmation characters and the downlink data in the receiving window with the preset time length, the reporting data can be uploaded again after waiting for the preset time length, the reporting data is sent for multiple times, and the feedback of the gateway is waited. The method waits for the gateway to respond to an ACK (Acknowledge character) signal within a set time period, and is used for stopping the current sending timeout waiting; and waiting for the gateway to respond to the ACK signal within a set time period so as to terminate the current retransmission mechanism.
203. Step 201 and step 202 are repeated, if the confirmation character and the downlink data are not received within the preset uploading times, it indicates that the communication interaction fails, and the communication system directly enters into the sleep state.
It should be noted that, by repeating step 201 and step 202, the present application may set a certain number of uploading times to wait for the feedback of the gateway, and if the preset number of uploading times is exceeded, the battery switch directly enters the sleep state in order to reduce the power consumption of the battery switch. According to the method and the device, the battery switch is provided with the receiving window with the preset time length and sends the reported data for multiple times at intervals with the preset time length, so that the battery switch can respond quickly, and the power consumption of the battery switch can be reduced. The interaction process of the specific battery switch and the gateway server can refer to the interaction sequence chart shown in fig. 4.
According to the method and the device, the battery switch is provided with the receiving window with the preset time length and sends the reported data for multiple times at intervals with the preset time length, so that the battery switch can respond quickly, and the power consumption of the battery switch can be reduced. In addition, the battery switch is in a dormant state most of the time, and the battery switch with low power can be adopted in the application, for example, the battery switch with the lowest power consumption of 2uA can be adopted, so that the service life of the battery switch with low power consumption can be greatly prolonged, namely, the battery switch of the scheme can reduce the replacement times of the battery and increase the use satisfaction of a user.
In a specific application example, the application modifies the CLASS a mode in LoRaWAN, so as to implement interaction between the battery switch and the gateway and the server, where a specific interaction timing chart is shown in fig. 5, and includes:
specific parameters of the present application may set a modulation spreading factor SF to be 7, a bandwidth BW to be 500KHz, and a time window of 100ms, where the frequency may be modified according to the serial number of the battery switch;
301. the battery switch uploads the reported data to the gateway and opens a 100 millisecond receiving window; after receiving the reported data, the gateway replies a confirmation character to the battery switch and uploads the reported data to the server;
302. if the battery switch receives the confirmation character in the receiving window of 100 milliseconds, the battery switch enters a dormant state and waits for uploading the reported data next time; if the confirmation character is not received in the receiving window of 100 milliseconds, uploading the reported data again after the time of 100 milliseconds is exceeded;
303. and repeating the step 301 and the step 302, wherein if the battery switch does not receive the confirmation character within the preset uploading times, the communication interaction fails at this time, and the battery switch directly enters the sleep state.
It should be noted that, in the method for implementing modified LoRaWAN-based battery switch control, the battery switch and the gateway use the LoRa spread spectrum technology as the physical layer transmission technology; the link layer between the battery switch and the gateway is realized by using a LoRaWAN protocol synchronization technology; the battery switch modifies the CLASS a mode in LoRaWAN. A large number of experimental conclusions verify that the transmission parameters of the intelligent battery switch based on the LoRaWAN protocol framework are finally suitable for being realized, so that the intelligent battery switch based on the LoRaWAN protocol framework can achieve a millisecond-level response mechanism, the requirement of daily family on quick response is met, and meanwhile, the performance is better than that of other communication modes. On the basis of meeting the quick response, the communication distance of the battery switch can reach more than 500 meters, and the use and transformation requirements of the intelligent home under the condition of not using the repeater can be met.
In a specific embodiment, the system framework of the modified LoRaWAN battery switch is shown in fig. 8, where fig. 8 includes:
STM32G030C8T6, LLCC68 driver, key driver, LED driver, UART driver, send-receive mechanism to amend the CLASS A mode in LoRaWAN, adopt SEMTECH company LLCC68 (thing networking wireless communication spread spectrum module) or ASR6500SLC (LoRa wireless communication radio frequency chip) of ASR, the performance is superior to SX1278, the transmission distance is farther, send power consumption and receive power consumption lower, make the battery switch product life longer. PWM-pulse width modulation; UART-asynchronous transceiver transmitter, SPI-serial peripheral interface protocol, RTC-real time clock.
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. 6, where fig. 6 includes:
401. 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.
402. 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.
403. 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.
404. 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, the flow chart of dequeuing data is shown in fig. 7, where fig. 7 includes:
501. 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.
502. 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.
503. Inquiring whether a confirmation character is received, if so, returning to the step 501;
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, the process may return to step 501 to prepare for the next data transmission.
504. If the confirmation character is not received, inquiring an overtime retransmission mark;
505. 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 201 to 203, 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.
506. 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; when the retransmission times reaches the preset uploading times, the sending of the current pop-up data is stopped, and the step 501 is returned.
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; when the retransmission times reaches the preset uploading times, the sending of the current pop-up data is stopped, and the step 501 is returned to prepare for the next data sending.
The present application further provides an embodiment of a control device of a battery switch, as shown in fig. 9, where fig. 9 includes:
a first uploading unit 601, configured to upload reporting data to a gateway;
the gateway unit 602 is configured to reply to the confirmation character after receiving the report data, and send the report data to the server;
a first sleep unit 603, configured to enter a sleep state after receiving the confirmation character, and wait for uploading the report data next time;
and a storage and packing unit 604, configured to, when the gateway receives the downlink data sent by the server, store the downlink data by the gateway, and until the report data is received again, pack and reply the acknowledgment character and the downlink data by the gateway.
In a specific embodiment, the method further comprises the following steps:
the second uploading unit is used for uploading the reported data to the gateway and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies a confirmation character and downlink data;
the second dormancy unit is used for entering a dormant state if the confirmation character and the downlink data are received in the receiving window, and waiting 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;
and the repeated execution unit is used for repeatedly executing the steps of the second uploading unit and the second dormancy unit, and if the confirmation character and the downlink data are not received within the preset uploading times, the communication interaction fails at the time, and the communication directly enters the dormancy state.
In a specific embodiment, the method further comprises the following steps:
and the gateway uploading unit is used for uploading the reported data to the server, so that the server identifies that the gateway replies the confirmation characters and the downlink data.
In a specific embodiment, the method further comprises the following steps:
the detection unit is used for detecting the current network state;
the first query unit is used for querying a newly generated data mark to be uploaded in real time when 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 a first-in first-out sequence and updating the state of the temporary storage queue if the newly generated data to be uploaded mark is inquired and the temporary storage queue is not fully loaded;
and the covering unit is used for 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 if the data to be uploaded mark is inquired and the queue is fully loaded.
In a specific embodiment, the method further comprises the following steps:
the second inquiry unit is used for inquiring whether a data sending mark exists or not;
the popping unit is used for popping the data to be uploaded out of the temporary storage queue according to a first-in first-out principle when the data sending mark is inquired, sending the data to be uploaded to the gateway and updating the state of the current temporary storage queue;
a third query unit, configured to query whether a confirmation character is received, and if the confirmation character is received, return to the second query unit;
a fourth query unit, configured to query the timeout retransmission flag if no confirmation character is received;
the judging unit is used for judging whether the current retransmission times reach the preset uploading times or not when the overtime retransmission mark is received;
the updating unit is used for resending the data to be uploaded to the gateway and updating the state of the temporary storage queue when the retransmission times do not reach the preset uploading times; and when the retransmission times reach the preset uploading times, stopping sending the current pop-up data, and returning to the second query unit.
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 integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
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 (10)

1. A method of controlling a battery switch, comprising:
uploading the reported data to a gateway;
the gateway replies a confirmation character after receiving the reported data and sends the reported data to a server;
entering a dormant state after receiving the confirmation character, and waiting for uploading reported data next time;
and when the gateway receives downlink data issued by the server, the gateway stores the downlink data until the gateway receives the reported data again, and the gateway packs and replies the confirmation character and the downlink data.
2. The method according to claim 1, wherein when the gateway receives downlink data sent by the server, the gateway stores the downlink data until the gateway packages and replies the acknowledgment character and the downlink data when receiving the report data again, and thereafter further comprising:
201. uploading the reported data to a gateway, and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data;
202. if the confirmation character and the downlink data are received in the receiving window, entering a dormant state, and waiting for uploading the reported data next time; if the confirmation character and the downlink data are not received in the receiving window, uploading the reported data again after the preset time length is exceeded;
203. step 201 and step 202 are repeated, if the confirmation character and the downlink data are not received within the preset uploading times, it indicates that the communication interaction fails, and the communication system directly enters into the sleep state.
3. The method according to claim 2, wherein the report data is uploaded to a gateway, and a receiving window with a preset time length is opened; after receiving the reported data, the gateway replies the confirmation character and the downlink data, and then the method further comprises the following steps:
and the gateway uploads the reported data to a server, so that the server identifies that the gateway replies the confirmation character and the downlink data.
4. The method of controlling a battery switch 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.
5. The method of controlling a battery switch according to claim 1, further comprising:
501. inquiring whether a data sending mark exists;
502. 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;
503. inquiring whether the confirmation character is received, if the confirmation character is received, returning to the step 501;
504. if the confirmation character is not received, inquiring an overtime retransmission mark;
505. if receiving the overtime retransmission mark, judging whether the current retransmission times reach the preset uploading times or not;
506. 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; when the retransmission times reaches the preset uploading times, the sending of the current pop-up data is stopped, and the step 501 is returned.
6. A control device for a battery switch, comprising:
the first uploading unit is used for uploading the reported data to the gateway;
the gateway unit is used for replying a confirmation character after receiving the reported data and sending the reported data to a server;
the first dormancy unit is used for entering a dormant state after receiving the confirmation character and waiting for uploading the reported data next time;
and the storage and packaging unit is used for storing the downlink data by the gateway when the gateway receives the downlink data issued by the server, and packaging and replying the confirmation characters and the downlink data by the gateway until the reported data is received again.
7. The control device of the battery switch according to claim 6, further comprising:
the second uploading unit is used for uploading the reported data to the gateway and opening a receiving window with a preset time length; after receiving the reported data, the gateway replies the confirmation character and the downlink data;
a second sleep unit, configured to enter a sleep state if the acknowledgment character and the downlink data are received in the receiving window, and wait for uploading the reported data next time; if the confirmation character and the downlink data are not received in the receiving window, uploading the reported data again after the preset time length is exceeded;
and the repeated execution unit is used for repeatedly executing the steps of the second uploading unit and the second dormancy unit, and if the confirmation character and the downlink data are not received within the preset uploading times, the communication interaction fails at the time, and the communication system directly enters a dormancy state.
8. The control device of the battery switch according to claim 7, further comprising:
and the gateway uploading unit is used for uploading the reported data to a server, so that the server identifies that the gateway replies the confirmation character and the downlink data.
9. The control device of the battery switch according to claim 6, further comprising:
the detection unit is used for detecting the current network state;
the first query unit is used for querying a newly generated data mark to be uploaded in real time when 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 a first-in first-out sequence and updating the state of the temporary storage queue if the newly generated data to be uploaded mark is inquired and the temporary storage queue is not fully loaded;
and the covering unit is used for 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 if the to-be-uploaded data mark is inquired and the queue is fully loaded.
10. The method of controlling a battery switch according to claim 6, further comprising:
the second inquiry unit is used for inquiring whether a data sending mark exists or not;
the popping unit is used for popping the data to be uploaded out of the temporary storage queue according to a first-in first-out principle when the data sending mark is inquired, sending the data to be uploaded to the gateway and updating the state of the current temporary storage queue;
a third query unit, configured to query whether the confirmation character is received, and if the confirmation character is received, return to the second query unit;
a fourth query unit, configured to query a timeout retransmission flag when the acknowledgment character is not received;
the judging unit is used for judging whether the current retransmission times reach the preset uploading times or not when the overtime retransmission mark is received;
the updating unit is used for resending the data to be uploaded to the gateway when the retransmission times do not reach the preset uploading times and updating the state of the temporary storage queue; and stopping sending the current pop-up data when the retransmission times reach the preset uploading times, and returning to the second query unit.
CN202111506276.3A 2021-12-10 2021-12-10 Control method and device for battery switch Pending CN114333276A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111506276.3A CN114333276A (en) 2021-12-10 2021-12-10 Control method and device for battery switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111506276.3A CN114333276A (en) 2021-12-10 2021-12-10 Control method and device for battery switch

Publications (1)

Publication Number Publication Date
CN114333276A true CN114333276A (en) 2022-04-12

Family

ID=81050685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111506276.3A Pending CN114333276A (en) 2021-12-10 2021-12-10 Control method and device for battery switch

Country Status (1)

Country Link
CN (1) CN114333276A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592429A (en) * 2012-01-18 2012-07-18 中山大学 Remote meter reading system based on EnOcean
CN110049128A (en) * 2019-04-19 2019-07-23 欧普照明股份有限公司 The control system of outdoor lighting based on Internet of Things
CN110493856A (en) * 2019-08-27 2019-11-22 南方电网科学研究院有限责任公司 Data frame retransmission method, device, equipment and the storage medium of wireless network suspend mode
CN110798534A (en) * 2019-11-11 2020-02-14 龙尚科技(上海)有限公司 Control method and control system of intelligent power-taking switch

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592429A (en) * 2012-01-18 2012-07-18 中山大学 Remote meter reading system based on EnOcean
CN110049128A (en) * 2019-04-19 2019-07-23 欧普照明股份有限公司 The control system of outdoor lighting based on Internet of Things
CN110493856A (en) * 2019-08-27 2019-11-22 南方电网科学研究院有限责任公司 Data frame retransmission method, device, equipment and the storage medium of wireless network suspend mode
CN110798534A (en) * 2019-11-11 2020-02-14 龙尚科技(上海)有限公司 Control method and control system of intelligent power-taking switch

Similar Documents

Publication Publication Date Title
US7376435B2 (en) Transferring multiple data units over a wireless communication link
CN100461752C (en) Wireless communication apparatus and wireless communication method
US7277419B2 (en) Supporting disparate packet based wireless communications
US7720063B2 (en) Method apparatus and system for accelerated communication
CN102148662B (en) Adjusting method and device for data transmitting speed
US6438108B1 (en) System for improved transmission of acknowledgements within a packet data network
WO2006113023A1 (en) Wirless communication system with collision avoidance protocol
CN101273648A (en) Methods, apparatus, and computer program products for adapting a transmission setting
CN107735985A (en) Electronic installation, its wireless communications method and non-transitory computer-readable storage media
CN102655447A (en) Uploading data transmission method and device
WO2006048969A1 (en) Transmitter apparatus
CN110661840A (en) Management delegation of transmission and acknowledgement of frames
CN109863782A (en) 5G congestion control
US20150117465A1 (en) Communication control apparatus and communication control method
CN101605128B (en) Method for carrying out communication by LINUX primary and secondary devices through Ethernet interface
CN104052676A (en) Transmitting channel and data processing method thereof
CN103096328A (en) Device, system and method used for multilink wireless data transmission
CN101369879A (en) Method and apparatus for requesting data retransmission
CN114333276A (en) Control method and device for battery switch
CN110048955A (en) Jamming control method, device, computer equipment and storage medium
CN103368690B (en) The transmission method of the audio/video information of mobile unit
CN105897452A (en) Data retransmission method and device
US8270288B2 (en) Method of parallel wireless communication
CN110266446A (en) A kind of method and apparatus based on SACK mode adjustment random ordering duration
CN114364000B (en) Single-fire switch control method and device

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: 20230105

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