CN102546794B - Method for directly communicating browser client with back-end server as well as gateway and communication system - Google Patents
Method for directly communicating browser client with back-end server as well as gateway and communication system Download PDFInfo
- Publication number
- CN102546794B CN102546794B CN201110456297.9A CN201110456297A CN102546794B CN 102546794 B CN102546794 B CN 102546794B CN 201110456297 A CN201110456297 A CN 201110456297A CN 102546794 B CN102546794 B CN 102546794B
- Authority
- CN
- China
- Prior art keywords
- address
- port
- browser client
- gateway
- end server
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供浏览器客户端与后端服务器直通的方法、网关和通信系统,以在浏览器客户端与后端服务器之间实现端到端的全双工通信的同时提高资源利用率。所述方法包括:通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息;根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;根据所述后端服务器的IP地址和端口,通过网关与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。本发明提供的方法无需耗费额外资源实现HTTP与后端服务器之间的协议转换,因此节省了开销。
Embodiments of the present invention provide a method, a gateway and a communication system for direct communication between a browser client and a backend server, so as to improve resource utilization while realizing end-to-end full-duplex communication between the browser client and the backend server. The method includes: receiving the user request message sent by the browser client through the transmission control protocol TCP connection between the gateway and the browser client; querying the message forwarding table according to the IP address and port of the browser client, and obtaining the The IP address and the port of the back-end server associated with the IP address of the client and the port; According to the IP address and the port of the back-end server, the TCP connection between the gateway and the back-end server sends the user request message to the The backend server corresponding to the IP address and port of the above backend server. The method provided by the invention does not need to consume additional resources to implement the protocol conversion between HTTP and the backend server, thus saving overhead.
Description
技术领域 technical field
本发明涉及通信领域,尤其涉及浏览器客户端与后端服务器直通的方法、网关和通信系统。The invention relates to the field of communication, in particular to a method, a gateway and a communication system for direct communication between a browser client and a backend server.
背景技术 Background technique
实时Web是Web2.0体系中的一类互联网应用,其典型代表主要包括互联网的社交网站Facebook和twitter微博。在诸如社交网站Facebook和twitter微博此类的实时Web应用中,网站服务器需要实时地将用户好友的产出(Feed)信息主动推送给用户,使用户及其好友之间可以随时随地产生、分享和消费内容。其他诸如监控、即时通信和即时报价系统等Web应用也需要服务器将后台发生的变化实时传送到客户端。由此可知,实时Web应用的主要特征是高交互性及实时性,即非常需要在浏览器与后端服务器之间提供端到端的、双向(全双工)的实时通信。Real-time Web is a class of Internet applications in the Web 2.0 system, and its typical representatives mainly include Internet social networking sites Facebook and Twitter. In real-time web applications such as social networking sites Facebook and twitter Weibo, the website server needs to actively push the output (Feed) information of the user's friends to the user in real time, so that the user and his friends can generate and share feed information anytime and anywhere. and consume content. Other Web applications such as monitoring, instant messaging, and instant quotation systems also require the server to transmit changes in the background to the client in real time. It can be seen that the main characteristics of real-time Web applications are high interactivity and real-time performance, that is, it is very necessary to provide end-to-end, two-way (full-duplex) real-time communication between the browser and the back-end server.
现有的实现浏览器与后端服务器实时交互获取实时更新信息方法有基于超文本传输协议(Hypertext Transfer Protocol,HTTP)轮询(Polling)和基于HTTP长连接的“服务器推”技术(即Comet技术)等。以下以基于HTTP轮询为例,说明现有技术提供的浏览器与后端服务器实时交互获取实时更新信息方法,包括如下步骤:Existing methods for achieving real-time interaction between the browser and the back-end server to obtain real-time update information include Hypertext Transfer Protocol (Hypertext Transfer Protocol, HTTP) polling (Polling) and HTTP long-connection-based "server push" technology (i.e. Comet technology). )wait. Taking HTTP-based polling as an example, the method for obtaining real-time update information through real-time interaction between the browser and the back-end server provided by the prior art is described below, including the following steps:
S11,浏览器通过Web连接到Web应用服务器,并基于HTTP向Web应用服务器发送HTTP请求;S11, the browser connects to the web application server through the web, and sends an HTTP request to the web application server based on HTTP;
S12,Web应用服务器接收并解析浏览器的HTTP请求,将HTTP请求转换为对其扩展定制应用服务程序的调用;S12, the web application server receives and parses the HTTP request of the browser, and converts the HTTP request into a call to its extended custom application service program;
S13,扩展定制应用服务程序解析Web应用逻辑及协议,并将这些Web应用逻辑及协议转换为对后端服务器的标准API或者消息调用;S13, expand the custom application service program to analyze the Web application logic and protocol, and convert these Web application logic and protocol into a standard API or message call to the back-end server;
S14,扩展定制应用服务程序调用相应的消息客户端程序,例如,RSS(Really Simple Syndication)客户端、JMS(Java Message Service)客户端、EJB(Enterprise Java Bean)客户端或XMPP(The Extensible Messaging andPresence Protocol)客户端程序,建立一个全双工的TCP/IP连接到后端服务器,并基于相应的消息协议交互,从后端服务器获取更新信息;S14, the extended custom application service program calls the corresponding message client program, for example, RSS (Really Simple Syndication) client, JMS (Java Message Service) client, EJB (Enterprise Java Bean) client or XMPP (The Extensible Messaging and Presence Protocol) client program, establishes a full-duplex TCP/IP connection to the back-end server, and interacts based on the corresponding message protocol to obtain update information from the back-end server;
S14,浏览器基于HTTP轮询向Web服务器请求,或者Web服务器使用Comet技术将信息发送给浏览器显示。S14, the browser requests the web server based on HTTP polling, or the web server uses the Comet technology to send information to the browser for display.
上述现有技术提供的浏览器与后端服务器实时交互获取实时更新信息方法中,浏览器与Web应用服务器之间的会话以及Web应用服务器与后端服务器之间的会话是完全独立和割裂的,因此,上述现有技术存在如下缺陷:In the method for obtaining real-time update information through real-time interaction between the browser and the back-end server provided by the above-mentioned prior art, the session between the browser and the Web application server and the session between the Web application server and the back-end server are completely independent and fragmented, Therefore, there is following defective in above-mentioned prior art:
1)资源浪费严重。由于采用的HTTP协议所承载的信息往往只有几个字节,而HTTP头过大(近1K),即无效信息载荷多,因此,频繁的轮询造成系统带宽消耗大、延迟高;1) Serious waste of resources. Since the information carried by the HTTP protocol is often only a few bytes, and the HTTP header is too large (nearly 1K), that is, there are many invalid information loads, therefore, frequent polling causes large system bandwidth consumption and high delay;
2)系统具有性能瓶颈。由于浏览器与后端服务器之间的Web服务器需要运行主要的业务逻辑与计算,因此,Web服务器的性能成为系统的性能瓶颈;2) The system has a performance bottleneck. Since the web server between the browser and the back-end server needs to run the main business logic and calculation, the performance of the web server becomes the performance bottleneck of the system;
3)无法实现端到端的全双工通信。浏览器与Web应用服务器之间通信是基于HTTP协议,例如传统的HTTP轮询或者Comet技术,以获取实时信息;由于传统的HTTP轮询是半双工,基于HTTP协议的Comet技术需要在两条连接上实现双向通信,因此比较耗费服务器资源,在浏览器与后端服务器之间无法很好地实现端到端的全双工的通信。3) End-to-end full-duplex communication cannot be realized. The communication between the browser and the web application server is based on the HTTP protocol, such as the traditional HTTP polling or Comet technology, to obtain real-time information; since the traditional HTTP polling is half-duplex, the Comet technology based on the HTTP protocol needs to be in two Two-way communication is realized on the connection, so it consumes more server resources, and end-to-end full-duplex communication cannot be well realized between the browser and the back-end server.
发明内容 Contents of the invention
本发明实施例提供浏览器客户端与后端服务器直通的方法、网关和通信系统,以在浏览器客户端与后端服务器之间实现端到端的全双工通信的同时提高资源利用率。Embodiments of the present invention provide a method, a gateway and a communication system for direct communication between a browser client and a backend server, so as to improve resource utilization while realizing end-to-end full-duplex communication between the browser client and the backend server.
本发明实施例提供一种浏览器客户端与后端服务器直通的方法,所述方法包括:通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;An embodiment of the present invention provides a method for direct communication between a browser client and a backend server, the method comprising: receiving a user request message sent by the browser client through a transmission control protocol TCP connection between the gateway and the browser client, and the user The request message includes: the IP address and port of the browser client;
根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;According to the IP address and port query message forwarding table of the browser client, obtain the IP address and port of the back-end server associated with the IP address and port of the browser client;
根据所述后端服务器的IP地址和端口,通过网关与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。According to the IP address and port of the back-end server, the user request message is sent to the back-end server corresponding to the IP address and port of the back-end server through the TCP connection between the gateway and the back-end server.
本发明实施例提供一种网关,所述网关包括:An embodiment of the present invention provides a gateway, and the gateway includes:
接收模块,用于通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;The receiving module is used to receive the user request message sent by the browser client through the transmission control protocol TCP connection between the gateway and the browser client, and the user request message includes: the IP address and port of the browser client;
第一获取模块,用于根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;The first acquisition module is used to query the message forwarding table according to the IP address and port of the browser client, and obtain the IP address and port of the back-end server associated with the IP address and port of the browser client;
发送模块,用于根据所述后端服务器的IP地址和端口,通过网关与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。A sending module, configured to send the user request message to the back-end server corresponding to the IP address and port of the back-end server through the TCP connection between the gateway and the back-end server according to the IP address and port of the back-end server end server.
本发明实施例提供一种通信系统,所述通信系统包括:浏览器客户端、网关和后端服务器;An embodiment of the present invention provides a communication system, and the communication system includes: a browser client, a gateway, and a backend server;
所述浏览器客户端,用于通过与所述网关的传输控制协议TCP连接发送用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;The browser client is configured to send a user request message through a transmission control protocol TCP connection with the gateway, and the user request message includes: the IP address and port of the browser client;
所述网关,用于通过与浏览器客户端的所述TCP连接接收浏览器客户端发送的所述用户请求消息;根据所述用户请求消息中浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;根据所述后端服务器的IP地址和端口,通过与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器;The gateway is configured to receive the user request message sent by the browser client through the TCP connection with the browser client; query the message forwarding table according to the IP address and port of the browser client in the user request message, and obtain The IP address and the port of the back-end server associated with the IP address and port of the browser client; according to the IP address and the port of the back-end server, the user request message is sent through the TCP connection with the back-end server Send to the back-end server corresponding to the IP address and port of the back-end server;
所述后端服务器,用于接收所述网关转发的用户请求消息。从上述本发明实施例可知,由于网关与浏览器客户端以及后端服务器建立的是TCP长连接,一方面,浏览器客户端可以与后端服务器实现全双工通信,浏览器客户端的实时信息几近发布时间就能实时发送到后端服务器,因此实时性强;另一方面,网关通过TCP连接负责转发浏览器客户端到后端服务器之间的用户请求消息,主要的业务逻辑与计算分布在浏览器客户端和后端服务器,网关不需要承担主要的业务逻辑与计算,无需耗费额外资源实现HTTP与后端服务器之间的协议转换,因此节省了开销。The backend server is configured to receive the user request message forwarded by the gateway. As can be seen from the above-mentioned embodiment of the present invention, because what the gateway establishes with the browser client and the back-end server is a TCP long connection, on the one hand, the browser client can realize full-duplex communication with the back-end server, and the real-time information of the browser client It can be sent to the back-end server in real time at almost the release time, so the real-time performance is strong; on the other hand, the gateway is responsible for forwarding the user request message between the browser client and the back-end server through the TCP connection, and the main business logic and calculation distribution In the browser client and back-end server, the gateway does not need to undertake the main business logic and calculation, and does not need to consume additional resources to realize the protocol conversion between HTTP and the back-end server, thus saving overhead.
附图说明 Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对现有技术或实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,还可以如这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the prior art or the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiment, for those skilled in the art, other drawings can also be obtained like these drawings.
图1是本发明实施例提供的浏览器客户端与后端服务器直通的方法流程示意图;FIG. 1 is a schematic flow diagram of a method for direct communication between a browser client and a backend server provided by an embodiment of the present invention;
图2是本发明实施例提供的浏览器客户端与后端服务器直通的方法中浏览器客户端、WebSocket网关和后端服务器之间的交互示意图;Fig. 2 is a schematic diagram of the interaction between the browser client, the WebSocket gateway and the back-end server in the direct connection method between the browser client and the back-end server provided by the embodiment of the present invention;
图3是本发明实施例提供的网关结构示意图;FIG. 3 is a schematic diagram of a gateway structure provided by an embodiment of the present invention;
图4是本发明另一实施例提供的网关结构示意图;Fig. 4 is a schematic diagram of a gateway structure provided by another embodiment of the present invention;
图5是本发明另一实施例提供的网关结构示意图;Fig. 5 is a schematic diagram of a gateway structure provided by another embodiment of the present invention;
图6是本发明另一实施例提供的网关结构示意图;Fig. 6 is a schematic diagram of a gateway structure provided by another embodiment of the present invention;
图7本发明实施例提供的通信系统结构示意图;FIG. 7 is a schematic structural diagram of a communication system provided by an embodiment of the present invention;
图8是本发明实施例提供的通信系统物理连接示意图。Fig. 8 is a schematic diagram of the physical connection of the communication system provided by the embodiment of the present invention.
具体实施方式 Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention belong to the protection scope of the present invention.
请参阅附图1,是本发明实施例提供的浏览器客户端与后端服务器直通的方法流程示意图。附图1示例的方法是以浏览器为网页(Web)浏览器、网关是WebSocket网关、WebSocket网关与浏览器客户端、后端服务器进行通信的通信协议是HTML5标准WebSocket协议为例进行,其执行主体可以是WebSocket网关,主要包括步骤:Please refer to FIG. 1 , which is a schematic flowchart of a method for direct communication between a browser client and a backend server provided by an embodiment of the present invention. The method of accompanying drawing 1 example is that the communication protocol that the browser is a webpage (Web) browser, the gateway is a WebSocket gateway, and the communication protocol that the WebSocket gateway communicates with the browser client and the back-end server is the HTML5 standard WebSocket protocol as an example. The subject can be a WebSocket gateway, which mainly includes steps:
S101,通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口。S101. Receive a user request message sent by the browser client through a transmission control protocol TCP connection between the gateway and the browser client, where the user request message includes: the IP address and port of the browser client.
可选地,所述方法还可以包括:通过网关与浏览器客户端的TCP连接接收浏览器客户端发送的握手请求消息,所述握手请求消息包含后端服务器的IP地址和端口;根据所述握手请求消息建立网关与所述后端服务器的TCP连接;将所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。其中,所述根据所述握手请求消息建立网关与所述后端服务器的TCP连接可以为:析取所述握手请求消息包含的所述后端服务器的IP地址和端口;根据所述后端服务器的IP地址和端口建立网关与所述后端服务器的TCP连接。Optionally, the method may also include: receiving a handshake request message sent by the browser client through a TCP connection between the gateway and the browser client, the handshake request message including the IP address and port of the backend server; according to the handshake The request message establishes the TCP connection between the gateway and the back-end server; the IP address and the port of the browser client are associated with the IP address and the port of the back-end server, and the association is updated to the message forwarding Publishing. Wherein, the establishment of the TCP connection between the gateway and the back-end server according to the handshake request message may be: extracting the IP address and port of the back-end server included in the handshake request message; The IP address and port to establish a TCP connection between the gateway and the backend server.
在本发明实施例中,用户在访问网关时,浏览器客户端向网关发送一个应用程序下载请求,从网关下载Web应用程序到浏览器客户端。此后,用户为了从后端服务器获取实时信息,在浏览器客户端运行所述Web应用程序以请求与网关建立传输控制协议(Transmission Control Protocol,TCP)连接。In the embodiment of the present invention, when a user accesses the gateway, the browser client sends an application download request to the gateway, and the web application is downloaded from the gateway to the browser client. Thereafter, in order to obtain real-time information from the back-end server, the user runs the web application program on the browser client to request to establish a transmission control protocol (Transmission Control Protocol, TCP) connection with the gateway.
在浏览器客户端与网关的TCP连接建立后,浏览器客户端可以通过该TCP连接向网关发送、网关通过该TCP接收用户请求消息,例如,订阅请求,该用户请求消息包含浏览器客户端的IP地址和端口等表明信源的信息。为了提高浏览器客户端与网关之间消息传输的效率,在浏览器客户端与网关建立TCP连接后,浏览器客户端可以向网关发送一个握手请求消息,该握手请求消息是基于HTTP协议。网关通过其与浏览器客户端的TCP连接接收浏览器客户端发送的握手请求消息。当网关向浏览器客户端发送一个握手成功的响应消息时,浏览器客户端与网关之间协商成功,后续浏览器客户端与网关之间的交互都是基于WebSocket协议进行,WebSocket协议消息可通过该TCP连接进行传输。由于WebSocket协议消息的消息头(Head)非常小即消息的开销小,因此,与现有技术中浏览器与Web应用服务器采用HTTP协议进行传输相比,效率要高;另一方面,由于网关与浏览器客户端、后端服务器进行通信的通信协议是HTML5标准WebSocket协议而不是私有定制协议,因此,通用性好。After the TCP connection between the browser client and the gateway is established, the browser client can send to the gateway through the TCP connection, and the gateway receives a user request message through the TCP, for example, a subscription request, and the user request message contains the IP address of the browser client. Information such as address and port indicating the source of the message. In order to improve the efficiency of message transmission between the browser client and the gateway, after the browser client establishes a TCP connection with the gateway, the browser client can send a handshake request message to the gateway, and the handshake request message is based on the HTTP protocol. The gateway receives the handshake request message sent by the browser client through its TCP connection with the browser client. When the gateway sends a handshake success response message to the browser client, the negotiation between the browser client and the gateway is successful, and the subsequent interaction between the browser client and the gateway is based on the WebSocket protocol. WebSocket protocol messages can be passed through The TCP connection is used for transmission. Because the message head (Head) of WebSocket protocol message is very small and the overhead of message is little, therefore, compared with browser and Web application server in prior art, adopt HTTP protocol to transmit, efficiency will be high; On the other hand, because gateway and The communication protocol between the browser client and the back-end server is the HTML5 standard WebSocket protocol instead of a private custom protocol, so it has good versatility.
网关接收的握手请求消息可以包含后端服务器的IP地址、端口以及所述后端服务器的通信协议等信息,其中,后端服务器的通信协议是握手请求消息中的可选项,即握手请求消息可以不包含后端服务器的通信协议,后端服务器的通信协议这一信息可以预先配置。后端服务器的IP地址、端口以及所述后端服务器的通信协议等信息可以通过在握手请求消息中新增信元而成,如下所示,是握手请求消息中新增信元的HTTP Upgrade握手请求消息的示例:The handshake request message received by the gateway can include information such as the IP address, port, and communication protocol of the backend server of the backend server, wherein the communication protocol of the backend server is an optional item in the handshake request message, that is, the handshake request message can be The communication protocol of the backend server is not included, and the information of the communication protocol of the backend server can be preconfigured. Information such as the IP address and port of the back-end server and the communication protocol of the back-end server can be formed by adding cells in the handshake request message, as shown below, which is the HTTP Upgrade handshake of adding cells in the handshake request message Example of request message:
其中,新增的信元“DestHost:tcp://myDestHostAddress:9960”,即用于声明后端服务器的IP地址、端口以及所述后端服务器的通信协议,本实施例中,后端服务器的通信协议是TCP。Among them, the newly added information element "DestHost: tcp://myDestHostAddress: 9960" is used to declare the IP address and port of the back-end server and the communication protocol of the back-end server. In this embodiment, the back-end server's The communication protocol is TCP.
在接收到浏览器客户端发送的握手请求消息后,网关根据所述握手请求消息建立其与后端服务器的TCP连接。具体地,网关析取所述握手请求消息包含的所述后端服务器的IP地址和端口,然后根据所述后端服务器的IP地址和端口建立网关至所述后端服务器的TCP连接。After receiving the handshake request message sent by the browser client, the gateway establishes its TCP connection with the backend server according to the handshake request message. Specifically, the gateway extracts the IP address and port of the backend server included in the handshake request message, and then establishes a TCP connection from the gateway to the backend server according to the IP address and port of the backend server.
S102,根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址、端口。S102. Query a message forwarding table according to the IP address and port of the browser client, and obtain the IP address and port of the backend server associated with the IP address and port of the browser client.
在本发明实施例中,网关维护一个消息转发表,当有新的连接建立时,网关可以将该消息转发表进行更新。例如,网关在收到握手请求消息并据此建立网关至所述后端服务器的TCP连接后,可以更新消息转发表,即,记录所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息。在本发明实施中,网关根据浏览器客户端发送的握手请求消息建立网关与所述后端服务器的TCP连接后,将浏览器客户端的IP地址、端口与后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。因此,更新后的消息转发表包含所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息,并且可以记录所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联关系。消息转发表记录这些关联关系的意义在于,根据浏览器客户端的IP地址、端口,通过查询消息转发表,可以获取与之关联的后端服务器的IP地址、端口,或者反之,根据后端服务器的IP地址、端口,通过查询消息转发表,可以获取与之关联的浏览器客户端的IP地址、端口。In the embodiment of the present invention, the gateway maintains a message forwarding table, and when a new connection is established, the gateway can update the message forwarding table. For example, after the gateway receives the handshake request message and establishes the TCP connection between the gateway and the back-end server accordingly, it can update the message forwarding table, that is, record the IP address, port, and port number of the back-end server. information such as the communication protocol and the IP address and port of the browser client. In the implementation of the present invention, after the gateway establishes the TCP connection between the gateway and the back-end server according to the handshake request message sent by the browser client, the IP address and the port of the browser client are associated with the IP address and the port of the back-end server, and update the association relationship into the message forwarding table. Therefore, the updated message forwarding table includes information such as the IP address and port of the backend server, the communication protocol of the backend server, and the IP address and port of the browser client, and can record the information of the browser client The IP address and port of the client are associated with the IP address and port of the back-end server. The significance of these associations recorded in the message forwarding table is that, according to the IP address and port of the browser client, by querying the message forwarding table, the IP address and port of the associated back-end server can be obtained, or vice versa, according to the IP address and port of the back-end server. IP address, port, by querying the message forwarding table, you can obtain the IP address and port of the browser client associated with it.
需要说明的是,由于后端服务器可以广播“建立连接请求”消息,因此,网关也可以在侦听到这些广播的建立连接请求”消息后,建立与后端服务器的TCP连接,本发明对网关建立与后端服务器的TCP连接的方式可不做限制。It should be noted that since the back-end server can broadcast the "connection establishment request" message, the gateway can also establish a TCP connection with the back-end server after listening to these broadcasted "connection establishment request" messages. The way of establishing the TCP connection with the backend server is not limited.
S103,根据后端服务器的IP地址和端口,通过网关与后端服务器的TCP连接将用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。S103, according to the IP address and port of the back-end server, send the user request message to the back-end server corresponding to the IP address and port of the back-end server through the TCP connection between the gateway and the back-end server.
当用户通过浏览器客户端发送一个请求消息时,网关接收浏览器客户端发送的请求消息。由于在应用层以下的网络协议层(例如,IP层),网关可以解析出该请求消息包含的后端服务器的IP地址、端口、后端服务器的通信协议,因此,网关可以查询所述更新后的消息转发表,即,网关根据浏览器客户端的IP地址、端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的的IP地址和端口。然后,根据获取的所述后端服务器IP地址和端口,将所述请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器,从而实现通过所述网关与所述后端服务器的TCP连接,转发所述浏览器客户端与所述后端服务器之间的交互的消息。When the user sends a request message through the browser client, the gateway receives the request message sent by the browser client. Due to the network protocol layer (for example, IP layer) below the application layer, the gateway can resolve the IP address of the backend server, the port, and the communication protocol of the backend server contained in the request message. Therefore, the gateway can query the updated The message forwarding table, that is, the gateway queries the message forwarding table according to the IP address and port of the browser client to obtain the IP address and port of the back-end server associated with the IP address and port of the browser client. Then, according to the acquired IP address and port of the back-end server, the request message is sent to the back-end server corresponding to the IP address and the port of the back-end server, thereby realizing communication with the back-end through the gateway The TCP connection of the server forwards the interactive messages between the browser client and the backend server.
可选地,本发明实施例提供的方法还可以包括:通过网关与后端服务器的TCP连接接收所述后端服务器发送的请求响应消息,所述请求响应消息包括:所述后端服务器的IP地址和端口;根据所述后端服务器的IP地址和端口查询所述消息转发表,获得与所述后端服务器的IP地址和端口关联的浏览器客户端的IP地址和端口;根据所述浏览器客户端的IP地址和端口,通过网关与所述浏览器客户端的TCP连接将所述请求响应消息发送至与所述浏览器客户端的IP地址和端口对应的浏览器客户端。Optionally, the method provided in the embodiment of the present invention may further include: receiving a request response message sent by the backend server through a TCP connection between the gateway and the backend server, the request response message including: the IP address of the backend server address and port; query the message forwarding table according to the IP address and port of the back-end server, obtain the IP address and port of the browser client associated with the IP address and port of the back-end server; according to the browser IP address and port of the client, sending the request response message to the browser client corresponding to the IP address and port of the browser client through the TCP connection between the gateway and the browser client.
后端服务器接收到通过网关转发的请求消息时,向网关发送请求响应消息。网关通过其与后端服务器的TCP连接接收所述后端服务器发送的请求响应消息,该请求响应消息为对浏览器客户端发送的用户请求消息的响应,其中包含后端服务器的IP地址和端口,还可以包含后端服务器的通信协议等信息。When the backend server receives the request message forwarded by the gateway, it sends a request response message to the gateway. The gateway receives the request response message sent by the backend server through its TCP connection with the backend server, and the request response message is a response to the user request message sent by the browser client, which includes the IP address and port of the backend server , and can also contain information such as the communication protocol of the backend server.
由于在应用层以下的网络协议层(例如,IP层),网关可以解析出该请求响应消息包含的后端服务器的IP地址、端口和后端服务器的通信协议等信息,因此,网关可以查询所述更新后的消息转发表,即,网关根据后端服务器的IP地址和端口,查询所述更新后的消息转发表,获取与所述后端服务器的IP地址、端口关联的浏览器客户端的IP地址、端口。然后,根据获取的所述浏览器客户端的IP地址、端口,将所述请求响应消息转发至与所述浏览器客户端的IP地址和端口对应的浏览器客户端,从而实现通过事前网关建立的与所述浏览器客户端的TCP连接,转发所述浏览器客户端与所述后端服务器之间交互的消息。Due to the network protocol layer (for example, IP layer) below the application layer, the gateway can resolve information such as the IP address of the back-end server, the port, and the communication protocol of the back-end server contained in the request response message, so the gateway can query all The updated message forwarding table, that is, the gateway queries the updated message forwarding table according to the IP address and port of the back-end server, and obtains the IP address of the browser client associated with the IP address and port of the back-end server address, port. Then, according to the obtained IP address and port of the browser client, the request response message is forwarded to the browser client corresponding to the IP address and port of the browser client, so as to realize the connection with the gateway established in advance. The TCP connection of the browser client forwards the interactive messages between the browser client and the backend server.
从上述本发明实施例提供的浏览器客户端与后端服务器直通的方法可知,由于网关与浏览器客户端以及后端服务器可以建立的是TCP长连接,一方面,浏览器客户端可以与后端服务器实现全双工通信,浏览器客户端的实时信息几近发布时间就能实时发送到后端服务器,因此实时性强;另一方面,网关通过TCP连接负责转发浏览器客户端发送给后端服务器之间的用户请求消息,主要的业务逻辑与计算分布在浏览器客户端和后端服务器,网关不需要承担主要的业务逻辑与计算,无需耗费额外资源实现HTTP与后端服务器之间的协议转换,因此节省了开销。It can be known from the browser client and the back-end server direct communication method provided by the above-mentioned embodiments of the present invention that since the gateway can establish a TCP long connection with the browser client and the back-end server, on the one hand, the browser client can communicate with the back-end server. The end server realizes full-duplex communication, and the real-time information of the browser client can be sent to the back-end server in real time almost at the release time, so the real-time performance is strong; on the other hand, the gateway is responsible for forwarding the browser client to the back-end through the TCP connection For user request messages between servers, the main business logic and calculation are distributed between the browser client and the back-end server. The gateway does not need to undertake the main business logic and calculation, and does not need to consume additional resources to implement the protocol between HTTP and the back-end server. conversion, thus saving overhead.
以下以浏览器客户端、WebSocket网关和后端服务器之间的交互,并且浏览器客户端通过建立的TCP连接向WebSocket网关发送消息订阅请求以请求订阅新的消息为例,进一步说明浏览器与后端服务器直通的方法,请参阅附图2,浏览器客户端、WebSocket网关和后端服务器之间的交互主要包括:The following takes the interaction between the browser client, the WebSocket gateway and the back-end server, and the browser client sends a message subscription request to the WebSocket gateway through the established TCP connection to request to subscribe to new messages as an example to further illustrate the relationship between the browser and the back-end server. For the direct connection method of the end-server, please refer to Figure 2. The interaction between the browser client, the WebSocket gateway and the back-end server mainly includes:
S201,浏览器客户端向WebSocket网关发送Web应用程序下载请求。S201. The browser client sends a web application download request to the WebSocket gateway.
Web应用程序下载请求是在用户访问网关时,浏览器客户端在接收这一访问请求后向WebSocket网关发送。The web application download request is sent to the WebSocket gateway by the browser client after receiving the access request when the user accesses the gateway.
S202,WebSocket网关将Web应用程序下载到浏览器客户端。S202, the WebSocket gateway downloads the Web application to the browser client.
S203,浏览器客户端运行Web应用程序。S203, the browser client runs the web application program.
S204,浏览器客户端接收用户输入的实时信息请求消息。S204. The browser client receives a real-time information request message input by the user.
S205,浏览器客户端通过Web应用程序向WebSocket网关发送握手请求消息。S205, the browser client sends a handshake request message to the WebSocket gateway through the web application program.
在通信开始时,浏览器客户端可以向网关发送一个基于HTTP格式的握手请求消息,以请求与网关协商通信协议。该握手请求消息包含后端服务器的IP地址、端口,可选地,还可以包含所述后端服务器的通信协议等。后端服务器的IP地址、端口,可选地,还可以包含所述后端服务器的通信协议等信息可以通过在握手请求消息中新增信元而成,以下是握手请求消息中新增信元的HTTP Upgrade握手请求消息的示例:At the beginning of the communication, the browser client can send a HTTP-based handshake request message to the gateway to request to negotiate a communication protocol with the gateway. The handshake request message includes the IP address and port of the backend server, and optionally, the communication protocol of the backend server and the like. The IP address and port of the back-end server, optionally, information such as the communication protocol of the back-end server can also be included by adding new cells in the handshake request message. The following are new cells in the handshake request message An example of the HTTP Upgrade handshake request message:
其中,新增的信元“DestHost:tcp://myDestHostAddress:9960”,即用于声明后端服务器的IP地址、端口以及所述后端服务器的通信协议,本实施例中,后端服务器的通信协议是TCP。Among them, the newly added information element "DestHost: tcp://myDestHostAddress: 9960" is used to declare the IP address and port of the back-end server and the communication protocol of the back-end server. In this embodiment, the back-end server's The communication protocol is TCP.
S206,WebSocket网关解析握手请求消息。S206, the WebSocket gateway parses the handshake request message.
网关通过解析握手请求消息,析取其中包含的所述后端服务器的IP地址和端口,然后根据所述后端服务器的IP地址和端口建立网关与所述后端服务器的TCP连接,包括:The gateway parses the handshake request message, extracts the IP address and port of the back-end server contained therein, and then establishes a TCP connection between the gateway and the back-end server according to the IP address and port of the back-end server, including:
S207,WebSocket网关向后端服务器发送TCP连接建立请求。S207, the WebSocket gateway sends a TCP connection establishment request to the backend server.
S208,后端服务器向WebSocket网关返回响应消息。S208. The backend server returns a response message to the WebSocket gateway.
S209,WebSocket网关更新消息转发表。S209, the WebSocket gateway updates the message forwarding table.
即,WebSocket网关在消息转发表中记录所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等,更新后的消息转发表包含所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息,并且可以记录所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联关系。在本实施中,网关根据浏览器客户端发送的握手请求消息建立网关与所述后端服务器的TCP连接后,将浏览器客户端的IP地址、端口与后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。因此,更新后的消息转发表包含所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息,并且包含所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联关系。消息转发表记录这些关联关系的意义在于,根据浏览器客户端的IP地址、端口,通过查询消息转发表,可以获取与之关联的后端服务器的IP地址、端口,或者反之,根据后端服务器的IP地址、端口,通过查询消息转发表,可以获取与之关联的浏览器客户端的IP地址、端口。That is, the WebSocket gateway records the IP address and port of the backend server, the communication protocol of the backend server and the IP address and port of the browser client in the message forwarding table, and the updated message forwarding table includes all information such as the IP address and port of the back-end server, the communication protocol of the back-end server, and the IP address and port of the browser client, and can record the IP address and port of the browser client in relation to the back-end The IP address and port association of the server. In this implementation, after the gateway establishes the TCP connection between the gateway and the backend server according to the handshake request message sent by the browser client, the IP address and port of the browser client are associated with the IP address and port of the backend server, and The association relationship is updated in the message forwarding table. Therefore, the updated message forwarding table includes information such as the IP address and port of the backend server, the communication protocol of the backend server, and the IP address and port of the browser client, and includes information such as the IP address and port of the browser client. The IP address, port and the IP address and port association relationship of the backend server. The significance of these associations recorded in the message forwarding table is that, according to the IP address and port of the browser client, by querying the message forwarding table, the IP address and port of the associated back-end server can be obtained, or vice versa, according to the IP address and port of the back-end server. IP address, port, by querying the message forwarding table, you can obtain the IP address and port of the browser client associated with it.
S210,WebSocket网关向浏览器客户端发送握手请求响应消息。S210, the WebSocket gateway sends a handshake request response message to the browser client.
WebSocket网关向浏览器客户端发送的握手请求响应消息表明WebSocket网关与浏览器客户端以及后端服务器成功建立TCP连接,后续的浏览器客户端与后端服务器的消息交互都可以通过该TCP连接进行。The handshake request response message sent by the WebSocket gateway to the browser client indicates that the WebSocket gateway has successfully established a TCP connection with the browser client and the backend server, and subsequent message interactions between the browser client and the backend server can be carried out through this TCP connection .
S211,浏览器客户端向WebSocket网关发送消息订阅请求。S211. The browser client sends a message subscription request to the WebSocket gateway.
对于应用层以下的网络协议层,例如,IP层,该消息订阅请求包含所述后端服务器的IP地址、端口和所述后端服务器的通信协议等信息。For the network protocol layer below the application layer, for example, the IP layer, the message subscription request includes information such as the IP address and port of the backend server, and the communication protocol of the backend server.
S212,WebSocket网关解析该消息订阅请求。S212. The WebSocket gateway parses the message subscription request.
在应用层以下的网络协议层(例如,IP层),WebSocket网关可以解析出该消息订阅请求包含的所述后端服务器的IP地址、端口和所述后端服务器的通信协议等信息,因此,WebSocket网关可以查询步骤S209中更新后的消息转发表,即,WebSocket网关根据浏览器客户端的IP地址和端口,查询消息转发表,获得与所述浏览器客户端关联的后端服务器的IP地址和端口。At the network protocol layer (for example, IP layer) below the application layer, the WebSocket gateway can resolve information such as the IP address of the back-end server, the port, and the communication protocol of the back-end server contained in the message subscription request. Therefore, The WebSocket gateway can query the updated message forwarding table in step S209, that is, the WebSocket gateway queries the message forwarding table according to the IP address and port of the browser client, and obtains the IP address and the IP address of the backend server associated with the browser client. port.
S213,WebSocket网关向后端服务器发送消息订阅请求。S213, the WebSocket gateway sends a message subscription request to the backend server.
WebSocket网关根据获取的后端服务器的IP地址和端口,将所述消息订阅请求发送至与所述后端服务器的IP地址和端口对应的后端服务器。The WebSocket gateway sends the message subscription request to the backend server corresponding to the IP address and port of the backend server according to the acquired IP address and port of the backend server.
S214,后端服务器向WebSocket网关发送与消息订阅请求相应的请求响应消息。S214. The backend server sends a request response message corresponding to the message subscription request to the WebSocket gateway.
对于应用层以下的网络协议层,例如,IP层,与消息订阅请求相应的响应消息包含后端服务器的IP地址和端口,,还可以包含后端服务器的通信协议等信息。For the network protocol layer below the application layer, for example, the IP layer, the response message corresponding to the message subscription request includes the IP address and port of the backend server, and may also include information such as the communication protocol of the backend server.
S215,WebSocket网关将后端服务器的响应消息转发至浏览器客户端。S215. The WebSocket gateway forwards the response message of the backend server to the browser client.
S216,后端服务器向WebSocket网关发送更新消息。S216. The backend server sends an update message to the WebSocket gateway.
该更新消息即为消息订阅请求所请求订阅的消息。The update message is the message requested to be subscribed by the message subscription request.
S217,WebSocket网关解析与消息订阅请求相应的响应消息。S217, the WebSocket gateway parses the response message corresponding to the message subscription request.
由于在应用层以下的网络协议层(例如,IP层),WebSocket网关可以解析出与消息订阅请求相应的请求响应消息包含的所述后端服务器后端服务器的IP地址、端口和后端服务器的通信协议等信息,因此,WebSocket网关可以查询步骤S209中更新后的消息转发表,即,WebSocket网关根据后端服务器的IP地址和端口,查询所述更新后的消息转发表,获取与所述后端服务器关联的浏览器客户端的IP地址、端口。Due to the network protocol layer (for example, IP layer) below the application layer, the WebSocket gateway can resolve the IP address of the back-end server, the port and the IP address of the back-end server contained in the request response message corresponding to the message subscription request. communication protocol and other information, therefore, the WebSocket gateway can query the updated message forwarding table in step S209, that is, the WebSocket gateway queries the updated message forwarding table according to the IP address and port of the back-end server, and obtains the information related to the The IP address and port of the browser client associated with the end server.
S218,WebSocket网关向浏览器客户端转发更新消息。S218, the WebSocket gateway forwards the update message to the browser client.
WebSocket网关根据获取的与所述后端服务器关联的浏览器客户端的IP地址、端口后,通过浏览器客户端的IP地址、端口查询到相应的浏览器通信连接,将步骤S216中后端服务器向WebSocket网关发送的更新消息转发至与所述浏览器客户端的IP地址和端口对应的浏览器客户端。After the IP address and the port of the browser client associated with the described back-end server obtained, the WebSocket gateway inquires about the corresponding browser communication connection through the IP address and port of the browser client, and sends the back-end server in step S216 to the WebSocket The update message sent by the gateway is forwarded to the browser client corresponding to the IP address and port of the browser client.
S219,浏览器客户端向WebSocket网关发送与更新消息相应的响应消息。S219, the browser client sends a response message corresponding to the update message to the WebSocket gateway.
该响应消息是对WebSocket网关转发的更新消息的确认。This response message is an acknowledgment of the update message forwarded by the WebSocket gateway.
S220,WebSocket网关将与更新消息相应的响应消息发送至后端服务器。S220, the WebSocket gateway sends a response message corresponding to the update message to the backend server.
请参阅附图3,是本发明实施例提供的网关结构示意图。为了便于说明,仅仅示出了与本发明实施例相关的部分。附图3示例的网关可以是WebSocket网关,其与浏览器客户端、后端服务器进行通信的通信协议可以是HTML5标准WebSocket协议。附图3示例的网关包括接收模块301、第一获取模块302和发送模块303,其中:Please refer to FIG. 3 , which is a schematic diagram of a gateway structure provided by an embodiment of the present invention. For ease of description, only parts related to the embodiments of the present invention are shown. The gateway illustrated in FIG. 3 may be a WebSocket gateway, and the communication protocol for communicating with the browser client and the backend server may be the HTML5 standard WebSocket protocol. The gateway illustrated in Figure 3 includes a receiving module 301, a first acquiring module 302 and a sending module 303, wherein:
接收模块301,用于通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;The receiving module 301 is used to receive the user request message sent by the browser client through the transmission control protocol TCP connection between the gateway and the browser client, and the user request message includes: the IP address and port of the browser client;
第一获取模块302,用于根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;The first obtaining module 302 is used to query the message forwarding table according to the IP address and port of the browser client, and obtain the IP address and port of the back-end server associated with the IP address and port of the browser client;
发送模块303,用于根据所述后端服务器的IP地址和端口,通过网关与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。The sending module 303 is configured to send the user request message to the IP address and port corresponding to the back-end server through the TCP connection between the gateway and the back-end server according to the IP address and port of the back-end server backend server.
当用户通过浏览器客户端发送一个请求消息时,接收模块301接收浏览器客户端发送的请求消息。由于在应用层以下的网络协议层(例如,IP层),网关可以解析出该请求消息包含的后端服务器的IP地址、端口、后端服务器的通信协议,因此,第一获取模块302可以查询所述更新后的消息转发表,即,第一获取模块302根据浏览器客户端的IP地址、端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的的IP地址和端口。然后,发送模块303根据获取的所述后端服务器IP地址和端口,将所述请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器,从而实现通过所述网关与所述后端服务器的TCP连接,转发所述浏览器客户端与所述后端服务器之间的交互的消息。When the user sends a request message through the browser client, the receiving module 301 receives the request message sent by the browser client. Due to the network protocol layer (for example, IP layer) below the application layer, the gateway can resolve the IP address of the back-end server, the port, and the communication protocol of the back-end server contained in the request message. Therefore, the first acquisition module 302 can query The updated message forwarding table, that is, the first obtaining module 302 queries the message forwarding table according to the IP address and port of the browser client to obtain the IP address of the back-end server associated with the IP address and port of the browser client. address and port. Then, the sending module 303 sends the request message to the back-end server corresponding to the IP address and port of the back-end server according to the acquired IP address and port of the back-end server, thereby realizing communication with the back-end server through the gateway The TCP connection of the back-end server is forwarded, and the interactive message between the browser client and the back-end server is forwarded.
从上述本发明实施例提供的网关可知,由于网关与浏览器客户端以及后端服务器可以建立的是TCP长连接,一方面,浏览器客户端可以与后端服务器实现全双工通信,浏览器客户端的实时信息几近发布时间就能实时发送到后端服务器,因此实时性强;另一方面,网关通过TCP连接负责转发浏览器客户端发送给后端服务器之间的用户请求消息,主要的业务逻辑与计算分布在浏览器客户端和后端服务器,网关不需要承担主要的业务逻辑与计算,无需耗费额外资源实现HTTP与后端服务器之间的协议转换,因此节省了开销。From the gateway provided by the above-mentioned embodiments of the present invention, it can be seen that since the gateway, the browser client and the back-end server can establish a TCP long connection, on the one hand, the browser client can realize full-duplex communication with the back-end server, and the browser The real-time information of the client can be sent to the back-end server in real time almost at the release time, so the real-time performance is strong; on the other hand, the gateway is responsible for forwarding the user request message sent by the browser client to the back-end server through the TCP connection. The business logic and calculation are distributed between the browser client and the back-end server. The gateway does not need to undertake the main business logic and calculation, and does not need to spend additional resources to realize the protocol conversion between HTTP and the back-end server, thus saving costs.
需要说明的是,以上网关的实施方式中,各功能模块的划分仅是举例说明,实际应用中可以根据需要,例如相应硬件的配置要求或者软件的实现的便利考虑,而将上述功能分配由不同的功能模块完成,即将所述网关的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。而且,实际应用中,本实施例中的相应的功能模块可以是由相应的硬件实现,也可以由相应的硬件执行相应的软件完成,例如,前述的接收模块,可以是具有执行前述通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息的硬件,例如接收器,也可以是能够执行相应计算机程序从而完成前述功能的一般处理器或者其他硬件设备;再如前述的第一获取模块,可以是具有执行前述将根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口功能的硬件,例如第一获取器,也可以是能够执行相应计算机程序从而完成前述功能的一般处理器或者其他硬件设备(本说明书提供的各个实施例都可应用上述描述原则)。在附图3示例的网关可以进一步包括握手消息接收模块401、连接建立模块402和更新模块403,如附图4所示本发明另一实施例提供的网关,其中:It should be noted that in the above implementation of the gateway, the division of each functional module is only an example. In practical applications, the above functions can be allocated according to needs, such as the configuration requirements of corresponding hardware or the convenience of software implementation. The functional modules are completed, that is, the internal structure of the gateway is divided into different functional modules to complete all or part of the functions described above. Moreover, in practical applications, the corresponding functional modules in this embodiment can be implemented by corresponding hardware, or can be completed by corresponding hardware executing corresponding software. For example, the aforementioned receiving module can be implemented with The transmission control protocol TCP connection of the browser client is the hardware that receives the user request message sent by the browser client, such as the receiver, or it can be a general processor or other hardware device that can execute the corresponding computer program to complete the aforementioned functions; as mentioned above The first obtaining module can be to have the IP address and port of the back-end server associated with the IP address and port of the browser client to obtain the IP address and port associated with the browser client according to the IP address and port query message forwarding table of the aforementioned browser client. Functional hardware, such as the first acquirer, may also be a general processor or other hardware device capable of executing corresponding computer programs to complete the aforementioned functions (the above description principles can be applied to each embodiment provided in this specification). The gateway illustrated in Figure 3 may further include a handshake message receiving module 401, a connection establishment module 402, and an update module 403, as shown in Figure 4, the gateway provided by another embodiment of the present invention, wherein:
握手消息接收模块401,用于通过网关与浏览器客户端的TCP连接接收浏览器客户端发送的握手请求消息,所述握手请求消息包含后端服务器的IP地址和端口;The handshake message receiving module 401 is used to receive the handshake request message sent by the browser client through the TCP connection between the gateway and the browser client, and the handshake request message includes the IP address and port of the backend server;
为了提高浏览器客户端与网关之间消息传输的效率,在浏览器客户端与网关建立TCP连接后,浏览器客户端可以向网关发送一个握手请求消息,该握手请求消息是基于HTTP协议。握手消息接收模块401通过网关与浏览器客户端的TCP连接接收浏览器客户端发送的握手请求消息。当网关向浏览器客户端发送一个握手成功的响应消息时,浏览器客户端与网关之间协商成功,后续浏览器客户端与网关之间的交互都是基于WebSocket协议进行,WebSocket协议消息可通过该TCP连接进行传输。由于WebSocket协议消息的消息头(Head)非常小即消息的开销小,因此,与现有技术中浏览器与Web应用服务器采用HTTP协议进行传输相比,效率要高;另一方面,由于网关与浏览器客户端、后端服务器进行通信的通信协议是HTML5标准WebSocket协议而不是私有定制协议,因此,通用性好。In order to improve the efficiency of message transmission between the browser client and the gateway, after the browser client establishes a TCP connection with the gateway, the browser client can send a handshake request message to the gateway, and the handshake request message is based on the HTTP protocol. The handshake message receiving module 401 receives the handshake request message sent by the browser client through the TCP connection between the gateway and the browser client. When the gateway sends a handshake success response message to the browser client, the negotiation between the browser client and the gateway is successful, and the subsequent interaction between the browser client and the gateway is based on the WebSocket protocol. WebSocket protocol messages can be passed through The TCP connection is used for transmission. Because the message head (Head) of WebSocket protocol message is very small and the overhead of message is little, therefore, compared with browser and Web application server in prior art, adopt HTTP protocol to transmit, efficiency will be high; On the other hand, because gateway and The communication protocol between the browser client and the back-end server is the HTML5 standard WebSocket protocol instead of a private custom protocol, so it has good versatility.
握手消息接收模块401接收的握手请求消息可以包含后端服务器的IP地址、端口以及所述后端服务器的通信协议等信息,其中,后端服务器的通信协议是握手请求消息中的可选项,即握手请求消息可以不包含后端服务器的通信协议,后端服务器的通信协议这一信息可以预先配置。后端服务器的IP地址、端口以及所述后端服务器的通信协议等信息可以通过在握手请求消息中新增信元而成,如下所示,是握手请求消息中新增信元的HTTP Upgrade握手请求消息的示例:The handshake request message received by the handshake message receiving module 401 may include information such as the IP address of the backend server, the port, and the communication protocol of the backend server, wherein the communication protocol of the backend server is an optional item in the handshake request message, namely The handshake request message may not include the communication protocol of the backend server, and the information of the communication protocol of the backend server may be preconfigured. Information such as the IP address and port of the back-end server and the communication protocol of the back-end server can be formed by adding cells in the handshake request message, as shown below, which is the HTTP Upgrade handshake of adding cells in the handshake request message Example of request message:
其中,新增的信元“DestHost:tcp://myDestHostAddress:9960”,即用于声明后端服务器的IP地址、端口以及所述后端服务器的通信协议,本实施例中,后端服务器的通信协议是TCP。Among them, the newly added information element "DestHost: tcp://myDestHostAddress: 9960" is used to declare the IP address and port of the back-end server and the communication protocol of the back-end server. In this embodiment, the back-end server's The communication protocol is TCP.
连接建立模块402,用于根据所述握手请求消息建立网关与所述后端服务器的TCP连接;A connection establishment module 402, configured to establish a TCP connection between the gateway and the backend server according to the handshake request message;
更新模块403,用于将所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。附图3示例的网关可以进一步包括响应消息接收模块501、第二获取模块502和响应消息发送模块503,如附图5所示本发明另一实施例提供的网关,其中:An update module 403, configured to associate the IP address and port of the browser client with the IP address and port of the backend server, and update the association relationship into the message forwarding table. The gateway illustrated in Figure 3 may further include a response message receiving module 501, a second obtaining module 502, and a response message sending module 503, such as the gateway provided in another embodiment of the present invention shown in Figure 5, wherein:
响应消息接收模块501,用于通过网关与后端服务器的TCP连接接收所述后端服务器发送的请求响应消息,所述请求响应消息包括:所述后端服务器的IP地址和端口;Response message receiving module 501, configured to receive the request response message sent by the back-end server through the TCP connection between the gateway and the back-end server, the request response message including: the IP address and port of the back-end server;
第二获取模块502,用于根据所述后端服务器的IP地址和端口查询所述消息转发表,获得与所述后端服务器的IP地址和端口关联的浏览器客户端的IP地址和端口;The second obtaining module 502 is used to query the message forwarding table according to the IP address and port of the back-end server, and obtain the IP address and port of the browser client associated with the IP address and port of the back-end server;
响应消息发送模块503,用于根据所述浏览器客户端的IP地址和端口,通过网关与所述浏览器客户端的TCP连接将所述请求响应消息发送至与所述浏览器客户端的IP地址和端口对应的浏览器客户端。The response message sending module 503 is used to send the request response message to the IP address and port of the browser client through the TCP connection between the gateway and the browser client according to the IP address and port of the browser client corresponding browser client.
应当理解的是,附图4示例的网关也可以进一步包括如附图5所示的响应消息接收模块501、第二获取模块502以及响应消息发送模块503,功能如上,在此不再赘述。It should be understood that the gateway illustrated in FIG. 4 may further include a response message receiving module 501, a second obtaining module 502, and a response message sending module 503 as shown in FIG. 5. The functions are as above and will not be repeated here.
在本发明实施例中,网关维护一个消息转发表,当有新的连接建立时,更新模块403可以将该消息转发表进行更新。例如,连接建立模块402在收到握手请求消息并据此建立网关至所述后端服务器的TCP连接后,更新模块403可以更新消息转发表,即,记录所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息。在本发明实施中,连接建立模块402根据浏览器客户端发送的握手请求消息建立网关与所述后端服务器的TCP连接后,更新模块403将浏览器客户端的IP地址、端口与后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。因此,更新后的消息转发表包含所述后端服务器的IP地址、端口、所述后端服务器的通信协议以及所述浏览器客户端的IP地址和端口等信息,并且可以记录所述浏览器客户端的IP地址、端口与所述后端服务器的IP地址、端口关联关系。消息转发表记录的关联关系的意义在于,第一获取模块302根据浏览器客户端的IP地址、端口,通过查询消息转发表,可以获取与之关联的后端服务器的IP地址、端口,或者反之,第二获取模块502根据后端服务器的IP地址、端口,通过查询消息转发表,可以获取与之关联的浏览器客户端的IP地址、端口。In the embodiment of the present invention, the gateway maintains a message forwarding table, and when a new connection is established, the update module 403 can update the message forwarding table. For example, after the connection establishment module 402 receives the handshake request message and establishes the TCP connection between the gateway and the backend server accordingly, the update module 403 can update the message forwarding table, that is, record the IP address and port of the backend server , the communication protocol of the backend server, the IP address and port of the browser client, and other information. In the implementation of the present invention, after the connection establishment module 402 establishes the TCP connection between the gateway and the backend server according to the handshake request message sent by the browser client, the update module 403 compares the IP address and port of the browser client with the IP address and port of the backend server. Associating the IP address with the port, and updating the association relationship into the message forwarding table. Therefore, the updated message forwarding table includes information such as the IP address and port of the backend server, the communication protocol of the backend server, and the IP address and port of the browser client, and can record the information of the browser client The IP address and port of the client are associated with the IP address and port of the back-end server. The significance of the association relationship recorded in the message forwarding table is that the first acquisition module 302 can obtain the IP address and port of the associated back-end server by querying the message forwarding table according to the IP address and port of the browser client, or vice versa. The second acquiring module 502 can acquire the IP address and port of the browser client associated with the backend server by querying the message forwarding table according to the IP address and port of the backend server.
在附图4示例的网关中,连接建立模块402可以进一步包括解析单元601和建立单元602,如附图6所示本发明另一实施例提供的网关,其中:In the gateway illustrated in FIG. 4 , the connection establishment module 402 may further include an analysis unit 601 and an establishment unit 602, such as the gateway provided by another embodiment of the present invention shown in FIG. 6 , wherein:
解析单元601用于析取所述握手请求消息包含的所述后端服务器的IP地址和端口;The parsing unit 601 is used to extract the IP address and port of the backend server included in the handshake request message;
建立单元602,用于根据所述后端服务器的IP地址和端口建立网关与所述后端服务器的TCP连接。The establishing unit 602 is configured to establish a TCP connection between the gateway and the back-end server according to the IP address and port of the back-end server.
请参阅附图7,本发明实施例提供的一种通信系统。为了便于说明,仅仅示出了与本发明实施例相关的部分。附图7示例的通信系统包括浏览器客户端701、后端服务器703和附图3至附图6任一示例的网关702,其中:Please refer to FIG. 7 , which shows a communication system provided by an embodiment of the present invention. For ease of description, only parts related to the embodiments of the present invention are shown. The communication system illustrated in accompanying drawing 7 includes a browser client 701, a backend server 703 and a gateway 702 in any example of accompanying drawing 3 to accompanying drawing 6, wherein:
浏览器客户端701用于,用于通过与所述网关的传输控制协议TCP连接发送用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;The browser client 701 is used for sending a user request message through a transmission control protocol TCP connection with the gateway, and the user request message includes: the IP address and port of the browser client;
网关702,用于用于通过与浏览器客户端的所述TCP连接接收浏览器客户端发送的所述用户请求消息;根据所述用户请求消息中浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;根据所述后端服务器的IP地址和端口,通过与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器;Gateway 702, configured to receive the user request message sent by the browser client through the TCP connection with the browser client; query the message forwarding table according to the IP address and port of the browser client in the user request message, Obtain the IP address and port of the back-end server associated with the IP address and port of the browser client; according to the IP address and port of the back-end server, connect the user request with the TCP connection with the back-end server The message is sent to the back-end server corresponding to the IP address and port of the back-end server;
后端服务器703,用于接收所述网关转发的用户请求消息。The backend server 703 is configured to receive the user request message forwarded by the gateway.
在附图7示例的通信系统中,浏览器客户端701还用于通过与所述网关702的TCP连接发送握手请求消息,所述握手请求消息包含所述后端服务器的IP地址和端口;所述网关702还用于通过与所述浏览器客户端701的TCP连接接收所述浏览器客户端701发送的所述握手请求消息;根据所述握手请求消息建立与所述后端服务器703的所述TCP连接;将所述浏览器客户端701的IP地址、端口与所述后端服务器的IP地址、端口关联,并将所述关联关系更新到所述消息转发表中。In the communication system illustrated in accompanying drawing 7, the browser client 701 is also used to send a handshake request message through the TCP connection with the gateway 702, and the handshake request message includes the IP address and port of the backend server; The gateway 702 is also configured to receive the handshake request message sent by the browser client 701 through the TCP connection with the browser client 701; establish the connection with the backend server 703 according to the handshake request message Described TCP connection; The IP address of described browser client 701, port are associated with the IP address of described back-end server, port, and described association relation is updated in described message forwarding table.
在附图7示例的通信系统中,后端服务器703还用于通过与所述网关702的TCP连接向所述网关702发送请求响应消息,所述请求响应消息包括:所述后端服务器的IP地址和端口;所述网关702还用于通过与所述后端服务器的TCP连接接收所述后端服务器703发送的请求响应消息;根据所述请求响应消息中的后端服务器703的IP地址和端口查询所述消息转发表,获得与所述后端服务器703的IP地址和端口关联的浏览器客户端701的IP地址和端口;根据所述浏览器客户端701的IP地址和端口,通过与所述浏览器客户端701的TCP连接将所述请求响应消息发送至与所述浏览器客户端701的IP地址和端口对应的浏览器客户端;所述浏览器客户端701还用于:接收所述网关发送的所述请求响应消息。In the communication system illustrated in FIG. 7 , the backend server 703 is also configured to send a request response message to the gateway 702 through a TCP connection with the gateway 702, and the request response message includes: the IP address of the backend server address and port; the gateway 702 is also used to receive the request response message sent by the backend server 703 through the TCP connection with the backend server; according to the IP address and the IP address of the backend server 703 in the request response message Port query the message forwarding table, obtain the IP address and port of the browser client 701 associated with the IP address and port of the back-end server 703; according to the IP address and port of the browser client 701, through the The TCP connection of the browser client 701 sends the request response message to the browser client corresponding to the IP address and port of the browser client 701; the browser client 701 is also used for: receiving The request response message sent by the gateway.
附图8是附图7示例的通信系统物理连接(实际部署)示意图。附图7示例的网关702可以是WebSocket网关,采用WebSocket协议与浏览器客户端交互,通过浏览器客户端、后端服务器建立的TCP连接,转发浏览器客户端与后端服务器之间交互的实时信息。Fig. 8 is a schematic diagram of the physical connection (actual deployment) of the communication system illustrated in Fig. 7 . The gateway 702 of accompanying drawing 7 example can be WebSocket gateway, adopts WebSocket protocol to interact with browser client, through the TCP connection that browser client, back-end server establishes, forwards the real-time interaction between browser client and back-end server information.
从上述本发明实施可知,由于网关与浏览器客户端以及后端服务器建立的是TCP长连接,一方面,浏览器客户端可以与后端服务器实现全双工通信,浏览器客户端的实时信息几近发布时间就能实时发送到后端服务器,因此实时性强;另一方面,网关通过TCP连接负责转发浏览器客户端到后端服务器之间的用户请求消息,主要的业务逻辑与计算分布在浏览器客户端和后端服务器,网关不需要承担主要的业务逻辑与计算,无需耗费额外资源实现HTTP与后端服务器之间的协议转换,因此节省了开销。From the implementation of the above-mentioned present invention, it can be known that because what the gateway and the browser client and the back-end server set up is a TCP long connection, on the one hand, the browser client can realize full-duplex communication with the back-end server, and the real-time information of the browser client is almost It can be sent to the back-end server in real time as soon as the release time is near, so the real-time performance is strong; on the other hand, the gateway is responsible for forwarding the user request message between the browser client and the back-end server through the TCP connection, and the main business logic and calculation are distributed in The browser client and back-end server, the gateway does not need to undertake the main business logic and calculation, and does not need to consume additional resources to realize the protocol conversion between HTTP and the back-end server, thus saving overhead.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本发明方法实施例基于同一构思,其带来的技术效果与本发明方法实施例相同,具体内容可参见本发明方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction and execution process between the modules/units of the above-mentioned device are based on the same idea as the method embodiment of the present invention, and the technical effect it brings is the same as that of the method embodiment of the present invention. The specific content can be Refer to the descriptions in the method embodiments of the present invention, and details are not repeated here.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,比如以下各种方法的一种或多种或全部:Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, such as one or more or all of the following various methods:
通过网关与浏览器客户端的传输控制协议TCP连接接收浏览器客户端发送的用户请求消息,所述用户请求消息包括:所述浏览器客户端的IP地址和端口;Receive the user request message sent by the browser client through the transmission control protocol TCP connection between the gateway and the browser client, and the user request message includes: the IP address and the port of the browser client;
根据所述浏览器客户端的IP地址和端口查询消息转发表,获得与所述浏览器客户端的IP地址和端口关联的后端服务器的IP地址和端口;According to the IP address and port query message forwarding table of the browser client, obtain the IP address and port of the back-end server associated with the IP address and port of the browser client;
根据所述后端服务器的IP地址和端口,通过网关与所述后端服务器的TCP连接将所述用户请求消息发送至与所述后端服务器的IP地址和端口对应的后端服务器。According to the IP address and port of the back-end server, the user request message is sent to the back-end server corresponding to the IP address and port of the back-end server through the TCP connection between the gateway and the back-end server.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: Read Only Memory (ROM, Read Only Memory), Random Access Memory (RAM, Random Access Memory), disk or CD, etc.
以上对本发明实施例提供的浏览器客户端与后端服务器直通的方法、网关和通信系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method, gateway, and communication system for direct communication between the browser client and the back-end server provided by the embodiment of the present invention have been described above in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The above embodiments The description is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary , the contents of this specification should not be construed as limiting the present invention.
Claims (8)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201110456297.9A CN102546794B (en) | 2011-12-30 | 2011-12-30 | Method for directly communicating browser client with back-end server as well as gateway and communication system |
| PCT/CN2012/075776 WO2013097401A1 (en) | 2011-12-30 | 2012-05-19 | Method, gateway and communication system for browser client directly communicating with back-end server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201110456297.9A CN102546794B (en) | 2011-12-30 | 2011-12-30 | Method for directly communicating browser client with back-end server as well as gateway and communication system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102546794A CN102546794A (en) | 2012-07-04 |
| CN102546794B true CN102546794B (en) | 2015-01-21 |
Family
ID=46352740
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201110456297.9A Active CN102546794B (en) | 2011-12-30 | 2011-12-30 | Method for directly communicating browser client with back-end server as well as gateway and communication system |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN102546794B (en) |
| WO (1) | WO2013097401A1 (en) |
Families Citing this family (30)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102932436A (en) * | 2012-10-19 | 2013-02-13 | 广东中科遥感技术有限公司 | Remote sensing remote consultation and collaborative plotting system, browser, server and method |
| CN102932471B (en) * | 2012-11-12 | 2015-11-18 | 北京奇虎科技有限公司 | Browser logon server and realize browser log in method and system |
| CN102984218B (en) * | 2012-11-12 | 2016-08-24 | 北京奇虎科技有限公司 | Browser and login method thereof and system |
| CN102938788B (en) * | 2012-11-15 | 2016-03-30 | 易程科技股份有限公司 | The processing method of event and device |
| CN103023907B (en) * | 2012-12-21 | 2017-12-01 | 北京奇虎科技有限公司 | The method for obtaining site information, equipment and system |
| CN103118410B (en) * | 2013-02-18 | 2015-10-07 | 广州市动景计算机科技有限公司 | Method of mobile communication, system and the server for mobile communication |
| CN103546543A (en) * | 2013-09-29 | 2014-01-29 | 北京京东尚科信息技术有限公司 | Client device for electronic commerce and method and system for supplying information |
| CN104580106A (en) * | 2013-10-24 | 2015-04-29 | 北大方正集团有限公司 | Communication method and communication device |
| CN103546584B (en) * | 2013-11-13 | 2018-08-14 | 努比亚技术有限公司 | Information-pushing method and system |
| CN103634382B (en) * | 2013-11-20 | 2019-10-18 | 科大讯飞股份有限公司 | A system and method for realizing real-time interaction on web pages |
| CN103945003B (en) * | 2014-05-06 | 2017-06-06 | 北京邮电大学 | A kind of method that WebRTC clients connect dynamic adaptive selection |
| CN105488095A (en) * | 2015-09-30 | 2016-04-13 | 小米科技有限责任公司 | Search result access method, apparatus and system |
| CN105391536A (en) * | 2015-10-28 | 2016-03-09 | 浪潮(北京)电子信息产业有限公司 | Communication method and device between client end and service end |
| CN106201375B (en) * | 2016-07-01 | 2019-02-19 | 浪潮通用软件有限公司 | Websocket-based network sharing printing control method |
| CN108124007A (en) * | 2017-12-19 | 2018-06-05 | 深圳交控科技有限公司 | The method and apparatus of message data real-time Transmission |
| CN110691033A (en) * | 2019-09-02 | 2020-01-14 | 视联动力信息技术股份有限公司 | Monitoring data processing method and device and storage medium |
| CN111314313A (en) * | 2020-01-19 | 2020-06-19 | 成都康赛信息技术有限公司 | Cloud pushing method based on message |
| CN111355784B (en) * | 2020-02-20 | 2022-10-25 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for processing request information |
| CN112565214A (en) * | 2020-11-26 | 2021-03-26 | 中国船舶工业系统工程研究院 | Data transmission method, system and medium based on WebSocket |
| CN114579224A (en) * | 2020-12-02 | 2022-06-03 | 永中软件股份有限公司 | Method for acquiring browser closing event, computing device and computer readable medium |
| CN112859752B (en) * | 2021-01-06 | 2021-12-28 | 华南师范大学 | A laser embroidery machine remote monitoring and management system |
| CN112905928B (en) * | 2021-05-07 | 2021-08-03 | 杭州米络星科技(集团)有限公司 | Webpage refreshing method and device, electronic equipment and storage medium |
| CN113613348B (en) * | 2021-08-11 | 2023-08-29 | 北京达佳互联信息技术有限公司 | Connection establishment method, device, electronic equipment and storage medium |
| CN114363427A (en) * | 2021-12-24 | 2022-04-15 | 北京鼎普科技股份有限公司 | A method for real-time acquisition of host device information based on browser |
| CN114386152B (en) * | 2022-01-14 | 2024-03-29 | 中国电建集团昆明勘测设计研究院有限公司 | Light BIM model linkage labeling system based on WebSocket |
| CN114553945A (en) * | 2022-01-15 | 2022-05-27 | 江苏秉信科技有限公司 | Message pushing method for power intranet cloud platform-crossing unified framework gateway |
| CN115242766B (en) * | 2022-08-02 | 2024-07-19 | 亚数信息科技(上海)有限公司 | HTTPS transparent gateway method based on two-layer network bridge |
| CN116192517A (en) * | 2023-02-23 | 2023-05-30 | 京东方科技集团股份有限公司 | Method, client, server gateway and system for realizing service access |
| CN118353888B (en) * | 2024-04-29 | 2026-01-13 | 天翼云科技有限公司 | Method for realizing TCP secure long connection on browser |
| CN120416313A (en) * | 2025-07-01 | 2025-08-01 | 三维通信股份有限公司 | Base station communication method, system, electronic device and storage medium based on Websocket protocol |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1694430A (en) * | 2005-05-25 | 2005-11-09 | 复旦大学 | Gateway Penetration Method of UDP Streaming Media Server Based on NAT |
| CN101184275A (en) * | 2007-12-19 | 2008-05-21 | Ut斯达康通讯有限公司 | Service implementing method and system and mobile terminal of mobile terminal rolling screen amusement |
| CN101534302A (en) * | 2009-04-16 | 2009-09-16 | 杭州华三通信技术有限公司 | Method for providing TCP service, system and relevant device thereof |
| CN101741817A (en) * | 2008-11-21 | 2010-06-16 | 中国移动通信集团安徽有限公司 | A multi-network fusion system, device and method |
| WO2010127327A1 (en) * | 2009-05-01 | 2010-11-04 | Kaazing Corporation | Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI310275B (en) * | 2004-10-19 | 2009-05-21 | Nec Corp | Virtual private network gateway device and hosting system |
| CN101257450A (en) * | 2008-03-28 | 2008-09-03 | 华为技术有限公司 | Network security protection method, gateway device, client and network system |
| CN101350814A (en) * | 2008-08-26 | 2009-01-21 | 成都卫士通信息产业股份有限公司 | Safety remote access technology and gateway thereof |
| CN102025746B (en) * | 2010-12-21 | 2013-04-17 | 北京星网锐捷网络技术有限公司 | Method, device and network equipment for establishing transmission control protocol (TCP) connection |
-
2011
- 2011-12-30 CN CN201110456297.9A patent/CN102546794B/en active Active
-
2012
- 2012-05-19 WO PCT/CN2012/075776 patent/WO2013097401A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1694430A (en) * | 2005-05-25 | 2005-11-09 | 复旦大学 | Gateway Penetration Method of UDP Streaming Media Server Based on NAT |
| CN101184275A (en) * | 2007-12-19 | 2008-05-21 | Ut斯达康通讯有限公司 | Service implementing method and system and mobile terminal of mobile terminal rolling screen amusement |
| CN101741817A (en) * | 2008-11-21 | 2010-06-16 | 中国移动通信集团安徽有限公司 | A multi-network fusion system, device and method |
| CN101534302A (en) * | 2009-04-16 | 2009-09-16 | 杭州华三通信技术有限公司 | Method for providing TCP service, system and relevant device thereof |
| WO2010127327A1 (en) * | 2009-05-01 | 2010-11-04 | Kaazing Corporation | Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2013097401A1 (en) | 2013-07-04 |
| CN102546794A (en) | 2012-07-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102546794B (en) | Method for directly communicating browser client with back-end server as well as gateway and communication system | |
| US10411956B2 (en) | Enabling planned upgrade/downgrade of network devices without impacting network sessions | |
| CN107948324B (en) | request transmission system, method, device and storage medium | |
| JP6538867B2 (en) | Message bus service directory | |
| CN108200165B (en) | request transmission system, method, device and storage medium | |
| CN104253742B (en) | Virtual WEB real-time Communication for Power gateway is with and related methods, system | |
| CN104253857B (en) | Virtual WEB real-time Communication for Power agency is with and related methods, system back-to-back | |
| CN101534302B (en) | A method, system and related device for providing TCP service | |
| CN103634382B (en) | A system and method for realizing real-time interaction on web pages | |
| CN104009938B (en) | The long method and system connected based on route aspect | |
| CN108200158B (en) | request transmission system, method, device and storage medium | |
| CN104363291A (en) | Network communication middleware implementation method | |
| CN102594886B (en) | Method and device for direct communication between browsers, and communication system | |
| CN103795689A (en) | Resource subscription method and device | |
| CN103457843A (en) | Communication method, communication system, relay gateway device, application server and client side | |
| CN101895520B (en) | Widget system data sharing method, server and data sharing system | |
| WO2012151980A1 (en) | Service processing server, system, and method | |
| CN102984223B (en) | A kind of message method, the network equipment and system | |
| CN103618667A (en) | Information transfer method, access gateway and system | |
| CN105357250B (en) | A kind of data operation system | |
| CN103885973B (en) | A kind of RPC system and implementation method based on Web engines | |
| CN104010001A (en) | Method and system for connecting and communicating with the same kind of networking request in a mobile terminal | |
| CN104486327A (en) | Method and client side of communication between pages and long connection servers | |
| Cui et al. | Research and Implementation of WEBRTC Signaling via websocket-based for real-time multimedia communications | |
| CN106911732A (en) | A kind of website visiting accelerating 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 |