[go: up one dir, main page]

CN103152378B - A kind of transmission method of network data, system and client - Google Patents

A kind of transmission method of network data, system and client Download PDF

Info

Publication number
CN103152378B
CN103152378B CN201210570683.5A CN201210570683A CN103152378B CN 103152378 B CN103152378 B CN 103152378B CN 201210570683 A CN201210570683 A CN 201210570683A CN 103152378 B CN103152378 B CN 103152378B
Authority
CN
China
Prior art keywords
network
protocol
data
type
transmission
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
CN201210570683.5A
Other languages
Chinese (zh)
Other versions
CN103152378A (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.)
China Mobile Group Jiangxi Co Ltd
Original Assignee
China Mobile Group Jiangxi Co Ltd
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 Mobile Group Jiangxi Co Ltd filed Critical China Mobile Group Jiangxi Co Ltd
Priority to CN201210570683.5A priority Critical patent/CN103152378B/en
Publication of CN103152378A publication Critical patent/CN103152378A/en
Application granted granted Critical
Publication of CN103152378B publication Critical patent/CN103152378B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Communication Control (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种网络数据的传输方法,客户端检测网络制式和判断网络稳定性,根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据;本发明同时还公开了一种网络数据的传输系统和客户端,通过本发明的方案,能够选择最优的传输协议进行数据传输,提高了客户端与服务器的信息交互速度。

The invention discloses a network data transmission method. A client detects the network standard and judges the network stability, determines the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmits the data to the interface server according to the transmission protocol; The invention also discloses a network data transmission system and a client. Through the solution of the invention, the optimal transmission protocol can be selected for data transmission, and the information interaction speed between the client and the server is improved.

Description

一种网络数据的传输方法、系统和客户端A network data transmission method, system and client

技术领域technical field

本发明涉及移动通信技术,尤其涉及一种网络数据的传输方法、系统和客户端。The present invention relates to mobile communication technology, in particular to a network data transmission method, system and client.

背景技术Background technique

随着智能终端的普及,客户端应用已越来越成为企业管理者与普通员工信息交流的主流工具,智能终端中网络的选择、客户端与服务器的交互速度则成为了企业信息沟通的主要障碍。With the popularization of smart terminals, client applications have increasingly become the mainstream tool for information exchange between enterprise managers and ordinary employees. The choice of network in smart terminals and the interaction speed between clients and servers have become the main obstacles to enterprise information communication. .

移动的无线网络有通用分组无线服务(GPRS,GeneralPacketRadioService)、增强型数据速率GSM演进(EDGE,EnhancedDataRateforGSMEvolution)、时分同步码分多址(TD-SCDMA,TimeDivision-SynchronousCodeDivisionMultipleAccess)、Wi-Fi等,在使用无线网络时,各种网络的连通性、互联性差已成为了共识。在现在激烈的竞争中,好的用户体验越来越成为一款成功软件的标志,如果只有软件本身的功能,好的界面,但是没有好的数据通信速度、好的客户需求响应速度,则将很有可能造成无法挽回的损失。Mobile wireless networks include General Packet Radio Service (GPRS, General Packet Radio Service), Enhanced Data Rate GSM Evolution (EDGE, Enhanced Data Rate for GSMEvolution), Time Division Synchronous Code Division Multiple Access (TD-SCDMA, Time Division-Synchronous Code Division Multiple Access), Wi-Fi, etc. When it comes to wireless networks, it has become a consensus that the connectivity and interconnectivity of various networks are poor. In today's fierce competition, good user experience is increasingly becoming a symbol of a successful software. If there are only functions of the software itself and a good interface, but without good data communication speed and customer demand response speed, it will be It is very likely that irreparable damage will be caused.

客户端与服务器通信主要是对信息的交换和使用,目前客户端与服务器通信广泛使用的方式主要有基于TCP/UDP的套接字(Socket)协议、超文本传送协议(HTTP)或简单对象访问协议(SOAP)等。由于移动无线网络制式中GPRS、EDGE网络相对比较稳定,但是网络带宽不大,TD-SCDMA、Wi-Fi网络带宽相对较大,但是网络有可能不太稳定,尤其是在用户是在移动过程中不太稳定。从网络实现条件及传输优缺点来看,Socket需要特定的端口,传输速度快、时间短、实时性强、性能高、可加密、数据安全性强,但传输数据量较小,且需要自定义传输的数据格式,对开发人员的技术要求比较高,需要对传输的数据进行解析,转化成应用级的数据,相对于应用级协议来说,增加了开发者的开发量;相对于Socket,HTTP/SOAP协议是基于应用级的接口协议,使用方便,容错性强,但传输速度较慢,传输数据包中包含辅助应用信息。The communication between the client and the server is mainly the exchange and use of information. At present, the widely used communication methods between the client and the server mainly include socket (Socket) protocol based on TCP/UDP, hypertext transfer protocol (HTTP) or simple object access. protocol (SOAP), etc. Because GPRS and EDGE networks are relatively stable in mobile wireless network standards, but the network bandwidth is not large, TD-SCDMA and Wi-Fi network bandwidth is relatively large, but the network may not be stable, especially when the user is moving Not very stable. From the perspective of network implementation conditions and transmission advantages and disadvantages, Socket requires a specific port, with fast transmission speed, short time, strong real-time performance, high performance, encryption, and strong data security, but the amount of transmitted data is small and needs to be customized. The transmitted data format has relatively high technical requirements for developers. It needs to analyze the transmitted data and convert it into application-level data. Compared with application-level protocols, it increases the amount of development for developers; compared with Socket, HTTP The /SOAP protocol is an interface protocol based on the application level, which is easy to use and has strong fault tolerance, but the transmission speed is relatively slow, and the transmission data packet contains auxiliary application information.

目前,主流的android客户端与服务器的数据交互方式都是以单一的形式进行,要么是以Socket通信,要么是以HTTP/SOAP通信,并且没有从无线网络的制式方面考虑。而在一个大型的应用系统中可能涉及到小文本传输,也可能涉及到像图片、音视频等大数据量的传输,而可能实时性没有那么强,并且很多企业使用客户端的用户都是外勤人员。如在一篇申请号为“201110389055.2”的中国专利申请文件中公开了一种在android上实现Socket通讯服务共享的方法,其中,所述方法包括以下部分:创建Socket管理模块、创建独立线程以运行Socket管理模块、将Socket管理模块封装为系统的服务组件、将Socket服务所具有的对外接口实现为android的IBinder对象、采用android接口描述语言AIDL实现IBinder对象远程代理、并进行进程间的通信和解析,该专利只使用单一的Socket传输方式,而没有考虑到网络制式。At present, the mainstream android client and server data interaction method is in a single form, either by Socket communication, or by HTTP/SOAP communication, and does not consider the standard of the wireless network. In a large-scale application system, it may involve the transmission of small text, or the transmission of large amounts of data such as pictures, audio and video, etc., but the real-time performance may not be so strong, and many users of the enterprise client are field personnel. . For example, a Chinese patent application document with the application number "201110389055.2" discloses a method for sharing Socket communication services on android, wherein the method includes the following parts: creating a Socket management module, creating an independent thread to run Socket management module, encapsulate the Socket management module as a service component of the system, implement the external interface of the Socket service as an android IBinder object, use the android interface description language AIDL to realize the remote proxy of the IBinder object, and perform inter-process communication and analysis , the patent only uses a single Socket transmission mode, without taking into account the network standard.

在现有的无线网络中单一地使用一种通信协议,在一个系统应用中,如果只使用单一的传输方式而没有考虑到网络制式,很可能会在一个系统的开发过程导致投入太多的人力,或在用户使用过程中因客户端与服务器的信息交互速度慢、数据流量大而导致感知不佳,以致业务难以推广。A single communication protocol is used in the existing wireless network. In a system application, if only a single transmission method is used without considering the network standard, it is very likely that too much manpower will be invested in the development process of a system. , or in the process of user use, due to the slow information interaction speed between the client and the server and the large data traffic, the perception is not good, so that the business is difficult to promote.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种网络数据的传输方法、系统和客户端,提高客户端与服务器的信息交互速度。In view of this, the main purpose of the present invention is to provide a network data transmission method, system and client to improve the speed of information interaction between the client and the server.

为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:

本发明提供的一种网络数据的传输方法,该方法包括:A method for transmitting network data provided by the present invention, the method comprising:

客户端检测网络制式和判断网络稳定性;根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据。The client detects the network standard and judges the network stability; determines the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmits the data to the interface server according to the transmission protocol.

上述方案中,所述客户端检测网络制式和判断网络稳定性为:客户端在移动终端后台运行服务进程,所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定。In the above solution, the client detects the network standard and judges the network stability as follows: the client runs a service process in the background of the mobile terminal, the service process detects the network standard currently selected by the mobile terminal, and judges whether the network is Stablize.

上述方案中,所述根据需要传输的数据、网络制式和网络稳定性确定传输协议,为:客户端检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为通用分组无线服务GPRS或增强型数据速率GSM演进EDGE或时分同步码分多址TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为套接字Socket协议;In the above scheme, the determination of the transmission protocol according to the data to be transmitted, the network format and the stability of the network is: the client detects the module selected by the user to transmit data, the type of data transmitted in the module is a text type, and The network standard is General Packet Radio Service GPRS or Enhanced Data Rate GSM Evolution EDGE or Time Division Synchronous Code Division Multiple Access TD-SCDMA or Wi-Fi. When the network is stable, the transmission protocol is determined to be the Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为超文本传送协议HTTP或简单对象访问协议SOAP;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, it is determined that the transmission protocol is Hypertext Transfer Protocol HTTP or Simple Object Access Protocol SOAP;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议。When the type of data transmitted by the module is a multimedia type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol.

本发明提供的一种网络数据的传输系统,该系统包括:客户端、接口服务器;其中,A network data transmission system provided by the present invention, the system includes: a client, an interface server; wherein,

所述客户端,用于检测网络制式和判断网络稳定性,根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据;The client is used to detect the network standard and judge the network stability, determine the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmit the data to the interface server according to the transmission protocol;

所述接口服务器,用于接收客户端传输的数据。The interface server is configured to receive data transmitted by the client.

上述方案中,所述客户端包括:网络检测单元、协议确定单元、数据传输单元;其中,In the above solution, the client includes: a network detection unit, a protocol determination unit, and a data transmission unit; wherein,

所述网络检测单元,用于检测网络制式和判断网络稳定性;The network detection unit is used to detect network standards and judge network stability;

所述协议确定单元,用于根据需要传输的数据、网络检测单元获得的网络制式和网络稳定性确定传输协议;The protocol determination unit is used to determine the transmission protocol according to the data to be transmitted, the network standard and network stability obtained by the network detection unit;

所述数据传输单元,用于按照所述协议确定单元确定的传输协议向接口服务器传输数据。The data transmission unit is configured to transmit data to the interface server according to the transmission protocol determined by the protocol determination unit.

上述方案中,所述网络检测单元,具体用于在移动终端后台运行服务进程,所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定。In the above solution, the network detection unit is specifically used to run a service process in the background of the mobile terminal, and the service process detects the network standard currently selected by the mobile terminal, and judges whether the network is stable through the network signal strength value.

上述方案中,所述协议确定单元,具体用于检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为Socket协议;In the above scheme, the protocol determination unit is specifically used to detect the module selected by the user to transmit data, the type of data transmitted in the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi- Fi, when the network is stable, determine that the transmission protocol is the Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为HTTP协议或SOAP协议;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, determine that the transmission protocol is the HTTP protocol or the SOAP protocol;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议。When the type of data transmitted by the module is a multimedia type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol.

本发明提供的一种客户端,所述客户端包括:网络检测单元、协议确定单元、数据传输单元;其中,A client provided by the present invention, the client includes: a network detection unit, a protocol determination unit, and a data transmission unit; wherein,

所述网络检测单元,用于检测网络制式和判断网络稳定性;The network detection unit is used to detect network standards and judge network stability;

所述协议确定单元,用于根据需要传输的数据、网络检测单元获得的网络制式和网络稳定性确定传输协议;The protocol determination unit is used to determine the transmission protocol according to the data to be transmitted, the network standard and network stability obtained by the network detection unit;

所述数据传输单元,用于按照所述协议确定单元确定的传输协议向接口服务器传输数据。The data transmission unit is configured to transmit data to the interface server according to the transmission protocol determined by the protocol determination unit.

上述方案中,所述网络检测单元,具体用于在移动终端后台运行服务进程,所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定。In the above solution, the network detection unit is specifically used to run a service process in the background of the mobile terminal, and the service process detects the network standard currently selected by the mobile terminal, and judges whether the network is stable through the network signal strength value.

上述方案中,所述协议确定单元,具体用于检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为Socket协议;In the above scheme, the protocol determination unit is specifically used to detect the module selected by the user to transmit data, the type of data transmitted in the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi- Fi, when the network is stable, determine that the transmission protocol is the Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为HTTP协议或SOAP协议;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, determine that the transmission protocol is the HTTP protocol or the SOAP protocol;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议。When the type of data transmitted by the module is a multimedia type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol.

本发明提供了一种网络数据的传输方法、系统和客户端,客户端检测网络制式和判断网络稳定性,根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据;如此,能够选择最优的传输协议进行数据传输,提高了客户端与服务器的信息交互速度。The present invention provides a network data transmission method, system and client. The client detects the network standard and judges the network stability, determines the transmission protocol according to the data to be transmitted, the network standard and the network stability, and sends the network data according to the transmission protocol. The interface server transmits data; in this way, the optimal transmission protocol can be selected for data transmission, which improves the speed of information interaction between the client and the server.

附图说明Description of drawings

图1为本发明实施例提供的网络数据的传输方法流程示意图;FIG. 1 is a schematic flowchart of a network data transmission method provided by an embodiment of the present invention;

图2为本发明实施例提供的网络数据的传输系统结构示意图。FIG. 2 is a schematic structural diagram of a network data transmission system provided by an embodiment of the present invention.

具体实施方式detailed description

这里介绍下无线网络中的传输协议:Here are the transmission protocols in the wireless network:

Socket协议:Socket协议通常也称作套接字协议,应用程序通常通过套接字向网络发出请求或者应答网络请求,套接字之间的连接过程可以分为三个步骤:服务器监听、客户端请求、连接确认,其中,Socket protocol: Socket protocol is usually also called socket protocol. Applications usually send requests to the network or respond to network requests through sockets. The connection process between sockets can be divided into three steps: server monitoring, client request, connection confirmation, where,

服务器监听是服务器端套接字并不定位具体的客户端套接字,而是处于等待连接的状态,实时监控网络状态;Server monitoring means that the server-side socket does not locate the specific client socket, but is in the state of waiting for connection, and monitors the network status in real time;

客户端请求是指由客户端的套接字提出连接请求,要连接的目标是服务器端的套接字,为此,客户端的套接字必须首先描述它要连接的服务器的套接字,指出服务器端套接字的地址和端口号,然后向服务器端套接字提出连接请求;The client request refers to the connection request made by the client's socket, and the target to be connected is the server's socket. For this reason, the client's socket must first describe the socket of the server it wants to connect to, indicating that the server The address and port number of the socket, and then make a connection request to the server-side socket;

连接确认是指当服务器端套接字监听到或者说接收到客户端套接字的连接请求时,响应客户端套接字的请求,建立一个新的线程,把服务器端套接字的描述发给客户端,一旦客户端确认了此描述,连接就建立好了,而服务器端套接字继续处于监听状态,继续接收其他客户端套接字的连接请求。Connection confirmation means that when the server-side socket monitors or receives the connection request of the client-side socket, it responds to the request of the client-side socket, creates a new thread, and sends the description of the server-side socket to For the client, once the client confirms this description, the connection is established, and the server-side socket continues to be in the listening state, and continues to receive connection requests from other client sockets.

HTTP协议或SOAP协议:HTTP协议是一种通信协议,允许将超文本标记语言(HTML)文档从Web服务器传送到Web浏览器,HTTP协议是一个属于应用层的面向对象的协议,由于其简捷、快速的方式,适用于分布式超媒体信息系统;SOAP是一种轻量的、简单的、基于XML的协议,被设计成在WEB上交换结构化的和固化的信息。HTTP protocol or SOAP protocol: HTTP protocol is a communication protocol that allows Hypertext Markup Language (HTML) documents to be transmitted from a Web server to a Web browser. The HTTP protocol is an object-oriented protocol belonging to the application layer. Because of its simplicity, A fast way, suitable for distributed hypermedia information systems; SOAP is a lightweight, simple, XML-based protocol designed to exchange structured and solidified information on the WEB.

本发明的基本思想是:客户端检测网络制式和判断网络稳定性,根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据。The basic idea of the present invention is: the client detects the network standard and judges the network stability, determines the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmits the data to the interface server according to the transmission protocol.

下面通过附图及具体实施例对本发明做进一步的详细说明。The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

本发明实现一种网络数据的传输方法,如图1所示,该方法包括以下几个步骤:The present invention realizes a kind of transmission method of network data, as shown in Figure 1, this method comprises the following several steps:

步骤101:客户端检测网络制式和判断网络稳定性;Step 101: the client detects the network standard and judges the network stability;

具体的,客户端在移动终端后台运行服务进程(Service),所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定,所述网络信号强度值为-50dBm~0dBm时为网络很稳定,网络信号强度值为-90dBm~-51dBm时为网络比较稳定,-110dBm~-91dBm时为网络不稳定;Specifically, the client runs a service process (Service) in the background of the mobile terminal. The service process detects the network standard currently selected by the mobile terminal, and judges whether the network is stable through the network signal strength value. The network signal strength value is -50dBm~ When 0dBm, the network is very stable, when the network signal strength value is -90dBm~-51dBm, the network is relatively stable, when -110dBm~-91dBm, the network is unstable;

所述网络制式包括:GPRS、EDGE、TD-SCDMA或Wi-Fi等。The network standard includes: GPRS, EDGE, TD-SCDMA or Wi-Fi, etc.

步骤102:客户端根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器传输数据;Step 102: The client determines the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmits the data to the interface server according to the transmission protocol;

本步骤中,所述客户端根据需要传输的数据、网络制式和网络稳定性确定传输协议为:客户端检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为Socket协议;In this step, the client determines that the transmission protocol is based on the data to be transmitted, the network format and network stability: the client detects the module that needs to be transmitted by the user, and the type of data transmitted in the module is a text type, And the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is stable, confirm that the transmission protocol is Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为HTTP协议或SOAP协议;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, determine that the transmission protocol is the HTTP protocol or the SOAP protocol;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议,这里不考虑网络是否稳定;When the type of data transmitted by the module is a multimedia type, and the network system is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol, regardless of whether the network is stable here;

在确定传输协议为HTTP协议或SOAP协议时,所述客户端中被用户选择需要传输数据的模块在按照HTTP协议或SOAP协议传输数据过程中,采用的传输数据格式为JSON格式;When it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol, the module in the client that needs to transmit data selected by the user is in the process of transmitting data according to the HTTP protocol or the SOAP protocol, and the transmission data format adopted is JSON format;

这里,所述被用户选择需要传输数据的模块包括:登录模块、应用模块等;Here, the modules selected by the user to transmit data include: a login module, an application module, etc.;

所述登录模块需要传输的只是用户名、密码等信息,传输的数据的类型为文本类型;What the login module needs to transmit is only user name, password and other information, and the type of data transmitted is text type;

所述应用模块需要进行音视频传输,传输的数据的类型为多媒体类型。The application module needs to transmit audio and video, and the type of data to be transmitted is multimedia.

上述方法还包括:在按照Socket协议向接口服务器传输数据时,所述接口服务器中有Socket连接监听程序,通过所述Socket连接监听程序监听客户端传输的数据,对监听到的数据进行处理,比如,监听到客户端传输的登录请求后,根据所述登录请求中的用户名、密码进行鉴权,即在数据库服务器中进行用户名、密码的匹配,将鉴权结果封装成传输报文返回给客户端,并关闭Socket连接。The above method also includes: when transmitting data to the interface server according to the Socket protocol, there is a Socket connection monitoring program in the interface server, monitoring the data transmitted by the client through the Socket connection monitoring program, and processing the monitored data, such as After listening to the login request transmitted by the client, authentication is performed according to the username and password in the login request, that is, the username and password are matched in the database server, and the authentication result is encapsulated into a transmission message and returned to the client, and close the Socket connection.

基于上述传输方法,本发明还提供一种网络数据的传输系统,如图2所示,该系统包括:客户端21、接口服务器22;其中,Based on the above transmission method, the present invention also provides a network data transmission system, as shown in Figure 2, the system includes: a client 21, an interface server 22; wherein,

所述客户端21,用于检测网络制式和判断网络稳定性,根据需要传输的数据、网络制式和网络稳定性确定传输协议,按照所述传输协议向接口服务器22传输数据;The client 21 is used to detect the network standard and judge the network stability, determine the transmission protocol according to the data to be transmitted, the network standard and the network stability, and transmit data to the interface server 22 according to the transmission protocol;

所述接口服务器22,用于接收客户端21传输的数据;The interface server 22 is configured to receive data transmitted by the client 21;

所述客户端21包括:网络检测单元211、协议确定单元212、数据传输单元213;其中,The client 21 includes: a network detection unit 211, a protocol determination unit 212, and a data transmission unit 213; wherein,

所述网络检测单元211,用于检测网络制式和判断网络稳定性;The network detection unit 211 is used for detecting network standards and judging network stability;

所述协议确定单元212,用于根据需要传输的数据、网络检测单元211获得的网络制式和网络稳定性确定传输协议;The protocol determination unit 212 is configured to determine the transmission protocol according to the data to be transmitted, the network standard and network stability obtained by the network detection unit 211;

所述数据传输单元213,用于按照所述协议确定单元212确定的传输协议向接口服务器22传输数据;The data transmission unit 213 is configured to transmit data to the interface server 22 according to the transmission protocol determined by the protocol determination unit 212;

所述网络检测单元211,具体用于在移动终端后台运行服务进程(Service),所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定;The network detection unit 211 is specifically used to run a service process (Service) in the background of the mobile terminal, the service process detects the network standard currently selected by the mobile terminal, and judges whether the network is stable through the network signal strength value;

所述协议确定单元212,具体用于检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为Socket协议;The protocol determination unit 212 is specifically used to detect the module selected by the user to transmit data, the type of data transmitted in the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, the network When stable, confirm that the transmission protocol is the Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为HTTP协议或SOAP协议;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, determine that the transmission protocol is the HTTP protocol or the SOAP protocol;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议,这里不考虑网络是否稳定;When the type of data transmitted by the module is a multimedia type, and the network system is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol, regardless of whether the network is stable here;

这里,所述被用户选择需要传输数据的模块包括:登录模块、应用模块等;Here, the modules selected by the user to transmit data include: a login module, an application module, etc.;

所述登录模块需要传输的只是用户名、密码等信息,传输的数据的类型为文本类型;What the login module needs to transmit is only user name, password and other information, and the type of data transmitted is text type;

所述应用模块需要进行音视频传输,传输的数据的类型为多媒体类型。The application module needs to transmit audio and video, and the type of data to be transmitted is multimedia.

所述客户端21在按照Socket协议向接口服务器22传输数据时,所述接口服务器22,具体用于通过Socket连接监听程序监听客户端21传输的数据,对监听到的数据进行处理,比如,监听到客户端21传输的登录请求后,根据所述登录请求中的用户名、密码进行鉴权,即在数据库服务器中进行用户名、密码的匹配,将鉴权结果封装成传输报文返回给客户端21,并关闭Socket连接。When the client 21 transmits data to the interface server 22 according to the Socket protocol, the interface server 22 is specifically used to monitor the data transmitted by the client 21 through the Socket connection monitoring program, and process the monitored data, such as monitoring After the login request transmitted by the client 21, authentication is performed according to the username and password in the login request, that is, the matching of the username and password is performed in the database server, and the authentication result is encapsulated into a transmission message and returned to the client Terminal 21, and close the Socket connection.

基于上述系统,本发明还提供一种客户端,如图2所示,该客户端21包括:网络检测单元211、协议确定单元212、数据传输单元213;其中,Based on the above system, the present invention also provides a client. As shown in FIG. 2, the client 21 includes: a network detection unit 211, a protocol determination unit 212, and a data transmission unit 213; wherein,

所述网络检测单元211,用于检测网络制式和判断网络稳定性;The network detection unit 211 is used for detecting network standards and judging network stability;

所述协议确定单元212,用于根据需要传输的数据、网络检测单元211获得的网络制式和网络稳定性确定传输协议;The protocol determination unit 212 is configured to determine the transmission protocol according to the data to be transmitted, the network standard and network stability obtained by the network detection unit 211;

所述数据传输单元213,用于按照所述协议确定单元212确定的传输协议向接口服务器22传输数据;The data transmission unit 213 is configured to transmit data to the interface server 22 according to the transmission protocol determined by the protocol determination unit 212;

所述网络检测单元211,具体用于在移动终端后台运行服务进程(Service),所述服务进程检测移动终端当前选择的网络制式,并通过网络信号强度值判断网络是否稳定;The network detection unit 211 is specifically used to run a service process (Service) in the background of the mobile terminal, the service process detects the network standard currently selected by the mobile terminal, and judges whether the network is stable through the network signal strength value;

所述协议确定单元212,具体用于检测被用户选择需要传输数据的模块,在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络稳定时,确定传输协议为Socket协议;The protocol determination unit 212 is specifically used to detect the module selected by the user to transmit data, the type of data transmitted in the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, the network When stable, confirm that the transmission protocol is the Socket protocol;

在所述模块传输的数据的类型为文本类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi,网络不稳定时,确定传输协议为HTTP协议或SOAP协议;The type of data transmitted by the module is a text type, and the network standard is GPRS or EDGE or TD-SCDMA or Wi-Fi, and when the network is unstable, determine that the transmission protocol is the HTTP protocol or the SOAP protocol;

在所述模块传输的数据的类型为多媒体类型,且网络制式为GPRS或EDGE或TD-SCDMA或Wi-Fi时,确定传输协议为HTTP协议或SOAP协议,这里不考虑网络是否稳定;When the type of data transmitted by the module is a multimedia type, and the network system is GPRS or EDGE or TD-SCDMA or Wi-Fi, it is determined that the transmission protocol is the HTTP protocol or the SOAP protocol, regardless of whether the network is stable here;

这里,所述被用户选择需要传输数据的模块包括:登录模块、应用模块等;Here, the modules selected by the user to transmit data include: a login module, an application module, etc.;

所述登录模块需要传输的只是用户名、密码等信息,传输的数据的类型为文本类型;What the login module needs to transmit is only user name, password and other information, and the type of data transmitted is text type;

所述应用模块需要进行音视频传输,传输的数据的类型为多媒体类型。The application module needs to transmit audio and video, and the type of data to be transmitted is multimedia.

以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.

Claims (7)

1. A method for transmitting network data, the method comprising:
the client side runs a service process on a background of the mobile terminal, the service process detects a currently selected network type of the mobile terminal and judges whether a network is stable or not according to a network signal strength value;
determining a transmission protocol according to data to be transmitted, a network type and network stability, and transmitting the data to an interface server according to the transmission protocol.
2. The transmission method according to claim 1, wherein the determining a transmission protocol according to the data to be transmitted, the network type, and the network stability is: the method comprises the steps that a client detects a module needing data transmission selected by a user, when the type of the data transmitted by the module is a text type, the network mode is general packet radio service GPRS or enhanced data rate GSM evolution EDGE or time division synchronous code division multiple access TD-SCDMA or Wi-Fi, and the network is stable, the transmission protocol is determined to be a Socket protocol;
when the type of the data transmitted by the module is a text type and the network mode is GPRS or EDGE or TD-SCDMA or Wi-Fi and the network is unstable, determining that the transmission protocol is a hypertext transfer protocol (HTTP) or a Simple Object Access Protocol (SOAP);
and when the type of the data transmitted by the module is a multimedia type and the network mode is GPRS, EDGE, TD-SCDMA or Wi-Fi, determining that the transmission protocol is an HTTP protocol or an SOAP protocol.
3. A system for transmitting network data, the system comprising: a client and an interface server; wherein,
the client is used for running a service process in a background of the mobile terminal, the service process detects a currently selected network type of the mobile terminal, judges whether a network is stable or not according to a network signal strength value, determines a transmission protocol according to data to be transmitted, the network type and the network stability, and transmits the data to the interface server according to the transmission protocol;
and the interface server is used for receiving the data transmitted by the client.
4. The transmission system according to claim 3, wherein the client comprises: the device comprises a network detection unit, a protocol determination unit and a data transmission unit; wherein,
the network detection unit is used for running a service process in the background of the mobile terminal, detecting the currently selected network type of the mobile terminal by the service process, and judging whether the network is stable or not according to the network signal strength value;
the protocol determining unit is used for determining a transmission protocol according to the data to be transmitted, the network type and the network stability obtained by the network detecting unit;
and the data transmission unit is used for transmitting data to the interface server according to the transmission protocol determined by the protocol determination unit.
5. The transmission system according to claim 4, wherein the protocol determining unit is specifically configured to detect a module that is selected by a user and needs to transmit data, and determine that the transmission protocol is a Socket protocol when the type of data transmitted by the module is a text type and a network format is GPRS, EDGE, TD-SCDMA, or Wi-Fi and the network is stable;
when the type of the data transmitted by the module is a text type and the network mode is GPRS or EDGE or TD-SCDMA or Wi-Fi and the network is unstable, determining that the transmission protocol is HTTP protocol or SOAP protocol;
and when the type of the data transmitted by the module is a multimedia type and the network mode is GPRS, EDGE, TD-SCDMA or Wi-Fi, determining that the transmission protocol is an HTTP protocol or an SOAP protocol.
6. A client, the client comprising: the device comprises a network detection unit, a protocol determination unit and a data transmission unit; wherein,
the network detection unit is used for running a service process in the background of the mobile terminal, detecting the currently selected network type of the mobile terminal by the service process, and judging whether the network is stable or not according to the network signal strength value;
the protocol determining unit is used for determining a transmission protocol according to the data to be transmitted, the network type and the network stability obtained by the network detecting unit;
and the data transmission unit is used for transmitting data to the interface server according to the transmission protocol determined by the protocol determination unit.
7. The client according to claim 6, wherein the protocol determining unit is specifically configured to detect a module that is selected by a user and needs to transmit data, and determine that the transmission protocol is a Socket protocol when the type of data transmitted by the module is a text type and a network format is GPRS, EDGE, TD-SCDMA, or Wi-Fi and the network is stable;
when the type of the data transmitted by the module is a text type and the network mode is GPRS or EDGE or TD-SCDMA or Wi-Fi and the network is unstable, determining that the transmission protocol is HTTP protocol or SOAP protocol;
and when the type of the data transmitted by the module is a multimedia type and the network mode is GPRS, EDGE, TD-SCDMA or Wi-Fi, determining that the transmission protocol is an HTTP protocol or an SOAP protocol.
CN201210570683.5A 2012-12-25 2012-12-25 A kind of transmission method of network data, system and client Active CN103152378B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210570683.5A CN103152378B (en) 2012-12-25 2012-12-25 A kind of transmission method of network data, system and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210570683.5A CN103152378B (en) 2012-12-25 2012-12-25 A kind of transmission method of network data, system and client

Publications (2)

Publication Number Publication Date
CN103152378A CN103152378A (en) 2013-06-12
CN103152378B true CN103152378B (en) 2016-03-02

Family

ID=48550238

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210570683.5A Active CN103152378B (en) 2012-12-25 2012-12-25 A kind of transmission method of network data, system and client

Country Status (1)

Country Link
CN (1) CN103152378B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973778A (en) * 2014-04-22 2014-08-06 华为技术有限公司 Information pushing method and device
CN104980414B (en) * 2014-05-15 2020-01-10 腾讯科技(深圳)有限公司 File transmission method and terminal
TWI552547B (en) * 2014-07-22 2016-10-01 廣達電腦股份有限公司 Data transmission service switch system and method
CN104113835B (en) * 2014-08-01 2016-01-06 努比亚技术有限公司 A kind of ciphertext sends, the method for transmission, mobile terminal and communication base station
CN105007500A (en) * 2015-07-28 2015-10-28 无锡天脉聚源传媒科技有限公司 Video transmission method and device
CN105337821A (en) * 2015-10-22 2016-02-17 湖南快乐阳光互动娱乐传媒有限公司 Internet of things system based on UPNP protocol and Internet of things data transmission method
CN105871509A (en) * 2016-03-25 2016-08-17 乐视控股(北京)有限公司 Data transmission method and device
CN105992290B (en) * 2016-04-28 2019-11-08 努比亚技术有限公司 A kind of user equipment and its method for switching network
CN107547468B (en) * 2016-06-23 2020-03-03 广州市动景计算机科技有限公司 Network protocol switching device, method and terminal
CN106487906B (en) * 2016-11-01 2019-05-17 北京大学(天津滨海)新一代信息技术研究院 A kind of mobile Web application protocol switching method of context aware
CN108111546A (en) * 2018-03-02 2018-06-01 瓦戈科技(上海)有限公司 A kind of document transmission method and system
CN108632376B (en) * 2018-05-10 2021-10-08 Oppo广东移动通信有限公司 A data processing method, terminal, server and computer storage medium
CN109214196B (en) * 2018-08-13 2022-04-19 创新先进技术有限公司 Data interaction method, device and equipment
CN112601122A (en) * 2020-12-14 2021-04-02 福建福讯人才服务有限公司 Screen broadcasting method and system based on udp
CN114979306A (en) * 2022-04-14 2022-08-30 哈尔滨工业大学人工智能研究院有限公司 Novel multi-path fusion transmission method for Internet of things equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212160B1 (en) * 1998-03-24 2001-04-03 Avaya Technlogy Corp. Automated selection of a protocol by a communicating entity to match the protocol of a communications network
CN1691730A (en) * 2004-04-20 2005-11-02 村田机械株式会社 Communication device and communication method
CN1773990A (en) * 2004-11-10 2006-05-17 乐金电子(中国)研究开发中心有限公司 Mobile communication terminal of radio interconnection network based on mobile browsing device and method thereof
CN1867132A (en) * 2006-02-15 2006-11-22 华为技术有限公司 User terminal for carrying out point-to-point file transmission and its transmission method
CN102084634A (en) * 2008-07-02 2011-06-01 汤姆森许可贸易公司 Optimized selection of transmission protocol respecting thresholds

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212160B1 (en) * 1998-03-24 2001-04-03 Avaya Technlogy Corp. Automated selection of a protocol by a communicating entity to match the protocol of a communications network
CN1691730A (en) * 2004-04-20 2005-11-02 村田机械株式会社 Communication device and communication method
CN1773990A (en) * 2004-11-10 2006-05-17 乐金电子(中国)研究开发中心有限公司 Mobile communication terminal of radio interconnection network based on mobile browsing device and method thereof
CN1867132A (en) * 2006-02-15 2006-11-22 华为技术有限公司 User terminal for carrying out point-to-point file transmission and its transmission method
CN102084634A (en) * 2008-07-02 2011-06-01 汤姆森许可贸易公司 Optimized selection of transmission protocol respecting thresholds

Also Published As

Publication number Publication date
CN103152378A (en) 2013-06-12

Similar Documents

Publication Publication Date Title
CN103152378B (en) A kind of transmission method of network data, system and client
EP3195566B1 (en) Service layer interworking using mqtt protocol
US10708376B2 (en) Message bus service directory
CN105099882B (en) A kind of cloud method for pushing and system based on MQTT
CN101534302B (en) A method, system and related device for providing TCP service
CN104009938B (en) The long method and system connected based on route aspect
CN108712485A (en) A kind of resource subscription method and apparatus of internet of things equipment
CN105357283B (en) Long connection establishing method of intelligent wearable equipment, server and terminal
WO2018009815A1 (en) Methods to monitor resources through http/2
CN107172051A (en) A kind of method that internet of things equipment finds and managed
CN102546794A (en) Method for directly communicating browser client with back-end server as well as gateway and communication system
CN110290185B (en) An Agent-based IoT device integration system and its application method
CN110769009B (en) User identity authentication method and system
WO2016086755A1 (en) Packet processing method and transparent proxy server
US20250301022A1 (en) Data transmission method and system, electronic device, and nonvolatile readable storage medium
CN113132477A (en) Real-time transmission interaction method and system for browser terminal and equipment
CN103597466B (en) Real time data based on data-pushing is monitored
CN111884938B (en) Router information acquisition method and device
CN116015892A (en) Intranet remote desktop access method based on private encryption protocol flow agent
CN102647432A (en) Authentication information transmission method, device and authentication middleware
TW201312369A (en) Method for filetring web page content and network equipment
CN104303488A (en) User plane event processing method, PCRF entity, and AF entity
CN104104554A (en) Life cycle method and apparatus for detecting data access request
CN113542324A (en) Message pushing method and device
CN104363235A (en) Communication method, device and system and communication channel establishing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant