CN114666177B - Intelligent home early warning method, system, computer equipment and storage medium - Google Patents
Intelligent home early warning method, system, computer equipment and storage medium Download PDFInfo
- Publication number
- CN114666177B CN114666177B CN202210163927.1A CN202210163927A CN114666177B CN 114666177 B CN114666177 B CN 114666177B CN 202210163927 A CN202210163927 A CN 202210163927A CN 114666177 B CN114666177 B CN 114666177B
- Authority
- CN
- China
- Prior art keywords
- data
- sensor data
- sensor
- channel
- changed
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000005540 biological transmission Effects 0.000 claims abstract description 48
- 230000008859 change Effects 0.000 claims abstract description 24
- 238000004590 computer program Methods 0.000 claims description 22
- 230000005059 dormancy Effects 0.000 claims description 9
- 230000007958 sleep Effects 0.000 claims description 9
- 230000007717 exclusion Effects 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 claims description 7
- 238000013461 design Methods 0.000 claims description 5
- 238000012986 modification Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims description 4
- 230000001360 synchronised effect Effects 0.000 claims description 3
- 238000012544 monitoring process Methods 0.000 abstract description 6
- 238000004891 communication Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 238000005265 energy consumption Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 2
- 230000009365 direct transmission Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 240000007651 Rubus glaucus Species 0.000 description 1
- 235000011034 Rubus glaucus Nutrition 0.000 description 1
- 235000009122 Rubus idaeus Nutrition 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000149 penetrating effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/2823—Reporting information sensed by appliance or service execution status of appliance services in a home automation network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/38—Services specially adapted for particular environments, situations or purposes for collecting sensor information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. Transmission Power Control [TPC] or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0225—Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
- H04W52/0248—Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Alarm Systems (AREA)
- Telephonic Communication Services (AREA)
Abstract
The disclosure relates to an intelligent home early warning method, an intelligent home early warning system, computer equipment and a storage medium, and relates to the technical field of monitoring and early warning of the Internet of things. The method comprises the following steps: acquiring sensor data, and transmitting the sensor data to a first channel of a message queue telemetry transmission protocol through the message queue telemetry transmission protocol, wherein the sensor data is obtained by storing data acquired by a sensor into a cache through a limited application protocol; under the condition that data change is executed in a second channel of a message queue telemetry transmission protocol, the changed execution data is obtained, early warning operation is executed according to the changed execution data, and the changed execution data is obtained according to sensor data changed in the first channel and preset early warning conditions. By adopting the method, the resource consumption can be reduced, the running cost can be reduced, and the safety of the sensor in the data transmission process can be ensured.
Description
Technical Field
The disclosure relates to the technical field of monitoring and early warning of the internet of things, in particular to an intelligent home early warning method, an intelligent home early warning system, computer equipment and a storage medium.
Background
The development of wireless sensor networks originally originated in military applications such as battlefield monitoring. The system is composed of a large number of tiny sensor nodes which are deployed in an action area and have wireless communication and calculation capabilities in a self-organizing mode, and is a distributed intelligent network system capable of automatically completing specified tasks according to environments. However, with the development of society, the wireless sensor network is used in a wider and wider range. Especially in the field of smart home applications.
However, the following problems exist in the application field of the intelligent home in the current wireless sensor network application: (1) The existing sensor consumes energy and has high cost when operated for a long time to transmit data. And (2) the security of the sensor is lower when the sensor transmits data.
Disclosure of Invention
Based on the foregoing, it is necessary to provide an intelligent home early warning method, system, computer device and storage medium for reducing resource consumption, running cost and ensuring safety in the data transmission process.
In a first aspect, the present disclosure provides an intelligent home early warning method. The method comprises the following steps:
Acquiring sensor data, and transmitting the sensor data to a first channel of a message queue telemetry transmission protocol through the message queue telemetry transmission protocol, wherein the sensor data is obtained by storing data acquired by a sensor into a cache through a limited application protocol;
Under the condition that data change is executed in a second channel of a message queue telemetry transmission protocol, the changed execution data is obtained, early warning operation is executed according to the changed execution data, and the changed execution data is obtained according to sensor data changed in the first channel and preset early warning conditions.
In one embodiment, the sensor collects the sensor data according to a preset time period and stores the sensor data in the cache;
and after the sensor data is collected in the time period, the sensor enters a dormant state;
And when the running time of the sensor enters the next time period, exiting the dormant state, and continuously collecting the sensor data.
In one embodiment, the process of obtaining the modified execution data includes:
Acquiring the sensor data changed in the first channel;
and under the condition that the changed sensor data meets the preset early warning condition, changing the execution data, and transmitting the changed execution data to the second channel.
In one embodiment, the sensor data comprises at least, via multiline Cheng Huoqu: one or more of temperature data, humidity data, pressure data;
a synchronization lock and a mutual exclusion lock are used in acquiring the sensor data and the modified execution data.
In a second aspect, the disclosure further provides an intelligent home early warning system. The system comprises:
at least one sensor for collecting sensor data and transmitting the sensor data to a cache via a restricted application protocol;
The first application module is used for acquiring the sensor data in the cache and transmitting the sensor data to a first channel of the message queue telemetry transmission protocol through the message queue telemetry transmission protocol;
The cloud platform is used for acquiring the sensor data changed in the first channel and changing execution data according to the changed sensor data and preset early warning conditions;
And the second application module is used for acquiring the changed execution data under the condition that the execution data is changed, and executing early warning operation according to the changed execution data.
In one embodiment of the system, the sensor includes: the device comprises a period acquisition module, a dormancy module and a period calculation module;
The period acquisition module is used for acquiring the sensor data according to a preset time period and storing the sensor data into the cache;
The dormancy module is used for entering a dormancy state after collecting the sensor data in the time period;
And the period calculation module is used for exiting the sleep state when the running time of the sensor enters the next time period so that the sleep module can continuously collect the sensor data.
In one embodiment of the system, the cloud platform comprises: the system comprises a change data acquisition module, an execution data modification module and an execution data transmission module;
The change data acquisition module is used for acquiring the sensor data changed in the first channel;
the execution data changing module is used for changing the execution data under the condition that the changed sensor data meets the preset early warning condition;
and the execution data transmission module is used for transmitting the changed execution data to the second channel.
In one embodiment of the system, the first application module and the second application module each employ a multi-threaded design, and the sensor data includes at least: one or more of temperature data, humidity data, pressure data;
And when the first application module acquires the sensor data in the cache and the second application module acquires the changed execution data, a synchronous lock and a mutual exclusion lock are used.
In a third aspect, the present disclosure also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the steps of the above method when the processor executes the computer program.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method described below.
In a fifth aspect, the present disclosure also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of the above method.
In the above embodiments, the sensor data is stored in the cache through the limited application protocol. The problem of loss of the sensor data due to connection failure, which may occur, is avoided by direct transmission into the first channel. The size of the sensor data in the transmission process can be controlled by using a limited application protocol to transmit the sensor data in the intelligent home, and reliable transmission, data retransmission and block transmission are supported, so that reliable arrival of the sensor data can be ensured. Non-long connection communication can be performed, and energy consumption generated when sensor data are transmitted is reduced. And transmitting the sensor data via the message queue telemetry transport protocol into a first frequency channel of the message queue telemetry transport protocol. The sensor data changed in the first channel and the preset early warning condition can change the execution data in the second channel corresponding to the message queue telemetry transmission protocol, so that the interference between the execution data and the sensor data can be prevented, and the corresponding data can be transmitted in a small size when the sensor data is monitored for a long time or the execution data is changed through the message queue telemetry transmission protocol, so that the network flow is reduced, and the power consumption of the smart home is further reduced. Further, the application layer, the transmission layer and the network layer of the telemetry transmission protocol through the message queue improve the safety and reliability of transmitting sensor data and executing data.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the prior art, the drawings that are required in the detailed description or the prior art will be briefly described, it will be apparent that the drawings in the following description are some embodiments of the present disclosure, and other drawings may be obtained according to the drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a schematic diagram of an application environment of an intelligent home early warning method in one embodiment;
FIG. 2 is a flow chart of a smart home early warning method in one embodiment;
FIG. 3 is a flow chart of the sensor operation steps in one embodiment;
FIG. 4 is a flowchart illustrating steps for modifying execution data in one embodiment;
fig. 5 is a flow chart of an early warning method for smart home in another embodiment;
FIG. 6 is a schematic block diagram of an intelligent home early warning system according to one embodiment;
FIG. 7 is a schematic diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims herein and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
At present, the following technical schemes of the application of the wireless sensor network in the field of intelligent home application appear:
Intelligent home management and control system based on mobile phone APP and WIFI network control includes: the sensor acquisition data is directly sent to a cloud server through WI-FI and stored, a user can monitor the data in real time through a mobile phone APP, when abnormal data (such as excessive temperature caused by fire, excessive humidity caused by rain without window closing, and short circuit caused by electric appliances) occur, corresponding measures are taken, namely control signals are sent out, and the control signals are sent to equipment through the server, so that control over household appliances at any time and any place is realized. The ESP8266 serial port WIFI module is adopted in the scheme on the communication protocol, the communication protocol of a third party platform is used for interaction between the cloud server and the mobile phone APP, and autonomous development is not involved.
In conclusion, the technology designs a set of intelligent home management and control system based on the mobile phone APP and the WIFI network by utilizing the ESP8266 serial port WIFI module, the cloud Internet of things development platform and the singlechip control system.
However, this solution has the following drawbacks:
1. The sensor, cell-phone APP, communication interaction between the cloud platform all provides for the third party, and the dependence is high, and the flexibility ratio is low, is difficult to satisfy customized demand.
2. The sensor needs to be maintained regularly to maintain equipment and energy loss which continuously operate for a long time, and the maintenance cost is high.
3. Data security is difficult to secure using a public WI-FI network.
Intelligent home remote wireless monitoring system design based on the internet of things comprises: an intelligent home monitoring system is designed based on an S3C2440, embedded Web service, QT technology and wireless networking technology of an ARM920T kernel, and the system consists of an intelligent home host, a ZigBee/Wi-Fi wireless sensing control network and intelligent home client software. The system completes the hardware and software design of the intelligent home host computer: transplanting an embedded Linux operating system on the ARM platform; using gSOAP tools to build embedded Web services; configuring a USB-to-serial port driver and a wireless Wi-Fi network card driver; the ZigBee wireless sensing control network is built, the program design of the coordinator node and the terminal node is completed, and a data communication protocol is formulated; the client program is designed using QT technology. The sensor nodes in the network can transmit detected information to the coordinator, and intelligent home client software can complete remote monitoring and control of home environments through the intelligent home host.
However, this solution has the following drawbacks: 1. the ZigBee technology is adopted, and although the ZigBee technology can solve the problem of power consumption, the chip cost is high. And communication generally adopts 2.5G frequency in an ISM frequency band, and has weak diffraction capability and weak wall penetrating capability. In a home environment, even a door, a window and a non-bearing wall can greatly discounts signals, so that the scheme has weaker signal anti-interference capability. 2. The wireless Wi-Fi network card driver is used, and data security is difficult to guarantee.
Therefore, in order to solve the problems of the above technology, the embodiment of the disclosure provides an intelligent home early warning method, which can be applied to an application environment as shown in fig. 1. Wherein at least one sensor 102 communicates with server 104 via a limited application protocol, an application 106 communicates with the server via a communication network, and communicates with a first frequency channel and a second frequency channel therein via a message queue telemetry transport protocol. Cloud platform 108 communicates with the first and second frequency channels therein via a message queue telemetry transport protocol. The sensor 102 collects sensor data in the smart home environment, which is stored in a cache of the server 104 via a limited application protocol. The application 106 obtains the sensor data in the cache of the server 104, and transmits the sensor data to the first channel of the message queue remote sensing transmission protocol through the message queue remote sensing transmission protocol. Cloud platform 108 listens for changes in data in the first channel via a message queue telemetry transport protocol. When the sensor data in the first channel is monitored to change, the cloud platform 108 acquires the changed sensor data, and determines whether to change the execution data in the second channel in the message queue telemetry transmission protocol according to the changed sensor data and preset early warning conditions. In the event that a data change is performed in the second channel of the message queue telemetry transport protocol, the changed execution data is sent to the application 106. The application end 106 obtains the modified execution data, and executes corresponding early warning operation according to the modified execution data. The application 106 may be, but is not limited to, APP or an application program set in various personal computers, notebook computers, smartphones, tablet computers, internet of things devices, and portable wearable devices. The application end 106 may be implemented as a cluster formed by a plurality of application ends 106. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, an intelligent home early warning method is provided, and the method is applied to the application end 106 in fig. 1 for illustration, and includes the following steps:
s202, sensor data are acquired, the sensor data are transmitted to a first channel of the message queue telemetry transmission protocol through the message queue telemetry transmission protocol, and the sensor data are obtained by storing data acquired by a sensor into a cache through a limited application protocol.
The sensor data may be temperature, humidity, pressure, etc. data of different types of sensors in the smart home collected during operation. The message queue telemetry transport protocol may generally be MQTT (Message Queuing Telemetry Transport) protocol, a lightweight, simple, open, and easy to implement protocol. The first channel may typically be one of the message channels in the MQTT protocol using a publish/subscribe message mode, which is capable of publishing sensor data. The restricted application protocol may typically be Coap (Constrained Application Protocol) protocol.
Specifically, sensor data is acquired through various types of sensors in the smart home, and then the sensors can store the sensor data into a cache of the server through Coap protocols, using POST, PUT, GET, DELETE and other various modes. Sensor data is acquired in the cache, and then can be published to a first channel of the MQTT through the MQTT protocol.
In some exemplary embodiments, during the testing of the present solution, a sensor-equipped Raspberry Pi (Raspberry Pi) analog sensor and application may be used. Environmental data (temperature, humidity, pressure and the like) can be respectively acquired through an I2C interface and a sensor Hat analog sensor on the raspberry party, and an error range is calculated, so that the accuracy of the acquired data is ensured.
S204, under the condition that data change is executed in a second channel of the message queue telemetry transmission protocol, the changed execution data is obtained, early warning operation is executed according to the changed execution data, and the changed execution data is obtained according to sensor data changed in the first channel and preset early warning conditions.
The execution data may generally be data corresponding to an executor in the smart home. The actuator may typically be a home device that performs an action based on instructions issued by the control hub. The execution data corresponds to the pre-warning operation in general. The early warning operation can be sending a short message to perform early warning (reminding a homeowner through a short message or mail) or triggering an early warning instruction in a smart home such as a fire fighting device. The preset early warning condition can be a condition for judging whether early warning is needed or not according to the sensor data.
In particular, the execution data may be distributed in the second channel of the MQTT protocol by those skilled in the art in the initial state, and it should be noted that the first channel and the second channel are not the same channel, and the first and second are merely used to distinguish the channels. In the event that a change in sensor data in the first channel is monitored, the changed sensor data may be acquired and stored to a cloud platform, which may be a Ubidots platform. Whether the execution data is changed can be judged according to the changed sensor data and preset early warning conditions. If the execution data is changed, the changed execution data may be input. The application end can acquire the modified execution data, and further can execute corresponding early warning operation according to the modified execution data. If a plurality of early warning conditions for executing data change exist, priority can be set, the early warning conditions with high priority change the execution data firstly, and then the early warning conditions with low priority are changed. The alert e-mail may be sent via SMTP (SIMPLE MAIL TRANSFER Protocol) Protocol when alerting by mail.
In some exemplary embodiments, the execution data may be changed from 0 to 1 if the preset pre-warning condition is that the temperature exceeds 35 degrees celsius. If the preset early warning condition is that the humidity exceeds 60%, the execution data can be changed from 0 to 2, and the priority of the early warning condition is that the temperature is usually higher than that of the early warning condition. And the cloud platform can monitor the change of the sensor data in the first channel, if the sensor data is changed from 20 ℃ to 40 ℃. And if the preset early warning condition is met, correspondingly changing the execution data in the second channel to be 1. After the data is changed to 1, the data can correspond to an early warning operation, and the early warning operation can be as follows: triggering the fire fighting device. If the pre-warning condition corresponding to the temperature and the pre-warning condition corresponding to the humidity are triggered, because the priority of the pre-warning condition for the temperature is generally greater than that of the pre-warning condition for the humidity, the execution data is changed to 1 first, then the corresponding pre-warning operation is executed, and further the execution data changed to 2 can be used for executing the corresponding pre-warning operation. The execution data to be described herein is merely illustrative, and specific values of the execution data are not limited in this embodiment.
In the intelligent home early warning method, the sensor data is stored into the cache through the limited application protocol. The problem of loss of the sensor data due to connection failure, which may occur, is avoided by direct transmission into the first channel. And all are accomplished through a request and response mechanism, similar to HTTP, the application can operate on the sensor data through a plurality of request methods (such as GET, PUT, POST, DELETE). The sensor data in the transmission can be controlled to be as small as possible by using the limited application protocol in the smart home, so that the requirement of framing is reduced. The energy consumption generated during data transmission is reduced, and the data is reliably transmitted, retransmitted and transmitted in blocks, so that the reliable arrival of the data is ensured, and the reliability and the safety of the transmission are ensured. And transmitting the sensor data via the message queue telemetry transport protocol into a first frequency channel of the message queue telemetry transport protocol. The message queue telemetry transmission protocol in the scheme can carry out small-sized transmission when transmitting sensor data, can reduce network flow, solves the problems of energy consumption and high cost of the current intelligent home, and further improves the safety and reliability of the data through an application layer, a transmission layer and a network layer. And because the WIFI network is not used in the data transmission process, the safety in data transmission is improved. And cloud storage can be used for storing the sensor data, so that the problem of storage space is avoided, and data analysis is facilitated.
In one embodiment, as shown in figure 3,
S302, the sensor collects the sensor data according to a preset time period and stores the sensor data in the cache.
The preset time period may be a time preset by a person skilled in the art according to actual needs, such as 10 minutes, 5 minutes, 1 minute, and the like, and is not limited in this embodiment.
Specifically, the sensor may collect sensor data in the home environment according to a preset time period, for example, every 10 minutes, and store the sensor data in the cache.
S304, after the sensor data are collected in the time period, the sensor enters a dormant state.
The sleep state may be generally considered as a standby state, and may be a state in which the sensor does not collect data.
Specifically, after the sensor collects sensor data and stores the sensor data in the buffer memory, because the sensor is periodically operated, the sensor can enter the operating state only when the time period is reached, so the sensor is dormant when the operating state is not performed, so that the energy consumption is reduced and the service life of the sensor is prolonged.
And S306, when the running time of the sensor enters the next time period, exiting the dormant state, and continuously collecting the sensor data.
The running time may be, in general, the time when the sensor enters the active state plus the time when it is in the sleep state.
Specifically, when the sensor operation time enters the next time period, the sensor may enter the working state, so the sensor needs to exit from the sleep state, enter the working state to collect sensor data, and after collecting sensor data, the process may return to step 302 to repeatedly execute steps S302 to S304.
In some exemplary embodiments, the predetermined period of time is, for example, 5 minutes. The sensor can collect the sensor data in the home just when started in the initial working process, enter the working state, collect the sensor data, store the data into the cache, and enter the dormant state. And when the sum of the working state and the dormant state of the sensor reaches 5 minutes, entering the next time period, and collecting the sensor data after the sensor enters the working state again. The above steps are repeated.
In this embodiment, by setting a preset time period, the sensor enters a working state when entering the time period, so that the sensor is started only during operation, thereby greatly reducing the waste of energy consumption, prolonging the service life of the sensor, and reducing the operation maintenance cost.
In one embodiment, as shown in fig. 4, the process of obtaining the modified execution data includes:
S402, acquiring the sensor data changed in the first channel.
S404, under the condition that the changed sensor data meets the preset early warning condition, the execution data is changed, and the changed execution data is transmitted to the second channel.
Specifically, the application end can acquire the data in the cache in real time, or can acquire the data in the cache at intervals of a certain time period. And then published into the first channel via MQTT protocol. The cloud platform can monitor sensor data in the first channel in real time, and acquire the changed sensor data under the condition that the sensor data in the first channel is changed. And then the cloud platform can compare the sensor data in the changed first channel with preset early warning conditions, correspondingly change the execution data if the preset early warning conditions are met, and transmit the changed execution data to the second channel.
In this embodiment, by changing the sensor data and determining whether to change the execution data according to the preset early warning condition, the execution data corresponds to the early warning operation, and different early warning operations can be performed according to different sensor data. And the execution data and the sensor data are distributed in different channels, so that interference generated between the data is avoided.
In one embodiment, the sensor data comprises at least, via multiline Cheng Huoqu: one or more of temperature data, humidity data, pressure data; it should be noted that, the above-mentioned sensor data are merely taken as examples, and various sensor data may exist in a practical application scenario.
A synchronization lock and a mutual exclusion lock are used in acquiring the sensor data and the modified execution data.
Where a mutex lock may be a mechanism where different threads enter critical sections (shared data and hardware resources) by competing, only one of them is allowed to use the shared resource exclusively for a limited time in order to prevent access conflicts. If simultaneous writing is not allowed, or simultaneous reading is allowed, a synchronous lock may typically be a plurality of threads cooperating with each other to collectively accomplish a task through a certain logical relationship. Generally, synchronization relationships often include mutual exclusion, and resources in critical sections are accessed in a logical order. For example, it is used after birth.
Specifically, it is necessary to acquire sensor data first, while only one thread is allowed to acquire sensor data while the other threads are not allowed to acquire sensor data. After the sensor data is acquired, if the modified execution data exists, the modified execution data can be acquired, and only one thread can exist to acquire the modified execution data.
In this embodiment, by using the synchronization lock and the mutual exclusion lock, at most one thread access of the sensor and the modified execution data is ensured at any time, so as to ensure the consistency of the data and the thread security.
In one embodiment, unit testing is deployed at each sensor data and node performing data transmission, ensuring that each link has problem self-checking capability so as to locate the problem in time.
In another embodiment, the disclosure further provides an intelligent home early warning method, as shown in fig. 5, including the following steps:
S502, the sensor collects sensor data in the home and sends the sensor data to a cache of the server through a limited application protocol.
S504, the sensor collects the sensor data according to a preset time period and stores the sensor data in the cache.
S506, after the sensor data are collected in the time period, the sensor enters a dormant state.
And S508, when the running time of the sensor enters the next time period, exiting the dormant state, and continuously collecting the sensor data.
S510, the application end obtains the sensor data in the cache and transmits the sensor data to a first channel of the message queue telemetry transmission protocol through the message queue telemetry transmission protocol.
S512, the cloud platform monitors the change of the sensor data in the first channel, acquires the changed sensor data under the condition that the sensor data is changed, and acquires the changed sensor data.
S514, the cloud platform compares the changed sensor data with preset early warning conditions.
S516, if the preset early warning condition is met, the execution data in the second channel of the message queue telemetry transmission protocol is changed.
And S518, under the condition that the data is changed in the second channel of the message queue telemetry transmission protocol, the application end acquires the changed execution data, and performs early warning operation according to the changed execution data.
S520, if the preset early warning condition is not met, executing data in the second channel of the message queue telemetry transmission protocol is not changed.
It should be noted that, the specific implementation manner in this embodiment may refer to the above embodiment, and repeated descriptions are omitted here.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the disclosure also provides an intelligent home early warning system for implementing the intelligent home early warning method. The implementation scheme of the solution to the problem provided by the system is similar to the implementation scheme described in the above method, so the specific limitation in one or more embodiments of the smart home early warning system provided below can be referred to the limitation of the smart home early warning method above, and will not be repeated here.
In one embodiment, as shown in fig. 6, there is provided an intelligent home early warning system 600 comprising: at least one sensor 602, a first application module 604, a cloud platform 606, a second application module 608, wherein:
At least one sensor 602 for collecting sensor data and transmitting the sensor data into a buffer via a limited application protocol;
a first application module 604, configured to obtain the sensor data in the cache, and transmit the sensor data to a first channel of a message queue telemetry transport protocol through the message queue telemetry transport protocol;
The cloud platform 606 is configured to obtain the sensor data changed in the first channel, and change execution data according to the changed sensor data and a preset early warning condition;
and the second application module 608 is configured to obtain the modified execution data when the execution data is modified, and execute the early warning operation according to the modified execution data.
In one embodiment of the system, the sensor 602 includes: the device comprises a period acquisition module, a dormancy module and a period calculation module;
The period acquisition module is used for acquiring the sensor data according to a preset time period and storing the sensor data into the cache.
And the dormancy module is used for entering a dormancy state after collecting the sensor data in the time period.
And the period calculation module is used for exiting the sleep state when the running time of the sensor enters the next time period so that the sleep module can continuously collect the sensor data.
In one embodiment of the system, the cloud platform 606 includes: the system comprises a change data acquisition module, an execution data modification module and an execution data transmission module;
the change data acquisition module is used for acquiring the sensor data changed in the first channel.
The execution data changing module is used for changing the execution data under the condition that the changed sensor data meets the preset early warning condition.
And the execution data transmission module is used for transmitting the changed execution data to the second channel.
In one embodiment of the system, the first application module 604 and the second application module 608 each employ a multi-threaded design, the sensor data comprising at least: one or more of temperature data, humidity data, pressure data.
The first application module 604 may use a synchronization lock and a mutual exclusion lock when it obtains the sensor data in the cache and the second application module 608 may use the modified execution data.
All or part of the modules in the intelligent home early warning system can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store sensor data and execution data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program when executed by the processor is used for realizing an intelligent home early warning method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of a portion of the architecture in connection with the disclosed aspects and is not limiting of the computer apparatus to which the disclosed aspects apply, and that a particular computer apparatus may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory, among others. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the various embodiments provided by the present disclosure may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors involved in the embodiments provided by the present disclosure may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic, quantum computing-based data processing logic, etc., without limitation thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples have expressed only a few embodiments of the present disclosure, which are described in more detail and detail, but are not to be construed as limiting the scope of the present disclosure. It should be noted that variations and modifications can be made by those skilled in the art without departing from the spirit of the disclosure, which are within the scope of the disclosure. Accordingly, the scope of the present disclosure should be determined from the following claims.
Claims (9)
1. An intelligent home early warning method is characterized by comprising the following steps:
Acquiring sensor data, and transmitting the sensor data to a first channel of a message queue telemetry transmission protocol through the message queue telemetry transmission protocol, wherein the sensor data is obtained by storing data acquired by a sensor into a cache through a limited application protocol; the message queue telemetry transport protocol is an MQTT protocol;
Under the condition that data change is executed in a second channel of a message queue telemetry transmission protocol, acquiring changed execution data, executing early warning operation according to the changed execution data, wherein the changed execution data is obtained according to sensor data changed in the first channel and preset early warning conditions;
A process of obtaining modified execution data, comprising: acquiring the sensor data changed in the first channel; under the condition that the changed sensor data meets the preset early warning condition, the execution data is changed, and the changed execution data is transmitted to the second channel; the first channel and the second channel are message channels using a publish/subscribe message mode in an MQTT protocol; the first channel and the second channel are not the same channel.
2. The method of claim 1, wherein the sensor collects the sensor data according to a preset time period and stores the sensor data in the cache;
and after the sensor data is collected in the time period, the sensor enters a dormant state;
And when the running time of the sensor enters the next time period, exiting the dormant state, and continuously collecting the sensor data.
3. The method according to claim 1 or 2, wherein the sensor data comprises at least by means of multilines Cheng Huoqu: one or more of temperature data, humidity data, pressure data;
a synchronization lock and a mutual exclusion lock are used in acquiring the sensor data and the modified execution data.
4. An intelligent home early warning system, the system comprising:
at least one sensor for collecting sensor data and transmitting the sensor data to a cache via a restricted application protocol;
the first application module is used for acquiring the sensor data in the cache and transmitting the sensor data to a first channel of the message queue telemetry transmission protocol through the message queue telemetry transmission protocol; the message queue telemetry transport protocol is an MQTT protocol;
the cloud platform is used for acquiring the sensor data changed in the first channel and changing execution data according to the changed sensor data and preset early warning conditions; the cloud platform comprises: the system comprises a change data acquisition module, an execution data modification module and an execution data transmission module;
The change data acquisition module is used for acquiring the sensor data changed in the first channel;
the execution data changing module is used for changing the execution data under the condition that the changed sensor data meets the preset early warning condition;
The execution data transmission module is used for transmitting the changed execution data to a second channel; the first channel and the second channel are message channels using a publish/subscribe message mode in an MQTT protocol; the first channel and the second channel are not the same channel;
And the second application module is used for acquiring the changed execution data under the condition that the execution data is changed, and executing early warning operation according to the changed execution data.
5. The smart home early warning system of claim 4, wherein the sensor comprises: the device comprises a period acquisition module, a dormancy module and a period calculation module;
The period acquisition module is used for acquiring the sensor data according to a preset time period and storing the sensor data into the cache;
The dormancy module is used for entering a dormancy state after collecting the sensor data in the time period;
And the period calculation module is used for exiting the sleep state when the running time of the sensor enters the next time period so that the sleep module can continuously collect the sensor data.
6. The smart home early warning system of claim 4 or 5, wherein the first application module and the second application module each employ a multi-threaded design, and the sensor data includes at least: one or more of temperature data, humidity data, pressure data;
And when the first application module acquires the sensor data in the cache and the second application module acquires the changed execution data, a synchronous lock and a mutual exclusion lock are used.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 3 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 3.
9. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210163927.1A CN114666177B (en) | 2022-02-22 | 2022-02-22 | Intelligent home early warning method, system, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210163927.1A CN114666177B (en) | 2022-02-22 | 2022-02-22 | Intelligent home early warning method, system, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114666177A CN114666177A (en) | 2022-06-24 |
CN114666177B true CN114666177B (en) | 2024-05-28 |
Family
ID=82028382
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210163927.1A Active CN114666177B (en) | 2022-02-22 | 2022-02-22 | Intelligent home early warning method, system, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114666177B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018132557A1 (en) * | 2017-01-11 | 2018-07-19 | Convida Wirewless, Llc | Dynamic protocol switching |
CN110352604A (en) * | 2017-02-27 | 2019-10-18 | 甲骨文国际公司 | For providing method, system and computer-readable medium of service ability exposure function (SCEF) as cloud service |
US10891282B1 (en) * | 2017-11-22 | 2021-01-12 | Amazon Technologies, Inc. | Mutations with immediate feedback |
WO2021032269A1 (en) * | 2019-08-16 | 2021-02-25 | Telefonaktiebolaget Lm Ericsson (Publ) | Distribution of constrained device data |
US11126610B1 (en) * | 2017-11-22 | 2021-09-21 | Amazon Technologies, Inc. | Conflict resolution in a data proxy |
CN113639796A (en) * | 2021-08-11 | 2021-11-12 | 南京理工大学 | NB-IoT-based environmental information acquisition method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050210109A1 (en) * | 2004-03-22 | 2005-09-22 | International Business Machines Corporation | Load balancing mechanism for publish/subscribe broker messaging system |
-
2022
- 2022-02-22 CN CN202210163927.1A patent/CN114666177B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018132557A1 (en) * | 2017-01-11 | 2018-07-19 | Convida Wirewless, Llc | Dynamic protocol switching |
CN110352604A (en) * | 2017-02-27 | 2019-10-18 | 甲骨文国际公司 | For providing method, system and computer-readable medium of service ability exposure function (SCEF) as cloud service |
US10891282B1 (en) * | 2017-11-22 | 2021-01-12 | Amazon Technologies, Inc. | Mutations with immediate feedback |
US11126610B1 (en) * | 2017-11-22 | 2021-09-21 | Amazon Technologies, Inc. | Conflict resolution in a data proxy |
WO2021032269A1 (en) * | 2019-08-16 | 2021-02-25 | Telefonaktiebolaget Lm Ericsson (Publ) | Distribution of constrained device data |
CN113639796A (en) * | 2021-08-11 | 2021-11-12 | 南京理工大学 | NB-IoT-based environmental information acquisition method |
Also Published As
Publication number | Publication date |
---|---|
CN114666177A (en) | 2022-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Elsts et al. | Enabling healthcare in smart homes: the SPHERE IoT network infrastructure | |
Alippi et al. | Energy management in wireless sensor networks with energy-hungry sensors | |
Hoang et al. | Mobile cloud for assistive healthcare (MoCAsH) | |
US9977488B1 (en) | Electronic device with smart power management system | |
US20160183191A1 (en) | Energy efficient wireless data transfer | |
CN110688280A (en) | Management system, method, equipment and storage medium of alarm event | |
Porambage et al. | Quantitative power consumption analysis of a multi-tier wireless multimedia sensor network | |
CN114666177B (en) | Intelligent home early warning method, system, computer equipment and storage medium | |
Ding et al. | Development and Coverage Evaluation of ZigBee‐Based Wireless Network Applications | |
Barsocchi et al. | Are you in or out? Monitoring the human behavior through an occupancy strategy | |
Devidas et al. | A system for energy conservation through personalized learning mechanism | |
WO2018083710A2 (en) | An improved management and internetworking of devices to collect and exchange data without requiring interaction | |
US11062099B1 (en) | System and method for wearable, ubiquitous RFID-enabled sensing | |
US10992757B2 (en) | Edge-computing-based forensic feedback architecture | |
Kumar et al. | A prospective towards M2M Communication | |
KR20140115130A (en) | Method of managing power of Machine to Machine device, and network server for managing power of Machine to Machine device | |
Kaur et al. | Internet of things: Vision, challenges and future scope | |
Modukari et al. | Autonomous middleware framework for sensor networks | |
KR101110675B1 (en) | asynchronous COMMAND ACHIEVING METHOD OF REMOTE METER READING SYSTEM | |
Dahiya et al. | Efficient Green Solution | |
Aghdasi et al. | Energy efficient camera node activation control in multi-tier wireless visual sensor networks | |
CN111308940A (en) | Wireless sensor network and mobile terminal interaction system and method | |
Faro et al. | Edge Devices Internetworking to Pervasive Monitor and Control People in the Covid Age | |
Saleem et al. | Cellular IoT based secure monitoring system for smart environments | |
Cao et al. | Distributed Security System for Intelligent Building Based On Wireless Communication Network |
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 |