Disclosure of Invention
An objective of the embodiments of the present application is to provide a method, an apparatus, a computing device, and a storage medium for processing a source back, so as to solve the problem in the prior art that a client that a media file request does not hit a content distribution system for storage needs to wait for the source back processing, resulting in long pull time and live broadcast clip.
According to one aspect of the present application, there is provided a back source processing method, wherein the method includes:
receiving an index file request sent by a client, and forwarding the index file request to a source station server;
receiving an index file returned by the source station server in response to the index file request, and forwarding the index file to the client;
analyzing the index file, and initiating a source-returning request for requesting at least one media slice file to a source station server under the condition that the index file contains a pre-cache tag of the at least one media slice file; at least one media slice file is a media slice file to be produced;
at least one media slice file returned by the source station server is received and stored.
Optionally, the receiving the at least one media slice file returned by the source station server is specifically: receiving at least one media slice file which is transmitted back while being produced by a source station server;
after storing the at least one media slice file, the method further comprises: after the production of the at least one media slice file is finished, the source station server updates the index file so that the media file list of the updated index file contains the file name of the at least one media slice file.
Optionally, after the source station server updates the index file, the method further comprises:
receiving an index file request sent by a client, and forwarding the index file request to a source station server;
receiving an updated index file returned by the source station server in response to the index file request, and forwarding the updated index file to the client;
and receiving a media file request sent by the client based on the updated index file, and transmitting the stored at least one media slice file back to the client.
Optionally, the pre-cache tag records a file name of at least one media slice file.
Optionally, receiving the at least one media slice file returned by the source station server further comprises:
receiving at least one media slice file returned by the source station server through a communication link established by the source station server; wherein the communication link is established by the source station server upon receipt of the back source request and is broken upon completion of production of the at least one media slice file.
According to another aspect of the present application, there is provided a source-back processing method, wherein the method includes:
receiving an index file request sent by a client terminal and forwarded by a content distribution system, and returning the index file to the client terminal through the content distribution system;
Receiving a source returning request which is initiated by the content distribution system through analyzing the index file to obtain a pre-cache label and used for requesting at least one media slice file; at least one media slice file is a media slice file to be produced;
the at least one media slice file is returned to the content distribution system for storage by the content distribution system.
Optionally, returning at least one media slice file to the content distribution system is specifically: returning at least one media slice file to the content distribution system while producing;
the method further comprises the steps of: after the production of the at least one media slice file is finished, updating the index file so that a media file list of the updated index file contains the file name of the at least one media slice file.
Optionally, the method further comprises: after receiving the back source request, establishing a communication link;
the returning of the at least one media slice file to the content distribution system is specifically: returning at least one media slice file to the content distribution system via the communication link;
the method further comprises the steps of: after the production of the at least one media slice file is completed, the communication link is disconnected.
According to another aspect of the present application, there is provided a back source processing apparatus, wherein the apparatus includes:
The first transceiver module is suitable for receiving the index file request sent by the client and forwarding the index file request to the source station server;
the second transceiver module is suitable for receiving the index file returned by the source station server in response to the index file request and forwarding the index file to the client;
the analysis module is suitable for analyzing the index file;
a pre-source-return module adapted to initiate a source-return request to the source server for requesting the at least one media slice file if the index file contains a pre-cache tag for the at least one media slice file; at least one media slice file is a media slice file to be produced;
the media file receiving and transmitting module is suitable for receiving at least one media slice file returned by the source station server;
the storage module is suitable for storing at least one media slice file.
Optionally, the media file transceiving module is further adapted to: receiving at least one media slice file which is transmitted back while being produced by a source station server;
after storing the at least one media slice file, the source station server updates the index file after the production of the at least one media slice file is finished, so that a media file list of the updated index file contains the file name of the at least one media slice file.
Optionally, the first transceiver module is further adapted to: after the source station server updates the index file, receiving an index file request sent by the client, and forwarding the index file request to the source station server;
the second transceiver module is further adapted to: receiving an updated index file returned by the source station server in response to the index file request, and forwarding the updated index file to the client;
the media file transceiving module further begins with: and receiving a media file request sent by the client based on the updated index file, and transmitting the stored at least one media slice file back to the client.
Optionally, the pre-cache tag records a file name of at least one media slice file.
Optionally, the media file transceiving module is further adapted to: receiving at least one media slice file returned by the source station server through a communication link established by the source station server; wherein the communication link is established by the source station server upon receipt of the back source request and is broken upon completion of production of the at least one media slice file.
According to another aspect of the present application, there is provided a back source processing apparatus, wherein the apparatus includes:
the third receiving and transmitting module is suitable for receiving an index file request sent by the client terminal and forwarded by the content distribution system, and transmitting the index file back to the client terminal through the content distribution system;
A fourth transceiver module adapted to receive a source-returning request initiated by the content distribution system by parsing the index file to obtain a pre-cache tag for requesting at least one media slice file; the at least one media slice file is the media slice file to be produced and is returned to the content distribution system for storage by the content distribution system.
In an alternative, the fourth transceiver module is further adapted to: returning at least one media slice file to the content distribution system while producing;
the apparatus further comprises: and the file updating module is suitable for updating the index file after the production of the at least one media slice file is finished, so that the media file list of the updated index file contains the file name of the at least one media slice file.
In an alternative, the apparatus further comprises: the link processing module is suitable for establishing a communication link after receiving the source return request;
the fourth transceiver module is further adapted to: returning at least one media slice file to the content distribution system via the communication link;
the link handling module is further adapted to: after the production of the at least one media slice file is completed, the communication link is disconnected.
According to yet another aspect of the present application, there is provided a computing device comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the source-returning processing method.
According to still another aspect of the present application, there is provided a computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the above-described back-source processing method.
According to the method, the device, the computing equipment and the storage medium for processing the back source, on one hand, when the index file is manufactured, the pre-cache label of the media slice file to be produced is additionally added in the index file, when the client initiates an index file request, the index file is returned to the client and the content distribution system, the content distribution system analyzes the pre-cache label in the index file, requests the media slice file corresponding to the back source pre-cache label from the source station server, and the media slice file is downloaded to the content distribution system without the end of production of the media slice file, but not downloaded to the back source again under the condition that the corresponding media slice file is not stored in the content distribution system when the media file is requested, so that the media file request of the client can be stored in the content distribution system, the pull time of the client can be reduced, the client click rate can be reduced, and the user playing experience can be optimized; in still another aspect, when the source station server receives a source return request of the content distribution system, a communication link with the content distribution system is established to transmit a media slice file to be produced, and the media slice file to be produced is disconnected after the production of the media slice file to be produced is finished, so that the accuracy of data transmission can be ensured, and the occupied resources can be released in time by timely disconnecting the communication link.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
First, terms related to one or more embodiments of the present application will be explained.
Live stream: the transmission of video-on-demand data, which can be transmitted as a steady and continuous stream over a network to a viewer for viewing.
Live broadcast stream pulling: the method refers to a process of pulling a live stream from a live cloud platform to a source station designated by a user.
Content distribution system: the CDN (Content Delivery Network) system is an advanced flow distribution network constructed on the existing network, a new network architecture is added in the existing network, the content of the website is distributed to the network 'edge' closest to the user, the response speed of the user for accessing the website is improved, the load balancing is achieved, the CDN has the functions of caching, mirroring and overall load balancing, and the static data in the website is mainly cached.
And the CDN edge node is used for covering the server node of the corresponding area user.
And the CDN source station returns to the central node of source resource collection.
The source station server: and a service device for producing the live stream as a media slice file.
And (3) source returning treatment: the content distribution system initiates a process to the content provider that returns a source request to pull the direct broadcast content.
Index file: files used for recording media file information in HLS live protocols.
Media slice file: and the HLS live broadcast protocol is used for storing and playing files of audio and video data.
Fig. 1 shows a flowchart of a source-back processing method provided in an embodiment of the present application, where the method of the embodiment is applied to a content distribution system, as shown in fig. 1, and the method includes the following steps:
step S110, receiving an index file request sent by a client, and forwarding the index file request to a source station server.
In the HLS live broadcast system, when viewing HLS live broadcast stream, a client is required to request an index file first, after the client requests the index file, a media file list in the index file is obtained, and then a media slice file is requested according to the media file list and played.
The index file is made by the source station server, the source station server slices the live stream to generate a media slice file, and when the production of the media slice file is finished, the source station server updates the file name of the produced media slice file into a media file list of the index file. With the continuous streaming of the live broadcast end, the server of the source station can continuously produce new media slice files, so that the index files are continuously updated, the client needs to continuously request the index files, and the client requests the index files to be updated every time.
Wherein the index file request is used to obtain the index file. And the client initiates an index file request to the content distribution system, and the content distribution system forwards the index file request of the client to the source station server.
In step S120, the source server receives the index file returned by the source server in response to the index file request, and forwards the index file to the client.
The source station server responds to the index file request forwarded by the content distribution system, the index file is returned to the content distribution system, and the content distribution system forwards the index file to the client.
After receiving the index file, the client initiates a media file request to the content distribution system according to a media file list contained in the index file, so as to obtain a corresponding media slice file.
In step S130, the index file is parsed, and a source-back request for requesting at least one media slice file is initiated to the source server in case the index file contains a pre-cached tag of the at least one media slice file.
After the content distribution system receives the index file, the index file is analyzed, a pre-cache tag of at least one media slice file contained in the index file is obtained, and a source return request is initiated to the source station server for downloading the at least one media slice file corresponding to the pre-cache tag.
The pre-cache tag is a field additionally added to the index file, and the content distribution system is identifiable, but the client is not identifiable, so as to instruct the content distribution system to request the media slice file corresponding to the source pre-cache tag from the source server, which is different from the media slice file at the end of production, and the media slice file corresponding to the pre-cache tag refers to the media slice file to be produced, such as the media slice file in production and the media slice file to be produced.
In the method of this embodiment, when the source server creates the index file, in addition to updating the media file list of the index file according to at least one media slice file that is completed in production, at least one pre-cache tag of the media slice file to be produced is added to the index file.
In step S140, at least one media slice file returned by the source station server is received, and the at least one media slice file is stored.
The source station server responds to a source returning request of the content distribution system and returns at least one media slice file corresponding to the pre-cache label to the content distribution system, and the content distribution system stores the received at least one media slice file.
In the prior art, since the client can only update the media slice file to the media file list of the index file after the production of the media slice file is completed, and the client can only request the media file according to the media file list of the index file and can only multiplex the stored media slice file after the content distribution system finishes storing the media slice file in the back source, for the first client requesting the media slice file by using the index file, the requested media slice file will not exist in the content distribution system, the content distribution system needs to request the media slice file requested by the back source client to the source server, and the client needs to wait for a long time to successfully pull the stream after the downloading is completed.
The method of this embodiment is described below with a specific example, assuming that the production sequence number of the media slice file is identified by the sequence number, and under the current update occasion, the media slice file after the production is completed includes the media slice file 1-3, that is, the media slice file to be produced includes the media slice file 4-6, the index file includes the media file list corresponding to the media slice file 1-3 and the pre-cache tag corresponding to the media slice file 4-6, at this time, the client requests the index file, the client requests the media slice file 1-3 from the content distribution system according to the index file, and the content distribution system requests the media slice file 4-6 from the source station server; with continuous production of the source server, when the next update time is reached, the production of the 4-6 number media slice file is finished, the currently to-be-produced media slice file comprises 7-9 number media slice files, the index file comprises a media file list corresponding to the 4-6 number media slice files and a pre-cache tag corresponding to the 7-9 number media slice files, at the moment, the client requests the index file, the client requests the 4-6 number media slice files according to the index file, the 4-6 number media slice files are already stored in the content distribution system, and the content distribution system directly returns the stored media slice files. In short, for any media slice file, the media slice file is transmitted back to the content distribution system in the production process, so when the production end of the media slice file is updated to the index file and the client requests the media slice file according to the index file, the content distribution system already stores the media slice file, thereby avoiding the problem that the media file request cannot hit the content distribution system for storage.
In summary, according to the method for processing a playback source provided in this embodiment, when an index file is manufactured, a pre-cache tag of a media slice file to be produced is additionally added in the index file, when a client initiates an index file request, the index file is returned to the client and the content distribution system, the content distribution system analyzes the pre-cache tag in the index file, requests the media slice file corresponding to the playback source pre-cache tag from the source server, and by the above manner, the media slice file is downloaded to the content distribution system without the production end, but is downloaded to the playback source without the content distribution system storing the corresponding media slice file when the media file is requested, so that the media file request of the client can be stored in the content distribution system, the client pull time can be reduced, the client clip rate can be reduced, and the user playing experience can be optimized.
Fig. 2 shows a flowchart of a back source processing method according to another embodiment of the present application, where the method is applied to a content distribution system, and as shown in fig. 2, the method includes the following steps:
step S210, receiving an index file request sent by a client, and forwarding the index file request to a source station server.
In step S220, the source station server receives the index file returned in response to the index file request, and forwards the index file to the client.
The index file request is used to obtain an index file. The client initiates an index file request to the content distribution system, the content distribution system forwards the index file request of the client to the source station server, and the source station server responds to the index file request to transmit the index file back to the content distribution system, and then the content distribution system transmits the index file back to the client.
The index file is made by the source station server, and when the source station server makes the index file, the source station server updates a media file list of the index file according to at least one media slice file which is finished in production, and at least one pre-cache label of the media slice file to be produced is added in the index file.
After receiving the index file, the client requests the corresponding media slice file from the content distribution system according to the media file list contained in the index file.
Step S230, analyzing the index file, and initiating a source-returning request for requesting at least one media slice file to a source station server under the condition that the index file contains a pre-cache tag of the at least one media slice file; the at least one media slice file is the media slice file to be produced.
After the content distribution system receives the index file, the index file is analyzed, a pre-cache tag of at least one media slice file contained in the index file is obtained, and a source return request is initiated to the source station server for downloading the at least one media slice file corresponding to the pre-cache tag.
The pre-cache label is a field additionally added to the index file, the content distribution system is identifiable, but the client is not identifiable, and the pre-cache label is used for indicating the content distribution system to download at least one media slice file corresponding to the pre-cache label to the source station server, and the at least one media slice file corresponding to the pre-cache label is the media slice file to be produced.
Optionally, the pre-cache tag records a file name of at least one media slice file, after the content distribution system receives the index file, the content distribution system analyzes the index file to obtain the pre-cache tag contained in the index file, and initiates a source return request to the source station server so as to download the media slice file corresponding to the file name of the at least one media slice file recorded by the pre-cache tag.
Optionally, the pre-cache tag consists of the specified character and the filename of the media slice file, e.g., EXT-X-BILI-PERFRETCH: URL=27019223. M4 split, where EXT-X-BILI-PERFRETCH is the specified character and URL=27019223. M4 split is the filename of the media slice file. The content distribution system firstly identifies the appointed character in the index file, and then obtains the file name associated with the appointed character, and the file name of the media slice file to be downloaded is obtained.
In step S240, at least one media slice file that is transmitted back while being produced by the source station server is received, and the at least one media slice file is stored.
The source station server transmits the produced file data to the content distribution system while producing the media slice file to be produced, namely the media slice file which is not produced yet, and the content distribution system stores the received file data.
Specifically, at least one media slice file returned by the source station server is received through a communication link established by the source station server, wherein the communication link is established by the source station server after receiving the source return request, and is disconnected after the production of the at least one media slice file to be produced is finished. In this way, the communication link is established to transmit the media slice file being produced, and the communication link is disconnected after the production is finished, so that the accuracy of data transmission can be ensured, and the occupied resources can be released in time by disconnecting the communication link in time.
In step S250, after the production of at least one media slice file is completed, the source server updates the index file so that the media file list of the updated index file contains the file name of the at least one media slice file.
When the production of the at least one media slice file to be produced is finished, the index file updating time is reached, at this time, the source station server updates the file name of the media slice file which is finished in the updating time into the media file list of the index file, and meanwhile, a pre-cache label is generated according to the file name of the at least one media slice file to be produced in the updating time and updated into the index file, so that the updated index file is obtained.
Step S260, receiving an index file request sent by a client, and forwarding the index file request to a source station server; receiving an updated index file returned by the source station server in response to the index file request, and forwarding the updated index file to the client; and receiving a media file request sent by the client based on the updated index file, and transmitting the stored at least one media slice file back to the client.
The client initiates an index file request again, the content distribution system forwards the index file request to the source station server, the source station server responds to the index file request and returns an updated index file to the content distribution system, and the content distribution system returns the updated index file to the client; the client receives the updated index file, extracts a media file list, requests a media slice file corresponding to a file name contained in the media file list from the content distribution system, the media slice file corresponding to the media file list of the updated index file is stored in the content distribution system through returning the source in advance, the media file request of the client can hit the storage content of the content distribution system, and the stored media slice file is returned to the client.
Fig. 3 shows a schematic diagram of a source return flow in the prior art, specifically as follows: each user side requests HLS live stream, and the client side requests to the CDN edge server; if the request does not hit the CDN edge server, returning to the CDN source station; if the request also does not hit the CDN source station, the source request is returned to the source station server to download the media slice file requested by the client, and other clients can utilize the media file cache only after waiting for the cache to be constructed successfully, wherein the live stream of the host is pushed to the source station server through the upstream edge server, and the live stream is pushed by RTMP (Real Time Messaging Protocol, real-time message transfer protocol). Therefore, the source returning process needs to return to the live source station server, the middle is transmitted through at least two layers of links, the network delay is very obvious, the streaming time is greatly prolonged, and when the source returning of the first user is finished, other users can multiplex the cache after waiting for the source returning of the first user, so that the source returning process in the prior art can lead to longer streaming time of the client and high live blocking rate, thereby influencing the user experience.
Fig. 4 shows an interaction timing diagram of a live procedure for viewing by a client according to another embodiment of the present application, specifically including the following procedure steps:
Step 1, a client sends an index file request to the edge of a CDN;
step 2, the CDN edge forwards the index file request to the CDN source station;
step 3, the CDN source station transmits an index file request to a source station server;
step 4, the source station server returns an index file response to the CDN source station, namely, an m3u8 file is returned, and the source station server is assumed to update a media file list corresponding to the media slice file 1-3 which is produced and a pre-cache label corresponding to the media slice file 4-6 which is to be produced into the index file;
step 5, the CDN source station returns an index file response to the CDN edge, namely, a m3u8 file is returned;
step 6, the CDN edge returns an index file response to the client, namely, an m3u8 file is returned;
and 7, analyzing the index file by the CDN edge, and judging whether the index file contains a pre-cache label.
Step 8, if the pre-cache tag is included, the CDN edge requests the pre-cache file from the CDN source station, namely requests the pre-cache of the media slice file 4-6 to be produced;
step 9, the CDN source station requests the pre-cache file from the source station server;
step 10, the source station server returns a media file response, namely a returned media slice file, to the CDN source station, and the CDN source station caches the received media slice file, namely the source station server produces the media slice files 4-6 and transmits the produced data to the CDN source station.
In step 11, the CDN source returns a media file response to the CDN edge, that is, the media slice file 4-6 is returned, and the CDN edge caches the received media slice file 4-6.
Step 12, after the media slice file is written at the edge of the CDN, the index file is updated, that is, after the production of the media slice file is finished, the index file after updating contains the media file list corresponding to the media slice file 4-6 that has finished being produced and the pre-cache tag corresponding to the media slice file 7-9 to be produced.
The above steps 1 to 11 are processing flows after the client requests the index file, in which the flow that the client requests the media file according to the media file list of the index file is omitted, specifically: the client requests the corresponding media slice files 1-3 from the CDN edge according to the media file list in the index file, if the CDN caches the media slice files 1-3 requested by the client, the cached files are directly returned, otherwise, if the CDN edge does not cache the media slice files 1-3 requested by the client, the back source is needed.
Then, the client requests the updated index file, and the specific flow is as follows:
Step 13, the client sends an index file request to the CDN edge;
step 14, the CDN edge forwards the index file request to the CDN source station;
step 15, the CDN source station transmits an index file request to a source station server;
step 16, the source station server returns an index file response to the CDN source station, namely, an m3u8 file is returned, and the index file contains a media file list corresponding to the media slice file 4-6 after production and a pre-cache label corresponding to the media slice file 7-9 to be produced;
step 17, the CDN source station returns an index file response to the CDN edge, namely, a m3u8 file is returned;
step 18, the CDN edge returns an index file response to the client, namely, an m3u8 file is returned;
step 19, the client requests the media file from the CDN edge according to the media file list in the index file, namely requests the media slice file 4-6;
in step 20, the media file request hits the CDN edge cache, the CDN edge returns the media slice file requested by the client, the media slice file 4-6 is already cached in the CDN edge, and the media file request of the client can hit the CDN edge cache.
The above steps 13-20 are the processing flow after the client requests the updated index file, and the flow of the CDN requesting the back source media slice file according to the pre-cache tag in the updated index file, that is, the flow of the media slice file 7-9 to be produced by the back source is omitted, which is referred to in the foregoing description and will not be repeated here. The media file list of the updated index file corresponds to the media slice file 4-6, so that the client requests the media slice file 4-6 according to the updated index file, the media slice file 4-6 is cached in the edge of the CDN, and even the first client requesting the updated index file, the media file request can directly hit the cache of the CDN, so that the streaming time is greatly reduced, the live-broadcast click-through rate can be reduced, and the user experience is improved.
According to the back source processing method of the embodiment, when the source station server is used for manufacturing the index file, a pre-cache label of a media slice file to be produced is additionally added in the index file; when a client initiates an index file request, the index file is returned to the client and a content distribution system, the content distribution system analyzes a pre-cache tag in the index file, initiates a source return request to a source station server according to the pre-cache tag, establishes a communication link with the content distribution system after receiving the source return request, and returns a media slice file corresponding to the pre-cache tag while producing, so that the media slice file which is not produced is stored to the content distribution system in advance, but is returned to the source when the media file is requested to not hit the content distribution system, the advanced source return of the media slice file is realized, the media file request of the client can hit the content distribution system, the client pull time can be reduced, the client click rate can be reduced, the user playing experience can be optimized, further, the communication link is established for transmitting the file when the source return request is needed, the communication link is disconnected once the production of the media slice file is finished, the accuracy of data transmission can be ensured, and the resources occupied by the communication link can be released in time.
Fig. 5 shows a flowchart of a source-back processing method according to another embodiment of the present application, where the method of the present embodiment is applied to a source station server, as shown in fig. 5, and the method includes the following steps:
step S510, receiving an index file request sent by a client and forwarded by a content distribution system, and returning the index file to the client through the content distribution system.
Wherein the index file request is used to obtain the index file. And the client initiates an index file request to the content distribution system, and the content distribution system forwards the index file request of the client to the source station server.
The index file is made by the source station server, the source station server slices the live stream to generate a media slice file, and when the production of the media slice file is finished, the source station server updates the file name of the produced media slice file into a media file list of the index file.
The source station server responds to the index file request forwarded by the content distribution system, the index file is returned to the content distribution system, and the content distribution system forwards the index file to the client.
After receiving the index file, the client requests the corresponding media slice file from the content distribution system according to the media file list contained in the index file.
In step S520, a source-back request for requesting at least one media slice file initiated by the content distribution system by parsing the index file to obtain a pre-cache tag is received. Wherein the at least one media slice file is the media slice file to be produced.
After the content distribution system receives the index file, the index file is analyzed, a pre-cache label of at least one media slice file contained in the index file is obtained, and a source return request is initiated to the source station server for downloading the media slice file corresponding to the pre-cache label.
The pre-cache tag is a field additionally added to the index file, and the content distribution system is identifiable, but the client is not identifiable, so as to instruct the content distribution system to return the media slice file corresponding to the source pre-cache tag to the source station server, which is different from the media slice file at the end of production, and the media slice file corresponding to the pre-cache tag refers to the media slice file to be produced, such as the media slice file in production and the media slice file to be produced.
In the method of this embodiment, when the source server creates the index file, in addition to updating the media file list of the index file according to at least one media slice file that is completed in production, at least one pre-cache tag of the media slice file to be produced is added to the index file.
Optionally, the pre-cache tag records a file name of at least one media slice file, after the content distribution system receives the index file, the index file is parsed to obtain that the index file contains the pre-cache tag, and a source return request is initiated to the source station server so as to download the media slice file corresponding to the file name of the at least one media slice file recorded by the pre-cache tag.
Optionally, the pre-cache tag consists of the specified character and the filename of the media slice file, e.g., EXT-X-BILI-PERFRETCH: URL=27019223. M4 split, where EXT-X-BILI-PERFRETCH is the specified character and URL=27019223. M4 split is the filename of the media slice file. The content distribution system firstly identifies the appointed character in the index file, and then obtains the file name associated with the appointed character, and the file name of the media slice file to be downloaded is obtained.
At step S530, the at least one media slice file is returned to the content distribution system for storage by the content distribution system.
The source station server responds to a source returning request of the content distribution system and returns at least one media slice file corresponding to the pre-cache label to the content distribution system, and the content distribution system stores the received at least one media slice file.
Specifically, at least one media slice file is returned to the content distribution system while being produced. The source station server transmits the produced file data to the content distribution system while producing the media slice file to be produced, namely the media slice file which is not produced yet, and the content distribution system stores the received file data.
In an alternative way, after receiving the back source request, a communication link is established; returning at least one media slice file to the content distribution system via the communication link; after the production of the at least one media slice file is completed, the communication link is disconnected. In this way, the communication link is established to transmit the media slice file being produced, and the communication link is disconnected after the production is finished, so that the accuracy of data transmission can be ensured, and the occupied resources can be released in time by disconnecting the communication link in time.
After the production of the at least one media slice file is finished, updating the index file so that a media file list of the updated index file contains the file name of the at least one media slice file. After the production of at least one media slice file to be produced is finished, a new index file updating time is reached, at this time, the source station server updates the file name of the produced media slice file to a media file list of the index file, and at the same time, a pre-cache label is generated according to the file name of the next group of at least one media slice file to be produced and updated to the index file, so as to obtain the updated index file.
According to the method for processing the back source, when the source station server is used for manufacturing the index file, the pre-cache tag of the media slice file to be produced is additionally added in the index file, when the client initiates the index file request, the index file is returned to the client and the content distribution system, the content distribution system analyzes the pre-cache tag in the index file, requests the media slice file corresponding to the back source pre-cache tag to the source station server, and the media slice file is downloaded to the content distribution system without the end of production of the media slice file, instead of downloading the back source when the content distribution system does not store the corresponding media slice file when the media file is requested, so that the media file request of the client can be stored in the content distribution system, the client pull time can be reduced, the client clip rate can be reduced, and the user playing experience can be optimized.
Fig. 6 shows a schematic structural diagram of a source-back processing apparatus according to another embodiment of the present application, as shown in fig. 6, where the apparatus includes:
the first transceiver module 61 is adapted to receive an index file request sent by a client and forward the index file request to a source station server;
A second transceiver module 62 adapted to receive the index file returned by the source station server in response to the index file request, and forward the index file to the client;
the parsing module 63 is adapted to parse the index file;
a pre-fetch module 64 adapted to initiate a fetch request to the source server requesting at least one media slice file if the index file contains a pre-cache tag for the at least one media slice file; at least one media slice file is a media slice file to be produced;
a media file transceiving module 65 adapted to receive at least one media slice file returned by the source station server;
the storage module 66 is adapted to receive at least one media slice file returned by the source station server and store the at least one media slice file.
In an alternative way, the media file transceiving module 65 is further adapted to: receiving at least one media slice file which is transmitted back while being produced by a source station server;
after storing the at least one media slice file, the source station server updates the index file after the production of the at least one media slice file is finished, so that a media file list of the updated index file contains the file name of the at least one media slice file.
In an alternative way, the first transceiver module 61 is further adapted to: after the source station server updates the index file, receiving an index file request sent by the client, and forwarding the index file request to the source station server;
the second transceiver module 62 is further adapted to: receiving an updated index file returned by the source station server in response to the index file request, and forwarding the updated index file to the client;
the media file transceiving module 65 further begins with: and receiving a media file request sent by the client based on the updated index file, and transmitting the stored at least one media slice file back to the client.
In an alternative way, the pre-cache tag records the file name of at least one media slice file.
In an alternative way, the media file transceiving module 65 is further adapted to: receiving at least one media slice file returned by the source station server through a communication link established by the source station server; wherein the communication link is established by the source station server upon receipt of the back source request and is broken upon completion of production of the at least one media slice file.
Fig. 7 shows a schematic structural diagram of a source-back processing apparatus according to another embodiment of the present application, as shown in fig. 7, where the apparatus includes:
The third transceiver module 71 is adapted to receive the index file request sent by the client and forwarded by the content distribution system, and transmit the index file back to the client through the content distribution system;
a fourth transceiver module 72 adapted to receive a back source request initiated by the content distribution system by parsing the index file to obtain a pre-cache tag for requesting at least one media slice file; the at least one media slice file is the media slice file to be produced and is returned to the content distribution system for storage by the content distribution system.
In an alternative way, the fourth transceiver module 72 is further adapted to: returning at least one media slice file to the content distribution system while producing;
the apparatus further comprises: and the file updating module is suitable for updating the index file after the production of the at least one media slice file is finished, so that the media file list of the updated index file contains the file name of the at least one media slice file.
In an alternative, the apparatus further comprises: the link processing module is suitable for establishing a communication link after receiving the source return request;
the fourth transceiver module 72 is further adapted to: returning at least one media slice file to the content distribution system via the communication link;
The link handling module is further adapted to: after the production of the at least one media slice file is completed, the communication link is disconnected.
The embodiment of the application provides a non-volatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the source-returning processing method in any of the method embodiments.
FIG. 8 illustrates a schematic diagram of a computing device according to an embodiment of the present application, and the embodiments of the present application are not limited to a specific implementation of the computing device.
As shown in fig. 8, the computing device may include: a processor (processor) 802, a communication interface (Communications Interface) 804, a memory (memory) 806, and a communication bus 808.
Wherein: processor 802, communication interface 804, and memory 806 communicate with each other via a communication bus 808. A communication interface 804 for communicating with network elements of other devices, such as clients or other servers. The processor 802 is configured to execute the program 810, and may specifically perform relevant steps in the embodiments of the source-back processing method for a computing device.
In particular, program 810 may include program code including computer operating instructions.
The processor 802 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors included by the computing device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
Memory 806 for storing a program 810. The memory 806 may include high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, embodiments of the present application are not directed to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the present application as described herein, and the above description of specific languages is provided for disclosure of preferred embodiments of the present application.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the present application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the above description of exemplary embodiments of the application, various features of embodiments of the application are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the application and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed application requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this application.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the present application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components according to embodiments of the present application may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present application may also be embodied as an apparatus or device program (e.g., computer program and computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present application may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specifically stated.