CN100486330C - Method for realizing flow media server supporting long-distance storage mode - Google Patents

Method for realizing flow media server supporting long-distance storage mode Download PDF

Info

Publication number
CN100486330C
CN100486330C CN 200510122607 CN200510122607A CN100486330C CN 100486330 C CN100486330 C CN 100486330C CN 200510122607 CN200510122607 CN 200510122607 CN 200510122607 A CN200510122607 A CN 200510122607A CN 100486330 C CN100486330 C CN 100486330C
Authority
CN
China
Prior art keywords
data
module
file
server
stored
Prior art date
Application number
CN 200510122607
Other languages
Chinese (zh)
Other versions
CN1777278A (en
Inventor
刚 吴
奚宏生
俊 李
茅旭峰
许书彬
Original Assignee
中国科学技术大学
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 中国科学技术大学 filed Critical 中国科学技术大学
Priority to CN 200510122607 priority Critical patent/CN100486330C/en
Publication of CN1777278A publication Critical patent/CN1777278A/en
Application granted granted Critical
Publication of CN100486330C publication Critical patent/CN100486330C/en

Links

Abstract

支持异地存储方式的流媒体服务器的实现方法,属于计算机多媒体技术领域,涉及流媒体服务器的实现方法以及流媒体数据的传输,存储和读取方法。 Support offsite storage implemented method of streaming media server, which belongs to the field of multimedia technology, to achieve a method and a streaming media server streaming media data transmission, storing and reading methods. 本方法实现的本地服务器包括四个模块:流化传输模块,虚拟文件模块,数据请求模块,数据接收模块。 This local server implemented method comprises four modules: a transmission module of the stream, the virtual file module, data request module, a data receiving module. 包括以下步骤:将电影文件进行重新组织,分别存储在本地服务器和内容分发服务器;用户点播这些电影文件时,虚拟文件模块通过从操作系统接管特定的目录从而虚拟出此文件的方法,实时的向内容分发服务器请求电影数据,向用户提供服务。 Comprising the steps of: a movie file to re-organize, store distribution in the local server and content server; method users demand these movie files, the virtual file module takes over a specific directory by the operating system so the virtual out of this file, real-time to movie content distribution server request data to provide services to users. 本方法的优点是流化传输模块与虚拟文件模块相互独立,不影响流化传输模块原有的服务。 Advantage of this method is the fluidized module and the transmission module are independent virtual file, does not affect the flow of the original service transmission module.

Description

支持异地存储方式的流媒体服务器的实现方法 Implementation support for off-site storage of streaming media server

技术领域 FIELD

本发明涉及计算机多媒体技术领域,尤其涉及一种支持异地存储方式的流媒体服务器的实现方法以及流媒体数据的传输、存储和读取方法。 The present invention relates to the field of multimedia technology, in particular, it relates to a method for realizing streaming media server off-site storage and streaming media data transmission, storing and reading methods support.

背景技术 Background technique

隨着网络的发展,网络速度的提高,各种各样的音视频服务器也越来越多, 其中流媒体服务器的应用变得更加广泛,用户也逐渐习惯于在网络上点播电影,实时收看节目。 With the development of the network, increase network speed, a variety of audio and video server is also increasing, streaming media server where the application has become more widespread, users have grown accustomed to on-demand movies on the network, real-time viewing program . 随着宽带网络的发展,特别是宽带接入技术的发展,网络传输的瓶颈正在被打破,这就为流媒体技术的发展提供了基础,而流媒体服务器对用户提供高质量的服务也成为可能,例如要求服务器提供码率尽可能高的影片,尽可能多的影片供用户选择。 With the development of broadband networks, especially the development of broadband access technology, network transmission bottleneck is being broken, which provides the basis for the development of streaming media technology, and provide high-quality streaming media server service is also possible for the user , for example, requires the server to provide the highest possible bit rate of the video, as many films to choose from.

现在的流媒体服务器的实现方法多是所有的影片全部存储在本地服务器上,从而只能对用户提供本服务器上的影片,为了提供更丰富的节目,往往采取加大服务器磁盘容量或者采用集群服务器的方式。 Implementation of the streaming media server now mostly all of the videos are all stored on a local server, which can only provide video on this server to the user, in order to provide a richer program, often take to increase the server's disk capacity or the use of cluster server The way. 但是这种实现方式将所有的容量压力都集中在了本地服务器上,却没有充分利用网络的功能,会使本地服务器逐渐不堪重负。 However, this implementation all the capacity pressures have focused on the local server, but does not take full advantage of the network, will gradually overwhelmed the local server.

发明内容 SUMMARY

技术问题:本发明针对现有的流媒体服务器(以后统称为流化传输模块) 提供了一种基于虚拟文件系统方式的支持异地存储方式的流媒体服务器的实现方法,在不改动现有的流化传输模块的前提下,使得流化传输模块能够支持向用户提供采用异地存储方式存储的电影服务,可解决本地服务器的压力过大的问题,充分利用网络的功能。 Problem: The present invention provides a method implemented to support remote storage streaming server virtual file system based on the conventional way for streaming media server (hereinafter collectively referred to as fluidized transmission module), without modification of existing stream under the premise of the transmission module so that the flow of the transfer module can provide support to users using stored off-site storage of movies, local server to resolve the problem of excessive pressure, take full advantage of the network. 技术方案:通过虚拟文件模块,数据请求模块,数据接收模块,连同流化传输模块一起构成了本系统。 Technical Solution: virtual file module, data request module, a data receiving module, along with the fluidizing transmission module of the present system together. 其中,流化传输模块通过向操作系统发出系统调用读取数据向用户提供流媒体服务,与客户端以实时流传输协议(RTSP, Real Time Streaming Protocol )、实时传输协议(RTP, Real-time Transport Protocol 和实时传输控制协议(RTCP, Real-time Transport Control Protocol)进行交互; 虚拟文件模块通过从操作系统接管数据块文件所在目录的方法,向流化传输模块提供统一的文件操作接口,将从上一级服务器传输过来的电影数据片断,通过虚拟映射的方式,变成该目录中的本地文件;数据请求模块向上级内容分发服务器发送数据请求,数据接收模块接收来自上级内容分发服务器的数据。 Wherein the transmission module fluidized by issuing system calls to the operating system to read data streaming service to the user, with the client in real-time streaming protocol (RTSP, Real Time Streaming Protocol), real-time transport protocol (RTP, Real-time Transport protocol and real-time transport control protocol (RTCP, real-time transport control protocol) interacts; a method of operating virtual file system takes over from the module directory file's data blocks, to provide a unified interface to a file operation by the fluidized transport module, from the a server data transmission over the movie clips, virtual mapping way into a local file in that directory; data request module sends a data request to a superior content distribution server, data receiving module receives data from a higher-level content distribution server.

本方法包括以下步骤: The method comprising the steps of:

a) .将电影文件进行为按照电影播放的时间顺序,以M秒为单位,将此M 秒之内的所有音视频数据提取出来,形成一个数据片断,并按照时间顺序将这些片断组织成新的数据文件,同时生成索引文件,分别存放在本地流媒体服务器与内容分发服务器,或单独存放在媒体服务器中,或单独存放在上级内容分发服务器中; a). The movie file to be played back in chronological order the movie to M seconds, this extract all audio and video data within seconds out of M, forming a data segment, and the chronological order of these pieces into a new tissue data files, while generating the index file, are stored in the local server and the streaming media content distribution server, or stored in a separate media server, or stored in a separate higher content distribution server;

b) .户端向流媒体服务器发出电影点播请求; . B) on-demand movies client issuing a request to the streaming server;

C).流化传输模块接收到客户端的电影点播请求,根据路径区别电影文件完全存储在本地还是部分存储在本地,如果完全存储在本地,则与普通文件读取方式相同,如果部分存储在本地,则向虚拟文件模块提出数据请求; C). Fluidized transport module receives movies on demand request from a client, according to the path difference between the movie file is completely stored locally or partially stored locally, if completely stored locally, and general files the same manner as the reading, if the part is stored in a local , then make data requests to the virtual file module;

d) .虚拟文件模块将本地硬盘数据和上级内容分发服务器传过来的数据片断(放在本地内存中)映射成流化传输模块所请求的本地目录下的完整文件,向流化传输模块提供数据服务; d). The virtual file module to the local hard disk and the higher the content distribution server data transmission over a data segment (in local memory) mapped into a complete file in the local directory fluidization requested transmission module, providing data transmission module to a fluidized service;

e) .虚拟文件模块将当前流化数据与索引文件信息进行比较,判断是否需要向上级内容分发服务器申请新的数据,如果需要,则执行第6步,否则执行第8步; . E) virtual file module the current stream data and index file information, and determines whether to apply for a new data to the higher content distribution server, if necessary, to step 6, otherwise go to step 8;

f) .数据申请模块向上级内容分发服务器申请数据; . F) application module to apply the data to the higher data content distribution server;

g) .数据接收模块从上级内容分发服务器接收数据; . G) a data receiving module receives the upper data from the content distribution server;

5h) .流化传输模块读取数据发送给客户端; . 5h) of the transmission module reads the data stream to the client;

i) .从第C步到第h部循环进行,直到点播结束,撤销映射,释放资源。 I). Step C from the first cycle to the second portion h, until the end demand, unmapping, the release of resources.

所述的步骤a包括:所述的电影重新组织方式为按照电影播放的时间顺序, 以M秒为单位,将此M秒之内的所有音视频数据提取出来,形成一个数据片断,并按照时间顺序将这些片断组织成新的数据文件,同时生成索引文件,标记数据文件中各种数据的存储方式,索引文件和数据文件可以存放在媒体服务器或上级内容分发服务器或两者均存储。 Said step a comprises: the film is re-organization of the movie player in chronological order, in M ​​seconds, all audio and video data in this extracted M seconds, forming a data segment, and in time the order of these pieces of data into a new file organization, while generating an index file, data file tag storage of various data, the index file and data files may be stored in the media server or the content distribution server, or both the upper storage.

流化传输模块与虚拟文件模块相互独立,通过不同的存储目录区分流化传输模块是否需要向上级内容分发服务器申请数据。 Fluidized module and a virtual file transfer module independent of each other, through the different storage directory area of ​​the shunt module is required to apply for data transmission to the higher content distribution server. 虚拟文件模块通过从操作系统接管特定的目录的方式接收流化传输模块的读取数据请求,不与流化传输模块直接通信。 By way of taking over the virtual file module specific directory from the operating system receives a request to read the data stream of the transmission module does not communicate directly with the flow of the transmission module. 虚拟文件模块通过读取索引文件找到数据的存储位置进行数据读取。 Virtual file module file found by reading the index data storage location for data reading. 虚拟文件模块通过关键点判断是否需要进行数据请求的步骤。 If the virtual file module data request step needs to be determined by key points.

有益效果:虚拟文件模块与流化传输模块各自独立,虚拟文件模块的实现不影响流化传输模块;现有的流媒体服务器软件都可以很容易的通过本方法, 使它支持异地方式的点播,同时不影响流媒体服务器原有的服务;由于与流化传输模块相分离,具体实现简单。 Beneficial effects: the virtual file transfer module with a fluid module independently, virtual file module does not affect the flow of the transmission module; existing streaming media server software can be easily through this method so that it supports on-demand remote mode, without affecting the existing service streaming media server; due to phase separation and fluidized transmission module is simple.

采用本方法设计的服务器, 一台内容服务器,可以同时服务多台流媒体服务器,增加了整体的服务能力。 This method uses server design, a content server can service multiple simultaneous streaming media server, increases the overall service capacity.

对于一些比较冷门的影片,由于点播的人很少,如果流媒体服务器如果将他全部存储在本地,浪费了存储空间,进一步的,由于是冷门影片,用户点播的概率很小,而且有很大的可能性,用户只看了开头几分钟之后,不再观看。 For some of the more popular films, due to the demand of the very few people, if the streaming media server if all he stored locally, wasted storage space, further, as is the popular movie, the probability of user demand is very small, and there is great after the possibility of users look at the first few minutes, no longer watch. 可以将这种影片大部分存储在内容服务器上,下面的流媒体服务器只存储电影篇头,这样每台服务器都可以向用户提供这部影片的服务,同时减少了占用的磁盘空间。 Much of this movie can be stored on the content server, streaming media server only following chapter head store movies, so each server can provide film services to users, while reducing the amount of disk space.

附图说明 BRIEF DESCRIPTION

图l:流媒体服务器构成框图。 FIG. L: a block diagram of a streaming media server. 图2:本发明详细实现流程图。 Figure 2: a detailed flow chart for implementing the present invention. 图3:索引文件结构。 Figure 3: The index file structure. 图4:数据文件结构。 Figure 4: the data file structure.

具体实施方式 Detailed ways

下面结合苹果(A卯le)公司的流媒体服务器Darwin举出我们在具体实施本发明方法时的例子。 Apple below with (A Le d) streaming media server company Darwin we include the specific examples of embodiment of the method of the present invention. 由于本发明虚拟文件模块与流化传输模块相分离,所以本发明不仅适用于Darwin服务器,对其他服务器如RealNetworks公司的Helix 服务器等同样适用。 Since the present invention is a virtual file module and transmission module fluidized phase separation, the present invention is applicable not only to the server Darwin, is equally applicable to other servers, such as RealNetworks, Inc. Helix servers.

电影文件采用了MP4格式的电影文件,每个MP4文件,由媒体信息 Movie file movie file using the MP4 format, each MP4 file, the information from the media

('moov, atom,元数据)和媒体数据('mdat, atom)两部分组成。 ( 'Moov, atom, metadata) and media data (' mdat, atom) composed of two parts. 鉴于MP4文件中,音视频数据及其索引数据并不一定按时间顺序交织在一起,因此需要对原始的MP4文件进行预处理,使其中的音视频数据及索引数据按一定的时间间隔(选择了30秒)组织成大的数据块形成新的数据文件,并生成索引文件标记新的数据文件中的数据的存储情况,新的数据文件由文件切割工具切割成两部分, 一部分存储在本地得流媒体服务器上,另一部分存储在内容分发服务器上,存储在本地的数据部分包含所有的元数据,以及180秒的媒体数据, 即本地服务器对于采用异地存储存储方式存储的影片都存储了一个影片的前180秒的数据,在不向内容服务器申请数据的情况下可以向用户提供前180秒的播放服务。 In view of the MP4 file, the audio and video data and index data are not necessarily in chronological order intertwined, thus requiring pretreatment MP4 file to the original, so that audio and video data and index data in which a certain time interval (selected 30 seconds) organized into large blocks of data to form a new data file, generates an index file and data storage status flag of the new data file, the new file by the data file the cutting tool is cut into two parts, stored locally overflowing the media server, the other part is stored on a content distribution server, store contains all metadata, and 180 seconds of media data in a local data portion, i.e., the local server for video use offsite storage memory is stored a video the first 180 seconds of data, does not apply in the case where data may be provided to the content server 180 seconds before play services to users.

采用的操作系统环境为Linux操作系统,虚拟文件模块通过向操作系统注册一个文件系统的方式,实现了对特定目录的接管,即当用户程序访问这个特定目录时,发出的一系列系统调用如stat, open, read, close等都被虚拟文件模块接收到,由虚拟文件模块完成这些调用,并可以根据我们的需要,通过从内存中读取数据或着从硬盘的其他地方读取数据的方法,在这个目录中虚拟出一个文件。 Used operating system environment for the Linux operating system, a virtual file system module by registering a file to the operating system, enabling a takeover of a particular directory, that is, when the user program accesses this particular directory, such as a series of system calls made by the stat , open, read, close and so is the virtual file module receives, by the virtual file module to complete these calls, and according to our needs, by reading data from memory or the method of reading data from other parts of the hard disk, a virtual file in this directory.

实现的过程是: The implementation process is:

客户端向流媒体服务器发送电影点播请求,请求的格式为: rtsp:〃ipaddress/path/filename.mp4,其中,path指电影在流媒体服务器上 The client sends a request to the streaming server movies on demand, requested format is: rtsp: 〃ipaddress / path / filename.mp4, wherein, path refers movie streaming server

7的存放路径,流化传输模块(Darwin)接收到这个请求之后根据路径读取电影文件数据,流化之后,向客户端传送数据;完全存储在本地的电影和部分存储在本地的电影的路径是不同的,部分存储在本地的电影都被虚拟成存储在一个特定的由虚拟文件模块管理的目录中,如果客户点播的电影是完全存储在本地的,则Darwin根据路径读取电影文件,向客户端提供服务;如果客户端点播的电影为部分存储在本地的,则路径必定是这个特殊的目录,Darwin从这个目录读取数据,由于这个目录由虚拟文件模块接管,Darwin的一系列的系统调用, 都由虚拟文件模块来完成。 Storage path 7, the flow of the transmission module (the Darwin) after receiving the request to read data from the movie file path, after fluidization, transmitting data to the client; path completely stored in local film and the film portion of the locally stored is different, some movies are stored in a local storage is virtualized into a specific directory in the virtual file management module, if the customer is on-demand movies in local, Darwin read movie files stored entirely based on the path to client service; if the client is part of the on-demand movies stored locally, the path must be this special directory, Darwin read data from this directory, since this was taken over by the virtual file directory module, Darwin series of system called by the virtual file module to complete. Darwin读取电影文件的过程为:打开文件(open), 读取从指定位置开始的一定长度的数据(read),关闭文件(close)。 Darwin movie file read process: Open File (open), a length of the read data starting from the specified position (read), closes the file (close). 虚拟文件模块首先接收到打开文件调用,虚拟文件模块为虚拟出此文件做准备,包括: Virtual File module receives the first call to open the file, virtual file out of this module is a virtual file preparation, including:

(1)将此电影文件对应的索引文件读入内存,(2)为此电影点播分配内存, 存储数据接收模块从内容分发服务器接收得数据块,对于每个点播分配三块内存(内存的使用见读取数据步骤),大小初始为零。 (1) this movie file corresponding index file in memory, (2) movie on demand to allocate memory, store data receiving module receives from the content distribution server available for this data block, allocating three memory (memory used for each demand see data reading step), the size of the initial zero. (3)返回成功,即打开文件成功。 (3) returns success, that is, open the file successfully. 然后Darwin读取数据,虚拟文件模块从操作系统接到Darwin得读取数据请求,主要参数为:电影文件名,所请求的数据在原MP4文件中的偏移, 所请求的数据的长度。 Darwin then reads the data, the virtual file system from the operating module to a data read request to obtain Darwin, main parameters: the name of the movie file, the data requested in the original MP4 file offset, the length of the requested data. 虚拟文件模块根据电影文件名,到相应的内存中査找索引文件表,根据所请求的数据在原MP4文件中的偏移和所请求的数据的长度在索引文件中进行查找,索引文件中标记出了每一块数据(30秒为单位)在原MP4文件中得的偏移,长度,以及存储位置,如果存储在异地则还标记出了从内容服务器传输到本地流媒体服务器之后应存储的内存区域,査找到Darwin 请求的数据的存储位置,如果存储在本地流媒体服务器上,虚拟文件模块从存储在本地的数据文件中读取数据,如果存储在内容服务器,则从相应的内存中读取数据;读取数据之后都要检査是否到达关键点,如果未到达关键点则直接返回本次读取得数据长度,如果达到关键点则通知数据请求模块请求新的数据。 The virtual file module, lookup The movie file names to the corresponding memory in the index file table lookup in the index file according to the length of the offset data requested in the original MP4 file and the requested data, the index file marked in the each block of data (30 seconds) was shifted in the original MP4 file, the length, and a storage location, if stored in different places are also marked for the memory region after the transmission from the content server to the local streaming server to be stored, Charles found Darwin storage location of the requested data, if stored on the local media streaming server, the virtual file data in the local module reads the data file from the storage, if the content stored in the server, from the corresponding read data memory; read after the data fetch will check whether the arrival point key, if the key does not arrive directly back to obtain this read length data, if the key reaches the notification data request module requests new data.

关键点设定为每个30秒数据块在原MP4文件中的起始位置,即每次读取数据之后都检査此次请求的数据是否包含了关键点,如果关键点在本次请求的数据块之内,则认为到达关键点,反之则认为没有到达关键点。 The key point is set to 30 seconds for each data block in the original starting position in the MP4 file, check whether all the requested data read after that is, each key contains data, if the data in the key point of this request within the block, that reaches the critical point, that otherwise does not reach the critical point. 到达关键点时需要申请数据,申请数据的方式采用预申请的方式,即在第n个30秒开始的 Application data reach the required mode key, the application data using the pre-application mode, i.e., 30 seconds at the beginning of the n th

8时候申请第n+2个30秒的数据。 8, when n + 2 th application of the 30 seconds of data. 所以对于每个电影点播来说,需要分配三块内存,循环使用,其中两块是始终有数据的,另一块内存由数据接收模块用来接收数据。 So for each on-demand movies, a memory needs to be allocated three, recycling, which is always two data, other memory by the data receiving module to receive the data. 申请数据时虚拟文件模块根据索引文件以及当前为此电影点播分配的三块内存的使用情况,决定申请的此块数据的存放位置,并为此数据块重新分配所要存储的内存块的大小,以使之能够容纳下数据接收模块接收到的此数据块。 Storage location when the application data virtualization file module according to the index file and the current memory usage for this purpose three movies-on-demand distribution, decided to apply for this block data, and re-allocate the size of the memory block to be stored for this data block to so that it can accommodate a data receiving module receives the data block. 其中n为自然数。 Wherein n is a natural number.

数据请求模块接收到虚拟文件模块的请求数据之后会向内容分发服务器发送数据请求报文,数据接收模块接收到内容分发服务器的数据发送报文之后接收数据到指定的内存区域中。 It will be sent to the content distribution server after receiving a request data requesting module data of the virtual file module data request packet, a data receiving module receives content data distribution server receives data to the specified memory area after sending the message.

用户点播终止,Darwin释放文件,虚拟文件模块释放为此电影点播分配的所有资源。 User demand is terminated, Darwin release file, virtual file module releases all resources allocated for this on-demand movies.

运行结果: operation result:

本实例在局域网环境中进行了运行,监视播放效果,服务器端运行情况。 This example was run in a LAN environment, monitoring playback, the server side operation.

视频点播的文件为2Mbps的采用MPEG-4编码格式的MP4文件,播放器为 VOD file format using MPEG-4 encoding 2Mbps MP4 file, the player is

quicktime,对于同一部MP4影片,分别将其进行两种方式的存储,即一种完全存放在本地服务器上, 一种将其进行中心组织,分别存放在本地服务器和内容服务器上,用两个客户端同时对这两种方式存储的影片进行点播,观看播放效果,画面和声音同样清晰流畅,从客户端看来播放效果没有区别,没有出现停顿现象。 quicktime, with an MP4 movie for, respectively, which was stored in two ways, that is a completely stored on a local server A which was organized by the Center, were stored on a local server and content server with two clients At the same time these two ends of stored movies on-demand, viewing playback, the picture and sound equally clear and smooth playback from the client seems there is no difference, no stuttering. 从本地服务器端来看,两种播放方式的丢包率保持一致。 From the local server side, the packet loss rate of either two ways consistent. 本实例运行环境: This example operating environment:

本地服务器以及内容服务器端的硬件配置及操作系统CPU: Intel P4 2. 4G两颗内存:4G Local content server and server hardware configuration and operating system CPU: Intel P4 2. 4G two memory: 4G

网卡:1000M两块操作系统:Debian 接收端硬件配置及操作系统CPU:Intel P4 2. 4G 内存:256M网卡:10/100M自适应 NIC: 1000M two operating systems: Debian receiving end hardware configuration and operating system CPU: Intel P4 2. 4G memory: 256M card: 10 / 100M adaptive

操作系统:Windows2000 Professional 本发明原理- Operating System: Windows2000 Professional principles of the invention -

如上所述,现在的流媒体服务器的实现方法多是将所有的影片全部存储 As mentioned above, implementation of streaming media server now mostly all the videos all the memory

在本地服务器上。 On the local server. 这种实现方式没有充分利用网络的功能。 This implementation does not take full advantage of the network. 其实,随着网络速度的飞跃,不仅用户可以做到在线收看节目,流媒体服务器也没有必要更没有可能把所有的节目都保存在本地存储设备上,对一些电影,可以只在本地存储一个片头,另一部分存储在上一级服务器(称为内容分发服务器)的方式(称为异地存储),在用户请求的节目数据不在本地时,实时的向自己的上一级服务器请求数据同时向用户提供服务。 In fact, with the rapid speed of the network, users can not only watch the program do online, streaming media server does not need no more likely to put all the programs are stored on a local storage device, some movies can be stored in a local titles only , another portion of the embodiment are stored on a server (referred to as content delivery server) (referred to as off-site storage), when the program data requested by the user is not local, the real-time request to a server on its own data at the same time providing the user service.

下面结合附图对本发明做进一步说明。 Accompanying drawings of the present invention is further described in conjunction.

服务器上的影片种类分为两种, 一种是完全存储在本地,用户点播这种电影时,与传统的流媒体服务器相同,另一种是影片只有一个片头存储在本地(前M秒),在有用户点播时,再向内容分发服务器申请数据。 Video on the server is divided into two types, one is completely stored locally, a user orders such a film, with the same traditional streaming media server, and the other is a film leader is only stored locally (M seconds before), when a user demands, again content distribution server application data.

为实现电影文件在不同服务器上的分块存储,首先需要对电影文件进行分析和重组。 To achieve the movie file segment stored on different servers, you first need to analyze and restructuring of movie files. 电影播放是按照时间顺序播放的,而在具体的电影文件中,各种音视频数据并不一定是按照时间先后顺序存放在电影文件中的,所以为了网络传输的方便需要对电影文件进行重新组织,将每一个时间间隔内的音视频数据提取出来组织在一起形成一个数据片断,按照时间的先后顺序将这些片断组织成一个新的数据文件,并生成相应的索引文件,用以标记数据文件中的数据块与原电影文件中数据块的对应关系,数据文件分段分别保存在本地服务器(其中有些数据必须存放在本地)和内容分发服务器上,而索引文件存放在媒体服务器本地,数据文件与索引文件的格式见附图3、 4。 Movie player is playing in chronological order, but in a specific movie files, various audio and video data is not necessarily in chronological order stored in the movie file, so in order to facilitate network transmission of movie files need to be reorganized the audio and video data within each time interval to extract a piece of data together to form a tissue, a chronological these fragments are organized into a new data file and the index file generated corresponding to the data file tag the original movie file and block data correspondence between data blocks, the data segments are stored in the local file server (which some data must be stored locally) and the content distribution server, and the index files are stored in a local media server, data files index file format, see figures 3, 4.

附图2考虑了用户点播的节目为采用了异地存储方式的电影,用户点播的请求到达流化传输模块,电影存储方式对流化传输模块是透明的,对流化传输模块来说,不同方式存储的电影只是在本机的存储的目录有所不同,流化传输模块根据用户点播请求中的路径目录去读取电影文件。 Brief account of the user 2 is using a program on-demand movie offsite storage, user demand request transmission module of the stream is reached, the film storage fluidized transparent transmission module, a transmission module for fluidization, stored in different ways film differing only in the directory stored in the machine, fluidized transport module to read movie file according to a user demand request in the route directory. 虚拟文件模块管理这个特殊的路径目录,流化传输模块对这个目录的操作都被虚拟文件模块从操作系统那里接管过来。 Virtual file management module this particular path directory, a stream of transmission module operating on this virtual directory have been taken over the module file from the operating system there.

流化传输模块读取文件分为两步,首先打开文件,打幵文件时需要读取文件的大小,存取权限之类的信息,其中文件的大小对流化传输模块来说是必需的,虚拟文件模块在接收到流化传输模块的打开文件请求之后,将此电影相应的索引文件(index文件,其详细结构见附图)读入内存中,形成一张index 表,并读取电影文件的大小返回给流化传输模块。 Fluidizing read the file transfer module in two steps, first to open the file, the file size required to read playing Jian file, access permission information or the like, wherein the size of the file transfer module fluidization is required, virtual after receiving the file module fluidized request to open the file transfer module, this film corresponding index file (index file, and the detailed structure is shown in the drawings) into memory, forming an index table, movie files and read It returns the size of the transmission module to the stream. 之后流化传输模块开始读取数据。 After fluidization transport module starts to read the data.

虚拟文件模块接收到的流化传输模块的读取数据请求内容包括电影文件名,数据长度,数据在电影文件中的偏移。 Reading the virtual file data transmission module fluidized module receives content requests includes an offset movie file name, data length, data in the movie file. 虚拟文件模块根据这三个参数,在index表中进行查找,判断。 Virtual File module based on these three parameters, look in the index table to determine. 如果请求的数据存储在本地则从本地的数据文件 If the requested data is stored in local data files from local

中读取数据,如果请求的数据存储在异地,则从相应的内存中读取数据。 Read data, in the remote, from the corresponding memory read data if the requested data is stored. 读取数据之后都要判断是否到达关键点,如果到达关键点则通知数据请求模块请求数据,数据接收模块接收数据。 After reading the data reaches the critical point to be determined whether, if the key reaches the notification data request request data module, a data receiving module receiving data. 申请数据采用预申请的方式,以M秒为单位, 在每个M秒的开始就申请下下个M秒的音视频数据,即本地服务器的内存中始终有2XM秒的音视频数据可供播放,其中M与前面进行电影文件重组时选择的时间间隔保持一致。 Application data by way of a pre-application to M seconds, at the beginning of each M seconds on the application under the next M seconds of audio and video data, that is, memory local server always 2XM seconds of audio and video data to play wherein M is selected when the previous movie file recombinant interval consistent. 数据接收模块接收到这一个M秒的数据片断之后将其存储在指定的内存中,供虚拟文件模块读取。 After the data receiving module that receives a second M pieces of data stored in the specified memory module for reading the virtual file.

Claims (6)

1. 一种支持异地存储方式的流媒体服务器的实现方法,其特征在于包括以下步骤:a)、将电影文件进行重新组织,分别存放在流媒体服务器与上级内容分发服务器,或单独存放在流媒体服务器,或单独存放在上级内容分发服务器;b)、客户端播放器向流媒体服务器发出电影点播请求;c)、流化传输模块接收到客户端的电影点播请求,根据路径区别电影文件完全存储在本地还是部分存储在本地,如果完全存储在流媒体服务器本地,则与普通文件读取方式相同,如果部分存储在本地,则向虚拟文件模块提出数据请求;d)、虚拟文件模块将本地硬盘数据和上级内容分发服务器传过来的数据片断放在本地内存中映射成流化传输模块所请求的本地目录下的完整文件,向流化传输模块提供数据服务;e)、虚拟文件模块判断是否需要申请新的数据,如果需要,则执行 A support offsite storage implemented method of streaming media server, comprising the steps of: a), reorganize the movie file, are stored in the streaming media server with the higher content distribution server, or stored in a separate stream media server, or stored in a separate higher the content distribution server; B), the client player makes movies on demand request to the streaming server; C), the fluidized transport module received client's demand movies request completely stored according to the path difference between the movie file locally stored locally or partially, if at all streaming media server in the local storage, the file is read with the same general manner, if locally, make data requests to the virtual file stored in the module portion; D), a local hard disk virtual file module and the higher the content distribution server data transmission over the data segments in local memory is mapped into a complete file in the local directory fluidization requested transmission module, providing data transmission services to the fluidized module; E), determines whether the virtual file module apply new data, if needed, perform 第f步,否则执行第h步;f)、数据申请模块向上级内容分发服务器申请数据;g)、数据接收模块从上级内容分发服务器接收数据;h)、流化传输模块读取数据发送给客户端;i)、从第c步到第h步循环进行,直到点播结束,撤销映射,释放资源。 The first step f, otherwise go to step H; f), the application module to apply the data to the higher data content distribution server; G), a data receiving module receives data from the upper distribution server content; H), fluidized read data to a transmitting module client; I), from step c to h-step cycle, until the end demand, unmapping, the release of resources.
2. 根据权利要求1所述的支持异地存储方式的流媒体服务器的实现方法, 其特征在于,所述的步骤a包括:电影重新组织方式为按照电影播放的时间顺序,以M秒为单位,将此M秒之内的所有音视频数据提取出来,形成一个数据片断,并按照时间顺序将这些片断组织成新的数据文件,同时生成索引文件, 标记数据文件中各种数据的存储方式,索引文件和数据文件可以存放在媒体服务器或上级内容分发服务器或两者均存储。 The off-site storage support of claim 1 implemented method as claimed in claim streaming media server, wherein, said step a comprises: the film is re-organization of the movie player in chronological order, in M ​​seconds, All of this audio and video data extracted out in the M seconds, forming a data segment, and these fragments chronologically organized into new data file, while generating an index file, storage label data in various data files, index files and data files can be stored on a media server or superior content distribution server storage, or both.
3. 根据权利要求1或2所述的支持异地存储方式的流媒体服务器的实现方法,其特征在于:流化传输模块与虚拟文件模块相互独立,通过不同的存储目录区分流化传输模块是否需要向上级内容分发服务器申请数据。 The support offsite storage implemented method of claim 12 or the streaming server as claimed in claim, wherein: the fluidized module and the virtual file transfer module independent of each other, through the different storage directory area of ​​the splitter transmission module need application data to the higher content distribution server.
4. 根据权利要求1所述的支持异地存储方式的流媒体服务器的实现方法, 其特征在于:虚拟文件模块通过从操作系统接管特定的目录的方式接收流化传输模块的读取数据请求,不与流化传输模块直接通信。 The off-site storage support of claim 1 implemented method as claimed in claim streaming media server, wherein: the virtual file module by way of taking over a specific directory from the operating system receives a request to read the data stream of the transmission module, not direct communication with the fluidized transmission module.
5. 根据权利要求1或2所述的支持异地存储方式的流媒体服务器的实现方法,其特征在于:虚拟文件模块通过读取索引文件找到数据的存储位置进行数据读取。 The support offsite storage implemented method of claim 12 or the streaming server as claimed in claim, wherein: the virtual file module reads the index file to find the storage location of the data to read the data.
6. 根据权利要求1或2所述的支持异地存储方式的流媒体服务器的实现方法,其特征在于:虚拟文件模块通过关键点判断是否需要进行数据请求的步骤。 The support offsite storage implemented method of claim 12 or the streaming server as claimed in claim, wherein: the virtual file module data request step of determining whether the key is required.
CN 200510122607 2005-11-29 2005-11-29 Method for realizing flow media server supporting long-distance storage mode CN100486330C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200510122607 CN100486330C (en) 2005-11-29 2005-11-29 Method for realizing flow media server supporting long-distance storage mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200510122607 CN100486330C (en) 2005-11-29 2005-11-29 Method for realizing flow media server supporting long-distance storage mode

Publications (2)

Publication Number Publication Date
CN1777278A CN1777278A (en) 2006-05-24
CN100486330C true CN100486330C (en) 2009-05-06

Family

ID=36766539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200510122607 CN100486330C (en) 2005-11-29 2005-11-29 Method for realizing flow media server supporting long-distance storage mode

Country Status (1)

Country Link
CN (1) CN100486330C (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101378490B (en) 2007-08-30 2011-01-19 腾讯科技(深圳)有限公司 Device, client terminal and method for implementing stream medium video order programme
CN101409824B (en) 2007-10-12 2011-12-28 中兴通讯股份有限公司 Demand online purchasing system sources and methods
CN101662655B (en) 2009-09-17 2011-06-08 青岛海信电器股份有限公司 Audio/video on-demand system
CN102307195B (en) * 2011-08-23 2018-10-12 南京中兴新软件有限责任公司 Channel carousel based streaming media and streaming media server
CN102769666B (en) * 2012-06-30 2015-09-23 杭州天视智能系统有限公司 The method of one kind of cloud storage, and cloud storage system
CN104462154B (en) * 2013-09-25 2018-10-12 联想(北京)有限公司 Data processing method and a data processing apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5969714A (en) 1994-09-15 1999-10-19 Northern Telecom Limited Interactive video system with frame reference number
US6170006B1 (en) 1997-07-29 2001-01-02 Matsushita Electric Industrial Co., Ltd. Video on demand service system for performing automatic expanding processing of data and title information
US6211901B1 (en) 1995-06-30 2001-04-03 Fujitsu Limited Video data distributing device by video on demand
US6721490B1 (en) 1998-09-30 2004-04-13 Kabushiki Kaisha Toshiba Hierarchical storage scheme and data playback scheme for enabling random access to realtime stream data
CN1540990A (en) 2000-10-11 2004-10-27 联合视频制品公司 System and methods for providing storage of data on servers in on-demand media delivery system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5969714A (en) 1994-09-15 1999-10-19 Northern Telecom Limited Interactive video system with frame reference number
US6211901B1 (en) 1995-06-30 2001-04-03 Fujitsu Limited Video data distributing device by video on demand
US6170006B1 (en) 1997-07-29 2001-01-02 Matsushita Electric Industrial Co., Ltd. Video on demand service system for performing automatic expanding processing of data and title information
US6721490B1 (en) 1998-09-30 2004-04-13 Kabushiki Kaisha Toshiba Hierarchical storage scheme and data playback scheme for enabling random access to realtime stream data
CN1540990A (en) 2000-10-11 2004-10-27 联合视频制品公司 System and methods for providing storage of data on servers in on-demand media delivery system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
大型视频点播系统的一种负载均衡算法. 尹萍,李俊,刘振安.计算机应用,第25卷第5期. 2005

Also Published As

Publication number Publication date
CN1777278A (en) 2006-05-24

Similar Documents

Publication Publication Date Title
Acharya et al. Middleman: A video caching proxy server
CN100574199C (en) A system and method for distribution-type flow transmission of scalable media
CN1134934C (en) System and method for distributing continuous media content according to special request of customer
US7073191B2 (en) Streaming a single media track to multiple clients
CN1112043C (en) Video optimized media streamer
KR101275726B1 (en) A multi-source and resilient video on demand streaming system for a peer-to-peer subscriber community
JP5596808B2 (en) Multi-user remote video editing
EP2122482B1 (en) Video distribution system including progressive playback
CN103814562B (en) Fragment with a characteristic signal for network streaming media data
KR100449981B1 (en) Video on-demand video file server and how to operate the video file server for
US7403993B2 (en) System and method for highly-scalable real-time and time-based data delivery using server clusters
US6289376B1 (en) Tightly-coupled disk-to-CPU storage server
US7836474B2 (en) Method and apparatus for preprocessing and postprocessing content in an interactive information distribution system
CN1875629B (en) Dynamic composition of pre-encrypted video on demand content
CA2841216C (en) Modular storage server architecture with dynamic data management
US20060053253A1 (en) Caching control for streaming media
CN106209892B (en) Streaming is requested using the enhanced block of scalable coding
RU2577473C2 (en) Enhanced block-request streaming using url templates and construction rules
AU2010210639B2 (en) Server-side support for seamless rewind and playback of video streaming
CN1151645C (en) Distribution interactive multi-medium bussiness system
CN101715650B (en) Set-top box peer-assisted video-on-demand
US7983344B2 (en) Service rate change method and apparatus
US20030097661A1 (en) Time-shifted television over IP network system
CN102474504B (en) It offers a variety of collection and distribution methods for content delivery network support system and method
CN102740159B (en) Media file format and stored in the adaptive transmission system

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model
CF01