Network quality measurement method and system
Through WebRTC technology, signaling connections and data channels are established in web pages, and network bandwidth, packet loss rate and delay are calculated, which solves the problem that the existing technology cannot easily measure network quality and achieves fast and convenient network quality measurement.
Patent Information
- Application Number
- PCT/CN2024/116077
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-11
- Filing Date
- 2024-08-30
- Publication Date
- 2025-03-20
AI Technical Summary
The prior art cannot simultaneously measure the bandwidth, latency and packet loss rate of the network through web pages.
Through WebRTC technology, signaling connections and WebRTC data channels are established in web pages, and the specified data packets are requested from the measurement server, and the network bandwidth, packet loss rate and delay are calculated by calculating the size, number and transmission time of these data packets.
It realizes rapid and efficient measurement of network bandwidth, latency and packet loss rates in web pages, avoids the requirements of installing special measurement tools and having professional knowledge, and improves network quality diagnostic efficiency.
Smart Images

Figure CN2024116077_20032025_PF_FP_ABST
Abstract
Description
Network quality measurement method and system Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a network quality measurement method and system. Background Art
[0002] With the widespread popularity of Internet services, the requirements for Internet service quality are becoming increasingly higher. How to quickly diagnose the network quality between users and the computer room where the Internet service is located is crucial to improving the quality of Internet services.
[0003] Currently, common methods for measuring network quality include direct measurement on web pages and using proprietary tools. These methods measure user uplink and downlink bandwidth by transmitting uplink and downlink data via HTTP or HTTPS protocols on web pages. This method only measures bandwidth, not latency or packet loss.
[0004] Proprietary measurement tools, such as the open-source program iperf3, require installation and operation of the server on an internet server, followed by installation and operation of the client on the user's terminal device. Data transmission between the client and server can be used to measure network quality indicators such as bandwidth and packet loss between the user and the server. This method requires installation of a dedicated measurement tool on the terminal device, making it inconvenient and requiring specialized knowledge to use correctly. Furthermore, it does not support latency measurement.
[0005] In addition, when using WebRTC (Web Real-Time Communication) on a web page to transmit audio and video streams and collect the actual bandwidth, latency, and packet loss rate of the audio and video streams, the corresponding audio and video materials must be prepared in advance on the server side. This method can only measure the target bandwidth consistent with the bit rate of the audio and video materials themselves, and cannot measure any target bandwidth. Summary of the Invention
[0006] The present invention aims to provide a web-based network quality measurement method and system to address the existing technical problem of being unable to conveniently and quickly measure network bandwidth, latency, and packet loss rate directly through a web page. The various technical effects achieved by the preferred technical solutions provided by the present invention are detailed below.
[0007] To achieve the above objectives, the present invention provides the following technical solutions:
[0008] The present invention provides a network quality measurement method, comprising the following steps:
[0009] The user terminal loads a measurement webpage, establishes a signaling connection with the measurement server through the measurement webpage, and performs WebRTC connection negotiation through the signaling connection to form a WebRTC data channel; requests a specified data packet from the measurement server through the measurement webpage; calculates network quality indicators through the measurement webpage based on the specified data packet, including calculating the network bandwidth based on the size and number of the received specified data packets and the set speed measurement duration, calculating the packet loss rate based on the total amount of the requested specified data packets and the number of received specified data packets, and calculating the network delay based on the time of sending the request for the specified data packet and the time of receiving the request response; and outputs the calculated network quality indicators through the measurement webpage.
[0010] Furthermore, after the measurement webpage and the measurement server perform WebRTC connection negotiation to form a WebRTC data channel through a signaling connection, the method further includes:
[0011] The properties of the WebRTC data channel are set to out-of-order and no-retransmission.
[0012] Furthermore, before requesting a specified data packet from the measurement server through the measurement webpage, the method further includes:
[0013] The measurement server is notified by signaling to start network quality measurement; the data packet sending rate, speed test duration, the total number of specified data packets sent and the size of specified data packets are set through the measurement webpage; the set data packet sending rate, speed test duration, the total number of specified data packets sent and the size of specified data packets are transmitted to the measurement server through the measurement webpage.
[0014] Furthermore, the calculating of the network bandwidth according to the size and quantity of the received specified data packets and the set speed measurement duration comprises the following steps:
[0015] Receive and count the number and size of the specified data packets sent by the measurement server from the WebRTC data channel, and calculate the network bandwidth according to the following method:
[0016] Network bandwidth = (number of received specified data packets × size of received specified data packets) / speed test duration.
[0017] Furthermore, the calculating of the packet loss rate according to the total amount of the requested specified data packets and the number of received specified data packets comprises the following steps:
[0018] Receive and count the number and size of the specified data packets sent by the measurement server from the WebRTC data channel, and calculate the packet loss rate according to the following method:
[0019] Packet loss rate = (total number of specified data packets sent - number of specified data packets received) / total number of specified data packets sent.
[0020] Furthermore, the instruction for measuring the network delay includes a detection instruction for detecting a network data packet and a response instruction for responding to the detection instruction; the detection instruction and the response instruction are both sent through the WebRTC data channel.
[0021] Furthermore, measuring the network delay according to the detection instruction and the response instruction includes the following steps:
[0022] The loaded measurement webpage informs the measurement server of its actual external network address through the WebSocket protocol; within the set speed measurement duration, the measurement webpage sends the detection instruction to the measurement server, and after the measurement server receives the detection instruction, it sends the response instruction to the measurement webpage, and so on until the set speed measurement duration ends.
[0023] Furthermore, the instructions for measuring the network bandwidth and packet loss rate include thread request instructions and data request instructions; during the measurement process, the thread request instruction is used to request the creation of a measurement thread, and the data request instruction is used to request load data to fill the bandwidth; the thread request instruction is sent through the WebSocket protocol, and the data request instruction is sent through the WebRTC data channel.
[0024] Furthermore, the step of measuring the network bandwidth and packet loss rate according to the thread request instruction and the data request instruction includes:
[0025] The loaded measurement webpage informs the measurement server of its actual external network address through the WebSocket protocol; the measurement webpage sends the thread request instruction to the measurement server; after receiving the thread request instruction, the measurement server creates a measurement thread; after creating the measurement thread, the measurement server sends the data request instruction to the measurement webpage, and stops sending the data request instruction when the set speed measurement time ends.
[0026] According to another aspect of the present invention, a network quality measurement system is also provided, which is based on the above-mentioned network quality measurement method and includes a measurement webpage and a measurement service module set up on the measurement server; a user terminal loads the corresponding measurement webpage from the measurement server by opening the measurement address in a browser; the measurement webpage includes an input / output module and a measurement terminal module; after the user terminal loads the measurement webpage, the measurement terminal module establishes a signaling connection with the measurement server through the measurement webpage, and performs WebRTC connection negotiation through the signaling connection to form a WebRTC data channel; the input / output module is used to input specified parameters before network quality measurement, the measurement terminal module uses the input specified parameters to obtain specified data packets from the measurement service module, and calculates network quality indicators based on the obtained specified data packets, and the calculated network quality indicators are output through the input / output module; the network quality indicators include network bandwidth, packet loss rate and network delay.
[0027] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects:
[0028] This method leverages the real-time communication capabilities of WebRTC and uses WebRTC data channel configuration to quickly and effectively measure network bandwidth, latency, and packet loss within a webpage. Furthermore, network quality can be measured without installing dedicated measurement tools on terminal devices, and users do not need specialized knowledge. Therefore, this method and system are easy to use and can significantly improve the efficiency of diagnosing network quality issues. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive work. In the drawings:
[0030] FIG1 is a schematic diagram of an application scenario of an embodiment of the present invention;
[0031] FIG2 is a flow chart of a network quality measurement method according to an embodiment of the present invention;
[0032] FIG3 is a flowchart of a WebRTC connection negotiation according to an embodiment of the present invention;
[0033] FIG4 is a flow chart of instruction creation and transmission according to an embodiment of the present invention;
[0034] FIG5 is a schematic diagram of a webpage measurement display interface according to an embodiment of the present invention;
[0035] FIG6 is a schematic diagram of the functional architecture of the measurement method according to an embodiment of the present invention;
[0036] FIG7 is a schematic diagram of a network quality measurement system according to an embodiment of the present invention.
[0037] 1. User terminal; 2. Measurement webpage; 21. Input and output module; 22. Measurement terminal module; 3. Measurement server; 31. Measurement service module. DETAILED DESCRIPTION
[0038] In order to make the objects, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, in which various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods and devices that are consistent with some aspects of the present disclosure as detailed in the appended claims, and other embodiments may also be used, or structural and functional modifications may be made to the embodiments listed herein without departing from the scope and essence of the present invention.
[0039] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse" and the like indicate the orientation or positional relationship based on the figures, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the elements referred to must have a specific orientation, be constructed and operated in a specific orientation. The terms "first", "second" and the like are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "multiple" means two or more. The terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0040] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below, in which only the parts related to the embodiment of the present invention are shown.
[0041] Example 1:
[0042] A network quality measurement method provided by the present invention can be applied to the application scenario shown in Figure 1. In Figure 1, a user terminal 1 can communicate with multiple measurement servers 3. Each measurement server 3 has a built-in measurement webpage, as well as a signaling service and a measurement service for network quality measurement. The signaling service is used for signaling interaction with the user terminal 1, and the measurement service is used for data packet interaction with the user terminal 1. The user first needs to load the corresponding measurement webpage 2 from the measurement server 3 communicating with the user terminal through the user terminal. The loaded measurement webpage 2 will establish connections with the signaling service and measurement service of the corresponding measurement server 3, respectively, and then implement the network quality measurement method of this embodiment solely through the loaded measurement webpage 2. The network quality measurements of this embodiment include, but are not limited to, network bandwidth, packet loss rate, and network latency.
[0043] It should be noted that the user terminal 1 in this embodiment can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the measurement server 3 can be a server independently set up in different computer rooms (such as computer room A, computer room B, ..., computer room N), or a server cluster consisting of multiple servers, or a cloud server, etc.
[0044] As shown in FIG2 , this embodiment provides a network quality measurement method, including the following steps:
[0045] S100: The user terminal loads a measurement webpage, establishes a signaling connection with a measurement server through the measurement webpage, and performs WebRTC connection negotiation through the signaling connection to form a WebRTC data channel.
[0046] In one example, a user opens a measurement address in a browser on a terminal device and loads the corresponding measurement webpage. If the measurement webpage address is the IP address of the measurement server, this IP address is by default the same as the IP address of the measurement webpage. This allows the user to quickly open the measurement address without having to search the network to obtain the IP address of the corresponding measurement webpage.
[0047] As an optional implementation, step S100 includes the following steps:
[0048] Establish a signaling connection with the measurement server through the http, https or WebSocket protocol, and negotiate a WebRTC connection through the signaling connection; establish a WebRTC signaling channel and a WebRTC data channel with the measurement server.
[0049] WebRTC (Web Real-Time Communications) is a real-time communication technology that allows web applications or websites to establish peer-to-peer connections between browsers without the need for an intermediary, enabling the transmission of video and / or audio streams, or any other arbitrary data. The standards included in WebRTC enable peer-to-peer data sharing and conference calls without the need to install any plugins or third-party software.
[0050] As shown in Figure 3, in one example, WebRTC connection negotiation uses the standard WebRTC process and exchanges SDP (Session Description Protocol) and IceCandidate over a WebSocket connection. IceCandidate is a candidate for the Interactive Connectivity Establishment (ICE) protocol. The steps for WebRTC connection negotiation include the following:
[0051] The steps of connecting a measurement webpage to a measurement server include: creating a peer connection (Create PeerConnection); creating a WebRTC data channel (WebRTC DataChannel), and setting the properties of the WebRTC data channel to unordered and non-retransmission; establishing a connection (signaling channel and data channel connection) with the measurement server corresponding to the measurement webpage through the above-mentioned protocol (such as the WebSocket protocol); after creating a peer connection (Create PeerConnection) with the corresponding measurement server, setting the local session protocol description (setLocalDescription) and sending the local session protocol description to the measurement server peer; receiving the remote session protocol description sent by the measurement server peer; setting the remote session description and sending ICE protocol candidates to the measurement server peer; receiving and adding the ICE protocol candidates sent by the measurement server peer, and the WebRTC connection negotiation is completed;
[0052] The steps of connecting the measurement server to the measurement webpage include: creating a peer connection (Create PeerConnection) after connecting to the measurement webpage channel; setting a remote session protocol description after receiving a local session protocol description sent by the measurement webpage and sending it to the measurement webpage; and adding an ICE protocol candidate after receiving an ICE protocol candidate sent by the measurement webpage and sending the ICE protocol candidate to the measurement webpage.
[0053] It should be noted that the above-mentioned receiving and sending can be achieved through protocols such as WebSocket.
[0054] It's important to note that WebSocket is a full-duplex communication protocol over a single TCP connection. WebSocket simplifies data exchange between clients and servers, allowing the server to proactively push data to the client. With the WebSocket API, the browser and server only need to complete a single handshake to establish a persistent connection and enable bidirectional data transfer.
[0055] Furthermore, after the measurement webpage and the measurement server establish a WebRTC data channel through a signaling connection through WebRTC connection negotiation, the method further includes: setting the properties of the WebRTC data channel to be unordered and non-retransmitted. Specifically, the API call is as follows:
[0056] / / Create a WebRTC connection;
[0057] pc = new RTCPeerConnection();
[0058] / / Create a WebRTC DataChannel data channel;
[0059] dc = pc.createDataChannel('Speed Test', { ordered: false, / / Arrival order is not guaranteed;
[0060] maxRetransmits: 0, / / no retransmission;
[0061] });
[0062] It should be noted that the above setting sets the data channel attributes to "out of order" and "no retransmission." In reality, data packets may be dropped during network transmission for various reasons. One solution is to retransmit these dropped packets. Therefore, when measuring network quality, it is necessary to set the data channel attribute to "no retransmission." This setting ensures that network quality testing meets measurement requirements and improves measurement accuracy and efficiency.
[0063] S200: Requesting a specified data packet from a measurement server via a measurement webpage, wherein the specified data packet includes a total amount of the specified data packet to be sent and a size of the data packet.
[0064] In one example, before requesting a specified data packet from a measurement server through a measurement webpage, the method further includes:
[0065] Notify the measurement server to start network quality measurement through signaling;
[0066] Set the data packet sending rate, speed test duration, the total number of specified data packets sent, and the specified data packet size through the measurement webpage;
[0067] The set data packet sending rate, speed test duration, the specified total number of data packets sent, and the specified data packet size are transmitted to the measurement server through the measurement webpage.
[0068] S300: Calculate network quality indicators based on the specified data packets by measuring the web page. This includes calculating network bandwidth based on the size and number of received specified data packets and the set speed measurement duration; calculating packet loss rate based on the total number of requested specified data packets and the number of received specified data packets; and calculating network latency based on the time it takes to send the requested data packets and the time it takes to receive the response to the request.
[0069] In one example, calculating network bandwidth based on the size and number of received specified data packets and a set speed measurement duration includes the following steps:
[0070] Receives and measures the number and size of specified data packets sent by the server from the WebRTC data channel, and calculates the network bandwidth according to the following method:
[0071] Network bandwidth = (number of received specified data packets × size of received specified data packets) / speed test duration.
[0072] In one example, calculating the packet loss rate based on the total number of requested data packets and the number of received data packets includes the following steps:
[0073] Receives and measures the number and size of specified data packets sent by the server from the WebRTC data channel, and calculates the packet loss rate according to the following method:
[0074] Packet loss rate = (total number of specified data packets sent - number of specified data packets received) / total number of specified data packets sent.
[0075] In one example, calculating the network delay based on the time of sending a data packet specified by a request and the time of receiving a response to the request includes the following steps:
[0076] The measurement webpage sends a delay measurement request packet to the measurement server through the WebRTC data channel, and the request packet carries the timestamp of the sending time;
[0077] After receiving the delay measurement request packet, the measurement server immediately replies with a delay measurement response packet, and sends back the timestamp in the delay measurement request packet intact in the delay measurement response packet;
[0078] The delay measurement response packet replied by the measurement server is received, and the difference between the time when the delay measurement response packet is received and the timestamp in the received delay measurement response packet is used as the network delay.
[0079] As an implementation, the instructions for measuring network latency include a probe instruction (PerfPing instruction) for detecting network data packets and a response instruction (PerfPong instruction) for responding to the probe instruction. Both the probe instruction and the response instruction are sent via the WebRTC data channel. Furthermore, the instructions for measuring network bandwidth and packet loss rate include a thread request instruction (PerfStart instruction) and a data request instruction (PerfData instruction). During the measurement process, the thread request instruction is used to request the creation of a measurement thread, while the data request instruction is used to request payload data to fill the bandwidth. The thread request instruction is sent via the WebSocket protocol, while the data request instruction is sent via the WebRTC data channel.
[0080] As shown in FIG5 , in one example, the steps for measuring network delay, network bandwidth, and packet loss rate using the above instructions are as follows:
[0081] Initialization is required. This means that the loaded measurement webpage communicates its actual public IP address to the measurement server via the WebSocket protocol. Note that the measurement server is typically behind a gateway and therefore doesn't know the specific public IP address of each connection. Therefore, the actual public IP address must be communicated during initialization.
[0082] When measuring network latency, the webpage being measured (loaded) sends a probe command (PerfPing command) to the measurement server within the set test duration. Upon receiving the probe command, the measurement server sends a response command (PerfPong command) to the webpage being measured (loaded). This cycle continues until the set test duration ends. Both the probe command and the response command are sent over the WebRTC data channel.
[0083] When measuring network bandwidth and packet loss rate, the measurement webpage (loaded) sends a thread request instruction (PerfStart instruction) to the measurement server, such as sending this instruction through the WebSocket protocol; after receiving the thread request instruction, the measurement server creates a measurement thread; after creating the measurement thread, the measurement server sends a data request instruction (PerfData instruction) to the loaded measurement webpage through the WebRTC data channel, and stops sending data request instructions when the set speed measurement duration ends.
[0084] S400: Output the calculated network quality index via a measurement webpage.
[0085] Figure 5 shows a trend chart generated from the measurement web interface's statistical output, visually illustrating the measurement results for network bandwidth, packet loss rate, and network latency. The network latency in the chart is expressed in milliseconds (RTT). Table 1 provides a tabular output from the measurement web interface, showing the measurement results for network bandwidth, packet loss rate, and network latency per time interval. This output makes the results easily accessible to users, enabling quick and easy speed testing without requiring specialized knowledge, while also providing a rich display experience.
[0086] Table 1 Network quality measurement statistics
[0087]
[0088] As shown in Figure 6, the network quality method of this embodiment uses network data in kernel space to measure network bandwidth, packet loss rate, and network latency in user space. It also supports simulation of various network scenarios and supports simulating specific network characteristics at the application layer. Therefore, measurement capabilities are not limited to network bandwidth, packet loss rate, and network latency.
[0089] In summary, this embodiment uses WebRTC technology to measure network quality, enabling rapid and effective measurement of network bandwidth, latency, packet loss rate, and network scenario simulation using only a webpage. This eliminates the need to install dedicated measurement tools on terminal devices, and users can measure network quality without requiring specialized knowledge. This method is easy to use and can significantly improve the efficiency of diagnosing network quality issues.
[0090] Example 2:
[0091] As shown in FIG7 , this embodiment further provides a network quality measurement system, which is based on the network quality measurement method described in the first embodiment and includes a measurement webpage 2 and a measurement service module 31 provided on a measurement server 3 ; a user terminal loads the corresponding measurement webpage 2 from the measurement server 3 by opening the measurement address in a browser.
[0092] As an optional embodiment, the measurement webpage 2 includes an input / output module 21 and a measurement terminal module 22. After the user terminal loads the measurement webpage 2, the measurement terminal module 22 establishes a signaling connection with the measurement server 3 via the measurement webpage 2. This signaling connection negotiates a WebRTC connection to form a WebRTC data channel. Specifically, the measurement terminal module 22 establishes a signaling transmission channel with the measurement service module 31 via the HTTP, HTTPS, or WebSocket protocol, and a data transmission channel with the measurement service module 31 via the WebRTC data channel. The input / output module 21 is configured to input specified parameters (such as speed measurement duration, expected bandwidth, and measurement server IP address (which defaults to the same as the measurement webpage IP address)) before network quality measurement. The measurement terminal module 22 uses these parameters to retrieve specified data packets from the measurement service module 31 and calculates network quality metrics based on the retrieved data packets. The calculated network quality metrics, including network bandwidth, packet loss rate, and network latency, are then output via the input / output module 21. It should be noted that the measurement server 3 has a built-in measurement webpage, and the user terminal can load the measurement webpage 2 from the measurement server 3 .
[0093] More specifically, user terminals, such as computers, tablets, and mobile phones, communicate with multiple measurement servers 3. In practice, measurement servers 3 are typically located in different computer rooms, such as computer room A, computer room B, ..., and computer room N. Users load the corresponding measurement page from the corresponding measurement server 3 through these terminals and monitor or measure network quality for different measurement servers 3 using WebSocket signaling and WebSocket measurement services.
[0094] In summary, this system enables users to quickly and conveniently obtain network quality measurement results through web pages, improving the user's Internet experience.
[0095] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the processes of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0096] The foregoing is merely a preferred embodiment of the present invention. Those skilled in the art will appreciate that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. Furthermore, under the guidance of the present invention, these features and embodiments may be modified to suit specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be within the scope of the present invention.
Claims
1. A network quality measurement method, characterized in that: The steps include: The user terminal loads the measurement webpage, establishes a signaling connection with the measurement server through the measurement webpage, and performs WebRTC connection negotiation through the signaling connection to form a WebRTC data channel; Requesting a specified data packet from the measurement server through the measurement webpage; Calculating the network quality index through the measurement webpage according to the specified data packet; including calculating the network bandwidth according to the size, quantity and set speed measurement duration of the received specified data packet, calculating the packet loss rate according to the total amount of the requested specified data packet and the number of the received specified data packet, and calculating the network delay according to the time of sending the requested specified data packet and the time of receiving the request response; The calculated network quality index is outputted through the measurement webpage.
2. A network quality measurement method according to claim 1, characterized in that: After the measurement webpage and the measurement server perform WebRTC connection negotiation through signaling connection to form a WebRTC data channel, the method further includes: The properties of the WebRTC data channel are set to unordered and no retransmission.
3. A network quality measurement method according to claim 1, characterized in that: Before requesting the specified data packet from the measurement server through the measurement webpage, the method further includes: Notify the measurement server to start network quality measurement through signaling; The sending rate of the data packets, the speed measurement duration, the total sending amount of the specified data packets and the size of the specified data packets are set through the measurement webpage; The set data packet sending rate, speed measurement duration, the specified total number of data packets sent and the specified data packet size are transmitted to the measurement server via the measurement webpage.
4. A network quality measurement method according to claim 1, characterized in that: The step of calculating the network bandwidth according to the size and quantity of the received specified data packets and the set speed measurement duration comprises the following steps: Receive and count the number and size of the specified data packets sent by the measurement server from the WebRTC data channel, and calculate the network bandwidth according to the following method: Network bandwidth = (number of received specified data packets × size of received specified data packets) / speed test duration.
5. A network quality measurement method according to claim 1, characterized in that: The step of calculating the packet loss rate according to the total amount of the specified data packets requested and the number of the specified data packets received comprises the following steps: Receive and count the number and size of the specified data packets sent by the measurement server from the WebRTC data channel, and calculate the packet loss rate according to the following method: Packet loss rate = (total number of specified data packets sent - number of specified data packets received) / total number of specified data packets sent.
6. A network quality measurement method according to claim 1, characterized in that: The instruction for measuring the network delay includes a detection instruction for detecting a network data packet and a response instruction for responding to the detection instruction; the detection instruction and the response instruction are both sent through the WebRTC data channel.
7. A network quality measurement method according to claim 6, characterized in that: Measuring the network delay according to the detection instruction and the response instruction comprises the following steps: The loaded measurement webpage informs the measurement server of the actual external network address of the measurement webpage through the WebSocket protocol; During the set speed measurement duration, the measurement webpage sends the detection instruction to the measurement server. After receiving the detection instruction, the measurement server sends the response instruction to the measurement webpage, and the response instructions are sent to each other in this way until the set speed measurement duration ends.
8. A network quality measurement method according to claim 1, characterized in that: The instructions for measuring the network bandwidth and packet loss rate include thread request instructions and data request instructions; during the measurement process, the thread request instruction is used to request the creation of a measurement thread, and the data request instruction is used to request load data that fills the bandwidth; The thread request instruction is sent through the WebSocket protocol, and the data request instruction is sent through the WebRTC data channel.
9. A network quality measurement method according to claim 8, characterized in that: The step of measuring the network bandwidth and the packet loss rate according to the thread request instruction and the data request instruction comprises: The loaded measurement webpage informs the measurement server of the actual external network address of the measurement webpage through the WebSocket protocol; The measurement webpage sends the thread request instruction to the measurement server; after receiving the thread request instruction, the measured server creates a measurement thread; after creating the measurement thread, the measurement server sends the data request instruction to the measurement webpage, and stops sending the data request instruction when the set speed measurement time ends.
10. A network quality measurement system, characterized in that: The network quality measurement method according to any one of claims 1 to 9 comprises a measurement webpage and a measurement service module arranged on the measurement server; the user terminal loads the corresponding measurement webpage from the measurement server by opening the measurement address in a browser; The measurement webpage includes an input and output module and a measurement terminal module; after the user terminal loads the measurement webpage, the measurement terminal module establishes a signaling connection with the measurement server through the measurement webpage, and performs WebRTC connection negotiation through the signaling connection to form a WebRTC data channel; The input-output module is used to input specified parameters before network quality measurement. The measurement terminal module uses the input specified parameters to obtain specified data packets from the measurement service module, and calculates network quality indicators through the obtained specified data packets. The calculated network quality indicators are output through the input-output module; the network quality indicators include network bandwidth, packet loss rate and network delay.
Citation Information
Patent Citations
Data processing method and device
CN109600766A
Method for switching multiple video streams based on webrtc
CN112437319A
Network bandwidth detection method and device, computer equipment and storage medium
CN115150283A
Bandwidth estimation method and device, equipment and storage medium
CN116248973A
Network quality measurement method and system
CN116896521A