Based on the iOS platform's design and development technology, a smart home alarm system is implemented in heterogeneous networks to solve security problems in smart homes. In this security system, the ZigBee wireless sensor node (monitoring node) is composed of ZigBee wireless sensor nodes in a self-organizing manner. It can collect real-time information in the monitoring area and transmit the alarm information to the server. The mobile client developed based on iOS technology can help the user to take corresponding alarm processing and operation measures.
First, the overall design
The overall design scheme is shown in Figure 1. The alarm system mainly includes ZigBee data acquisition end, alarm management server end, and iOS mobile client three subsystems. The data collection end is connected to the alarm management server through the serial port, responsible for collecting the monitoring information in the home environment, and taking corresponding alarm operations according to the hardware intelligent control mechanism. The iOS mobile client is responsible for the push of alarm information and the control of alarm operations. It is connected to the alarm management server through the WLAN/GPRS network. The alarm management server is responsible for forwarding and processing the alarm information sent by the information collecting end and responding to the operation information of the mobile client. The data collection side and the alarm management server side only provide a brief introduction. This article will introduce the iOS-based mobile client development in detail.
Second, system design and implementation
1. Design and Implementation of ZigBee Data Acquisition Terminal
The data acquisition system uses the Zig-Bee wireless node to collect and send out alarm information, uses the human pyroelectric infrared sensor (HC-SR501 human body sensing module) to sense human intrusion information in real time, and uses the door magnetic switch module (KTMC8) to passively sense the door or window. Turn on the operation. The data collection scheme utilizes the advantage of ZigBee ad hoc network without fixed infrastructure and multi-source sensor information fusion to ensure the real-time and accuracy of home environment information perception.
2, alarm management server design and implementation
The alarm management server uses a Tomcat 8.0 server. The Tomcat 8.0 server is a free open source web application server. It occupies less system resources and has good scalability. It is suitable for small application servers.
3, iOS mobile client software design and implementation
The mobile client is developed based on the iOS mobile terminal, and the release of alarm information can be achieved through information and image information bearing means. Taking into account other unfavorable factors, such as unstable network speed of the terminal equipment and information processing load changes, the smart home alarm system based on the iOS platform adopts the form of text information push to issue alarm information. After receiving the push message, the terminal reminds the user to take corresponding alarm operations at the terminal, such as turning on the light, taking pictures, and making a call.
(1) Development Platform
iOS is a mobile operating system developed by Apple. Its main application is related mobile devices produced by Apple. The operating system has an easy-to-use interface, powerful features, and superior stability. According to a quarterly global smartphone sales report released by KantarWorldpanelComTech, in the second quarter of 2015, iOS devices took up 24 mobile devices. The share of .4% was a record high, and more and more mobile users chose to use iOS devices. Compared with the Android platform, the mobile terminal device using the iOS system takes the principle of view priority as the principle, and uses fewer frames to ensure the most effective use of the hardware by the developer. At the same time, the iOS system has high security, so the advantages of such devices are mainly reflected in a good user experience and a relatively safe use environment. The iOS mobile client is developed using the non-open source integrated development environment Xcode 6.1 provided by Apple, and the programming language is Objective-C. The early debugging of the smart home alarm program is completed on the Xcode simulator, and the later testing and debugging are completed on the real machine.
(2) Software main program architecture design
First enter the mobile terminal program, the user needs to log in the corresponding account. The mobile terminal receives the alarm message sent by the alarm management server through the WLAN/GPRS in real time. If there is an alarm message, the user can take corresponding alarm operations according to different alarm messages. If the current alarm operation is completed, the state of receiving the push message is entered again. In accordance with the above method, the program is executed cyclically. Figure 2 shows the flow chart of the software main program.
(3) The main interface design
As shown in FIG. 3, the main interface of the mobile terminal application program includes a monitoring area, a scenario setting, monitoring details, and four other function modules.
1. Monitoring area: delete or add monitoring of the designated room;
2. Scenario setting: Set different monitoring conditions for different monitoring areas, including three monitoring status settings: home, home and rest. In addition, users can also add other custom alarm actions;
3. Monitoring details: The monitor area screen is displayed in the form of pictures. The user can take human alarm operation based on this monitoring screen.
4. Other: Provides related information of the mobile terminal program, such as user login, software, version update and other functions.
(4) Alarm message push design
The mobile client uses the iOS message push mechanism to implement alarm message push. This message push mechanism is implemented between the application program APP, the application server (YourServer) and the APNS (ApplePushNotificationService) server. The message push process is shown in Figure 4. The function of the push process is described as follows:
1. Application program (APP) through the iOS system to ApplePushNotificationService (APNS server) registration message push service and apply for DeviceToken (device identification);
2. APNS server sends DeviceToken to APP;
3. APP sends DeviceToken to YourServer (APP server);
4. The APP server sends a push message to the APNS server.
5. The APNS server sends the push message to the APP. The mobile terminal alarm message prompt interface is shown in Figure 5.
(5) User alarm operation design
The user alarm operation interface is shown in Figure 6. After the mobile device receives the push message sent from the APNS server, the user can promptly take related alarm operations according to the push message. For example, click the "light" button to switch the light in the monitor area. Features. Click the "photograph" button to achieve the function of photographing the recording monitoring area. Click the "alarm call" button to implement the dial-up alarm function. The above operations are all implemented in the iOS mobile client. After the user operates the mobile terminal, the relevant management information is forwarded to the data collection terminal through the alarm management server, and the final data collection terminal implements corresponding operations to achieve the purpose of home environment smart home security.
Third, system analysis and test
Software testing is an important part of program development. It is also the key to guaranteeing the normal operation of applications. The programs developed in this article were tested on the Xcode Simulator (Xcode simulator) and the iOS real device. Including delay test and iOS device compatibility test in two parts.
Delay testing, including intrusion alarm message push delays and security operation delays, where the delays include the sum of hardware and software delays. From the test statistics, we can see that different delays have reached the requirements of the system, and the results of the delay test are shown in Figure 7. The iOS device compatibility test includes the compatibility of the alarm system software with the current domestic mainstream iPhone models. After testing, the mobile client can be compatible with the current mainstream iPhone models. iOS device compatibility test results are shown in Table 1. After continuous testing and improvement, the delay and equipment compatibility of the smart home alarm system all meet the design requirements.
Concluding remarks
The iOS-based personnel intrusion alarm system designed in this paper focuses on the needs of smart home security and can be used in many different scenarios such as homes, warehouses, small supermarkets, and individual stores. Combined with the advantages of wireless networking of ZigBee nodes, flexible deployment of different monitoring areas is realized. Developing for the iOS mobile client enables users with iOS devices to use the system, which will increase the target users of the smart home security system. Therefore, the design of the system is better adapted to the needs of the smart home security system and adapts to the development direction of the smart home industry. Future work will further optimize the performance of iOS mobile terminals according to the characteristics of the ZigBee wireless network, adding more monitoring measures to help users get a more perfect experience.
Computer Screen Protector,Screen Protector For Computer,Screen Protector,Best Computer Screen Protectors
Guangdong Magic Electronic Limited , https://www.magicmax.cc