In recent years, it has become a trend to master cloud computing technology from the point of view of scientific research or application development, when the application of mass data demand is becoming more and more common. As one of the main fields of the Internet of things, smart home is naturally inseparable from cloud computing. With the development of cloud computing, users need not pay attention to the complex internal working mechanism, need not have rich distributed system knowledge and development experience, can realize large-scale distributed system stipulation deployment, and the massive data parallel processing.
Hadoop is one of the more mature and widely used cloud computing architectures. The core idea of Hadoop is distributed parallel processing. The key technologies in Hadoop are HDFS (Distributed File System) and map/reduce (Mapping/specification). Hadoop uses HDFS to store massive amounts of data, using MAP/REDUCE to compute massive amounts of data.
This paper first introduces the concept of intelligent home and cloud computing, then, according to the traditional method of mass data processing, the hardware cost is too high and the problem of calculating bottleneck exists, the data processing platform based on Hadoop is built on the basis of cloud computing theory aiming at the access control system, temperature and humidity system, drip irrigation system and illumination system in intelligent home. A large number of sensor information can be distributed in parallel processing, and according to processing results to the bottom of the device to send instructions to achieve intelligent services.
Smart Home and cloud computing
1.1 Smart Home
At present, smart home is usually defined as the use of computers, networks and integrated wiring technology, through the family Information management platform will be related to the life of the various subsystems of a system of organic integration. First of all, it is necessary to establish a communication network at home to provide the necessary access for family information interaction and transmission, and to control and monitor the household appliances and equipment on all home networks through the corresponding hardware and executing agencies under the control of the operating system of the home network. Secondly, the intelligent home system needs to provide the communication channel with the outside through certain media platform, in order to realize the communication with the world outside the family, to meet the requirement of remote control/monitoring and exchanging information.
1.2 Cloud Computing Architecture Hadoop
Hadoop is a distributed computing framework that can run applications on a cluster of inexpensive hardware devices, providing a stable and reliable set of interfaces for applications designed to build a distributed system with high reliability and scalability. The main advantages of Hadoop are: strong capacity, low cost, high efficiency, high reliability, free open source and good portability. The Hadoop project consists of several subprojects, but consists primarily of two major subprojects of the Hadoop Distributed File System (hadoopdistributed file systems, HDFS) and the Mapping/Specification engine (Map/reduce Engine).
1.3 Distributed File System (HDFS)
HDFs consists of a primary node called Namenode and a number of child nodes called Datanode, a typical master-slave (Master/slave) architecture, which shields the underlying complex structure from the primary node and provides convenient file directory mapping to the client. Namenode stores the metadata of the file system, which includes the namespace of the file system, and manages the storage of the file, but the actual data is not stored in the Namenode but is stored by the Datanode in the HDFs Client directly establishes data communication with Datanode.
In addition, in order to reliably mass store files, each file is stored in the form of a block sequence HDFs. To ensure fault tolerance, blocks of files are replicated. The size of the block and the number of replicas can be configured. Name CK node controls all block replication operations, periodically receiving "heartbeat response and Block reports" from Datanode in the cluster. Receiving a node's "heartbeat response indicates that this datanode is normal."
1.4MapReduce Distributed Computing
MapReduce distributed computing is primarily used to handle up to dozens of TB or more of data stored in GFS clusters on thousands of servers.
The operation of MapReduce in the statistical process of temperature values is described below.
The role of MapReduce is to run distributed computing on large datasets on computer clusters, and to do parallel computation for large amounts of data. The entire architecture of MapReduce is composed of the map and reduce functions, and when the program enters a large set of Key/value key pairs, the map function automatically splits the original key/value into a set of key pairs of multiple mediations, and then The reduce function merges the mediation values with the same key to Jiancheng the final output.
1.5 Smart Home Cloud model
Intelligent Home has 7 large subsystems, each system contains different terminals, each terminal is equipped with sensors, sensors to perceive the environment and generate a large number of data. Tens of thousands of users will produce a huge amount of data, and cloud computing reliable data storage, powerful computing power, low operating costs makes it very suitable for processing massive data. So each user will connect to the Cloud service center through the network, the data generated by the cloud Computing center storage and computing processing.
Development programming Analysis
This platform is aimed at several typical applications of intelligent home: access control, temperature, humidity, illumination and other information collection and distributed parallel processing. After starting the program can see the current room temperature, humidity, soil moisture, light intensity, but also through the indoor temperature, humidity, soil moisture settings to change the current state.
2.1 Function Module Design
According to the demand analysis, the system function module is divided into four parts, namely access control system, temperature and humidity system, drip irrigation system, lighting system.
Access control system to achieve the function of cardholder card holders, the Cardholder's card number, from the pre-set database to inquire whether there is the card number, if there is a description of the user as a legitimate user, access control open, and show the cardholder card number, name, card type, otherwise access control continues to remain closed.
The temperature and humidity system shows the current temperature and humidity in the room. When setting a temperature value, the air-conditioning work, according to set temperature adjustment indoor temperature, until the indoor current temperature reaches the set value; When the humidity value is set, the indoor humidity will be adjusted according to the humidity set, until the indoor current humidity reaches the set value.
The drip irrigation system shows the current soil moisture. When the soil moisture is set, the drip irrigation system works and adjusts the humidity until the current humidity is the set soil moisture.
In the lighting system, display the current light intensity in the room. The curtain and the state of the lamp are controlled by the intensity of the illumination.
The function of the intelligent Home cloud computing platform is to be able to bring the sensing information to the server processing, and the user can transmit the sensor information to the server. The server is a cluster of computers, which is modeled using three computers. Three computers distributed parallel processing of information, and according to the processing results of the underlying equipment issued instructions to achieve the effect of intelligent control. At the same time, all kinds of sensing data and the state of the underlying device are written to the database.
2.2 Logical Structure Design
(1) Access control system.
The access status is closed at the beginning. When cardholder to swipe card, get card number, query the database, to determine whether the card ID is legitimate, if the ID is not legitimate, then access to stay closed. If valid, access is opened and the name and gender of the cardholder are displayed.
(2) temperature and humidity system.
When the system starts, the temperature must be judged first. The current temperature is lower than the lower limit, the air conditioner starts heating; The current temperature is above the upper limit, the air conditioner starts the refrigeration; When the indoor temperature adjusts to the comfort range, the air-conditioner closes automatically. The system also shows the current indoor humidity, through the "Set humidity smelting button can set indoor humidity, the current humidity will slowly adjust to the set humidity."
(3) Indoor drip irrigation system.
The state of drip irrigation system is mainly controlled by soil moisture. The humidity is still used in soil moisture.
When the system starts to run, the drip irrigation is closed, then the soil moisture is less than 0.15, if less than 0.15, drip irrigation open, spray water, soil moisture began to rise, when the soil humidity reached a predetermined upper limit (0.4), drip irrigation automatically closed. After the drip irrigation closes, the soil humidity will decrease gradually because of the evaporation of water. The system makes a judgment on soil moisture every 1s, and if the soil humidity is less than 0.15, the drip irrigation opens again. So repeatedly. Of course, the upper limit of soil moisture can also be set by "Setting the Soil hydrometallurgy button."
(4) Lighting system.
The lighting system consists of two parts of curtains and electric lamps. Curtains and lights will change automatically depending on the intensity of the light and the current time. According to the literature [1], the minimum illumination of living room illumination is defined as the critical value, that is, 150Lux.
(5) Intelligent Home Cloud platform.
The entire cloud platform is simulated using five computers, the first computer as a sensor and the bottom of the device simulation, used to generate sensing information. The second computer as a gateway to the underlying devices and servers, leaving three computers to form a server cluster, as a cloud processing center, and the database connected to the sensing information distributed parallel processing. The communication between the server and the client uses the socket.
Platform simulation
3.1 Access control system test
After running the program, the access control is turned off. Click the Generate ID metallurgical button to produce the ID number of the current cardholder card. Then click "Swipe the card to search for a valid ID number that already exists in the database, legal visitors, open access, and display the cardholder's name and gender." Lock the door open after 5s. If the ID number does not exist, the access remains closed, as shown in Figure 4.
3.2 Temperature and humidity system test
After running the program, the current temperature, humidity, and the default lower temperature (18 benefits) and the upper limit temperature (23 benefits) are displayed. The system compares the current temperature with the lower limit temperature and the upper limit temperature, if the current temperature in the human body Comfort Range 18 Benefits ~23 benefit, then the air-conditioning continue to remain closed. At present, when the indoor temperature is lower than the lower limit temperature, the air conditioner turns on, is in the heating state, until the current indoor temperature achieves the comfortable lower limit temperature. At present, when the indoor temperature is higher than the upper limit temperature, the air conditioner turns on and is in the refrigeration state until the current indoor temperature reaches the upper limit temperature of comfort. The upper and lower limit values of the temperature can be set by setting the button.
In the "set humidity side of the text box to enter the indoor humidity to be set, and then press the" Set the humidity smelting button, then the indoor temperature will slowly change, rise or fall, until the current humidity to achieve the set humidity.
3.3 Drip Irrigation System test
After running the program shows the current soil moisture, drip irrigation system at the beginning of the shutdown state. Soil moisture is declining due to evaporation of soil moisture. When the soil moisture drops to 0.15, drip irrigation opens automatically and begins to spray water. The soil moisture increased after drip irrigation, until the current soil moisture reached the set value (the default is 0.4), when the drip irrigation closed again.
3.4 Lighting System Test
After running the program shows the current indoor light intensity, if it is seven o'clock in the morning to the night six o'clock, then the curtains open, other time window curtains closed. The state of the electric lamp is controlled not only by the time period but also by the indoor light intensity. If it is 10 o'clock to seven o'clock in the morning at night, the lights are off. Between seven o'clock in the morning and six o'clock, the lights are generally off, unless the indoor natural light intensity is below 150Lux, night six o'clock to night 10 o'clock, and the lights are turned on.
3.5 Cloud Platform Test
Set up five computers to connect and start, the first computer for analog sensors and low-level devices, the second computer as a gateway to the underlying network and the upper network, leaving three computers as server clusters (Cloud Computing center). The first computer generated sensor data to the second computer, the second computer as a gateway to the data to the server cluster, the server cluster using the Hadoop computing framework for the distributed parallel processing of the sensor data, judge the status of the current intelligent home systems, and issued instructions to the underlying equipment, to achieve the effect of intelligent control.
Concluding
Based on the theory of cloud computing, a data processing platform based on Hadoop is built for the access control system, temperature and humidity system, drip irrigation system and illumination system in intelligent home. A large number of sensor information can be distributed in parallel processing, and according to processing results to the bottom of the device to send instructions to achieve intelligent services. This cloud computing platform is based on the Hadoop distributed computing framework, using three computer simulation services cluster to achieve the parallel processing of massive data, and effectively solve the cost and calculation bottleneck problems.