CN105530150A - Android platform based intelligent home client - Google Patents

Android platform based intelligent home client Download PDF

Info

Publication number
CN105530150A
CN105530150A CN201410567206.2A CN201410567206A CN105530150A CN 105530150 A CN105530150 A CN 105530150A CN 201410567206 A CN201410567206 A CN 201410567206A CN 105530150 A CN105530150 A CN 105530150A
Authority
CN
China
Prior art keywords
module
client
data
activity
control
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
CN201410567206.2A
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201410567206.2A priority Critical patent/CN105530150A/en
Publication of CN105530150A publication Critical patent/CN105530150A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides an Android platform based intelligent home client. The client can conveniently and rapidly achieves various functions and can fulfill expectations. The client includes an XML resource file, an Android control, a self-defined or re-written control, an XML layout file, an Activity, an event listening and updating interface, a communication module and a home gateway. The Activity includes a learning waiting box, a controlling waiting box, a network connecting prompt box, and also includes an event and data source listener. The event and data source listener includes update events, control events and wireless learning events. The communication module includes a Socket module and an HTTP module. The Activity, as one of the four main components of the Android system, not only displays the View part, but also provides all entrance interfaces of the control layer so as to complete interactions with various function modules in different lifecyle functions. The Activity connects the View part and bottom layer module functions, obtains data from the View and transfers the data to the Model layer for processing, and at last displays processing results.

Description

A kind of based on Android platform Smart Home client
Technical field
The invention belongs to Smart Home field, a kind of based on Android platform Smart Home client specifically.
Background technology
Smart Home take house as platform, by network technology, automatic control technology, computer technology, the various equipment connections in life staying idle at home environment are got up, realize the intelligentized control method of life staying idle at home environment, human nature and an intelligentized living environment are more provided.Client is the part with user's direct interaction in system, is the most directly embodying of intelligent domestic system integral status, receives and pay close attention to widely.
At present, lot of domestic and international scholar and mechanism are in research Smart Home correlation technique.Achieve a Smart Home total solution, comprise home gateway, family ZigBee wireless network and sensor function module, focus on various piece and directly communicate and in hardware designs, pay close attention to less to client and control mode.Using An droid handheld terminal as the client of Smart Home, the communication protocol between research client and home gateway and the JNI of Android application layer to bottom call.Achieve by the equipment in cdma cellular net and In ternet control household, namely user can be controlled by notebook computer and the multiple client device of handheld terminal; But these household clients also also exist convenient not problem.
Summary of the invention
The present invention is exactly the convenience problem for functional realiey in intelligent domestic system, the aspects such as the communication module of intelligent domestic system control realization, database and message communication format are analyzed and realized, provides a kind of based on Android platform Smart Home client; The present invention can realize each function quickly and easily and meet the expected requirements.
For realizing above-mentioned purpose of the present invention, the present invention adopts following technical scheme.
The present invention is a kind of based on Android platform Smart Home client implementation framework, comprising xml resource file, Android control, self-defined or the control, Xml topology file, Activity, the action listener that rewrite with more net is closed in new interface, communication module, family; Described Activity comprises that the band such as frame, control frame is waited in study, network connects prompting frame, also comprises monitoring event and data source, described in listen event and data source by more new events, control event, wireless learning event; Described communication module comprises Socket module and HTTP module.
As a preferred embodiment of the present invention, described Activity, as one of the four large assemblies of Android, except being shown by View component, also carry all entrances of key-course, in the life cycle function that they are different, what complete with functional module is alternately various.
Further, described Activity is connected to the functions of modules part of View component and bottom, obtains data and then data are passed to Model layer and process from View, finally Graphics Processing result again.
As another kind of preferred version of the present invention, described communication module comprises Socket module and HTTP module, described Socket module and gateway server carry out being connected and sending byte data, arrange connection duration to carry out being connected and sending byte data with abnormality processing and gateway server simultaneously, arrange simultaneously and connect duration and abnormality processing.
The invention has the beneficial effects as follows.
The present invention is directed to the convenience problem of functional realiey in intelligent domestic system, the communication module of intelligent domestic system control realization, the aspect such as database and message communication format are analyzed and realized, thus devising intelligent domestic system client.First based on Android platform, Client Design is divided into View view, Activity key-course and logic function part; Secondly the data message format between self-defined client and embedded gateway, thus adopt formatted message exchange format to improve the extensibility of system and the reliability of Internet Transmission; Design and Implement the database of client, to preserve user setup data and sensor historic data; Communicate with communicating with http protocol to the Socket that client and gateway are mutual and carried out design and implimentation.Finally in conjunction with gateway and radio sensing network node, client functionality is tested.Result of study shows, this client can realize each function quickly and easily, meets the expected requirements.
The present invention's design, based on the Smart Home client of Android, realizes the general frame of client and each functional module, the message format between self-defined and home gateway, and designs client database, makes client functionality abundanter.Mainly from the design aspect of data format mutual between the design and implimentation of the design of client overall framework, communication module, self-defined and gateway and database, design and implimentation is carried out to the client based on Android platform.
Accompanying drawing explanation
Fig. 1 is a kind of Organization Chart based on Android platform Smart Home client of the present invention.
Embodiment
As shown in Figure 1, be a kind of Organization Chart based on Android platform Smart Home client of the present invention; Comprising xml resource file, Android control, self-defined or rewrite control, Xml topology file, Activity, action listener and more new interface, communication module, family close net; Described Activity comprises that the band such as frame, control frame is waited in study, network connects prompting frame, also comprises monitoring event and data source, described in listen event and data source by more new events, control event, wireless learning event; Described communication module comprises Socket module and HTTP module.
Smart Home FTP client FTP of the present invention totally can be divided into 3 parts: based on the client of Android platform, built-in Linux gateway and radio sensing network node.First the execution of all functions sends the corresponding command to gateway by client, at gateway, treatment and analysis is carried out to the order received, then the order after process is transferred to radio sensing network node through telegon, finally by node, home equipment is controlled.
Client of the present invention adopts the Socket based on ICP/IP protocol to communicate with between embedded gateway by Wi-Fi or http communication realizes alternately, Appweb server, SQLite3 database and php script etc. are disposed, to realize each function better in gateway.Radio sensing network node adopts CC2530 chip, is realized the mutual transmission of the data between gateway telegon by Zigbee communication.The functions such as intelligent domestic system mainly realizes control to various household electrical appliances, timing function, interlink warning controls, contextual model controls, environmental monitoring and sensor historic data query.
The present invention sets up Socket communication and carries out being connected and sending byte data with gateway server in the client of Android platform, arranges simultaneously and connects duration and abnormality processing.And Socket communication belongs to time-consuming operation, run if transmission and receiving course are placed in same thread, may program crashing be caused.Therefore, be responsible for specially receive the data that return of gateway by setting up another a thread, send like this and receive and just process in different threads, and data are each time sent corresponding time of reception is set limits, prevent obscuring of transmission thread and receiving thread.The detailed process setting up Socket communication in the client of Android platform is as follows:
(1) Socket object is created:
SocketClientSocket=newSocket();
(2) the IP address that binding is local and port numbers, local port numbers
Identical with service end port numbers, and Socket object is arranged simultaneously
Connect hours restriction:
InterSocketAddressisa=newInterSocketAddress(IP,PORT);
(3) set up Socket connect and arrange connection time-out:
ClientSocket.connect(isa,TIMEOUT);
(4) set up data flow path and data are sent to by circulation road
Service end, use the relevant knowledge of JAVA data flow herein:
DataOutputStreamout=newDadaOutputStream(ClientSocket.
getOutputStream());
Out.write (byte data);
out.flush();
(5) this research set up another a thread be used for specially receive service end
The data returned, in thread, same needs sets up reception stream pipeline, connects
Harvest into rear closedown Socket connect and data broadcast is gone out:
ClassMyThreadextendsThread{ // set up thread
override
Publicvoidrun () // rewrite run method
... // receive data
ClientSocket.close (); // finish receiving, close Socket and connect
}}
// start thread
MyThreadmThread=newMyThread();
mThread.start()。
Activity of the present invention, as one of the four large assemblies of Android, except being shown by View component, also carry all entrances of key-course, and in the life cycle function that they are different, what complete with functional module is alternately various.Described Activity is connected to the functions of modules part of View component and bottom, obtains data and then data are passed to Model layer and process from View, finally Graphics Processing result again.Described communication module comprises Socket module and HTTP module, described Socket module and gateway server carry out being connected and sending byte data, arrange connection duration to carry out being connected and sending byte data with abnormality processing and gateway server simultaneously, arrange simultaneously and connect duration and abnormality processing.

Claims (4)

1., based on an Android platform Smart Home client, it is characterized in that: comprise xml resource file, Android control, self-defined or rewrite control, Xml topology file, Activity, action listener and more new interface, communication module, family close net; Described Activity comprises that the band such as frame, control frame is waited in study, network connects prompting frame, also comprises monitoring event and data source, described in listen event and data source by more new events, control event, wireless learning event; Described communication module comprises Socket module and HTTP module.
2. one according to claim 1 is based on Android platform Smart Home client, it is characterized in that: described Activity is as one of the four large assemblies of Android, except View component is shown, also carry all entrances of key-course, in the life cycle function that they are different, what complete with functional module is alternately various.
3. one according to claim 1 is based on Android platform Smart Home client, it is characterized in that: described Activity is connected to the functions of modules part of View component and bottom, from View, obtain data then data are passed to Model layer and process, finally Graphics Processing result again.
4. one according to claim 1 is based on Android platform Smart Home client, it is characterized in that: described communication module comprises Socket module and HTTP module, described Socket module and gateway server carry out being connected and sending byte data, arrange connection duration to carry out being connected and sending byte data with abnormality processing and gateway server simultaneously, arrange simultaneously and connect duration and abnormality processing.
CN201410567206.2A 2014-10-22 2014-10-22 Android platform based intelligent home client Pending CN105530150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410567206.2A CN105530150A (en) 2014-10-22 2014-10-22 Android platform based intelligent home client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410567206.2A CN105530150A (en) 2014-10-22 2014-10-22 Android platform based intelligent home client

Publications (1)

Publication Number Publication Date
CN105530150A true CN105530150A (en) 2016-04-27

Family

ID=55772153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410567206.2A Pending CN105530150A (en) 2014-10-22 2014-10-22 Android platform based intelligent home client

Country Status (1)

Country Link
CN (1) CN105530150A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254348A (en) * 2016-08-08 2016-12-21 中国地质大学武汉 A kind of Wireless LAN communication method based on Android
CN107274037A (en) * 2017-07-26 2017-10-20 杨建伟 A kind of market shopping indoor navigation system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254348A (en) * 2016-08-08 2016-12-21 中国地质大学武汉 A kind of Wireless LAN communication method based on Android
CN107274037A (en) * 2017-07-26 2017-10-20 杨建伟 A kind of market shopping indoor navigation system

Similar Documents

Publication Publication Date Title
Sisavath et al. Design and implementation of security system for smart home based on IOT technology
CN102625171B (en) Remote control method, system and corresponding equipment for smart television
CN103309308B (en) A kind of device intelligence control method and device, system, PnP device
WO2016058246A1 (en) Smart home gateway and smart home system
CN102355390B (en) Intelligent home system
CN102638460B (en) Home gateway, Cloud Server and the method communicated between the two
CN105357245B (en) A kind of smart home system and its design method based on cloud service and ZigBee technology
CN106707777A (en) Intelligent home remote control system based on cloud system
CN105093945B (en) The system and method that intelligent home device is safely controlled based on intelligent cloud
CN105739322A (en) Intelligent engine system and intelligent household system
CN203366312U (en) Household appliance upgrading system and household appliance
CN104836848A (en) Method for remotely upgrading intelligent household electrical appliances
CN109976176A (en) Control method, Intelligent control equipment and the system of split type household appliance
WO2020168568A1 (en) Data processing method and apparatus, electronic device and readable storage medium
CN111381508B (en) Control method, system and storage medium for smart home
CN102291284A (en) Intelligent terminal device of wireless network digital home
CN108810061A (en) A kind of intelligent domestic system
CN102694705A (en) Internet-based home appliance information management and service device and realization method thereof
CN112332997A (en) Network distribution method of terminal equipment, terminal equipment and computer readable storage medium
CN107479940A (en) A kind of method and device for realizing Internet of Things module
CN105681181A (en) Home gateway system suitable for smart home
CN106850418A (en) A kind of gateway of intelligent home network
CN108449246A (en) A kind of intelligent domestic system based on instant message applications Yu Internet of Things Network Communication
CN110045705B (en) Intelligent home control method, device and system adopting heterogeneous wireless network
CN105530150A (en) Android platform based intelligent home client

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160427

WD01 Invention patent application deemed withdrawn after publication