The embodiments of the present disclosure relate to the technical field of live video broadcasting, and in particular to a method and system for compensating HLS slice loss.
HLS (HTTP Live broadcasting) is a protocol defined by Apple Inc. for real-time streaming transport, which is realized based on the HTTP protocol, and the transmission contents comprise two parts, namely, m3u8 description files and TS media files. At present, in the industry, the HLS live broadcasting scheme is generally realized via the Internet TCP protocol. However, due to uncertainties of network conditions, connection jitters sometimes occur between the internal nodes of relay distribution networks, resulting in pauses and frame losses during playing by the user, which greatly influences the user experience.
During the implementation process of the present disclosure, the inventor finds that the prior art at least has the following problem: in the framework of the prior art, communications between the upper and lower layers are based on one-way notification; therefore, even if the lower layer knows which specific slice is lost, it cannot notify the upper servers at higher layers of the lost slice, and thus cannot obtain the compensated slice in time.
In a first aspect, the present disclosure provides a method for compensating HLS slice loss. The method may include: configuring a compensation request agent on a lower server; transmitting by the lower server a subscription request to a plurality of upper servers corresponding thereto, and obtaining by the lower server slices issued by message issuing pools of the plurality of upper servers according to the subscription request; performing a slice loss detection by the lower server for the slice information received, and generating by the lower server a slice loss request when it is detected that a slice loss occurs; and transmitting by the compensation request agent the generated slice loss request to the plurality of upper servers.
In a second aspect, the present disclosure provides a system for compensating HLS slice loss. The system may include: lower servers each corresponding to a plurality of upper servers, the upper servers issuing slices by message issuing pools, the lower server including a slice obtaining module configured to transmit a subscription request to the plurality of upper servers and obtain slices issued by the message issuing pools of the plurality of upper servers, wherein, the lower server is also provided with a compensation request agent and a slice loss detecting module. The slice loss detecting module is configured to perform a slice loss detection for the slice information received, and generate a slice loss request when it is detected that a slice loss occurs. The compensation request agent is configured to transmit the generated slice loss request to the plurality of upper servers.
In a third aspect, the present disclosure provides a non-transitory computer-readable storage medium storing executable instructions. When executed by one or more processors, the instructions cause the one or more processors to: transmit a subscription request to the plurality of upper servers and obtain slices issued by the message issuing pools of the plurality of upper servers; perform a slice loss detection for slice information received, and generate a slice loss request when it is detected that a slice loss occurs; and transmit the generated slice loss request to the plurality of upper servers.
One or more embodiments are illustrated by way of example, and not by limitation, in the figures of the accompanying drawings, wherein elements having the same reference numeral designations represent like elements throughout. The drawings are not to scale, unless otherwise disclosed.
In order to make the purpose, technical solutions, and advantages of the embodiments of the disclosure more clearly, technical solutions of the embodiments of the present disclosure will be described clearly and completely in conjunction with the figures. Obviously, the described embodiments are merely part of the embodiments of the present disclosure, but not all embodiments. Based on the embodiments of the present disclosure, other embodiments obtained by the ordinary skill in the art without inventive efforts are within the scope of the present disclosure.
The terminology used in the present disclosure is for the purpose of describing exemplary embodiments only and is not intended to limit the present disclosure. As used in the present disclosure and the appended claims, the singular forms “a,” “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It shall also be understood that the terms “or” and “and/or” used herein are intended to signify and include any or all possible combinations of one or more of the associated listed items, unless the context clearly indicates otherwise.
It shall be understood that, although the terms “first,” “second,” “third,” etc. may include used herein to describe various information, the information should not be limited by these terms. These terms are only used to distinguish one category of information from another. For example, without departing from the scope of the present disclosure, first information may include termed as second information; and similarly, second information may also be termed as first information. As used herein, the term “if” may include understood to mean “when” or “upon” or “in response to” depending on the context.
Reference throughout this specification to “one embodiment,” “an embodiment,” “exemplary embodiment,” or the like in the singular or plural means that one or more particular features, structures, or characteristics described in connection with an embodiment is included in at least one embodiment of the present disclosure. Thus, the appearances of the phrases “in one embodiment” or “in an embodiment,” “in an exemplary embodiment,” or the like in the singular or plural in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics in one or more embodiments may include combined in any suitable manner.
The embodiments of the present disclosure provides a method and a system for compensating HLS slice loss in order to solve the problem that slice loss is likely to occur in the traditional HLS live broadcasting scheme and it is not possible to obtain the compensated slice in time when the slice loss occurs, thereby realizing real-time compensation for slice loss, and improving the terminal playing experience. By configuring a compensation request agent on the lower server, the method and system for compensating HLS slice loss provided by the embodiments of the present disclosure can transmit a slice loss request to the upper servers in time when it is detected that a slice loss occurs, so as to obtain a compensation in time and reduce the pausing phenomenon, thereby improving the terminal playing experience.
The followings will provide more detailed descriptions of the embodiments of the present disclosure with reference to the drawings.
So, the present disclosure provides a system and a method for compensating HLS slice loss to solve the deficiencies in the traditional live broadcasting framework and method.
As shown in
In this embodiment, the lower server is a server or a server cluster, wherein each module may be an individual server or server cluster; at this time, an interaction between the above modules manifest as an interaction between the server or server cluster corresponding to said each module, and the plurality of servers or server clusters jointly form the system for compensating HLS slice loss of this disclosure.
In particular, the system for compensating HLS slice loss of the present disclosure formed by the plurality of servers or server clusters together includes:
a slice obtaining server or server cluster configured to transmit a subscription request to the corresponding plurality of upper servers 1, receive message notifications from the upper servers, and obtain slices issued by the message issuing pools of the plurality of upper servers according to the subscription request;
a slice detecting server or server cluster configured to perform a slice loss detection for the received slice information issued by the plurality of upper servers, and generate a slice loss request when it is detected that a slice loss occurs;
a compensation request agent server or server cluster configured to transmit the generated slice loss request to the plurality of upper servers so as to obtain a slice loss compensation.
In an alternative embodiment, several modules of the above mentioned plurality of modules may jointly form a server or server cluster. For example: the slice obtaining module constitutes a first server or a first sever cluster, and the slice detecting module and the compensation request agent jointly form a second server or a second server cluster.
At this time, the interaction between the above modules manifests as an interaction between the first server and each second server or an interaction between the first server cluster and the second server clusters, and the first and second servers or the first and second server clusters jointly form the system for compensating HLS slice loss of the present disclosure.
As shown in
In this embodiment, the slice loss detecting module may be a server or a server cluster, wherein each of the above units may be an individual server or server cluster, and at this time, the interaction between the above units manifests as an interaction between the servers corresponding to each of the units.
In an alternative embodiment, one or two of the dumping unit and the slice loss request generating unit may jointly form a server or server cluster.
In this embodiment, the compensation request agent may be a server or a server cluster, wherein each of the above units may be an individual server or server cluster, at this time, the interaction between the above units manifests as the interaction between the servers corresponding to each of the units.
In an alternative embodiment, one or two of the connection establishing unit and the request broadcasting unit may jointly form a server or server cluster.
As shown in
Step S301 includes configuring a compensation request agent on a lower server.
The compensation request agent is configured on the lower server for establishing a TCP persistent connection with the message issuing pools of the upper servers, and when the slice loss occurs, broadcasting the slice loss request to the message issuing pools of all upper servers corresponding to the present machine.
Step S302 includes transmitting by the lower server a subscription request to a plurality of upper servers corresponding thereto, and obtaining by the lower server slices issued by message issuing pools of the plurality of upper servers according to the subscription request.
The lower server transmits the subscription request to the plurality of upper servers corresponding thereto according to the needs, and the message issuing pools of the upper servers will issue the slices to the corresponding subjects according to the received subscription request and transmit the issuing notifications to their lower servers. The lower server receives the issuing notifications from the upper servers, and obtains the slices according to the messages issued by the message issuing pools of the upper servers.
Step S303 includes performing a slice loss detection by the lower server according to the slice information received, and generating by the lower server a slice loss request when it is detected that a slice loss occurs.
After obtaining the slices, the lower server stores the slices in the local database according to the names of the slices, and at the same time, a slice loss detection will be performed for the received slices. To be specific, the serial number of a received slice will be compared with the serial numbers of the slices stored in the database; and when the serial numbers of the newly received slice is not continuous with a serial number of the slice stored in the database which is closest to this serial number, this means that a slice loss occurs, and thus a slice loss request will be generated. The slice loss request includes the serial number of the lost slice.
Step S304 includes transmitting by the compensation request agent the generated slice loss request to the plurality of upper servers.
The compensation request agent broadcasts the generated slice loss request to all upper servers corresponding thereto via the established TCP persistent connection, and the upper servers receive the slice loss request from the lower server by their message issuing pools according to the established TCP persistent connection.
Step S305 includes configuring a monitoring agent on the upper servers, monitoring by the monitoring agent the slice loss request of the lower server, and when the slice loss request is monitored, performing a slice loss compensation for the lower server.
A monitoring agent is configured on the upper servers. The monitoring agent will monitor the message issuing pool of the present machine, and when the message issuing pool of the present machine receives a slice loss request, will obtain the corresponding slice in the database of the present machine according to the serial number of the lost slice in the slice loss request. If there exists the corresponding slice in the database of the present machine, the slice will be transmitted to the message issuing pool to be reissued, and if there does not exist the corresponding slice, this means that the slice loss of the slice also occurs in the present machine; and at this time, the present machine will serve as a lower server and perform a compensation request to its upper servers via the compensation request agent.
The system and method of the embodiments of the present disclosure can realize the full-duplex communication between the lower server and the upper servers by the compensation request agent configured on the lower server, and the full-duplex communication of the persistent connection can reduce the number of times of requests from the lower server, so as to reduce the pressures of the upper servers and the core production device. Thus, the reliance of the lower server on the core production device can be reduced, which realizes the real-time compensation for slice loss and decreases the slice loss frequency when interruptions occur in the intermediate network status, thereby improving the playing experience of device terminals.
Hardware processor can be used to implement relevant function module of embodiments of the present disclosure.
The present disclosure provides a non-transitory computer readable storage medium which stores one or more programs including execution instructions, and the execution instructions are executable by electronic devices that have control interfaces for execution of the related steps in the above method embodiments, for example:
configuring a compensation request agent on a lower server;
transmitting by the lower server a subscription request to a plurality of upper servers corresponding thereto, and obtaining by the lower server slices issued by message issuing pools of the plurality of upper servers according to the subscription request;
performing a slice loss detection by the lower server for the slice information received, and generating by the lower server a slice loss request when it is detected that a slice loss occurs; and
transmitting by the compensation request agent the generated slice loss request to the plurality of upper servers.
a processor 410, a communications interface 420, a memory 430 and a communication bus 440.
Communications among the processor 410, the communications interface 420 and the memory 430 are accomplished via the communication bus 440.
The communications interface 420 is configured to communicate with a network element, such as a client.
The processor 410 is configured to execute a program 432 in the memory 430, so as to execute the related steps in the above method embodiments.
In particular, the program 432 may include a program code which includes a computer operation instruction.
The processor 410 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure.
The memory 430 is configured to store the program 432. The memory 430 may include a high speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory. The program 432 may in particular be configured to cause the device 400 to execute the following operations:
a configuring step: configuring a compensation request agent;
a slice obtaining step: transmitting a subscription request to the corresponding plurality of upper servers, and obtaining slices issued by the message issuing pools of the plurality of upper servers according to the subscription request;
a slice loss detecting step: performing a slice loss detection for the slice information received, and generating a slice loss request when it is detected that a slice loss occurs; and
a compensation requesting step: transmitting the generated slice loss request to the plurality of upper servers.
The specific realization manners of each step in the program 432 can be seen from the corresponding descriptions of the corresponding steps and units in the above embodiments, and will not be described further herein. It can be well appreciated for the skilled person in the art that specific operation procedure of the devices and modules described above can be referred to the corresponding description of the procedure in the above embodiments of the method according to the disclosure, and thus are omitted for the sake of conciseness.
The foregoing embodiments of device are merely illustrative, in which those units described as separate parts may or may not be separated physically. Displaying part may or may not be a physical unit, i.e., may locate in one place or distributed in several parts of a network. Some or all modules may be selected according to practical requirement to realize the purpose of the embodiments, and such embodiments can be understood and implemented by the skilled person in the art without inventive effort.
A person skilled in the art can clearly understand from the above description of embodiments that these embodiments can be implemented through software in conjunction with general-purpose hardware, or directly through hardware. Based on such understanding, the essence of foregoing technical solutions, or those features making contribution to the prior art may be embodied as software product stored in computer-readable medium such as ROM/RAM, diskette, optical disc, etc., and including instructions for execution by a computer device (such as a personal computer, a server, or a network device) to implement methods described by foregoing embodiments or a part thereof
Finally, it should be noted that, the above embodiments are merely provided for describing the technical solutions of the present disclosure, but not intended as a limitation. Although the present disclosure has been described in detail with reference to the embodiments, those skilled in the art will appreciate that the technical solutions described in the foregoing various embodiments can still be modified, or some technical features therein can be equivalently replaced. Such modifications or replacements do not make the essence of corresponding technical solutions depart from the spirit and scope of technical solutions embodiments of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201610192827.6 | Mar 2016 | CN | national |
This application is a continuation of International Application No. PCT/CN2016/088882, filed on Jul. 6, 2016, which is based upon and claims priority to Chinese Patent Application No. 201610192827.6, filed on Mar. 30, 2016, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2016/088882 | Jul 2016 | US |
Child | 15246243 | US |