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>
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