+

CN102843351B - A kind of processing method of streaming media service, streaming media server and system - Google Patents

A kind of processing method of streaming media service, streaming media server and system Download PDF

Info

Publication number
CN102843351B
CN102843351B CN201210101482.0A CN201210101482A CN102843351B CN 102843351 B CN102843351 B CN 102843351B CN 201210101482 A CN201210101482 A CN 201210101482A CN 102843351 B CN102843351 B CN 102843351B
Authority
CN
China
Prior art keywords
streaming media
bandwidth
media file
request
slice
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210101482.0A
Other languages
Chinese (zh)
Other versions
CN102843351A (en
Inventor
陈寒江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210101482.0A priority Critical patent/CN102843351B/en
Publication of CN102843351A publication Critical patent/CN102843351A/en
Application granted granted Critical
Publication of CN102843351B publication Critical patent/CN102843351B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种流媒体业务的处理方法、流媒体服务器及系统,用于解决媒体文件传输过程中,所传送的媒体文件的码率不能根据链路的带宽进行动态码率调整的问题。一种通信系统,包括:用户终端设备,用于发起获取流媒体文件的请求,以及接收并播放流媒体服务器发送返回的切片数据;流媒体服务器,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配,并向所述用户终端返回所述切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配。

The invention discloses a streaming media service processing method, a streaming media server and a system, which are used to solve the problem that the code rate of the transmitted media file cannot be dynamically adjusted according to the link bandwidth during the media file transmission process. A communication system, comprising: a user terminal device, configured to initiate a request for obtaining a streaming media file, and receive and play sliced data sent back by a streaming media server; Request the bandwidth of the current link associated with the request, and the bandwidth is represented by a bandwidth value; according to the bandwidth value, obtain the matching streaming media file from multiple streaming media files with different code rates corresponding to the request corresponding slice data, wherein the code rate corresponding to the streaming media file matches the bandwidth value, and returns the slice data to the user terminal, wherein the code rate corresponding to the streaming media file matches the bandwidth value Bandwidth value matches.

Description

一种流媒体业务的处理方法、流媒体服务器及系统Method for processing streaming media services, streaming media server and system

技术领域 technical field

本发明涉及通信技术领域,尤其涉及一种流媒体业务的处理方法、流媒体服务器及系统。The present invention relates to the technical field of communication, in particular to a processing method of a streaming media service, a streaming media server and a system.

背景技术 Background technique

随着3G(3rd-generation,第三代移动通信技术)技术的不断发展,网络技术的不断成熟,用户对流媒体业务的需求量也大幅度增长。目前,绝大多数流媒体业务都是基于HTTP(HyperTextTransferProtocol,超文本传输协议)承载的流媒体业务。With the continuous development of 3G (3rd-generation, third-generation mobile communication technology) technology and the continuous maturity of network technology, users' demand for streaming media services has also increased significantly. At present, most streaming media services are streaming media services carried by HTTP (HyperTextTransfer Protocol, hypertext transfer protocol).

在基于HTTP承载的流媒体业务中,ProgressiveDownload(渐进式下载)是主流方案,是直接通过HTTP协议下载媒体文件,或通过边下载边播放的方式提供流化服务,所述边下载边播放的方式是将媒体文件不断发送到播放终端,播放终端获得一部分能播放的媒体文件内容,就进行媒体播放。这种方式使得用户等待时间较少,但是,用户所需的媒体文件在开始传送时,码率就已经确定,不能进行动态的调整。码率是指单位时间内传输的数据位数,由于不能动态的调整码率,使得媒体文件在传输中,无论是在高带宽或是低带宽下,都是以恒定的码率传输,从而造成网络传输资源的浪费,或造成网络传输资源的不足,影响用户体验。In the streaming media business based on HTTP bearer, ProgressiveDownload (progressive download) is the mainstream solution, which downloads media files directly through the HTTP protocol, or provides streaming services by playing while downloading. It is to continuously send media files to the playback terminal, and the playback terminal obtains a part of the content of the media file that can be played, and then plays the media. This method makes the waiting time of the user less, but the code rate of the media file required by the user is already determined when the transmission of the media file is started, and dynamic adjustment cannot be performed. The code rate refers to the number of data bits transmitted per unit time. Since the code rate cannot be dynamically adjusted, media files are transmitted at a constant code rate during transmission, whether in high bandwidth or low bandwidth, resulting in The waste of network transmission resources may cause insufficient network transmission resources, which affects user experience.

发明内容 Contents of the invention

本发明的实施例提供一种流媒体业务的处理方法、流媒体服务器及系统,一定程度上解决媒体文件传输过程中,所传送的媒体文件的码率不能根据网络的带宽进行动态码率调整调节的问题。Embodiments of the present invention provide a streaming media service processing method, streaming media server and system, to a certain extent solve the problem that the code rate of the transmitted media file cannot be dynamically adjusted and adjusted according to the bandwidth of the network during the media file transmission process The problem.

本发明的实施例采用如下技术方案:Embodiments of the invention adopt the following technical solutions:

本发明实施例提供了一种通信系统,包括:An embodiment of the present invention provides a communication system, including:

用户终端设备,用于发起获取流媒体文件的请求,以及接收并播放流媒体服务器返回的切片数据;The user terminal device is used to initiate a request for obtaining a streaming media file, and receive and play sliced data returned by the streaming media server;

流媒体服务器,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;并向所述用户终端返回所述切片数据。The streaming media server is used to obtain the bandwidth of the current link associated with the request of the user terminal for obtaining the streaming media file, and the bandwidth is represented by a bandwidth value; according to the bandwidth value, from different codes corresponding to the request Acquire the corresponding slice data in the matching stream media file from a plurality of stream media files of the same rate, wherein the code rate corresponding to the stream media file matches the bandwidth value; and return the slice to the user terminal data.

本发明实施还例提供了一种流媒体业务的处理方法,包括:Another embodiment of the present invention provides a method for processing streaming media services, including:

获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;Acquiring the bandwidth of the current link associated with the request of the user terminal for obtaining the streaming media file, the bandwidth is represented by a bandwidth value;

根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;According to the bandwidth value, obtain the corresponding slice data in the matching streaming media file from multiple streaming media files corresponding to the request and different bit rates, wherein the bit rate corresponding to the streaming media file is the same as the bit rate of the streaming media file match the above bandwidth value;

向所述用户终端返回所述切片数据。returning the sliced data to the user terminal.

本发明实施例提供了一种流媒体服务器,包括:The embodiment of the present invention provides a streaming media server, including:

获取单元,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;An acquisition unit, configured to acquire the bandwidth of the current link associated with the user terminal's request for acquiring a streaming media file, the bandwidth being represented by a bandwidth value;

处理单元,用于根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;A processing unit, configured to obtain, according to the bandwidth value, corresponding slice data in a matching streaming media file from a plurality of streaming media files corresponding to the request and having different code rates, wherein the streaming media file corresponds to The code rate matches the bandwidth value;

发送单元,用于向所述用户终端返回所述切片数据。A sending unit, configured to return the slice data to the user terminal.

本发明实施例提供了一种流媒体业务的处理方法、流媒体服务器及系统,能够获取用户终端的链路带宽值,根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,并返回给用户终端,实现了流媒体文件在传输过程中的动态码率调整,提高了网络传输利用率,提升了用户体验。Embodiments of the present invention provide a streaming media service processing method, streaming media server and system, capable of obtaining the link bandwidth value of the user terminal, and according to the bandwidth value, multiple The corresponding slice data in the matching streaming media file is obtained from a streaming media file, and returned to the user terminal, which realizes the dynamic code rate adjustment of the streaming media file during the transmission process, improves the utilization rate of network transmission, and improves the user experience. .

附图说明 Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为发明实施例的通信系统框图;Fig. 1 is the communication system block diagram of the embodiment of the invention;

图2为发明实施例的一种流媒体业务的处理方法的流程示意图;FIG. 2 is a schematic flow diagram of a method for processing a streaming media service according to an embodiment of the invention;

图3为发明实施例的另一种流媒体业务的处理方法的流程示意图;FIG. 3 is a schematic flow diagram of another method for processing a streaming media service according to an embodiment of the invention;

图4为发明实施例的一种流媒体服务器的结构示意图。Fig. 4 is a schematic structural diagram of a streaming media server according to an embodiment of the invention.

具体实施方式 detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本文中描述的各种技术可用于各种无线通信系统,例如当前2G,3G通信系统和下一代通信系统,例如全球移动通信系统(GSM,GlobalSystemforMobilecommunications),码分多址(CDMA,CodeDivisionMultipleAccess)系统,时分多址(TDMA,TimeDivisionMultipleAccess)系统,宽带码分多址(WCDMA,WidebandCodeDivisionMultipleAccessWireless),频分多址(FDMA,FrequencyDivisionMultipleAddressing)系统,正交频分多址(OFDMA,OrthogonalFrequency-DivisionMultipleAccess)系统,单载波FDMA(SC-FDMA)系统,通用分组无线业务(GPRS,GeneralPacketRadioService)系统,长期演进(LTE,LongTermEvolution)系统,以及其他此类通信系统。The various technologies described herein can be used in various wireless communication systems, such as current 2G, 3G communication systems and next-generation communication systems, such as Global System for Mobile Communications (GSM, Global System for Mobile communications), Code Division Multiple Access (CDMA, CodeDivisionMultipleAccess) system, Time Division Multiple Access (TDMA, TimeDivisionMultipleAccess) system, Wideband Code Division Multiple Access (WCDMA, WidebandCodeDivisionMultipleAccessWireless), Frequency Division Multiple Access (FDMA, FrequencyDivisionMultipleAddressing) system, Orthogonal Frequency Division Multiple Access (OFDMA, OrthogonalFrequency-DivisionMultipleAccess) system, single carrier FDMA (SC-FDMA) system, General Packet Radio Service (GPRS, General Packet Radio Service) system, Long Term Evolution (LTE, Long Term Evolution) system, and other such communication systems.

用户终端,可以是无线终端也可以是有线终端,无线终端可以是指向用户提供语音和/或数据连通性的设备,具有无线连接功能的手持式设备、或连接到无线调制解调器的其他处理设备。无线终端可以经无线接入网(例如,RAN,RadioAccessNetwork)与一个或多个核心网进行通信,无线终端可以是移动终端,如移动电话(或称为“蜂窝”电话)和具有移动终端的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语言和/或数据。例如,个人通信业务(PCS,PersonalCommunicationService)电话、个人数字助理(PDA,PersonalDigitalAssistant)等设备。无线终端也可以称为系统、远程终端(RemoteTerminal)、接入终端(AccessTerminal)、用户终端(UserTerminal)、用户代理(UserAgent)、用户设备(UserDevice)、或用户装备(UserEquipment)。The user terminal may be a wireless terminal or a wired terminal. The wireless terminal may be a device that provides voice and/or data connectivity to the user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. The wireless terminal can communicate with one or more core networks via a radio access network (for example, RAN, RadioAccessNetwork), and the wireless terminal can be a mobile terminal, such as a mobile phone (or called a "cellular" phone) and a computer with a mobile terminal , for example, may be portable, pocket, handheld, computer built-in, or vehicle-mounted mobile devices that exchange voice and/or data with the radio access network. For example, Personal Communication Service (PCS, Personal Communication Service) phone, Personal Digital Assistant (PDA, Personal Digital Assistant) and other devices. A wireless terminal may also be called a system, a remote terminal (RemoteTerminal), an access terminal (AccessTerminal), a user terminal (UserTerminal), a user agent (UserAgent), a user device (UserDevice), or a user equipment (UserEquipment).

实施例一Embodiment one

本发明实施例提供了一种通信系统,如图1所示,包括:用户终端设备11和流媒体服务器12。An embodiment of the present invention provides a communication system, as shown in FIG. 1 , including: a user terminal device 11 and a streaming media server 12 .

所述用户终端设备11,用于发起获取流媒体文件的请求,以及接收并播放流媒体服务器返回的切片数据。The user terminal device 11 is configured to initiate a request for obtaining a streaming media file, and receive and play sliced data returned by the streaming media server.

需要说明的是,本发明实施例中的流媒体包括但不限于:视频文件或视频流或音频文件或音频流。It should be noted that the streaming media in this embodiment of the present invention includes but is not limited to: video files or video streams or audio files or audio streams.

当用户终端需要通过网络进行在线的流媒体文件播放时,首先向流媒体服务器发起获取流媒体文件请求,请求流媒体服务器返回所请求的流媒体文件。When the user terminal needs to play an online streaming media file through the network, it first initiates a request for obtaining the streaming media file to the streaming media server, and requests the streaming media server to return the requested streaming media file.

在本发明实施例中,所述流媒体服务器中存储有大量的不同码率的多个流媒体文件,且所述每个流媒体文件有一个或多个切片数据,所述切片数据为等时长的连续数据。当流媒体服务器获取到用户终端的流媒体文件的请求时,周期性的将所选取的切片数据返回用户终端。用户终端还用于接收并播放流媒体服务器返回的切片数据。In the embodiment of the present invention, a large number of streaming media files with different code rates are stored in the streaming media server, and each streaming media file has one or more slice data, and the slice data is equal in length continuous data. When the streaming media server obtains the streaming media file request of the user terminal, it periodically returns the selected slice data to the user terminal. The user terminal is also used to receive and play sliced data returned by the streaming media server.

流媒体服务器12,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;并向所述用户终端返回所述切片数据。The streaming media server 12 is used to obtain the bandwidth of the current link associated with the request of the user terminal to obtain the streaming media file, and the bandwidth is represented by a bandwidth value; Acquire the corresponding slice data in the matching streaming media file from a plurality of streaming media files of the code rate, wherein, the code rate corresponding to the streaming media file matches the bandwidth value; and return the described slice data.

所谓链路是从一个节点到相邻节点的一段物理线路。在本发明实施例中,用户终端发送获取流媒体文件的请求到流媒体服务器,以使得用户终端与流媒体服务器间建立了TCP(TransmissionControlProtocol,传输控制协议)连接,即建立了用户终端与流媒体服务器之间的获取流媒体文件的请求所关联的链路。The so-called link is a section of physical line from one node to an adjacent node. In the embodiment of the present invention, the user terminal sends a request for obtaining the streaming media file to the streaming media server, so that a TCP (Transmission Control Protocol, Transmission Control Protocol) connection is established between the user terminal and the streaming media server, that is, the user terminal and the streaming media server are established. Links associated with requests for streaming media files between servers.

带宽指的是网络传输数据在单位时间内从网络中的某一点到另一点所能通过的“最高数据率”,即每秒传输多少位(bit/s)。因此,带宽越大,在规定时间内从一端流到另一端的数据量越大,即数据传输率越快。网络带宽影响了数据或文件的传输速率。但是由于网络环境的变化,用户终端可使用的带宽是变化的,因此,在进行流媒体文件传输前,先检测获取流媒体文件请求所关联的当前链路的带宽,获得用户当前带宽值,并根据根据所述带宽值发送与所述带宽值匹配的切片数据,以提高网络带宽的利用率,保证流媒体文件的播放流畅性,进而提升了用户体验。Bandwidth refers to the "highest data rate" that network transmission data can pass from one point to another in a unit of time, that is, how many bits per second (bit/s) can be transmitted. Therefore, the greater the bandwidth, the greater the amount of data that can flow from one end to the other within a given period of time, ie, the faster the data transfer rate. Network bandwidth affects the rate at which data or files are transferred. However, due to changes in the network environment, the available bandwidth of the user terminal changes. Therefore, before streaming media file transmission, first detect and obtain the bandwidth of the current link associated with the streaming media file request, obtain the current bandwidth value of the user, and Slicing data matching the bandwidth value is sent according to the bandwidth value, so as to improve the utilization rate of network bandwidth, ensure the fluency of playing streaming media files, and further improve user experience.

本发明提供的通信系统中,在一种实现方式下,流媒体服务器12具体用于:获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;并根据所述带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述带宽值相匹配;以及根据所述流媒体切片属性信息,获取并向所述用户终端返回对应的切片数据,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址。In the communication system provided by the present invention, in an implementation manner, the streaming media server 12 is specifically configured to: acquire the bandwidth of the current link associated with the user terminal's request for acquiring a streaming media file, and the bandwidth is represented by a bandwidth value ; and according to the bandwidth value and the streaming media file identifier carried in the request, search for matching streaming media slice attribute information from the description file, wherein the streaming media slice attribute information corresponds to the streaming media file identifier , and the code rate information associated with the streaming media slice attribute information matches the bandwidth value; and according to the streaming media slice attribute information, obtain and return corresponding slice data to the user terminal, the streaming media slice The attribute information includes the start time, end time and storage address of each slice data included in the streaming media file.

进一步的,所述通信系统还包括带宽检测设备13,用于检测用户终端设备的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用第一带宽值表示;Further, the communication system further includes a bandwidth detection device 13, configured to detect the bandwidth of the current link associated with the request of the user terminal device for obtaining the streaming media file, and the bandwidth is represented by a first bandwidth value;

此时,流媒体服务器12具体用于:根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;以及根据起始时间升序排序第一的切片数据的存放地址,获取并向用户终端返回对应的第一切片数据。At this time, the streaming media server 12 is specifically configured to: search for matching streaming media slice attribute information from the description file according to the first bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice The attribute information corresponds to the identifier of the streaming media file, and the code rate information associated with the attribute information of the streaming media slice matches the first bandwidth value, and the attribute information of the streaming media slice includes the The start time, end time and storage address of each slice data; and the storage address of the first slice data sorted in ascending order according to the start time, and obtain and return the corresponding first slice data to the user terminal.

另外,带宽检测设备13,还用于当收到用户终端发送的获取流媒体文件的请求,且返回所述第一切片数据后,以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示;In addition, the bandwidth detection device 13 is also configured to periodically detect the request associated with the first threshold time interval after receiving the request for obtaining the streaming media file sent by the user terminal and returning the first slice data. The bandwidth of the current link, or periodically request the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, the bandwidth is represented by a second bandwidth value;

此时,流媒体服务器12具体用于:根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址,以及根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取并向用户终端返回对应的下一个切片数据。At this time, the streaming media server 12 is specifically configured to: search for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice The attribute information corresponds to the identifier of the streaming media file, and the code rate information associated with the attribute information of the streaming media slice matches the second bandwidth value, and the attribute information of the streaming media slice includes the The start time, end time and storage address of each slice data, as well as the storage address of the slice data whose start time is the same as or continuous with the end time of the first slice data or the last slice data, are acquired and sent to the user The terminal returns the corresponding next slice data.

这里的下一个切片数据可以是第二切片数据,第三切片数据,...第N切片数据等等。The next slice data here may be the second slice data, the third slice data, . . . the Nth slice data and so on.

需要说明的是,当带宽检测设备13周期性的检测用户终端设备的获取流媒体文件的请求所关联的当前链路的带宽时,不同时刻所述带宽值可以是可以相同的,所以,所述流媒体服务器12向用户终端返回对应的第一切片数据与第二切片数据,第三切片数据,...第N切片数据的码率可以是相同的,但是,第二切片数据的起始时间与所述第一切片数据的结束必须时间相同或连续,第三切片数据的起始时间与所述第二切片数据的结束必须时间相同或连续,...第N切片数据的起始时间与所述第N-1切片数据的结束必须时间相同或连续。It should be noted that when the bandwidth detection device 13 periodically detects the bandwidth of the current link associated with the request of the user terminal equipment to obtain the streaming media file, the bandwidth value may be the same at different moments, so the The stream media server 12 returns to the user terminal the corresponding first slice data and the second slice data, the third slice data, ... the code rate of the Nth slice data may be the same, but the start of the second slice data The time must be the same as or continuous with the end time of the first slice data, the start time of the third slice data must be the same or continuous with the end time of the second slice data, ... the beginning of the Nth slice data The time must be the same as or continuous with the end time of the N-1th slice data.

进一步的,所述通信系统还包括:转码设备14,Further, the communication system further includes: a transcoding device 14,

用于复制流媒体文件,生成第一流媒体文件副本和第二媒体文件副本;For duplicating streaming media files, generating a first copy of the streaming media file and a second copy of the media file;

将所述第一流媒体文件副本和第二流媒体文件副本分别进行转码,生成具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本;Transcoding the first copy of the streaming media file and the copy of the second streaming media file respectively to generate a copy of the streaming media file with a first code rate and a copy of the streaming media file with a second code rate;

将所述具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本进行切片,生成若干个等时长的切片数据。Slicing the copy of the streaming media file with the first code rate and the copy of the streaming media file with the second code rate to generate several slice data of equal duration.

转码设备14事先执行转码操作,将视频源(视频文件或视频流)转换成不同码率的视频文件,这些视频文件内部是进行切片了的,且切片是按时间对齐的,即不同码率的视频文件内部每个切片的起始和结束时间都是相同的。转码设备14同时生成描述文件,记录生成文件的各个码率和切片信息。The transcoding device 14 performs a transcoding operation in advance to convert video sources (video files or video streams) into video files with different code rates. These video files are internally sliced, and the slices are aligned by time, that is, different code rates The start and end time of each slice in the video file of the same rate are the same. The transcoding device 14 simultaneously generates a description file, and records each code rate and slice information of the generated file.

可见,本发明实施例提供了一种通信系统,能够对用户终端的链路带宽进行检测,根据链路带宽发送经过转码和切片后的切片数据,且每次进行切片数据前都能够进行带宽检测和切片数据的选择,实现了流媒体业务的动态码率调整,对用户终端、流媒体服务器等的都有所提升,具体的,It can be seen that the embodiment of the present invention provides a communication system, which can detect the link bandwidth of the user terminal, and transmit the sliced data after transcoding and slicing according to the link bandwidth, and the bandwidth can be checked each time before slicing data. The selection of detection and slice data realizes the dynamic code rate adjustment of streaming media services, and improves the performance of user terminals and streaming media servers. Specifically,

1)就用户终端而言,码率根据带宽动态调整,在低带宽情况下,能保证媒体文件的的流畅性,带宽充足时,可提升流媒体(如音频或视频)质量,从而提升了客户端流媒体播放体验,另外,相对于现有技术中,用户终端每播放一个分片都要发起一个新的HTTP请求,本发明实施例中用户终端只需要发起一次获取流媒体文件的请求(即整个过程只需要一次HTTP请求),用户终端与流媒体服务器之间的交互大大减少。此外,相对于传统技术而言,本发明实施例的用户终端无需解析描述文件,因此本发明实施例的用户终端无需定制,适应性更强。1) As far as the user terminal is concerned, the code rate is dynamically adjusted according to the bandwidth. In the case of low bandwidth, the smoothness of media files can be guaranteed. When the bandwidth is sufficient, the quality of streaming media (such as audio or video) can be improved, thereby improving the user experience. In addition, compared with the prior art, the user terminal needs to initiate a new HTTP request every time a segment is played, but in the embodiment of the present invention, the user terminal only needs to initiate a request for obtaining the streaming media file once (i.e. The whole process only needs one HTTP request), and the interaction between the user terminal and the streaming media server is greatly reduced. In addition, compared with the traditional technology, the user terminal in the embodiment of the present invention does not need to parse the description file, so the user terminal in the embodiment of the present invention does not need to be customized and has stronger adaptability.

2)就流媒体服务器而言,由流媒体服务器调整流媒体文件的码率,从而使流媒体服务器具备了网络带宽分配能力,尤其在高并发情况下,此特性使网络带宽能更有效利用。2) As far as the streaming media server is concerned, the streaming media server adjusts the code rate of the streaming media file, so that the streaming media server has the ability to allocate network bandwidth, especially in the case of high concurrency, this feature enables more efficient use of network bandwidth.

实施例二Embodiment two

本发明实施例所提供了一种流媒体业务的处理方法,是基于边下载边播放方式中的流媒体业务的处理方法。所述边下载边播放方式是将流媒体文件不断发送到用户终端,用户终端获得一部分能播放的流媒体文件内容后,就进行媒体播放。现有技术中,用户终端发送流媒体文件请求消息后,服务器发送用户终端所请求的流媒体文件到用户终端,一旦流媒体文件开始传输,无论是在高链路带宽或是低链路带宽下,流媒体文件都是以恒定的码率传输,不能够调整,从而造成网络传输资源的浪费,或造成网络传输资源的不足。The embodiment of the present invention provides a processing method of streaming media services, which is based on the processing method of streaming media services in the mode of playing while downloading. The method of playing while downloading is to continuously send streaming media files to the user terminal, and the user terminal performs media playback after obtaining a part of the content of the streaming media file that can be played. In the prior art, after the user terminal sends a streaming media file request message, the server sends the streaming media file requested by the user terminal to the user terminal. Once the streaming media file starts to be transmitted, whether it is under high link bandwidth or low link bandwidth , streaming media files are transmitted at a constant bit rate, which cannot be adjusted, resulting in a waste of network transmission resources, or a shortage of network transmission resources.

为了解决流媒体文件传输过程中,所传送的流媒体文件的码率不能根据网络的带宽进行动态码率调整调节的问题,如图2所示,本发明实施例提供了一种流媒体业务的处理方法,该方法的执行主体可以是流媒体服务器,该方法包括:In order to solve the problem that the bit rate of the transmitted streaming media file cannot be dynamically adjusted and adjusted according to the bandwidth of the network during the streaming media file transmission process, as shown in Figure 2, the embodiment of the present invention provides a streaming media service Processing method, the execution body of this method can be a streaming media server, and this method includes:

S101、获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示。S101. Obtain the bandwidth of the current link associated with the user terminal's request for obtaining a streaming media file, where the bandwidth is represented by a bandwidth value.

在本发明实施例中,用户终端通过网络进行在线的流媒体文件播放时,向流媒体服务器发起获取流媒体文件的请求。当流媒体服务器接收到用户终端发起的获取流媒体文件的请求后,首先,与所述用户终端建立TCP连接,即建立了用户终端与流媒体服务器之间的获取流媒体文件的请求所关联的链路。In the embodiment of the present invention, when playing an online streaming media file through the network, the user terminal initiates a request to the streaming media server for acquiring the streaming media file. After the streaming media server receives the request for obtaining the streaming media file initiated by the user terminal, first, it establishes a TCP connection with the user terminal, that is, establishes the connection between the user terminal and the streaming media server associated with the request for obtaining the streaming media file. link.

然后,流媒体服务器获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示。Then, the streaming media server obtains the bandwidth of the current link associated with the user terminal's request for obtaining the streaming media file, and the bandwidth is represented by a bandwidth value.

带宽指的是网络传输数据在单位时间内从网络中的某一点到另一点所能通过的“最高数据率”,即每秒传输多少位(bit/s)。因此,带宽越大,在规定时间内从一端流到另一端的数据量越大,即数据传输率越快。网络带宽影响了数据或文件的传输速率。Bandwidth refers to the "highest data rate" that network transmission data can pass from one point to another in a unit of time, that is, how many bits per second (bit/s) can be transmitted. Therefore, the greater the bandwidth, the greater the amount of data that can flow from one end to the other within a given period of time, ie, the faster the data transfer rate. Network bandwidth affects the rate at which data or files are transferred.

S102、根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配。S102. According to the bandwidth value, obtain the corresponding slice data in the matching streaming media file from multiple streaming media files corresponding to the request and having different code rates, wherein the code rate corresponding to the streaming media file Match the bandwidth value described.

所述切片数据是转码设备对流媒体文件进行处理后所获得的数据,具体的处理过程包括:The slice data is the data obtained after the transcoding device processes the streaming media file, and the specific processing process includes:

首先,复制流媒体文件,生成第一流媒体文件副本和第二流媒体文件副本;First, copy the streaming media file to generate a first streaming media file copy and a second streaming media file copy;

其次,将第一流媒体文件副本和第二流媒体文件副本分别进行转码,生成具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本;其中,所述码率是指单位时间内传输的数据位数。Secondly, the first stream media file copy and the second stream media file copy are respectively transcoded to generate a stream media file copy with a first code rate and a stream media file copy with a second code rate; wherein the code rate is Refers to the number of data bits transmitted per unit time.

最后,将所述具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本进行切片,生成若干个等时长的子切片数据。进行切片过程时,是按照时间进行切片,例如,可以每隔十秒进行一次切片。这样可以保证每个切片数据的时长都一样。Finally, slice the stream media file copy with the first code rate and the stream media file copy with the second code rate to generate several sub-slice data of equal duration. During the slicing process, the slicing is performed according to time, for example, slicing can be performed every ten seconds. This ensures that the duration of each slice of data is the same.

优选的,为了使得服务器有更精确的选择适合带宽的切片数据,服务器还可以:Preferably, in order to enable the server to more accurately select slice data suitable for the bandwidth, the server can also:

复制流媒体文件,生成第三流媒体文件副本和第四流媒体文件副本,然后将所述第三流媒体文件副本和第四流媒体文件副本分别进行转码,生成具有第三码率的流媒体文件副本和具有第四码率的流媒体文件副本;Duplicating the streaming media file to generate a third streaming media file copy and a fourth streaming media file copy, and then transcoding the third streaming media file copy and the fourth streaming media file copy to generate a stream with a third code rate A copy of the media file and a copy of the streaming media file with a fourth bit rate;

再将所述具有第三码率的流媒体文件副本和具有第四码率的流媒体文件副本进行切片,生成若干个等时长的切片数据。Then slice the copy of the streaming media file with the third code rate and the copy of the streaming media file with the fourth code rate to generate several slice data of equal duration.

可见,生成的具有第一码率的流媒体文件副本、具有第二码率的流媒体文件副本、具有第三码率的流媒体文件副本以及具有第四码率的流媒体文件副本分别具有不同的码率,因此,在根据服务器选择适合带宽的切片数据时,可以有较多的码率选择。It can be seen that the generated copy of the streaming media file with the first bit rate, the copy of the streaming media file with the second bit rate, the copy of the streaming media file with the third bit rate and the copy of the streaming media file with the fourth bit rate have different Therefore, when selecting slice data suitable for the bandwidth according to the server, there are more bit rate options.

所述切片数据可以存放于流媒体服务器中,也可以存放于数据存储设备中,当流媒体服务器需要时,可以直接获取即可。The slice data can be stored in the streaming media server or in the data storage device, and can be obtained directly when the streaming media server needs it.

优选的,为了能够快速为用户终端匹配所需的切片数据,当转码设备完成转码后,生成描述文件。所述描述文件用于对每个切片数据的属性进行描述,流媒体切片属性信息包括:切片数据的起始时间、结束时间以及存放地址,具体的,描述文件有两种描述方式:Preferably, in order to quickly match the required slice data for the user terminal, the description file is generated after the transcoding device completes the transcoding. The description file is used to describe the attributes of each slice data, and the streaming media slice attribute information includes: the start time, end time and storage address of the slice data. Specifically, the description file has two description methods:

第一种方式,所述描述文件中包含同一个流媒体文件标识,不同的码率信息,以及不同码率下的不同流媒体文件切片属性信息(即不同码率下的流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址)之间的关联关系,示例性的,以视频文件为例进行说明,所述流媒体文件的标识为视频文件的名称,用《电影1》表示,如表1所示:In the first way, the description file contains the same stream media file identifier, different code rate information, and different stream media file slice attribute information under different code rates (that is, each stream media file included in different code rates) The relationship between the start time, the end time and the storage address) of slice data, as an example, a video file is used as an example for illustration, and the identifier of the streaming media file is the name of the video file, using "Movie 1" Indicates, as shown in Table 1:

表1Table 1

第二种方式,涉及一个完整的描述文件,描述文件中包括包含不同的流媒体文件标识,不同的码率信息,以及不同码率下的不同流媒体文件切片属性信息(即不同码率下的流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址)之间的关联关系,示例性的,以视频文件为例进行说明,所述流媒体文件的标识为视频文件的名称,用《电影1》、《电影2》、《电影3》分别表示三部不同的视频文件,如表2所示:The second way involves a complete description file. The description file includes different stream media file identifiers, different code rate information, and different stream media file slice attribute information under different code rates (that is, different stream media file slice attribute information under different code rates) The relationship between the start time, end time and storage address of each slice data included in the streaming media file, for example, a video file is used as an example for illustration, and the identifier of the streaming media file is the name of the video file , using "Movie 1", "Movie 2", and "Movie 3" to represent three different video files, as shown in Table 2:

表2Table 2

其中,所述流媒体文件标识用于,与用户终端的获取流媒体文件的请求的中携带的流媒体文件标识相匹配,所述流媒体文件标识不仅限于流媒体文件的名称,还可以是流媒体文件的代码或识别符。示例性的,所述用户终端的获取流媒体文件的请求的中携带的流媒体文件标识相可以是统一资源定位符(URL,UniformResourceLocator)。URL是对可以从因特网上得到的资源的位置和访问方法的一种简洁的表示,只要能够对资源定位,系统就可以对资源进行各种操作,如存取、更新、替换和查找其属性。URL相当于一个文件名在网络范围的扩展,因此URL是与因特网相连的机器上的任何可访问对象的一个指针。Wherein, the streaming media file identifier is used to match the streaming media file identifier carried in the user terminal's request for obtaining the streaming media file, and the streaming media file identifier is not limited to the name of the streaming media file, but may also be a stream The code or identifier of the media file. Exemplarily, the stream media file identifier carried in the user terminal's request for acquiring the stream media file may be a Uniform Resource Locator (URL, UniformResourceLocator). URL is a concise representation of the location and access method of resources that can be obtained from the Internet. As long as the resource can be located, the system can perform various operations on the resource, such as access, update, replace and search for its attributes. A URL is equivalent to a network-wide extension of a file name, so a URL is a pointer to any accessible object on a machine connected to the Internet.

本发明实施例中,流媒体服务器可以根据所述带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述带宽值相匹配,以及根据所述流媒体切片属性信息,获取对应的切片数据,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址。In this embodiment of the present invention, the streaming media server may search for matching streaming media slice attribute information from the description file according to the bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information is the same as The streaming media file identifier corresponds, and the code rate information associated with the streaming media slice attribute information matches the bandwidth value, and according to the streaming media slice attribute information, the corresponding slice data is obtained, and the streaming media The slice attribute information includes the start time, end time and storage address of each slice data included in the streaming media file.

由于带宽值指单位时间可传输的位数(bit/s),码率也是指单位时间内传输的数据位数(bit/s),所以可以选定最接近带宽值但又不大于的码率为待发送的切片数据的码率,流媒体文件的码率和质量成正比的,码率越大,媒体文件的质量越高,但是,在进行网络数据传输时,对网络的要求也就越高,所以,本发明实施可以根据带宽值,选定最接近带宽值但又不大于所述带宽值的码率为待发送的切片数据的码率,能够实现在低带宽时,传输低码率的切片数据,保证了媒体文件的流畅性,在高带宽时,传输高码率的切片媒体文件,提高了网络资源的利用率。Since the bandwidth value refers to the number of bits (bit/s) that can be transmitted per unit time, and the code rate also refers to the number of data bits (bit/s) transmitted per unit time, you can choose the code rate that is closest to the bandwidth value but not greater than is the code rate of the slice data to be sent, the code rate of the streaming media file is directly proportional to the quality, the higher the code rate, the higher the quality of the media file, however, when the network data is transmitted, the more demanding the network is High, so, according to the bandwidth value, the implementation of the present invention can select the code rate closest to the bandwidth value but not greater than the code rate of the slice data to be sent, which can realize the transmission of low code rate when the bandwidth is low The sliced data ensures the smoothness of the media files. When the bandwidth is high, the sliced media files with a high bit rate are transmitted, which improves the utilization of network resources.

S103、向所述用户终端返回所述切片数据。S103. Return the slice data to the user terminal.

流媒体服务器可以根据流媒体切片属性信息中的所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址,选择用户终端当前所需要的切片数据,并将该切片数据返回给用户终端,以使得用户终端进行播放。The streaming media server can select the slice data currently required by the user terminal according to the start time, end time and storage address of each slice data included in the streaming media file in the stream media slice attribute information, and return the slice data to the user terminal, so that the user terminal can play.

在本发明实施例中,从描述文件中查找匹配的流媒体切片属性信息,并根据流媒体切片属性信息返回所述切片数据,都是由流媒体服务器完成的,用户终端只需要发送一次获取流媒体文件的请求即可,这样可以减少用户与流媒体服务器之间的交互。进一步的,用户终端只需要播放流媒体服务器返回的切片数据,不需要进行额外的查找或解析过程,因此,对用户终端无需为定制的播放设备,进而适应性更强。In the embodiment of the present invention, searching for the matching streaming media slice attribute information from the description file, and returning the slice data according to the streaming media slice attribute information are all completed by the streaming media server, and the user terminal only needs to send the acquisition stream once. The request of the media file is enough, which can reduce the interaction between the user and the streaming media server. Furthermore, the user terminal only needs to play the segmented data returned by the streaming media server, and does not need to perform an additional search or parsing process. Therefore, the user terminal does not need to be a customized playback device, and thus the adaptability is stronger.

需要说明的是,由于当前链路的带宽是变化的,不稳定的,所以每次返回的切片数据码率可能不相同,但是,流媒体服务器向用户终端返回的切片数据的时间必须是连续的,这样才能够保证用户终端播放的流媒体文件时连续不间断的。It should be noted that since the bandwidth of the current link is variable and unstable, the code rate of the slice data returned each time may be different, but the time of the slice data returned by the streaming server to the user terminal must be continuous , so as to ensure that the streaming media files played by the user terminal are continuous and uninterrupted.

如图3所示,本发明实施例还提供了一种流媒体业务的处理方法,包括:As shown in Figure 3, the embodiment of the present invention also provides a method for processing a streaming media service, including:

S201、用户终端向流媒体服务器发送获取流媒体文件的请求。S201. The user terminal sends a request for acquiring a streaming media file to the streaming media server.

S202、流媒体服务器请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第一带宽值表示。S202. The streaming media server requests the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, where the bandwidth is represented by a first bandwidth value.

需要说明的是,带宽检测设备可以是单独的一个设备与流媒体服务器连接,用于检测用户终端设备的获取流媒体文件的请求所关联的当前链路的带宽,也可以是设置于流媒体服务器中的检测单元,用于获取用户终端设备的获取流媒体文件的请求所关联的当前链路的带宽。It should be noted that the bandwidth detection device can be a separate device connected to the streaming media server for detecting the bandwidth of the current link associated with the request of the user terminal device to obtain the streaming media file, or it can be set on the streaming media server The detecting unit in the method is configured to acquire the bandwidth of the current link associated with the request of the user terminal equipment for acquiring the streaming media file.

S203、带宽检测设备向流媒体服务器返回第一带宽值。S203. The bandwidth detection device returns the first bandwidth value to the streaming media server.

S204、流媒体服务器根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息。S204. The streaming media server searches for matching streaming media slice attribute information from the description file according to the first bandwidth value and the streaming media file identifier carried in the request.

其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址。Wherein, the streaming media slice attribute information corresponds to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the first bandwidth value, and the streaming media slice attribute information includes The start time, end time and storage address of each slice data included in the streaming media file.

S205、流媒体服务器根据起始时间升序排序第一的切片数据的存放地址,获取并向用户终端对应的第一切片数据。S205. The streaming media server sorts the storage addresses of the first slice data in ascending order according to the start time, acquires and sends the corresponding first slice data to the user terminal.

流媒体服务器根据切片数据的起始时间,选择起始时间升序排序第一的切片数据的切片数据的存放地址,并且根据切片数据的存放地址获取对应的第一切片数据,并将所述第一切片数据返回用户终端。According to the start time of the slice data, the streaming media server selects the storage address of the slice data of the first slice data in ascending order of the start time, and obtains the corresponding first slice data according to the storage address of the slice data, and stores the first slice data One piece of data is returned to the user terminal.

S206、用户终端播放所述第一切片数据。S206. The user terminal plays the first slice data.

应当理解的是,在步骤S206之后,每隔一段时间向用户终端发送一个切片数据。每隔一段时间,重复步骤207~211,直到流媒体文件播放完毕。It should be understood that, after step S206, a piece of slice data is sent to the user terminal at intervals. Repeat steps 207-211 at regular intervals until the streaming media file is played completely.

本发明实施例中,当流媒体服务器向用户终端对应的第一切片数据后,还包括:In the embodiment of the present invention, after the streaming media server sends the first slice data corresponding to the user terminal, it also includes:

S207、流媒体服务器以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示。需要说明的是,这里的第一阈值时间间隔可以是根据实际应用场景灵活设置的,也可以在使用的过程中变化。S207. The streaming media server periodically detects the bandwidth of the current link associated with the request at a first threshold time interval, or periodically requests the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, the The bandwidth is represented by a second bandwidth value. It should be noted that the first threshold time interval here can be flexibly set according to actual application scenarios, and can also be changed during use.

S208、带宽检测设备向流媒体服务器返回带宽用第二带宽值。S208. The bandwidth detection device returns the second bandwidth value for bandwidth to the streaming media server.

S209、流媒体服务器根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息。S209. The streaming media server searches for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request.

其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址。Wherein, the streaming media slice attribute information corresponds to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the second bandwidth value, and the streaming media slice attribute information includes The start time, end time and storage address of each slice data included in the streaming media file.

S210、流媒体服务器根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取对应的下一个切片数据并向用户终端返回对应的下一个切片数据(例如第二切片数据,第三切片数据...第N切片数据)。S210. The streaming media server obtains the corresponding next slice data and returns the corresponding next slice data to the user terminal according to the storage address of the slice data whose start time is the same as the end time of the first slice data or the previous slice data or is continuous. A slice of data (for example, the second slice of data, the third slice of data ... the Nth slice of data).

S211、用户终端播放所述下一个切片数据。S211. The user terminal plays the next data slice.

需要说明的是,例如,第一切片数据与第二切片数据的码率是与链路带宽匹配的,因此第一切片数据与第二切片数据的码率可以是相同的,也可以是不相同的,但是,第二切片数据的起始时间与所述第一切片数据的结束时间相同或连续的。It should be noted that, for example, the code rates of the first slice data and the second slice data match the link bandwidth, so the code rates of the first slice data and the second slice data can be the same, or can be Not the same, however, the start time of the second slice data is the same as or continuous with the end time of the first slice data.

用户终端播放所述第二切片数据后,还会继续以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,并根据所述带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,并根据匹配的流媒体切片属性信息获取并向所述用户终端返回对应的第三、第四切片数据等等,直到一个完整的流媒体文件传输结束为止。需要说明的是,所返回的所有切片数据都是同一个标识的流媒体文件,用户终端只需要发送一次获取流媒体文件的请求到服务器,这样就可以减少用户终端与服务器之间的交互。进一步的,用户终端在接收到服务器发送的切片数据后,进行播放,在用户看来,是一个连续的、完整的流媒体文件(如视频文件),不会应为选择的切片数据的码率不同而影响用户的观看效果。对于流媒体服务器能够根据带宽值进行切片媒体文件的选择传输,能保证媒体文件正常传输,进而用户终端能够流畅的播放。After playing the second slice data, the user terminal will continue to periodically detect the current link bandwidth of the request association at the first threshold time interval, or periodically request the bandwidth detection device to detect and provide the request association The bandwidth of the current link, and according to the bandwidth value and the streaming media file identifier carried in the request, search for the matching streaming media slice attribute information from the description file, and obtain and send the matching streaming media slice attribute information to the The user terminal returns the corresponding third and fourth slice data, etc., until the transmission of a complete streaming media file ends. It should be noted that all the sliced data returned are stream media files with the same identifier, and the user terminal only needs to send a request for obtaining the stream media file to the server once, thus reducing the interaction between the user terminal and the server. Further, after receiving the slice data sent by the server, the user terminal plays it. From the user's point of view, it is a continuous and complete streaming media file (such as a video file), and it will not be the code rate of the selected slice data. Differently affect the user's viewing effect. For the streaming media server, the selection and transmission of sliced media files can be performed according to the bandwidth value, which can ensure the normal transmission of the media files, and then the user terminal can play smoothly.

需要说明的是,在本发明实施例中,步骤S201之前,还包括S2011。It should be noted that, in the embodiment of the present invention, before step S201, S2011 is also included.

S2011、转码设备将流媒体文件进行转码处理,得到不同码率的流媒体文件中的一个或多个切片数据,以及生成对应的描述文件。S2011. The transcoding device transcodes the streaming media file to obtain one or more slice data in the streaming media file with different code rates, and generates a corresponding description file.

本发明实施例的描述文件可以是一个或多个,应当理解的是,如果是一个描述文件,其中描述的关联关系可以参考前述表二;如果是多个描述文件,相对于针对不同码率的流媒体文件,分别对应有一个描述文件,其中描述的关联关系可以参考前述表一。There may be one or more description files in the embodiment of the present invention. It should be understood that if it is one description file, the association relationship described therein may refer to the aforementioned Table 2; if there are multiple description files, relative to different code rates Each streaming media file corresponds to a description file, and the association relationship described therein can refer to the aforementioned Table 1.

具体的,所述转码设备先复制流媒体文件,生成第一流媒体文件副本和第二媒体文件副本;Specifically, the transcoding device first copies the streaming media file to generate a first copy of the streaming media file and a second copy of the media file;

然后,将所述第一流媒体文件副本和第二流媒体文件副本分别进行转码,生成具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本;Then, the first stream media file copy and the second stream media file copy are respectively transcoded to generate a stream media file copy with a first code rate and a stream media file copy with a second code rate;

最后,将所述具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本进行切片,生成若干个等时长的切片数据。Finally, slice the stream media file copy with the first code rate and the stream media file copy with the second code rate to generate several slice data of equal duration.

S2012、转码设备将生成的切片数据和描述文件发送到流媒体服务器。S2012. The transcoding device sends the generated slice data and description file to the streaming media server.

流媒体服务器将接收到的切片数据和描述文件进行保存,当流媒体服务器接收到用户终端发送的获取流媒体文件的请求后,流媒体服务器可以根据描述文件查找并获取到切片数据。The stream media server saves the received slice data and description file, and when the stream media server receives a request from the user terminal to obtain the stream media file, the stream media server can search and obtain the slice data according to the description file.

但是,在本发明实施例中,步骤S2011与S2012是步骤S201~S211的前提条件,一旦切片数据生成,可以由流媒体服务器直接获取,不是每次用户终端发送获取流媒体请求都要进行转码过程。However, in the embodiment of the present invention, steps S2011 and S2012 are the preconditions of steps S201-S211. Once the slice data is generated, it can be obtained directly by the streaming media server, and it is not necessary to perform transcoding every time the user terminal sends a streaming media request. process.

可见,本发明实施例提供了一种动态码率调整的方法,能够对用户终端的链路带宽进行检测,根据链路带宽发送经过转码和切片后的切片数据,且每次进行切片数据前都能够进行带宽检测和切片数据的选择,实现了流媒体业务的动态码率调整,对用户终端、流媒体服务器等的都有所提升,具体的,It can be seen that the embodiment of the present invention provides a dynamic code rate adjustment method, which can detect the link bandwidth of the user terminal, and transmit the sliced data after transcoding and slicing according to the link bandwidth, and each time before slicing the data Both can perform bandwidth detection and slice data selection, realize dynamic code rate adjustment of streaming media services, and improve user terminals, streaming media servers, etc. Specifically,

1)就用户终端而言,码率根据带宽动态调整,在低带宽情况下,能保证媒体文件的的流畅性,带宽充足时,可提升流媒体(如音频或视频)质量,从而提升了客户端流媒体播放体验,另外,相对于现有技术中,用户终端每播放一个分片都要发起一个新的HTTP请求,本发明实施例中用户终端只需要发起一次获取流媒体文件的请求(即整个过程只需要一次HTTP请求),用户终端与流媒体服务器之间的交互大大减少。此外,相对于传统技术而言,本发明实施例的用户终端无需解析描述文件,因此本发明实施例的用户终端无需定制,适应性更强。1) As far as the user terminal is concerned, the code rate is dynamically adjusted according to the bandwidth. In the case of low bandwidth, the smoothness of media files can be guaranteed. When the bandwidth is sufficient, the quality of streaming media (such as audio or video) can be improved, thereby improving the user experience. In addition, compared with the prior art, the user terminal needs to initiate a new HTTP request every time a segment is played, but in the embodiment of the present invention, the user terminal only needs to initiate a request for obtaining the streaming media file once (i.e. The whole process only needs one HTTP request), and the interaction between the user terminal and the streaming media server is greatly reduced. In addition, compared with the traditional technology, the user terminal in the embodiment of the present invention does not need to parse the description file, so the user terminal in the embodiment of the present invention does not need to be customized and has stronger adaptability.

2)就流媒体服务器而言,由流媒体服务器调整流媒体文件的码率,从而使流媒体服务器具备了网络带宽分配能力,尤其在高并发情况下,此特性使网络带宽能更有效利用。2) As far as the streaming media server is concerned, the streaming media server adjusts the code rate of the streaming media file, so that the streaming media server has the ability to allocate network bandwidth, especially in the case of high concurrency, this feature enables more efficient use of network bandwidth.

实施例三Embodiment three

如图4所示,本发明实施例提供了一种流媒体服务器400,包括:获取单元401、处理单元402以及发送单元403,其中,As shown in FIG. 4 , an embodiment of the present invention provides a streaming media server 400, including: an acquisition unit 401, a processing unit 402, and a sending unit 403, wherein,

获取单元401,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;The obtaining unit 401 is configured to obtain the bandwidth of the current link associated with the user terminal's request for obtaining the streaming media file, and the bandwidth is represented by a bandwidth value;

处理单元402,用于根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;The processing unit 402 is configured to obtain, according to the bandwidth value, corresponding slice data in a matching streaming media file from multiple streaming media files corresponding to the request and having different code rates, wherein the streaming media file The corresponding code rate matches the bandwidth value;

发送单元403,用于向所述用户终端返回所述切片数据。A sending unit 403, configured to return the slice data to the user terminal.

本发明实施例中,在一种实现方式下,所述处理单元402具体用于:In the embodiment of the present invention, in an implementation manner, the processing unit 402 is specifically configured to:

根据所述带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述带宽值相匹配,以及根据所述流媒体切片属性信息,获取对应的切片数据,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址。Searching for matching streaming media slice attribute information from the description file according to the bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information corresponds to the streaming media file identifier, and The code rate information associated with the streaming media slice attribute information matches the bandwidth value, and according to the streaming media slice attribute information, corresponding slice data is obtained, and the streaming media slice attribute information includes that the streaming media file includes The start time, end time and storage address of each slice data of .

应当理解的是,一个完整的流媒体文件包括一个或多个切片,从时间轴上来看,切片可以分成头切片,中间切片和尾切片,应当理解的是,这些切片可以是码率相同的切片,也可以是码率不同的切片,具体根据实际应用场景下的带宽来决定;It should be understood that a complete streaming media file includes one or more slices. From the perspective of the time axis, slices can be divided into header slices, middle slices and tail slices. It should be understood that these slices can be slices with the same code rate , can also be slices with different bit rates, depending on the bandwidth in the actual application scenario;

针对头切片而言,所述获取单元401具体用于:当收到用户终端发送的获取流媒体文件的请求后,检测所述请求关联的当前链路带宽,或者请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第一带宽值表示。For header slices, the obtaining unit 401 is specifically configured to: after receiving a request for obtaining a streaming media file sent by a user terminal, detect the current link bandwidth associated with the request, or request the bandwidth detection device to detect and provide the The bandwidth of the current link associated with the request is represented by the first bandwidth value.

所述处理单元402具体用于:根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;根据起始时间升序排序第一的切片数据的存放地址,获取对应的第一切片数据。The processing unit 402 is specifically configured to: search for matching streaming media slice attribute information from the description file according to the first bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information Corresponding to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the first bandwidth value, the streaming media slice attribute information includes each The start time, end time and storage address of the slice data; sort the storage address of the first slice data in ascending order according to the start time, and obtain the corresponding first slice data.

所述发送单元403具体用于:向所述用户终端返回所述第一切片数据。The sending unit 403 is specifically configured to: return the first slice data to the user terminal.

针对中间切片或尾切片而言,在本发明实施例中,所述获取单元401具体用于:当收到用户终端发送的获取流媒体文件的请求,且返回所述第一切片数据后,以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示。For the middle slice or tail slice, in the embodiment of the present invention, the acquiring unit 401 is specifically configured to: when receiving a request for acquiring a streaming media file sent by the user terminal and returning the first slice data, Periodically detect the bandwidth of the current link associated with the request at a first threshold time interval, or periodically request the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, and the bandwidth uses the second bandwidth Value representation.

所述处理单元402具体用于:根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;以及,根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取对应的下一个切片数据(例如第二切片数据,第三切片数据...第N切片数据)。The processing unit 402 is specifically configured to: search for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information Corresponding to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the second bandwidth value, the streaming media slice attribute information includes each The start time, end time and storage address of the slice data; and, according to the storage address of the slice data whose start time is the same as the end time of the first slice data or the last slice data or continuous, obtain the corresponding next Slice data (eg second slice data, third slice data... Nth slice data).

所述发送单元403具体用于:向所述用户终端返回所述下一个切片数据(例如第二切片数据,第三切片数据...第N切片数据)。The sending unit 403 is specifically configured to: return the next slice data (for example, the second slice data, the third slice data...the Nth slice data) to the user terminal.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

本发明实施例提供了一种流媒体服务器,能够获取用户终端的链路带宽值,根据带宽值发送经过转码和切片后的切片数据,且每次进行切片数据前都能够进行带宽检测和切片数据的选择,实现了流媒体文件在传输过程中的动态码率调整,提高了网络传输利用率,提升了用户体验。The embodiment of the present invention provides a streaming media server, which can obtain the link bandwidth value of the user terminal, and send sliced data after transcoding and slicing according to the bandwidth value, and can perform bandwidth detection and slicing before each slicing data The selection of data realizes the dynamic code rate adjustment of streaming media files during transmission, improves the utilization rate of network transmission, and enhances user experience.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (7)

1.一种通信系统,其特征在于,包括:1. A communication system, characterized in that, comprising: 用户终端设备,用于向流媒体服务器发起获取流媒体文件的请求,以及接收并播放所述流媒体服务器返回的切片数据;A user terminal device, configured to initiate a request to a streaming media server for obtaining a streaming media file, and receive and play sliced data returned by the streaming media server; 带宽检测设备,用于检测用户终端设备的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用第一带宽值表示;The bandwidth detection device is used to detect the bandwidth of the current link associated with the request of the user terminal equipment to obtain the streaming media file, and the bandwidth is represented by a first bandwidth value; 所述流媒体服务器具体用于:根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;以及根据起始时间升序排序第一的切片数据的存放地址,获取并向用户终端返回对应的第一切片数据。The streaming media server is specifically configured to: search for matching streaming media slice attribute information from the description file according to the first bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information Corresponding to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the first bandwidth value, the streaming media slice attribute information includes each The start time, end time and storage address of the slice data; and the storage address of the first slice data in ascending order according to the start time, acquire and return the corresponding first slice data to the user terminal. 2.根据权利要求1所述的系统,其特征在于,2. The system of claim 1, wherein: 所述带宽检测设备,还用于当收到用户终端发送的获取流媒体文件的请求,且返回所述第一切片数据后,以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示;The bandwidth detection device is further configured to periodically detect the bandwidth associated with the request at a first threshold time interval after receiving a request for obtaining a streaming media file sent by a user terminal and returning the first slice data. The bandwidth of the current link, or periodically requesting the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, where the bandwidth is represented by a second bandwidth value; 所述流媒体服务器具体用于:根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址,以及根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取并向用户终端返回对应的下一个切片数据。The streaming media server is specifically configured to: search for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information Corresponding to the streaming media file identifier, and the code rate information associated with the streaming media slice attribute information matches the second bandwidth value, the streaming media slice attribute information includes each The start time, end time and storage address of the slice data, and the storage address of the slice data whose start time is the same as or continuous with the end time of the first slice data or the last slice data, acquire and return to the user terminal The corresponding next slice data. 3.根据权利要求1所述的系统,其特征在于,进一步包括:3. The system according to claim 1, further comprising: 转码设备,用于复制流媒体文件,生成第一流媒体文件副本和第二流媒体文件副本;A transcoding device is used to copy the streaming media file to generate a first copy of the streaming media file and a second copy of the streaming media file; 将所述第一流媒体文件副本和第二流媒体文件副本分别进行转码,生成具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本;Transcoding the first copy of the streaming media file and the copy of the second streaming media file respectively to generate a copy of the streaming media file with a first code rate and a copy of the streaming media file with a second code rate; 将所述具有第一码率的流媒体文件副本和具有第二码率的流媒体文件副本进行切片,生成若干个等时长的切片数据。Slicing the copy of the streaming media file with the first code rate and the copy of the streaming media file with the second code rate to generate several slice data of equal duration. 4.一种流媒体业务的处理方法,其特征在于,应用于流媒体服务器,包括:4. A processing method for a streaming media service, characterized in that it is applied to a streaming media server, comprising: 获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;Acquiring the bandwidth of the current link associated with the request of the user terminal for obtaining the streaming media file, the bandwidth is represented by a bandwidth value; 根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;According to the bandwidth value, obtain the corresponding slice data in the matching streaming media file from multiple streaming media files corresponding to the request and different bit rates, wherein the bit rate corresponding to the streaming media file is the same as the bit rate of the streaming media file match the above bandwidth value; 向所述用户终端返回所述切片数据;returning the sliced data to the user terminal; 其中,所述获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示,包括:Wherein, the acquisition and the bandwidth of the current link associated with the request of the user terminal to acquire the streaming media file, the bandwidth is represented by a bandwidth value, including: 当收到用户终端发送的获取流媒体文件的请求后,检测所述请求关联的当前链路带宽,或者请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第一带宽值表示;After receiving the request from the user terminal to obtain the streaming media file, detect the bandwidth of the current link associated with the request, or request the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, and the bandwidth uses the first A bandwidth value representation; 其中,所述根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据包括:Wherein, according to the bandwidth value, obtaining the corresponding slice data in the matching streaming media file from multiple streaming media files corresponding to the request and with different code rates includes: 根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;Search for matching streaming media slice attribute information from the description file according to the first bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information corresponds to the streaming media file identifier , and the code rate information associated with the streaming media slice attribute information matches the first bandwidth value, and the streaming media slice attribute information includes the start time and end time of each slice data included in the streaming media file and storage address; 根据起始时间升序排序第一的切片数据的存放地址,获取对应的第一切片数据;Sort the storage address of the first slice data in ascending order according to the start time, and obtain the corresponding first slice data; 其中,所述向所述用户终端返回所述切片数据包括:向所述用户终端返回所述第一切片数据。Wherein, the returning the slice data to the user terminal includes: returning the first slice data to the user terminal. 5.根据权利要求4所述的方法,其特征在于,5. The method of claim 4, wherein, 所述获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示,包括:The acquisition is related to the bandwidth of the current link associated with the user terminal's request for obtaining the streaming media file, and the bandwidth is represented by a bandwidth value, including: 当收到用户终端发送的获取流媒体文件的请求,且返回所述第一切片数据后,以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示;After receiving the request from the user terminal to obtain the streaming media file and returning the first slice data, periodically detect the current link bandwidth associated with the request at the first threshold time interval, or periodically The request bandwidth detection device detects and provides the bandwidth of the current link associated with the request, and the bandwidth is represented by a second bandwidth value; 其中,所述根据所述带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述带宽值相匹配,以及根据所述流媒体切片属性信息,获取对应的切片数据,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址,包括:Wherein, according to the bandwidth value and the streaming media file identification carried in the request, search for matching streaming media slice attribute information from the description file, wherein the streaming media slice attribute information is consistent with the streaming media file identification Correspondingly, and the code rate information associated with the streaming media slice attribute information matches the bandwidth value, and according to the streaming media slice attribute information, obtain the corresponding slice data, and the streaming media slice attribute information includes the The start time, end time and storage address of each slice data included in the streaming media file, including: 根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;Search for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information corresponds to the streaming media file identifier , and the code rate information associated with the streaming media slice attribute information matches the second bandwidth value, the streaming media slice attribute information includes the start time and end time of each slice data included in the streaming media file and storage address; 根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取对应的下一个切片数据;Acquiring the corresponding next slice data according to the storage address of the slice data whose starting time is the same as or continuous with the end time of the first slice data or the last slice data; 其中,所述向所述用户终端返回所述切片数据包括:向所述用户终端返回所述下一个切片数据。Wherein, the returning the slice data to the user terminal includes: returning the next slice data to the user terminal. 6.一种流媒体服务器,其特征在于,包括:6. A streaming media server, characterized in that, comprising: 获取单元,用于获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,所述带宽用带宽值表示;An acquisition unit, configured to acquire the bandwidth of the current link associated with the user terminal's request for acquiring a streaming media file, the bandwidth being represented by a bandwidth value; 处理单元,用于根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,其中,所述流媒体文件对应的码率与所述带宽值相匹配;A processing unit, configured to obtain, according to the bandwidth value, corresponding slice data in a matching streaming media file from a plurality of streaming media files corresponding to the request and having different code rates, wherein the streaming media file corresponds to The code rate matches the bandwidth value; 发送单元,用于向所述用户终端返回所述切片数据;a sending unit, configured to return the sliced data to the user terminal; 其中,所述获取单元获取与用户终端的获取流媒体文件的请求所关联的当前链路的带宽,具体用于:当收到用户终端发送的获取流媒体文件的请求后,检测所述请求关联的当前链路带宽,或者请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第一带宽值表示;Wherein, the obtaining unit obtains the bandwidth of the current link associated with the user terminal's request for obtaining the streaming media file, and is specifically used for: after receiving the request for obtaining the streaming media file sent by the user terminal, detecting the association of the request The bandwidth of the current link, or request the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, the bandwidth is represented by a first bandwidth value; 所述处理单元根据所述带宽值,从与所述请求对应的、不同码率的多个流媒体文件中获取匹配的流媒体文件中的相应的切片数据,具体用于:根据所述第一带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第一带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;根据起始时间升序排序第一的切片数据的存放地址,获取对应的第一切片数据;According to the bandwidth value, the processing unit obtains the corresponding slice data in the matching streaming media file from multiple streaming media files corresponding to the request and with different code rates, specifically for: according to the first The bandwidth value and the streaming media file identifier carried in the request, and search for matching streaming media slice attribute information from the description file, wherein the streaming media slice attribute information corresponds to the streaming media file identifier, and the stream The code rate information associated with the media slice attribute information matches the first bandwidth value, and the stream media slice attribute information includes the start time, end time and storage address of each slice data included in the stream media file; according to Sort the storage address of the first slice data in ascending order by the start time, and obtain the corresponding first slice data; 所述发送单元向所述用户终端返回所述切片数据,具体用于:向所述用户终端返回所述第一切片数据。The sending unit returns the slice data to the user terminal, and is specifically configured to: return the first slice data to the user terminal. 7.根据权利要求6所述的流媒体服务器,其特征在于,7. streaming media server according to claim 6, is characterized in that, 所述获取单元具体用于:当收到用户终端发送的获取流媒体文件的请求,且返回所述第一切片数据后,以第一阈值时间间隔,周期性地检测所述请求关联的当前链路带宽,或者周期性地请求带宽检测设备检测并提供所述请求关联的当前链路的带宽,所述带宽用第二带宽值表示;The obtaining unit is specifically configured to: when receiving a request for obtaining a streaming media file sent by a user terminal and returning the first slice data, periodically detect the current file associated with the request at a first threshold time interval. link bandwidth, or periodically request the bandwidth detection device to detect and provide the bandwidth of the current link associated with the request, where the bandwidth is represented by a second bandwidth value; 所述处理单元具体用于:根据所述第二带宽值和所述请求中携带的流媒体文件标识,从描述文件中查找匹配的流媒体切片属性信息,其中,所述流媒体切片属性信息与所述流媒体文件标识相对应,且所述流媒体切片属性信息关联的码率信息与所述第二带宽值相匹配,所述流媒体切片属性信息包括所述流媒体文件包括的每个切片数据的起始时间、结束时间以及存放地址;以及,根据起始时间与所述第一切片数据或上一个切片数据的结束时间相同或连续的切片数据的存放地址,获取对应的下一个切片数据;The processing unit is specifically configured to: search for matching streaming media slice attribute information from the description file according to the second bandwidth value and the streaming media file identifier carried in the request, wherein the streaming media slice attribute information is the same as The streaming media file identifier corresponds, and the code rate information associated with the streaming media slice attribute information matches the second bandwidth value, and the streaming media slice attribute information includes each slice included in the streaming media file The start time, end time and storage address of the data; and, according to the storage address of the slice data whose start time is the same as the end time of the first slice data or the last slice data or continuous, obtain the corresponding next slice data; 所述发送单元具体用于:向所述用户终端返回所述下一个切片数据。The sending unit is specifically configured to: return the next slice data to the user terminal.
CN201210101482.0A 2012-03-31 2012-03-31 A kind of processing method of streaming media service, streaming media server and system Active CN102843351B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210101482.0A CN102843351B (en) 2012-03-31 2012-03-31 A kind of processing method of streaming media service, streaming media server and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210101482.0A CN102843351B (en) 2012-03-31 2012-03-31 A kind of processing method of streaming media service, streaming media server and system

Publications (2)

Publication Number Publication Date
CN102843351A CN102843351A (en) 2012-12-26
CN102843351B true CN102843351B (en) 2016-01-27

Family

ID=47370414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210101482.0A Active CN102843351B (en) 2012-03-31 2012-03-31 A kind of processing method of streaming media service, streaming media server and system

Country Status (1)

Country Link
CN (1) CN102843351B (en)

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125482B (en) * 2013-04-23 2018-01-30 深圳中兴网信科技有限公司 A kind of flow media playing method and device
CN103354618B (en) * 2013-06-24 2015-04-15 西安交通大学 HLS-based multi-scenario streaming media adaptive live broadcast method
WO2015000142A1 (en) * 2013-07-02 2015-01-08 华为技术有限公司 Method, system and equipment for transmitting service data
CN103561283A (en) * 2013-10-30 2014-02-05 乐视致新电子科技(天津)有限公司 Method and device for code rate switch of smart television
CN103731415A (en) * 2013-12-09 2014-04-16 乐视网信息技术(北京)股份有限公司 High code stream data transmitting method and device
CN103763580B (en) * 2014-01-06 2017-09-29 深圳创维数字技术有限公司 A kind of multi-medium play method and relevant device
CN105027530B (en) * 2014-01-23 2018-09-07 华为技术有限公司 Mobile terminal, first base station and Streaming Media are segmented acquisition methods
CN105791223B (en) * 2014-12-22 2020-01-31 联想(北京)有限公司 media stream data processing method and system and electronic equipment
CN104506631B (en) * 2014-12-26 2018-06-15 杭州网易云音乐科技有限公司 A kind of audio file caching method and equipment
CN104581435A (en) * 2015-01-20 2015-04-29 赵树乔 Naming method of data stream
CN106464942B (en) * 2015-03-20 2020-03-10 华为技术有限公司 Downloading method and device of streaming media resource and terminal equipment
ES2822429T3 (en) 2015-09-18 2021-05-04 Huawei Tech Co Ltd Core network selection method, device and system
CN105306960B (en) * 2015-10-18 2018-05-04 北京航空航天大学 A kind of dynamic self-adapting streaming system for being used for transmission high quality online course video
CN106027337B (en) * 2016-05-11 2019-04-05 百度在线网络技术(北京)有限公司 Smart home platform is applied to Network Provider selection method therein and device
CN107566855B (en) * 2016-06-30 2020-11-10 华为技术有限公司 Method for quickly switching channels, server and set top box
EP4007328B1 (en) * 2016-07-06 2025-01-01 Huawei Technologies Co., Ltd. Network connection configuration method and apparatus
CN107800665B (en) * 2016-08-31 2020-08-25 华为技术有限公司 Multimedia transmission method, access network equipment and terminal
CN107889155A (en) * 2016-09-30 2018-04-06 中兴通讯股份有限公司 A kind of management method and device of network section
CN108023864A (en) * 2016-10-28 2018-05-11 中国移动通信有限公司研究院 Streaming Media method for pushing and device
CN107078852B (en) * 2017-01-18 2019-03-08 深圳市大疆创新科技有限公司 Transmit method, apparatus, computer system and the mobile device of coded data
CN108737355B (en) * 2017-04-25 2021-11-30 中信国安广视网络有限公司 Streaming media playback based on user bandwidth
CN107809680A (en) * 2017-11-07 2018-03-16 长沙曙通信息科技有限公司 A kind of multimedia system transmits control method
CN109981532A (en) * 2017-12-27 2019-07-05 中移(杭州)信息技术有限公司 A kind of transmission method and server of media file
CN109996094B (en) * 2017-12-29 2021-08-13 杭州海康威视系统技术有限公司 Video playing method, device and system
CN110099088B (en) * 2018-01-31 2022-03-08 国广融合(北京)传媒科技发展有限公司 Self-adaptive data transmission method based on fusion transmission system
CN108769805B (en) * 2018-06-11 2021-05-07 广州酷狗计算机科技有限公司 Data transmission method, device, computer equipment and storage medium
CN111083430B (en) * 2018-10-18 2021-04-23 杭州海康威视系统技术有限公司 Image acquisition method and device, electronic equipment and storage medium
CN110086777A (en) * 2019-03-22 2019-08-02 视联动力信息技术股份有限公司 A kind of video broadcasting method and transfer server based on view networking
CN110740342B (en) * 2019-09-06 2022-02-18 浙江大华技术股份有限公司 Storage medium, streaming media transmission and playing method, and slicing method and device
CN112383834A (en) * 2020-10-28 2021-02-19 北京宁算科技有限公司 Intelligent streaming media method based on cloud computing
CN119071277B (en) * 2024-07-27 2025-04-18 广州九微信息科技有限公司 A method and device for optimizing streaming media audio

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145933A (en) * 2007-10-26 2008-03-19 北大方正集团有限公司 Publishing system, sending method and receiving method of media data, and corresponding device
CN101741890A (en) * 2008-11-19 2010-06-16 华为技术有限公司 A method, system and device for realizing rate control
CN102088620A (en) * 2010-12-01 2011-06-08 中兴通讯股份有限公司 Method for downloading media file in content distribution network and client
CN102118357A (en) * 2009-12-31 2011-07-06 华为技术有限公司 Method, device and system for processing streaming media
CN102143384A (en) * 2010-12-31 2011-08-03 华为技术有限公司 Method, device and system for generating media file

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070130358A1 (en) * 2005-12-02 2007-06-07 Mike Severa Faster Than Real Time Streaming in a Playlist Context

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145933A (en) * 2007-10-26 2008-03-19 北大方正集团有限公司 Publishing system, sending method and receiving method of media data, and corresponding device
CN101741890A (en) * 2008-11-19 2010-06-16 华为技术有限公司 A method, system and device for realizing rate control
CN102118357A (en) * 2009-12-31 2011-07-06 华为技术有限公司 Method, device and system for processing streaming media
CN102088620A (en) * 2010-12-01 2011-06-08 中兴通讯股份有限公司 Method for downloading media file in content distribution network and client
CN102143384A (en) * 2010-12-31 2011-08-03 华为技术有限公司 Method, device and system for generating media file

Also Published As

Publication number Publication date
CN102843351A (en) 2012-12-26

Similar Documents

Publication Publication Date Title
CN102843351B (en) A kind of processing method of streaming media service, streaming media server and system
CN104025548B (en) For the method and apparatus for the flexible caching for being delivered media
US9401968B2 (en) Method and apparatus for enabling pre-fetching of media
KR101364299B1 (en) Method and apparatus to facilitate client controlled sessionless adaptation
CN102598691B (en) Streaming with optional broadcast delivery of data segments
CN108886630A (en) Signaling of application content packaging and delivery
CA2850416C (en) Method and device for transmitting streaming media
KR20160067126A (en) Method and apparatus for content delivery
US20110246660A1 (en) Systems, Methods, and Apparatuses for Media File Streaming
CN104509060B (en) The method and device of transmission of flow media data
CN103269331A (en) Method and device for selecting playable bit rate content
CN108668146A (en) A method and device for adjusting streaming media code rate
KR20140055340A (en) Method and apparatus for transmitting and receiving media segment using adaptive streaming
CN108494720A (en) A kind of dispatching method and server of dialogue-based migration
EP1719319B1 (en) Method and arrangement for state memory management
CN108632680B (en) A scheduling method for live content, a scheduling server and a terminal
CN103491393B (en) A kind of video traffic processing method and equipment
CN104066015B (en) The flow media playing method and device of mobile terminal
US11012723B2 (en) Service descriptions for multimedia streaming
WO2017071524A1 (en) Multimedia resource publishing method and apparatus
CN104781807B (en) Management method, server and the client of streaming media resource
CN104202618A (en) Method for acquiring broadcasting resource, proxy client, proxy server and system
WO2018068262A1 (en) Video code rate acquisition method, apparatus, and network side device
JP2015008475A (en) Streaming by broadcast distribution of option of data segment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载