Home  >  Article  >  Backend Development  >  Live traffic statistics delay, how to achieve error-free calculation of traffic charges

Live traffic statistics delay, how to achieve error-free calculation of traffic charges

WBOY
WBOYOriginal
2016-09-06 08:57:071143browse

Currently, we are working on a Baidu open cloud interface, which is about the activation of live broadcast and traffic statistics. However, there is a delay in Baidu's traffic statistics, which is about 20 minutes. How can I avoid this delay using PHP, accurately calculate the traffic cost, and if the user's balance is insufficient, force the live broadcast to be closed;

<code>我想到的解决方案是,做一个定时任务,在用户停止直播后20分钟时执行,但仍然存在欠费时仍可直播的问题,大神们,还有没有其他方案呢??</code>

Reply content:

Currently, we are working on a Baidu open cloud interface, which is about the activation of live broadcast and traffic statistics. However, there is a delay in Baidu's traffic statistics, which is about 20 minutes. How can I avoid this delay using PHP, accurately calculate the traffic cost, and if the user's balance is insufficient, force the live broadcast to be closed;

<code>我想到的解决方案是,做一个定时任务,在用户停止直播后20分钟时执行,但仍然存在欠费时仍可直播的问题,大神们,还有没有其他方案呢??</code>

This statistical delay comes from the upstream (your service provider Baidu Open Cloud). You cannot control this delay downstream. You can set a safety threshold for the user, which is to estimate how much traffic the user can use in 20 minutes when the user's balance is close. This traffic time can send an alarm to the user

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn