Content source: Huawei Developer Conference 2021 HMS Core 6 System Technical Forum, the keynote speech "Tik Tok Short Video Network Performance Optimization Practice".
Speaker: Tao Ka, Android Architect of Douyin
Hello everyone! I am Ka Tao from the ByteDance Douyin Experience Team. My sharing topic is the practice of optimization of Douyin short video network performance. Next, I will introduce the weak network bottleneck of short video applications and the changes after the integration of HMS Core wireless transmission services.
Weak network: network bottleneck for short video applications
Douyin, which has over 600 million daily active users, faces a huge network experience challenge in the face of a huge user base. Video freezes, long video loading times, and freezes for more than 5 seconds are all problems that bother us. Douyin also has a live broadcast service, in which the "push-pull streaming" process requires very high bandwidth, and the failure of the network will directly cause users to "stuck" during live broadcast panic buying. In response to these problems, we generally conduct LAN detection to check bandwidth problems; diagnostic tests to determine which link has a problem.
With the continuous expansion of Douyin's business scope, the business needs on the Android side have gradually increased, facing many network difficulties——
- Video download/upload : Many users of Douyin not only download videos to share with others, but also upload high-quality videos independently, which places high demands on the network.
- Dynamic : Douyin's e-commerce business is booming, and the information flow advertisements in it will use part of the dynamic resources.
- : In addition to short videos, the terminal experience of functional plug-ins such as Douyin's live broadcast, local life, and social networking is particularly important.
- Offline 16192110ec687a: When large-scale events are held during the Spring Festival, shopping festivals and other time nodes, At this time, it is necessary to ensure the immediacy of activities. For example, the scene of grabbing red envelopes in the Spring Festival Gala needs to be issued in advance, and there are also high requirements for bandwidth.
- live broadcast : Douyin's live broadcast service is in full swing, and conditions such as sufficient bandwidth, low latency, and weak network environment are as smooth as possible. In the case of “push streaming”, the upload bandwidth is sufficient; “pull streaming” has very high requirements on the real-time, delay, bandwidth, and weak network availability of watching live broadcasts.
API request large number of users. To continuously pull user information and video playback information, it poses challenges to bandwidth, latency, weak network, and stability.
System capability: a breakthrough in network optimization
So, how does Douyin improve the network experience on the application side? application service layer network availability optimization has dynamic bit rate, dynamic resolution, service degradation, etc. For example, video can automatically reduce the bit rate at low network speeds; use the intelligent heartbeat capability to detect the heartbeat interval of the network.
Network framework layer availability optimization has data packet compression, dynamic routing, DNS resolution optimization, composite request, link layer optimization, CDN acceleration, protocol layer optimization, and weak network switching. If the user's network environment is poor, we will prompt the user to log in to free Wi-Fi; or prompt them to choose the free streaming mode. For traffic-sensitive users, we will try our best to allow them to browse A on a higher-quality network, so as not to have a great impact on tariffs. The real-time requirements of some services are not high, but they have a great impact on the front-end traffic of Douyin. The back-end will also limit the CDN rate of these services to ensure the front-end playback and live broadcast experience. System layer network availability optimization is reflected in more accurate user perception, more accurate prediction, stronger tripartite control, and finer link protection.
The above are the most common network optimization methods in the industry. The system network enhancement capabilities in the HMS Core wireless transmission service, including link protection, bandwidth enhancement, scenario prediction, weak network availability, and signal evaluation, basically achieve full coverage.
Regarding the network freeze, the root cause is found to be caused by the loading of the critical link after testing. The weak network diagnosis methods on the application side are limited, and the wireless transmission service provides stronger weak network perception and recognition capabilities, and then more accurate weak network predictions. It can help applications understand the priority of network API links, actively control the concurrent amount of bandwidth, perceive more network state switching, more comprehensive user experience information, and improve user experience.
Best Practice: A typical case of Douyin's weak network optimization
weak network prediction, can prepare the application before the arrival of the weak network. After receiving the notification, the wireless transmission service can take different cloud control weak network measures in different weak network scenarios such as subways, elevators, and high-speed rails. For example, when users watch on-demand or live broadcast in a weak network scenario, they can intelligently preload, adjust the push rate, and perform traffic control to download traffic in advance.
If it is estimated that the weak network environment will not last long, the wireless transmission service will conduct weak network behavior guidance, prompting users who want to exit the application "Your network is about to be restored, please wait patiently". After anticipating changes in the weak network environment, it will also adjust the protocol layer parameters in advance. In addition, for some business scenarios that have a large impact on the front desk and consume traffic, Douyin will also consider removing it. But in the case of good network quality, these business scenarios are beneficial to the user experience, and we generally decide to stay after observing the performance through experiments.
Carton transparent transmission allows the system to make fine-grained decision-making. When a user is playing a long video, if the background request times out, there is basically no perception; when a short video is ordered in the foreground, if the user sees a ten-second stuck replay, the experience will become very poor. The main reasons for this phenomenon are instantaneous no network, delay fluctuations, and limited bandwidth. How to solve it? In order to give priority to video loading and streaming media, wireless transmission services can be combined with a stuttering event customization strategy. After Wi-Fi signals, 5G signals, and base station signals are estimated, the priority of the network channel is defined and the bandwidth is enhanced.
network stalls quickly respond, so that hidden no longer become the experience bottleneck 16192110ec6ae5. Before, the network was disconnected for 1-2 seconds, and the application could not perceive it in time. But the on-demand or live broadcast at the front desk will have a 5-6 second freeze. After the integration of wireless transmission services, events can be predicted, two-way event notifications, and frequent evaluations can be achieved. Under the premise of perceivable, it is guaranteed that no invalid request will be sent without internet, and the request will be made immediately after the internet is available, so as to better serve the application scenarios that require high real-time performance.
Large data volume bandwidth expansion, so that the pain disappears quickly . With the improvement of user video quality, Douyin is facing substantial bandwidth consumption and application traffic demand. Such as plug-in download, offline resource download for large-scale events, dynamic resource pre-loading, video upload, live streaming, and installation package download. First of all, Douyin will perform application-level optimization, through traffic scheduling, to complete off-peak downloads, to ensure smooth front-end traffic, and at the same time limit the CDN speed on the server side. After the integration of wireless transmission services, Wi-Fi high-priority packet delivery, dual Wi-Fi functions, multi-network concurrency, bandwidth control and other functions continue to be optimized.
In general, based on the large number of Douyin users, the performance of integrated wireless transmission service capabilities is very good. We still have a lot of cooperation with Huawei in the areas of power consumption, display, network, etc., and hope to have the opportunity to share with you again, thank you!
for more details>>
Visit Huawei Developer Alliance official website
Obtain the development guide document
Huawei Mobile Services open source warehouse address: GitHub , Gitee
and learn about the latest technical information of HMS Core for the first time~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。