计算剩余下载时间的最佳方法是什么? [英] What's the best way to calculate remaining download time?

查看:31
本文介绍了计算剩余下载时间的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您要计算剩余下载时间,并且您拥有所需的所有信息,即:文件大小、dl'ed 大小、剩余大小、已用时间、瞬时 dl 速度等.你将如何计算剩余的 dl 时间?

Let's say you want to calculate the remaining download time, and you have all the information needed, that is: File size, dl'ed size, size left, time elapsed, momentary dl speed, etc'. How would you calculate the remaining dl time?

当然,最直接的方法是:左尺寸/瞬时 dl 速度,或:(经过的时间/dl'ed 尺寸)*左尺寸.只是前者会受到瞬时速度偏差的影响,后者不能很好地适应变化的速度.

Ofcourse, the straightforward way would be either: size left/momentary dl speed, or: (time elapsed/dl'ed size)*size left. Only that the first would be subject to deviations in the momentary speed, and the latter wouldn't adapt well to altering speeds.

一定是更聪明的方法来做到这一点,对吧?查看您当前使用 uTorrent 下载的盗版软件和音乐.很容易注意到它比前面提到的简单计算做的更多.实际上,我注意到有时当 dl 速度下降时,剩余时间也会下降几分钟,直到重新调整.

Must be some smarter way to do that, right? Take a look at the pirated software and music you currently download with uTorrent. It's easy to notice that it does more than the simple calculation mentioned before. Actually, I notices that sometimes when the dl speed drops, the time remaining also drops for a couple of moments until it readjusts.

推荐答案

嗯,正如你所说,使用绝对当前的下载速度并不是一个好方法,因为它往往会波动.然而,像整体平均值这样的东西也不是一个好主意,因为那里也可能会有很大的波动.

Well, as you said, using the absolutely current download speed isn't a great method, because it tends to fluctuate. However, something like an overall average isn't a great idea either, because there may be large fluctuations there as well.

考虑我是否与其他 9 个人同时开始下载文件.我只获得了正常速度的 10%,但文件进行到一半,其他 9 次完成.现在我以 10 倍的速度下载.我原来的 10% 速度不应该成为还剩多少时间?"的一个因素.不再计算.

Consider if I start downloading a file at the same time as 9 others. I'm only getting 10% of my normal speed, but halfway through the file, the other 9 finish. Now I'm downloading at 10x the speed I started at. My original 10% speed shouldn't be a factor in the "how much time is left?" calculation any more.

就我个人而言,我可能会取过去 30 秒左右的平均值,然后使用它.那应该根据最近的速度进行计算,而不会剧烈波动.30 秒可能不是合适的数量,需要一些实验才能找出合适的数量.

Personally, I'd probably take an average over the last 30 seconds or so, and use that. That should do calculations based on recent speed, without fluctuating wildly. 30 seconds may not be the right amount, it would take some experimentation to figure out a good amount.

另一种选择是设置一种波动阈值",在速度变化超过该阈值之前,您不要进行任何重新计算.例如(同样,随机数需要实验),您可以将阈值设置为 10%.然后,如果您以 100kb/s 下载,则不会重新计算剩余时间,直到下载速度更改为低于 90kb/s 或 110kb/s.如果发生这些更改之一,则会重新计算时间并设置新的阈值.

Another option would be to set a sort of "fluctuation threshold", where you don't do any recalculation until the speed changes by more than that threshold. For example (random number, again, would require experimentation), you could set the threshold at 10%. Then, if you're downloading at 100kb/s, you don't recalculate the remaining time until the download speed changes to either below 90kb/s or 110kb/s. If one of those changes happens, the time is recalculated and a new threshold is set.

这篇关于计算剩余下载时间的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆