CN114666177A - Intelligent home early warning method and system, computer equipment and storage medium - Google Patents

Intelligent home early warning method and system, computer equipment and storage medium Download PDF

Info

Publication number
CN114666177A
CN114666177A CN202210163927.1A CN202210163927A CN114666177A CN 114666177 A CN114666177 A CN 114666177A CN 202210163927 A CN202210163927 A CN 202210163927A CN 114666177 A CN114666177 A CN 114666177A
Authority
CN
China
Prior art keywords
data
sensor
sensor data
changed
channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210163927.1A
Other languages
Chinese (zh)
Inventor
凌子烨
任文涛
谭汉坚
张舜华
傅强
吴兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202210163927.1A priority Critical patent/CN114666177A/en
Publication of CN114666177A publication Critical patent/CN114666177A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2823Reporting information sensed by appliance or service execution status of appliance services in a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols 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
    • 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
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The disclosure relates to an intelligent home warning method, an intelligent home warning system, computer equipment and a storage medium, and relates to the technical field of monitoring and 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 comprises data acquired by a sensor and stored in a cache through a limited application protocol; and under the condition that data change is performed in a second channel of a message queue telemetry transmission protocol, acquiring the changed execution data, and executing early warning operation according to the changed execution data, wherein the changed execution data is obtained according to the changed sensor data in the first channel and preset early warning conditions. By adopting the method, the resource consumption can be reduced, the operation cost can be reduced, and the safety of the sensor in the data transmission process can be ensured.

Description

Intelligent home warning method and system, computer equipment and storage medium
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 from military applications such as battlefield monitoring. The distributed intelligent network system is composed of a large number of tiny sensor nodes which are deployed in an action area and have wireless communication and computing capabilities in a self-organizing mode, and can autonomously complete specified tasks according to environments. However, as society develops, wireless sensor networks are used in a wider and wider range. Especially, the use in the smart home application field is more.
However, the application of the wireless sensor network in the field of intelligent home application has the following problems: (1) the existing sensor runs for a long time to transmit data, consumes energy and has higher cost. (2) The security is lower when the sensor transmits data.
Disclosure of Invention
Therefore, it is necessary to provide an intelligent home warning method, system, computer device, and storage medium for reducing resource consumption, reducing operation cost, and ensuring security during data transmission, in order to solve the above technical problems.
In a first aspect, the present disclosure provides an intelligent home 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 comprises data acquired by a sensor and stored in a cache through a limited application protocol;
and under the condition that data change is performed in a second channel of a message queue telemetry transmission protocol, acquiring the changed execution data, and executing early warning operation according to the changed execution data, wherein the changed execution data is obtained according to the changed sensor data 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, the sensor exits the sleep state and continues to acquire the sensor data.
In one embodiment, the process of obtaining the modified execution data includes:
acquiring the sensor data of the change in the first channel;
and under the condition that the changed sensor data meets a preset early warning condition, changing the execution data, and transmitting the changed execution data to the second channel.
In one embodiment, the sensor data is acquired by multiple threads, the sensor data including at least: 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 present disclosure further provides an intelligent home warning system. The system comprises:
the system comprises at least one sensor, a cache and a data processing module, wherein the sensor is used for acquiring sensor data and sending the sensor data to the cache through a limited 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 a message queue telemetry transmission protocol through the message queue telemetry transmission protocol;
the cloud platform is used for acquiring the changed sensor data 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 of changing the execution data and executing early warning operation according to the changed execution data.
In one embodiment of the system, 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 sleep module is used for entering a sleep state after the sensor data are collected in the time period;
and the period calculation module is used for exiting the dormant state when the running time of the sensor enters the next time period so as to enable the dormant module to continue to 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 modification module is used for modifying the execution data under the condition that the changed sensor data meets a 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 both adopt a multi-thread design, and the sensor data is obtained through multiple threads, and the sensor data at least includes: one or more of temperature data, humidity data, pressure data;
the first application module uses a synchronization lock and a mutual exclusion lock when acquiring the sensor data in the cache and the second application module acquires the changed execution data.
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 executing the computer program.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium. The computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method described above.
In a fifth aspect, the present disclosure also provides a computer program product. The computer program product comprises a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method.
In the above embodiments, the sensor data is stored in the cache by the restricted application protocol. The problem that the connection fails and the sensor data is lost when the data is transmitted directly to the first channel is avoided. And the limited application protocol is used for transmitting the sensor data in the smart home, so that the size of the sensor data in transmission can be controlled, reliable transmission, data retransmission and block transmission are supported, and the sensor data can be ensured to arrive reliably. The method can perform non-long connection communication, and reduce energy consumption generated when transmitting sensor data. And transmitting the sensor data into a first channel of a message queue telemetry transmission protocol via the message queue telemetry transmission protocol. The execution data in the second channel corresponding to the message queue telemetry transmission protocol is changed according to the sensor data changed in the first channel and the preset early warning condition, interference between the execution data and the sensor data can be prevented, and the corresponding data can be transmitted in a small-size mode when the sensor data is monitored or the execution data is changed for a long time through the message queue telemetry transmission protocol, so that network flow is reduced, and power consumption of the smart home is further reduced. Further, the application layer, the transmission layer and the network layer of the transmission protocol are telemetered through the message queue, so that the safety and the reliability of transmitting sensor data and executing data are improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic diagram of an application environment of an intelligent home warning method in an embodiment;
fig. 2 is a schematic flow chart of an intelligent home warning method in an embodiment;
FIG. 3 is a schematic flow chart of the steps of operation of a sensor in one embodiment;
FIG. 4 is a flowchart illustrating the steps of modifying execution data in one embodiment;
fig. 5 is a schematic flow chart illustrating an intelligent home warning method in another embodiment;
fig. 6 is a schematic structural block diagram of the smart home warning system in one embodiment;
FIG. 7 is a diagram illustrating an internal configuration of a computer device in accordance with an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present disclosure 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 above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments herein described are capable of operation in sequences other than those illustrated or described herein. Moreover, 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.
The following technical scheme of applying the wireless sensor network to the field of intelligent home application appears at present:
intelligent house management and control system based on cell-phone APP and WIFI network control includes: the data collected by the sensor are directly sent to the server at the cloud end through the WI-FI and stored, the user can monitor the data in real time through the mobile phone APP, corresponding measures are taken when abnormal data (such as overhigh temperature caused by fire, overlarge humidity caused by the fact that a window is not closed by rain and short circuit of an electric appliance) occur, a control signal is sent out, the data are sent to the equipment through the server, and the control over the electric appliance at any time and any place is achieved. According to the scheme, an ESP8266 serial port WIFI module is adopted in the communication protocol, the communication protocol of a third-party platform is used in the interaction between the cloud server and the mobile phone APP, and independent development is not involved.
In summary, according to the technology, an intelligent home management and control system based on a mobile phone APP and a WIFI network is designed by using an ESP8266 serial port WIFI module, a cloud internet of things development platform and a single chip microcomputer control system.
However, this solution has the following disadvantages:
1. the sensor, cell-phone APP, the communication interaction between the cloud platform is the third party and provides, and the dependency is high, and the flexibility ratio is low, is difficult to satisfy the demand of customization.
2. The sensors need to be maintained regularly to maintain continuous operation for a long time, equipment and energy consumption are low, and maintenance cost is high.
3. Data security is difficult to guarantee using a public WI-FI network.
Intelligent house remote wireless monitoring system design based on thing networking includes: based on an S3C2440 of an ARM920T inner core, embedded Web service, QT technology and wireless networking technology, an intelligent home monitoring system is designed, 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 hardware and software design of the intelligent household host: an embedded Linux operating system is planted on the ARM platform; establishing embedded Web service by using a gSOAP tool; configuring a USB-to-serial port driver and a wireless Wi-Fi network card driver; establishing a ZigBee wireless sensing control network, completing program design of a coordinator node and a terminal node, and formulating a data communication protocol; the client program is designed using the QT technique. The sensor nodes in the network can transmit detected information to the coordinator, and the intelligent home client software can complete remote monitoring and control of home environment through the intelligent home host.
However, this solution has the following disadvantages: 1. according to the scheme, the ZigBee technology is adopted, and although the power consumption problem can be solved, the chip cost is high. And 2.5G frequency in ISM frequency band is usually adopted for communication, and the diffraction ability and the wall penetrating ability of the frequency band are weak. In a household environment, even a door, a window and a non-bearing wall can greatly reduce signals, so that the scheme is weak in signal anti-interference capability. 2. The wireless Wi-Fi network card drive is used, and data safety is difficult to guarantee.
Therefore, in order to solve the problems in the foregoing technology, an embodiment of the present disclosure provides an intelligent home warning method, which may be applied to an application environment as shown in fig. 1. Wherein the at least one sensor 102 communicates with the server 104 via a restricted application protocol, the application 106 communicates with the server via a communication network, and communicates with the first and second channels therein via a message queue telemetry transport protocol. Cloud platform 108 communicates with the first channel and the second channel therein via a message queue telemetry transport protocol. The sensor 102 collects sensor data in the smart home environment and stores the sensor data in the cache of the server 104 via a restricted application protocol. The application 106 obtains the sensor data cached by the server 104, and transmits the sensor data to a first channel of a message queue remote sensing transmission protocol through the message queue remote sensing transmission protocol. The cloud platform 108 listens for changes in the data in the first channel through the message queue telemetry transport protocol. When monitoring that the sensor data in the first channel changes, 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 the preset early warning condition. 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 106 obtains the modified execution data and executes the corresponding early warning operation according to the modified execution data. The application 106 may be, but is not limited to, an APP or an application program provided in various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices. The application 106 may be implemented as one or a cluster formed by a plurality of applications 106. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In an embodiment, as shown in fig. 2, an intelligent home warning method is provided, which is described by taking the application terminal 106 in fig. 1 as an example, and includes the following steps:
s202, obtaining 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 comprises data acquired by a sensor and stored in a cache through a limited application protocol.
The sensor data may be temperature, humidity, pressure, and the like of the smart home, which are collected by different types of sensors of the smart home during operation. The message queue Telemetry transport protocol may be mqtt (message Queuing Telemetry transport) protocol, which is a lightweight, simple, open, and easy-to-implement protocol. The first channel may typically be one of the messaging channels in the MQTT protocol that uses a publish/subscribe messaging mode, which is capable of publishing sensor data. The restricted Application protocol may typically be the coach (structured Application protocol) protocol.
Specifically, sensor data is acquired by various types of sensors in the smart home, and then the sensors can store the sensor data in the cache of the server through the map protocol and by using various modes such as POST, PUT, GET, DELETE and the like. And acquiring the sensor data in the cache, and further publishing the sensor data to a first channel of the MQTT through an MQTT protocol.
In some exemplary embodiments, a Raspberry Pi (Raspberry Pi) equipped with Sense Hat may be used to simulate the sensor and application during testing of the present solution. Environmental data (temperature, humidity, pressure and the like) can be respectively acquired through an I2C interface and a Sense Hat analog sensor on the raspberry pi, and an error range is calculated, so that the accuracy of the acquired data is ensured.
S204, under the condition that data change is carried out in a second channel of the message queue telemetry transmission protocol, the changed execution data is obtained, and early warning operation is carried out according to the changed execution data, wherein the changed execution data is obtained according to the changed sensor data in the first channel and preset early warning conditions.
The execution data may be data corresponding to an actuator in the smart home. The actuator may typically be a household device that performs an action based on a command issued by the control hub. The execution data corresponds to the pre-warning operation in a normal case. The early warning operation may be sending a short message, making an early warning (reminding the owner of the house by a short message or an email), or triggering an early warning instruction in an intelligent home such as a fire fighting device. The preset warning condition may be a condition for determining whether warning is required according to sensor data.
Specifically, the execution data may be published in the second channel of the MQTT protocol by those skilled in the art in the initial state, it should be noted that the first channel and the second channel are not the same channel, and the first and the second are only used for distinguishing the channel. In the case of monitoring a change in sensor data in the first channel, the changed sensor data may be acquired and stored to a cloud platform, which may be a Ubidots platform. Whether to change the execution data can be judged according to the changed sensor data and the preset early warning condition. If the execution data is changed, the changed execution data may be input. The application terminal can obtain the changed execution data, and then can execute corresponding early warning operation according to the changed execution data. If a plurality of early warning conditions for executing data change exist, priority can be set, and the early warning condition with high priority changes the execution data first and then changes the early warning condition with low priority. When reminding by Mail, the alarm e-Mail can be sent by SMTP (simple Mail Transfer protocol) protocol.
In some exemplary embodiments, if the preset warning condition is that the temperature exceeds 35 degrees celsius, the execution data may be changed from 0 to 1. If the preset early warning condition is that the humidity exceeds 60%, the execution data is changed from 0 to 2, and the priority of the early warning condition is that the temperature is generally higher than the priority of the early warning condition that the humidity is. And the cloud platform can monitor the change of the sensor data in the first channel, and if the change of the sensor data is from 20 ℃ to 40 ℃. If the preset early warning condition is reached, the execution data in the second channel is changed to 1 accordingly. After the execution data is changed to 1, it may correspond to an early warning operation, where the early warning operation may be: and triggering the fire fighting device. If the early warning condition corresponding to the temperature and the early warning condition corresponding to the humidity are both triggered, because the priority of the early warning condition that the temperature is usually higher than the priority of the early warning condition that the humidity is, the execution data is changed to 1, then the corresponding early warning operation is executed, and then the execution data which is changed to 2 can be used for executing the corresponding early warning operation. It should be noted that the execution data herein is only an example, and the specific value of the execution data is not limited in this embodiment.
In the intelligent home warning method, the sensor data is stored in the cache through a limited application protocol. The problem that the connection fails and the sensor data is lost when the data is transmitted directly to the first channel is avoided. And all are accomplished through a request and response mechanism, like HTTP, the application can operate on the sensor data through multiple request methods (e.g., GET, PUT, POST, DELETE). And the limited application protocol is used for transmitting the sensor data in the smart home, so that the sensor data in the transmission can be controlled to be as small as possible, and the requirement of framing is reduced. The method reduces the energy consumption generated during data transmission, and ensures reliable transmission, data retransmission and block transmission, thereby ensuring the reliable arrival of the data and ensuring the reliability and safety of the transmission. And transmitting the sensor data into a first channel of a message queue telemetry transmission protocol via the message queue telemetry transmission protocol. The small-size transmission can be carried out when the message queue telemetering transmission protocol transmits the sensor data in the scheme, the network flow can be reduced, the problems that the current smart home consumes energy and is high in cost are solved, and the safety and the reliability of the data are further improved 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 the storage of the sensor data can use cloud storage, so that the problem of storage space is not needed to be worried about, and the data analysis is convenient.
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, and 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 cache, because the sensor is in periodic work, the sensor can enter a working state only when a time period is reached, and therefore the sensor is in a dormant state when the working state is not carried out, energy consumption is reduced, and the service life of the sensor is prolonged.
S306, when the running time of the sensor enters the next time period, the sensor exits the sleep state and continues to acquire the sensor data.
The running time may be the time when the sensor enters the working state plus the time when the sensor enters the sleep state.
Specifically, when the sensor running time enters the next time period, the sensor may enter the working state, so that it is necessary to exit the sleep state, enter the working state to collect the sensor data, and after collecting the sensor data, the step 302 may be returned to repeat steps S302 to S304.
In some exemplary embodiments, the predetermined time period is 5 minutes. When the sensor initially works, the sensor may be just started to collect sensor data in a home, enter a working state, collect the sensor data, store the data in a cache, and enter a 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 enabling the sensor to enter the working state again to collect the data of the sensor. The above operation steps are repeated continuously.
In the embodiment, the preset time period is set, the sensor enters the working state when entering the time period, the sensor can be started only when operating, the energy consumption waste is greatly reduced, the service life of the sensor is prolonged, and the operation and maintenance cost is reduced.
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 may obtain the data in the cache in real time, or may obtain the data in the cache at certain time intervals. And then released into the first channel through MQTT protocol. The cloud platform can monitor the 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 changed sensor data in the first channel with preset early warning conditions, if the preset early warning conditions are met, the corresponding execution data is changed, and the changed execution data is transmitted to the second channel.
In this embodiment, whether the execution data is changed is determined according to the change of the sensor data and the preset early warning condition, and the execution data corresponds to the early warning operation, so that 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 mutual interference between the data is avoided.
In one embodiment, the sensor data is acquired by multiple threads, the sensor data including at least: one or more of temperature data, humidity data, pressure data; it should be noted that, the above sensor data are only used as examples, and in a practical application scenario, multiple sensor data may exist.
A synchronization lock and a mutual exclusion lock are used in acquiring the sensor data and the modified execution data.
In general, a mutex lock may be a lock in which different threads enter a critical section (shared data and hardware resources) by contention, and only one of the threads is allowed to use the shared resource exclusively within a limited time period in order to prevent access conflicts. If simultaneous writing or simultaneous reading is not allowed, the synchronous lock can be that a plurality of threads cooperate with each other to jointly complete a task through a certain logic relationship. Generally, a synchronization relationship often includes mutual exclusion, and resources of a critical section are accessed according to a certain logic sequence. Such as after first birth.
Specifically, sensor data needs to be acquired first, and only one thread is allowed to acquire while sensor data is acquired, and other threads are not allowed to acquire sensor data. After the sensor data is acquired, if there is changed execution data, the changed execution data may be acquired, and only one thread may exist to acquire the execution data.
In the present embodiment, the use of synchronization locks and mutual exclusion locks ensures that sensors and modified execution data are accessed by at most one thread at any time to ensure data consistency and thread security.
In one embodiment, unit testing is deployed at each node where sensor data and data transmission are performed, and it is ensured that each link has problem self-checking capability so as to locate problems in time.
In another embodiment, the present disclosure further provides an intelligent home 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 acquiring the sensor data.
S510, the application end obtains the sensor data in the cache, and transmits the sensor data to a first channel of a 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.
And S514, the cloud platform compares the changed sensor data with preset early warning conditions.
And S516, if the preset early warning condition is met, changing the second channel of the message queue telemetry transmission protocol to execute data.
S518, under the condition that data change is carried out in a second channel of the message queue telemetry transmission protocol, the application terminal obtains the changed execution data and executes early warning operation according to the changed execution data.
And S520, if the preset early warning condition is not met, the data is executed in the second channel of the message queue telemetry transmission protocol without changing.
It should be noted that, for specific implementation in this embodiment, reference may be made to the above-mentioned embodiment, and repeated descriptions are not repeated here.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the disclosure also provides an intelligent home warning system for implementing the intelligent home warning method. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the method, so that specific limitations in one or more embodiments of the smart home warning system provided below can be referred to the limitations on the smart home warning method in the foregoing, and details are not repeated herein.
In one embodiment, as shown in fig. 6, there is provided a smart home warning system 600, including: 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 to collect sensor data and send the sensor data to a cache via a restricted application protocol;
the first application module 604 is configured to obtain sensor data in the buffer, and transmit the sensor data to a first channel of a message queue telemetry transmission protocol through the message queue telemetry transmission protocol;
the cloud platform 606 is configured to acquire the sensor data changed in the first channel, and change execution data according to the changed sensor data and a preset early warning condition;
the second application module 608 is configured to, in a case that the execution data is changed, obtain the changed execution data, and execute an early warning operation according to the changed execution data.
In one embodiment of the system, the sensor 602 comprises: the device comprises a period acquisition module, a dormancy module and a period calculation module;
and 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 the sensor data is collected in the time period.
And the period calculation module is used for exiting the dormant state when the running time of the sensor enters the next time period so as to enable the dormant module to continue to collect the sensor data.
In one embodiment of the system, the cloud platform 606 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 configured to acquire the sensor data changed in the first channel.
And 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 both employ multi-threading design, and the sensor data is obtained through multi-threading, and the sensor data at least includes: one or more of temperature data, humidity data, pressure data.
The first application module 604 uses a synchronization lock and a mutual exclusion lock when acquiring the sensor data in the cache and the second application module 608 acquires the modified execution data.
All modules in the intelligent home early warning system can be completely or partially realized through software, hardware and a combination of the software and the hardware. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the 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, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing 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 is executed by the processor to realize the intelligent home warning method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain 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 above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory. 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), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases involved in embodiments provided by the present disclosure may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided in this 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.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present disclosure, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present disclosure. It should be noted that, for those skilled in the art, various changes and modifications can be made without departing from the concept of the present disclosure, and these changes and modifications are all within the scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the appended claims.

Claims (11)

1. The 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 comprises data acquired by a sensor and stored in a cache through a limited application protocol;
under the condition that data modification is carried out in a second channel of a message queue telemetry transmission protocol, modified execution data is obtained, and early warning operation is carried out according to the modified execution data, wherein the modified execution data is obtained according to changed sensor data and preset early warning conditions in the first 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, the sensor exits the sleep state and continues to acquire the sensor data.
3. The method of claim 1, wherein obtaining the altered execution data comprises:
acquiring the sensor data of the change in the first channel;
and under the condition that the changed sensor data meets a preset early warning condition, modifying the execution data, and transmitting the modified execution data to the second channel.
4. A method according to any of claims 1-3, wherein the sensor data is acquired by multithreading, the sensor data comprising at least: 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.
5. The utility model provides an intelligent house early warning system which characterized in that, the system includes:
the system comprises at least one sensor, a cache and a data processing module, wherein the sensor is used for acquiring sensor data and sending the sensor data to the cache through a limited 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 a message queue telemetry transmission protocol through the message queue telemetry transmission protocol;
the cloud platform is used for acquiring the changed sensor data 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 of changing the execution data and executing early warning operation according to the changed execution data.
6. The smart home warning system of claim 5, 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 sleep module is used for entering a sleep state after the sensor data are collected in the time period;
and the period calculation module is used for exiting the dormant state when the running time of the sensor enters the next time period so as to enable the dormant module to continue to collect the sensor data.
7. The smart home warning system of claim 5, wherein 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 a preset early warning condition;
and the execution data transmission module is used for transmitting the changed execution data to the second channel.
8. The intelligent home warning system according to any one of claims 5 to 7, wherein the first application module and the second application module are designed in a multi-thread manner, and the sensor data is obtained in a multi-thread manner, and the sensor data at least comprises: one or more of temperature data, humidity data, pressure data;
the first application module uses a synchronization lock and a mutual exclusion lock when acquiring the sensor data in the cache and when acquiring the modified execution data by the second application module.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202210163927.1A 2022-02-22 2022-02-22 Intelligent home early warning method and system, computer equipment and storage medium Pending CN114666177A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210163927.1A CN114666177A (en) 2022-02-22 2022-02-22 Intelligent home early warning method and system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210163927.1A CN114666177A (en) 2022-02-22 2022-02-22 Intelligent home early warning method and system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114666177A true CN114666177A (en) 2022-06-24

Family

ID=82028382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210163927.1A Pending CN114666177A (en) 2022-02-22 2022-02-22 Intelligent home early warning method and system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114666177A (en)

Citations (7)

* Cited by examiner, † Cited by third party
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
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
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
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

Similar Documents

Publication Publication Date Title
Elsts et al. Enabling healthcare in smart homes: the SPHERE IoT network infrastructure
Hoang et al. Mobile cloud for assistive healthcare (MoCAsH)
CN109314716A (en) Cognition edge processing for Internet of Things
US9977488B1 (en) Electronic device with smart power management system
EP2918062B1 (en) Aggregation framework using low-power alert sensor
EP3243111A1 (en) Multi-core processor for optimized power consumption in a security and home automation system
Iscoe et al. Domain modeling for software engineering
Porambage et al. Quantitative power consumption analysis of a multi-tier wireless multimedia sensor network
US11172366B2 (en) Edge-node authentication-data exchange system
Mahgoub et al. Fire alarm system for smart cities using edge computing
CN114666177A (en) Intelligent home early warning method and system, computer equipment and storage medium
Bansal et al. Advancements and applications in fog computing
Saari et al. Data collector service-practical approach with embedded linux
Ruta et al. An agent framework for knowledge-based homes
Mosleh et al. Implementation of active wireless sensor network monitoring using ZigBeeprotocol
Devidas et al. A system for energy conservation through personalized learning mechanism
Barsocchi et al. Are you in or out? Monitoring the human behavior through an occupancy strategy
US10992757B2 (en) Edge-computing-based forensic feedback architecture
US11062099B1 (en) System and method for wearable, ubiquitous RFID-enabled sensing
Kaur et al. Internet of things: Vision, challenges and future scope
Modukari et al. Autonomous middleware framework for sensor networks
Hanganu et al. Efficient Solution for Smart Home Applications
Uqaili et al. Implementation of scalable and energy efficient WSN platform for IoT applications
CN111308940A (en) Wireless sensor network and mobile terminal interaction system and method
Saleem et al. Cellular IoT based secure monitoring system for smart environments

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