[go: up one dir, main page]

CN104243188A - Searching method and device for network nodes not supporting WebSocket data forwarding - Google Patents

Searching method and device for network nodes not supporting WebSocket data forwarding Download PDF

Info

Publication number
CN104243188A
CN104243188A CN201310228458.8A CN201310228458A CN104243188A CN 104243188 A CN104243188 A CN 104243188A CN 201310228458 A CN201310228458 A CN 201310228458A CN 104243188 A CN104243188 A CN 104243188A
Authority
CN
China
Prior art keywords
network node
data forwarding
websocket data
routing link
websocket
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.)
Granted
Application number
CN201310228458.8A
Other languages
Chinese (zh)
Other versions
CN104243188B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310228458.8A priority Critical patent/CN104243188B/en
Publication of CN104243188A publication Critical patent/CN104243188A/en
Application granted granted Critical
Publication of CN104243188B publication Critical patent/CN104243188B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明适用于通讯领域,尤其涉及不支持的WebSocket的网络节点的查找方法和装置,该方法包括:接收查找不支持WebSocket数据转发的网络节点的指令;根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路;如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点;在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。本发明实施例实现过程实现简单,随着测试次数的增加,不支持WebSocket数据转发的网络节点库会越来越精确。

The present invention is applicable to the communication field, and particularly relates to a method and device for searching network nodes that do not support WebSocket. The method includes: receiving an instruction to search for a network node that does not support WebSocket data forwarding; The two terminals establish a routing link for transmitting WebSocket data; if the routing link is connected, record the network node on the routing link as a network node that can support WebSocket data forwarding; the default may not support WebSocket data forwarding Delete the network nodes that can support WebSocket data forwarding from the network node database. The implementation process of the embodiment of the present invention is simple, and as the number of tests increases, the network node library that does not support WebSocket data forwarding will become more and more accurate.

Description

不支持WebSocket数据转发的网络节点的查找方法、装置Method and device for searching network nodes that do not support WebSocket data forwarding

技术领域technical field

本发明属于通讯领域,尤其涉及不支持的WebSocket的网络节点的查找方法和装置。The invention belongs to the communication field, and in particular relates to a method and a device for searching network nodes not supported by WebSocket.

背景技术Background technique

目前在浏览器中的HTTP(英文全称为:hypertext transport protocol,中文全称为:超文本传送协议)一般用于实现单向的通信;comet(基于HTTP长连接的“服务器推”技术)可以一定程度上模拟双向通信,但效率较低,并需要服务器有较好的支持;flash中的socket和xmlsocket可以实现真正的双向通信,通过flex、Ajax或bridge,可以在java script中使用这两项功能。At present, HTTP (English full name: hypertext transport protocol, Chinese full name: hypertext transfer protocol) in browsers is generally used to realize one-way communication; comet ("server push" technology based on HTTP long connection) can be used to a certain extent The two-way communication is simulated on the Internet, but the efficiency is low, and the server needs better support; the socket and xmlsocket in the flash can realize the real two-way communication, and these two functions can be used in javascript through flex, Ajax or bridge.

WebSocket protocol是HTML5的一种新协议,随着用户对网页双向实时通信要求的提高,WebSocket协议未来必定会是HTML5的一个基础性协议,如果网络上有代理服务器无法转发或传递WebSocket数据包,将会给基于WebSocket的应用带来极大的困扰。无论是在Internet还是企业内网,所使用的代理服务器往往数量巨大,想要一个一个的排查其中对WebSocket是否支持的工作难度非常大,而且几乎不可能完成,因此如何有效的查找其中的无法支持WebSocket数据转发的代理服务器将成为一个比较重要的问题。WebSocket protocol is a new protocol of HTML5. With the improvement of users' requirements for two-way real-time communication on web pages, WebSocket protocol will definitely become a basic protocol of HTML5 in the future. If there is a proxy server on the network that cannot forward or deliver WebSocket data packets, it will It will bring great trouble to WebSocket-based applications. Whether it is on the Internet or in the intranet, there are often a large number of proxy servers used. It is very difficult and almost impossible to check whether WebSocket is supported one by one. Therefore, how to effectively find out which ones cannot support The proxy server for WebSocket data forwarding will become a more important issue.

发明内容Contents of the invention

本发明实施例的目的在于提供一种不支持WebSocket数据转发的网络节点的查找方法,以解决现有技术查找无法支持WebSocket数据转发的网络节点的工作难度大的问题。The purpose of the embodiments of the present invention is to provide a method for searching network nodes that do not support WebSocket data forwarding, so as to solve the problem of difficulty in finding network nodes that cannot support WebSocket data forwarding in the prior art.

本发明第一方面提供了一种不支持WebSocket数据转发的网络节点的查找方法,所述方法包括下述步骤:The first aspect of the present invention provides a method for searching a network node that does not support WebSocket data forwarding, and the method includes the following steps:

接收查找不支持WebSocket数据转发的网络节点的指令;Receive instructions to find network nodes that do not support WebSocket data forwarding;

根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路;According to the instruction, a routing link for transmitting WebSocket data is established between the first terminal and the second terminal;

判断所述路由链路是否连通;judging whether the routing link is connected;

如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路经过的位于所述第一终端与所述第二终端之间的所有网络节点;If the routing link is connected, record that the network node on the routing link is a network node that can support WebSocket data forwarding, and the network node on the routing link includes the network node that the routing link passes through and is located at the first all network nodes between a terminal and said second terminal;

在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。The network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

在第一方面的第一种可能实现方式中,所述方法还包括:In a first possible implementation manner of the first aspect, the method further includes:

如果所述路由链路为不连通,判断所述路由链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;If the routing link is disconnected, determine whether the network node on the routing link is a recorded network node that can support WebSocket data forwarding;

如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。If the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node on the routing link into the preset network node library that may not support WebSocket data forwarding Or form the network nodes on the routing link into a network node library that may not support WebSocket data forwarding.

在第一方面的第二种可能实现方式中,所述第一终端包括带有浏览器的客户端,所述第二终端包括支持WebSocket协议被通信的服务器,在所述根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路的步骤之前,所述方法还包括:In the second possible implementation manner of the first aspect, the first terminal includes a client with a browser, the second terminal includes a server supporting WebSocket protocol for communication, and according to the instruction, in Before the step of establishing a routing link for transmitting WebSocket data between the first terminal and the second terminal, the method further includes:

检测所述客户端的浏览器是否为支持WebSocket协议通信的浏览器;Detecting whether the browser of the client is a browser supporting WebSocket protocol communication;

如果所述客户端的浏览器为不支持WebSocket协议通信的浏览器,则结束查找;If the browser of the client is a browser that does not support WebSocket protocol communication, then end the search;

如果所述客户端的浏览器为支持WebSocket协议通信的浏览器,则执行所述根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路的步骤。If the browser of the client is a browser supporting WebSocket protocol communication, then execute the step of establishing a routing link for transmitting WebSocket data between the first terminal and the second terminal according to the instruction.

在第一方面的第三种可能实现方式中,在所述步骤根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路之前,所述方法还包括:In a third possible implementation of the first aspect, before the first terminal and the second terminal establish a routing link for transmitting WebSocket data according to the instruction in the step, the method further includes:

检测所述第一终端与所述第二终端通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断所述第一终端与所述第二终端之间的传送POST请求的链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;Detecting whether the first terminal and the second terminal can be connected through the POST mode of the hypertext transfer protocol, if not, then judging the link for transmitting the POST request between the first terminal and the second terminal Whether the network node on is a recorded network node that can support WebSocket data forwarding;

如果所述传送POST请求的链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。If the network node on the link that transmits the POST request is not a recorded network node that can support WebSocket data forwarding, store the network node on the link that transmits the POST request into the preset may not support WebSocket A network node library for data forwarding.

在第一方面的第四种可能实现方式中,所述方法还包括:In a fourth possible implementation manner of the first aspect, the method further includes:

将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。The network nodes that are recorded as being capable of supporting WebSocket data forwarding are stored in a database of network nodes capable of supporting WebSocket data forwarding.

在第二方面提供了一种不支持WebSocket数据转发的网络节点的查找装置,所述装置包括:In a second aspect, a device for searching a network node that does not support WebSocket data forwarding is provided, and the device includes:

接收单元,用于接收查找不支持WebSocket数据转发的网络节点的指令;The receiving unit is used to receive an instruction to find a network node that does not support WebSocket data forwarding;

路由链路建立单元,用于根据所述接收单元接收到的所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路;A routing link establishment unit, configured to establish a routing link for transmitting WebSocket data between the first terminal and the second terminal according to the instruction received by the receiving unit;

第一判断单元,用于判断所述路由链路建立单元建立的所述路由链路是否连通;a first judging unit, configured to judge whether the routing link established by the routing link establishing unit is connected;

记录单元,用于如果所述第一判断单元判断的所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括路由链路经过的位于所述第一终端与第二终端之间的所有网络节点;A recording unit, configured to record that the network node on the routing link is a network node that can support WebSocket data forwarding if the routing link judged by the first judging unit is connected, and the network node on the routing link The nodes include all network nodes located between the first terminal and the second terminal through which the routing link passes;

删除单元,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述记录单元记录的所述可支持WebSocket数据转发的网络节点。The deleting unit is configured to delete the network node capable of supporting WebSocket data forwarding recorded by the recording unit from the preset network node library that may not support WebSocket data forwarding.

在第二方面的第一种可能实现方式中,所述装置还包括:In a first possible implementation manner of the second aspect, the device further includes:

第二判断单元,用于如果所述第一判断单元判断的所述路由链路为不连通,判断所述路由链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;The second judging unit is configured to judge whether the network node on the routing link is a recorded network node that can support WebSocket data forwarding if the routing link judged by the first judging unit is disconnected;

第一网络节点存入单元,用于如果第二判断单元判断的所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。The first network node storage unit is used to save the network node on the routing link if the network node on the routing link judged by the second judging unit is not a recorded network node that can support WebSocket data forwarding Enter the preset network node library that may not support WebSocket data forwarding or configure the network nodes on the routing link to form a network node library that may not support WebSocket data forwarding.

在第二方面的第二种可能实现方式中,所述第一终端包括带有浏览器的客户端,所述第二终端包括支持WebSocket协议被访问的服务器,所述装置还包括:In a second possible implementation of the second aspect, the first terminal includes a client with a browser, the second terminal includes a server that supports the WebSocket protocol to be accessed, and the device further includes:

第一检测单元,用于检测所述客户端的浏览器是否为支持WebSocket协议通信的浏览器;如果所述客户端的浏览器为不支持WebSocket协议通信的浏览器,则结束查找;如果所述客户端的浏览器为支持WebSocket协议通信的浏览器,则转至所述路由链路建立单元执行。The first detection unit is used to detect whether the browser of the client is a browser that supports WebSocket protocol communication; if the browser of the client is a browser that does not support WebSocket protocol communication, then end the search; if the client's If the browser is a browser supporting WebSocket protocol communication, then transfer to the routing link establishment unit for execution.

在第二方面的第三种可能实现方式中,所述装置还包括:In a third possible implementation manner of the second aspect, the device further includes:

第二检测单元,用于检测所述第一终端与所述第二终端通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断所述第一终端与所述第二终端之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;The second detection unit is used to detect whether the first terminal and the second terminal can be connected through the POST mode of the hypertext transfer protocol, and if not, judge the connection between the first terminal and the second terminal Whether the network node of the link that transmits the POST request is a recorded network node that can support WebSocket data forwarding;

第二网络节点存入单元,用于如果所述传送POST请求的链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,则将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。The second network node storage unit is used to store the network node on the routing link into the stored network node if the network node on the link transmitting the POST request is not a recorded network node that can support WebSocket data forwarding. The preset network node library that may not support WebSocket data forwarding.

在第二方面的第四种可能实现方式中,所述装置还包括:In a fourth possible implementation manner of the second aspect, the device further includes:

第三网络节点存入单元,将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。The third network node storage unit is configured to store the record as a network node capable of supporting WebSocket data forwarding into a database of network nodes capable of supporting WebSocket data forwarding.

在第三方面提供了一种不支持WebSocket数据转发的网络节点的查找方法,其特征在于,所述方法包括下述步骤:A method for searching a network node that does not support WebSocket data forwarding is provided in a third aspect, wherein the method includes the following steps:

接收查找不支持WebSocket数据转发的网络节点的指令;Receive instructions to find network nodes that do not support WebSocket data forwarding;

根据所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求,以便于与第二终端建立传送WebSocket数据的路由链路;According to the instruction, initiate a connection request for establishing a routing link for transmitting WebSocket data to the second terminal, so as to establish a routing link for transmitting WebSocket data with the second terminal;

判断所述路由链路是否连通;judging whether the routing link is connected;

如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路为与所述第二终端之间建立连接的所有网络节点;If the routing link is connected, record the network node of the routing link as a network node that can support WebSocket data forwarding, and the network node on the routing link includes that the routing link is connected to the second terminal All network nodes that establish connections between;

在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。The network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

在第三方面的第一种可能实现方式中,所述第二终端为服务器,所述步骤判断所述路由链路是否连通具体为:In the first possible implementation manner of the third aspect, the second terminal is a server, and the step of judging whether the routing link is connected is specifically:

调用服务器的traceroute服务获取所述路由链路的网络节点,判断所述路由链路是否连通。Invoke the traceroute service of the server to obtain the network nodes of the routing link, and determine whether the routing link is connected.

在第三方面的第二种可能实现方式中,所述连接请求由浏览器发送,在所述步骤根据所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求之前,所述方法还包括:In a second possible implementation of the third aspect, the connection request is sent by the browser, and before the step initiates a connection request to the second terminal to establish a routing link for transmitting WebSocket data according to the instruction, the The method also includes:

检测浏览器是否支持WebSocket协议的数据访问,如果不支持WebSocket协议的数据访问,则结束查找;Detect whether the browser supports the data access of the WebSocket protocol, and if it does not support the data access of the WebSocket protocol, end the search;

如果所述浏览器支持WebSocket协议的数据访问,则执行所述向第二终端发起建立传送WebSocket数据的路由链路的连接请求的步骤。If the browser supports data access of the WebSocket protocol, perform the step of initiating a connection request to the second terminal to establish a routing link for transmitting WebSocket data.

在第三方面的第三种可能实现方式中,所述连接请求由浏览器发送,在所述步骤根据所述指令,向服务器发起建立传送WebSocket数据的路由链路的连接请求之前,所述方法还包括:In a third possible implementation of the third aspect, the connection request is sent by the browser, and before the step initiates a connection request to the server to establish a routing link for transmitting WebSocket data according to the instruction, the method Also includes:

检测浏览器与服务器通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断浏览器与服务器之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;Detect whether the browser and the server can be connected through the POST mode of the hypertext transfer protocol. If not, determine whether the network node of the link transmitting the POST request between the browser and the server is a recorded one that can support WebSocket data forwarding network node;

如果所述传送POST请求的链路的网络节点不是记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路的网络节点存入可能不支持WebSocket数据转发的网络节点库。If the network node of the link transmitting the POST request is not a recorded network node capable of supporting WebSocket data forwarding, store the network node of the link transmitting the POST request into the database of network nodes that may not support WebSocket data forwarding.

在第四方面提供了一种不支持WebSocket数据转发的网络节点的查找装置,所述装置包括:In the fourth aspect, a device for searching a network node that does not support WebSocket data forwarding is provided, and the device includes:

接收模块,用于接收查找不支持WebSocket数据转发的网络节点的指令;A receiving module, configured to receive an instruction to find a network node that does not support WebSocket data forwarding;

连接请求发送模块,用于根据接收模块接收的所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求,以便于与第二终端建立传送WebSocket数据的路由链路;A connection request sending module, configured to initiate a connection request to the second terminal to establish a routing link for transmitting WebSocket data according to the instruction received by the receiving module, so as to establish a routing link for transmitting WebSocket data with the second terminal;

第一判断模块,用于判断所述路由链路是否连通;A first judging module, configured to judge whether the routing link is connected;

第一记录模块,用于如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路为与所述第二终端之间建立连接的所有网络节点;The first recording module is configured to record the network nodes on the routing link as network nodes that can support WebSocket data forwarding if the routing link is connected, and the network nodes on the routing link include the routing link The paths are all network nodes establishing connections with the second terminal;

删除模块,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。A deletion module, configured to delete the network node that can support WebSocket data forwarding from the preset network node library that may not support WebSocket data forwarding.

在第四方面的第一种可能实现方式中,所述第二终端为服务器,所述第一获取判断模块具体用于调用服务器的traceroute服务获取所述路由链路的网络节点,判断所述路由链路是否连通。In the first possible implementation manner of the fourth aspect, the second terminal is a server, and the first obtaining and judging module is specifically configured to invoke the traceroute service of the server to obtain the network node of the route link, and judge the route Whether the link is connected.

在第四方面的第二种可能实现方式中,所述连接请求由浏览器发送,所述装置还包括:In a second possible implementation manner of the fourth aspect, the connection request is sent by a browser, and the device further includes:

第一检测模块,用于检测浏览器是否支持WebSocket协议的数据访问,如果不支持WebSocket协议的数据访问,则结束查找,如果所述浏览器支持WebSocket协议的数据访问,则转至连接请求发送模块执行。The first detection module is used to detect whether the browser supports the data access of the WebSocket protocol, if it does not support the data access of the WebSocket protocol, then ends the search, and if the browser supports the data access of the WebSocket protocol, then forwards to the connection request sending module implement.

在第四方面的第三种可能实现方式中,所述连接请求由浏览器发送,所述装置还包括:In a third possible implementation manner of the fourth aspect, the connection request is sent by a browser, and the device further includes:

第二检测模块,用于检测浏览器与服务器通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断浏览器与服务器之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;The second detection module is used to detect whether the browser and the server can be connected through the POST mode of the hypertext transfer protocol, if not, then judge whether the network node of the link transmitting the POST request between the browser and the server is recorded A network node that can support WebSocket data forwarding;

第一网络节点存入模块,用于如果所述传送POST请求的链路的网络节点不是记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路的网络节点存入可能不支持WebSocket数据转发的网络节点库。The first network node storage module is used to store the network node of the link that transmits the POST request into the network node that may not A network node library that supports WebSocket data forwarding.

在第五方面提供了一种终端设备,所述终端设备包括第四方面任一项所述的不支持WebSocket数据转发的网络节点的查找装置。A fifth aspect provides a terminal device, which includes the device for finding a network node that does not support WebSocket data forwarding according to any one of the fourth aspect.

在第六方面提供了一种不支持WebSocket数据转发的网络节点的查找方法,所述方法包括下述步骤:In the sixth aspect, a method for searching a network node that does not support WebSocket data forwarding is provided, and the method includes the following steps:

接收第一终端发送的建立传送WebSocket数据的路由链路的连接请求;receiving a connection request sent by the first terminal to establish a routing link for transmitting WebSocket data;

根据所述请求,与第一终端建立传送WebSocket数据的路由链路;Establishing a routing link for transmitting WebSocket data with the first terminal according to the request;

判断所述路由链路的连通性;judging the connectivity of the routing link;

如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点,If the routing link is connected, record the network node of the routing link as a network node that can support WebSocket data forwarding,

在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。The network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

在第六方面的第一种可能实现方式中,所述方法还包括:In a first possible implementation manner of the sixth aspect, the method further includes:

如果所述路由链路为不连通,判断所述路由链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;If the routing link is disconnected, determine whether the network node on the routing link is a recorded network node that can support WebSocket data forwarding;

如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入可能不支持WebSocket数据转发的网络节点库。If the network nodes on the routing link are not recorded network nodes that can support WebSocket data forwarding, store the network nodes on the routing link in a network node database that may not support WebSocket data forwarding.

在第六方面的第二种可能实现方式中,所述方法还包括:In a second possible implementation manner of the sixth aspect, the method further includes:

将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。The network nodes that are recorded as being capable of supporting WebSocket data forwarding are stored in a database of network nodes capable of supporting WebSocket data forwarding.

在第七方面提供了一种不支持WebSocket数据转发的网络节点的查找装置,所述装置包括:In the seventh aspect, a device for searching a network node that does not support WebSocket data forwarding is provided, and the device includes:

连接请求接收模块,用于接收第一终端发送的建立传送WebSocket数据的路由链路的连接请求;A connection request receiving module, configured to receive a connection request sent by the first terminal to establish a routing link for transmitting WebSocket data;

路由链路建立模块,用于根据连接请求接收模块接收的所述请求,与第一终端建立传送WebSocket数据的路由链路;A routing link establishing module, configured to establish a routing link for transmitting WebSocket data with the first terminal according to the request received by the connection request receiving module;

第二判断模块,用于判断所述路由链路建立模块建立的路由链路的连通性;A second judging module, configured to judge the connectivity of the routing link established by the routing link establishing module;

第二记录模块,用于由第二判断模块判断如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点;The second recording module is used for judging by the second judging module that if the routing link is connected, record the network node of the routing link as a network node that can support WebSocket data forwarding;

第二删除模块,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。The second deletion module is configured to delete the network node that can support WebSocket data forwarding from the preset network node library that may not support WebSocket data forwarding.

在第七方面的第一种可能实现方式中,所述装置还包括:In a first possible implementation manner of the seventh aspect, the device further includes:

网络节点判断模块,用于如果所述路由链路为不连通,判断所述路由链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;A network node judging module, used to judge whether the network node of the routing link is a recorded network node that can support WebSocket data forwarding if the routing link is disconnected;

第二网络节点存入模块,用于如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。The second network node storage module is used to store the network node on the routing link into a network node that may not support WebSocket data if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding The forwarding network node library or the network nodes on the routing link constitute a network node library that may not support WebSocket data forwarding.

在第七方面的第二种可能实现方式中,所述装置还包括:In a second possible implementation manner of the seventh aspect, the device further includes:

第二存入模块,用于将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。The second storing module is configured to store the network nodes that are recorded as being capable of supporting WebSocket data forwarding into a database of network nodes capable of supporting WebSocket data forwarding.

在第八方面提供了一种服务器,其特征在于,所述服务器包括上述第七方面任一项所述的不支持WebSocket数据转发的网络节点的查找装置。The eighth aspect provides a server, characterized in that the server includes the device for finding network nodes that do not support WebSocket data forwarding according to any one of the seventh aspect.

在本发明实施例中,接收到查找不支持WebSocket数据转发的网络节点的指令,根据所述指令在第一终端与第二终端建立传送WebSocket数据的路由链路,如果所述路由链路连通,在预设的可能不支持WebSocket数据转发的网络节点库中将所述路由链路的网络节点删除,可得到进一步精确的可能不支持WebSocket数据转发的网络节点库。通过第一终端和第二终端之间路由链路的连通,可得到所述路由链路上的网络节点都为可支持WebSocket数据转发的网络节点,在预设的可能不支持WebSocket数据转发的网络节点库中删除后,使得到的可能不支持WebSocket数据转发的网络节点库更加精确,而且整个实现过程实现简单,随着测试次数的增加,不支持WebSocket数据转发的网络节点库会越来越精确,可便于未来各类基于WebSocket数据转发的解决方案更加可靠的实施。In the embodiment of the present invention, after receiving an instruction to find a network node that does not support WebSocket data forwarding, a routing link for transmitting WebSocket data is established between the first terminal and the second terminal according to the instruction, and if the routing link is connected, By deleting the network node of the routing link in the preset network node database that may not support WebSocket data forwarding, a more accurate network node database that may not support WebSocket data forwarding can be obtained. Through the connection of the routing link between the first terminal and the second terminal, it can be obtained that the network nodes on the routing link are all network nodes that can support WebSocket data forwarding, and in the preset network that may not support WebSocket data forwarding After the node library is deleted, the obtained network node library that may not support WebSocket data forwarding is more accurate, and the entire implementation process is simple to implement. With the increase in the number of tests, the network node library that does not support WebSocket data forwarding will become more and more accurate , which can facilitate the more reliable implementation of various future solutions based on WebSocket data forwarding.

附图说明Description of drawings

图1是本发明第一实施例提供的不支持WebSocket数据转发的网络节点的查找的实现流程图;Fig. 1 is the realization flowchart of the search of the network node that does not support WebSocket data forwarding that the first embodiment of the present invention provides;

图2是本发明第二实施例提供的不支持WebSocket数据转发的网络节点的查找的实现流程图;Fig. 2 is the realization flowchart of the search of the network node that does not support WebSocket data forwarding provided by the second embodiment of the present invention;

图3是本发明第三实施例提供的基于客户端的不支持WebSocket数据转发的网络节点的查找的实现流程图;Fig. 3 is the implementation flowchart of the search of the network node based on the client that does not support WebSocket data forwarding provided by the third embodiment of the present invention;

图4为本发明第四实施例提供的不支持WebSocket数据转发的网络节点的查找的实现流程图;Fig. 4 is the implementation flowchart of searching for the network node that does not support WebSocket data forwarding provided by the fourth embodiment of the present invention;

图5为本发明第五实施例提供的不支持WebSocket数据转发的网络节点的查找装置的结构示意图;5 is a schematic structural diagram of a search device for a network node that does not support WebSocket data forwarding provided by a fifth embodiment of the present invention;

图6为本发明第六实施例提供的不支持WebSocket数据转发的网络节点的查找装置的结构示意图;6 is a schematic structural diagram of a search device for a network node that does not support WebSocket data forwarding provided by a sixth embodiment of the present invention;

图7为本发明实施例提供的不支持WebSocket数据转发的网络节点的查找装置的结构示意图;7 is a schematic structural diagram of a search device for a network node that does not support WebSocket data forwarding provided by an embodiment of the present invention;

图8为本发明实施例提供的不支持WebSocket数据转发的网络节点的查找的终端设备的结构示意图。FIG. 8 is a schematic structural diagram of a terminal device that does not support searching for a network node that forwards WebSocket data provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

在本发明实施例中,提供了一种不支持WebSocket数据转发的网络节点的查找方法,接收查找不支持WebSocket数据转发的网络节点的指令;根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路;判断所述路由链路是否连通;如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路经过的位于所述第一终端与所述第二终端之间的所有网络节点;在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。通过在第一终端与第二终端建立传送WebSocket数据的路由链路,如果所述路由链路连通,在预设的可能不支持WebSocket数据转发的网络节点库中将所述路由链路的网络节点删除,可得到进一步精确的可能不支持WebSocket数据转发的网络节点库。通过第一终端和第二终端之间路由链路的连通,可得到所述路由链路上的网络节点都为可支持WebSocket数据转发的网络节点,在预设的可能不支持WebSocket数据转发的网络节点库中删除后,使得到的可能不支持WebSocket数据转发的网络节点库更加精确,而且整个实现过程实现简单,随着测试次数的增加,不支持WebSocket数据转发的网络节点库会越来越精确,可便于未来各类基于WebSocket数据转发的解决方案更加可靠的实施。In the embodiment of the present invention, a search method for a network node that does not support WebSocket data forwarding is provided, and an instruction to search for a network node that does not support WebSocket data forwarding is received; according to the instruction, the first terminal and the second terminal establish Send the routing link of WebSocket data; determine whether the routing link is connected; if the routing link is connected, record the network node on the routing link as a network node that can support WebSocket data forwarding, and the routing link The network nodes on the road include all network nodes between the first terminal and the second terminal that the routing link passes through; delete the A network node that supports WebSocket data forwarding. By establishing a routing link for transmitting WebSocket data between the first terminal and the second terminal, if the routing link is connected, the network node of the routing link will be selected in the preset network node library that may not support WebSocket data forwarding Delete it to get more accurate network node libraries that may not support WebSocket data forwarding. Through the connection of the routing link between the first terminal and the second terminal, it can be obtained that the network nodes on the routing link are all network nodes that can support WebSocket data forwarding, and in the preset network that may not support WebSocket data forwarding After the node library is deleted, the obtained network node library that may not support WebSocket data forwarding is more accurate, and the entire implementation process is simple to implement. With the increase in the number of tests, the network node library that does not support WebSocket data forwarding will become more and more accurate , which can facilitate the more reliable implementation of various future solutions based on WebSocket data forwarding.

实施例一:Embodiment one:

图1示出了本发明第一实施例提供的不支持WebSocket数据转发的网络节点的查找的实现流程,详述如下:Fig. 1 shows the implementation process of searching for network nodes that do not support WebSocket data forwarding provided by the first embodiment of the present invention, and the details are as follows:

在步骤S101中,接收查找不支持WebSocket数据转发的网络节点的指令。In step S101, an instruction to find a network node that does not support WebSocket data forwarding is received.

所述接收指令的实现形式,可以为设置在WEB页面嵌入有测试代码的广告框或者设置相应的功能按钮,在用户点击相应的广告或者点击相应的功能按钮,即可触发相应的指令。将触指令嵌入WEB页面,可以接收更为广泛的用户终端通过浏览器触发指令。当然,本发明实施例不局限于此,也可通过客户端的各种应用或者客户端等形式接收用户终端的查找不支持WebSocket数据转发的网络节点的指令。The implementation form of the receiving instruction can be setting an advertisement box embedded with test codes on the WEB page or setting a corresponding function button, and the corresponding instruction can be triggered when the user clicks on the corresponding advertisement or clicks on the corresponding function button. Embedding the touch command into the WEB page can receive trigger commands from a wider range of user terminals through browsers. Certainly, the embodiment of the present invention is not limited thereto, and an instruction from the user terminal to search for a network node that does not support WebSocket data forwarding may also be received through various applications or client forms of the client.

在步骤S102中,根据所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路。In step S102, according to the instruction, a routing link for transmitting WebSocket data is established between the first terminal and the second terminal.

所述路由链路,包括由多个链路,即包括多个从一个网络节点到相邻网络节点的线路,所确定的最佳的路径。The routing link includes the best path determined by a plurality of links, that is, including a plurality of lines from one network node to an adjacent network node.

所述指令中包括需要建立传送WebSocket数据的路由链路的两个终端,如果所述指令在浏览器或者其它应用中接收,则其中一端(第一终端或者第二终端)为所述浏览器或者应用所在终端,另一终端为指令中所设定的服务器,如网易、新浪等设定可接收WebSocket数据访问的服务器。The instruction includes two terminals that need to establish a routing link for transmitting WebSocket data. If the instruction is received in a browser or other applications, one of the ends (the first terminal or the second terminal) is the browser or the second terminal. The terminal where the application is located, and the other terminal is the server set in the command, such as Netease, Sina, etc., set the server that can receive WebSocket data access.

建立客户端与服务器之间传送WebSocket数据的路由链路的握手,一般包括如下三个步骤:Establishing a handshake for routing links between the client and the server to transmit WebSocket data generally includes the following three steps:

1、客端向服务器端发送连接请求;1. The client sends a connection request to the server;

2、服务器判断为WebSocket协议的连接请求并响应所述连接请求,在客户端与服务器之间建立传送WebSocket数据包的连接,客户端开始向服务器传送WebSocket数据包。2. The server determines that it is a connection request of the WebSocket protocol and responds to the connection request, establishes a connection for transmitting WebSocket data packets between the client and the server, and the client starts to transmit WebSocket data packets to the server.

在步骤S103中,判断所述路由链路是否连通。In step S103, it is judged whether the routing link is connected.

判断所述路由链路是否连通,可以根据握手请求所返回的数据是否正常,如果所述数据正常,表示当前路由链路为可连通的路由链路。Judging whether the routing link is connected can be based on whether the data returned by the handshake request is normal. If the data is normal, it means that the current routing link is a routing link that can be connected.

在步骤S104中,如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点。所述路由链路上的网络节点包括所述路由链路经过的位于所述第一终端与所述第二终端之间的所有网络节点,不包括第一终端和第二终端。In step S104, if the routing link is connected, record that the network node of the routing link is a network node that can support WebSocket data forwarding. The network nodes on the routing link include all network nodes between the first terminal and the second terminal that the routing link passes through, excluding the first terminal and the second terminal.

当握手请求返回的数据正常或者可正常收发数据时,表示当前路由链路可连通,在当前路由链路上所有的网络节点支持WebSocket数据转发。When the data returned by the handshake request is normal or data can be sent and received normally, it means that the current routing link can be connected, and all network nodes on the current routing link support WebSocket data forwarding.

在此步骤中,需要获取路由链路的网络节点信息,可通过服务器端或者可支持traceroute服务的终端通过调用traceroute指令,获取路由链路的网络节点信息。In this step, the network node information of the routing link needs to be obtained, and the network node information of the routing link can be obtained by invoking the traceroute command through the server or a terminal that supports the traceroute service.

在步骤S105中,在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。In step S105, the network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

在预设的可能不支持WebSocket数据转发的网络节点库中,包括有支持WebSocket数据转发的网络节点,也可能包括不支持WebSocket数据转发的网络节点,所述网络节点库可以预先设置于服务器或者第三方服务器,也可以在测试过程中自我建立,在测试过程中得到的数据库,随着测试的进行,网络节点数据库也将越来越来齐全。其中,由测试过程中自我完善所述网络节点库的过程可以为:The preset network node library that may not support WebSocket data forwarding includes network nodes that support WebSocket data forwarding, and may also include network nodes that do not support WebSocket data forwarding. The network node library can be pre-set on the server or the first The third-party server can also establish itself during the test process. The database obtained during the test process will become more and more complete as the test progresses. Wherein, the process of self-improving the network node library in the testing process can be:

如果所述路由链路为不连通,判断所述路由链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;If the routing link is disconnected, determine whether the network node of the routing link is a recorded network node that can support WebSocket data forwarding;

如果所述路由链路的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路的网络节点存入可能不支持WebSocket数据转发的网络节点库。If the network node of the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node of the routing link in a network node library that may not support WebSocket data forwarding.

随着测试的进行,在可能不支持WebSocket数据转发的网络节点库中删除越来越多的经过测试确定的支持WebSocket数据转发的网络节点,使可能不支持WebSocket数据转发的网络节点库中的网络节点的精确度越来越高。从而可以为后续的各类基于WebSocket数据转发的解决方案更加可靠的实施。As the test progresses, delete more and more network nodes that support WebSocket data forwarding after testing in the network node library that may not support WebSocket data forwarding, so that the network in the network node library that may not support WebSocket data forwarding The accuracy of the nodes is getting higher and higher. In this way, various subsequent solutions based on WebSocket data forwarding can be implemented more reliably.

实施例二:Embodiment two:

图2为本发明第二实施例提供的不支持WebSocket数据转发的网络节点的查找的实现流程,所述方法基于带有浏览器的客户端和支持WebSocket协议被访问的服务器,所述客户端不局限于电脑终端,还可包括由手机、PAD等移动终端构成的客户端。所述方法包括如下步骤:Fig. 2 is the implementation process of searching for network nodes that do not support WebSocket data forwarding provided by the second embodiment of the present invention. The method is based on a client with a browser and a server that supports the WebSocket protocol to be accessed, and the client does not It is limited to computer terminals, and may also include clients composed of mobile terminals such as mobile phones and PADs. The method comprises the steps of:

在步骤S201中,接收查找不支持WebSocket数据转发的网络节点的指令。In step S201, an instruction to find a network node that does not support WebSocket data forwarding is received.

客户端通过浏览器接收用户查找不支持WebSocket数据转发的网络节点的指令,所述指令可设置于网页页面或者应用程序或者广告中,客户端通过浏览器由服务器访问到相应页面,接收点击指令触发请求。由于网页页面、应用程序客户端或者广告所推向的用户数量多,因则,在测试过程中可以建立众多客户端到服务器的路由链路,测试过程中包括尽可能多的中转路由等网络节点。The client receives the user's instruction to find a network node that does not support WebSocket data forwarding through the browser. The instruction can be set in a web page, application program or advertisement. The client accesses the corresponding page from the server through the browser and receives the click instruction to trigger ask. Due to the large number of users pushed by web pages, application clients or advertisements, many routing links from clients to servers can be established during the test process, including as many transit routes and other network nodes as possible .

在步骤S202中,检测客户端的浏览器是否为支持WebSocket协议的数据通信的浏览器,如果所述浏览器不支持WebSocket协议的数据访问,则结束查找。In step S202, it is detected whether the browser of the client is a browser supporting the data communication of the WebSocket protocol, and if the browser does not support the data access of the WebSocket protocol, the search is ended.

在现有的客户端中的浏览器,根据版本不同,其扩展或者支持的协议也不相同,较新版本的浏览器,如IE9等较新版本的浏览器,可支持WebSocket协议的数据通信。其检测方式可以检测浏览器的型号版本或者相应的协议标识信息。The browsers in the existing clients have different extensions or supported protocols according to different versions. Newer versions of browsers, such as IE9 and other newer versions of browsers, can support data communication of the WebSocket protocol. The detection method may detect the model version of the browser or corresponding protocol identification information.

作为本发明的一种可选的实施方式,还可以包括步骤S203和步骤S204,在步骤S203中,检测所述客户端与所述服务器通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断所述客户端与所述服务器之间的传送POST请求的链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点。As an optional implementation of the present invention, it may also include steps S203 and S204. In step S203, it is detected whether the client and the server can communicate through the POST mode of the hypertext transfer protocol, if not , it is judged whether the network node on the link transmitting the POST request between the client and the server is a recorded network node that can support WebSocket data forwarding.

在步骤S204中,如果所述传送POST请求的链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。此实施例中的客户端、服务器端,可与实施例一中的第一终端、第二终端相对应。In step S204, if the network node on the link transmitting the POST request is not a recorded network node that can support WebSocket data forwarding, store the network node on the link transmitting the POST request into the preset The network node library that may not support WebSocket data forwarding. The client and the server in this embodiment may correspond to the first terminal and the second terminal in the first embodiment.

在步骤S205中,根据所述指令,在客户端与服务器之间建立传送WebSocket数据的路由链路。In step S205, according to the instruction, a routing link for transmitting WebSocket data is established between the client and the server.

建立服务器与客户端的传送WebSocket数据的路由链路,可由客户端的浏览器发起传送WebSocket数据的握手请求,在得到服务器的响应后,建立传送数据连接的路由链路。To establish a routing link between the server and the client for transmitting WebSocket data, the browser of the client can initiate a handshake request for transmitting WebSocket data, and after getting a response from the server, establish a routing link for transmitting data connection.

在步骤S206中,判断所述路由链路是否连通。In step S206, it is judged whether the routing link is connected.

当握手请求返回的数据正常时,表示当前路由链路可连通,在当前路由链路上所有的网络节点支持WebSocket数据转发。When the data returned by the handshake request is normal, it means that the current routing link can be connected, and all network nodes on the current routing link support WebSocket data forwarding.

在步骤S207中,如果所述路由链路为不连通,判断所述路由链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点。In step S207, if the routing link is disconnected, it is judged whether the network node of the routing link is a recorded network node that can support WebSocket data forwarding.

在步骤S208中,如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。In step S208, if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node on the routing link into the preset that may not support WebSocket data The forwarding network node library or the network nodes on the routing link constitute a network node library that may not support WebSocket data forwarding.

在可能不支持WebSocket数据转发的网络节点库建立之前,在如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点时,将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。Before the network node library that may not support WebSocket data forwarding is established, if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, form the network node on the routing link A network node library that may not support WebSocket data forwarding.

在可能不支持WebSocket数据转发的网络节点库建立后,在如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点时,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。After the network node library that may not support WebSocket data forwarding is established, if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node on the routing link Enter the preset network node library that may not support WebSocket data forwarding.

在步骤S209中,如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路经过的位于所述第一终端与所述第二终端之间的所有网络节点。In step S209, if the routing link is connected, record the network node of the routing link as a network node that can support WebSocket data forwarding, and the network nodes on the routing link include the All network nodes located between the first terminal and the second terminal.

在步骤S210中,在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。In step S210, the network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

在步骤S211中,将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。In step S211, the network nodes recorded as being capable of supporting WebSocket data forwarding are stored in a database of network nodes capable of supporting WebSocket data forwarding.

本发明实施例由网页访问测试页面而得到众多的客户端,因而可以和服务器建立数量众多的路由链路,使其能包括数量众多的不同的路由链路,使测试的同一网络节点可能存在多个路由链路中,在其中一条路由链路中的网络节点为可支持WebSocket数据转发的网络节点后,在其它不连通的路由链路中就可以排除由所述网络节点产生不连通的原因。当一条不连通的路由链路中有N个网络节点,有N-1个网络节点都已记录为支持WebSocket数据转发的网络节点,那么剩下的一个网络节点即为不支持WebSocket数据转发的网络节点,并对其记录到不支持WebSocket数据转发的网络节点库,该网络节点库可为以后的方案实施提供准确的数据。The embodiment of the present invention obtains many clients by accessing the test page from the webpage, thus can establish a large number of routing links with the server, so that it can include a large number of different routing links, so that the same network node of the test may have multiple Among the routing links, after the network node in one of the routing links is a network node that can support WebSocket data forwarding, the cause of the disconnection caused by the network node can be eliminated in other disconnected routing links. When there are N network nodes in a disconnected routing link, and N-1 network nodes have been recorded as network nodes that support WebSocket data forwarding, then the remaining network node is a network that does not support WebSocket data forwarding Node, and record it to the network node library that does not support WebSocket data forwarding, the network node library can provide accurate data for future solution implementation.

实施例三:Embodiment three:

图3为本发明第三实施例提供的基于客户端的不支持WebSocket数据转发的网络节点的查找的流程示意图,详述如下:FIG. 3 is a schematic flow diagram of a client-based search for a network node that does not support WebSocket data forwarding provided by the third embodiment of the present invention, and is described in detail as follows:

在步骤S301中,接收查找不支持WebSocket数据转发的网络节点的指令。In step S301, an instruction to find a network node that does not support WebSocket data forwarding is received.

基于第一终端,可以为客户端,客户端通过网页或者应用程序接收到用户浏览页面或者使用应用程序时输入的查找指令,由于测试的客户端越多,所建立的路由链路也越多,测试结果也越精确,因此,可以选用较为常用的网页或应用程序接收测试指令,执行后续的测试过程。Based on the first terminal, it can be a client. The client receives the search instruction input by the user when browsing the page or using the application through the web page or the application program. Since the more clients are tested, the more routing links are established. The test result is also more accurate, therefore, you can choose a more commonly used web page or application program to receive the test instruction and execute the subsequent test process.

在步骤S302中,根据所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求,以便于与第二终端建立传送WebSocket数据的路由链路。In step S302, according to the instruction, a connection request for establishing a routing link for transmitting WebSocket data is initiated to the second terminal, so as to establish a routing link for transmitting WebSocket data with the second terminal.

客户端接收到请求查找不支持WebSocket数据转发的网络节点的指令,向第二终端,可为服务器等,发起握手请求,握手请求完成后,建立传送WebSocket数据的路由链路。The client receives an instruction to search for a network node that does not support WebSocket data forwarding, and initiates a handshake request to the second terminal, which can be a server, etc. After the handshake request is completed, a routing link for transmitting WebSocket data is established.

在步骤S303中,判断所述路由链路是否连通。In step S303, it is judged whether the routing link is connected.

在客户端获取路由链路的网络节点,考虑到一般的客户端有可能不能执行traceroute指令,因此,可以通过调用服务器的traceroute服务,得到路由链路的网络节点,并将获取的路由链路的网络节点的数据返回至客户端。Obtain the network node of the routing link on the client side. Considering that the general client may not be able to execute the traceroute command, the network node of the routing link can be obtained by calling the traceroute service of the server, and the obtained routing link Data from network nodes is returned to the client.

在步骤S304中,如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路为与所述第二终端之间建立连接的所有网络节点。In step S304, if the routing link is connected, record that the network node on the routing link is a network node that can support WebSocket data forwarding, and the network node on the routing link includes that the routing link is All network nodes establishing connections with the second terminal.

在步骤S305中,在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。In step S305, the network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

其中,当握手请求返回的数据正常或者可正常收发数据时,表示当前路由链路可连通。所述预设的可能不支持WebSocket数据转发的网络节点库,可以由测试人员预先设定,或者在测试过程中得到不连通的路由链路,将所述不连通的路由链路的网络节点存入可能不支持WebSocket数据转发的网络节点库,所述网络节点库可以指定的服务器中。Wherein, when the data returned by the handshake request is normal or data can be sent and received normally, it means that the current routing link can be connected. The preset network node library that may not support WebSocket data forwarding can be preset by the tester, or a disconnected routing link is obtained during the test, and the network nodes of the disconnected routing link are stored Enter the network node library that may not support WebSocket data forwarding, and the network node library can be in the specified server.

为提高路由链路的网络节点的测试效率,在步骤S303前还可包括检测浏览器是否支持WebSocket协议的数据访问;如果不支持WebSocket协议的数据访问,则结束查找;如果所述浏览器支持WebSocket协议的数据访问,则执行所述向第二终端发起建立传送WebSocket数据的路由链路的连接请求的步骤。或者包括检测浏览器与服务器通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断浏览器与服务器之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;如果所述传送POST请求的链路的网络节点不是记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路的网络节点存入可能不支持WebSocket数据转发的网络节点库。For improving the test efficiency of the network node of routing link, before step S303, also can include detecting whether browser supports the data access of WebSocket agreement; If do not support the data access of WebSocket agreement, then end search; If described browser supports WebSocket protocol data access, execute the step of initiating a connection request to the second terminal to establish a routing link for transmitting WebSocket data. Or it includes detecting whether the browser and the server can be connected through the POST mode of the hypertext transfer protocol, and if not, then judging whether the network node of the link transmitting the POST request between the browser and the server is a recorded WebSocket data that can be supported forwarding network node; if the network node of the link that transmits the POST request is not a recorded network node that can support WebSocket data forwarding, store the network node of the link that transmits the POST request into the network node that may not support WebSocket data forwarding Network node library.

实施例四:Embodiment four:

图4为本发明第四实施例提供的不支持WebSocket数据转发的网络节点的查找方法,本发明实施例基于服务器端描述其实施过程,具体包括如下步骤:Fig. 4 is the search method of the network node that does not support WebSocket data forwarding provided by the fourth embodiment of the present invention, the embodiment of the present invention describes its implementation process based on the server end, specifically includes the following steps:

在步骤S401中,接收第一终端发送的建立传送WebSocket数据的路由链路的连接请求。In step S401, a connection request for establishing a routing link for transmitting WebSocket data sent by a first terminal is received.

在步骤S402中,根据所述请求,与第一终端建立传送WebSocket数据的路由链路。In step S402, according to the request, a routing link for transmitting WebSocket data is established with the first terminal.

建立与第一终端的传送WebSocket数据的路由链路,可由第一终端的浏览器发起传送WebSocket数据的握手请求,在得到服务器的响应后,建立传送数据连接的路由链路Establish a routing link for transmitting WebSocket data with the first terminal. The browser of the first terminal can initiate a handshake request for transmitting WebSocket data. After receiving a response from the server, establish a routing link for transmitting data connection

在步骤S403中,判断所述路由链路的连通性。In step S403, the connectivity of the routing link is judged.

在步骤S404中,如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点。In step S404, if the routing link is connected, record that the network node of the routing link is a network node that can support WebSocket data forwarding.

在步骤S405中,在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。In step S405, the network node that can support WebSocket data forwarding is deleted from the preset network node library that may not support WebSocket data forwarding.

其中,所述预先设定的可能不支持WebSocket数据转发的网络节点库,可以通过如下方式获取:在步骤S402后,如果所述路由链路为不连通,判断所述路由链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;Wherein, the preset network node library that may not support WebSocket data forwarding can be obtained in the following manner: after step S402, if the routing link is not connected, it is judged whether the network node of the routing link It is a recorded network node that can support WebSocket data forwarding;

如果所述路由链路的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路的网络节点存入可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。If the network node of the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node of the routing link in the network node library that may not support WebSocket data forwarding or save the routing link The network nodes on constitute a library of network nodes that may not support WebSocket data forwarding.

在可能不支持WebSocket数据转发的网络节点库建立之前,在如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点时,将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。Before the network node library that may not support WebSocket data forwarding is established, if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, form the network node on the routing link A network node library that may not support WebSocket data forwarding.

在可能不支持WebSocket数据转发的网络节点库建立后,在如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点时,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。After the network node library that may not support WebSocket data forwarding is established, if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding, store the network node on the routing link Enter the preset network node library that may not support WebSocket data forwarding.

所述网络节点库可以存储在服务器,或者其它第三方服务器,可以方便的进行修改的网络节点数据信息的共享。The network node database can be stored in a server or other third-party server, which can facilitate the sharing of modified network node data information.

另外,还可将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库,方便以后调用。In addition, the network nodes that are recorded as being able to support WebSocket data forwarding can also be stored in the network node database that can support WebSocket data forwarding, so as to facilitate future calls.

实施例五:Embodiment five:

图5为本发明第五实施例提供的不支持WebSocket数据转发的网络节点的查找装置500的结构示意图,详述如下:FIG. 5 is a schematic structural diagram of a search device 500 for a network node that does not support WebSocket data forwarding provided by a fifth embodiment of the present invention. The details are as follows:

本发明实施例所述不支持WebSocket数据转发的网络节点的查找装置500,包括:The search device 500 for a network node that does not support WebSocket data forwarding in the embodiment of the present invention includes:

接收单元501,用于接收查找不支持WebSocket数据转发的网络节点的指令;The receiving unit 501 is configured to receive an instruction to find a network node that does not support WebSocket data forwarding;

路由链路建立单元502,用于根据所述接收单元501接收到的所述指令,在第一终端与第二终端建立传送WebSocket数据的路由链路;A routing link establishment unit 502, configured to establish a routing link for transmitting WebSocket data between the first terminal and the second terminal according to the instruction received by the receiving unit 501;

第一判断单元503,用于判断所述路由链路建立单元502建立的所述路由链路是否连通;A first judging unit 503, configured to judge whether the routing link established by the routing link establishing unit 502 is connected;

记录单元504,用于如果所述第一判断单元503判断的所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括路由链路经过的位于所述第一终端与第二终端之间的所有网络节点;The recording unit 504 is configured to record that the network node on the routing link is a network node that can support WebSocket data forwarding if the routing link judged by the first judging unit 503 is connected, and the routing link on the routing link The network nodes include all network nodes located between the first terminal and the second terminal through which the routing link passes;

删除单元505,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述记录单元记录的所述可支持WebSocket数据转发的网络节点。The deleting unit 505 is configured to delete the network node capable of supporting WebSocket data forwarding recorded by the recording unit from the preset network node library that may not support WebSocket data forwarding.

其中,为完善可能不支持WebSocket数据转发的网络节点库的数据信息,所述装置还可包括:Wherein, in order to improve the data information of the network node library that may not support WebSocket data forwarding, the device may also include:

第二判断单元506,用于如果所述第一判断单元判断的所述路由链路为不连通,判断所述路由链路上的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;The second judging unit 506 is configured to judge whether the network node on the routing link is a recorded network node that can support WebSocket data forwarding if the routing link judged by the first judging unit is disconnected;

第一网络节点存入单元507,用于如果第二判断单元判断的所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。The first network node storage unit 507 is configured to save the network node on the routing link if the network node on the routing link judged by the second judging unit is not a recorded network node that can support WebSocket data forwarding Store the preset network node library that may not support WebSocket data forwarding or form the network nodes on the routing link into a network node library that may not support WebSocket data forwarding.

可进一步提高检测效率的,所述第一终端为带有浏览器的客户端,所述第二终端为支持WebSocket协议被访问的服务器,所述装置还包括:Can further improve the detection efficiency, the first terminal is a client with a browser, the second terminal is a server that supports the WebSocket protocol to be accessed, and the device also includes:

第一检测单元508,用于检测所述客户端的浏览器是否为支持WebSocket协议通信的浏览器,如果所述客户端的浏览器为不支持WebSocket协议通信的浏览器,则结束查找;如果所述客户端的浏览器为支持WebSocket协议通信的浏览器,则转至所述路由链路建立单元502执行。或者所述装置还可第二检测单元509和第二网络节点存入单元510,其中第二检测单元509用于检测所述第一终端与所述第二终端通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断所述第一终端与所述第二终端之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点。The first detection unit 508 is used to detect whether the browser of the client is a browser that supports WebSocket protocol communication, if the browser of the client is a browser that does not support WebSocket protocol communication, then end the search; if the client If the browser at the end is a browser supporting WebSocket protocol communication, transfer to the routing link establishing unit 502 for execution. Or the device can also have a second detection unit 509 and a second network node storage unit 510, wherein the second detection unit 509 is used to detect whether the first terminal and the second terminal use the POST mode of the hypertext transfer protocol It can be connected, and if not, it is judged whether the network node of the link transmitting the POST request between the first terminal and the second terminal is a recorded network node that can support WebSocket data forwarding.

第二网络节点存入单元510用于如果所述传送POST请求的链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,则将所述路由链路上的网络节点存入所述预设的可能不支持WebSocket数据转发的网络节点库。The second network node storage unit 510 is used to store the network node on the routing link into the network node if the network node on the link transmitting the POST request is not a recorded network node that can support WebSocket data forwarding. The preset network node library that may not support WebSocket data forwarding.

相应的,本发明实施例还可包括由本实施例所述装置构成的系统。Correspondingly, the embodiments of the present invention may also include a system composed of the devices described in this embodiment.

本发明实施例所述装置与本发明实施一和实施例二所述的方法实施例相对应,在此不重复赘述。The device described in the embodiment of the present invention corresponds to the method embodiment described in Embodiment 1 and Embodiment 2 of the present invention, and details are not repeated here.

实施例六:Embodiment six:

图6为本发明第六实施例提供的不支持WebSocket数据转发的网络节点的查找装置600的结构示意图,详述如下:FIG. 6 is a schematic structural diagram of a search device 600 for a network node that does not support WebSocket data forwarding provided by the sixth embodiment of the present invention. The details are as follows:

本发明实施例所述装置,包括:The device described in the embodiment of the present invention includes:

接收模块601,用于接收查找不支持WebSocket数据转发的网络节点的指令;The receiving module 601 is configured to receive an instruction to find a network node that does not support WebSocket data forwarding;

连接请求发送模块602,用于根据接收模块601接收的所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求,以便于与第二终端建立传送WebSocket数据的路由链路;The connection request sending module 602 is configured to initiate a connection request to the second terminal to establish a routing link for transmitting WebSocket data according to the instruction received by the receiving module 601, so as to establish a routing link for transmitting WebSocket data with the second terminal;

第一获取判断模块603,用于判断所述路由链路是否连通;A first acquisition judging module 603, configured to judge whether the routing link is connected;

第一记录模块604,用于如果所述路由链路为连通,记录所述路由链路上的网络节点为可支持WebSocket数据转发的网络节点,所述路由链路上的网络节点包括所述路由链路为与所述第二终端之间建立连接的所有网络节点;The first recording module 604 is configured to record the network node on the routing link as a network node that can support WebSocket data forwarding if the routing link is connected, and the network node on the routing link includes the route The links are all network nodes establishing connections with the second terminal;

删除模块605,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。A deletion module 605, configured to delete the network node that can support WebSocket data forwarding from the preset network node library that may not support WebSocket data forwarding.

具体的,所述第二终端可为服务器,所述第一获取判断模块603具体用于调用服务器的traceroute服务获取所述路由链路的网络节点,判断所述路由链路是否连通。Specifically, the second terminal may be a server, and the first obtaining and judging module 603 is specifically configured to call a traceroute service of the server to obtain the network node of the routing link, and judge whether the routing link is connected.

当所述连接请求由浏览器发送时,所述装置还可包括:When the connection request is sent by the browser, the device may further include:

第一检测模块606,用于检测浏览器是否支持WebSocket协议的数据访问,如果不支持WebSocket协议的数据访问,则结束查找,如果所述浏览器支持WebSocket协议的数据访问,则转至连接请求发送模块执行;或The first detection module 606 is used to detect whether the browser supports the data access of the WebSocket protocol, if the data access of the WebSocket protocol is not supported, the search is ended, and if the browser supports the data access of the WebSocket protocol, then the connection request is sent module execution; or

第二检测模块607,用于检测浏览器与服务器通过超文本传输协议的POST方式是否可以连通,如果不可以,则判断浏览器与服务器之间的传送POST请求的链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;The second detection module 607 is used to detect whether the browser and the server can be connected through the POST mode of the hypertext transfer protocol, if not, then judge whether the network node of the link transmitting the POST request between the browser and the server is established Recorded network nodes that can support WebSocket data forwarding;

第一网络节点存入模块608,用于如果所述传送POST请求的链路的网络节点不是记录的可支持WebSocket数据转发的网络节点,将所述传送POST请求的链路的网络节点存入可能不支持WebSocket数据转发的网络节点库。The first network node storage module 608 is used to store the network node of the link that transmits the POST request into a possible A network node library that does not support WebSocket data forwarding.

本发明实施例还提供了一种终端设备,所述终端设备包括本发明实施例所述的不支持WebSocket数据转发的网络节点的查找装置。The embodiment of the present invention also provides a terminal device, and the terminal device includes the device for finding a network node that does not support WebSocket data forwarding according to the embodiment of the present invention.

本发明所述装置实施例与本发明第三实施例所述方法实施例相对应,在此不重复赘述。The device embodiment in the present invention corresponds to the method embodiment in the third embodiment of the present invention, and details are not repeated here.

实施例七:Embodiment seven:

图7为本发明实施例提供的不支持WebSocket数据转发的网络节点的查找装置700的结构示意图,详述如下:7 is a schematic structural diagram of a search device 700 for a network node that does not support WebSocket data forwarding provided by an embodiment of the present invention, and is described in detail as follows:

本发明实施例所述不支持WebSocket数据转发的网络节点的查找装置700包括:The search device 700 for a network node that does not support WebSocket data forwarding in the embodiment of the present invention includes:

连接请求接收模块701,用于接收第一终端发送的建立传送WebSocket数据的路由链路的连接请求;A connection request receiving module 701, configured to receive a connection request sent by the first terminal to establish a routing link for transmitting WebSocket data;

路由链路建立模块702,用于根据连接请求接收模块接收的所述请求,与第一终端建立传送WebSocket数据的路由链路;A routing link establishment module 702, configured to establish a routing link for transmitting WebSocket data with the first terminal according to the request received by the connection request receiving module;

第二判断模块703,用于判断所述路由链路建立模块702建立的路由链路的连通性;The second judging module 703 is configured to judge the connectivity of the routing link established by the routing link establishing module 702;

第二记录模块704,用于由第二判断模块703判断如果所述路由链路为连通,记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点;The second recording module 704 is used for judging by the second judging module 703 that if the routing link is connected, record the network node of the routing link as a network node that can support WebSocket data forwarding;

第二删除模块705,用于在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点。The second deletion module 705 is configured to delete the network node that can support WebSocket data forwarding from the preset network node library that may not support WebSocket data forwarding.

为使得可能不支持WebSocket数据转发的网络节点库的数据更加周全,所述装置还包括网络节点判断模块706,用于如果所述路由链路为不连通,判断所述路由链路的网络节点是否为已记录的可支持WebSocket数据转发的网络节点;In order to make the data of the network node library that may not support WebSocket data forwarding more comprehensive, the device also includes a network node judging module 706, which is used to judge whether the network node of the routing link is connected if the routing link is disconnected. It is a recorded network node that can support WebSocket data forwarding;

第二网络节点存入模块707,用于如果所述路由链路上的网络节点不是已记录的可支持WebSocket数据转发的网络节点,将所述路由链路上的网络节点存入可能不支持WebSocket数据转发的网络节点库或将所述路由链路上的网络节点构成可能不支持WebSocket数据转发的网络节点库。The second network node storage module 707 is used to store the network node on the routing link into a network node that may not support WebSocket if the network node on the routing link is not a recorded network node that can support WebSocket data forwarding. The network node library for data forwarding or the network nodes on the routing link constitute a network node library that may not support WebSocket data forwarding.

为更好的方便后续的数据调用,所述装置还包括第二存入模块708,用于将所述记录为可支持WebSocket数据转发的网络节点存入可支持WebSocket数据转发的网络节点库。To better facilitate subsequent data calls, the device further includes a second storage module 708, configured to store the network nodes that are recorded as supporting WebSocket data forwarding into the network node library that supports WebSocket data forwarding.

本发明实施例提供了一种服务器,包括本实施例所述的不支持WebSocket数据转发的网络节点的查找装置。An embodiment of the present invention provides a server, including the device for finding network nodes that do not support WebSocket data forwarding described in this embodiment.

本发明装置实施例与实施例四所述的方法实施例相对应,在此不作重复赘述。The device embodiment of the present invention corresponds to the method embodiment described in Embodiment 4, and will not be repeated here.

实施例八:Embodiment eight:

图8为本发明实施例提供的不支持WebSocket数据转发的网络节点的查找的终端设备80,包括:处理器81,存储器82和网络模块83。其中,FIG. 8 is a terminal device 80 for searching network nodes that do not support WebSocket data forwarding provided by an embodiment of the present invention, including: a processor 81 , a memory 82 and a network module 83 . in,

处理器81,用于执行程序。The processor 81 is used for executing programs.

在本发明实施例八中,程序可以包括程序代码,所述程序代码包括计算机操作指令。In Embodiment 8 of the present invention, the program may include program code, and the program code includes computer operation instructions.

处理器81可能是中央处理器CPU,或者是被配置成实施本发明实施例的一个或多个集成电路。Processor 81 may be a central processing unit CPU, or one or more integrated circuits configured to implement embodiments of the present invention.

存储器82,用于存储程序。The memory 82 is used to store programs.

存储器82可能包含随机存取存储器(英文:Random-access memory,缩写:RAM),也可能还包括非易失性存储器(英文:Non-volatile memory,缩写:NVRAM)。The memory 82 may include random-access memory (English: Random-access memory, abbreviation: RAM), and may also include a non-volatile memory (English: Non-volatile memory, abbreviation: NVRAM).

网络模块83,用于将终端设备中数据发送到服务器,并接收服务下发的数据信息,如基于WebSocket协议的数据包;The network module 83 is used to send data in the terminal device to the server, and receive data information sent by the service, such as a data packet based on the WebSocket protocol;

当不支持WebSocket数据转发的网络节点的查找的终端设备运行时,所述处理器81用于执行存储器82中存储的程序使得所述不支持WebSocket数据转发的网络节点的查找的终端设备执行如下的方法:When the terminal device for searching the network node that does not support WebSocket data forwarding is running, the processor 81 is used to execute the program stored in the memory 82 so that the terminal device for searching the network node that does not support WebSocket data forwarding performs the following steps method:

处理器81接收查找不支持WebSocket数据转发的网络节点的指令;The processor 81 receives an instruction to find a network node that does not support WebSocket data forwarding;

处理器81根据所述指令,向第二终端发起建立传送WebSocket数据的路由链路的连接请求;The processor 81 initiates a connection request to the second terminal to establish a routing link for transmitting WebSocket data according to the instruction;

处理器81获取所述路由链路的网络节点,判断所述路由链路是否连通The processor 81 obtains the network node of the routing link, and judges whether the routing link is connected

当所述路由链路为连通,处理器81记录所述路由链路的网络节点为可支持WebSocket数据转发的网络节点,在预设的可能不支持WebSocket数据转发的网络节点库中删除所述可支持WebSocket数据转发的网络节点,得到进一步精确的不支持WebSocket数据转发的网络节点库。When the routing link is connected, the processor 81 records the network node of the routing link as a network node that can support WebSocket data forwarding, and deletes the network node that can support WebSocket data forwarding from the preset network node library that may not support WebSocket data forwarding. For network nodes that support WebSocket data forwarding, get a more accurate library of network nodes that do not support WebSocket data forwarding.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘,硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware, and of course also by hardware, but in many cases the former is a better embodiment . Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a floppy disk of a computer , a hard disk or an optical disk, etc., including several instructions for enabling a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (26)

1. A method for searching a network node which does not support WebSocket data forwarding is characterized by comprising the following steps:
receiving an instruction for searching a network node which does not support WebSocket data forwarding;
establishing a routing link for transmitting WebSocket data between the first terminal and the second terminal according to the instruction;
judging whether the routing links are connected or not;
if the routing link is communicated, recording that the network nodes on the routing link are network nodes capable of supporting WebSocket data forwarding, wherein the network nodes on the routing link comprise all network nodes which are located between the first terminal and the second terminal and passed by the routing link;
and deleting the network nodes capable of supporting the WebSocket data forwarding from a preset network node library which may not support the WebSocket data forwarding.
2. The method of claim 1, further comprising:
if the routing link is disconnected, judging whether the network node on the routing link is a recorded network node capable of supporting WebSocket data forwarding;
if the network node on the routing link is not the recorded network node which can support WebSocket data forwarding, the network node on the routing link is stored into the preset network node library which possibly does not support WebSocket data forwarding or the network node on the routing link is formed into the network node library which possibly does not support WebSocket data forwarding.
3. The method of claim 1, wherein the first terminal comprises a client with a browser, wherein the second terminal comprises a server supporting WebSocket protocol communication, and wherein before the step of establishing, according to the instruction, a routing link for transmitting WebSocket data between the first terminal and the second terminal, the method further comprises:
detecting whether the browser of the client is a browser supporting WebSocket protocol communication;
if the browser of the client side is a browser which does not support WebSocket protocol communication, finishing searching;
and if the browser of the client is the browser supporting WebSocket protocol communication, executing the step of establishing a routing link for transmitting WebSocket data between the first terminal and the second terminal according to the command.
4. The method of claim 1, wherein before the establishing, according to the instruction, a routing link for transmitting WebSocket data between the first terminal and the second terminal, the method further comprises:
detecting whether the first terminal and the second terminal can be communicated through a POST mode of a hypertext transfer protocol, if not, judging whether a network node on a link for transmitting a POST request between the first terminal and the second terminal is a recorded network node capable of supporting WebSocket data forwarding;
and if the network node on the link transmitting the POST request is not the recorded network node capable of supporting WebSocket data forwarding, storing the network node on the link transmitting the POST request into the preset network node library which possibly does not support WebSocket data forwarding.
5. The method of claim 1, further comprising:
and storing the network nodes recorded as the network nodes capable of supporting WebSocket data forwarding into a network node library capable of supporting WebSocket data forwarding.
6. A lookup apparatus for a network node that does not support WebSocket data forwarding, the apparatus comprising:
the receiving unit is used for receiving an instruction for searching a network node which does not support WebSocket data forwarding;
a routing link establishing unit, configured to establish, according to the instruction received by the receiving unit, a routing link that transmits WebSocket data between the first terminal and the second terminal;
a first judging unit, configured to judge whether the routing links established by the routing link establishing unit are connected;
a recording unit, configured to record, if the routing link determined by the first determining unit is connected, that a network node on the routing link is a network node capable of supporting WebSocket data forwarding, where the network node on the routing link includes all network nodes located between the first terminal and the second terminal, and the network nodes pass through by the routing link;
and the deleting unit is used for deleting the network nodes which are recorded by the recording unit and can support the WebSocket data forwarding in a preset network node library which can not support the WebSocket data forwarding.
7. The apparatus of claim 6, further comprising:
a second judging unit, configured to judge whether a network node on the routing link is a recorded network node that can support WebSocket data forwarding if the routing link judged by the first judging unit is not connected;
and the first network node storing unit is used for storing the network nodes on the routing link into the preset network node library which possibly does not support the WebSocket data forwarding or forming the network nodes on the routing link into the network node library which possibly does not support the WebSocket data forwarding if the network nodes on the routing link judged by the second judging unit are not the recorded network nodes which can support the WebSocket data forwarding.
8. The apparatus of claim 6, wherein the first terminal comprises a client with a browser, wherein the second terminal comprises a server supporting WebSocket protocol communication, and wherein the apparatus further comprises:
the first detection unit is used for detecting whether the browser of the client side is a browser supporting WebSocket protocol communication; if the browser of the client side is a browser which does not support WebSocket protocol communication, finishing searching; and if the browser of the client is the browser supporting WebSocket protocol communication, switching to the routing link establishing unit for execution.
9. The apparatus of claim 6, further comprising:
the second detection unit is used for detecting whether the first terminal and the second terminal can be communicated through a POST mode of a hypertext transfer protocol, and if not, judging whether a network node of a link for transmitting a POST request between the first terminal and the second terminal is a recorded network node capable of supporting WebSocket data forwarding;
and the second network node storing unit is used for storing the network node on the routing link into the preset network node library which possibly does not support the WebSocket data forwarding if the network node on the link transmitting the POST request is not the recorded network node which can support the WebSocket data forwarding.
10. The apparatus of claim 6, further comprising:
and the third network node storing unit is used for storing the network nodes which are recorded as the network nodes capable of supporting the WebSocket data forwarding into a network node library capable of supporting the WebSocket data forwarding.
11. A method for searching a network node which does not support WebSocket data forwarding is characterized by comprising the following steps:
receiving an instruction for searching a network node which does not support WebSocket data forwarding;
initiating a connection request for establishing a routing link for transmitting the WebSocket data to the second terminal according to the instruction so as to establish the routing link for transmitting the WebSocket data with the second terminal;
judging whether the routing links are connected or not;
if the routing link is communicated, recording that the network nodes on the routing link are network nodes capable of supporting WebSocket data forwarding, wherein the network nodes on the routing link comprise all network nodes which establish connection with the second terminal;
and deleting the network nodes capable of supporting the WebSocket data forwarding from a preset network node library which may not support the WebSocket data forwarding.
12. The method according to claim 11, wherein the second terminal is a server, and the step of determining whether the routing links are connected specifically comprises:
and calling traceroute service of a server to acquire the network node of the routing link and judge whether the routing link is communicated.
13. The method of claim 11, wherein the connection request is sent by a browser, and before the step of initiating a connection request for establishing a routing link for transmitting WebSocket data to the second terminal according to the instruction, the method further comprises:
detecting whether the browser supports data access of a WebSocket protocol;
if the data access of the WebSocket protocol is not supported, finishing the search;
and if the browser supports the data access of the WebSocket protocol, executing the step of initiating a connection request for establishing a routing link for transmitting the WebSocket data to the second terminal.
14. The method of claim 11, wherein the connection request is sent by a browser, and before the step of initiating a connection request for establishing a routing link for transmitting WebSocket data to a server according to the instruction, the method further comprises:
detecting whether the browser and the server can be communicated through a POST mode of a hypertext transfer protocol, and if not, judging whether a network node of a link for transmitting a POST request between the browser and the server is a recorded network node capable of supporting WebSocket data forwarding;
if the network node of the link transmitting the POST request is not the recorded network node capable of supporting WebSocket data forwarding, the network node of the link transmitting the POST request is stored into a network node library which may not support WebSocket data forwarding.
15. A lookup apparatus for a network node that does not support WebSocket data forwarding, the apparatus comprising:
the receiving module is used for receiving an instruction for searching a network node which does not support WebSocket data forwarding;
the connection request sending module is used for initiating a connection request for establishing a routing link for transmitting the WebSocket data to the second terminal according to the instruction received by the receiving module so as to establish the routing link for transmitting the WebSocket data with the second terminal;
the first judging module is used for judging whether the routing links are communicated or not;
a first recording module, configured to record, if the routing link is connected, that the network nodes on the routing link are network nodes capable of supporting WebSocket data forwarding, where the network nodes on the routing link include all network nodes in which the routing link is connected to the second terminal;
and the deleting module is used for deleting the network nodes which can support the WebSocket data forwarding from a preset network node library which may not support the WebSocket data forwarding.
16. The apparatus according to claim 15, wherein the second terminal is a server, and the first determining module is specifically configured to invoke a traceroute service of the server to obtain a network node of the routing link, and determine whether the routing link is connected.
17. The apparatus of claim 15, wherein the connection request is sent by a browser, the apparatus further comprising:
the first detection module is used for detecting whether the browser supports data access of the WebSocket protocol, if not, the search is finished, and if the browser supports the data access of the WebSocket protocol, the connection request sending module is switched to execute the search.
18. The apparatus of claim 15, wherein the connection request is sent by a browser, the apparatus further comprising:
the second detection module is used for detecting whether the browser and the server can be communicated through a POST mode of a hypertext transfer protocol, and if not, judging whether a network node of a link for transmitting a POST request between the browser and the server is a recorded network node capable of supporting WebSocket data forwarding;
and the first network node storing module is used for storing the network node of the link transmitting the POST request into a network node library which may not support the WebSocket data forwarding if the network node of the link transmitting the POST request is not the recorded network node which can support the WebSocket data forwarding.
19. A terminal device, characterized in that the terminal device comprises the lookup apparatus of any one of claims 15 to 18 for a network node that does not support WebSocket data forwarding.
20. A method for searching a network node which does not support WebSocket data forwarding is characterized by comprising the following steps:
receiving a connection request for establishing a routing link for transmitting WebSocket data, which is sent by a first terminal;
establishing a routing link for transmitting WebSocket data with the first terminal according to the request;
judging the connectivity of the routing link;
if the routing link is connected, recording that the network node of the routing link is a network node capable of supporting WebSocket data forwarding,
and deleting the network nodes capable of supporting the WebSocket data forwarding from a preset network node library which may not support the WebSocket data forwarding.
21. The method of claim 20, further comprising:
if the routing link is disconnected, judging whether the network node on the routing link is a recorded network node capable of supporting WebSocket data forwarding;
if the network nodes on the routing link are not recorded network nodes capable of supporting WebSocket data forwarding, storing the network nodes on the routing link into a network node library which possibly does not support WebSocket data forwarding or forming the network nodes on the routing link into a network node library which possibly does not support WebSocket data forwarding.
22. The method of claim 20, further comprising:
and storing the network nodes recorded as the network nodes capable of supporting WebSocket data forwarding into a network node library capable of supporting WebSocket data forwarding.
23. A lookup apparatus for a network node that does not support WebSocket data forwarding, the apparatus comprising:
the device comprises a connection request receiving module, a first terminal and a second terminal, wherein the connection request receiving module is used for receiving a connection request which is sent by the first terminal and used for establishing a routing link for transmitting WebSocket data;
the routing link establishing module is used for establishing a routing link for transmitting WebSocket data with the first terminal according to the request received by the connection request receiving module;
a second judging module, configured to judge connectivity of the routing link established by the routing link establishing module;
the second recording module is used for judging that if the routing link is communicated, the second judging module records that the network node of the routing link is a network node capable of supporting WebSocket data forwarding;
and the second deleting module is used for deleting the network nodes capable of supporting the WebSocket data forwarding in a preset network node library which may not support the WebSocket data forwarding.
24. The apparatus of claim 23, further comprising:
the network node judging module is used for judging whether the network node of the routing link is a recorded network node which can support WebSocket data forwarding or not if the routing link is not communicated;
and the second network node storing module is used for storing the network nodes on the routing link into a network node library which possibly does not support WebSocket data forwarding or forming the network nodes on the routing link into a network node library which possibly does not support WebSocket data forwarding if the network nodes on the routing link are not recorded network nodes which can support WebSocket data forwarding.
25. The apparatus of claim 23, further comprising:
and the second storing module is used for storing the network nodes which are recorded as being capable of supporting WebSocket data forwarding into a network node library capable of supporting WebSocket data forwarding.
26. A server, characterized in that it comprises lookup means of a network node not supporting WebSocket data forwarding according to any of claims 23 to 25.
CN201310228458.8A 2013-06-09 2013-06-09 Lookup method, the device of the network node of WebSocket data forwardings are not supported Expired - Fee Related CN104243188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310228458.8A CN104243188B (en) 2013-06-09 2013-06-09 Lookup method, the device of the network node of WebSocket data forwardings are not supported

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310228458.8A CN104243188B (en) 2013-06-09 2013-06-09 Lookup method, the device of the network node of WebSocket data forwardings are not supported

Publications (2)

Publication Number Publication Date
CN104243188A true CN104243188A (en) 2014-12-24
CN104243188B CN104243188B (en) 2018-02-13

Family

ID=52230590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310228458.8A Expired - Fee Related CN104243188B (en) 2013-06-09 2013-06-09 Lookup method, the device of the network node of WebSocket data forwardings are not supported

Country Status (1)

Country Link
CN (1) CN104243188B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235867A (en) * 2020-12-15 2021-01-15 广东省新一代通信与网络创新研究院 Resource scheduling method and system for improving spectrum efficiency

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833323A (en) * 2012-08-14 2012-12-19 新浪网技术(中国)有限公司 Method and system for remote control of controlled terminal by server
CN102893270A (en) * 2009-05-01 2013-01-23 卡金公司 Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications
US8396920B1 (en) * 2011-11-30 2013-03-12 Google Inc. Clean URLs in web applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102893270A (en) * 2009-05-01 2013-01-23 卡金公司 Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications
US8396920B1 (en) * 2011-11-30 2013-03-12 Google Inc. Clean URLs in web applications
CN102833323A (en) * 2012-08-14 2012-12-19 新浪网技术(中国)有限公司 Method and system for remote control of controlled terminal by server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GERARD NICOLAS ET.AL: "Websocket Enabler:achieving IMS and Web services end-to-end convergence", 《ACM,CONFERENCE 10》 *
李代立等: "WebSocket在Web实时通信领域的研究", 《电脑知识与技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235867A (en) * 2020-12-15 2021-01-15 广东省新一代通信与网络创新研究院 Resource scheduling method and system for improving spectrum efficiency
CN112235867B (en) * 2020-12-15 2021-03-30 广东省新一代通信与网络创新研究院 Resource scheduling method and system for improving spectrum efficiency

Also Published As

Publication number Publication date
CN104243188B (en) 2018-02-13

Similar Documents

Publication Publication Date Title
CN103257989B (en) Web page download time is analyzed
CN105589782B (en) User behavior acquisition method based on browser
US9503506B2 (en) Transit-mode-based webpage accessing method, system, and crawler route server
CN110737891B (en) Host intrusion detection method and device
CN103546903B (en) Method and device for handheld device wifi testing
CN111106983B (en) Method and device for detecting network connectivity
CN108134816B (en) Access to data on remote device
EP3179370A1 (en) Webpage automatic test method and apparatus
CN106911735A (en) Data capture method and device
CN110825603A (en) Page first loading time determining method and device, electronic equipment and storage medium
CN105187393B (en) A kind of mobile terminal from malicious software network behavior reconstructing method and its system
CN116192694B (en) A time delay measurement method and related device
CN108600377B (en) Method, device, terminal and storage medium for suspending file downloading
CN110347955B (en) Resource detection method and device
CN110784364B (en) Data monitoring method and device, storage medium and terminal
CN110347380B (en) Front-end and back-end development method and device
WO2025158261A1 (en) Request processing method and apparatus, and task execution method and apparatus
CN112671574B (en) Front-end and back-end joint debugging method and device, proxy equipment and storage medium
CN104243188B (en) Lookup method, the device of the network node of WebSocket data forwardings are not supported
CN108810092A (en) Network Access Method and device, electronic equipment, computer readable storage medium
CN104125605B (en) A kind of implementation method and device for asking to set up WIFI connections
CN106911733A (en) The network address access method and device of cloud agency
JP2020510251A (en) Redirect reduction
CN105229990B (en) The method and apparatus for loading webpage
CN116820958A (en) An agent-based multi-environment automated testing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180213