| CPC H04N 21/6437 (2013.01) [H04L 65/612 (2022.05); H04N 21/232 (2013.01); H04N 21/2323 (2013.01); H04N 21/2393 (2013.01); H04N 21/438 (2013.01)] | 13 Claims |

|
1. A media stream delivery method, applied to a content delivery network (CDN) node server which runs in a Linux operating system, wherein the CDN node server supports a channel unicast live business, and the CDN node server comprises a network card, and the Linux operating system comprises an architecture divided into a user mode and a kernel mode, and wherein the method comprises:
receiving a data packet of a media stream, wherein the data packet is received by a network card driver process from the network card and written to a data cache area in the kernel mode of the network card;
establishing a shared memory through a memory mapping function mmap provided by the Linux operating system, wherein data in the data cache area in the kernel mode of the network card is copied to the shared memory by a media packet reception process through a system call function recvmsg provided by the Linux operating system, and the shared memory is mapped as a memory file at the same time, wherein the shared memory refers to a memory area shared by an application cache area of a streaming media service software in the user mode and a packet sending buffer area of a network card driver process in the kernel mode;
and
responding to requests of multiple user terminals, reading the data packet of the media stream requested by the multiple user terminals from the memory file mapped by the shared memory by using a SENDFILE function provided by the Linux operating system, and submitting the data packet to the network card driver process for direct packet sending.
|