CN109982417B - Sensor control method, sensor control device, sensor, and storage medium - Google Patents

Sensor control method, sensor control device, sensor, and storage medium Download PDF

Info

Publication number
CN109982417B
CN109982417B CN201910068697.9A CN201910068697A CN109982417B CN 109982417 B CN109982417 B CN 109982417B CN 201910068697 A CN201910068697 A CN 201910068697A CN 109982417 B CN109982417 B CN 109982417B
Authority
CN
China
Prior art keywords
mode
wireless sensor
wireless
working mode
sensor
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
CN201910068697.9A
Other languages
Chinese (zh)
Other versions
CN109982417A (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.)
Lumi United Technology Co Ltd
Original Assignee
Lumi United Technology 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 Lumi United Technology Co Ltd filed Critical Lumi United Technology Co Ltd
Priority to CN201910068697.9A priority Critical patent/CN109982417B/en
Publication of CN109982417A publication Critical patent/CN109982417A/en
Application granted granted Critical
Publication of CN109982417B publication Critical patent/CN109982417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0212Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave
    • H04W52/0216Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave using a pre-established activity schedule, e.g. traffic indication frame
    • 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
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/38Services specially adapted for particular environments, situations or purposes for collecting sensor information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/18Management of setup rejection or failure
    • 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 sensor control method, a sensor control device, a sensor and a storage medium, and relates to the technical field of communication. The method comprises the following steps: the connection state of the wireless sensor and the wireless center network equipment is detected, the connection state comprises a disconnection state and a communication state, then the current working mode of the wireless sensor is set according to the connection state, and different current working modes have different power consumptions. The working mode of the wireless sensor is set by detecting the connection state of the wireless sensor and the wireless center network equipment, the power consumption of the wireless sensor is reduced, and the service life of a battery of the wireless sensor is prolonged.

Description

Sensor control method, sensor control device, sensor, and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a sensor control method, a sensor control apparatus, a sensor, and a storage medium.
Background
With the development of the internet of things system, the number and the intelligence degree of the sensing layers in the internet of things are more and more valued. The wireless sensor network has the advantages of small size, low power consumption, convenience in deployment and the like, and is widely applied to the industry of the Internet of things. However, wireless sensor networks also face some challenges, such as maintenance of wireless sensors. Therefore, how to prolong the service life of the wireless sensor battery without affecting the user experience is a constantly pursued goal in the industry.
Disclosure of Invention
In view of the above problems, the present application provides a sensor control method, a sensor control device, a sensor, and a storage medium to reduce power consumption of a wireless sensor and to extend a service life of the wireless sensor.
In a first aspect, an embodiment of the present application provides a sensor control method, which is applicable to a wireless sensor, and the method includes: detecting the connection state of the wireless sensor and the wireless center network equipment, wherein the connection state comprises a disconnection state and a communication state; and setting the current working mode of the wireless sensor according to the connection state, wherein different current working modes have different power consumptions.
In a second aspect, an embodiment of the present application provides a sensor control device, including: the detection module is used for detecting the connection state of the wireless sensor and the wireless central network equipment, wherein the connection state comprises a disconnection state and a communication state; and the working module is used for setting the current working mode of the wireless sensor according to the connection state, and different current working modes have different power consumptions.
In a third aspect, an embodiment of the present application provides a sensor, including: memory, one or more processors, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed on the one or more processors, the one or more applications configured to perform the method of the first aspect as described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, where a program code is stored, and the program code may be called by a processor to execute the method according to the first aspect.
According to the sensor control method, the sensor control device, the sensor and the storage medium, the connection state of the wireless sensor and the wireless center network equipment is detected, the connection state comprises the disconnection state and the communication state, then the current working mode of the wireless sensor is set according to the connection state, and different current working modes have different power consumptions. Therefore, by detecting the connection state of the wireless sensor and the wireless center network equipment, the wireless sensor can be automatically switched to the working mode with optimal power consumption under the condition of not influencing the reliability and the function of the wireless sensor, so that the wireless sensor can still keep low power consumption when the wireless center network equipment is in an abnormal working state, and the service life of the battery of the wireless sensor is prolonged.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a diagram illustrating an application environment of a sensor control method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a sensor control method provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a sensor control method according to another embodiment of the present application;
fig. 4 is a schematic flowchart illustrating steps S310 to S320 in a sensor control method according to another embodiment of the present application;
FIG. 5 illustrates a block diagram of a sensor control device provided in an embodiment of the present application;
FIG. 6 shows a block diagram of a sensor for performing a sensor control method according to an embodiment of the present application;
fig. 7 illustrates a storage unit for storing or carrying program codes for implementing a sensor control method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, 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.
Existing wireless sensors typically need to join an established wireless network through some wireless communication protocol, such as ZigBee, bluetooth low energy network (BLE-mesh), wiFi, narrowband internet of things (NB-IoT), and other wireless communication protocols. Once the wireless sensor is added into the wireless network, handshake communication is performed between the wireless sensor and the network center device at an irregular time, so that data exchange between the network center device and the wireless sensor is facilitated, and meanwhile, the network center device can detect whether the working state of the wireless sensor is normal or not, and under the condition, the wireless sensor needs to be in an activation state at an irregular time, so that relatively large power consumption is caused.
Furthermore, when the wireless center network equipment is powered off or works abnormally due to faults, the wireless sensor can repeatedly try to reestablish communication with the wireless center network equipment, power consumption of the wireless sensor is greatly increased, and the service life of a battery of the wireless sensor cannot meet the expectation of a user.
In view of the above problems, the inventors have found and proposed a sensor control method, a sensor control apparatus, a sensor and a storage medium according to embodiments of the present application through long-term research, and set an operating mode of a wireless sensor by detecting a connection state between the wireless sensor and a wireless center network device, thereby reducing power consumption of the wireless sensor and prolonging a battery life of the wireless sensor.
An application environment to which the present application relates will be described below.
Referring to fig. 1, fig. 1 shows an intelligent control system 10 that can be used in the sensor control method provided in the embodiment of the present application, where the intelligent control system 10 includes a wireless sensor 11 and a wireless central network device 12. The wireless sensor 11 and the wireless center network device 12 are in communication connection through a wireless communication protocol, so that the wireless sensor 11 is added into a wireless network where the wireless center network device 12 is located.
In this embodiment, the wireless sensor 11 may be added to an established wireless network through a wireless communication protocol, specifically, the wireless communication protocol may be a wireless communication protocol such as ZigBee, low-power bluetooth network (BLE-mesh), wiFi, narrowband internet of things (NB-IoT), and it can be understood that the wireless sensor 11 establishes a connection with the wireless network through the wireless communication protocol, and the wireless communication protocols adopted for different wireless networks are different, and are not limited herein.
The wireless network also comprises a wireless center network device 12, the wireless center network device 12 can be connected with a wireless sensor network comprising at least one wireless sensor 11 through a communication protocol, and can also be connected with an external network through a same or different communication protocol in a wired or wireless manner, that is, the wireless center network device 12 is connected with the wireless network and the external network, so that conversion between the two communication protocols can be realized, a monitoring task is issued to the wireless sensor 11, and data collected by the wireless sensor 11 is forwarded to the external network, so that data interaction between the wireless sensor network and the external network is realized. It is understood that the wireless center network device 12 may be a gateway, a coordinator, or other devices that can interact with the wireless sensor network and the external network, and is not limited herein.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a sensor control method according to an embodiment of the present disclosure. As will be explained in detail below with respect to the embodiment shown in fig. 2, the method may specifically include the following steps:
step S110: and detecting the connection state of the wireless sensor and the wireless center network equipment.
In this embodiment, the connection state between the wireless sensor and the wireless central network device includes a disconnection state and a communication state. When the connection state is a communication state, the wireless sensor can normally communicate with the wireless center network equipment to realize data interaction; when the connection state is the disconnection state, the wireless sensor cannot communicate with the wireless center network equipment.
When the connection state is the communication state, the wireless sensor can normally communicate with the wireless center network equipment. The wireless sensor can report the collected information to the wireless center network equipment by collecting the information regularly or irregularly. As a mode, a preset threshold may be set for information acquired by the wireless sensor, when the acquired information exceeds the preset threshold, the currently acquired information is reported to the wireless central network device, and when the acquired information does not exceed the preset threshold, the heart rate information of the wireless sensor is periodically reported to the wireless central network device, so that the wireless central network device knows that the wireless sensor is still in a normal working state.
Specifically, when the acquired information of the wireless sensor does not exceed a preset threshold value, the wireless sensor reports heart rate information to the wireless center network device periodically, and the wireless center network device can judge whether the wireless sensor works normally by judging whether the wireless sensor reports the heart rate information according to a preset period. For example, when the wireless sensor does not report the heart rate information in the next preset period, the wireless center network device can judge that the wireless sensor fails to work normally, and at the moment, the wireless center network device can inform a user or contact related maintenance personnel to check the fault reason, so that the wireless sensor can be effectively monitored, and the maintenance is facilitated.
Further, when the wireless sensor fails to report the currently acquired information or the heart rate information to the wireless center network device, the connection state of the wireless sensor and the wireless center network device is a disconnection state. It should be noted that the connection state between the wireless sensor and the wireless central network device is a disconnected state, which may be caused by poor network signals where the wireless sensor is currently located, or may be caused by failure of the wireless central network device, and at this time, the wireless sensor stores network information therein, but cannot communicate with the corresponding wireless central network device.
Step S120: and setting the current working mode of the wireless sensor according to the connection state.
In this embodiment, the current operating mode of the wireless sensor may include a normal operating mode, a sub-health operating mode, and an abnormal operating mode.
When the connection state of the wireless sensor and the wireless center network equipment is a communication state, the wireless sensor can normally communicate with the wireless center network equipment, the wireless center network equipment can normally receive information reported by the wireless sensor, the information includes information collected by the wireless sensor or heart rate information, and the wireless sensor is in a normal working mode at the moment.
When the connection state of the wireless sensor and the wireless center network equipment is switched to the disconnection state from the communication state, the wireless sensor fails to report currently acquired information or heart rate information to the wireless center network equipment, and the current working mode of the wireless sensor is switched to the sub-health working mode from the normal working mode. When the wireless sensor is in the sub-health mode of operation, the wireless sensor may attempt to rejoin the wireless network.
In some embodiments, the wireless sensor may periodically wake up to attempt to rejoin the wireless network through the RTC timer, and specifically, a wake-up period of the RTC timer is set through a micro-control unit in the wireless sensor, the wireless sensor is woken up according to the wake-up period, so that the wireless sensor performs network scanning again to attempt to rejoin the wireless network, the wireless sensor is woken up only according to the wake-up period, so that the wireless sensor is woken up only once in each wake-up period for reconnection, and the micro-control unit in the wireless sensor returns to a sleep mode after reconnection fails, so that the micro-control unit of the wireless sensor can be kept in the sleep mode for most of time without reconnection, and can be woken up quickly while maintaining low power consumption, so that the wireless sensor can maintain low power consumption, which is beneficial to prolong the battery service life of the wireless sensor. The wakeup period may be 1 second, 1 minute, 5 minutes, or the like, and the setup of the wakeup period may be non-adjustable with built-in program or customized by the user, which is not limited herein. It can be appreciated that by increasing the wake-up period, more power consumption can be reduced, and by decreasing the wake-up period, the wireless sensor can be facilitated to timely resume normal communication.
When the connection state of the wireless sensor and the wireless center network device is in a disconnection state for a long time, that is, the wireless center network device cannot rejoin the network within a preset time period after not receiving the heart rate information or the collected information on the wireless sensor, the current working mode of the wireless sensor is switched from a sub-health working mode to an abnormal working mode, and the lowest power consumption is kept, wherein the preset time period can be preset by a system or customized by a user, and the embodiment does not limit the preset time period. Further, when the wireless sensor is in the abnormal operation mode, the wireless sensor can rejoin the wireless network through the keys arranged on the wireless sensor shell, that is, when the wireless sensor is in the abnormal operation mode, the wireless sensor does not automatically try to rejoin the wireless network. Due to the fact that the wireless sensor is disconnected with the wireless center network equipment, connection can be restored after related personnel are required to overhaul due to the fact that the wireless sensor is possibly caused by faults of the wireless center network equipment, when the connection state of the wireless sensor and the wireless center network equipment is in the disconnection state for a long time, the current working mode of the wireless sensor is switched to the abnormal working mode, the wireless sensor does not try to rejoin the wireless network, power consumption of the wireless sensor due to the fact that the wireless sensor rejoins the network is reduced, the power consumption of the wireless sensor is kept at a low level, and the power consumption is effectively reduced.
Furthermore, through the keys arranged on the shell of the wireless sensor, the wireless sensor can rejoin the network, and after the wireless sensor rejoins the network successfully, the current working mode of the wireless sensor is switched from the abnormal working mode to the normal working mode. Specifically, in some embodiments, a network connection key is arranged on a housing of the wireless sensor, and by clicking the network connection key, the wireless sensor can be triggered to send a network access request to the wireless center network device so as to join the wireless network, and the wireless sensor is switched from an abnormal working mode to a normal working mode.
It should be noted that different current operating modes have different power consumptions, specifically, the current operating modes are sorted according to the power consumptions from high to low, and the sorting result is the sub-health operating mode, the normal operating mode, and the abnormal operating mode, that is, the power consumption of the sub-health operating mode > the power consumption of the normal operating mode > the power consumption of the abnormal operating mode. It can be understood that, when the wireless sensor is in the sub-health operating mode, attempting to rejoin the wireless network requires the wireless sensor to perform network scanning, send a request for authentication, and the like, and the consumption of the above process is higher than that of the wireless sensor in the normal operating mode for normal communication.
When the connection state of the wireless sensor and the wireless center network equipment is switched to the communication state from the disconnection state, the current working mode of the wireless sensor is switched to the normal working mode, and the use requirement of a user on the wireless sensor is met.
In a specific application scenario, a user installs a temperature sensor indoors, sets a temperature threshold to be 28 ℃, and sets a preset sampling period of the temperature sensor to be 5s, so that the temperature sensor collects temperature information every 5s, compares the collected temperature information with the temperature threshold, and reports the collected temperature information to the wireless central network device when the temperature information exceeds the temperature threshold. Specifically, when the temperature information acquired by the temperature sensor is 29 ℃, the temperature information acquired currently exceeds the temperature threshold value because the temperature is 29 ℃ and is higher than 28 ℃, and the temperature information acquired currently is reported to the wireless center network device. When the temperature information acquired by the temperature sensor is 27 ℃, the currently acquired temperature information is not reported to the wireless center network equipment at the moment because the temperature is 27 ℃ less than 28 ℃, namely the currently acquired temperature information does not exceed the temperature threshold. Further, after comparing the collected temperature information with the temperature threshold and reporting the collected temperature information to the wireless central network device when the temperature threshold is exceeded, the method may further include comparing the collected temperature information with a preset range of the temperature threshold, and reporting the collected temperature information to the wireless central network device again only when the temperature threshold is exceeded by the preset range, if the preset range is ± 0.5 ℃. Specifically, when the temperature information acquired by the temperature sensor is 28.3 ℃, the temperature information acquired currently exceeds the temperature threshold value due to the fact that the temperature is 28.3 ℃ and is higher than 28 ℃, and the temperature information acquired currently is reported to the wireless center network device; if the temperature information acquired by the temperature sensor next time is 28.4 ℃, the acquired temperature information is not reported to the wireless center network equipment again because the temperature of 28.4 ℃ is less than 28.5 ℃ and the preset range of the temperature threshold value is not exceeded.
Further, the period for reporting the heart rate information by the temperature sensor may also be set, for example, to 1 hour. When the temperature information acquired by the temperature sensor does not exceed the temperature threshold value within 1 hour, namely the wireless center network equipment does not receive the temperature information reported by the wireless sensor for 1 hour continuously, the temperature sensor reports the heart rate information to the wireless center network equipment, and the wireless center network equipment returns a corresponding response signal, so that the wireless sensor can confirm that the wireless sensor and the wireless center network equipment are still in a communication state, and the wireless sensor is still in a normal working mode and can normally communicate. The heart rate information is reported regularly through the wireless sensor, the wireless center network equipment returns a corresponding response signal, the wireless center network equipment can find that the wireless sensor cannot work normally in time, the wireless sensor confirms the connection state of the wireless sensor and the wireless center network equipment in time, abnormal reasons can be found in time, the wireless sensor can respond to the abnormal conditions, and a user or related maintenance personnel can conveniently conduct troubleshooting.
Further, when the temperature sensor fails to report currently acquired information or heart rate information, and when the temperature sensor fails to report currently acquired information or heart rate information, the connection state of the temperature sensor and the wireless center network device is switched to a disconnection state from a communication state, retransmission is started, retransmission failure times are accumulated, when the retransmission failure times reach preset times, the current working mode of the temperature sensor is switched to a sub-health working mode from a normal working mode, the wireless sensor conducts network scanning again, the wireless sensor is tried to be added into a wireless network again, the wireless sensor is awakened every awakening period, the wireless sensor is only awakened once in each awakening period to be reconnected, and a micro control unit in the wireless sensor returns to a sleep mode after reconnection failure.
According to the sensor control method provided by one embodiment of the application, the connection state of the wireless sensor and the wireless center network equipment is detected, and then the current working mode of the wireless sensor is set according to the connection state. Therefore, by detecting the connection state of the wireless sensor and the wireless center network equipment, the wireless sensor can be automatically switched to the working mode with optimal power consumption under the condition of not influencing the reliability and the function of the wireless sensor, so that the wireless sensor can still keep low power consumption when the wireless center network equipment is in an abnormal working state, and the service life of the battery of the wireless sensor is prolonged.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a sensor control method according to another embodiment of the present application. As will be explained in detail with respect to the flow shown in fig. 3, the method may specifically include the following steps:
step S201: and detecting the connection state of the wireless sensor and the wireless center network equipment.
The detailed description of step S201 is referred to step S110, and is not repeated herein.
In this embodiment, after step S201, step S202a may be executed, and step S202b may also be executed, where:
when the connection state is switched from the communication state to the disconnection state, step S202a may be performed;
when the connection state is switched from the disconnection state to the communication state, step S202b may be performed.
Step S202a: and when the connection state is switched from the communication state to the disconnection state, retransmitting according to a preset retransmission mode, and accumulating retransmission failure times.
In this embodiment, when the wireless sensor fails to report the currently acquired information or the heart rate information to the wireless central network device, the connection state between the wireless sensor and the wireless central network device is switched from the communication state to the disconnection state.
In this embodiment, when the connection state is switched from the communication state to the disconnection state, the wireless sensor cannot report the acquired information or the heart rate information to the wireless central network device, and at this time, the wireless sensor sends the information of the report failure to the wireless central network device again according to a preset retransmission mode, and tries to report again. It can be understood that the retransmitted information may include information that fails to be reported, or may be other preset information, and through retransmission, the wireless sensor can acquire the information that fails to be reported, so as to avoid omission of information, and enable the wireless central network device to effectively monitor the state of the wireless sensor.
It should be noted that, when the connection state is switched from the communication state to the disconnection state, retransmission may be performed only once, or retransmission may be performed multiple times.
In some embodiments, when the connection state is switched from the communication state to the disconnection state, the wireless sensor performs retransmission according to a preset retransmission mode, and may retransmit the retransmission only once, and further, when the retransmission fails, the current operating mode of the wireless sensor may be switched from the normal operating mode to the sub-health operating mode. Therefore, power consumption caused by retransmission is effectively controlled, and the power consumption of the wireless sensor is reduced.
In other embodiments, when the connection state is switched from the communication state to the disconnection state, the wireless sensor retransmits according to a preset retransmission mode, and multiple retransmissions may be performed, so that the wireless sensor may perform multiple attempts. Specifically, if the current retransmission fails, after a retransmission interval, the reporting failure information may be sent to the wireless central network device again, and the retransmission interval may remain unchanged, may increase along a linear direction, and may increase along an exponential direction. Because the wireless sensor is possibly under the condition of unstable network signals, the wireless sensor fails to report information when reporting the information to the wireless central network equipment, so that the information which fails to report can be sent to the wireless central network equipment in time when the wireless sensor network signals are recovered by trying to retransmit for multiple times, the reporting timeliness is improved, and meanwhile, the higher power consumption caused by retransmission can be controlled while the reporting timeliness is ensured by controlling the retransmission frequency of the wireless sensor. Specifically, the preset retransmission mode may include a linear backoff mode or an exponential backoff mode. The linear back-off mode is to increase the retransmission interval linearly, and the exponential back-off mode is to increase the retransmission interval exponentially.
As one way, when the connection state is switched from the communication state to the disconnection state, retransmission is performed in a linear back-off manner, and the number of retransmission failures is accumulated. Specifically, the initial retransmission interval is x, the retransmission interval increases linearly, the second retransmission interval is 2x, and so on, which is not described herein again, and it can be understood that the nth retransmission interval is nx. When the connection state of the wireless sensor and the wireless center network equipment is switched to a disconnection state from a communication state, the wireless sensor initiates first retransmission to the wireless center network equipment, when the first retransmission fails, the accumulated retransmission failure times are 1, and after an initial retransmission interval x, second retransmission is initiated; when the second retransmission fails, the accumulated retransmission failure times is increased by one, namely the current retransmission failure times is 2, and after the second retransmission interval is 2x, the third retransmission is initiated. It is understood that the retransmission principles of the third, fourth, … and nth are substantially the same as the aforementioned retransmission principles, and are not described herein again. When the connection state of the wireless sensor and the wireless center network equipment is switched from a communication state to a disconnection state, the failed information is retransmitted and reported, the retransmission interval is increased linearly, the time interval between two retransmissions is continuously increased, and the retransmission frequency is reduced, so that the larger power consumption caused by retransmission can be reduced, and the service life of a battery of the wireless sensor is prolonged.
As another mode, when the connection state is switched from the communication state to the disconnection state, retransmission is performed in an exponential backoff manner, and the number of retransmission failures is accumulated. Specifically, the initial retransmission interval is x, the retransmission interval increases exponentially, and the second retransmission interval is x 2 By analogy, the description is not repeated herein, and it is understood that the nth retransmission interval is x n . When the connection state of the wireless sensor and the wireless center network equipment is switched to a disconnection state from a communication state, the wireless sensor initiates a first retransmission to the wireless center network equipment, when the first retransmission fails, the accumulated retransmission failure times are 1, and after an initial retransmission interval x, a second retransmission is initiated; when the second retransmission fails, the accumulated retransmission failure times is increased by one, namely the current retransmission failure times is 2, and the second retransmission interval x is 2 Thereafter, a third retransmission is initiated. It is understood that the retransmission principles of the third time, the fourth time, … and the nth time are substantially the same as the aforementioned retransmission principles, and are not described herein again. When the connection state of the wireless sensor and the wireless center network equipment is switched from a communication state to a disconnection state, the failed information is retransmitted, the retransmission interval is increased along an index, the time interval between two retransmissions is continuously increased, the increase amplitude is also continuously increased, the retransmission frequency can be greatly reduced compared with the linear increase of the retransmission interval, the larger power consumption caused by retransmission can be greatly reduced, and the service life of a battery of the wireless sensor is greatly prolonged.
In this embodiment, referring to fig. 3, after step S202a, step S203 may be executed.
Step S203: and when the retransmission failure times reach the preset times, switching the current working mode of the wireless sensor from the normal working mode to the sub-health working mode.
When the connection state of the wireless sensor and the wireless center network equipment is a communication state, the wireless sensor can normally communicate with the wireless center network equipment, the wireless center network equipment can normally receive information reported by the wireless sensor, the information includes information collected by the wireless sensor or heart rate information, and the wireless sensor is in a normal working mode at the moment.
When the connection state of the wireless sensor and the wireless center network equipment is switched to the disconnection state from the communication state, the wireless sensor fails to report currently acquired information or heart rate information to the wireless center network equipment, and the current working mode of the wireless sensor is switched to the sub-health working mode from the normal working mode. When the wireless sensor is in the sub-health operating mode, the wireless sensor may attempt to rejoin the wireless network, where the power consumption required by the wireless sensor is greater than the power consumption required in the normal operating mode.
In this embodiment, the preset times may be 1 time, 5 times, 10 times, and the like, and it can be understood that the smaller the preset times, the faster the wireless sensor can respond to the failure of the currently reported information, and the higher the preset times is, the higher the response speed of the wireless sensor in adjusting according to the connection state is, and meanwhile, the larger the preset times is, although the response speed of the wireless sensor is reduced, the power consumption of the wireless sensor can be reduced at the same time. Specifically, the preset times may be non-adjustable in the program, or may be set by the user through self-definition, and is not limited herein.
In this embodiment, when the retransmission failure times reaches the preset times, the current working mode of the wireless sensor is switched from the normal working mode to the sub-health working mode, so that the wireless sensor can respond to the connection state of the current wireless sensor and the wireless center network device, and the current working mode is automatically set according to the connection state. Therefore, the wireless sensor can automatically switch the current working mode to try to rejoin the network on the basis of keeping low power consumption, the power consumption is reduced, meanwhile, the current working mode can be automatically switched according to the connection state, the wireless sensor can automatically respond to the current environment, manual operation or inspection is not needed, the usability of the wireless sensor is improved, and the use complexity is reduced.
In a specific application scenario, for example, a user installs a temperature sensor indoors, sets a temperature threshold to be 28 ℃, and sets a preset sampling period of the temperature sensor to be 5s, so that the temperature sensor collects temperature information every 5s, compares the collected temperature information with the temperature threshold, and reports the collected temperature information to the wireless central network device when the temperature threshold is exceeded. Meanwhile, the period of reporting the heart rate information by the temperature sensor is set to 1 hour, for example. When the temperature sensor fails to report currently acquired information or heart rate information, the connection state of the temperature sensor and the wireless center network equipment is switched to a disconnection state from a communication state, retransmission is started, retransmission failure times are accumulated, and when the retransmission failure times reach preset times, the current working mode of the temperature sensor is switched to a sub-health working mode from a normal working mode.
In this embodiment, when the retransmission failure times do not reach the preset times and the retransmission is successful, the current working mode of the wireless sensor is kept to be the normal working mode, and the information which is not reported successfully is sent to the wireless central network device, so that after the wireless central network device recovers to be normal, the information which is not successfully received before abnormality can be obtained, and the information can be stored, which is beneficial to complete analysis of the current environment and monitoring of the wireless sensor and further monitoring of the environment where the current wireless sensor is located.
In some embodiments, information which is not successfully reported after the abnormality is added into the retransmission data packet one by one, and the retransmission data packet is sent to the wireless central network device during each retransmission, so that all the information which is not successfully reported is retransmitted during each retransmission, and when the wireless central network device recovers communication with the wireless sensor, all the information which is not successfully received before the abnormality can be acquired, so as to prevent data omission.
In a specific application scenario, for example, a user installs a temperature sensor indoors, sets a temperature threshold to be 28 ℃, and sets a preset sampling period of the temperature sensor to be 5s, so that the temperature sensor collects temperature information every 5s, compares the collected temperature information with the temperature threshold, and reports the collected temperature information to the wireless center network device when the temperature threshold is exceeded. When the network signal where the temperature sensor is currently located is not good, the temperature sensor cannot report the acquired first temperature information to the wireless center network device successfully. And at the moment, the temperature sensor starts a retransmission mechanism, retransmits the first temperature information to the wireless center network equipment according to a preset retransmission mode, before retransmission is successful, the temperature sensor also acquires that the second temperature information exceeds a temperature threshold value, namely the second temperature information is required to be reported to the wireless center network equipment, at the moment, the second temperature information is added into a retransmission data packet, the current retransmission data packet comprises the first temperature information and the second temperature information, before retransmission is successful, the temperature information which is not successfully reported is added into the retransmission data packet as in the previous step, and the whole retransmission data packet is sent to the wireless center network equipment during each retransmission. When the wireless central network equipment recovers communication with the wireless sensor, the wireless central network equipment can receive complete information before abnormity so as to prevent data omission, the information can be stored, complete analysis on the current environment is facilitated, and monitoring of the wireless sensor and monitoring of the environment where the wireless sensor is located are facilitated.
Step S204: and when the wireless sensor is in the sub-health working mode, sending a connection request to the wireless center network equipment according to a preset period.
In this embodiment, when the wireless sensor is in the sub-health operating mode, the wireless sensor and the wireless center network device cannot normally communicate within a time period lasting for at least one retransmission interval, and at this time, the connection request is sent to the wireless center network device according to a preset period, so that the wireless center network device can receive the connection request and respond to the connection request, and further the wireless sensor can rejoin the wireless network, so that the wireless sensor and the wireless center network device can recover normal communication.
The wakeup period of the wireless sensor in the preset period may be 1 second, 1 minute, 5 minutes, and the like, and the setting of the preset period may be non-adjustable with a built-in program, or may be set by a user through self-definition, which is not limited herein. It can be understood that more power consumption can be reduced by increasing the preset period, and the wireless sensor can timely recover normal communication by reducing the preset period.
In some embodiments, the wireless sensor may periodically wake up and attempt to rejoin the wireless network through the RTC timer, and specifically, a wake-up period of the RTC timer, that is, a preset period, is set through the micro control unit in the wireless sensor, and the wireless sensor is woken up according to the preset period, so that the wireless sensor performs network scanning again, and attempts to rejoin the wireless network, and the wireless sensor is woken up only according to the preset period, so that the wireless sensor is woken up only once in each preset period for reconnection, and the micro control unit in the wireless sensor returns to the sleep mode after reconnection fails, so that the wireless sensor can maintain low power consumption, which is beneficial to prolonging the service life of the battery of the wireless sensor.
Step S205: failure information is accumulated.
In this embodiment, the failure information includes at least one of the number of failures and a connection disconnection duration. The number of failures may be the number of times that the wireless sensor has not successfully joined the wireless network after sending the connection request to the wireless center network device when the wireless sensor is in the sub-health mode. The connection disconnection duration may be a duration consumed from the time when the wireless sensor is switched to the sub-health operating mode to the current time, or may be a duration consumed from the time when the connection state of the wireless sensor and the wireless center network device is switched from the communication state to the disconnection state to the current time.
Step S206: and judging whether the failure information meets a preset failure condition or not.
In this embodiment, the failure information includes at least one of the number of failures and the connection disconnection duration.
As one manner, the failure information may be failure times, accumulated failure information, and whether the failure information satisfies a preset failure condition, that is, whether the failure times exceed the preset failure times, when the failure times exceed the preset failure times, the failure information satisfies the preset failure condition, and when the failure times do not exceed the preset failure times, the failure information does not satisfy the preset failure condition. The preset failure times may be 1 time, 5 times, 10 times, etc. It can be understood that the smaller the preset times, the faster the wireless sensor can respond to the current situation of failing to rejoin the wireless network, and the faster the response speed of the wireless sensor, while the larger the preset times, the faster the response speed of the wireless sensor is reduced, but the power consumption of the wireless sensor can be reduced at the same time. Specifically, the preset number may be set by a user, and is not limited herein.
As another mode, the failure information may be a continuous disconnection time length, the failure information is accumulated, and whether the failure information satisfies a preset failure condition is determined, that is, whether the continuous disconnection time length exceeds the preset disconnection time length is determined, when the continuous disconnection time length exceeds the preset disconnection time length, the failure information satisfies the preset failure condition is determined, and when the continuous disconnection time length does not exceed the preset disconnection time length, the failure information does not satisfy the preset failure condition is determined. Wherein the preset off-time period may be 1 second, 1 minute, 5 minutes, etc. It can be understood that more power consumption can be reduced by increasing the preset disconnection time, and the wireless sensor can timely rejoin the network and recover normal communication with the wireless center network device by reducing the preset disconnection time. Specifically, the preset off-time may be set by a built-in program, or may be set by a user through self-definition, which is not limited herein.
In this embodiment, when the failure information does not satisfy the preset failure condition, step S201 may be executed to detect a connection state between the wireless sensor and the wireless center network device, and switch the connection state from a disconnection state to a communication state.
Step S207: and when the failure information meets the preset failure condition, switching the current working mode of the wireless sensor from the sub-health working mode to the abnormal working mode.
In this embodiment, the power consumption of the wireless sensor in the abnormal operating mode is lower than the power consumption of the wireless sensor in the sub-health operating mode. When the failure information meets the preset failure condition, the current working mode of the wireless sensor is switched from the sub-health working mode to the abnormal working mode, so that the wireless sensor cannot be added into a wireless network again, and when the wireless sensor cannot recover normal communication with wireless center network equipment, the current working mode can be automatically switched according to the connection state, the wireless sensor can automatically respond to the current environment, manual operation or inspection is not needed, the usability of the wireless sensor is improved, the power consumption of the wireless sensor is reduced while the use difficulty is reduced, and the service life of a battery of the wireless sensor is prolonged.
Step S208: and when the current working mode of the wireless sensor is switched from the sub-health working mode to the abnormal working mode, switching the current running mode of the micro-control unit from the sleep mode to the deep sleep mode.
In this embodiment, different current operating modes of the micro control unit correspond to different power consumptions, and it can be understood that the power consumption of the wireless sensor can be changed by switching the current operating mode of the micro control unit, and the power consumption of the wireless sensor can be automatically adjusted by automatically adjusting the current operating mode of the micro control unit. As an embodiment, the optimal power consumption may be achieved by setting the current operation mode of the micro control unit.
Further, the current operation mode of the micro control unit includes a deep sleep mode, a sleep mode, and a normal operation mode. Wherein:
when the micro control unit is in the deep sleep mode, the micro control unit can be awakened only through the external I/O port, the corresponding power consumption is the lowest, but the time required from the awakening to the normal operation mode is longer, and the startup mode of the awakening from the deep sleep mode can also be called as cold startup;
when the micro control unit is in a sleep mode, the micro control unit can be awakened through an external I/O port or an RTC timer, the corresponding power consumption is higher than that of a deep sleep mode, the time required from the awakening to a normal operation mode is short, and the start mode of the awakening from the sleep mode can also be a warm start mode;
when the micro control unit is in a normal operation mode, data interaction can be carried out with wireless center network equipment or the outside, and the corresponding power consumption is highest at the moment.
In this embodiment, when the current working mode of the wireless sensor is switched from the sub-health working mode to the abnormal working mode, the current operating mode of the micro control unit is switched from the sleep mode to the deep sleep mode, that is, the RTC wake-up function of the micro control unit is turned off, so that the wireless sensor cannot be periodically woken up to try to rejoin the wireless network, and power consumption of the wireless sensor is greatly reduced. Meanwhile, when the current operation mode of the micro control unit is in the deep sleep mode, the micro control unit can only be awakened from the I/O port, namely the micro control unit can be awakened only when an external event is triggered, the operation of rejoining the wireless network is started, and the micro control unit tries to restore normal communication with the wireless center network equipment again.
In some embodiments, the mcu may attempt to rejoin the wireless network by detecting a network entry command while in the deep sleep mode. Specifically, the network access can be triggered through a key arranged on the wireless sensor shell, and the wireless sensor shell tries to rejoin the wireless network. As one mode, a network connection key is arranged on a shell of the wireless sensor, and by clicking the network connection key, the wireless sensor can be triggered to send a network access request to the wireless center network device so as to join the wireless network, and the wireless sensor is switched from an abnormal working mode to a normal working mode.
Further, when the wireless sensor successfully attempts to rejoin the wireless network, the current working mode of the wireless sensor is switched from the abnormal working mode to the normal working mode, and normal communication is recovered with the wireless center network equipment. When the wireless sensor fails to attempt to rejoin the wireless network, the current working mode of the wireless sensor is kept in the abnormal working mode, the current lowest power consumption is maintained, and the service life of the battery of the wireless sensor is prolonged.
In a specific application scenario, for example, a user installs a temperature sensor indoors, sets a temperature threshold to be 28 ℃, and sets a preset sampling period of the temperature sensor to be 5s, so that the temperature sensor collects temperature information every 5s, compares the collected temperature information with the temperature threshold, and reports the collected temperature information to the wireless center network device when the temperature threshold is exceeded. When the temperature sensor fails to report the currently acquired information or the heart rate information, the connection state of the temperature sensor and the wireless center network equipment is switched to a disconnection state from a communication state, retransmission is started, retransmission failure times are accumulated, when the retransmission failure times reach preset times, the current working mode of the temperature sensor is switched to a sub-health working mode from a normal working mode, so that the wireless sensor carries out network scanning again, the wireless sensor is awakened according to a preset period and tries to rejoin a wireless network,
in the present embodiment, after step S201, step S202b may be performed.
Step S202b: and when the connection state is switched from the disconnection state to the communication state, switching the current working mode of the wireless sensor to the normal working mode.
In this embodiment, the connection state is switched from the disconnection state to the communication state, and may be triggered by the wireless sensor according to the wireless network state where the wireless sensor is located, or may be triggered by an external event.
As one mode, the connection state of the wireless sensor and the wireless center network device is switched from the disconnection state to the communication state, which may be triggered by the wireless sensor according to the wireless network state of the wireless sensor. Specifically, when the wireless sensor is in the sub-health working mode, a connection request is sent to the wireless center network equipment according to a preset period to try to rejoin the wireless network, failure information is accumulated, when the failure information does not meet a preset failure condition, the connection state of the wireless sensor and the wireless center network equipment is detected, the connection state is switched from a disconnection state to a communication state, and at the moment, the current working mode of the wireless sensor is switched to a normal working mode. The wireless sensor can automatically rejoin the wireless network under the abnormal condition, automatically try to recover normal communication with the wireless center network equipment, switch from the sub-health working mode with larger power consumption to the normal working mode with smaller power consumption, recover the use function of the wireless sensor for users in time and reduce the power consumption of the wireless sensor.
The detailed description of the wireless sensor attempting to rejoin the wireless network can be seen in steps S204-S206, which are not described herein again.
Alternatively, the connection state of the wireless sensor and the wireless center network device is switched from the disconnection state to the communication state, which may be triggered by an external event. Specifically, when the wireless sensor is in an abnormal working mode, the wireless sensor receives an external event trigger to be awakened, starts the operation of rejoining the wireless network, and tries to recover normal communication with the wireless center network equipment again. In some embodiments, when the wireless sensor is in an abnormal operation mode, the micro control unit of the wireless sensor is in a deep sleep mode, and at this time, the wireless sensor may attempt to rejoin the wireless network by detecting a network access instruction. When the wireless sensor is successfully added into the wireless network again and normal communication is recovered with the wireless center network equipment, the connection state of the wireless sensor is switched from the disconnection state to the communication state, and the wireless sensor is switched to the normal working mode. Therefore, the wireless sensor is switched to the normal working mode from the abnormal working mode which can not normally realize the function, the use function of the wireless sensor to the user is timely recovered, and the inconvenience caused by the abnormal network to the use of the user is reduced.
The step S208 can be seen in the detailed description of switching the wireless sensor from the abnormal operating mode to the normal operating mode, which is not described herein again.
Further, referring to fig. 4, fig. 4 is a schematic flow chart illustrating steps S310 to S320 in the present embodiment, and the following details are set forth with respect to the flow chart illustrated in fig. 4, and the details are as follows:
step S310: and acquiring a mode switching instruction.
In this embodiment, the mode switching instruction may be triggered by an external event, specifically, may be triggered by a key disposed on the wireless sensor housing, so as to implement mode switching.
Step S320: and switching the current working mode of the wireless sensor to the non-network-access mode according to the mode switching instruction.
In this embodiment, the current operating mode of the wireless sensor further includes an unconnected mode, and it should be noted that when the wireless sensor is in the unconnected mode, the wireless sensor is disconnected from the wireless network and does not operate, and at this time, the power consumption required by the wireless sensor is the lowest. The current working mode of the wireless sensor is switched to the non-network-access mode, so that the wireless sensor can keep the lowest power consumption, the power consumption of the wireless sensor is reduced, and the service life of the wireless sensor is prolonged.
Specifically, the wireless sensor can be disconnected from the wireless network through the keys arranged on the shell of the wireless sensor, and the wireless sensor is disconnected from the wireless central network equipment, so that the current working mode of the wireless sensor is switched to the non-network-access mode. In some embodiments, a network connection key is arranged on a shell of the wireless sensor, the wireless sensor can be triggered to send a network access request to the wireless center network equipment by clicking the network connection key so as to join a wireless network, and meanwhile, the wireless sensor and the wireless center network equipment can be triggered to be disconnected by long pressing the network connection key, so that the current working mode of the wireless sensor is switched to a non-network access mode, the power consumption of the wireless sensor is reduced to the lowest level, the power consumption of the wireless sensor is greatly reduced, and the service life of the wireless sensor is prolonged.
According to the sensor control method provided by the embodiment, the current working mode of the wireless sensor is switched by detecting the connection state of the wireless sensor and the wireless center network equipment, so that the wireless sensor can automatically retransmit when the reported information fails, and automatically try to rejoin the wireless network to recover normal communication between the wireless sensor and the wireless center network equipment when the retransmission failure times reach the preset times, and when the reconnection failure information meets the preset failure condition, the sensor control method is automatically switched to the abnormal working mode to keep low power consumption. Therefore, the wireless sensor can automatically enter the working mode with optimal power consumption according to the wireless network state of the wireless sensor without influencing the reliability and the function of the wireless sensor, so that the wireless sensor can still keep lower power consumption when the wireless center network equipment is in an abnormal working state, and the service life of the battery of the wireless sensor is prolonged.
Referring to fig. 5, fig. 5 is a block diagram illustrating a sensor control device according to an embodiment of the present disclosure. As will be explained below with respect to the block diagram of fig. 5, the sensor control device 400 includes: a detection module 410 and an operation module 420, wherein:
a status module 410, configured to detect a connection status between the wireless sensor and the wireless center network device.
The working module 420 is configured to set a current working mode of the wireless sensor according to the connection state, where different current working modes have different power consumptions.
Further, the working module 420 includes an information retransmission unit, a retransmission switching unit, a connection request unit, a communication switching unit, a mode instruction obtaining unit, and a mode instruction switching unit, wherein:
and the information retransmission unit is used for retransmitting according to a preset retransmission mode when the connection state is switched from the communication state to the disconnection state.
And the retransmission switching unit is used for switching the current working mode of the wireless sensor from the normal working mode to the sub-health working mode when retransmission fails.
And the connection request unit is used for sending a connection request to the wireless center network equipment according to a preset period when the wireless sensor is in the sub-health working mode.
And the communication switching unit is used for switching the current working mode of the wireless sensor to the normal working mode when the connection state is switched from the disconnection state to the communication state.
And the mode instruction acquisition unit is used for acquiring a mode switching instruction.
And the mode instruction processing unit is used for switching the current working mode of the wireless sensor to a non-network-access mode according to a mode switching instruction, wherein the power consumption of the wireless sensor in the non-network-access mode is the lowest.
Further, the information retransmission unit includes an accumulated information retransmission subunit, wherein:
and the failure frequency accumulation subunit is used for retransmitting according to a preset retransmission mode and accumulating the retransmission failure frequency.
Further, the retransmission switching unit includes an accumulative retransmission switching subunit, wherein:
and the accumulative retransmission switching subunit is used for switching the current working mode of the wireless sensor from the normal working mode to the sub-health working mode when the retransmission failure times reach the preset times.
Further, the sensor control device 400 further includes: failure accumulation module, condition judgment module, operation mode switch module, wherein:
and the failure accumulation module is used for accumulating failure information, wherein the failure information comprises at least one of failure times and connection and disconnection duration.
And the condition judgment module is used for judging whether the failure information meets a preset failure condition or not.
And the mode switching module is used for switching the current working mode of the wireless sensor from the sub-health working mode to the abnormal working mode when the failure information meets the preset failure condition. Wherein the power consumption of the wireless sensor in the abnormal operating mode is lower than the power consumption of the wireless sensor in the sub-health operating mode.
And the operation mode switching module is used for setting the current operation mode of the micro control unit according to the current working mode. The current operation mode of the micro control unit comprises a deep sleep mode, a sleep mode and a normal operation mode.
Further, the operation mode switching module includes an operation mode switching unit, wherein:
and the operation mode switching unit is used for switching the current operation mode of the micro control unit from the sleep mode to the deep sleep mode when the current operation mode of the wireless sensor is switched from the sub-health operation mode to the abnormal operation mode. The time required by the micro control unit to wake up from the sleep mode to the normal operation mode is shorter than the time required by the micro control unit to wake up from the deep sleep mode to the normal operation mode.
The embodiment of the application provides a sensor control device, which switches the current working mode of a wireless sensor by detecting the connection state of the wireless sensor and a wireless center network device, so that the wireless sensor can automatically retransmit when reporting information fails, automatically tries to rejoin a wireless network when the retransmission failure times reach preset times so as to restore normal communication between the wireless sensor and the wireless center network device, and automatically switches to an abnormal working mode when the reconnection failure information meets preset failure conditions, thereby keeping lower power consumption. Therefore, the wireless sensor can automatically enter the working mode with optimal power consumption according to the wireless network state of the wireless sensor without influencing the reliability and the function of the wireless sensor, so that the wireless sensor can still keep lower power consumption when the wireless center network equipment is in an abnormal working state, and the service life of the battery of the wireless sensor is prolonged.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described devices and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
A sensor provided by the present application will be described with reference to fig. 6.
Referring to fig. 6, based on the sensor control method and apparatus, an embodiment of the present application further provides a sensor 500 capable of executing the sensor control method.
The sensor 500 in the present application may include one or more of the following components: a processor 510, a memory 520, and one or more applications, wherein the one or more applications may be stored in the memory 520 and configured to be executed by the one or more processors 510, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 510 may include one or more processing cores, among other things. The processor 510 interfaces with various components throughout the sensor 500 using various interfaces and wires to perform various functions of the sensor 500 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 520 and invoking data stored in the memory 520. Alternatively, the processor 510 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 510 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 510, but may be implemented by a communication chip.
The Memory 520 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 520 may be used to store instructions, programs, code sets, or instruction sets. The memory 520 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a key function, an LED indication function, a sensor signal acquisition function, etc.), instructions for implementing various method embodiments described below, and the like. The stored data area may also store data created during use by the sensor 500 (e.g., sensor calibration parameters, system operating parameter data, sensor sampling data), and the like.
Referring to fig. 7, a block diagram of a computer-readable storage medium according to an embodiment of the present disclosure is shown. The computer-readable storage medium 600 has stored therein program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 600 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 600 includes a non-volatile computer-readable storage medium. The computer readable storage medium 600 has storage space for program code 610 for performing any of the method steps described above. The program code can be read from and written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.
In summary, according to the sensor control method, the sensor control device, the sensor and the storage medium provided in the embodiments of the present application, the connection state of the wireless sensor is an off-network state or a networking state, then the current operating mode of the wireless sensor is set according to the connection state, and finally the current operating mode of the micro control unit is set according to the current operating mode, where different current operating modes have different power consumptions. Therefore, the working modes of hardware and software of the wireless sensor are set by detecting the network state of the wireless sensor, so that the wireless sensor can realize optimal power consumption under the condition of not influencing the reliability and the function.
In the description of the present specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
Any process or method descriptions in flow diagrams or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
The logic and/or steps represented in the flowchart or otherwise described herein, e.g., as a sequential list of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (mobile terminal) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments. In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and 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 sensor control method adapted for a wireless sensor including a micro control unit, the method comprising:
detecting the connection state of the wireless sensor and wireless center network equipment, wherein the connection state comprises a disconnection state and a communication state;
setting the current working mode of the wireless sensor according to the connection state; the current working mode comprises a normal working mode, a sub-health working mode and an abnormal working mode, different current working modes have different power consumptions, and the power consumption of the abnormal working mode is lower than the power consumptions of the normal working mode and the sub-health working mode;
if the connection state is switched from the communication state to the disconnection state, switching the current working mode from a normal working mode to a sub-health working mode, switching the current running mode of the micro control unit to a sleep mode, adding data to be transmitted into a retransmission data packet, and performing network reconnection so as to retransmit the retransmission data packet after communication is recovered; the micro control unit can be rapidly awakened by warm start in a sleep mode;
if the time length of the connection state in the disconnection state reaches a preset time length, switching the sub-health working mode to an abnormal working mode, and switching the current operation mode of the micro control unit from a sleep mode to a deep sleep mode; the micro control unit can be awakened through cold starting when in a deep sleep mode;
and when the micro control unit is in a deep sleep mode, responding to an external awakening operation to awaken the deep sleep mode to a normal operation mode, and trying to rejoin the network so as to switch the current operation mode of the wireless sensor to the normal operation mode after communication is recovered.
2. The method of claim 1, wherein said setting a current operating mode of said wireless sensor based on said connection status comprises:
when the connection state is switched from the communication state to the disconnection state, retransmitting according to a preset retransmission mode;
when the retransmission fails, switching the current working mode of the wireless sensor from a normal working mode to a sub-health working mode;
and when the wireless sensor is in the sub-health working mode, sending a connection request to wireless center network equipment according to a preset period.
3. The method as claimed in claim 2, wherein when the connection status is switched from the communication status to the disconnection status, the retransmitting according to a predetermined retransmission method comprises:
retransmitting according to a preset retransmission mode, and accumulating retransmission failure times;
when the retransmission fails, switching the current working mode of the wireless sensor from a normal working mode to a sub-health working mode, including:
and when the retransmission failure times reach preset times, switching the current working mode of the wireless sensor from a normal working mode to a sub-health working mode.
4. The method of claim 2 or 3, wherein after sending the connection request to the wireless center network device according to the preset period, the method further comprises:
accumulating failure information, wherein the failure information comprises at least one of failure times and connection and disconnection duration;
judging whether the failure information meets a preset failure condition or not;
and when the failure information meets a preset failure condition, switching the current working mode of the wireless sensor from the sub-health working mode to an abnormal working mode.
5. The method of claim 1, wherein said setting a current operating mode of said wireless sensor based on said connection status comprises:
and when the connection state is switched from the disconnection state to the communication state, switching the current working mode of the wireless sensor to a normal working mode.
6. The method of claim 1, wherein said setting a current operating mode of said micro-control unit based on said current operating mode comprises:
when the current working mode of the wireless sensor is switched from a sub-health working mode to an abnormal working mode, the time required by the micro control unit to wake up from the sleep mode to a normal running mode is shorter than the time required by the micro control unit to wake up from the deep sleep mode to the normal running mode.
7. The method of claim 1, wherein said setting a current operating mode of said wireless sensor based on said connection status further comprises:
acquiring a mode switching instruction;
and switching the current working mode of the wireless sensor to a non-network-access mode according to the mode switching instruction, wherein the power consumption of the wireless sensor in the non-network-access mode is the lowest.
8. A sensor control device adapted for use with a wireless sensor including a micro control unit, comprising:
the detection module is used for detecting the connection state of the wireless sensor and the wireless center network equipment, wherein the connection state comprises a disconnection state and a communication state;
the working module is used for setting the current working mode of the wireless sensor according to the connection state; the current working mode comprises a normal working mode, a sub-health working mode and an abnormal working mode, different current working modes have different power consumptions, and the power consumption of the abnormal working mode is lower than the power consumptions of the normal working mode and the sub-health working mode;
the operation mode switching unit is used for switching the current operation mode from a normal operation mode to a sub-health operation mode if the connection state is switched from a communication state to a disconnection state, switching the current operation mode of the micro control unit to a sleep mode, adding data to be transmitted into a retransmission data packet, performing network reconnection, and retransmitting the retransmission data packet after communication is recovered; the micro control unit can be quickly awakened by warm starting in a sleep mode;
the operation mode switching unit is further used for switching the sub-health operation mode to an abnormal operation mode and switching the current operation mode of the micro control unit from a sleep mode to a deep sleep mode if the time length of the connection state in the disconnection state reaches a preset time length; the micro control unit can be awakened through cold starting when in a deep sleep mode;
the operation mode switching unit is also used for responding to an external awakening operation to awaken the deep sleep mode to a normal operation mode when the micro control unit is in the deep sleep mode, and trying to rejoin the network so as to switch the current operation mode of the wireless sensor to the normal operation mode after communication is recovered.
9. A sensor, comprising:
a memory;
one or more processors coupled with the memory;
one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN201910068697.9A 2019-01-24 2019-01-24 Sensor control method, sensor control device, sensor, and storage medium Active CN109982417B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910068697.9A CN109982417B (en) 2019-01-24 2019-01-24 Sensor control method, sensor control device, sensor, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910068697.9A CN109982417B (en) 2019-01-24 2019-01-24 Sensor control method, sensor control device, sensor, and storage medium

Publications (2)

Publication Number Publication Date
CN109982417A CN109982417A (en) 2019-07-05
CN109982417B true CN109982417B (en) 2023-04-07

Family

ID=67076690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910068697.9A Active CN109982417B (en) 2019-01-24 2019-01-24 Sensor control method, sensor control device, sensor, and storage medium

Country Status (1)

Country Link
CN (1) CN109982417B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602772A (en) * 2019-09-12 2019-12-20 Oppo(重庆)智能科技有限公司 WiFi module control method, control device, electronic device and storage medium
CN112825589B (en) * 2019-11-21 2022-03-11 维沃移动通信有限公司 Method and terminal for entering dormancy behavior
CN112037494A (en) * 2020-08-05 2020-12-04 中车工业研究院有限公司 Wireless vibration data acquisition device
CN111918236B (en) * 2020-08-10 2021-08-31 上海顺舟智能科技股份有限公司 Internet of things security sensor network searching method, device, equipment and storage medium
CN112929954B (en) * 2021-03-27 2022-11-08 北京昆仑海岸科技股份有限公司 Control method of wireless sensor
CN114189015A (en) * 2021-12-06 2022-03-15 深圳市赋安安全系统有限公司 Battery power saving method and system
CN114245483B (en) * 2021-12-23 2023-12-12 广州思德医疗科技有限公司 Communication monitoring reconnection method and system for gastroenteroscope capsule

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916201A (en) * 2010-08-06 2010-12-15 中兴通讯股份有限公司 Android-based mobile terminal cold-boot method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6510144B1 (en) * 1999-12-07 2003-01-21 Cisco Technology, Inc. Network layer support to enhance the transport layer performance in mobile and wireless environments
US7313105B1 (en) * 2000-09-26 2007-12-25 Nortel Networks Limited Mechanism and method to select a time delay in response to a collision
JP3972630B2 (en) * 2001-10-24 2007-09-05 株式会社明電舎 Ethernet variable transmission system
US8934450B2 (en) * 2007-03-08 2015-01-13 Telefonaktiebolaget L M Ericsson (Publ) Mobile station with a semi-active mode
US8238312B2 (en) * 2008-11-10 2012-08-07 Xg Technology, Inc. Heterogeneous back-off mechanism to decrease latency in mobile IP telephony
US9564958B2 (en) * 2013-08-08 2017-02-07 Intel IP Corporation Power saving mode optimizations and related procedures
AU2014355732B2 (en) * 2013-11-27 2017-04-13 Sony Corporation Communication control apparatus, communication control method, and information processing apparatus
EP3202213B1 (en) * 2014-10-01 2019-12-04 Telefonaktiebolaget LM Ericsson (PUBL) Rlc delivery failure resolution

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916201A (en) * 2010-08-06 2010-12-15 中兴通讯股份有限公司 Android-based mobile terminal cold-boot method and device

Also Published As

Publication number Publication date
CN109982417A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN109982417B (en) Sensor control method, sensor control device, sensor, and storage medium
CN107466095B (en) Energy-saving method for acquisition equipment and acquisition equipment
EP2728948B1 (en) Method, device and storage medium for adjusting wake-up period of terminal
KR100857050B1 (en) Communication unit energy conservation apparatus and method
EP3190771B1 (en) Method and device for managing instant communication application program, and mobile terminal thereof
CN106557407B (en) Method and device for monitoring equipment load
WO2001030048A2 (en) Notification of low-battery in a wireless network
WO2020253417A1 (en) Lorawan-based electric transmission line monitoring device and system
KR20060066709A (en) System and method for wake on wireless lan
CN109788536B (en) Sensor control method, sensor control device, sensor, and storage medium
WO2011137714A2 (en) Power supply management method and device
WO2019010778A1 (en) Backup method and system for internet of things repeater
CN112616178A (en) Energy consumption management method and device, electronic equipment and storage medium
CN106550438B (en) Method and system for limiting regular awakening and mobile device
CN112398661B (en) Equipment dormancy processing method and device, ioT equipment and storage medium
CN106912091B (en) Control method and device and electronic equipment
CN106980353B (en) Electronic device, control method and control device thereof
CN112601270A (en) Terminal wake-up control method and device, electronic equipment and storage medium
CN109996319B (en) Beacon signal processing device
CN107203455B (en) Method and system for preventing over-discharge of standby power module when power-down fan of storage system is hung up
CN113920678B (en) Remote smoke alarm system on M5311 chip based on middle moving object
CN113784317B (en) Method, device, equipment and medium for preventing screen-throwing initialization from causing sleep failure of car machine
CN111935803A (en) Equipment awakening method and device based on ZigBee communication protocol
JP5158511B2 (en) Wireless LAN communication network system, wireless LAN communication network system management program, and computer-readable storage medium storing wireless LAN communication network system management program
CN114384793B (en) Monitoring system of multiple intelligent devices and control method thereof

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
GR01 Patent grant
GR01 Patent grant