Source: https://patents.google.com/patent/CN103139188B/en
Timestamp: 2019-04-21 09:11:15+00:00

Document:
本发明公开了一种流媒体传输方法与系统，其中，方法包括：流媒体服务器接收客户端发送的流媒体文件播放请求，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自t0+t时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V向客户端传输一个内容大小为k的流媒体数据块；客户端接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V0作为恒定码流速率，开始播放缓存的流媒体文件。 The present invention discloses a method and system for streaming media transmission, wherein the method comprising: streaming media server receives the streaming media file play request sent by the client to the network up to the maximum rate V content transmission to the client of the size m + k streaming media data block, and starting from the time t0 + t, t to a transmission period, respectively, start at the beginning of each time period, the network up to a transmission rate V content to the client size of the streaming media data k block; client receives the streaming media streaming data block media server sends and caches, and cache streaming media data block content when the size reaches m, coding rate streaming media file V0 as a constant stream rate, start playing the buffered streaming media files. 本发明实施例可以提高实时流式传输方式中客户端的视频播放效果，并减少顺序流式传输方式中网络与服务器资源的浪费。 Embodiments of the present invention can improve the real-time video streaming playback in the client mode, and to reduce sequential streaming mode and a waste of network server resources.
 本发明涉及流媒体技术，尤其是一种流媒体传输方法与系统。  The present invention relates to a streaming media technology, in particular to a method and system stream media transmission.
 流媒体是指采用流式传输的方式在互联网(Internet)或内联网(Intranet)播放的媒体格式，例如:音频、视频或多媒体文件。  streaming media refers to streaming manner using the Internet (Internet) or an intranet (Intranet) played media formats, such as: an audio, video or multimedia files. 流式传输主要指流媒体服务器将整个音频/视频(Aud1/Video，以下简称:A/V)、三维图形(three-dimens1nal，以下简称:3D)等流媒体文件经过特定的编码方式压缩成一个个压缩包，顺序、实时地传送给客户端，通常为用户计算机。 Streaming refers primarily to the streaming media server to the entire audio / video (Aud1 / Video, hereinafter referred to as: A / V), three-dimensional graphics (three-dimens1nal, hereinafter referred to as: 3D) and other streaming media file compressed into a through specific encoding compressed packet, sequentially, to the client in real-time, computer users generally. 近年来，随着网络直播、远程教育、视频分享等各类视频业务的迅猛发展，流媒体传输技术也成为了研究热点。 In recent years, with the rapid development of the network broadcast, distance education, video sharing and other types of video services, streaming media transmission technology has become a hot topic.
目前，流媒体传输方式主要有实时流式传输方式和顺序流式传输方式。  Currently, the main way streaming live streaming manner and order in streaming mode. 其中，实时流式传输方式具有可实时直播、方便快进快退、用户看多少则传输多少的优点，主要应用于网络电视(Internet ProtocolTelevis1n,以下简称:IPTV)场合；顺序流式传输方式具有对网络损伤容忍度高的优势，主要应用于基于超文本传输协议(Hyper TextTransportProtocol,以下简称:HTTP)方式的互联网视频在线播放场合。 Wherein the real-time streaming mode having real-time broadcast, to facilitate fast forward, rewind, to see how much of the advantage of the user is transmitted, is mainly used in network television (Internet ProtocolTelevis1n, hereinafter referred to as: IPTV) case; sequential streaming mode having high damage tolerance of the network advantages, mainly used in hypertext transfer protocol (Hyper TextTransportProtocol, hereinafter referred to as: HTTP) Internet video playback applications online mode.
 实时流式传输方式对网络损伤比较敏感，如果网络传输状况不佳，例如，存在网络层抖动、丢包等，将会导致流媒体文件数据丢失或传输中断、延迟，从而影响客户端的视频播放效果。  Real-time streaming mode sensitive to network impairments, if bad network transmission conditions, e.g., the presence of a network layer jitter, packet loss, the streaming media file will cause loss of data or transmission interruption, delay, thereby affecting the client video playback. 在顺序流式传输方式中，由于客户端播放的流媒体文件与流媒体服务器上传输流媒体文件并不同步，且存在由于用户观看的少从而播放的少、而流媒体服务器传输的传输流媒体文件多的可能，这就会造成有限网络与服务器资源的浪费。 In order streaming mode, since the client to play streaming media file is not synchronized with the stream media server transmits the streaming media file, and there is less due to the small play so viewed by the user, while the streaming server to transfer media stream transmission many files possible, which will result in a waste of limited network and server resources.
 本发明实施例所要解决的技术问题是:提供一种流媒体传输方法与系统，以提高实时流式传输方式中客户端的视频播放效果，并减少顺序流式传输方式中网络与服务器资源的浪费。  Technical Problem embodiments to be solved by the present invention are: to provide a media streaming method and system, to improve video playback live streaming mode client, and reduce sequential streaming mode network and server resources waste.
 客户端接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。  The streaming client receives the streaming media server sends the data blocks and cache and streaming media contents data block size reaches m, a coding rate of the streaming media file cache V. 作为恒定码流速率，开始播放缓存的流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file buffer until finished playing streaming media file or receiving the stop playing request sent by the user.
 客户端，用于接收用户发送的流媒体文件播放请求与停止播放请求并转发给所述流媒体服务器；接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。  client for streaming media file playback request and forwards the request to stop playing the streaming media server receives the transmitted user; receiving streaming media server streaming media data block to be sent and cache streaming media data and the cached when the content of the block size reaches m, a coding rate of the streaming media file V. 作为恒定码流速率，开始播放缓存的流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file buffer until finished playing streaming media file or receiving the stop playing request sent by the user.
 基于本发明上述实施例提供的流媒体传输方法与系统，流媒体服务器接收到客户端发送的流媒体文件播放请求后，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自h+t时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求；客户端接收流媒体服务器发送的流媒体数据块并缓存，在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。 After  streaming media transmission system and method of the above embodiments of the present invention provides streaming media server receives the streaming media file play request sent by the client to the network up to the maximum rate V content transmission to the client of size m + k streaming media data block, and starting from the time h + t to t as the transmission period, respectively, start at the start time of each cycle, up to the maximum network rate V content transmitting a size of the streaming media data block k until the streaming media file is completed, or receives a client transmission stop playing request sent; streaming media data block media server sends the client receives the stream and buffer, streaming media in a cache block of data content size reaches m, streaming media file coding rate V. 作为恒定码流速率，开始播放流媒体文件。 As the constant rate bit stream to start playing the streaming media file. 流媒体服务器以网络最大可达速率V而非流媒体文件的编码速率V。 Streaming media server to the network up rate V coding rate rather than the streaming media file V. 向客户端传输流媒体数据块，由于网络带宽余量的存在，网络最大可达速率V与网络平均可达速率通常大于流媒体文件的编码速率V。 Streaming media transmission to the client data block, due to the presence of the remaining network bandwidth, network speed V up to reach the network rate is typically greater than the average rate of the streaming media file encoded V. ，而t。 , And t. 的取值为m与网络平均可达速率的比值，t的取值为k与流媒体文件的编码速率V。 The value of the average ratio of m networks reachable rate, t the value of k and the coding rate of the streaming media file V. 的比值，因此，与现有技术相比，本发明实施例将具备更短的流媒体文件播放启动时间，减少用户等待播放的时间；并且，由于对流媒体文件进行分块分周期传输，且传输速率与编码速率分离，即使网络的可达带宽瞬时发生下降，也只会暂时地影响流媒体数据块的传输速率，而不会发生丢包，并不会影响客户端的视频播放效果，对网络损伤容忍度较高，提高了实时流式传输方式中客户端的视频播放效果，给用户带来更好的流媒体质量和观看体验，并且减少了顺序流式传输方式中对网络与服务器资源的浪费。 The ratio, therefore, compared with the prior art, embodiments of the present invention will have a shorter time to start playing the streaming media file, reducing the time to wait for the user to play; and, since the streaming media file Partitioned transmission period, and transmission separation rate and coding rate, even if the bandwidth of the network up to drop instantaneously, it will only temporarily affect the rate of streaming media data transmission block, and the packet loss does not occur, and will not affect the video playback client for network impairments high tolerance, improved real-time streaming mode in the client video playback, giving users a better streaming quality and viewing experience, and reduce the Progressive streaming mode in a waste of network and server resources.
图5为本发明流媒体传输系统一个实施例的结构示意图。  FIG. 5 of the present invention, a streaming transmission system schematic structural diagram of the embodiment.
 101，流媒体服务器接收客户端发送的流媒体文件播放请求，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自tft时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V向客户端传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求。  101, a streaming media file server receives the streaming media playing request sent by the client to the network up to the maximum rate V content transmission to the client of size m + k data blocks of the streaming media, and starting from the moment tft to t as a transmission period, respectively, at the start of each time period starts to end network transmission rate V up to a content to the client size of the streaming media data block k, streaming media file is completed, or until the client receives the transmission sent request to stop playing.
 其中，各流媒体数据块由流媒体文件按照播放顺序依次生成，m+k为客户端缓存容量的大小。  wherein each block of streaming media data are sequentially generated by the streaming media file played in the order, m + k is the size of the client side cache capacity. 的取值为m与网络平均可达速率的比值，t的取值为k与流媒体文件的编码速率V。 The value of the average ratio of m networks reachable rate, t the value of k and the coding rate of the streaming media file V. 的比值。 Ratio. 其中的流媒体文件可以是音频文件、视频文件、音视频文件、3D文件中的任意一种或多种的组合文件。 Wherein the streaming media file may be audio files, video files, audio and video files, any one or more of the 3D file of the combined file.
 102，客户端接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。  102, the client receives the streaming media streaming server sends media data blocks and cache streaming media data and the size of block content reaches m, a coding rate of the streaming media file cache V. 作为恒定码流速率，开始播放缓存的流媒体文件，直到缓存的流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file cache until the cache has finished playing the streaming media file or receiving the stop playing request sent by the user.
 本发明上述实施例提供的流媒体传输方法中，流媒体服务器接收到客户端发送的流媒体文件播放请求后，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自h+t时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求；客户端接收流媒体服务器发送的流媒体数据块并缓存，在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。 After streaming media transmission method of the invention to the above embodiment of the  present, the streaming media server receives the streaming media file play request sent by the client to the network up to the maximum rate V content transmission to the client of the size m + k streaming media data block, and starting from the time h + t to t as the transmission period, respectively, start at the start time of each cycle, up to the maximum network rate V content transmitting a streaming media data block size k until streaming media file transfer is completed, or receiving the client stops playing request sent; client receives streaming media streaming data block media server sends and cache streaming media data block size of the content in the buffer reaches m, encoded streaming media file rate V. 作为恒定码流速率，开始播放流媒体文件。 As the constant rate bit stream to start playing the streaming media file. 流媒体服务器以网络最大可达速率V而非流媒体文件的编码速率V。 Streaming media server to the network up rate V coding rate rather than the streaming media file V. 向客户端传输流媒体数据块，由于网络带宽余量的存在，网络最大可达速率V与网络平均可达速率通常大于流媒体文件的编码速率V。 Streaming media transmission to the client data block, due to the presence of the remaining network bandwidth, network speed V up to reach the network rate is typically greater than the average rate of the streaming media file encoded V. ，而t。 , And t. 的取值为m与网络平均可达速率的比值，t的取值为k与流媒体文件的编码速率V。 The value of the average ratio of m networks reachable rate, t the value of k and the coding rate of the streaming media file V. 的比值，因此，与传统的实时流式传输方式相比，本发明实施例将具备更短的流媒体文件播放启动时间，减少用户等待播放的时间；并且，由于对流媒体文件进行分块分周期传输，且传输速率与编码速率分离，即使网络的可达带宽瞬时发生下降，也只会暂时地影响流媒体数据块的传输速率，而不会发生丢包，并不会影响客户端的视频播放效果，对网络损伤容忍度较高，提高了实时流式传输方式中客户端的视频播放效果，给用户带来更好的流媒体质量和观看体验，并且减少了顺序流式传输方式中对网络与服务器资源的浪费。 Ratio, and therefore, compared to the conventional live streaming manner, the embodiment of the present invention will have a shorter time to start playing the streaming media file, reducing the time to wait for the user to play; and, since the streaming media file is divided into blocks half cycle transmission, and the transmission rate and the encoding rate of separation, even up network bandwidth decreases instantaneously, it will only temporarily affect the rate of streaming media data transmission block, and the packet loss does not occur, the client will not affect the video playback , higher tolerance of network impairments, improved video playback in real-time streaming mode client, giving users a better streaming quality and viewing experience, and reduce the Progressive streaming mode with a server on the network waste of resources.
图2为现有技术实时流式传输方式的一个示意图。  FIG. 2 is a schematic diagram of a real-time streaming mode of the prior art. 如图2所示，传统的实时流式传输方式中，流氓媒体服务器将流媒体文件打包为小的实时传输协议(Real Time Protocol,以下简称:RTP)数据包，总是以编码速率V。 2, a conventional real-time streaming, the media server rogue streaming media file is packaged into a small real-time transport protocol (Real Time Protocol, hereinafter: RTP) packets, a coding rate is always V. 作为恒定码流速率，基于用户数据报协议(UserDatagramProtocol，以下简称:UDP)传输给客户端。 As the constant rate bit stream based on the user datagram protocol (UserDatagramProtocol, hereinafter referred to as: UDP) transmitted to the client. 如果网络瞬间带宽也即网络最大可达速率低于编码速率V。 If the instantaneous bandwidth of the network up to the maximum rate that is lower than the network coding rate V. ，则立刻会发生丢包，影响播放质量。 , It will immediately packet loss, affecting playback quality. 因此，实际使用中，往往需要预留一定余量的网络带宽。 Therefore, the actual use, often need to set aside a certain margin of network bandwidth. 又由于，流媒体服务器端的实际上总是以恒定速率V。 Also, because, in fact, the streaming media server is always at a constant rate V. 传输流媒体数据包，这部分余量的网络带宽在没有网络突发问题的情况下，总是被浪费的。 Media data packet transport stream, this part of the balance of network bandwidth in the network without unexpected problems, the always wasted.
图3为本发明流媒体传输方法中传输方式的一个示意图。  Figure 3 a schematic view of a media transmission method of the transmission stream of the present invention. 如图3所示，本发明实施例中，每一个固定内容大小的流媒体数据块k在每个传输周期tfnt的起始点开始传输给客户端，其中，η为传输周期的次序数，η的取值为大于O的整数。 3, the embodiment of the present invention, each of the streaming media content fixed-sized data block k transmitted to the client beginning at the beginning of each transmission period tfnt wherein, [eta] is the number of sequence transmission period, the [eta] the value of an integer greater than O. 根据网络实时最大可达速率的不同，在不同的时间内传输完毕。 Depending on the network in real-time rate up to different transfer is completed within a different time. 只要传输周期t内的网络平均可达速率大于V。 The average rate up to the network as long as the transmission period t is larger than V. ，每个流媒体数据块k总能在每个传输周期内提前传输完毕。 Each streaming media data block k always been transmitted in advance in each transmission cycle.
 201，流媒体服务器接收客户端发送的流媒体文件播放请求。  201, the streaming media server receives the streaming media file play request sent by the client.
 202，流媒体服务器以预设编码方式按照播放顺序对客户端请求播放的流媒体文件进行压缩，依次生成一个内容大小为m+k的流媒体数据块与多个内容大小为k的流媒体数据块。  202, the streaming media server streaming media file in a preset coding scheme played in the order of playback on the client requests compressed sequentially generates a content of size m + k data blocks of the streaming media content with the plurality of size k streaming media data block.
 其中，m+k为客户端缓存容量的大小，可以预先配置在流媒体服务器中。  wherein, m + k is the size of the client side cache capacity can be pre-arranged in the streaming media server. 可以看作客户端缓存被划分为两个容量大小分别为k与m的区域，m为在向用户播放流媒体文件前需要预先缓冲的流媒体文件内容大小。 Can be viewed as client cache capacity is divided into two size k and m are the area, m is the user prior to play streaming media file requires buffering streaming media content file size. k与m的比例可调，可按经验值选取，例如，可取k与m的比例为1: 4，S卩:客户端预存的流媒体文件内容大小占客户端缓存大小的20%。 The ratio of k and m is adjustable, according to empirical values ​​selected, for example, the ratio of k and m is preferably 1: 4, S Jie: client streaming media file stored in the content 20% the size of the client buffer size.
另外，作为本发明的其它实施例，流媒体服务器也可以采用边生成流媒体数据块边传输的方式，而不是等到将流媒体文件全部生成流媒体数据块后再传输给客户端。  Further, as another embodiment of the present invention, the streaming server may be generated by way of the edge side of the streaming media data transmission block, rather than wait until all of the streaming media file streaming data blocks generated and then transmitted to the client.
 203，流媒体服务器以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块。  203, the streaming server to the network up to the maximum rate V content transmission to the client of size m + k data blocks of the streaming media.
 204，客户端接收流媒体服务器发送的流媒体数据块并缓存，在时刻点t。  204, the media server streaming media data block sent by the client and receiving a stream buffer, at time point t. 接收到的流媒体数据块内容大小达到m，以流媒体文件的编码速率V。 Received streaming media content data block size reaches m, a coding rate of the streaming media file V. 作为恒定码流速率，开始播放流媒体文件，并继续接收流媒体服务器发送的流媒体数据块并缓存。 As the constant rate bit stream to start playing the streaming media file, and continues to receive the streaming media streaming server sends media data block and buffer.
 其中，t。  wherein, t. 的取值为m与网络平均可达速率的比值。 The value of the average ratio of m networks reachable rate. 示例性地，网络平均可达速率大于编码速率V。 Illustratively, the network up to the average rate is greater than the coding rate V. ，该网络平均可达速率可由流媒体服务器在接收到流媒体文件播放请求后，根据之前某一段时间的网络瞬时可达速率获取，也可以从网络管理服务器等其它网络实体获取。 The network may be the average rate up to the streaming media server receives a request to play streaming media file, according to the network before a certain period of time the instantaneous speed up acquisition, may also be obtained from other network entities like network management server.
用户观看流媒体文件之前，在客户端缓存内先预存一部分内容大小为m的流媒体文件内容。 Before the  user to view streaming media file, the client cache in the first part of the stored content of size m streaming media file. 可以看出，如果以用户发送流媒体文件播放请求的时刻作为O时刻，O〜t。 As can be seen, if the time to send the streaming media file playback time requested by the user as O, O~t. 的时间长度即为到流媒体文件点播的启动时延，本发明实施例中，客户端缓存内先预存的该部分内容以网络最大可达速率V传输，而不必以编码速率V。 Time is the length of the on-demand streaming media file to start delay, embodiments of the present invention, the portion of the buffer contents to the client pre-stored in the network up to the maximum transmission rate V, rather than a coding rate V. 传输，t。 Transmission, t. 的取值为m与网络平均可达速率的比值，由于网络带宽余量的存在，网络平均可达速率通常应大于V。 The value of the ratio of m up to the average rate of the network, due to the presence of the remaining network bandwidth, the network should be greater than the average rate is generally up to V. ，也就是说，本发明实施例中流媒体文件点播的启动时延将低于传统的实时流式传输方式，从而减少了用户的等待时间。 That is, start delay of stream media files on demand embodiment of the present invention will be lower than a conventional live streaming mode, thereby reducing the waiting time for users.
目前，在传统实时流式传输方式下，以恒定速率V。  Currently, in conventional live streaming mode, at a constant rate V. 传输视频文件的话，网络预留带宽必定大于V。 Transmission of video file, network reserved bandwidth must be greater than V. 。 . 例如，标清IPTV编码速率为1.6M，实际分配给IPTV的网络带宽一般是2M。 For example, standard definition IPTV encoding rate of a 1.6M, the actual network bandwidth allocated to the IPTV generally 2M. 传统实时流式传输方式下，如果网络预留带宽正好等于V。 Traditional live streaming mode, if the reserved bandwidth of the network is exactly equal to V. = 1.6M的话，任何微小的网络带宽浮动都会造成丢包，从而影响视频播放质量。 = 1.6M, then any small float will cause loss of network bandwidth, thus affecting the quality of video playback. 因此，一般分配略大于编码速率V。 Thus, generally slightly greater than the coding rate allocated V. 的带宽，使得只有当存在较大的网络带宽浮动时才会造成丢包。 Bandwidth, so that only when there is a large network bandwidth will result in packet loss when floating. 本发明实施例中，在与传统实时流式传输方式相同的条件下，即:网络实际带宽大于编码速率V。 Embodiments of the present invention, in the conventional real-time streaming the same conditions, namely: network bandwidth is greater than the actual coding rate V. 的情况下。 in the case of. 如果网络实际带宽为2M，而流媒体服务器又以尽力而为方式，而不是限速的方式发送流媒体数据块，则该流媒体数据块的传输速度将大于V。 If the actual network bandwidth is 2M, and the streaming server again best effort, rather than send the media speed streaming data block, the data block streaming media velocity will be larger than V. = 1.6M，从而减少流媒体文件点播的启动时间。 = 1.6M, thereby reducing demand streaming media file start time.
 205，流媒体服务器自tft时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V向客户端传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求。  205, the streaming server tft from time t to a transmission period, respectively, start at the start time of each cycle, up to a maximum transmission rate of the network a V content to the client size of the streaming media data k block, streaming media file is completed, or until the client receives the transmission request sent to stop playing.
 其中，t的取值为k与流媒体文件的编码速率V。  wherein, t is a value of k and the coding rate of the streaming media file V. 的比值。 Ratio.
 客户端每接收一个流媒体数据块后，都可对该流媒体数据块进行独立解码，当网络平均可达速率大于流媒体文件的编码速率时，一个流媒体数据块将在其对应的流媒体文件内容被用户观看完毕之前传输完成。 After  Each client receives a media stream of data blocks, can be independently decoded block of the streaming media data, when the network is greater than the average rate up to the coding rate of the streaming media file, a media data block in its corresponding stream streaming media file content viewed by the user before the completion of the transfer is complete. 由于媒体数据块已提前下载完毕，当网络存在一定的抖动时，并不会影响客户端对流媒体文件的播放。 Because the media data block has been downloaded in advance when certain network jitter, and will not affect the playback of streaming media client file.
 206，客户端接收流媒体服务器发送的流媒体数据块并缓存，以流媒体文件的编码速率V。  206, the client receives the streaming media streaming server sends media data block and buffer, a coding rate of the streaming media file V. 作为恒定码流速率播放流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As a constant rate symbol stream play streaming media file, until the file has finished playing streaming media or receiving the stop playing request sent by the user. 若客户端接收到用户发送的停止播放请求，还将该停止播放请求转发给流媒体服务器，以便流媒体服务器停止传输流媒体数据块。 If the client receives a request sent by a user stops playing, it will forward the request to stop playing the streaming media server, the streaming media server to stop transmission of the streaming media data block.
 本发明实施例中，对流媒体文件进行分块传输，且传输速率与编码速率分离，数据块的传输速率取决于当时的网络带宽，而不以编码速率V。  The embodiments of the present invention, the streaming media file block transmission, the transmission rate and the encoding rate of separation, the transfer rate of data blocks depends then network bandwidth without coding rate V. 传输，即使网络的可达带宽瞬时发生下降，也只会暂时地影响流媒体数据块的传输速率，而不会发生丢包，并不会影响客户端的视频播放效果，对网络损伤容忍度较高，提高了实时流式传输方式中客户端的视频播放效果，给用户带来更好的流媒体播放质量和观看体验，并且，由于采用分块周期性地传输，减少了顺序流式传输方式中对网络与服务器资源的浪费。 Transmission, even up network bandwidth drops instantaneously, it will only temporarily affect the transmission rate of the streaming media data block, and packet loss does not occur, and will not affect the video playback client, a high tolerance for network impairments improved video playback mode live streaming client, give users a better streaming media quality and viewing experience, and, since the transmission block cyclically reduced in order to streaming mode waste of network and server resources.
 如图1所示，在传统实时流式传输方式下，假设流媒体服务器以V。  1, in the conventional live streaming mode, streaming media server is assumed to V. = 1.6M速率向客户端传输视频数据，一旦发生瞬间的网络速率下降到V = 1.5M的情况，则这I秒内0.1M的视频数据将在网络中被丢失，无法被客户端接收到，从而影响客户端的解码效果与播放质量。 = 1.6M rate of video data is transmitted to the client, the network once the instantaneous rate falls case V = 1.5M, then this video data within seconds 0.1M I will be lost in the network, the client can not be received, thus affecting the effect decoding and playback quality clients. 而如图2所示，以tQ+t到tQ+2t这一传输周期为例，在整个流媒体数据块传输完成之前，有一部分时间中的网络带宽瞬间下降并且传输速率下降到小于V。 And As shown, tQ + t 2 to the transmission period tQ + 2t example, until the entire streaming media data block transfer is complete, there is a portion of network bandwidth instantaneously and fall time of the transmission rate falls to less than V. ，但是只要整个流媒体数据块在t时间间隔内传输完成，短暂的传输速率下降并不影响流媒体文件的整体传输效果，并且，如果网络带宽下降发生在整个流媒体数据块已经传输完成的空档时间内，更不会对传输有任何影响了，便不会对流媒体文件播放效果带来任何影响。 , But as long as the entire streaming media data block in the time interval t the transfer is complete, the transmission rate falls short does not affect the overall transmission efficiency of the streaming media file, and, if the drop occurs in the entire network bandwidth streaming data blocks have completed transmission space time within the file, but will not have any impact on the transmission, streaming media file playback will not effect any effect.
 根据本发明的一个示例而非限制，本发明上述各实施例的流媒体传输方法中，流媒体服务器基于传输控制协议(Transmiss1n ControlProtocol，以下简称:TCP)向客户端传输流媒体数据块。  According to an example of the present invention, rather than limit, the present invention is the above-described embodiment of the streaming media transmission method of the streaming server transmission control protocol (Transmiss1n ControlProtocol, hereinafter referred to as: TCP) data blocks streaming media transmission to the client . 利用TCP重传机制，可以在流媒体文件数据块传输过程中减少丢包，从而避免数据包丢失会造成的解码失败等问题，提高流媒体文件的播放质量和用户的观看体验。 Using TCP retransmission mechanism can reduce packet loss in streaming media file data block transfer process, so as to avoid packet loss can cause problems such as failure of the decoding, playback quality and improve the user's streaming media file viewing experience.
图5为本发明流媒体传输系统一个实施例的结构示意图。  FIG. 5 of the present invention, a streaming transmission system schematic structural diagram of the embodiment. 该实施例的流媒体传输系统可用于实现本发明上述各流媒体传输方法实施例的流程。 Streaming media transmission system of this embodiment may be used to implement the above-described process of streaming media transmission method of the embodiment of the present invention. 如图5所示，其包括流媒体服务器I与客户端2。 5, which comprises a streaming media server and the client I 2.
 客户端2，用于接收用户发送的流媒体文件播放请求与停止播放请求并转发给流媒体服务器I ;接收流媒体服务器I发送的流媒体数据块，并在接收到的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。  Client 2, a streaming media file play request sent by a user request to stop playing the streaming media server and forward it to I; receive streaming media streaming media server I block transmission stream, and the received data when the content of the block size reaches m, a coding rate of the streaming media file V. 作为恒定码流速率，开始播放流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file, until the file has finished playing streaming media or receiving the stop playing request sent by the user.
 本发明上述实施例提供的流媒体传输系统中，流媒体服务器接收到客户端发送的流媒体文件播放请求后，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自h+t时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求；客户端接收流媒体服务器发送的流媒体数据块并缓存，在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。 After streaming media transmission system  The present invention provides the above-described embodiment, the streaming media server receives the streaming media file play request sent by the client to the network up to the maximum rate V content transmission to the client of the size m + k streaming media data block, and starting from the time h + t to t as the transmission period, respectively, start at the start time of each cycle, up to the maximum network rate V content transmitting a streaming media data block size k until streaming media file transfer is completed, or receiving the client stops playing request sent; client receives streaming media streaming data block media server sends and cache streaming media data block size of the content in the buffer reaches m, encoded streaming media file rate V. 作为恒定码流速率，开始播放流媒体文件。 As the constant rate bit stream to start playing the streaming media file. 流媒体服务器以网络最大可达速率V而非流媒体文件的编码速率V。 Streaming media server to the network up rate V coding rate rather than the streaming media file V. 向客户端传输流媒体数据块，由于网络带宽余量的存在，网络最大可达速率V与网络平均可达速率通常大于流媒体文件的编码速率V。 Streaming media transmission to the client data block, due to the presence of the remaining network bandwidth, network speed V up to reach the network rate is typically greater than the average rate of the streaming media file encoded V. ，而t。 , And t. 的取值为m与网络平均可达速率的比值，t的取值为k与流媒体文件的编码速率V。 The value of the average ratio of m networks reachable rate, t the value of k and the coding rate of the streaming media file V. 的比值，因此，本发明实施例将具备更短的流媒体文件播放启动时间，减少用户等待播放的时间；并且，由于对流媒体文件进行分块分周期传输，且传输速率与编码速率分离，即使网络的可达带宽瞬时发生下降，也只会暂时地影响流媒体数据块的传输速率，而不会发生丢包，并不会影响客户端的视频播放效果，对网络损伤容忍度较高，提高了实时流式传输方式中客户端的视频播放效果，给用户带来更好的流媒体质量和观看体验，并且减少了顺序流式传输方式中对网络与服务器资源的浪费。 The ratio, therefore, embodiments of the present invention will have a shorter streaming media file playback start time, reduce the time the user waits to play; and, since the streaming media file Partitioned periodic transmission, and the transmission rate and the encoding rate of separation, even up network bandwidth instantaneous drop occurs, it will only temporarily affect the transmission rate of the streaming media data block, and packet loss does not occur, and will not affect the video playback clients, higher damage tolerance of the network, improve Real-time streaming mode in the client video playback, giving users a better streaming quality and viewing experience, and reduce the Progressive streaming mode in a waste of network and server resources.
 根据本发明流媒体传输系统的一个示例而非限制，与本发明上述流媒体传输方法实施例相应地，流媒体服务器I具体基于TCP向客户端传输流媒体数据块。  According to an exemplary streaming media transmission system according to the present invention is not limited correspondingly embodiment, the streaming media server I specific transport block based on TCP streaming media data to the client and the stream media transmission method of the present invention.
 根据本发明流媒体传输系统的另一个示例而非限制，与本发明上述流媒体传输方法实施例相应地，流媒体服务器I还可用于获取网络平均可达速率。  According to another example of the streaming media transmission system according to the present invention without limiting, embodiment of the stream media transmission method of the present invention Accordingly, the streaming server network I may also be used to obtain the average rate up.
 进一步与本发明上述流媒体传输方法实施例相应地，根据本发明流媒体传输系统的又一个示例而非限制，流媒体服务器I在接收客户端发送的流媒体文件播放请求之后，还可用于以预设编码方式按照播放顺序对流媒体文件进行压缩，依次生成一个内容大小为m+k的流媒体数据块与多个内容大小为k的流媒体数据块。 After  A further embodiment of the stream media transmission method of the present invention accordingly, and not limitation, the streaming media file player requests the streaming server transmission I at the receiving client according to still another example of streaming media transmission system according to the present invention, further encoding may be at a preset compressed streaming media file played in the order, sequentially generates a content of size m + k data blocks of the streaming media content and the size of the plurality of streaming media data block k.
 本说明书中各个实施例均采用递进的方式描述，每个实施例重点说明的都是与其它实施例的不同之处，各个实施例之间相同或相似的部分相互参见即可。  In the present specification, various embodiments are described in a progressive way, differences from the embodiment described with other embodiments focus each embodiment, the same or similar parts between the respective embodiments can see each other. 对于系统实施例而言，由于其与方法实施例基本对应，所以描述的比较简单，相关之处参见方法实施例的部分说明即可。 For embodiments of the system, since the method of embodiment substantially corresponds with the embodiment, the description is relatively simple, some embodiments of the methods see relevant point can be described.
 本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成，前述的程序可以存储于一计算机可读取存储介质中，该程序在执行时，执行包括上述方法实施例的步骤；而前述的存储介质包括:R0M、RAM、磁碟或者光盘等各种可以存储程序代码的介质。  Those of ordinary skill in the art can be appreciated: realize all or part of the steps of the method described above may be implemented by a program instructing relevant hardware to complete, the program may be stored in a computer readable storage medium, the program execution when, comprising the step of performing the above-described embodiment of the method; and the storage medium comprising: a variety of medium may store program codes R0M, RAM, magnetic disk, or optical disk.
 本发明实施例将具备更短的流媒体文件播放启动时间，减少用户等待播放的时间；并且，由于对流媒体文件进行分块分周期传输，且传输速率与编码速率分离，即使网络的可达带宽瞬时发生下降，也只会暂时地影响流媒体数据块的传输速率，而不会发生丢包，并不会影响客户端的视频播放效果，对网络损伤容忍度较高，提高了实时流式传输方式中客户端的视频播放效果，给用户带来更好的流媒体质量和观看体验，并且减少了顺序流式传输方式中对网络与服务器资源的浪费。  The embodiments of the present invention will have a shorter streaming media file playback start time, reduce the time the user waits to play; and, since the streaming media file Partitioned periodic transmission, and the transmission rate and the encoding rate of separation, even if the network instantaneous bandwidth of up to fall, it will only temporarily affect the transmission rate of the streaming media data block, and packet loss does not occur, and will not affect the video playback clients, higher damage tolerance of the network, improve the real-time streaming type transmission mode in the client video playback, giving users a better streaming quality and viewing experience, and reduce the Progressive streaming mode in a waste of network and server resources.
 本发明的描述是为了示例和描述起见而给出的，而并不是无遗漏的或者将本发明限于所公开的形式。  The description of the present invention are exemplary and given in order of description, and not to be exhaustive or to limit the invention to the form disclosed. 很多修改和变化对于本领域的普通技术人员而言是显然的。 Many modifications and variations to those of ordinary skill in the art is obvious. 选择和描述实施例是为了更好说明本发明的原理和实际应用，并且使本领域的普通技术人员能够理解本发明从而设计适于特定用途的带有各种修改的各种实施例。 The embodiments were chosen and described in order to best explain the principles and practical applications of the present invention and enable one of ordinary skill in the art to understand the invention for various design suited to the particular use with a variety of modified embodiments.
1.一种流媒体传输方法，其特征在于，包括: 流媒体服务器接收客户端发送的流媒体文件播放请求，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自tft时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V向客户端传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求；其中，各流媒体数据块由流媒体文件按照播放顺序依次生成，m+k为客户端缓存容量的大小；t。 1. A media stream transmission method, characterized by comprising: a streaming media server receives the streaming media file play request sent by the client to the network up to the maximum rate V content transmission to the client size of the streaming media data of m + k blocks and tft from time t to a transmission period, respectively, start at the beginning of each time period to the network transmission rate V up to a content to a client for streaming media data block size k until the streaming media file transfer is complete or stop playing the received client request transmitted; wherein each block of streaming media data are sequentially generated by the streaming media file played in the order, m + k is the size of the buffer capacity of the client terminal; t. 的取值为m与网络平均可达速率的比值，以便客户端在时刻点t。 The value of the average ratio of m networks reachable rate, so that the client at time point t. 接收到的流媒体数据块内容大小达到m，t的取值为k与流媒体文件的编码速率V。 Received streaming media content data block size reaches m, t the value of k and the coding rate of the streaming media file V. 的比值； 客户端接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。 Ratio; streaming client receives the streaming media server sends media data chunks and caches, and streaming media contents data block size reaches m, a coding rate of the streaming media file cache V. 作为恒定码流速率，开始播放缓存的流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file buffer until finished playing streaming media file or receiving the stop playing request sent by the user.
2.根据权利要求1所述的方法，其特征在于，流媒体服务器基于传输控制协议TCP向客户端传输流媒体数据块。 2. The method according to claim 1, wherein the streaming server based on transmission control protocol TCP data blocks streaming media transmission to the client.
3.根据权利要求1所述的方法，其特征在于，所述网络平均可达速率大于编码速率V。 3. The method according to claim 1, characterized in that the network up to the average rate is greater than the coding rate V. 。 .
4.根据权利要求1所述的方法，其特征在于，还包括:流媒体服务器获取网络平均可达速率。 4. The method according to claim 1, characterized in that, further comprising: a streaming media server acquires the network up to the average rate.
5.根据权利要求1至4任意一项所述的方法，其特征在于，还包括:流媒体服务器接收客户端发送的流媒体文件播放请求之后，以预设编码方式按照播放顺序对流媒体文件进行压缩，依次生成一个内容大小为m+k的流媒体数据块与多个内容大小为k的流媒体数据块。 The method of any one of claims 1 to 4, characterized in that, further comprising: a streaming media server receives the streaming media file play request sent by the client after a preset coding scheme according to the streaming media file playback order compression, sequentially generates a content of size m + k data blocks of the streaming media content and the size of the plurality of streaming media data block k.
6.一种流媒体传输系统，其特征在于，包括: 流媒体服务器，用于接收客户端发送的流媒体文件播放请求，以网络最大可达速率V向客户端传输内容大小为m+k的流媒体数据块，并自tft时刻起，以t作为传输周期，分别在每个周期的起始时刻开始，以网络最大可达速率V向客户端传输一个内容大小为k的流媒体数据块，直到流媒体文件传输完毕或者接收到客户端发送的停止播放请求；其中，各流媒体数据块由流媒体文件按照播放顺序依次生成，m+k为客户端缓存容量的大小；t。 A streaming media transmission system, characterized by comprising: a streaming media server for streaming media file playback request sent by a client to the network up to the maximum rate V content transmission to the client of the size m + k streaming media data block, and tft from time t to a transmission period, respectively, start at the beginning of each time period to the network end of the transmission rate V up to a size of the content to the client streaming media data block k, wherein each of the streaming media data block are sequentially generated by the streaming media file played in the order, m + k is the size of the buffer capacity of the client terminal;; until completion of file transfer or streaming client receives the transmission request to stop playing t. 的取值为m与网络平均可达速率的比值，以便客户端在时刻点t。 The value of the average ratio of m networks reachable rate, so that the client at time point t. 接收到的流媒体数据块内容大小达到m，t的取值为k与流媒体文件的编码速率V。 Received streaming media content data block size reaches m, t the value of k and the coding rate of the streaming media file V. 的比值； 客户端，用于接收用户发送的流媒体文件播放请求与停止播放请求并转发给所述流媒体服务器；接收流媒体服务器发送的流媒体数据块并缓存，并在缓存的流媒体数据块内容大小达到m时，以流媒体文件的编码速率V。 Ratio; client, a streaming media file playback request and forwards the request to stop playing the streaming media server receives the transmitted user; receiving streaming media server streaming media data block to be sent and cache streaming media data and the cached when the content of the block size reaches m, a coding rate of the streaming media file V. 作为恒定码流速率，开始播放缓存的流媒体文件，直到流媒体文件播放完毕或者接收到用户发送的停止播放请求。 As the constant rate bit stream to start playing the streaming media file buffer until finished playing streaming media file or receiving the stop playing request sent by the user.
7.根据权利要求6所述的系统，其特征在于，所述流媒体服务器具体基于TCP向客户端传输流媒体数据块。 7. The system according to claim 6, wherein the TCP-based streaming server to the client specific media transport stream data block ends.
9.根据权利要求6所述的系统，其特征在于，所述流媒体服务器还用于获取网络平均可达速率。 9. The system according to claim 6, characterized in that the streaming media server is further configured to obtain an average of up network speed.
10.根据权利要求6至9任意一项所述的系统，其特征在于，所述流媒体服务器接收客户端发送的流媒体文件播放请求之后，还用于以预设方式按照播放顺序对流媒体文件进行压缩，依次生成一个内容大小为m+k的流媒体数据块与多个内容大小为k的流媒体数据块。 10. After system according to any one of claims 6-9, characterized in that, the streaming media server receives the client sends streaming media file play request, is further configured in a preset manner according to the streaming media file playback order compressed sequentially generates a content of size m + k data blocks of the streaming media content and the size of the plurality of streaming media data block k.

References: V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V. 
 V.