CN111541903A - Live broadcast acceleration method, source station end, edge node, client and live broadcast system - Google Patents
Live broadcast acceleration method, source station end, edge node, client and live broadcast system Download PDFInfo
- Publication number
- CN111541903A CN111541903A CN202010036207.XA CN202010036207A CN111541903A CN 111541903 A CN111541903 A CN 111541903A CN 202010036207 A CN202010036207 A CN 202010036207A CN 111541903 A CN111541903 A CN 111541903A
- Authority
- CN
- China
- Prior art keywords
- file
- edge node
- fragment
- client
- resource
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000001133 acceleration Effects 0.000 title claims abstract description 36
- 239000012634 fragment Substances 0.000 claims abstract description 132
- 238000004806 packaging method and process Methods 0.000 claims abstract description 22
- 238000012856 packing Methods 0.000 claims abstract description 16
- 238000013467 fragmentation Methods 0.000 claims abstract description 13
- 238000006062 fragmentation reaction Methods 0.000 claims abstract description 13
- 238000013507 mapping Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 4
- 238000007726 management method Methods 0.000 description 31
- 238000010586 diagram Methods 0.000 description 14
- 230000015654 memory Effects 0.000 description 11
- 230000005540 biological transmission Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000000977 initiatory effect Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012552 review Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/65—Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses and provides a live broadcast acceleration method, a source station end, an edge node, a client and a live broadcast system, wherein the live broadcast acceleration method comprises the following steps: acquiring a live stream of a target channel; carrying out fragment packing on the live stream through a preset streaming media protocol to obtain a fragment file and an index file of the live stream and storing the fragment file and the index file; judging whether the fragment file needs to be synchronously uploaded to an edge node or not; and if so, synchronously uploading the fragment files to an edge node so that the resource request of the client hits the fragment files in the edge node, and returning the fragment files corresponding to the resource request to the client through the edge node. The live broadcast stream is fragmented and packaged in the source station end, and the complexity of the edge node is reduced because fragmentation and packaging are not performed in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Description
Technical Field
The invention relates to the technical field of streaming media, in particular to a live broadcast acceleration method, a source station end, an edge node, a client and a live broadcast system.
Background
Dynamic adaptive Streaming based on HTTP (HTTP) is an adaptive Streaming media transport Protocol, including DASH (DASH, English: dynamic adaptive Streaming over HTTP), or HLS (HLS, HTTP live Streaming, Chinese: HTTP Streaming media transport Protocol). Services such as on-demand, live broadcast, time shift, review and the like of the Internet television can be realized based on the DASH/HLS protocol. How to realize live streaming acceleration based on HLS/DASH is a key point and difficulty for ensuring low live delay and improving user experience. At present, a traditional method for accelerating a live broadcast code stream is to forward a continuous live broadcast code stream through an RTMP (Real-Time Messaging Protocol, chinese) Protocol, push the live broadcast code stream to CDN (CDN, Content Delivery Network, chinese) edge nodes in different areas through the RTMP, perform packing and slicing by the edge nodes to output a slice file of an HLS/DASH Protocol, and then pull the generated HLS/DASH slice file by accessing the CDN edge nodes, as shown in fig. 1 a. Because the video coding of the live code stream based on RTMP transmission can only support the coding transmission in the H264 format, and can not support the coding transmission in other formats such as H265/HEVC (short for H265/HEVC, English: High Efficiency video coding, Chinese: High Efficiency video coding), the transmission surface is smaller; moreover, sinking such a task as a package slice to a CDN edge node leads to complexity of CDN edge node implementation, and the edge node must implement a function equivalent to that of the source station. This increases the load of the CDN edge node server, increases the complexity of CDN edge node implementation, and especially, when DRM (DRM for short) needs to be turned on to perform copyright protection on content, the complexity is greater, so that the CDN edge node needs more computing resources and spends more time, and thus the live broadcast acceleration effect is poor.
Therefore, in the existing live broadcast code stream acceleration mode, the problem that the transmission surface capable of accelerating is small and the CDN edge nodes need more computing resources exists, so that the existing live broadcast acceleration effect is poor.
Content of application
The invention aims to provide a live broadcast acceleration method aiming at the defects in the prior art and solves the problem that the existing live broadcast acceleration effect is poor.
The purpose of the invention is realized by the following technical scheme:
in a first aspect, a live broadcast acceleration method is provided, where the method includes:
acquiring a live stream of a target channel;
carrying out fragment packing on the live stream through a preset streaming media protocol to obtain a fragment file and an index file of the live stream and storing the fragment file and the index file;
judging whether the fragment file needs to be synchronously uploaded to an edge node or not;
and if so, synchronously uploading the fragment files to an edge node so that the resource request of the client hits the fragment files in the edge node, and returning the fragment files corresponding to the resource request to the client through the edge node.
Further, the determining whether the fragmented file needs to be uploaded to the edge node synchronously includes:
maintaining mapping information of a target channel and an index file, and marking a latest access timestamp of the target channel;
acquiring a current timestamp of the live stream when the live stream is subjected to fragment packaging;
according to the difference value between the current timestamp and the latest access timestamp;
and when the difference value between the current timestamp and the latest access timestamp is smaller than a preset threshold value, judging that the fragment file needs to be synchronously uploaded to the edge node.
In a second aspect, a live broadcast acceleration method is further provided, where the method includes:
acquiring resource request information of a client, wherein the resource request information comprises a request file type;
judging whether the type of the request file is a fragment type;
if the request file type is a fragment type, attempting to read a corresponding local fragment file, wherein the local fragment file is a fragment file which is fragmented and packaged in a source station end through a preset streaming media and synchronously uploaded to the local;
and returning the read local fragment file to the client.
Further, the method further comprises:
if the corresponding local fragment file cannot be read, forwarding the media request to the source station end;
and returning the fragmentation file returned by the source station end to the client.
In a third aspect, a live broadcast acceleration method is further provided, where the method includes:
requesting a target channel playing resource from a content management terminal, and receiving a playing resource locator of a target channel returned by the content management terminal;
generating first resource request information according to the playing resource locator;
sending the first resource request information to an edge node, and acquiring a target resource file through the edge node;
and receiving the target resource file returned by the edge node.
Further, the sending the first resource request information to the edge node, and acquiring the target resource file through the edge node, where the first resource request information includes an index file request, includes:
sending the index file request to an edge node, and forwarding the index file request to a source station end through the edge node;
receiving an index file returned by the edge node, wherein the index file is the index file returned by the source station end to the edge node;
analyzing the index file to obtain a fragment file list in the index file;
sequentially generating second resource requests corresponding to all the fragmented files in the fragmented file list according to the fragmented file list;
and sending the second resource request to an edge node, and acquiring a corresponding local fragment file as a target resource file through the edge node, wherein the local fragment file is a fragment file synchronously returned to the edge node when the source station returns an index file to the edge node, so that the second resource request is hit in the edge node.
In a fourth aspect, there is also provided a source-side apparatus, including:
the first acquisition module is used for acquiring a live stream of a target channel;
the processing module is used for carrying out fragmentation and packaging on the live stream through a preset streaming media protocol to obtain a fragmentation file and an index file of the live stream and storing the fragmentation file and the index file;
the first judgment module is used for judging whether the fragment files need to be synchronously uploaded to the edge nodes;
and the synchronization module is used for synchronously uploading the fragment files to the edge node if necessary, so that the resource request of the client hits the fragment files in the edge node, and the fragment files corresponding to the resource request are returned to the client through the edge node.
In a fifth aspect, there is also provided an edge node apparatus, the apparatus comprising:
the second acquisition module is used for acquiring resource request information of the client, wherein the resource request information comprises a request file type;
the second judging module is used for judging whether the type of the request file is a media type;
the reading module is used for trying to read a corresponding local fragment file if the type of the request file is a fragment type, wherein the local fragment file is a fragment file which is fragmented and packaged in a source station end through a preset streaming media and synchronously uploaded to the local fragment file;
and the return module is used for returning the read local fragment file to the client.
In a sixth aspect, there is also provided a client device, the device comprising:
the request module is used for requesting a target channel playing resource from a content management terminal and receiving a playing resource locator of the target channel returned by the content management terminal;
generating first resource request information according to the playing resource locator;
sending the first resource request information to an edge node, and acquiring a target resource file through the edge node;
and receiving the target resource file returned by the edge node.
In a seventh aspect, a live broadcast system is further provided, where the system includes: the system comprises a source station end, an edge node, a client and a content management end; wherein,
the source station end is used for executing the live broadcast acceleration method in the embodiment of the invention;
the edge node is used for executing the live broadcast acceleration method in the embodiment of the invention;
the client is used for executing the live broadcast acceleration method in the embodiment of the invention;
the content management terminal is used for maintaining or creating channel information in the source station terminal.
The invention has the following beneficial effects: acquiring a live stream of a target channel; carrying out fragment packing on the live stream through a preset streaming media protocol to obtain a fragment file and an index file of the live stream and storing the fragment file and the index file; judging whether the fragment file needs to be synchronously uploaded to an edge node or not; and if so, synchronously uploading the fragment files to an edge node so that the resource request of the client hits the fragment files in the edge node, and returning the fragment files corresponding to the resource request to the client through the edge node. The live broadcast stream is fragmented and packaged in the source station end, and is synchronously sent to the edge node under the condition of meeting the condition, and the complexity of the edge node is reduced because the fragmentation and packaging are not carried out in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Drawings
Fig. 1a is a schematic structural diagram of a conventional live broadcast system according to an embodiment of the present invention;
fig. 1 is a schematic structural diagram of a live broadcast system according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a live broadcast acceleration method according to an embodiment of the present invention;
fig. 3 is a schematic architecture diagram of another live broadcast system according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another live broadcast acceleration method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another live broadcast acceleration method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a source station apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a first determining module in a source station device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an edge node apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another edge node apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a client device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a sending module in a client device according to an embodiment of the present invention.
Detailed Description
The following describes preferred embodiments of the present invention and those skilled in the art will be able to realize the invention by using the related art in the following and will more clearly understand the innovative features and the advantages brought by the present invention.
The invention provides a live broadcast acceleration method. The purpose of the invention is realized by the following technical scheme:
referring to fig. 1, fig. 1 is a schematic diagram of an architecture of a live broadcast system according to an embodiment of the present invention, and as shown in fig. 1, the system includes: a source station side 101, an edge node 102, a client side 103, and a Content Management side (CMS, english: Content Management System, also called Content Management System) 104.
The source station end 101 is configured to acquire a live broadcast signal source from the outside, where the live broadcast signal source is a live broadcast signal uploaded in real time by each of different live broadcast channels. The source station side 101 may also be referred to as a source station, or a source station server, or a source station node. The source station end supports live stream packaging and slicing based on HLS/DASH streaming media protocol.
The edge node 102 is configured to obtain a resource request of the client 103, and determine whether the resource request is a fragmented file request or an index file request. The edge node may also be referred to as a transit node or an edge node server.
When the resource request is a fragmented file request, a request attempt of the fragmented file is performed locally, and if the fragmented file request hits, the hit fragmented file is directly returned to the client 103.
When the resource request is an index file request or a fragmented file request, the edge node 102 forwards the resource request to the source station 101. When the resource request is a fragmented file request, the source station 101 returns the corresponding fragmented file to the edge node 102, and the edge node 102 returns the corresponding fragmented file to the client 103. When the resource request is an index file request, the source station 101 returns the corresponding index file and the fragment file corresponding to the index file to the edge node 102, and the edge node 102 returns the corresponding index file to the client 103.
The client 103 is configured to generate resource request information, where the resource request information includes a fragmented file request or an index file request, where the fragmented file request may be understood as a live resource request, and the index file request may be understood as an on-demand resource request, a time-shifting resource request, a review resource request, and the like.
The content management terminal 104 is configured to issue a request for creating a channel to the source station 101, where the request for issuing the channel includes a channel number, an output streaming media protocol type (such as HLS or DASH), whether to open DRM protection, and the like.
After receiving the request for creating a channel sent by the content management end 104, the source station end 101 initializes the channel, including creating a directory for storing channel segments, creating a receive/pull flow, then constructing a broadcast URL (Uniform Resource Locator, URL) of the channel, and returning the broadcast URL to the content management end 104 for storage management. The URL format specification is: HTTP | HTTPS:// Host: Port/Path/To/master.m3u8| manifest.mpd? cid ═ XXX.
Wherein, HTTP | HTTPs indicates whether SSL (SSL, english: Secure Sockets Layer, chinese: Secure socket Layer) transmission is adopted, Host is the Host domain name of the deployed edge node 102, Port is the TCP Port monitored by the content distribution module on the edge node 102,/Path/To indicates the Path of channel fragment storage, and cid indicates the channel number corresponding To the channel. Further, assuming that the created channel number is ffea953990b74ea98d806d5b14b1ebd7, the path stored by the channel fragment is/media/ffea 953990b74ea98d806d5b14b1ebd7, the domain edge1.com of the edge node 102 has a port of 80, and the channel fragment is transmitted by using HTTPS (abbreviation: HTTPS, english: Hyper Text Transfer Protocol over secure session Layer, chinese: Hyper Text Transfer security Protocol), the returned specific broadcast URL is:
[HLS]https://edge1.com:80/media/ffea953990b74ea98d806d5b14b1ebd7/ master.m3u8?cid=ffea953990b74ea98d806d5b14b1ebd7。
[DASH]https://edge1.com:80/media/ffea953990b74ea98d806d5b14b1ebd7/ manifest.mpd?cid=ffea953990b74ea98d806d5b14b1ebd7。
m3u8 is a file format under the HLS transport protocol; the mpd is a file format under the DASH transport protocol.
Referring to fig. 2, fig. 2 is a flowchart of a live broadcast acceleration method provided in an embodiment of the present invention, which is applied to a live broadcast system in the embodiment of fig. 1, and as shown in fig. 2, the method includes:
201. the content manager 104 issues a request for creating a channel to the source station 101.
The request for creating the channel includes a channel number, a type of the output streaming media protocol, whether DRM protection is turned on, and the like.
202. After receiving the request for creating a channel, the source station 101 initializes the channel.
The initialization channel includes: including creating a catalog of channel slice stores, creating a receive/pull thread, then constructing a play URL for the channel, and returning the play URL to the content manager 104.
203. The client 103 requests the play URL of the target channel to the content manager 104.
204. The content management side 104 performs verification authentication on the client side 103.
If the verification authentication is passed, the client 103 initiating the request is considered to be a legal client, and the step 205 is carried out; or if the verification authentication is not passed, the client 103 initiating the request is considered as an illegal client, and the request of the client initiating the request is rejected.
205. The content manager 104 returns the play URL to the client 103 in response to the request of the client 103.
206. The client 103 successfully obtains the broadcast URL of the target channel, and initiates a first resource request to the edge node 102 through the broadcast URL.
207. Edge node 102 detects that the first resource request is a sharded file request or an indexed file request.
If the request is a fragment file request, step 208 is executed; if so, go to step 210.
208. An attempt is made in the edge node 102 to read the corresponding local tile file.
If the reading is successful, the procedure goes to step 209, and if the reading is failed, the procedure goes to step 210.
209. The edge node 102 returns the local fragmented file corresponding to the fragmented file request to the client 103.
210. The edge node 102 initiates a first resource request to the source station.
211. The source station 101 receives the first resource request and performs parsing.
212. The source station 101 synchronously uploads the fragment file of the live stream to the edge node 102, and simultaneously obtains the target index file in the directory corresponding to the target channel and returns the target index file to the edge node 102.
It may be that the fragmented files of the live stream are uploaded synchronously to all edge nodes.
213. The edge node 102 returns the target index file or the fragment file to the client.
If the resource request is an index file request, the process proceeds to step 214, and if the resource request is a fragment file request, the process ends.
214. The client 103 parses the target index file.
And analyzing to obtain a fragment file list in the target index file. For example, assuming that there are 3 pieces of sliced file information in the sliced file list, the contents of the target index file are as follows:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:9
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:6,
ffea953990b74ea98d806d5b14b1ebd7-001.ts
#EXTINF:6,
ffea953990b74ea98d806d5b14b1ebd7-002.ts
#EXTINF:6,
ffea953990b74ea98d806d5b14b1ebd7-003.ts
the client 103 may subsequently initiate a request for a slice file in the list of slice files as follows: ffea953990b74ea98d806d5b14b1ebd7- {001,002,003}. ts
The above-mentioned sliced file list may also be referred to as a playlist.
215. The client 103 constructs a new URL and initiates a second resource request to the edge node 102 for the first sharded file in the index file.
216. The edge node 102 receives the second resource request, and if the second resource request is judged to be a fragmented file request, the edge node 102 reads the corresponding local fragmented file.
Since the sharded file corresponding to the index file is already located on the edge node 102 in step 212, the second resource request may hit directly in the edge node.
217. The edge node 102 returns the corresponding local sharded file to the client 103.
218. The client 103 subsequently makes requests for other shards in the sharded file list.
In the embodiment of the invention, the live stream is fragmented and packaged in the source station end, and is synchronously sent to the edge node under the condition of meeting the condition, and the complexity of the edge node is reduced because the fragmentation and packaging are not carried out in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Referring to fig. 3, fig. 3 is a schematic diagram of an architecture of another live broadcast system according to an embodiment of the present invention, and as shown in fig. 3, the system includes: source station end 301, edge node 302, client 303.
The source station 301 includes a live broadcast packaging module 3011, an upload management module 3012, and a first content distribution module 3013.
The edge node 302 includes an upload module 3021, a back source module 3022, and a second content distribution module 3023.
Further, the live broadcast packing module 3011 is configured to perform fragment packing on the obtained live broadcast stream according to a preset streaming media protocol to obtain a fragment file and an index file of the live broadcast stream.
The live broadcast packaging module 3011 sends the fragment file and the index file of the live broadcast stream obtained by fragment packaging to the upload management module 3012 for storage management.
The upload management module 3012 described above is communicatively connected to the upload module 3021 in the edge node 302.
The first content distribution module 3013 is in communication connection with the source returning module 3022 in the edge node 302, and after receiving the request from the source returning module 3022 in the edge node 302, the first content distribution module 3013 sends a message to the upload management module 3012 to indicate the channel information to which the tile file or the index file in the resource request belongs.
The second content distribution module 3023 is configured to interact with the client 303, receive a resource request of the client, and return a corresponding resource request response.
Referring to fig. 4, fig. 4 is a flowchart of another live broadcast acceleration method provided by an embodiment of the present invention, which is applied to the live broadcast system in the embodiment of fig. 3, and as shown in fig. 4, the method includes:
401. and acquiring the live stream of the target channel.
The live stream can be acquired from a target channel through a stream receiving/pulling thread in the source station.
402. And carrying out fragment packaging on the live stream through a preset streaming media protocol, and obtaining fragment files and index files of the live stream and storing the fragment files and the index files.
After acquiring the live stream of the target channel, repackaging the live stream through a live stream packaging module in the source station end, wherein the preset stream media protocol can be based on an HLS/DASH stream media protocol, and the live stream packaging module outputs and obtains a fragment file and an index file based on the HLS/DASH stream media protocol. The above-described sliced file may also be referred to as a sliced file.
Further, when a new fragmented file is generated each time, the source station may be notified of metadata information of the new fragmented file by an upload management module in the form of a message, where the metadata information includes: the channel to which the fragment file belongs, the storage path of the fragment file, and the like.
403. And judging whether the fragment file needs to be synchronously uploaded to the edge node.
After receiving the message of the live broadcast packaging module, the upload management module first judges whether the fragment file needs to be uploaded to the edge node. If the uploading is needed, the step is carried out to step 404, and if the uploading is not needed, the message sent by the live broadcast packaging module is ignored.
Further, maintaining mapping information of a target channel and an index file, and marking a latest access timestamp of the target channel; acquiring a current timestamp of a live stream when the live stream is subjected to fragment packaging; according to the difference value between the current timestamp and the latest access timestamp; and when the difference value between the current timestamp and the latest access timestamp is smaller than a preset threshold value, judging that the fragment file needs to be synchronously uploaded to the edge node.
More specifically, the uploading management module may determine whether the fragmented file should be uploaded to the edge node based on the following policies and mechanisms: the uploading management module does not synchronously upload the index file generated and updated in real time to the edge node, so that a client player has to request a source station end through a source returning module of the edge node every time the index file is requested, a content distribution module of the source station end sends a message to the uploading management module after receiving the request of the edge node from the source returning module to indicate the channel information to which the requested index file belongs, the uploading management module maintains the mapping information between the index file and the channel information in a memory after receiving the message sent by the content distribution module, and if the mapping information does not exist before, the mapping information is created and the latest timestamp of the channel access is marked; if the mapping information has been previously created, the latest access timestamp of the mapping information is updated.
The uploading management module judges whether the fragment files need to be uploaded to the edge nodes synchronously based on the timestamps, after receiving a message of a new fragment file sent by the live broadcast packaging module, the uploading management module firstly finds corresponding mapping information according to the channel number of a target channel in a live broadcast stream, then subtracts the timestamp of the latest access of the target channel from the current timestamp, if the difference value of the two timestamps is less than a set threshold value, the target channel is considered to be accessed, the new fragment file is uploaded to all the edge nodes synchronously, and if the difference value of the timestamps is greater than the threshold value, the target channel is indicated to be accessed for more than a certain time, and therefore synchronous uploading of the fragment file to the edge nodes is suspended. Through the dynamically adjusted uploading strategy, on one hand, the purpose of live broadcast acceleration can be achieved, and on the other hand, uploading can be suspended when no one accesses a channel so as to save bandwidth between a source station end and a client.
404. And synchronously uploading the fragment file to the edge node.
The fragment files are synchronously uploaded to all the edge nodes through an uploading management module in the source station end, so that the client can directly hit the edge nodes when accessing the channel, and the fragment files corresponding to the resource request are returned to the client through the edge nodes without returning to the source station node to request the fragment files.
When the resource request of the client reaches the edge node, the edge node returns the resource request to the source station, and at the moment, the source station updates the latest access time stamp of the channel and returns the content corresponding to the resource request.
In the embodiment of the invention, the live stream is fragmented and packaged in the source station end, and is synchronously sent to the edge node under the condition of meeting the condition, and the complexity of the edge node is reduced because the fragmentation and packaging are not carried out in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Referring to fig. 5, fig. 5 is a flowchart of another live broadcast acceleration method provided in an embodiment of the present invention, which is applied to the live broadcast system in the embodiment of fig. 3, and as shown in fig. 5, the method includes:
501. and acquiring the resource request information of the client.
The resource request information includes a request file type, the request file type includes a fragment type and an index type, the fragment type refers to that a fragment file is requested in the resource request, and the index type refers to that an index file is requested in the resource request.
The resource request information of the client can be obtained through a second content distribution module in the edge node.
502. And judging whether the type of the request file is a fragment type.
In this step, when receiving a resource request from a client, a second content distribution module in an edge node first determines a file type requested by the resource request, and if the requested file type is an index type, the second content distribution module schedules the request to a back-to-source module, and then the back-to-source module initiates the request to a source station. If the requested file type is a shard type, then step 503 is entered.
503. An attempt is made to read the corresponding local tile file.
In the step, an attempt is first made to read the corresponding local fragmented file from the local storage, if the reading is successful, the corresponding local fragmented file is directly returned to the client, if the reading is unsuccessful, the resource request is dispatched to the back-source module, the back-source module initiates the resource request to the source station node, the corresponding fragmented file is obtained from the source station, and the fragmented file returned from the source station end is returned to the client.
504. And returning the read local fragment file to the client.
The local fragment file is obtained by performing fragment packaging in a source station end through a preset streaming media and synchronously uploading the fragment file to the local.
Specifically, after acquiring a live stream of a target channel, a source station re-packs the live stream through a live stream packing module in the source station, where the preset stream media protocol may be based on an HLS/DASH stream media protocol, and the live stream packing module outputs a fragment file and an index file based on the HLS/DASH stream media protocol. The fragment files are synchronously uploaded to all the edge nodes through an uploading management module in the source station end, so that the client can directly hit the edge nodes when accessing the channel, and the fragment files corresponding to the resource request are returned to the client through the edge nodes without returning to the source station node to request the fragment files.
In the embodiment of the invention, the live stream is fragmented and packaged in the source station end, and is synchronously sent to the edge node under the condition of meeting the condition, and the complexity of the edge node is reduced because the fragmentation and packaging are not carried out in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a source-side device according to an embodiment of the present invention, and as shown in fig. 6, the source-side device includes:
a first obtaining module 601, configured to obtain a live stream of a target channel;
a processing module 602, configured to perform fragment packing on the live stream through a preset streaming media protocol, to obtain a fragment file and an index file of the live stream, and store the fragment file and the index file;
a first judging module 603, configured to judge whether the fragmented file needs to be uploaded to an edge node synchronously;
a synchronization module 604, configured to upload the fragmented file to an edge node synchronously if needed, so that a resource request of a client hits the fragmented file in the edge node, and return the fragmented file corresponding to the resource request to the client through the edge node.
Optionally, as shown in fig. 7, the first determining module 603 includes:
a maintenance unit 6031 configured to maintain mapping information of a target channel and an index file, and mark a latest access timestamp of the target channel;
an obtaining unit 6032, configured to obtain a current timestamp when the live stream is subjected to fragment packaging;
a calculation unit 6033 configured to calculate a difference between the current timestamp and the latest access timestamp;
a determining unit 6034, configured to determine that the fragmented file needs to be uploaded to the edge node synchronously when a difference between the current timestamp and the latest access timestamp is smaller than a preset threshold.
In this embodiment, by performing fragment packing on a live stream in a source station and synchronizing to an edge node when a condition is satisfied, the complexity of the edge node is reduced because fragment packing is not performed in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an edge node apparatus according to an embodiment of the present invention, and as shown in fig. 8, the edge node apparatus includes:
a second obtaining module 801, configured to obtain resource request information of a client, where the resource request information includes a request file type;
a second judging module 802, configured to judge whether the requested file type is a media type;
a reading module 803, configured to try to read a corresponding local fragmented file if the requested file type is a fragmented type, where the local fragmented file is fragmented and packaged in a source station by using a preset streaming media, and is synchronously uploaded to a local fragmented file;
a first returning module 804, configured to return the read local shard file to the client.
In this embodiment, by performing fragment packing on a live stream in a source station and synchronizing to an edge node when a condition is satisfied, the complexity of the edge node is reduced because fragment packing is not performed in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
Optionally, as shown in fig. 9, the edge node apparatus further includes:
a forwarding module 805, configured to forward the media request to the source station if the corresponding local fragment file is not read;
a second returning module 806, configured to return the fragmented file returned by the source station to the client.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a client device according to an embodiment of the present invention, and as shown in fig. 10, the client device includes:
a request module 1001, configured to request a content management end for a target channel playing resource, and receive a playing resource locator of a target channel returned by the content management end;
a generating module 1002, configured to generate first resource request information according to the play resource locator;
a sending module 1003, configured to send the first resource request information to an edge node, and obtain a target resource file through the edge node;
a receiving module 1004, configured to receive the target resource file returned by the edge node
Optionally, as shown in fig. 11, the sending module 1003 includes:
a first sending unit 10031, configured to send the index file request to an edge node, and forward the index file request to a source end through the edge node;
a receiving unit 10032, configured to receive an index file returned by the edge node, where the index file is an index file returned by the source station to the edge node;
an analyzing unit 10033, configured to analyze the index file to obtain a fragment file list in the index file;
a generating unit 10034, configured to sequentially generate, according to the fragmented file list, second resource requests corresponding to each fragmented file in the fragmented file list;
a second sending unit 10035, configured to send the second resource request to an edge node, and obtain, by the edge node, a corresponding local fragment file as a target resource file, where the local fragment file is a fragment file that is synchronously returned to the edge node when the source station returns an index file to the edge node, so that the second resource request is hit in the edge node.
In this embodiment, by performing fragment packing on a live stream in a source station and synchronizing to an edge node when a condition is satisfied, the complexity of the edge node is reduced because fragment packing is not performed in the edge node; in addition, the constraint and limitation of the direct broadcast stream coding format in the stream relay mode are avoided, so that the flexibility and the applicability are improved.
An embodiment of the present invention provides an electronic device, including: the device comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps in the live broadcast acceleration method provided by the embodiment of the invention when executing the computer program.
The embodiment of the invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the live broadcast acceleration method provided by the embodiment of the invention are realized.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules illustrated are not necessarily required to practice the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative
In addition, the processors and chips in the embodiments of the present invention may be integrated into one processing unit, may exist alone physically, or may be integrated into one unit by two or more hardware. The computer-readable storage medium or the computer-readable program may be stored in a computer-readable memory. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing is a more detailed description of the present invention in connection with specific preferred embodiments thereof, and it is not intended that the specific embodiments of the present invention be limited to these descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (10)
1. A live broadcast acceleration method is used for a source station end, and is characterized by comprising the following steps:
acquiring a live stream of a target channel;
carrying out fragment packing on the live stream through a preset streaming media protocol to obtain a fragment file and an index file of the live stream and storing the fragment file and the index file;
judging whether the fragment file needs to be synchronously uploaded to an edge node or not;
and if so, synchronously uploading the fragment files to an edge node so that the resource request of the client hits the fragment files in the edge node, and returning the fragment files corresponding to the resource request to the client through the edge node.
2. The live broadcast acceleration method of claim 1, wherein the determining whether the fragmented file needs to be uploaded to an edge node synchronously comprises:
maintaining mapping information of a target channel and an index file, and marking a latest access timestamp of the target channel;
acquiring a current timestamp of the live stream when the live stream is subjected to fragment packaging;
calculating a difference between the current timestamp and the latest access timestamp;
and when the difference value between the current timestamp and the latest access timestamp is smaller than a preset threshold value, judging that the fragment file needs to be synchronously uploaded to the edge node.
3. A live broadcast acceleration method is used for an edge node, and is characterized by comprising the following steps:
acquiring resource request information of a client, wherein the resource request information comprises a request file type;
judging whether the type of the request file is a fragment type;
if the type of the request file is a fragment type, attempting to read a corresponding local fragment file, wherein the local fragment file is a fragment file which is fragmented and packaged in a source station end through a preset streaming media and synchronously uploaded to the local;
and returning the read local fragment file to the client.
4. A live acceleration method as defined in claim 3, characterized in that the method further comprises:
if the corresponding local fragment file cannot be read, forwarding the media request to the source station end;
and returning the fragmentation file returned by the source station end to the client.
5. A live broadcast acceleration method is used for a client side, and is characterized by comprising the following steps:
requesting a target channel playing resource from a content management terminal, and receiving a playing resource locator of a target channel returned by the content management terminal;
generating first resource request information according to the playing resource locator;
sending the first resource request information to an edge node, and acquiring a target resource file through the edge node;
and receiving the target resource file returned by the edge node.
6. The live broadcast acceleration method of claim 5, wherein the first resource request information includes an index file request, the sending of the first resource request information to an edge node, and the obtaining of the target resource file by the edge node comprises:
sending the index file request to an edge node, and forwarding the index file request to a source station end through the edge node;
receiving an index file returned by the edge node, wherein the index file is the index file returned by the source station end to the edge node;
analyzing the index file to obtain a fragment file list in the index file;
sequentially generating second resource requests corresponding to all the fragmented files in the fragmented file list according to the fragmented file list;
and sending the second resource request to an edge node, and acquiring a corresponding local fragment file as a target resource file through the edge node, wherein the local fragment file is a fragment file synchronously returned to the edge node when the source station returns an index file to the edge node, so that the second resource request is hit in the edge node.
7. A source-side apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a live stream of a target channel;
the processing module is used for carrying out fragmentation and packaging on the live stream through a preset streaming media protocol to obtain a fragmentation file and an index file of the live stream and storing the fragmentation file and the index file;
the first judgment module is used for judging whether the fragment files need to be synchronously uploaded to the edge nodes;
and the synchronization module is used for synchronously uploading the fragment files to the edge node if necessary, so that the resource request of the client hits the fragment files in the edge node, and the fragment files corresponding to the resource request are returned to the client through the edge node.
8. An edge node apparatus, the apparatus comprising:
the second acquisition module is used for acquiring resource request information of the client, wherein the resource request information comprises a request file type;
the second judging module is used for judging whether the type of the request file is a media type;
the reading module is used for trying to read a corresponding local fragment file if the type of the request file is a fragment type, wherein the local fragment file is a fragment file which is fragmented and packaged in a source station end through a preset streaming media and synchronously uploaded to the local fragment file;
and the first returning module is used for returning the read local fragment file to the client.
9. A client device, the device comprising:
the request module is used for requesting a target channel playing resource from a content management terminal and receiving a playing resource locator of the target channel returned by the content management terminal;
a generating module, configured to generate first resource request information according to the play resource locator;
the sending module is used for sending the first resource request information to an edge node and obtaining a target resource file through the edge node;
and the receiving module is used for receiving the target resource file returned by the edge node.
10. A live broadcast system, the system comprising: the system comprises a source station end, an edge node, a client and a content management end; wherein,
the source station end is used for executing the live broadcast acceleration method of claim 1 or 2;
the edge node is configured to perform the live acceleration method of claim 3 or 4;
the client is used for executing the live acceleration method of claim 5 or 6;
the content management terminal is used for maintaining or creating channel information in the source station terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010036207.XA CN111541903A (en) | 2020-01-14 | 2020-01-14 | Live broadcast acceleration method, source station end, edge node, client and live broadcast system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010036207.XA CN111541903A (en) | 2020-01-14 | 2020-01-14 | Live broadcast acceleration method, source station end, edge node, client and live broadcast system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111541903A true CN111541903A (en) | 2020-08-14 |
Family
ID=71978505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010036207.XA Pending CN111541903A (en) | 2020-01-14 | 2020-01-14 | Live broadcast acceleration method, source station end, edge node, client and live broadcast system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111541903A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112118461A (en) * | 2020-09-22 | 2020-12-22 | 湖南快乐阳光互动娱乐传媒有限公司 | Audio and video file storage and distribution method and device |
CN112822051A (en) * | 2021-01-06 | 2021-05-18 | 贵阳迅游网络科技有限公司 | Service acceleration method based on service perception |
CN114024954A (en) * | 2021-10-27 | 2022-02-08 | 北京达佳互联信息技术有限公司 | Information transmission method, device and storage medium |
CN114257503A (en) * | 2021-11-19 | 2022-03-29 | 网宿科技股份有限公司 | Method, server, system and storage medium for accelerating domain name deployment |
WO2022166591A1 (en) * | 2021-02-05 | 2022-08-11 | 北京金山云网络技术有限公司 | Method and apparatus for playing live streaming resource, and storage medium and electronic device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1889558A (en) * | 2006-07-20 | 2007-01-03 | 华为技术有限公司 | Program channel difference processing method in IPIV bearing network |
CN101420603A (en) * | 2008-09-05 | 2009-04-29 | 中兴通讯股份有限公司 | Method for implementing media distribution, positioning by segmented memory and stream media system thereof |
US20130318229A1 (en) * | 2012-05-25 | 2013-11-28 | Netapp, Inc. | Method and system for name space propagation and file caching to remote nodes in a storage system |
CN103634610A (en) * | 2012-08-24 | 2014-03-12 | 中兴通讯股份有限公司 | Live content distribution system and method |
US20150242397A1 (en) * | 2013-06-19 | 2015-08-27 | Tencent Technology (Shenzhen) Company Limited | Method, server and system for managing content in content delivery network |
CN109787983A (en) * | 2019-01-24 | 2019-05-21 | 北京百度网讯科技有限公司 | Live stream dicing method, device and system |
-
2020
- 2020-01-14 CN CN202010036207.XA patent/CN111541903A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1889558A (en) * | 2006-07-20 | 2007-01-03 | 华为技术有限公司 | Program channel difference processing method in IPIV bearing network |
CN101420603A (en) * | 2008-09-05 | 2009-04-29 | 中兴通讯股份有限公司 | Method for implementing media distribution, positioning by segmented memory and stream media system thereof |
US20130318229A1 (en) * | 2012-05-25 | 2013-11-28 | Netapp, Inc. | Method and system for name space propagation and file caching to remote nodes in a storage system |
CN103634610A (en) * | 2012-08-24 | 2014-03-12 | 中兴通讯股份有限公司 | Live content distribution system and method |
US20150242397A1 (en) * | 2013-06-19 | 2015-08-27 | Tencent Technology (Shenzhen) Company Limited | Method, server and system for managing content in content delivery network |
CN109787983A (en) * | 2019-01-24 | 2019-05-21 | 北京百度网讯科技有限公司 | Live stream dicing method, device and system |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112118461A (en) * | 2020-09-22 | 2020-12-22 | 湖南快乐阳光互动娱乐传媒有限公司 | Audio and video file storage and distribution method and device |
CN112118461B (en) * | 2020-09-22 | 2022-10-18 | 湖南快乐阳光互动娱乐传媒有限公司 | Audio and video file storage and distribution method and device |
CN112822051A (en) * | 2021-01-06 | 2021-05-18 | 贵阳迅游网络科技有限公司 | Service acceleration method based on service perception |
CN112822051B (en) * | 2021-01-06 | 2022-09-16 | 贵阳迅游网络科技有限公司 | Service acceleration method based on service perception |
WO2022166591A1 (en) * | 2021-02-05 | 2022-08-11 | 北京金山云网络技术有限公司 | Method and apparatus for playing live streaming resource, and storage medium and electronic device |
CN114024954A (en) * | 2021-10-27 | 2022-02-08 | 北京达佳互联信息技术有限公司 | Information transmission method, device and storage medium |
CN114024954B (en) * | 2021-10-27 | 2024-02-06 | 北京达佳互联信息技术有限公司 | Information transmission method, device, server and storage medium |
CN114257503A (en) * | 2021-11-19 | 2022-03-29 | 网宿科技股份有限公司 | Method, server, system and storage medium for accelerating domain name deployment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111541903A (en) | Live broadcast acceleration method, source station end, edge node, client and live broadcast system | |
US10601887B2 (en) | Stream handling using an intermediate format | |
US9038116B1 (en) | Method and system for recording streams | |
US11477262B2 (en) | Requesting multiple chunks from a network node on the basis of a single request message | |
US8578042B2 (en) | Method, system and device for playing streaming media | |
US8769614B1 (en) | Security framework for HTTP streaming architecture | |
CN104581374B (en) | A kind of method, node and server for obtaining section file and generating sub- m3u8 files | |
US20120110138A1 (en) | Method, system and network device for implementing http-based streaming service | |
CA2883195C (en) | System and method for delivering an audio-visual content to a client device | |
US10313478B2 (en) | Redirection in a content delivery network | |
CN105282627A (en) | Method for acquiring a live video clip and server | |
US11503098B2 (en) | Embedding MQTT messages in media streams | |
JP7178998B2 (en) | Resource segmentation to improve delivery performance | |
TW201332343A (en) | Virtualization in adaptive stream creation and delivery | |
CN103813185B (en) | A kind of method that segment programs are quickly distributed, server and client | |
WO2017028675A1 (en) | Playing method, device and system for live streaming channel | |
WO2011090715A2 (en) | Edge server for format-agnostic streaming architecture | |
JP6338709B2 (en) | Streaming apparatus and method thereof, streaming service system using the same, and computer-readable recording medium (streaming apparatus and method thereof, streaming service system using the streaming medium and computer readable) | |
CN111246314B (en) | Time-shifting live broadcast method, server device, client device and live broadcast system | |
CN107920072B (en) | Multimedia sharing method and system based on data characteristics | |
WO2023061060A1 (en) | Audio and video code stream scheduling method, system, medium and electronic apparatus | |
US20240155019A1 (en) | Synchronizing independent media and data streams using media stream synchronization points | |
CN111355979B (en) | Online audio rapid playing method | |
Mekuria et al. | Multi-protocol video delivery with late trans-muxing | |
CN103796035A (en) | Method for processing segmented programs, server and client device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200814 |
|
RJ01 | Rejection of invention patent application after publication |