Bandwidth measuring method and device

文档序号:309361 发布日期:2021-11-26 浏览:14次 中文

阅读说明:本技术 一种带宽测量方法和装置 (Bandwidth measuring method and device ) 是由 李飞霞 黄思远 李磊 邓艳芳 吴迪 孙晔 于 2021-08-25 设计创作,主要内容包括:本申请公开了一种带宽测量方法和装置,其中方法包括:当客户端接收到服务器返回的视频数据时,根据预设的带宽过滤条件,判断所述视频数据的带宽是否需要过滤;如果不需要,则根据所述视频数据,更新当前的带宽测量参数;所述客户端实时地根据所述带宽测量参数和预设的采样周期,判断当前是否满足预设的带宽测量条件,如果是,则根据所述带宽测量参数,触发带宽采样,并获取当前的带宽采样点数量,根据已采样的带宽值和所述带宽采样点数量,计算当前的带宽测量值。采用本申请,通过对接收到的数据带宽进行过滤,基于过滤后的带宽测量参数进行带宽测量,可以提高测量准确性和实时性,并且运算开销小。(The application discloses a bandwidth measurement method and a bandwidth measurement device, wherein the method comprises the following steps: when a client receives video data returned by a server, judging whether the bandwidth of the video data needs to be filtered according to a preset bandwidth filtering condition; if not, updating the current bandwidth measurement parameter according to the video data; and the client judges whether the current bandwidth meets the preset bandwidth measurement condition in real time according to the bandwidth measurement parameter and the preset sampling period, if so, the client triggers bandwidth sampling according to the bandwidth measurement parameter, acquires the number of current bandwidth sampling points, and calculates the current bandwidth measurement value according to the sampled bandwidth value and the number of the bandwidth sampling points. By adopting the method and the device, the received data bandwidth is filtered, and the bandwidth measurement is carried out based on the filtered bandwidth measurement parameters, so that the measurement accuracy and the real-time performance can be improved, and the calculation cost is low.)

1. A method of bandwidth measurement, comprising:

when a client receives video data returned by a server, judging whether the bandwidth of the video data needs to be filtered according to a preset bandwidth filtering condition; if not, updating the current bandwidth measurement parameter according to the video data;

and the client judges whether the current bandwidth meets the preset bandwidth measurement condition in real time according to the bandwidth measurement parameter and the preset sampling period, if so, the client triggers bandwidth sampling according to the bandwidth measurement parameter, acquires the number of current bandwidth sampling points, and calculates the current bandwidth measurement value according to the sampled bandwidth value and the number of the bandwidth sampling points.

2. The method of claim 1, wherein the bandwidth filtering condition comprises:

the video data belong to preset small-data-volume file data, and the small-data-volume file data comprise index file data and initialization fragment data;

and/or the current time interval from the latest request for downloading the video data is less than a preset filtering time threshold.

3. The method of claim 1, wherein the bandwidth measurement parameters include a transmission time to be used for bandwidth sampling and a total amount of video data that has been received without requiring bandwidth filtering.

4. The method of claim 3, wherein updating the current bandwidth measurement parameter based on the video data comprises:

setting the transmission time to be used for bandwidth sampling as a time interval between the current time and the latest request for downloading the video data;

and increasing the size of the video data to the current total amount of the video data.

5. The method of claim 3, further comprising:

when the bandwidth of the video data needs to be filtered, and the downloading unit to which the video data belongs has the downloading pause operation, the following conditions are met: when the time interval between the current time and the latest time for requesting to download the video data is smaller than a preset filtering time threshold value, setting the total amount of the video data which currently participates in the bandwidth measurement as the total amount of the video data which is currently received and does not need to filter the bandwidth, and timing the current sampling period to zero.

6. The method of claim 1, wherein the bandwidth measurement condition comprises:

the sampling period is currently reached;

or the number of video data which do not participate in bandwidth measurement in the video data which are currently received and do not need to be subjected to bandwidth filtering is larger than a preset threshold value of the number of bandwidth measurements.

7. The method of claim 3, wherein triggering bandwidth sampling according to the bandwidth measurement parameter comprises:

and if the transmission time to be used for bandwidth sampling is within a preset time range, calculating the bandwidth value of the current sampling according to the transmission time to be used for bandwidth sampling and the quantity of video data which does not participate in bandwidth measurement in the video data which is currently received and does not need bandwidth filtering.

8. The method of claim 1, wherein obtaining the current number of bandwidth samples comprises:

dividing the playing time length of the currently received and undisplayed data by the sampling period to obtain the number of initial sampling points;

if the playing time of the maximum downloading unit of the currently played file is less than a preset time threshold, determining the number of the bandwidth sampling points matched with the number of the initial sampling points according to the mapping relation between the number of the preset initial sampling points and the number of the bandwidth sampling points, and setting the number of the bandwidth sampling points as the number of the current bandwidth sampling points, otherwise, setting the number of the current bandwidth sampling points as the preset maximum sampling point number threshold.

9. The utility model provides a bandwidth measuring device which characterized in that sets up in the customer end, includes:

the bandwidth filtering unit is used for judging whether the bandwidth of the video data needs to be filtered or not according to a preset bandwidth filtering condition when the client receives the video data returned by the server; if not, updating the current bandwidth measurement parameter according to the video data;

and the bandwidth measuring unit is used for judging whether the current bandwidth meets the preset bandwidth measuring condition or not according to the bandwidth measuring parameter and the preset sampling period in real time, if so, triggering bandwidth sampling according to the bandwidth measuring parameter, acquiring the number of current bandwidth sampling points, and calculating the current bandwidth measuring value according to the sampled bandwidth value and the number of the bandwidth sampling points.

10. An electronic device for bandwidth measurement, comprising a processor and a memory;

the memory has stored therein an application executable by the processor for causing the processor to perform the bandwidth measurement method of any one of claims 1 to 8.

11. A computer-readable storage medium having computer-readable instructions stored therein for performing the bandwidth measurement method of any of claims 1-8.

Technical Field

The present invention relates to streaming media technologies, and in particular, to a bandwidth measurement method and apparatus.

Background

With the development of network technology in recent years, the use of streaming media is spread in all aspects of work and life of people, and various terminals such as televisions, mobile phones and notebooks need to use streaming media to play videos, so that how to realize smooth and quick playing of terminal videos becomes a crucial factor influencing the video watching experience of users. The smooth playing of the streaming media video is realized, and the accurate network bandwidth value of the user in the current time period needs to be calculated more quickly under the complicated and changeable network conditions, so that the streaming media video can be adaptively switched to the most appropriate code rate video resource for downloading and playing.

Currently, the commonly used bandwidth measurement schemes are: according to the bandwidth information of the downloaded streaming media segment or the downloading duration and other information of the video segment to be downloaded, a QoE model (such as a filter, a Lyapunov model and the like) is constructed, and then the current bandwidth is calculated according to the model output.

In the process of implementing the present application, the inventor finds that the existing bandwidth measurement technology has the problems of large operation overhead, inaccurate measurement and poor real-time performance.

Disclosure of Invention

In view of the above, the main objective of the present invention is to provide a bandwidth measurement method and apparatus, which can improve the measurement accuracy and real-time performance, and have low computation overhead.

In order to achieve the above purpose, the embodiment of the present invention provides a technical solution:

a bandwidth measurement method, comprising:

when a client receives video data returned by a server, judging whether the bandwidth of the video data needs to be filtered according to a preset bandwidth filtering condition; if not, updating the current bandwidth measurement parameter according to the video data;

and the client judges whether the current bandwidth meets the preset bandwidth measurement condition in real time according to the bandwidth measurement parameter and the preset sampling period, if so, the client triggers bandwidth sampling according to the bandwidth measurement parameter, acquires the number of current bandwidth sampling points, and calculates the current bandwidth measurement value according to the sampled bandwidth value and the number of the bandwidth sampling points.

Preferably, the bandwidth filtering condition includes:

the video data belong to preset small-data-volume file data, and the small-data-volume file data comprise index file data and initialization fragment data; and/or the current time interval from the latest request for downloading the video data is less than a preset filtering time threshold.

Preferably, the bandwidth measurement parameters include a transmission time to be used for bandwidth sampling and a total amount of video data that has been received without requiring filtering bandwidth.

Preferably, updating the current bandwidth measurement parameter according to the video data comprises:

setting the transmission time to be used for bandwidth sampling as a time interval between the current time and the latest request for downloading the video data;

and increasing the size of the video data to the current total amount of the video data.

Preferably, the method further comprises:

when the bandwidth of the video data needs to be filtered, and the downloading unit to which the video data belongs has the downloading pause operation, the following conditions are met: when the time interval between the current time and the latest time for requesting to download the video data is smaller than a preset filtering time threshold value, setting the total amount of the video data which currently participates in the bandwidth measurement as the total amount of the video data which is currently received and does not need to filter the bandwidth, and timing the current sampling period to zero.

Preferably, the bandwidth measurement condition includes:

the sampling period is currently reached;

or the number of video data which do not participate in bandwidth measurement in the video data which are currently received and do not need to be subjected to bandwidth filtering is larger than a preset threshold value of the number of bandwidth measurements.

Preferably, triggering bandwidth sampling according to the bandwidth measurement parameter includes:

and if the transmission time to be used for bandwidth sampling is within a preset time range, calculating the bandwidth value of the current sampling according to the transmission time to be used for bandwidth sampling and the quantity of video data which does not participate in bandwidth measurement in the video data which is currently received and does not need bandwidth filtering.

Preferably, obtaining the current number of bandwidth samples comprises:

dividing the playing time length of the currently received and undisplayed data by the sampling period to obtain the number of initial sampling points;

if the playing time of the maximum downloading unit of the currently played file is less than a preset time threshold, determining the number of the bandwidth sampling points matched with the number of the initial sampling points according to the mapping relation between the number of the preset initial sampling points and the number of the bandwidth sampling points, and setting the number of the bandwidth sampling points as the number of the current bandwidth sampling points, otherwise, setting the number of the current bandwidth sampling points as the preset maximum sampling point number threshold.

The embodiment of the present invention further provides a bandwidth measuring apparatus, which is disposed in a client, and includes:

the bandwidth filtering unit is used for judging whether the bandwidth of the video data needs to be filtered or not according to a preset bandwidth filtering condition when the client receives the video data returned by the server; if not, updating the current bandwidth measurement parameter according to the video data;

and the bandwidth measuring unit is used for judging whether the current bandwidth meets the preset bandwidth measuring condition or not according to the bandwidth measuring parameter and the preset sampling period in real time, if so, triggering bandwidth sampling according to the bandwidth measuring parameter, acquiring the number of current bandwidth sampling points, and calculating the current bandwidth measuring value according to the sampled bandwidth value and the number of the bandwidth sampling points.

The embodiment of the invention also provides electronic equipment for measuring the bandwidth, which is characterized by comprising a processor and a memory;

the memory has stored therein an application executable by the processor for causing the processor to perform the bandwidth measurement method as described above.

Embodiments of the present invention also provide a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions are used for executing the bandwidth measurement method described above.

In summary, the bandwidth measurement scheme provided in the embodiment of the present invention is applied to a client, and when the client receives video data returned by a server, it needs to determine whether bandwidth of currently received data needs to be filtered according to a preset bandwidth filtering condition, that is, whether the bandwidth can participate in bandwidth measurement, and if the bandwidth needs to be filtered, a parameter used for bandwidth measurement is not updated based on the currently received data, so that validity and accuracy of the bandwidth measurement parameter can be improved, and a factor that easily affects accuracy of bandwidth measurement is excluded from the bandwidth measurement, so that accuracy and real-time of the bandwidth measurement can be improved.

Drawings

FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.

After the inventor conducts careful research and analysis on the existing bandwidth measurement scheme, the inventor finds that the main reasons of the problems of high operation overhead, inaccurate measurement and poor real-time performance are as follows:

1. the existing bandwidth measurement scheme is realized based on a QoE model, and a model calculation formula is complex, so that the operation overhead of scheme operation can be increased, and the bandwidth calculation efficiency is influenced.

2. The existing bandwidth measurement scheme needs to wait for the completion of downloading of a single or multiple continuous downloading units during bandwidth calculation, and then the bandwidth measurement real-time performance is affected. The downloading unit refers to streaming media data requested by a user at one time.

3. In the downloading process of the streaming media data, the downloading of the audio data and the video data is independent, and when a user requests the downloading of the audio data, the downloading of the video data needs to be suspended, so that a time period for suspending the downloading may exist in the downloading process of the video data, and idle time without video data transmission may exist in the downloading process of the video data. The existing bandwidth measurement scheme is based on the receiving condition of video data, and the existence of deducting the idle time is not considered when calculating the transmission time of the video data, thereby causing the inaccuracy of bandwidth measurement.

4. The video file includes not only video main body data but also other types of data with small data volume: such as text information mpd and initial configuration information (init segment) for carrying video key information. The download units with these other types of data will have fast transmission rate due to the small amount of data, and therefore the download rate of these download units will not match the actual bandwidth. However, in the existing bandwidth measurement scheme, the downloading of the small data is not distinguished, so that the bandwidth measurement is limited by the influence of the small data, and the problem of inaccuracy exists. In addition, when the server performs streaming media transmission, the download unit requested by the user is divided into a plurality of parts to be transmitted in sequence, so that the data volume of the tail part of the download unit transmitted finally may be small, and the transmission rate is also fast.

5. During the actual transmission of streaming media data, the downloading speed of individual data may be affected by network fluctuation, and the downloading speed of the data may not reflect the normal bandwidth, so that the downloading speed of the individual data may also affect the accuracy of the bandwidth measurement during the bandwidth measurement.

Based on the problem analysis, the bandwidth measurement is not realized based on the model any more so as to reduce the operation cost, when the bandwidth is measured, whether the bandwidth of the currently received data can be used for the bandwidth measurement is screened in real time in order to filter the data which can influence the accuracy of the bandwidth measurement in order to improve the accuracy of the bandwidth measurement, the parameters for the bandwidth measurement are updated based on the video data which is not filtered, the bandwidth measurement is triggered immediately when the preset bandwidth measurement condition is met, and the bandwidth measurement is triggered without waiting for the completion of the downloading of one or more downloading units so as to improve the real-time performance of the bandwidth measurement.

Fig. 1 is a schematic flow chart of a bandwidth measurement method according to an embodiment of the present invention, as shown in fig. 1, the embodiment mainly includes:

step 101, when a client receives video data returned by a server, judging whether the bandwidth of the video data needs to be filtered according to a preset bandwidth filtering condition; and if not, updating the current bandwidth measurement parameter according to the video data.

In this step, when receiving the video data returned by the server according to the data download request, the client filters whether the bandwidth of the received video data can be used for bandwidth measurement according to the preset bandwidth filtering condition, and correspondingly updates the bandwidth measurement parameters in real time, so as to filter out data which can affect the accuracy of bandwidth measurement, enhance the effectiveness of the parameters for bandwidth measurement, and further improve the accuracy of bandwidth measurement.

Here, the fact that the bandwidth of the video data needs to be filtered means that the bandwidth of the video data is filtered out and cannot participate in the bandwidth measurement.

Preferably, for better filtering effect, the bandwidth filtering condition may be set based on the transmission time and/or transmission size of the received video data.

In one embodiment, the bandwidth filtering condition may be set to include the following:

the video data belong to preset small-data-volume file data, and the small-data-volume file data comprise index file data and initialization fragment data;

and/or the current time interval from the latest request for downloading the video data is less than a preset filtering time threshold.

In the bandwidth filtering condition, it is considered that the data size of the small data file data is very small, the corresponding download units occupy very small data file data, and the download rate of the download units is often inconsistent with the actual bandwidth, so the bandwidth of the data can be filtered out to improve the accuracy of bandwidth measurement. Specifically, the small-data-volume file data includes index file data (e.g., mpd, m3u8, etc.) and initialization segment data (e.g., init segment) of the video file, but is not limited thereto, and may also include other data contents with a small data volume.

In the bandwidth filtering condition, "the time interval between the current time and the latest request for downloading the video data is smaller than the preset filtering time threshold," the time interval between the current time and the latest request for downloading the video data "represents the transmission duration of the currently received data, and when the condition is satisfied, it indicates that the transmission duration of the currently received data is very short, which may be the case that the data number of the downloading unit itself is very small, or the remaining data amount of the downloading unit after resuming downloading due to suspension is very small, or an abnormally fast transmission rate may be obtained due to network fluctuation, and these situations with very short transmission duration may not reflect the real bandwidth situation, so that the bandwidth of the data received under the situation may be considered to be filtered out, so as to improve the accuracy of bandwidth measurement.

For the filtering time threshold, a person skilled in the art can set a reasonable value according to actual needs, so that the data bandwidth which cannot represent the current real bandwidth condition can be filtered by using the filtering time threshold. Such as, but not limited to, 100 ms.

In an embodiment, for the bandwidth measurement parameter that needs to be updated in real time, the method may specifically include: the transmission time to be used for bandwidth sampling and the total amount of video data that has been received without the need to filter the bandwidth.

Accordingly, the following method may be specifically adopted to update the current bandwidth measurement parameter:

setting the transmission time to be used for bandwidth sampling as a time interval between the current time and the latest request for downloading the video data; and increasing the size of the video data to the current total amount of the video data.

Here, the transmission time to be used for bandwidth sampling is set as the current time interval from the last request to download video data, where the last request may be a data unit requested to be downloaded for the first time, or a data download request triggered by resuming downloading after the downloading is suspended. In this way, the update can make the transmission time to be used for bandwidth sampling always record the transmission time of the latest request data. In this way, the idle time after the download pause can be eliminated to avoid the idle time from affecting the accuracy of the bandwidth measurement.

In the above updating method, for video data that does not need to be filtered, the data size of the video data is added to the current total amount of the video data, so that when bandwidth measurement is performed, the difference between the parameter and the total data amount currently participating in bandwidth measurement can be calculated, the data amount that does not need to be filtered and does not participate in bandwidth measurement is obtained, and bandwidth sampling can be performed based on the data amount.

Correspondingly, in an embodiment, if the bandwidth filtering condition includes that the "time interval between the current time and the latest request for downloading the video data is less than the preset filtering time threshold", in step 101, it is detected that the bandwidth of the video data needs to be filtered currently, and a downloading unit to which the video data belongs has a downloading pause operation, and the following conditions are satisfied: when the time interval between the current time and the latest time for requesting to download the video data is smaller than the preset filtering time threshold, the total amount of the video data which is currently involved in the bandwidth measurement needs to be set as the total amount of the video data which is currently received and does not need to filter the bandwidth, and the timing of the current sampling period is reset to zero.

In the above method, it is considered that if the downloading unit to which the video data belongs has a pause downloading operation, and the following conditions are satisfied: the time interval between the current time and the latest time for requesting to download the video data is smaller than the preset filtering time threshold, which indicates that the currently received data needs to be filtered because the residual data of the downloading unit where the currently received data is located is smaller when the downloading is suspended and the transmitted data volume is smaller after the downloading is resumed. In this case, the download time of the download unit cannot be accurately used to calculate the bandwidth, and therefore, all data information downloaded and not downloaded by the download unit needs to be filtered. Therefore, in the above method, it is necessary to set the current "amount of data that does not need filtering and does not participate in bandwidth measurement" to zero, that is, the "total amount of video data that currently participates in bandwidth measurement" to the "total amount of video data that is currently received and does not need filtering, so that the difference between the two amounts is zero. In this way, it can be ensured that the "transmission time to be used for bandwidth sampling" and the "amount of data which does not need filtering and does not participate in bandwidth measurement" counted thereafter are consistent, and they both correspond to the newly received unfiltered and sampled data, so that it can be ensured that the subsequent sampling result is not affected by the current data filtering.

And step 102, the client judges whether the current bandwidth meets the preset bandwidth measurement condition in real time according to the bandwidth measurement parameter and the preset sampling period, if so, the client triggers bandwidth sampling according to the bandwidth measurement parameter, acquires the current number of bandwidth sampling points, and calculates the current bandwidth measurement value according to the sampled bandwidth value and the number of the bandwidth sampling points.

The difference between the step and the prior art is that when the bandwidth measurement condition is judged to be satisfied according to the current bandwidth measurement parameter and the preset sampling period, the bandwidth measurement needs to be triggered without waiting for the completion of downloading of one or more downloading units and then triggering the bandwidth measurement, so that the real-time performance of the bandwidth measurement can be improved.

Specifically, in order to improve the real-time performance of the bandwidth, when calculating the current bandwidth measurement value, it is necessary to perform calculation based on the M bandwidth sample values sampled most recently. And if the bandwidth value sampled currently reaches the number of the bandwidth sampling points, M is the number of the bandwidth sampling points acquired currently, otherwise, M is the number of all the bandwidth values actually acquired currently.

In particular, when the current bandwidth measurement value is calculated by using the M bandwidth sample values of the new sample, an average value may be calculated, but the method is not limited to this, and other calculation methods may be used to make the measurement result more match with the actual bandwidth.

In one embodiment, in order to improve the timeliness of the bandwidth measurement, the bandwidth measurement condition may be set to include the following:

the sampling period is currently reached; or the number of video data which do not participate in bandwidth measurement in the video data which are currently received and do not need to be subjected to bandwidth filtering is larger than a preset threshold value of the number of bandwidth measurements.

Wherein, the monitoring whether the sampling period is reached can be realized by a timer.

Based on the bandwidth measurement condition, when a preset sampling period is reached, or the number of received video data which do not need to filter bandwidth and do not participate in bandwidth measurement reaches a certain number, triggering needs to be considered for bandwidth measurement calculation.

The sampling period and the bandwidth measurement quantity threshold may be specifically set by those skilled in the art according to actual needs, as long as timeliness and accuracy of bandwidth measurement can be ensured.

In an embodiment, after determining that the preset bandwidth measurement condition is currently satisfied, the following method may be specifically adopted to trigger bandwidth sampling according to the bandwidth measurement parameter:

and if the transmission time to be used for bandwidth sampling is within a preset time range, calculating the bandwidth value of the current sampling according to the transmission time to be used for bandwidth sampling and the quantity of video data which does not participate in bandwidth measurement in the video data which is currently received and does not need bandwidth filtering.

In the method, in consideration of the fact that the short transmission time of the data sample based on which the bandwidth sampling is based affects the authenticity of the sampling result, in order to further improve the effectiveness of the bandwidth sampling, the time range is set, and the bandwidth sampling can be performed only when the transmission time currently to be used for the bandwidth sampling is within the time range. Specifically, in an embodiment, the time range is specifically equal to or greater than a preset minimum sampling transmission time and equal to or less than the sampling period, so that: the transmission time corresponding to the sampling data is too short, so that the accuracy of the sampling result is influenced. For the minimum sampling transmission time, a suitable value can be set by a person skilled in the art according to the needs of an actual application scenario.

In an embodiment, in step 102, the current number of bandwidth sampling points may also be obtained based on the playing duration of the currently received and undisplayed data, so as to improve the accuracy of bandwidth measurement by dynamically obtaining the current number of bandwidth sampling points, and specifically, the following steps may be adopted to obtain the current number of bandwidth sampling points:

and step x1, dividing the playing time length of the currently received and undisplayed data by the sampling period to obtain the number of initial sampling points.

The method comprises the step of determining the number of initial sampling points based on the playing time corresponding to the currently cached undisplayed data, so that the number of the sampling points finally used for bandwidth measurement is obtained in the subsequent steps based on the number of the initial sampling points. Here, when the initial sampling point number is determined, the play duration of the current cache data is considered, so that the number of the sampling points finally used for bandwidth measurement can be matched with the duration of the current cache data, and thus the continuity and the real-time performance of bandwidth sampling can be guaranteed.

Step x2, if the playing time of the maximum downloading unit of the current playing file is less than the preset time threshold, determining the number of the bandwidth sampling points matched with the number of the initial sampling points according to the mapping relation between the number of the preset initial sampling points and the number of the bandwidth sampling points, and setting the number of the bandwidth sampling points as the number of the current bandwidth sampling points, otherwise, setting the number of the current bandwidth sampling points as the preset maximum sampling point number threshold.

Here, in order to match the determined number of bandwidth sampling points with the transmission requirement of the currently played file, when the number of current bandwidth sampling points is set, the playing time of the maximum download unit of the currently played file is considered, and when the playing time is not too long, the number of current bandwidth sampling points is determined based on the number of initial sampling points obtained in step x1 according to the mapping relationship between the number of preset initial sampling points and the number of bandwidth sampling points. When the playing time of the maximum downloading unit of the currently played file is longer, the required bandwidth is larger, at this time, the number of the current bandwidth sampling points is set as the preset maximum sampling point number threshold value, and the accuracy of bandwidth measurement can be improved through the number of the sampling points as many as possible.

The mapping relation between the initial sampling point quantity and the bandwidth sampling point quantity can be set according to the proportional relation between the initial sampling point quantity and the bandwidth sampling point quantity, so that the larger bandwidth sampling point quantity can be set when the time length of data to be played in the cache region is larger, and then the accuracy of bandwidth measurement can be improved on the basis of more sampling data as much as possible.

For the threshold of the maximum number of sampling points, a suitable value can be set by a person skilled in the art according to practical experience, as long as the requirement of accuracy of bandwidth measurement can be met as far as possible.

Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a bandwidth measurement apparatus, which is disposed in a client, and includes:

the bandwidth filtering unit 201 is configured to, when the client receives video data returned by the server, determine whether bandwidth of the video data needs to be filtered according to a preset bandwidth filtering condition; if not, updating the current bandwidth measurement parameter according to the video data;

and the bandwidth measuring unit 202 is configured to determine whether a preset bandwidth measuring condition is currently met according to the bandwidth measuring parameter and a preset sampling period in real time, if so, trigger bandwidth sampling according to the bandwidth measuring parameter, acquire the current number of bandwidth sampling points, and calculate a current bandwidth measurement value according to the sampled bandwidth value and the number of bandwidth sampling points.

Based on the embodiment of the bandwidth measuring method, the embodiment of the application also realizes the electronic equipment for measuring the bandwidth, which comprises a processor and a memory; the memory has stored therein an application executable by the processor for causing the processor to perform the bandwidth measurement method as described above. Specifically, a system or an apparatus equipped with a storage medium on which a software program code that realizes the functions of any of the embodiments described above is stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program code stored in the storage medium. Further, part or all of the actual operations may be performed by an operating system or the like operating on the computer by instructions based on the program code. The functions of any of the above-described embodiments of the bandwidth measurement method may also be implemented by writing the program code read out from the storage medium to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causing a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on the instructions of the program code.

The memory may be embodied as various storage media such as an Electrically Erasable Programmable Read Only Memory (EEPROM), a Flash memory (Flash memory), and a Programmable Read Only Memory (PROM). The processor may be implemented to include one or more central processors or one or more field programmable gate arrays, wherein the field programmable gate arrays integrate one or more central processor cores. In particular, the central processor or central processor core may be implemented as a CPU or MCU.

Embodiments of the present application implement a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the bandwidth measurement method as described above.

It should be noted that not all steps and modules in the above flows and structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The division of each module is only for convenience of describing adopted functional division, and in actual implementation, one module may be divided into multiple modules, and the functions of multiple modules may also be implemented by the same module, and these modules may be located in the same device or in different devices.

The hardware modules in the various embodiments may be implemented mechanically or electronically. For example, a hardware module may include a specially designed permanent circuit or logic device (e.g., a special purpose processor such as an FPGA or ASIC) for performing specific operations. A hardware module may also include programmable logic devices or circuits (e.g., including a general-purpose processor or other programmable processor) that are temporarily configured by software to perform certain operations. The implementation of the hardware module in a mechanical manner, or in a dedicated permanent circuit, or in a temporarily configured circuit (e.g., configured by software), may be determined based on cost and time considerations.

"exemplary" means "serving as an example, instance, or illustration" herein, and any illustration, embodiment, or steps described as "exemplary" herein should not be construed as a preferred or advantageous alternative. For the sake of simplicity, the drawings are only schematic representations of the parts relevant to the invention, and do not represent the actual structure of the product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "a" does not mean that the number of the relevant portions of the present invention is limited to "only one", and "a" does not mean that the number of the relevant portions of the present invention "more than one" is excluded. In this document, "upper", "lower", "front", "rear", "left", "right", "inner", "outer", and the like are used only to indicate relative positional relationships between relevant portions, and do not limit absolute positions of the relevant portions.

The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种视频切片推流的方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类