CN111556345B - Network quality detection method and device, electronic equipment and storage medium - Google Patents
Network quality detection method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111556345B CN111556345B CN202010197843.0A CN202010197843A CN111556345B CN 111556345 B CN111556345 B CN 111556345B CN 202010197843 A CN202010197843 A CN 202010197843A CN 111556345 B CN111556345 B CN 111556345B
- Authority
- CN
- China
- Prior art keywords
- data packets
- time
- determining
- quality
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 22
- 230000005540 biological transmission Effects 0.000 claims abstract description 69
- 238000000034 method Methods 0.000 claims abstract description 53
- 238000009825 accumulation Methods 0.000 claims abstract description 4
- 230000003111 delayed effect Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 13
- 230000008859 change Effects 0.000 claims description 12
- 230000001186 cumulative effect Effects 0.000 claims description 7
- 230000035945 sensitivity Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 12
- 230000002159 abnormal effect Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000001934 delay Effects 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2402—Monitoring of the downstream path of the transmission network, e.g. bandwidth available
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/647—Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
- H04N21/64723—Monitoring of network processes or resources, e.g. monitoring of network load
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及互联网领域,特别是涉及一种网络质量检测的方法、装置、电子设备及可读存储介质。The invention relates to the Internet field, in particular to a method, device, electronic equipment and readable storage medium for network quality detection.
背景技术Background technique
目前在网络传输过程中,下行网络质量决定用户收看到的视频、音频是否流畅,画面质量是否够高,越高的网络质量可以使用越大的视频码率,图像质量也就可以越高。因此,为了及时根据网络质量进行调整,以使得用户欣赏到流畅且质量较好的音视频画面,对下行网络的质量检测至关重要。At present, in the process of network transmission, the quality of the downlink network determines whether the video and audio that users watch are smooth, and whether the picture quality is high enough. The higher the network quality, the higher the video bit rate can be used, and the higher the image quality can be. Therefore, in order to adjust according to the network quality in time so that users can enjoy smooth audio and video images with good quality, it is very important to detect the quality of the downlink network.
目前使用的检测下行网络质量的方法有多种,例如:基于0.2秒,0.5秒,1.0秒为单位统计下行网络的字节数,判断网络速率间接检测网络质量等,这些方法均存在弊端,需要统计间隔较长,统计间隔时间越长则越准确,但灵敏度则很低,反应迟钝,不能很及时的检测出网络质量,而缩短统计间隔时间,其间隔时间越短,由于数据包是离散发送的,则会导致统计数据越不准确,跳跃很大,也无法确定网络的实际质量。There are many methods for detecting the quality of the downlink network currently used, for example: counting the number of bytes in the downlink network based on 0.2 seconds, 0.5 seconds, and 1.0 seconds, and judging the network speed to indirectly detect the network quality. The statistical interval is longer, the longer the statistical interval, the more accurate, but the sensitivity is very low, the response is slow, and the network quality cannot be detected in time, and the shorter the statistical interval, the shorter the interval, because the data packets are sent discretely , it will lead to inaccurate statistical data, large jumps, and the inability to determine the actual quality of the network.
发明内容Contents of the invention
鉴于上述问题,提出了本发明实施例一种网络质量检测的方法、装置、电子设备及可读存储介质解决了以上问题。In view of the above problems, a network quality detection method, device, electronic device, and readable storage medium according to embodiments of the present invention are proposed to solve the above problems.
为了解决上述问题,本发明实施例公开了一种网络质量检测的方法,所述方法应用于接收端,所述方法包括:In order to solve the above problems, the embodiment of the present invention discloses a method for network quality detection, the method is applied to the receiving end, and the method includes:
在接收到来自于发送端的多个数据包时,确定所述多个数据包各自的接收时间和发送时间;When receiving multiple data packets from the sending end, determine the respective receiving time and sending time of the multiple data packets;
确定所述多个数据包的发送时间之间的发送时间差,并确定所述多个数据包的接收时间之间的接收时间差;determining a transmission time difference between transmission times of the plurality of data packets, and determining a reception time difference between reception times of the plurality of data packets;
根据所述接收时间差与所述发送时间差之间的差值,确定所述网络在传输所述多个数据包期间的质量。The quality of the network during transmission of the plurality of data packets is determined according to the difference between the receiving time difference and the sending time difference.
可选地,确定所述多个数据包的发送时间之间的发送时间差,并确定所述多个数据包的接收时间之间的接收时间差,包括:Optionally, determining the sending time difference between the sending times of the multiple data packets, and determining the receiving time difference between the receiving times of the multiple data packets includes:
将所述多个数据包中间隔预设数据包数量的每两个数据包划分为一组,得到多组数据包;Dividing every two data packets with a preset number of data packets among the plurality of data packets into one group to obtain multiple groups of data packets;
确定每一组数据包中较后接收到的数据包与较先接收到的数据包的发送时间差值;determining the difference in sending time between a later received data packet and an earlier received data packet in each group of data packets;
确定每一组数据包中较后接收到的数据包与较先接收到的数据包的接收时间差值。A difference in reception time between a later received data packet and an earlier received data packet in each group of data packets is determined.
可选地,根据所述接收时间差与所述发送时间差之间的差值,确定所述网络在传输所述多个数据包期间的质量,包括:Optionally, determining the quality of the network during transmission of the plurality of data packets according to the difference between the receiving time difference and the sending time difference includes:
根据每一组数据包的接收时间差值与发送时间差值,得到该组数据包对应的延迟时间;According to the receiving time difference and sending time difference of each group of data packets, the delay time corresponding to the group of data packets is obtained;
对所述多个数据包各自对应的延迟时间进行累计,确定累积延迟时间;Accumulating delay times corresponding to each of the plurality of data packets to determine the cumulative delay time;
根据所述累积延迟时间与预设阈值的大小关系,确定所述网络在传输所述多个数据包期间的质量。The quality of the network during transmission of the plurality of data packets is determined according to a magnitude relationship between the accumulated delay time and a preset threshold.
可选地,根据所述累积延迟时间与预设阈值的大小关系,确定所述网络在传输所述多个数据包期间的质量,包括:Optionally, determining the quality of the network during transmission of the plurality of data packets according to the relationship between the accumulated delay time and a preset threshold includes:
在所述累积延迟时间等于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的质量正常,使得所述接收端接收的所述多个数据包未发生延迟;When the accumulated delay time is equal to the preset threshold, it is determined that the quality of the network during the transmission of the plurality of data packets is normal, so that the plurality of data packets received by the receiving end are not delayed;
在所述累积延迟时间大于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的网络质量异常,使得所述接收端接收的所述多个数据包发生延迟。When the accumulated delay time is greater than the preset threshold, it is determined that the network quality of the network during transmission of the multiple data packets is abnormal, so that the multiple data packets received by the receiving end are delayed.
可选地,在所述累积延迟时间大于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的网络质量异常,包括:Optionally, in a case where the accumulated delay time is greater than the preset threshold, determining that the network quality of the network is abnormal during transmission of the plurality of data packets includes:
在所述累积延迟时间大于所述预设阈值的情况下,若所述累积延迟时间大于所述预设阈值且所述累积延迟时间随时间而变化的变化值小于或等于预设变化值,则确定所述网络在传输所述多个数据包期间的网络质量趋稳,且存在固定的延迟;In the case where the accumulated delay time is greater than the preset threshold, if the accumulated delay time is greater than the preset threshold and the change value of the accumulated delay time over time is less than or equal to the preset change value, then Determining that the network quality of the network during the transmission of the plurality of data packets is stable, and there is a fixed delay;
在所述累积延迟时间大于所述预设阈值的情况下,若所述累积延迟时间大于所述预设阈值且所述累积延迟时间随时间而变化的变化幅度大于所述预设变化值,则确定所述网络在传输所述多个数据包期间的网络质量变差,且不符合预设带宽需求。In the case where the accumulated delay time is greater than the preset threshold, if the accumulated delay time is greater than the preset threshold and the change range of the accumulated delay time over time is greater than the preset change value, then It is determined that the network quality of the network deteriorates during the transmission of the plurality of data packets, and does not meet the preset bandwidth requirement.
可选地,在确定所述网络在传输所述多个数据包期间的质量之后,所述方法还包括:Optionally, after determining the quality of the network during transmission of the plurality of data packets, the method further includes:
根据所述网络在传输所述多个数据包期间的质量,向所述发送端发送调整提示,以提示所述发送端调整单次发送给所述接收端的数据包的总数据量;和/或According to the quality of the network during the transmission of the plurality of data packets, an adjustment prompt is sent to the sending end, so as to prompt the sending end to adjust the total data volume of the data packets sent to the receiving end at a time; and/or
输出接收调整提示,以提示所述接收端的用户对单次接收的数据包的总数据量进行调整。Outputting a receiving adjustment prompt to prompt the user at the receiving end to adjust the total data volume of a single received data packet.
本发明实施例还提供了一种网络质量检测的装置,所述装置应用于接收端,所述装置包括:The embodiment of the present invention also provides a device for network quality detection, the device is applied to the receiving end, and the device includes:
确定时间模块,用于在接收到来自于发送端的多个数据包时,确定所述多个数据包各自的接收时间和发送时间;A time-determining module, configured to determine the respective receiving time and sending time of the multiple data packets when receiving multiple data packets from the sending end;
确定时间差模块,用于确定所述多个数据包的发送时间之间的发送时间差,并确定所述多个数据包的接收时间之间的接收时间差;Determining a time difference module, configured to determine the sending time difference between the sending times of the plurality of data packets, and determine the receiving time difference between the receiving times of the plurality of data packets;
确定质量模块,用于根据所述接收时间差与所述发送时间差之间的差值,确定所述网络在传输所述多个数据包期间的质量。A quality determining module, configured to determine the quality of the network during transmission of the plurality of data packets according to the difference between the receiving time difference and the sending time difference.
可选地,所述确定时间差模块包括:Optionally, the module for determining the time difference includes:
划分组子模块,用于将所述多个数据包中间隔预设数据包数量的每两个数据包划分为一组,得到多组数据包;The division group sub-module is used to divide every two data packets with a preset number of data packets in the plurality of data packets into one group to obtain multiple groups of data packets;
确定发送时间差子模块,用于确定每一组数据包中较后接收到的数据包与较先接收到的数据包的发送时间差值;Determine the sending time difference submodule, which is used to determine the sending time difference between the data packet received later and the data packet received earlier in each group of data packets;
确定接收时间差子模块,用于确定每一组数据包中较后接收到的数据包与较先接收到的数据包的接收时间差值。The submodule of determining the receiving time difference is used to determine the receiving time difference between the later received data packet and the earlier received data packet in each group of data packets.
可选地,所述确定质量模块包括:Optionally, the quality determination module includes:
延迟时间子模块,用于根据每一组数据包的接收时间差值与发送时间差值,得到该组数据包对应的延迟时间;The delay time sub-module is used to obtain the delay time corresponding to the group of data packets according to the receiving time difference and the sending time difference of each group of data packets;
累计子模块,用于对所述多个数据包各自对应的延迟时间进行累计,确定累积延迟时间;an accumulating submodule, configured to accumulate the delay times corresponding to each of the plurality of data packets, and determine the accumulated delay time;
确定质量子模块,用于根据所述累积延迟时间与预设阈值的大小关系,确定所述网络在传输所述多个数据包期间的质量。The determining quality submodule is configured to determine the quality of the network during the transmission of the plurality of data packets according to the magnitude relationship between the accumulated delay time and a preset threshold.
可选地,所述确定质量子模块具体用于:Optionally, the determining quality submodule is specifically used for:
在所述累积延迟时间等于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的质量正常,使得所述接收端接收的所述多个数据包未发生延迟;When the accumulated delay time is equal to the preset threshold, it is determined that the quality of the network during the transmission of the plurality of data packets is normal, so that the plurality of data packets received by the receiving end are not delayed;
在所述累积延迟时间大于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的网络质量异常,使得所述接收端接收的所述多个数据包发生延迟。When the accumulated delay time is greater than the preset threshold, it is determined that the network quality of the network during transmission of the multiple data packets is abnormal, so that the multiple data packets received by the receiving end are delayed.
可选地,所述装置还包括:调整提示模块,具体用于:Optionally, the device further includes: an adjustment prompt module, specifically used for:
根据所述网络在传输所述多个数据包期间的质量,向所述发送端发送调整提示,以提示所述发送端调整单次发送给所述接收端的数据包的总数据量;和/或According to the quality of the network during the transmission of the plurality of data packets, an adjustment prompt is sent to the sending end, so as to prompt the sending end to adjust the total data volume of the data packets sent to the receiving end at a time; and/or
输出接收调整提示,以提示所述接收端的用户对单次接收的数据包的总数据量进行调整。Outputting a receiving adjustment prompt to prompt the user at the receiving end to adjust the total data volume of a single received data packet.
本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明以上所述的方法中的步骤。An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps in the method described above in the present invention are implemented.
本发明实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行时实现本发明以上所述的方法中的步骤。An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. The processor implements the steps in the above-mentioned method of the present invention when executed.
采用本发明提供的网络质量检测的方法,在接收到来自于发送端的多个数据包时,确定多个数据包各自的接收时间和发送时间;确定多个数据包的发送时间之间的发送时间差以及接收时间之间的接收时间差;根据接收时间差与发送时间差之间的差值,确定网络在传输多个数据包期间的质量。本发明的方案,只考虑时间差值因素,与目前传统的检测网络质量的方法:基于一定时间段内统计下行网络的字节数,或者判断网络速率间接检测网络质量完全不同,且由于只需根据接收时间和发送时间进行简单的差值、累计等运算,不需要复杂的运算,更不需要数量庞大的变量采集,具有较高的检测灵敏度,可以快速、简洁的检测出网络质量的状况,具有极高的可扩展性。Using the method for network quality detection provided by the present invention, when receiving multiple data packets from the sending end, determine the respective receiving time and sending time of the multiple data packets; determine the sending time difference between the sending times of the multiple data packets and the receive time difference between the receive times; based on the difference between the receive time difference and the send time difference, determine the quality of the network during the transmission of multiple packets. The solution of the present invention only considers the time difference factor, which is completely different from the current traditional method of detecting network quality: based on counting the number of bytes of the downlink network within a certain period of time, or judging the network speed to indirectly detect the network quality, and because only Simple calculations such as difference and accumulation are performed according to the receiving time and sending time, which do not require complex calculations, let alone a large number of variable collections, have high detection sensitivity, and can quickly and concisely detect the status of network quality. It is extremely scalable.
附图说明Description of drawings
图1是本发明实施例的一种网络质量检测的方法的流程图;FIG. 1 is a flowchart of a method for network quality detection according to an embodiment of the present invention;
图2是本发明实施例基于下行网络发送端和接收端实现网络质量检测的方法的示意图;FIG. 2 is a schematic diagram of a method for realizing network quality detection based on a downlink network sending end and a receiving end according to an embodiment of the present invention;
图3是本发明实施例一种网络质量检测的装置的框图;FIG. 3 is a block diagram of an apparatus for network quality detection according to an embodiment of the present invention;
图4是本发明实施例中网络质量检测的整体流程框架图。Fig. 4 is a frame diagram of the overall flow of network quality detection in the embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
参照图1,示出了本发明实施例一种网络质量检测的方法的流程图,该方法应用于接收端,网络质量检测的方法包括如下步骤:Referring to FIG. 1 , it shows a flowchart of a method for network quality detection in an embodiment of the present invention, the method is applied to a receiving end, and the method for network quality detection includes the following steps:
步骤101:在接收到来自于发送端的多个数据包时,确定多个数据包各自的接收时间和发送时间。Step 101: When receiving multiple data packets from the sending end, determine the respective receiving time and sending time of the multiple data packets.
本发明实施例中,一般情况下,在通常的网络中传输音视频数据时,为了最大化的节省网络流量,均按照特定的编码器进行压缩编码,再通过网络传输到对端进行解码播放,传输过程中一般需要分包发送。例如:常用视频编码格式H264、H265;音频编码格式PCM、AAC等,传输格式则可能是PS、PES、TS或者自定义打包格式,无论哪种打包格式,一般每个传输封包都包含包头、负载数据两部分,包头中包含音视频类型、格式、时间戳等附加信息,负载数据则包含音视频编码数据。In the embodiment of the present invention, in general, when transmitting audio and video data in a normal network, in order to maximize the saving of network traffic, compression and encoding are performed according to a specific encoder, and then transmitted to the peer end through the network for decoding and playback. During the transmission process, it is generally necessary to send packets in packets. For example: commonly used video encoding formats H264, H265; audio encoding formats PCM, AAC, etc., the transmission format may be PS, PES, TS or custom packaging format, no matter which packaging format, generally each transmission packet contains a header, payload There are two parts to the data. The header contains additional information such as audio and video type, format, and timestamp, and the payload data contains audio and video encoding data.
目前在网络传输过程中,下行网络质量决定用户收看到的视频、音频是否流畅,画面质量是否够高,越高的网络质量可以使用越大的视频码率,图像质量也就可以越高。在下行网络中,音视频数据均通过网络从对端传输到本端,其中,网络中的对端即为发送端,用于发送音视频数据包,而本端即为接收端,用于接收音视频数据包,之后将接收到的音视频数据包转发给后端设备进行处理,播放展示给用户,网络质量的越高,用户欣赏到的音质、画质越好,用户体验感越好。At present, in the process of network transmission, the quality of the downlink network determines whether the video and audio that users watch are smooth, and whether the picture quality is high enough. The higher the network quality, the higher the video bit rate can be used, and the higher the image quality can be. In the downlink network, audio and video data are transmitted from the opposite end to the local end through the network. Among them, the opposite end in the network is the sending end for sending audio and video data packets, and the local end is the receiving end for receiving Audio and video data packets, and then forward the received audio and video data packets to the back-end equipment for processing, and then play and display them to users. The higher the network quality, the better the sound quality and picture quality users will enjoy, and the better the user experience will be.
在发送端发送音视频数据包时,发送端会在每一个数据包的包头中添加时间戳,该时间戳可以按照发送端自身的系统时间来添加。接收端在接收到每一个音视频数据包时,也会存在一个接收时间,该接收时间可以是接收端自身系统的时间,可以理解的是,接收端的系统时间可能和发送端的系统时间有差异,并不相同。接收端在接收到来自发送端的多个数据包时,可以通过包头中的时间戳确定每一个数据包的发送时间,并根据接收到每一个数据包时接收端自身的系统时间,确定每一个数据包的接收时间。When the sending end sends audio and video data packets, the sending end will add a time stamp in the header of each data packet, and the time stamp can be added according to the system time of the sending end itself. When the receiving end receives each audio and video data packet, there will also be a receiving time. The receiving time can be the time of the receiving end's own system. It is understandable that the system time of the receiving end may be different from the system time of the sending end. Not the same. When the receiving end receives multiple data packets from the sending end, it can determine the sending time of each data packet through the timestamp in the packet header, and determine each data packet according to the receiving end's own system time when each data packet is received. The time the packet was received.
作为一个示例:一个发送端可以按照自身的系统时间2020.3.3.8:00:000开始发送数据包,每30毫秒(ms)发送一个数据包,则第二个数据包的时间戳会是:2020.3.3.8:00:030;第三个数据包的时间戳会是:2020.3.3.8:00:060,以此类推;接收端接收到第一个数据包的时间可能是:2020.3.3.8:01:000,第二数据包的时间是:2020.3.3.8:01:030,第二数据包的时间是:2020.3.3.8:01:060,以此类推。其中1秒的时间是下行网络的固有延时,即,下行网络质量最佳时,从发送端发送的数据包均需要1秒的时间才可以到达接收端。As an example: a sender can start sending data packets according to its own system time 2020.3.3.8:00:000, and send a data packet every 30 milliseconds (ms), then the timestamp of the second data packet will be: 2020.3. 3.8:00:030; the timestamp of the third data packet will be: 2020.3.3.8:00:060, and so on; the time when the receiving end receives the first data packet may be: 2020.3.3.8:01:000 , the time of the second data packet is: 2020.3.3.8:01:030, the time of the second data packet is: 2020.3.3.8:01:060, and so on. The time of 1 second is the inherent delay of the downlink network, that is, when the quality of the downlink network is the best, it takes 1 second for the data packets sent from the sending end to reach the receiving end.
假若接收端与发送端的距离很远,垮多个时区,那么接收端的时间可以按照当地时间来确定,例如:发送端的发送时间为北京时间2020.3.3.8:00:000,而接收端在瑞士,那么接收端的时间可能会是瑞士时间2020.3.3.1:10:000,其中1点与8点是北京时间与瑞士时间的时区差距,10秒为下行网络固有延时,即,从北京发送端发送的数据包经过10秒达到瑞士接收端。If the distance between the receiving end and the sending end is very far, and there are multiple time zones, then the time of the receiving end can be determined according to the local time. For example: the sending time of the sending end is 2020.3.3.8:00:000 Beijing time, and the receiving end is in Switzerland, then The time at the receiving end may be 2020.3.3.1:10:000 Swiss time, where 1:00 and 8:00 are the time zone difference between Beijing time and Swiss time, and 10 seconds is the inherent delay of the downlink network, that is, the data sent from the Beijing sending end It took 10 seconds for the packet to reach the receiving end in Switzerland.
步骤102:确定多个数据包的发送时间之间的发送时间差,并确定多个数据包的接收时间之间的接收时间差。Step 102: Determine the sending time difference between the sending times of the multiple data packets, and determine the receiving time difference between the receiving times of the multiple data packets.
本发明实施例中,发送端在确定多个数据包的接收时间和发送时间之后,再确定多个数据包的发送时间之间的发送时间差以及接收时间之间的接收时间差,即,使用较后接收的数据包的接收时间减去较前接收的数据包的接收时间,使用较后接收的数据包的发送时间减去较前接收的数据包的发送时间。具体步骤为:In the embodiment of the present invention, after determining the receiving time and sending time of multiple data packets, the sending end determines the sending time difference between the sending times of the multiple data packets and the receiving time difference between the receiving times, that is, using the later The receive time of the received packet is subtracted from the receive time of the earlier received packet, and the send time of the later received packet is used minus the send time of the earlier received packet. The specific steps are:
步骤s1:将多个数据包中间隔预设数据包数量的每两个数据包划分为一组,得到多组数据包;Step s1: Divide every two data packets with a preset number of data packets in the plurality of data packets into one group to obtain multiple groups of data packets;
步骤s2:确定每一组数据包中较后接收到的数据包与较先接收到的数据包的发送时间差值;Step s2: determine the sending time difference between the later received data packet and the earlier received data packet in each group of data packets;
步骤s3:确定每一组数据包中较后接收到的数据包与较先接收到的数据包的接收时间差值。Step s3: Determine the receiving time difference between the later received data packet and the earlier received data packet in each group of data packets.
本发明实施例中,接收端首先将多个数据包中间隔预设数据包数量的每两个数据包划分为一组,这样就可以得到多组数据包,例如:取间隔2的每两个数据包划分为一组,那么就是第一个数据包和第四个数据包为一组,第二个数据包和第五个数据包为一组,第三个数据包和第六个数据包为一组,以此类推,可以将多个数据包划分为多个组的数据包,当然,假若需要高灵敏度的检测网络质量,则最优的方案是将相邻的两个数据包划分为一组,即,第一个数据包和第二个数据包为一组,第三个数据包和第二个数据包为一组,第四个数据包和第三个数据包为一组,以此类推。In the embodiment of the present invention, the receiving end first divides every two data packets with a preset data packet interval among multiple data packets into a group, so that multiple groups of data packets can be obtained, for example: every two data packets with an interval of 2 The data packets are divided into a group, then the first data packet and the fourth data packet are a group, the second data packet and the fifth data packet are a group, the third data packet and the sixth data packet By analogy, multiple data packets can be divided into multiple groups of data packets. Of course, if high-sensitivity detection of network quality is required, the optimal solution is to divide adjacent two data packets into A group, that is, the first data packet is a group with the second data packet, the third data packet is a group with the second data packet, and the fourth data packet is a group with the third data packet, and so on.
划分小组之后,使用每一个小组中较后接收到的数据包的接收时间减去较前接收到的数据包的接收时间,同理,使用每一个小组中较后接收到的数据包的发送时间减去较前接收到的数据包的发送时间,得到每一组的接收时间差值和发送时间差值。After dividing the groups, use the receiving time of the data packets received later in each group to subtract the receiving time of the data packets received earlier, and similarly, use the sending time of the data packets received later in each group The sending time of the data packets received earlier is subtracted to obtain the receiving time difference and sending time difference of each group.
沿用上述示例:按照相邻两个数据包划分,则第一数据包和第二数据包的发送时间、接收时间分别为:2020.3.3.8:00:000、2020.3.3.8:00:030、2020.3.3.8:01:000、2020.3.3.8:01:030;第三个数据包和第二数据包的发送时间、接收时间分别为:2020.3.3.8:00:090、2020.3.3.8:00:060、2020.3.3.8:01:090、2020.3.3.8:01:060,分别计算两组各自的接收时间差和发送时间差,第一数据包和第二数据包组的接收时间差为30ms,发送时间差为30ms;第三个数据包和第二数据包组的接收时间差也为30ms,发送时间差也为30ms。Using the above example: according to the division of two adjacent data packets, the sending time and receiving time of the first data packet and the second data packet are respectively: 2020.3.3.8:00:000, 2020.3.3.8:00:030, 2020.3. 3.8:01:000, 2020.3.3.8:01:030; the sending time and receiving time of the third data packet and the second data packet are: 2020.3.3.8:00:090, 2020.3.3.8:00:060, 2020.3 .3.8:01:090, 2020.3.3.8:01:060, respectively calculate the receiving time difference and sending time difference of the two groups, the receiving time difference between the first data packet and the second data packet group is 30ms, and the sending time difference is 30ms; the third The receiving time difference between the first data packet and the second data packet group is also 30ms, and the sending time difference is also 30ms.
步骤103:根据接收时间差与发送时间差之间的差值,确定网络在传输多个数据包期间的质量。Step 103: According to the difference between the receiving time difference and the sending time difference, determine the quality of the network during the transmission of multiple data packets.
本发明实施例中,在确定了数据包的接收时间差和发送时间差之后,根据接收时间差与发送时间差之间的差值,即可确定网络在传输多个数据包期间的质量。即,使用同一组计算得到的接收时间差值减去该组计算得到的发送时间差值得到的差值,即可确定网络在传输多个数据包期间的质量,具体的步骤为:In the embodiment of the present invention, after the receiving time difference and the sending time difference of the data packets are determined, the quality of the network during transmission of multiple data packets can be determined according to the difference between the receiving time difference and the sending time difference. That is, the quality of the network during the transmission of multiple data packets can be determined by subtracting the difference between the receiving time difference calculated by the same group and the sending time difference calculated by the same group. The specific steps are:
步骤t1:根据每一组数据包的接收时间差值与发送时间差值,得到该组数据包对应的延迟时间;Step t1: Obtain the delay time corresponding to the group of data packets according to the difference between the receiving time and the sending time of each group of data packets;
步骤t2:对多个数据包各自对应的延迟时间进行累计,确定累积延迟时间;Step t2: Accumulate the respective delay times of multiple data packets to determine the accumulated delay time;
步骤t3:根据累积延迟时间与预设阈值的大小关系,确定网络在传输多个数据包期间的质量。Step t3: According to the relationship between the accumulated delay time and the preset threshold, determine the quality of the network during the transmission of multiple data packets.
发送端在得到每一个数据包的接收时间差值与发送时间差值,使用该组的接收时间差值减去其发送时间差值,得到一个结果值,该结果值即为该组数据包对应的延迟时间。After obtaining the receiving time difference and sending time difference of each data packet, the sending end subtracts the sending time difference from the receiving time difference of the group to obtain a result value, which is the corresponding data packet of the group. delay time.
沿用上述示例:第一数据包和第二数据包组的接收时间差为30ms,发送时间差为30ms,则该组数据包的延迟时间为:30ms-30ms=0,即表明该组数据包对应的延迟时间为0,即网络在传输这两个数据包时未发生延时,网络质量最佳;第三个数据包和第二数据包组的接收时间差也为30ms,发送时间差也为30ms,则该组数据包的延迟时间为:30ms-30ms=0,即表明该组数据包对应的延迟时间为0,即网络在传输这两个数据包时未发生延时,网络质量最佳。Using the above example: the receiving time difference between the first data packet and the second data packet group is 30ms, and the sending time difference is 30ms, then the delay time of this group of data packets is: 30ms-30ms=0, which means that the corresponding delay of this group of data packets The time is 0, that is, there is no delay when the network transmits these two data packets, and the network quality is the best; the receiving time difference between the third data packet and the second data packet group is also 30ms, and the sending time difference is also 30ms, then the The delay time of a group of data packets is: 30ms-30ms=0, which means that the delay time corresponding to this group of data packets is 0, that is, there is no delay when the network transmits these two data packets, and the network quality is the best.
在得到每一组对应的延迟时间后,再把每一组的延迟时间进行累加,得到累积延迟时间,最后根据累积延迟时间与预设阈值的大小关系,确定网络在传输多个数据包期间的质量。After obtaining the corresponding delay time of each group, the delay time of each group is accumulated to obtain the accumulated delay time, and finally, according to the relationship between the accumulated delay time and the preset threshold value, the network is determined during the transmission of multiple data packets. quality.
沿用上述示例:第一数据包和第二数据包组的延迟时间为0;第三个数据包和第二数据包组的延迟时间为0,将两者累积得到的结果也为0,根据这个数值与预设阈值的大小关系,即可确定网络在传输多个数据包期间的质量。具体的:Following the above example: the delay time of the first data packet and the second data packet group is 0; the delay time of the third data packet and the second data packet group is 0, and the result obtained by accumulating the two is also 0, according to this The relationship between the value and the preset threshold can determine the quality of the network during the transmission of multiple data packets. specific:
在累积延迟时间等于预设阈值的情况下,确定网络在传输多个数据包期间的质量正常,使得接收端接收的多个数据包未发生延迟;在累积延迟时间大于预设阈值的情况下,确定网络在传输多个数据包期间的网络质量异常,使得接收端接收的多个数据包发生延迟。When the accumulated delay time is equal to the preset threshold, it is determined that the quality of the network during the transmission of multiple data packets is normal, so that the multiple data packets received by the receiving end are not delayed; when the accumulated delay time is greater than the preset threshold, It is determined that the network quality is abnormal during the transmission of multiple data packets on the network, causing delays in the multiple data packets received by the receiving end.
本发明实施例中,预设阈值是表征网络质量的阈值,一般以预设阈值为0表征网络质量最佳,接收端接收到的数据包没有延时(固有延时除外),则,多个数据包的累积延迟时间等于0,表明网络在传输多个数据包期间质量正常,接收端接收的多个数据包未发生延迟;而假若多个数据包的累积延迟时间大于0,表明网络在传输多个数据包期间质量异常,接收端接收的多个数据包发生延迟。In the embodiment of the present invention, the preset threshold is a threshold that characterizes the network quality. Generally, the preset threshold is 0 to represent the best network quality, and the data packets received by the receiving end have no delay (except the inherent delay). Then, multiple The cumulative delay time of the data packet is equal to 0, indicating that the quality of the network is normal during the transmission of multiple data packets, and the multiple data packets received by the receiving end are not delayed; and if the cumulative delay time of multiple data packets is greater than 0, it indicates that the network is transmitting The quality of multiple data packets is abnormal, and multiple data packets received by the receiving end are delayed.
沿用上述示例:第一数据包和第二数据包组的延迟时间为0;第三个数据包和第二数据包组的延迟时间为0,将两者累积得到的结果也为0,等于预设阈值0,则网络在传输上述三个数据包期间质量正常,接收端接收的三个数据包未发生延迟;假若两者累积得到的结果不为0,而是大于0,则网络在传输上述三个数据包期间质量异常,接收端接收的三个数据包发生延迟。可以理解的是,假若前述步骤中,是使用同一组较前的数据包的接收时间减去较后的数据包的接收时间,那么差值就为负值,那么发送时间的差值也需要使用较前的数据包的发送时间减去较后的数据包的发送时间,假若网络质量异常,发生延迟,那么最终累积出来的累积延迟时间为负值,则前述判定网络质量的条件需变更为等于预设阈值0为正常,小于预设阈值0为异常。Following the above example: the delay time of the first data packet and the second data packet group is 0; the delay time of the third data packet and the second data packet group is 0, and the result of accumulating the two is also 0, which is equal to the predetermined If the threshold is set to 0, the quality of the network is normal during the transmission of the above three data packets, and there is no delay in the three data packets received by the receiving end; if the cumulative result of the two is not 0, but greater than 0, then the network is transmitting the above The quality of the three data packets is abnormal, and the three data packets received by the receiving end are delayed. It can be understood that if in the preceding steps, the receiving time of the same group of earlier data packets is used to subtract the receiving time of the later data packets, then the difference is negative, and the difference of sending time also needs to be used The sending time of the earlier data packet minus the sending time of the later data packet, if the network quality is abnormal and the delay occurs, then the accumulated delay time accumulated in the end will be a negative value, and the above-mentioned condition for determining the network quality needs to be changed to be equal to A preset threshold of 0 is normal, and a value less than the preset threshold of 0 is abnormal.
而在累积延迟时间大于预设阈值的情况下,若累积延迟时间大于预设阈值且累积延迟时间随时间而变化的变化值小于或等于预设变化值,则确定网络在传输多个数据包期间的网络质量趋稳,且存在固定的延迟。即,假若第一数据包和第二数据包组的延迟时间为0;第三个数据包和第二数据包组的延迟时间为10ms,第四个数据包和第三数据包组的延迟时间为0,第五个数据包和第四数据包组的延迟时间为0,将四者累积得到的结果为10ms,则表明网络在传输这五个数据包期间的网络质量趋稳,且存在固定的延迟10ms。最直观的体现就是用户欣赏到的音视频卡顿,时常需要缓冲,不能流畅播放。In the case where the accumulated delay time is greater than the preset threshold, if the accumulated delay time is greater than the preset threshold and the change value of the accumulated delay time over time is less than or equal to the preset change value, it is determined that the network is transmitting multiple data packets The network quality of is stable and there is a fixed delay. That is, if the delay time of the first data packet and the second data packet group is 0; the delay time of the third data packet and the second data packet group is 10ms, and the delay time of the fourth data packet and the third data packet group is 0, the delay time of the fifth data packet and the fourth data packet group is 0, and the result obtained by accumulating the four is 10ms, which indicates that the network quality during the transmission of these five data packets is stable, and there is a fixed The delay is 10ms. The most intuitive manifestation is that the audio and video that the user enjoys freezes, often needs to be buffered, and cannot be played smoothly.
在累积延迟时间大于预设阈值的情况下,若累积延迟时间大于预设阈值且累积延迟时间随时间而变化的变化幅度大于预设变化值,则确定网络在传输多个数据包期间的网络质量变差,且不符合预设带宽需求。即,假若第一数据包和第二数据包组的延迟时间为0;第三个数据包和第二数据包组的延迟时间为10ms,第四个数据包和第三数据包组的延迟时间为8ms,第五个数据包和第四数据包组的延迟时间为0ms,将四者累积得到的结果为18ms,则表明网络在传输这五个数据包期间的网络质量变差,且不符合预设带宽需求。最直观的体现就是用户欣赏到的音视频卡在某一时间,完全不能流畅播放,需要缓冲很长时间,且会出现声音在画面之前出现,造成用户完全没有欣赏的体验感。In the case that the accumulated delay time is greater than the preset threshold, if the accumulated delay time is greater than the preset threshold and the change range of the accumulated delay time over time is greater than the preset change value, then determine the network quality during the transmission of multiple data packets of the network Deteriorated and does not meet preset bandwidth requirements. That is, if the delay time of the first data packet and the second data packet group is 0; the delay time of the third data packet and the second data packet group is 10ms, and the delay time of the fourth data packet and the third data packet group is 8ms, the delay time of the fifth data packet and the fourth data packet group is 0ms, and the result obtained by accumulating the four is 18ms, which indicates that the network quality during the transmission of these five data packets is degraded, and it does not comply with Preset bandwidth requirements. The most intuitive manifestation is that the audio and video that the user enjoys is stuck at a certain time, and cannot be played smoothly at all. It needs to be buffered for a long time, and the sound will appear before the screen, causing the user to have no sense of appreciation experience at all.
本发明实施例中,可以根据网络在传输多个数据包期间的质量,向发送端发送调整提示,以提示发送端调整单次发送给接收端的数据包的总数据量;和/或输出接收调整提示,以提示接收端的用户对单次接收的数据包的总数据量进行调整。即,在出现网络延迟,或者网络带宽完全无法满足需求时,向发送端发送调整提示,发送端接收到提示后,调整单此发送给接收端的数据包的总数据量,以适应网络质量,或者,向接收端输出调整提示,接收端收到提示后,调整对单此接收的数据包的总数据量,以适应网络质量,或者,同时向发送端和接收端发送调整提示,使得两者均调整来适应网络质量,最终保证用户可以欣赏到符合当前网络质量的音视频画面,最直观的体现就是,假若网络质量最佳时,满足1080P画质的音视频数据包传输,用户可以欣赏到1080P的音视频画面,当网络质量不满足时,自动调整到按照720P画质的音视频数据包传输方式进行传输,网络质量更差时,再次降低,当然,在网络质量恢复之后,则可以恢复到1080P画质的音视频数据包传输方式进行传输。In the embodiment of the present invention, according to the quality of the network during the transmission of multiple data packets, an adjustment prompt can be sent to the sending end to prompt the sending end to adjust the total data volume of the data packets sent to the receiving end in a single time; and/or output reception adjustment Prompt, to prompt the user at the receiving end to adjust the total data volume of a single received data packet. That is, when there is a network delay or the network bandwidth cannot meet the demand at all, an adjustment prompt is sent to the sender. After receiving the prompt, the sender adjusts the total data volume of the data packets sent to the receiver alone to adapt to the network quality, or , output an adjustment prompt to the receiving end. After receiving the prompt, the receiving end adjusts the total data volume of the data packets received by the pair to adapt to the network quality, or sends an adjustment prompt to the sending end and the receiving end at the same time, so that both Adjust to adapt to the network quality, and finally ensure that users can enjoy the audio and video images that meet the current network quality. The most intuitive manifestation is that if the network quality is the best, the audio and video data packets that meet the 1080P quality can be transmitted, and users can enjoy 1080P When the network quality is not satisfactory, it will automatically adjust to the transmission method of 720P audio and video data packets. When the network quality is worse, it will be reduced again. Of course, after the network quality is restored, it can be restored to 1080P quality audio and video data packet transmission mode for transmission.
为了更直观的描述本发明的方案,如图2所示,示出了本发明实施例基于下行网络发送端和接收端实现网络质量检测的方法的示意图,该网络中包括发送端和接收端,发送端发送数据包,接收端接收数据包。In order to describe the solution of the present invention more intuitively, as shown in FIG. 2 , it shows a schematic diagram of a method for realizing network quality detection based on the sending end and the receiving end of the downlink network in the embodiment of the present invention. The network includes the sending end and the receiving end. The sender sends data packets, and the receiver receives data packets.
假设发送端以30ms为间隔,持续向接收端发送数据包,从第一数据包(图2中1表示第一数据包)开始依次的发送时间为:0ms、30ms、60ms、90ms…n*30ms;接收端接收到的数据包的接收时间为:T0+0ms、T0+30ms、T0+60ms、T0+90ms…T0+n*30ms;其中,T0为固有延时。Assuming that the sending end continues to send data packets to the receiving end at intervals of 30ms, the sending time from the first data packet (1 in Figure 2 indicates the first data packet) is: 0ms, 30ms, 60ms, 90ms...n*30ms ; The receiving time of the data packet received by the receiving end is: T0+0ms, T0+30ms, T0+60ms, T0+90ms...T0+n*30ms; where T0 is the inherent delay.
正常情况下,网络质量正常时,接收端接收到的数据包的接收时间为:T0+0ms、T0+30ms、T0+60ms、T0+90ms…T0+n*30ms,假若第二数据包(图2中2表示第二数据包)延迟10ms到达接收端,则第二数据包的接收时间变为:T0+40ms,以相邻数据包为一组,分别计算每一组的接收时间差、发送时间差,则有:第二数据包与第一数据包的接收时间差:T0+40ms-(T0+0ms)=40ms,发送时间差:30ms-0ms=30ms;第三数据包与第二数据包的接收时间差:T0+60ms-(T0+40ms)=20ms,发送时间差:60ms-30ms=30ms。Under normal circumstances, when the network quality is normal, the receiving time of the data packet received by the receiving end is: T0+0ms, T0+30ms, T0+60ms, T0+90ms...T0+n*30ms, if the second data packet (Fig. 2 in 2 means that the second data packet arrives at the receiving end with a delay of 10ms, then the receiving time of the second data packet becomes: T0+40ms, taking adjacent data packets as a group, and calculating the receiving time difference and sending time difference of each group respectively , then have: the receiving time difference of the second data packet and the first data packet: T0+40ms-(T0+0ms)=40ms, sending time difference: 30ms-0ms=30ms; The receiving time difference of the 3rd data packet and the second data packet : T0+60ms-(T0+40ms)=20ms, sending time difference: 60ms-30ms=30ms.
第二数据包与第一数据包的延迟时间为:40ms-30ms=10ms,此即表明网络传输这两个数据包期间异常,接收端延迟接收到第二数据包,第三数据包与第二数据包的延迟时间为:20ms-30ms=-10ms,此即表明网络传输这两个数据包期间恢复正常,接收端按照正常时间接收到第三数据包,对两者的延迟时间进行累计,得到累计延迟时间为:10ms+(-10ms)=0ms,即,接收端按照正常时间接收到第三数据包,网络虽然在中间发生了延迟,但在第三数据包时恢复了。The delay time between the second data packet and the first data packet is: 40ms-30ms=10ms, which means that the network transmits the two data packets abnormally, the receiving end delays receiving the second data packet, the third data packet and the second The delay time of the data packet is: 20ms-30ms=-10ms, which means that the network returns to normal during the transmission of the two data packets, and the receiving end receives the third data packet according to the normal time, and accumulates the delay time of the two to obtain The cumulative delay time is: 10ms+(-10ms)=0ms, that is, the receiving end receives the third data packet according to the normal time, although the network is delayed in the middle, it recovers at the time of the third data packet.
上述过程中,假若第三数据包也发生了10ms的延迟,即第三数据包的接收时间变为T0+70ms,则第三数据包与第二数据包的接收时间差:T0+70ms-(T0+40ms)=30ms,发送时间差:60ms-30ms=30ms,第三数据包与第二数据包的延迟时间为:30ms-30ms=0ms,最终累计延迟时间为:10ms+0ms=10ms,即,接收端延迟接收到第二、第三数据包,网络发生了延迟,但网络延迟趋稳,该延迟时间固定在了10ms。In the above process, if the third data packet is also delayed by 10ms, that is, the receiving time of the third data packet becomes T0+70ms, then the receiving time difference between the third data packet and the second data packet: T0+70ms-(T0 +40ms)=30ms, sending time difference: 60ms-30ms=30ms, the delay time of the 3rd data packet and the 2nd data packet is: 30ms-30ms=0ms, and final accumulative delay time is: 10ms+0ms=10ms, that is, receiving The end received the second and third data packets with delay, and the network was delayed, but the network delay stabilized, and the delay time was fixed at 10ms.
上述过程中,假若第三数据包发生了20ms的延迟,即第三数据包的接收时间变为T0+80ms,则第三数据包与第二数据包的接收时间差:T0+80ms-(T0+40ms)=40ms,发送时间差:60ms-30ms=30ms,第三数据包与第二数据包的延迟时间为:40ms-30ms=10ms,最终累计延迟时间为:10ms+10ms=20ms,即,接收端延迟接收到第二、第三数据包,网络发生了延迟,且网络延迟时间变长,网络质量变差,实际的带宽不满足需求的带宽。In the above process, if the third data packet is delayed by 20ms, that is, the receiving time of the third data packet becomes T0+80ms, then the receiving time difference between the third data packet and the second data packet: T0+80ms-(T0+ 40ms)=40ms, the sending time difference: 60ms-30ms=30ms, the delay time between the third data packet and the second data packet is: 40ms-30ms=10ms, and the final cumulative delay time is: 10ms+10ms=20ms, that is, the receiving end Delayed reception of the second and third data packets, the network delay occurs, and the network delay time becomes longer, the network quality deteriorates, and the actual bandwidth does not meet the required bandwidth.
参照图3示出了本发明实施例一种网络质量检测的装置的框图,该装置应用于接收端,网络质量检测的装置包括:Referring to FIG. 3, a block diagram of a device for network quality detection according to an embodiment of the present invention is shown. The device is applied to a receiving end. The device for network quality detection includes:
确定时间模块310,用于在接收到来自于发送端的多个数据包时,确定所述多个数据包各自的接收时间和发送时间;The determining time module 310 is used to determine the respective receiving time and sending time of the multiple data packets when receiving multiple data packets from the sending end;
确定时间差模块320,用于确定所述多个数据包的发送时间之间的发送时间差,并确定所述多个数据包的接收时间之间的接收时间差;Determining a time difference module 320, configured to determine the sending time difference between the sending times of the multiple data packets, and determine the receiving time difference between the receiving times of the multiple data packets;
确定质量模块330,用于根据所述接收时间差与所述发送时间差之间的差值,确定所述网络在传输所述多个数据包期间的质量。The determining quality module 330 is configured to determine the quality of the network during transmission of the plurality of data packets according to the difference between the receiving time difference and the sending time difference.
可选地,所述确定时间差模块包括:Optionally, the module for determining the time difference includes:
划分组子模块,用于将所述多个数据包中间隔预设数据包数量的每两个数据包划分为一组,得到多组数据包;The division group sub-module is used to divide every two data packets with a preset number of data packets in the plurality of data packets into one group to obtain multiple groups of data packets;
确定发送时间差子模块,用于确定每一组数据包中较后接收到的数据包与较先接收到的数据包的发送时间差值;Determine the sending time difference submodule, which is used to determine the sending time difference between the data packet received later and the data packet received earlier in each group of data packets;
确定接收时间差子模块,用于确定每一组数据包中较后接收到的数据包与较先接收到的数据包的接收时间差值。The submodule of determining the receiving time difference is used to determine the receiving time difference between the later received data packet and the earlier received data packet in each group of data packets.
可选地,所述确定质量模块包括:Optionally, the quality determination module includes:
延迟时间子模块,用于根据每一组数据包的接收时间差值与发送时间差值,得到该组数据包对应的延迟时间;The delay time sub-module is used to obtain the delay time corresponding to the group of data packets according to the receiving time difference and the sending time difference of each group of data packets;
累计子模块,用于对所述多个数据包各自对应的延迟时间进行累计,确定累积延迟时间;an accumulating submodule, configured to accumulate the delay times corresponding to each of the plurality of data packets, and determine the accumulated delay time;
确定质量子模块,用于根据所述累积延迟时间与预设阈值的大小关系,确定所述网络在传输所述多个数据包期间的质量。The determining quality submodule is configured to determine the quality of the network during the transmission of the plurality of data packets according to the magnitude relationship between the accumulated delay time and a preset threshold.
可选地,所述确定质量子模块具体用于:Optionally, the determining quality submodule is specifically used for:
在所述累积延迟时间等于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的质量正常,使得所述接收端接收的所述多个数据包未发生延迟;When the accumulated delay time is equal to the preset threshold, it is determined that the quality of the network during the transmission of the plurality of data packets is normal, so that the plurality of data packets received by the receiving end are not delayed;
在所述累积延迟时间大于所述预设阈值的情况下,确定所述网络在传输所述多个数据包期间的网络质量异常,使得所述接收端接收的所述多个数据包发生延迟。When the accumulated delay time is greater than the preset threshold, it is determined that the network quality of the network during transmission of the multiple data packets is abnormal, so that the multiple data packets received by the receiving end are delayed.
可选地,所述装置还包括:调整提示模块,具体用于:Optionally, the device further includes: an adjustment prompt module, specifically used for:
根据所述网络在传输所述多个数据包期间的质量,向所述发送端发送调整提示,以提示所述发送端调整单次发送给所述接收端的数据包的总数据量;和/或According to the quality of the network during the transmission of the plurality of data packets, an adjustment prompt is sent to the sending end, so as to prompt the sending end to adjust the total data volume of the data packets sent to the receiving end at a time; and/or
输出接收调整提示,以提示所述接收端的用户对单次接收的数据包的总数据量进行调整。Outputting a receiving adjustment prompt to prompt the user at the receiving end to adjust the total data volume of a single received data packet.
本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明以上所述的方法中的步骤。An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps in the method described above in the present invention are implemented.
本发明实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行时实现本发明以上所述的方法中的步骤。An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. The processor implements the steps in the above-mentioned method of the present invention when executed.
参照图4,示出了本发明实施例中网络质量检测的整体流程框架图,首先发送端对数据包打时间戳;接收端接收时记录首包时间T0;之后接收端计算收包时间差和发包时间差,最后接收端计算两个时间差差值之和,该差值之和作为网络质量参考值输出。Referring to Fig. 4 , it shows the overall process frame diagram of the network quality detection in the embodiment of the present invention, first, the sending end stamps the data packet; the receiving end records the time T0 of the first packet when receiving; then the receiving end calculates the packet receiving time difference and sends the packet time difference, and finally the receiving end calculates the sum of the difference between the two time differences, and outputs the sum of the difference as a network quality reference value.
通过上述实施例,本发明提供的网络质量检测的方法,在接收到来自于发送端的多个数据包时,确定多个数据包各自的接收时间和发送时间;确定多个数据包的发送时间之间的发送时间差以及接收时间之间的接收时间差;根据接收时间差与发送时间差之间的差值,确定网络在传输多个数据包期间的质量。本发明的方案,与目前传统的检测网络质量的方法完全不同,且由于只需根据接收时间和发送时间进行简单的差值、累计等运算,不需要复杂的运算,更不需要数量庞大的变量采集,具有较高的检测灵敏度,可以快速、简洁的检测出网络质量的状况,具有极高的可扩展性。Through the above embodiments, the method for network quality detection provided by the present invention, when receiving multiple data packets from the sending end, determines the respective receiving time and sending time of the multiple data packets; determines the time between the sending times of the multiple data packets. The difference between the send time difference and the receive time difference between the receive times; based on the difference between the receive time difference and the send time difference, determine the quality of the network during the transmission of multiple data packets. The solution of the present invention is completely different from the current traditional method of detecting network quality, and since it only needs to perform simple calculations such as difference and accumulation according to the receiving time and sending time, it does not require complicated calculations, let alone a large number of variables Acquisition, with high detection sensitivity, can quickly and concisely detect the status of network quality, and has extremely high scalability.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, devices, or computer program products. Accordingly, embodiments of the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor or processor of other programmable data processing terminal equipment to produce a machine such that instructions executed by the computer or processor of other programmable data processing terminal equipment Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded into a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce computer-implemented processing, thereby The instructions executed above provide steps for implementing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Also, herein, the terms "comprises," "comprising," or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article, or apparatus that includes a set of elements includes not only those elements, but also includes none. other elements specifically listed, or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,这些均属于本发明的保护之内。Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive, and those of ordinary skill in the art will Under the enlightenment of the present invention, many forms can also be made without departing from the gist of the present invention and the protection scope of the claims, and these all belong to the protection of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010197843.0A CN111556345B (en) | 2020-03-19 | 2020-03-19 | Network quality detection method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010197843.0A CN111556345B (en) | 2020-03-19 | 2020-03-19 | Network quality detection method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111556345A CN111556345A (en) | 2020-08-18 |
| CN111556345B true CN111556345B (en) | 2023-08-29 |
Family
ID=72004123
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010197843.0A Active CN111556345B (en) | 2020-03-19 | 2020-03-19 | Network quality detection method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111556345B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112671718B (en) * | 2020-12-03 | 2023-07-21 | 网宿科技股份有限公司 | Switching method, server and storage medium of back-to-source link |
| CN115277508A (en) * | 2022-07-26 | 2022-11-01 | 西安万像电子科技有限公司 | Network bandwidth prediction method for remote camera injection into cloud host |
| CN119763580A (en) * | 2024-11-18 | 2025-04-04 | 北京百融睿博科技有限公司 | Intelligent outbound delay monitoring method and device |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101527834A (en) * | 2009-03-26 | 2009-09-09 | 浙江大华技术股份有限公司 | Wireless narrowband network video transmission method |
| CN103414956A (en) * | 2013-08-13 | 2013-11-27 | 中安消技术有限公司 | Real-time data transmission method and system based on transmission control protocol |
| CN105430532A (en) * | 2015-11-18 | 2016-03-23 | 南京创维信息技术研究院有限公司 | Control method and system for adaptive adjustment of video data transmission |
| CN105634865A (en) * | 2015-12-29 | 2016-06-01 | 广州华多网络科技有限公司 | Method and system for obtaining bandwidth |
| CN106604055A (en) * | 2017-01-06 | 2017-04-26 | 广州四三九九信息科技有限公司 | Video smooth transmission and live broadcasting uplink method based on complex weak mobile network environment |
| CN108401128A (en) * | 2018-03-20 | 2018-08-14 | 宁波菊思网络科技有限公司 | A kind of jamming control method in video calling |
| CN108965055A (en) * | 2018-07-17 | 2018-12-07 | 成都力鸣信息技术有限公司 | A kind of network flow abnormal detecting method taking a method based on historical time |
| CN109286813A (en) * | 2018-11-14 | 2019-01-29 | 北京奇艺世纪科技有限公司 | A kind of video communication quality detection method and device |
| CN109802898A (en) * | 2019-02-01 | 2019-05-24 | 深圳市比速智网技术有限公司 | Multilink data transmission method, reception device and storage medium |
| CN111741249A (en) * | 2020-06-04 | 2020-10-02 | 北京佳讯飞鸿电气股份有限公司 | Network congestion detection method and device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20170135107A (en) * | 2016-05-30 | 2017-12-08 | 삼성에스디에스 주식회사 | Data Transmission Method and Computing Apparatus Provided with Data Transmission Function |
| CN111869163B (en) * | 2018-03-19 | 2022-05-24 | 华为技术有限公司 | A method, device and system for fault detection |
-
2020
- 2020-03-19 CN CN202010197843.0A patent/CN111556345B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101527834A (en) * | 2009-03-26 | 2009-09-09 | 浙江大华技术股份有限公司 | Wireless narrowband network video transmission method |
| CN103414956A (en) * | 2013-08-13 | 2013-11-27 | 中安消技术有限公司 | Real-time data transmission method and system based on transmission control protocol |
| CN105430532A (en) * | 2015-11-18 | 2016-03-23 | 南京创维信息技术研究院有限公司 | Control method and system for adaptive adjustment of video data transmission |
| CN105634865A (en) * | 2015-12-29 | 2016-06-01 | 广州华多网络科技有限公司 | Method and system for obtaining bandwidth |
| CN106604055A (en) * | 2017-01-06 | 2017-04-26 | 广州四三九九信息科技有限公司 | Video smooth transmission and live broadcasting uplink method based on complex weak mobile network environment |
| CN108401128A (en) * | 2018-03-20 | 2018-08-14 | 宁波菊思网络科技有限公司 | A kind of jamming control method in video calling |
| CN108965055A (en) * | 2018-07-17 | 2018-12-07 | 成都力鸣信息技术有限公司 | A kind of network flow abnormal detecting method taking a method based on historical time |
| CN109286813A (en) * | 2018-11-14 | 2019-01-29 | 北京奇艺世纪科技有限公司 | A kind of video communication quality detection method and device |
| CN109802898A (en) * | 2019-02-01 | 2019-05-24 | 深圳市比速智网技术有限公司 | Multilink data transmission method, reception device and storage medium |
| CN111741249A (en) * | 2020-06-04 | 2020-10-02 | 北京佳讯飞鸿电气股份有限公司 | Network congestion detection method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111556345A (en) | 2020-08-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111556345B (en) | Network quality detection method and device, electronic equipment and storage medium | |
| CN101971629B (en) | Apparatus and method for adapting a target rate of a video signal | |
| EP2888844B1 (en) | Device and method for adaptive rate multimedia communications on a wireless network | |
| US7151749B2 (en) | Method and System for providing adaptive bandwidth control for real-time communication | |
| US10560393B2 (en) | Controlling a jitter buffer | |
| EP2798850B1 (en) | Apparatus and method for synchronized transmission of multimedia content over an asynchronous network | |
| JP2019532576A (en) | Multimode synchronous rendering of audio and video | |
| EP2888845B1 (en) | Device and method for adaptive rate multimedia communications on a wireless network | |
| US20020004841A1 (en) | Communication apparatus and communication method | |
| US20180241675A1 (en) | Method and Apparatus for Providing A Low Latency Transmission System Using Adaptive Buffering Estimation | |
| CN107529097A (en) | A kind of method and device of adaptive regulating video buffer size | |
| CN109889398B (en) | A method and device, device and storage medium for detecting service quality of media stream | |
| JPWO2006054442A1 (en) | Transmitting apparatus, receiving apparatus, and communication system | |
| CN105791735B (en) | Method and system for video calling code stream dynamic adjustment | |
| US20130282871A1 (en) | Streaming service transmitting/receiving device and method | |
| US20170048025A1 (en) | Communication control apparatus, communication control method, and computer-readable non-transitory recording medium | |
| KR20110090596A (en) | Jitter Correction Method and Device | |
| US20070177625A1 (en) | Packet communication system, packet communication method, transmission apparatus, and storage medium having stored therein computer program | |
| JP5186094B2 (en) | Communication terminal, multimedia playback control method, and program | |
| CN113163233B (en) | Bandwidth detection method based on real-time video streaming transmission | |
| JP2010136159A (en) | Data receiver | |
| US9106551B2 (en) | Data packet frequency | |
| JP4457841B2 (en) | Transmission apparatus, transmission program, and transmission method for controlling coding rate | |
| CN103533005A (en) | Processing method, system and related devices based on playing state information synchronization | |
| CN101141368B (en) | Method and device for controlling stream media data playback processing speed |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address |
Address after: 33rd Floor, No.1 Huasheng Road, Yuzhong District, Chongqing 400013 Patentee after: VISIONVERA INFORMATION TECHNOLOGY Co.,Ltd. Country or region after: China Address before: 100000 Beijing Dongcheng District Qinglong Hutong 1 Song Hua Building A1103-1113 Patentee before: VISIONVERA INFORMATION TECHNOLOGY Co.,Ltd. Country or region before: China |
|
| CP03 | Change of name, title or address |