CN104683419B - A kind of communication means and system based on Android system and m2m - Google Patents

A kind of communication means and system based on Android system and m2m Download PDF

Info

Publication number
CN104683419B
CN104683419B CN201310642340.XA CN201310642340A CN104683419B CN 104683419 B CN104683419 B CN 104683419B CN 201310642340 A CN201310642340 A CN 201310642340A CN 104683419 B CN104683419 B CN 104683419B
Authority
CN
China
Prior art keywords
data
android system
protocol
terminal
file transfer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310642340.XA
Other languages
Chinese (zh)
Other versions
CN104683419A (en
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.)
Aisino Corp
Original Assignee
Aisino 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 Aisino Corp filed Critical Aisino Corp
Priority to CN201310642340.XA priority Critical patent/CN104683419B/en
Publication of CN104683419A publication Critical patent/CN104683419A/en
Application granted granted Critical
Publication of CN104683419B publication Critical patent/CN104683419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a kind of communication means and system based on Android system and m2m, includes the following steps: that, based on Android system and m2m communication module, terminal generates http agreement using JNI mode, and initiates linking Internet using the http agreement generated;Based on Android system and m2m communication module, terminal generates File Transfer Protocol using JNI mode, and carries out Internet data transmission using the ftp agreement generated.Facilitate exploitation and use, it is practical.

Description

A kind of communication means and system based on Android system and m2m
Technical field
The present invention relates to technical field of the computer network, more particularly to a kind of communication based on Android system and m2m Method and system.
Background technique
Android system is the operating system freely increased income based on linux, aims at mobile device and gives birth to.By means of The powerful function of Android system, the mobile device for meeting various demands is also more and more diversified, more more and more universal.Wherein, it connects Entering internet can be described as most basic function, and Internet of Things is also not only merely a concept, start to be applied to daily life In.
But also lack preferable android system internet access method and system in the prior art.
Summary of the invention
The purpose of the present invention is to provide a kind of communication means and system based on Android system and m2m, is conveniently opened Hair and use, it is practical.
A kind of means of communication based on Android system and m2m provided to realize the present invention, comprising:
Based on Android system and m2m communication module, terminal generates http agreement using JNI mode, and utilizes generation Http agreement initiates linking Internet;
Based on Android system and m2m communication module, terminal generates File Transfer Protocol using JNI mode, and utilizes generation Ftp agreement carries out Internet data transmission.
More preferably, described to be based on Android system and m2m communication module, terminal generates http protocol package using JNI mode Include following steps:
IP address and port is arranged in terminal, opens the data flow of m2m;
Request data is sent, corresponding data is received;
Terminal sends request data according to interaction protocol.
More preferably, the request data includes protocol header and protocol data, and protocol header is generated according to http standard:
"POST/ieds/iedsServlet HTTP/1.1\r\n
Content-Length:1024\r\n
Content-Type:application/octet-stream;Charset=gb18030\r\n
Host:www.aisino.com:8080\r\n\r\n"。
More preferably, described to be based on Android system and m2m communication module, terminal generates http agreement also using JNI mode Include the following steps:
Terminal proofreads protocol header data, the response then returned according to interaction protocol parsing.
More preferably, described to be based on Android system and m2m communication module, terminal generates File Transfer Protocol packet using JNI mode Include following steps:
Two links, the transmitting and receiving of control connection user command are established, data connection is used for the transmitting and receiving of data, beats Open the two data streams on m2m and synchronization;
IP address and port are set, control data flow is opened;
Order is sent, according to ftp agreement, sends username and password, carries out internet ftp using the ftp agreement of generation Data transmission.
More preferably, the ftp data are transmitted as active module or Passive Mode.
More preferably, the transmission of ftp data is carried out using Passive Mode, included the following steps:
It sends PASV order and enters Passive Mode, data IP and port are obtained from response;
Data connection is enabled, document data flow can be obtained by retr order;
Data flow is write under locally specified catalogue, file download is just completed;
Local file is uploaded by stor order.
Purpose also provides a kind of communication system based on Android system and m2m, the terminal and packet to realize the present invention It includes:
Http agreement generation module, ftp agreement generation module, initiation module and data transmission module, in which:
The http agreement generation module is generated for being based on Android system and m2m communication module using JNI mode Http agreement;
The ftp module, for being based on Android system and m2m communication module, terminal generates FTP association using JNI mode View;
The initiation module, for initiating linking Internet using the http agreement generated;
The data transmission module, for carrying out Internet data transmission using the ftp agreement generated.
Communication means and system based on Android system and m2m of the invention, facilitates exploitation and use, practicability By force, the waste of customer flow in the bad situation of network is avoided.
Detailed description of the invention
Fig. 1 is the communication system schematic diagram based on Android system and m2m of one embodiment according to the present invention.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to keep the objectives, technical solutions, and advantages of the present invention more clear thorough Of the invention communication means and system based on Android system and m2m is further elaborated.It should be appreciated that herein Described specific embodiment is only used to explain the present invention, is not intended to limit the present invention.
The present invention is based on the communication means and system of Android system and m2m, are communicated by Android system and m2m Module completes the realization of network application-level protocol http and ftp, the two agreements are to complete the basis of most of network applications, To complete linking Internet.
Communication means based on Android system and m2m, includes the following steps:
Step S100 is based on Android system and m2m communication module, and terminal generates http agreement using JNI mode, and Linking Internet is initiated using the http agreement of generation;
Step S200, is based on Android system and m2m communication module, and terminal generates File Transfer Protocol, and benefit using JNI mode Internet data transmission is carried out with the ftp agreement of generation.
The agreement is realized using JNI mode, facilitates exploitation and use.
Preferably, as an embodiment, the step S100 includes the following steps:
Step S110, terminal are arranged IP address and port, open the data flow of m2m;
Step S120 sends request data, receives corresponding data;
Preferably, as an embodiment, the request data includes protocol header and protocol data, protocol header according to Http standard generates:
"POST/ieds/iedsServlet HTTP/1.1\r\n
Content-Length:1024\r\n
Content-Type:application/octet-stream;Charset=gb18030\r\n
Host:www.aisino.com:8080\r\n\r\n"
Step S130, terminal send request data according to interaction protocol.
Preferably, as an embodiment, the step S100 further includes following steps:
Step S100 ', terminal proofread protocol header data, the response then returned according to interaction protocol parsing.
Preferably, as an embodiment, the step S200 includes the following steps:
Step S210, establishes two links, the transmitting and receiving of control connection user command, and data connection is used for the hair of data Reception is sent, the two data streams on m2m and synchronization are opened;
In order to facilitate control, need to establish two links, the transmitting and receiving of control connection user command, data connection is used for The transmitting and receiving of data opens the two data streams on m2m and synchronization.
IP address and port is arranged in step S220, opens control data flow.
Step S230 sends order, according to ftp agreement, sends username and password, is carried out using the ftp agreement of generation The transmission of internet ftp data.
There are two types of mode, aggressive mode and Passive Mode for the ftp data transmission.Aggressive mode provides file by client The IP address sent and received and port, and Passive Mode be other equipment (such as peripheral server) provide connection IP address and Port.
As an embodiment, in the embodiment of the present invention, using Passive Mode.
As an embodiment, the Passive Mode of the embodiment of the present invention carries out the transmission of ftp data, including walks as follows It is rapid:
Step S231 sends PASV order and enters Passive Mode, data IP and port are obtained from response;
Step S232 enables data connection, can obtain document data flow by retr order;
Data flow is write under locally specified catalogue, just completes file download by step S233;
Step S234 is uploaded local file by stor order.
Communication means based on Android system and m2m avoids the waste of customer flow in the bad situation of network.
Based on same goal of the invention, the communication system based on Android system and m2m that the invention also includes a kind of is described Terminal includes:
Http agreement generation module, ftp agreement generation module, initiation module and data transmission module, in which:
The http agreement generation module is generated for being based on Android system and m2m communication module using JNI mode Http agreement;
The ftp module, for being based on Android system and m2m communication module, terminal generates FTP association using JNI mode View;
The initiation module, for initiating linking Internet using the http agreement generated;
The data transmission module, for carrying out Internet data transmission using the ftp agreement generated.
Communication means and system based on Android system and m2m of the invention, facilitates exploitation and use, practicability By force, the waste of customer flow in the bad situation of network is avoided.
Finally it should be noted that it will be apparent that those skilled in the art can carry out various changes and change to the present invention Type is without departing from the spirit and scope of the present invention.If being wanted in this way, these modifications and changes of the present invention belongs to right of the present invention Ask and its equivalent technologies within the scope of, then the present invention be also intended to encompass these modification and variations.

Claims (6)

1. a kind of communication means based on Android system and m2m, which comprises the steps of:
Based on Android system and m2m communication module, terminal generates http protocol using JNI mode, and utilizes the HTTP generated Agreement initiates linking Internet;
Based on Android system and m2m communication module, terminal generates File Transfer Protocol using JNI mode, and is assisted using the FTP generated View carries out Internet data transmission, in which: described to be based on Android system and m2m communication module, terminal is raw using JNI mode Include the following steps: at File Transfer Protocol
Two links of control link and data link are established, control connection is used for the transmitting and receiving of user command, data connection For the transmitting and receiving of data, the two data streams on m2m and synchronization are opened, which is data flow and control data Stream;
IP address and port are set, control data flow is opened;
Order is sent, according to File Transfer Protocol, sends username and password, carries out internet FTP data using the File Transfer Protocol of generation Transmission;
Described to be based on Android system and m2m communication module, terminal generates http protocol using JNI mode and includes the following steps:
IP address and port is arranged in terminal, opens the data flow of m2m;
Request data is sent, corresponding data is received;
Terminal sends request data according to interaction protocol.
2. the communication means according to claim 1 based on Android system and m2m, which is characterized in that the number of request According to including protocol header and protocol data, protocol header is according to the generation of HTTP standard:
"POST/ieds/iedsServlet HTTP/1.1\r\n
Content-Length:1024\r\n
Content-Type:application/octet-stream;Charset=gb18030 r n
Host:www.aisino.com:8080\r\n\r\n"。
3. the communication means according to claim 2 based on Android system and m2m, which is characterized in that described to be based on Android system and m2m communication module, terminal generates http protocol using JNI mode, and is initiated using the http protocol generated Linking Internet further includes following steps:
Terminal proofreads protocol header data, the response then returned according to interaction protocol parsing.
4. the communication means according to claim 3 based on Android system and m2m, which is characterized in that the FTP number According to being transmitted as aggressive mode or Passive Mode.
5. the communication means according to claim 4 based on Android system and m2m, which is characterized in that using by dynamic model Formula carries out FTP data transmission, includes the following steps:
It sends PASV order and enters Passive Mode, data IP and port are obtained from response;
Data connection is enabled, document data flow can be obtained by retr order;
This document data flow is write under locally specified catalogue, file download is just completed;
Local file is uploaded by stor order.
6. a kind of communication system based on Android system and m2m, including terminal, which is characterized in that the terminal includes:
Http protocol generation module, File Transfer Protocol generation module, initiation module and data transmission module, in which:
The http protocol generation module generates HTTP using JNI mode for being based on Android system and m2m communication module Agreement;
The File Transfer Protocol generation module, for being based on Android system and m2m communication module, terminal is generated using JNI mode File Transfer Protocol;
The initiation module, for initiating linking Internet using the http protocol generated;
The data transmission module, for carrying out Internet data transmission using the File Transfer Protocol generated, wherein
The File Transfer Protocol generation module, for being based on Android system and m2m communication module, terminal is generated using JNI mode File Transfer Protocol includes:
Two links of control link and data link are established, control connection is used for the transmitting and receiving of user command, data connection For the transmitting and receiving of data, the two data streams on m2m and synchronization are opened, which is data flow and control data Stream;
IP address and port are set, control data flow is opened;
Order is sent, according to File Transfer Protocol, sends username and password, carries out internet FTP data using the File Transfer Protocol of generation Transmission;
The http protocol generation module, for being based on Android system and m2m communication module, terminal is generated using JNI mode Http protocol includes the following steps:
IP address and port is arranged in terminal, opens the data flow of m2m;
Request data is sent, corresponding data is received;
Terminal sends request data according to interaction protocol.
CN201310642340.XA 2013-12-03 2013-12-03 A kind of communication means and system based on Android system and m2m Active CN104683419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310642340.XA CN104683419B (en) 2013-12-03 2013-12-03 A kind of communication means and system based on Android system and m2m

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310642340.XA CN104683419B (en) 2013-12-03 2013-12-03 A kind of communication means and system based on Android system and m2m

Publications (2)

Publication Number Publication Date
CN104683419A CN104683419A (en) 2015-06-03
CN104683419B true CN104683419B (en) 2019-08-27

Family

ID=53318004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310642340.XA Active CN104683419B (en) 2013-12-03 2013-12-03 A kind of communication means and system based on Android system and m2m

Country Status (1)

Country Link
CN (1) CN104683419B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107517239A (en) * 2016-06-17 2017-12-26 中兴通讯股份有限公司 Data transmission method and device
CN110930704B (en) * 2019-11-27 2021-11-05 连云港杰瑞电子有限公司 Traffic flow state statistical analysis method based on edge calculation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102111660A (en) * 2011-03-28 2011-06-29 博视联(苏州)信息科技有限公司 Interactive type intelligent network television
CN102447714A (en) * 2010-10-07 2012-05-09 鸿富锦精密工业(深圳)有限公司 Cookie management method
CN103269450A (en) * 2013-04-25 2013-08-28 中国科学院声学研究所 Multimedia system for Android smart television set

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235329A1 (en) * 2009-03-10 2010-09-16 Sandisk Il Ltd. System and method of embedding second content in first content
US20120214416A1 (en) * 2011-02-23 2012-08-23 Jonathan Douglas Kent Methods and apparatuses for communication between devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447714A (en) * 2010-10-07 2012-05-09 鸿富锦精密工业(深圳)有限公司 Cookie management method
CN102111660A (en) * 2011-03-28 2011-06-29 博视联(苏州)信息科技有限公司 Interactive type intelligent network television
CN103269450A (en) * 2013-04-25 2013-08-28 中国科学院声学研究所 Multimedia system for Android smart television set

Also Published As

Publication number Publication date
CN104683419A (en) 2015-06-03

Similar Documents

Publication Publication Date Title
US11122027B2 (en) End-to-end M2M service layer sessions
US20230007097A1 (en) Interworking service for the restful internet of things
US11616851B2 (en) Systems and methods for enabling access to third party services via a service layer
Santos et al. A personal connected health system for the Internet of Things based on the Constrained Application Protocol
CN102546794B (en) Method for directly communicating browser client with back-end server as well as gateway and communication system
WO2017045276A1 (en) Terminal interconnecting method, device, and storage medium
WO2015117367A1 (en) Remote assistance control method and device
CN107104936A (en) Set up the method and system of full-duplex bi-directional communication
CN102904959B (en) Network accelerating method and gateway
JP2015508273A (en) Shared network access via peer-to-peer link
CN103108037B (en) A kind of communication means, Web server and Web communication system
CN106105158B (en) For establishing the method and system of connection between searchers's device and destination apparatus
KR20070080197A (en) Multiple network connection method and communication device thereof
Chen et al. Intelligent file transfer for smart handheld devices based on mobile cloud computing
CN102594886B (en) Method and device for direct communication between browsers, and communication system
CN104683419B (en) A kind of communication means and system based on Android system and m2m
Gonçalves et al. A federated authentication and authorization approach for IoT farming
WO2013123688A1 (en) Method and device for data access
CN103581312B (en) Mobile Internet service implementation method, gateway, agent and system based on AOG
CN112565458A (en) Platform remote control method and device, storage medium and electronic equipment
US11924654B2 (en) Methods and systems for supporting communication a plurality of client communication devices in a wireless local area network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant