CN107682234A - A kind of method of the network speed test based on WebSocket - Google Patents

A kind of method of the network speed test based on WebSocket Download PDF

Info

Publication number
CN107682234A
CN107682234A CN201711148916.1A CN201711148916A CN107682234A CN 107682234 A CN107682234 A CN 107682234A CN 201711148916 A CN201711148916 A CN 201711148916A CN 107682234 A CN107682234 A CN 107682234A
Authority
CN
China
Prior art keywords
test
websocket
node
network speed
management server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711148916.1A
Other languages
Chinese (zh)
Inventor
窦鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
VIXTEL TECHNOLOGIES (BEIJING) Ltd
Original Assignee
VIXTEL TECHNOLOGIES (BEIJING) 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 VIXTEL TECHNOLOGIES (BEIJING) Ltd filed Critical VIXTEL TECHNOLOGIES (BEIJING) Ltd
Priority to CN201711148916.1A priority Critical patent/CN107682234A/en
Publication of CN107682234A publication Critical patent/CN107682234A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The present invention proposes a kind of method of the network speed test based on WebSocket, data channel is established in client and test node by technique, transmission data total amount and transmission are calculated so as to draw the data uploading rate between client and test node data total time, the information such as downloading rate, delay duration.And supported simultaneously for pc ends and mobile client, realize and realize that network tests the speed in the case of zero installation zero configuration in PC and mobile device, unnecessary file will not be produced, on client without influence.

Description

A kind of method of the network speed test based on WebSocket
Technical field
The present invention relates to network speed technical field of measurement and test, more particularly to a kind of network speed method of testing based on WebSocket.
Background technology
The mode of traditional test network speed is the embedded flash plug-in units in webpage, passes through flash and test node server Communication port transmission data are established, transmission rate is calculated according to data transfer total amount and time difference.But as HTML5 is marked Accurate popularization and the rise of mobile device, increasing browser stop or will stopped the support to flash, use before The function that flash technologies are realized will be more limited.
The content of the invention
The purpose of the present invention is intended at least solve one of described technological deficiency.
Therefore, it is an object of the invention to propose a kind of network speed method of testing based on WebSocket.
To achieve these goals, embodiments of the invention provide a kind of network speed method of testing based on WebSocket, bag Include following steps:
Step S1, during test node startup of server, oneself to management server is sent by WebSocket established and test the speed The IP address of service and port, test node is registered in the management server;
Step S2, when detecting user's opening network speed test page, by the javascript in the network speed test page Whether script detection browser supports WebSocket, and the passage to the management server is established if supporting, and to described Server sends local user identification information;Prompt message is sent if not supporting;
Step S3, the management server establish WebSocket services when starting, when receiving user's request, according to The IP address of user's connection and chartered test node, filter out optimal test node information and return to user;
Step S4, after the information that the management server returns is received, it is polytype to automatically select node progress Network speed is tested, and returns to test data to the management server.
Further, in the step S4, most suitable node is selected, carries out polytype network speed test, including:Prolong Test late, uploading rate test and downloading rate test.
Further, in the step S4, after the information that the management server returns is received, using automatically selecting It is adapted to node or manually selects other available nodes that test the speed.
Further, in the step S2, judge whether to support WebSocket by following methods:Pass through global object In whether include WebSocket objects, and whether possess send methods in WebSocket objects to judge whether to support Websocket。
Further, it is described to automatically select node in the step S4, comprise the following steps:The management server is returned Contain multiple test nodes in the test node group returned, each in test node group is being saved after obtaining test node group Point carries out delayed test, the minimum test node of query latency, as the result for automatically selecting suitable node.
Network speed method of testing based on WebSocket according to embodiments of the present invention, established by WebSocket with testing the speed The connection of node server, quantitative data is sent to calculate transmission rate, realize the unified realization of multi-platform speed-measuring method.This hair Bright connected using WebSocket to server sends a certain amount of data, and device to be serviced completes that transmission speed is calculated after receiving Rate, it is not necessary to do any configuration in a user device or install any software, i.e., network speed is tested without using additional software, in PC Realize that network tests the speed in the case of zero installation zero configuration in machine and mobile device, unnecessary file will not be produced, to client without Influence.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
The above-mentioned and/or additional aspect and advantage of the present invention will become in the description from combination accompanying drawings below to embodiment Substantially and it is readily appreciated that, wherein:
Fig. 1 is the flow chart for the method tested according to the network speed based on WebSocket of the embodiment of the present invention;
Fig. 2 is the schematic diagram for the method tested according to the network speed based on WebSocket of the embodiment of the present invention;
Fig. 3 is the schematic diagram for automatically selecting test node according to the embodiment of the present invention.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and is not considered as limiting the invention.
According to caniuse.com statistical information, 94.45% supports completely in the browser used at present websocket.WebSocket is a kind of agreement that full duplex communication is carried out in single TCP connections that HTML5 starts to provide. In WebSocket API, browser and server only needs to do an action shaken hands.Then, browser and server it Between be formed an express passway, after connection is established, client and server end can is directly exchanged by TCP connections Data.
Based on this, the present invention provides a kind of method of the network speed test based on WebSocket, is connected using WebSocket A certain amount of data are sent to server, device to be serviced completes that transmission rate is calculated after receiving, it is not necessary in user equipment In do it is any configuration or any software is installed, i.e., without using additional software test network speed.
As depicted in figs. 1 and 2, the method for the test of the network speed based on WebSocket of the embodiment of the present invention, including following step Suddenly:
Step S1, during test node startup of server, oneself to management server is sent by WebSocket established and test the speed The IP address of service and port, register test node on the management server.
Step S2, when detecting user's opening network speed test page, by the javascript scripts in network speed test page Whether detection browser supports WebSocket, the passage to management server is established if supporting, and send this to server Machine user identity information;Prompt message is sent if not supporting, clearly to prompt user not support.
In this step, judge whether to support WebSocket by following manner:Can be by whether being wrapped in global object Whether send method is possessed in object containing WebSocket and WebSocket objects to judge whether to support Websocket.
Step S3, management server establish WebSocket services when starting, when receiving user's request, according to user The IP address of connection and chartered test node, filter out optimal test node information and return to user.
Step S4, after the information of management server return is received, automatically select node and carry out polytype network speed Test, and return to test data to management server.
In this step, when receive management server return information after, using automatically select suitable node or manually Select other available nodes that test the speed.By selecting most suitable node, polytype network speed test is carried out, including:Delay is surveyed Examination, uploading rate test and downloading rate test.
In one embodiment of the invention, as shown in figure 3, automatically selecting node, comprise the following steps:The management clothes Business device return test node group in contain multiple test nodes, after obtaining test node group to every in test node group One node carries out delayed test, the minimum test node of query latency, as the result for automatically selecting suitable node.
It should be noted that the type for the network speed test that the present invention supports is not limited to above-mentioned three kinds, other can also be supported Network speed test-types, will not be repeated here.
Network speed method of testing based on WebSocket according to embodiments of the present invention, established by WebSocket with testing the speed The connection of node server, quantitative data is sent to calculate transmission rate, realize the unified realization of multi-platform speed-measuring method.This hair Bright connected using WebSocket to server sends a certain amount of data, and device to be serviced completes that transmission speed is calculated after receiving Rate, it is not necessary to do any configuration in a user device or install any software, i.e., network speed is tested without using additional software, in PC Realize that network tests the speed in the case of zero installation zero configuration in machine and mobile device, unnecessary file will not be produced, to client without Influence.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not Necessarily refer to identical embodiment or example.Moreover, specific features, structure, material or the feature of description can be any One or more embodiments or example in combine in an appropriate manner.
Although embodiments of the invention have been shown and described above, it is to be understood that above-described embodiment is example Property, it is impossible to limitation of the present invention is interpreted as, one of ordinary skill in the art is not departing from the principle and objective of the present invention In the case of above-described embodiment can be changed within the scope of the invention, change, replace and modification.The scope of the present invention By appended claims and its equivalent limit.

Claims (5)

  1. A kind of 1. method of the network speed test based on WebSocket, it is characterised in that comprise the following steps:
    Step S1, during test node startup of server, the section for establishing service of testing the speed is sent to management server by WebSocket Point IP address and port, register test node on the management server;
    Step S2, when detecting user's opening network speed test page, by the javascript scripts in the network speed test page Whether detection browser supports WebSocket, and the passage to the management server is established if supporting, and to the service Device sends local user identification information;Prompt message is sent if not supporting;
    Step S3, management server establish WebSocket services when starting, will be chartered when receiving user's request Test node information returns to user;
    Step S4, after the information that the management server returns is received, automatically select node and carry out polytype network speed Test, and report test data to the management server.
  2. 2. the method for the network speed test based on WebSocket as claimed in claim 1, it is characterised in that in the step S4 In, most suitable node is selected, carries out polytype network speed test, including:Delayed test, uploading rate test and download speed Rate is tested.
  3. 3. the method for the network speed test based on WebSocket as claimed in claim 1, it is characterised in that in the step S4 In, it is available using automatically selecting suitable node or manually selecting other after the information that the management server returns is received Test the speed node.
  4. 4. the method for the network speed test based on WebSocket as claimed in claim 1, it is characterised in that in the step S2 In, judge whether to support WebSocket by following methods:By whether including WebSocket objects in global object, and Whether send method is possessed in WebSocket objects to judge whether to support Websocket.
  5. 5. the method for the network speed test based on WebSocket as claimed in claim 1, it is characterised in that in the step S4 In, it is described to automatically select node, comprise the following steps:Contain multiple tests in the test node group that the management server returns Node, delayed test is being carried out after obtaining test node group to each node in test node group, query latency is minimum Test node, as the result for automatically selecting suitable node.
CN201711148916.1A 2017-11-17 2017-11-17 A kind of method of the network speed test based on WebSocket Pending CN107682234A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711148916.1A CN107682234A (en) 2017-11-17 2017-11-17 A kind of method of the network speed test based on WebSocket

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711148916.1A CN107682234A (en) 2017-11-17 2017-11-17 A kind of method of the network speed test based on WebSocket

Publications (1)

Publication Number Publication Date
CN107682234A true CN107682234A (en) 2018-02-09

Family

ID=61150048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711148916.1A Pending CN107682234A (en) 2017-11-17 2017-11-17 A kind of method of the network speed test based on WebSocket

Country Status (1)

Country Link
CN (1) CN107682234A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112648783A (en) * 2019-10-10 2021-04-13 中车石家庄车辆有限公司 Method and device for determining cooling capacity per unit time and computer equipment
CN113836025A (en) * 2021-09-28 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Page testing method and device, storage medium and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150180963A1 (en) * 2012-08-19 2015-06-25 Box, Inc. Enhancement of upload and/or download performance based on client and/or server feedback information

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150180963A1 (en) * 2012-08-19 2015-06-25 Box, Inc. Enhancement of upload and/or download performance based on client and/or server feedback information

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IRE王一喆: "speedtest-cli测试网速", 《CSDN博客,HTTPS://BLOG.CSDN.NET/IREWYZ/ARTICLE/DETAILS/76033026》 *
一夏末: "测速网站speedtest开始放弃Flash转投HTML5", 《NEWS.YESKY.COM/WDSD/447/99198947.SHTML》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112648783A (en) * 2019-10-10 2021-04-13 中车石家庄车辆有限公司 Method and device for determining cooling capacity per unit time and computer equipment
CN113836025A (en) * 2021-09-28 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Page testing method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US11870673B2 (en) Intercepting and examining a packet header or trailer
CN105577777B (en) message processing method, device and system
CN103257989B (en) Web page download time is analyzed
CN107409071B (en) Method for obtaining diagnosis test result, control module and computer readable storage medium
CN103117907B (en) The method and system of server is accelerated in network speed method of testing and system, selection
CN108132814A (en) Page loading method, device, computer equipment and the storage medium of application program
US20150358225A1 (en) Method and System For Testing a Broadband Internet Bandwidth
CN104994037A (en) Automatic distributing system and distributing method for bandwidth
CN105794175B (en) Convey the performance metric of the system of WEB content
CN108390955A (en) Domain Name acquisition method, Website access method and server
CN103200231B (en) Policy control method and system
CN105681124B (en) A kind of wire-speed detection method and device
CN107682234A (en) A kind of method of the network speed test based on WebSocket
Dabrowski et al. Browser history stealing with captive Wi-Fi portals
CN105634849A (en) Dial measuring method and apparatus for data traffic unified payment services
CN107426746A (en) The method and apparatus for identifying WIFI types
CN107807830A (en) Medical software update method and server based on cluster
CN110120971A (en) A kind of gray scale dissemination method, device and electronic equipment
CN108259207A (en) Flow statistical method, client, server and system
CN106776323A (en) Application testing method and device
CN106301977A (en) The method and device that network tests the speed
CN106302029A (en) Network speed-measuring method based on wireless router
CN106484720A (en) The method and apparatus that the effectiveness of URL is promoted in a kind of detection
CN103916681A (en) Streaming media content playing method, device and system
WO2016011831A1 (en) Charging method and device, access device, and service quality control method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180209