CN105405457B - File content reading method and apparatus - Google Patents

File content reading method and apparatus Download PDF

Info

Publication number
CN105405457B
CN105405457B CN201510717761.3A CN201510717761A CN105405457B CN 105405457 B CN105405457 B CN 105405457B CN 201510717761 A CN201510717761 A CN 201510717761A CN 105405457 B CN105405457 B CN 105405457B
Authority
CN
China
Prior art keywords
data
segment
file
address information
data segment
Prior art date
Application number
CN201510717761.3A
Other languages
Chinese (zh)
Other versions
CN105405457A (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 CN201510717761.3A priority Critical patent/CN105405457B/en
Publication of CN105405457A publication Critical patent/CN105405457A/en
Application granted granted Critical
Publication of CN105405457B publication Critical patent/CN105405457B/en

Links

Abstract

本发明实施例提供了一种文件内容读取方法和装置,其中方法,包括:定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息;读取所述第一数据段中存储的所述第二数据段的地址信息;依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息;依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 Example embodiments provide a method and apparatus for reading the contents of the file according to the present invention, wherein the method comprising: positioning to the end of the file; wherein, said file comprising: a main section at the beginning of the movie data file, located in the a first end of the file data segment of fixed length data segments, and a second plurality of logical data segments, said first segment of data is stored address information of the second data segments, said second data segment stored in each logical data segment address information; reading the address information of the second data segments stored in a first data segment; read according to the address information of the second data segment of the second data storage in each segment logical data segment address information; according to the address information of each logical data segments each corresponding to the read data stored in the logical data section, for reading the contents of the file. 通过本发明实施例提供的文件内容读取方案,能够对文件内容进行快速读取。 Reading file content solutions provided by the present invention, it is possible to quickly read the contents of the file.

Description

文件内容读取方法和装置 File content reading method and apparatus

技术领域 FIELD

[0001] 本发明涉及文件播放技术领域,特别是涉及一种文件内容读取方法和装置。 [0001] The present invention relates to a technical field file player, particularly to a method and apparatus for reading a file content.

背景技术 Background technique

[0002] MKV是Matroska的一种媒体文件,而Matroska是一种新的多媒体封装格式,也称多媒体容器(Multimedia Container)。 [0002] MKV Matroska is a media file, Matroska is a new multimedia container format, also called multimedia container (Multimedia Container). 疆丫文件可将多种不同编码的视频及16条以上不同格式的音频和不同语言的字幕流封装到一个Matroska Media文件当中。 Jiang Ah plurality of different audio files encoded video formats and more than 16 different languages ​​and different subtitle streams encapsulated into a file which Matroska Media. MKV文件最大的特点就是能容纳多种不同类型编码的视频、音频及字幕流。 MKV file biggest feature is the ability to accommodate many different types of encoded video, audio and subtitle streams.

[0003] 而随着用户对文件的个性化的播放需要,MKV扩展文件已成为技术人员所研究的热点。 [0003] With the need for users to play personalized file, MKV file extension has become the focus of the research technician. MKV扩展文件是在MKV的基础上增加了多个逻辑数据段后生成的新格式的文件。 The new file format generated MKV file extension is to increase the number of logical data segment on the basis of the MKV. MKV扩展文件生成后由相应的服务器进行管理。 After MKV extension files generated by the corresponding managing server. 在进行MKV扩展文件播放时,播放器可以通过有线或者无线的方式连接到服务器,然后从服务器中读取所需的文件内容进行播放。 When performing playback MKV extension files, the player may be connected to the server via a wired or wireless manner, and then read from the server to play the content file required.

[0004] 目前,播放器在对文件内容进行读取时,需要从文件的第一个数据段开始进行读取,然后按照各逻辑数据段在文件中的排列顺序依次读取各逻辑数据段中存储的数据,直至读取到所需的数据后再进行数据播放。 [0004] Currently, when the player reads contents of the file, from the first data segment needs to start reading the file, and then in the order of each data segment in the logical file sequentially read logical data section of each data storage until after the read data required for data playback. 例如:所需的数据位于文件中的第五个数据段中, 目前在读取所需数据时,则需要从文件的第一个数据段开始读取数据,然后依次读取第二、 第三、第四以及第五个数据段才能够得到所需的数据。 For example: the desired data is located in the file in the fifth segment, when the current required for reading the data, it is necessary to start reading data from the first data segment file, and then sequentially reads the second, third the fourth and fifth pieces of data to be able to get the required data.

[0005] 可见,现有的文件内容读取方案,对文件内容进行读取时,需遍历在所需数据所在的数据段前的全部数据段耗费大量的时间,无法实现对文件内容的快速读取。 [0005] visible, the existing contents of the file read scheme, when reading the contents of the file, you need to traverse the entire data segment before the segment where the data required to spend a lot of time, can not be achieved quickly read the content of the document take. 由于读取文件内容时需要耗费大量的时间,因此,当播放器与服务器之间通过无线连接、且连接速度较慢时,无法保证文件播放的流畅性,影响用户的使用体验。 Due to time-consuming reading file content, therefore, between the player and when the server via a wireless connection, and the connection is slow, can not guarantee smooth playback and affect the user experience.

发明内容 SUMMARY

[0006] 鉴于现有的文件内容读取方案无法实现对文件内容的快读读取问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的文件内容读取方法和装置。 [0006] In view of the existing file content reading program to read the problem can not be achieved quickly read the contents of the file, the present invention is proposed in order to overcome the above problems or to provide an at least partially solve the problems of file content reading method and apparatus . [0007]依据本发明的一个方面,提供了一种文件内容读取方法,包括:定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息;读取所述第一数据段中存储的所述第二数据段的地址信息;依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息;依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 [0007] According to an aspect of the present invention, there is provided a method for reading the contents of a file, comprising: positioning to the end of the file; wherein said file comprises: at the beginning of the main movie file data segment, located in the a first segment of said data file at the end of a fixed length data segments, and a second plurality of logical data segments, said first segment of data is stored address information of the second data segments, said second data segment are stored logical address information of each data segment; reading the address information of the second data segments stored in a first data segment; read according to the address information of the second data segment in said second data storage segment logical address information of each data segment; according to the address information of each logical data segments each corresponding to the read data stored in the logical data section, for reading the contents of the file.

[0008] 可选地,所述第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中,所述依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息的步骤包括:依据所述第二数据段的地址信息读取所述第二数据段中存储的地址索引表;从读取的所述地址索引表中获取各逻辑数据段的地址信息。 [0008] Alternatively, the logical data address information is set for each segment of the second data segments stored in the address index table, according to the address information of the read data to the second segment of the second data segments the step of each logical address information stored in the data segment comprises: a read address index table in the second data segments stored according to the address information of the second data segments; obtained from the index table in the read address logical address information of each data segment.

[0009] 可选地,,所述第一数据段的固定长度为第一设定值,所述读取所述第一数据中存储的所述第二数据段的地址信息的步骤包括:读取距所述文件末尾第一设定值范围内的数据,从读取的数据中获取所述第二数据段的地址信息。 [0009] Alternatively ,, the fixed length of the first data segment is a first set value, the step of reading the address information of first data in the stored second data segment comprising: reading data taken from the end of the first file within the set value range, obtaining address information of the second data segment from the read data.

[0010] 可选地,所述第一数据段的长度为63字节。 [0010] Alternatively, the length of the first data segment is 63 bytes.

[0011] 可选地,所述文件为MKV扩展文件;所述各逻辑数据段包括:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 [0011] Alternatively, the file is a file extension MKV; each of said logical segments comprises: supplemental data and additional content segments, document identification data segment, the data segment navigation user interface, the navigation control data segment, the data segment stream and identifying data stream segment.

[0012] 依据本发明的另一个方面,提供了一种文件内容读取装置,包括:定位模块,用于定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息; 第一地址信息读取模块,用于读取所述第一数据段中存储的所述第二数据段的地址信息; 第二地址信息读取模块,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息;文件读取模块,用于依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 [0012] According to another aspect of the present invention, there is provided a document content reading apparatus, comprising: a positioning module for positioning to the end of the file; wherein said file comprises: the beginning of the file is located in the main movie data segment, the data segment located at a first end of the fixed-length file, a plurality of second data segments and the logical data segments, said first segment of data is stored address information of the second data segments, said first stored in the second data segment address information of each logical data segment; a first reading module address information, the address information of said first data segment of said stored second data segment for reading; a second read address information take module configured according to the address information of the second read data segment address information of each of the logical data segment stored in the second data segments; file reading module, for each logical address according to the data segment information corresponding to the read data stored in each logical data section, for reading the contents of the file.

[0013] 可选地,所述第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中,所述第二地址信息读取模块包括:表读取模块,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的地址索引表;信息读取模块,用于从读取的所述地址索引表中获取各逻辑数据段的地址信息。 [0013] Alternatively, the address information of the second data segments disposed in respective logical data stored in the address segment index table in said second address information reading module comprising: a meter reader module according to the said address information of said second data segment read address index table stored in the second data segments; information reading module, configured to obtain the logical address information of each data segment from said address index table reads.

[0014] 可选地,所述第一数据段的固定长度为第一设定值,所述第一地址信息读取模块读取所述第一数据中存储的所述第二数据段的地址信息时:读取距所述文件末尾第一设定值范围内的数据,从读取的数据中获取所述第二数据段的地址信息。 [0014] Alternatively, the fixed length of the first data segment is a first set value, said first address information reading module reads the first address of the data stored in the second data segments when information: reading data from the end of the file within the first set range of values, obtaining address information of the second data segment from the read data.

[0015] 可选地,所述第一数据段的长度为63字节。 [0015] Alternatively, the length of the first data segment is 63 bytes.

[0016] 可选地,所述文件为MKV扩展文件;所述各逻辑数据段包括:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 [0016] Alternatively, the file is a file extension MKV; each of said logical segments comprises: supplemental data and additional content segments, document identification data segment, the data segment navigation user interface, the navigation control data segment, the data segment stream and identifying data stream segment.

[0017] 与现有技术相比,本发明具有以下优点: [0017] Compared with the prior art, the present invention has the following advantages:

[0018] 本发明实施例提供的文件内容读取方案,针对包含多个逻辑数据段的文件进行内容读取。 [0018] The content of the document reading scheme provided by the embodiments of the present invention, for a file containing a plurality of logical data segments read content. 文件中设置有多个逻辑数据段、主电影数据段、位于文件末尾固定长度的第一数据段以及存储有各逻辑数据段地址信息的第二数据段。 Is provided with a plurality of logical file data segment, the main movie data segment, the data segment is located in a first end of the file has a fixed length and storing the respective logical data segment address information of the second data segments. 在进行文件读取时,先定位到第一数据段获取第二数据段的地址信息,然后依据获取到的地址信息定位到存储有各逻辑数据段地址信息的第二数据段,从该数据断下获取到各逻辑数段的地址信息,然后,依据获取到的地址信息即可对逻辑数据段进行快速定位读取所需的数据,以实现对文件内容的读取。 During document reading, to locate a first data segment address information of the second data acquiring section, and then positioning each of the stored logical data segment address information of the second data segments based on the acquired address information from the data off Get the number of logical address information of each section, then the logical data segment can quickly locate the desired data is read based on the obtained address information, to enable reading of the contents of the file. 可见,本发明实施例提供的文件内容读取方案,能够依据逻辑数据段的地址信息直接定位到所需读取的数据段,相较于现有的需要从文件的首个数据段依次读取各数据段直至读取到所需的数据段为止的文件内容读取方案,能够提升文件内容的读取速度,实现对文件内容的快速读取。 Seen, the file content reading solutions provided by the embodiments of the present invention, the data segment can be positioned directly read desired, compared to conventional logical address information based on the needs of the data segment is read from the first data file segments sequentially each data segment until the read program to read the file contents data until the desired segment, it is possible to enhance the reading speed of the document content, fast reading of the contents of the file. 由于能够实现对文件内容的快速读取,因此,即便是播放器与服务器之间连接的无线网络网速慢时,也可以实现文件的流畅播放。 Due to possible rapid reading of the contents of the file, and therefore, even if the wireless network connection between the player and Suman server can be realized smoothly play the file.

[0019] 上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段, 而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。 [0019] The above description is only an overview of the technical solution of the present invention, in order to more fully understood from the present invention, but may be implemented in accordance with the contents of the specification, and in order to make the aforementioned and other objects, features and advantages of the present invention can be more apparent from the following specific embodiments cite Patent of the present invention.

附图说明 BRIEF DESCRIPTION

[0020] 通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。 [0020] By reading the following detailed description of preferred embodiments Hereinafter, a variety of other advantages and benefits to those of ordinary skill in the art will become apparent. 附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。 The drawings are only for purposes of illustrating a preferred embodiment and are not to be considered limiting of the present invention. 而且在整个附图中,用相同的参考符号表示相同的部件。 But throughout the drawings, like parts with the same reference symbols. 在附图中: In the drawings:

[0021] 图1是根据本发明实施例一的一种文件内容读取方法的步骤流程图; [0021] FIG. 1 is a step of one embodiment of a flowchart of a method to read the file contents according to the present invention;

[0022] 图2是根据本发明实施例二的一种文件内容读取方法的步骤流程图; [0022] FIG. 2 is a two step embodiment of a content file reading method according to the present invention, a flowchart of embodiment;

[0023]图3是根据本发明实施例三的一种文件内容读取装置的结构框图; [0023] FIG. 3 is a block diagram of a document reading apparatus according to a third embodiment in accordance with the contents of the present invention;

[0024]图4是根据本发明实施例四的一种文件内容读取装置的结构框图。 [0024] FIG. 4 is a block diagram showing one embodiment four document content reading apparatus according to the present invention.

具体实施方式 Detailed ways

[0025]下面将参照附图更详细地描述本公开的示例性实施例。 [0025] The following exemplary embodiments of the present disclosure will be described in more detail with reference to the drawings. 虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。 While the exemplary embodiment shows an exemplary embodiment of the present disclosure in the drawings, it should be understood that the present disclosure may be implemented embodiments and should not be set forth herein to limit in various forms. 相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。 Rather, these embodiments are able to more thorough understanding of the present disclosure, and the scope of the present disclosure can be completely conveying to those skilled in the art.

[0026] 实施例一 [0026] Example a

[0027]参照图1,示出了本发明实施例一的一种文件内容读取方法的步骤流程图。 [0027] Referring to FIG. 1, there is shown a flow chart illustrating the steps of the present invention is a method for reading the contents of files embodiment.

[0028]本发明实施例的文件内容读取方法包括以下步骤: [0028] Example contents of a file reading method of the present invention comprises the steps of:

[0029] 步骤S102:定位至文件的末尾。 [0029] the step S102: Navigate to the end of the file.

[0030]在从服务器中读取文件时,首先定位至文件的末尾,以便从文件的末尾字段开始读取数据。 [0030] When reading the file from the server, to the end of the file is first positioned to begin reading the file data from the end of the field.

[0031]待读取的文件可以为标清标准兼容的MKV扩展文件,还可以为高清标准兼容的MKV 扩展文件。 [0031] file to be read is compatible with standard SD MKV file extension, can also standards-compliant HD MKV file extension. 当然,可以是其他适当格式的文件,本发明实施例中,对待读取文件的格式不作具体限制。 Of course, other suitable formats may be file formats embodiment of the present invention, the file-read is not particularly limited.

[0032]步骤S104:读取第一数据段中存储的第二数据段的地址信息。 [0032] Step S104: reading the address information of the second data segment stored in the first data segment.

[0033]其中,待读取的文件包括:位于文件开头的主电影数据段、位于文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,且第一数据段中存储有第二数据段的地址信息,第二数据段中存储有各逻辑数据段的地址信息。 [0033] wherein the file to be read comprises: at the beginning of the main movie file data segment, the data segment located at a first end of the file fixed length data segments, and a second plurality of logical data segments, and the first data storage section the address information of the second data segment, the second data segments stored logical address information of each data segment. 将第一数据段设置在文件末尾且固定长度,更加便于文件打开时进行读取。 The first end of the file data segment disposed and fixed length, to read it easier to open the file.

[0034]需要说明的是,第一数据段以及第二数据段在具体应用过程中可以由本领域技术人员根据实际需求进行命名,例如,将第一数据命名为标识数据段,将第二数据段命名为分割信息数据段。 [0034] Incidentally, data of a first data segment and the second segment may be named according to the actual needs of a person skilled in the specific application process, e.g., the first data name identification data segment, a second segment designated dividing information data segment.

[0035]文件中包含的逻辑数据段可以由本领域技术人员根据实际需求进行设置,本发明实施例中对此不作具体限制。 Logical data segment [0035] contained in the file can be set according to actual demand by those skilled in the art, this embodiment of the present invention is not particularly limited. 例如:当待读取的文件为标清标准兼容的MKV扩展文件时,文件中包含的多个逻辑数据段为补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 For example: when the file is to be read-compatible file extensions MKV SD standard, a plurality of logical data segments contained in the file and additional content is supplemental data segment, the document identification data segment, the data segment navigation user interface, the navigation control data section , information identifying the stream data stream segments and data segments. 当待读取的文件为高清标准兼容的MKV扩展文件时,文件中包含的多个逻辑数据段为补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段、章节信息数据段以及标识流数据段。 When the file is to be read-compatible high-definition standard MKV extension files, a plurality of logical data segments contained in the file and additional content is supplemental data segment, the document identification data segment, a navigation user interface data segment, segment navigation control data, information stream data segment, the data segment and chapter information for identifying a flow of data segments.

[0036]步骤S106:依据第二数据段的地址信息读取第二数据段中存储的各逻辑数据段的地址信息。 [0036] Step S106: reading the logical address information of each data segment stored in the second data segments according to the address information of the second data segment.

[0037]需^要说明的是,第二数据段中存储的各逻辑数据段的地址信息,可以以任意适当的形式进行存储。 [0037] ^ needs to be noted that the logical address information of each data segment stored in the second data segment, may be stored in any suitable form. 例如:可以将各逻辑数据段的地址信息以及各逻辑数据段的标识进行一一对应,存储在地址索引表中;还可以,直接按照顺序依次将各逻辑数据段的标识以及其对应的地址信息存储在第二数据段中。 For example: identification address information of each data segment, and each of the logical logical data segments may be subjected to one correspondence, the address stored in the index table; also, directly in accordance with the order identification data each logical segment and its corresponding address information stored in the second data segment.

[0038]步骤S108:依据各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据, 以进行文件内容读取。 [0038] Step S108: according to the address information of each logical data segments corresponding to the read data stored in each logical data segment, for reading the contents of the file.

[0039]在确定各逻辑数据段的地址信息后,即可依据地址读取各数据段中存储的数据。 [0039] After determining the logical address information of each data segment, to read data stored in each data section according to the address. 例如:预读取文件中的第四个数据段中的数据,若采用普通的读取方式,则依次读取文件的第一、第二、第三以及第四个数据段才可以读取到所需要的数据。 For example: pre-read data in the file data in the fourth segment, if the ordinary read mode, the read file are sequentially first, second, third and fourth segments of data to be read before the required data. 而采用本发明实施例提供的文件内容读取方法,仅需读取最后一个数据段,然后从中获取到第二数据段的地址信息, 通过获取到的第二数据段的地址信息读取第二数据段最终获取到各数据段的地址信息,依据地址信息即可直接读取第四数据段中存储的数据,无需从第一数据段开始依次读取各数据段中存储的数据,以实现对文件内容的快速读取。 The use of file content reading method according to an embodiment of the present invention, only the last data segment is read, and then the address information acquired from a second data segment, the address information acquired by the second reading of the second data segment the final acquired data segment address information of each data segment, the data segment stored in the fourth data based on the address information can be read directly, without having to sequentially read data stored in each data segment from the first segment, in order to achieve Quick to read the file contents.

[0040]通过本发明实施例提供的文件内容读取方法,针对包含多个逻辑数据段的文件进行内容读取。 Reading document content method provided in the [0040] embodiment of the present invention, for reading the content file containing a plurality of logical data segments. 文件中设置有多个逻辑数据段、主电影数据段以及位于文件末尾固定长度的第一数据段以及存储有各逻辑数据段地址信息的第二数据段。 It is provided with a plurality of logical file data segments, a first data segment and the data segment is located in the main movie file is stored at the end of a fixed length and a second data segment for each logical data segment address information. 在进行文件读取时,先定位到第一数据段获取第二数据段的地址信息,然后依据获取到的地址信息定位到存储有各逻辑数据段地址信息的第二数据段,从该数据断下获取到各逻辑数段的地址信息,然后,依据获取到的地址信息即可对逻辑数据段进行快速定位读取所需的数据,以实现对文件内容的读取。 During document reading, to locate a first data segment address information of the second data acquiring section, and then positioning each of the stored logical data segment address information of the second data segments based on the acquired address information from the data off Get the number of logical address information of each section, then the logical data segment can quickly locate the desired data is read based on the obtained address information, to enable reading of the contents of the file. 可见,本发明实施例提供的文件内容读取方法,能够依据逻辑数据段的地址信息直接定位到所需读取的数据段,相较于现有的需要从文件的首个数据段依次读取各数据段直至读取到所需的数据段为止的文件内容读取方案,能够提升文件内容的读取速度,实现对文件内容的快速读取。 Seen, the file content reading method according to an embodiment of the present invention, can be positioned according to the address information of the logical data segments directly to the period required to read data, compared to the existing needs to be read from the first data file segments sequentially each data segment until the read program to read the file contents data until the desired segment, it is possible to enhance the reading speed of the document content, fast reading of the contents of the file.

[0041]实施例二 [0041] Second Embodiment

[0042] 参照图2,示出了本发明实施例二的一种文件内容读取方法的步骤流程图。 [0042] Referring to FIG. 2, the present invention shows a two step embodiment of a document reading contents flowchart of a method embodiment.

[0043]本发明实施例的文件内容读取方法包括以下步骤: [0043] Example contents of a file reading method of the present invention comprises the steps of:

[0044] 步骤S202:播放器定位至文件的末尾。 [0044] Step S202: the player positioned to the end of the file.

[0045] 本发明实施例中以对VID0N文件进行内容读取为例进行说明。 Embodiment [0045] In the present embodiment of the invention, the file content reading VID0N example. 需要说明的是,本发明实施例中提供的文件内容读取方法并不局限于对VID0N文件进行内容读取,还适用于其它包含多个逻辑数据段的文件的内容提取。 Incidentally, the document reading method embodiment provided in the present invention is not limited to the embodiments VID0N content reading file, the content is also applicable to other data segments comprising a plurality of logical file extraction. 其中,VID0N文件为对MKV文件进行扩展后生成的另一种格式的文件。 Wherein the file in another format VID0N file after the file extension MKV generated. VID0N仅是对该特定格式的文件的后缀名,在具体实现过程中,还可以将MKV扩展文件以其它后缀名进行命名,本发明实施例中对此不作具体限制。 VID0N only the suffix of the file of a specific format, the specific implementation process, may also be named MKV extension file in another suffix, this embodiment of the present invention is not particularly limited.

[0046] 播放器从VID0N文件服务器中确定待读取的VID0N文件,然后定位到该文件的末尾对该文件进行内容读取。 [0046] The player determines the file to be read from VID0N VID0N file server, and then locate the end of the file to read the contents of the file. 在VID0N文件服务器中存储有多个VID0N文件,各VID0N文件具有对应的名称和/或标识。 In VID0N file server stores a plurality VID0N files, each file has a corresponding VID0N name and / or identification. VID0N文件中存储有多部电影的主电影以及主电影补充内容,播放器在进行播放时,在VIDON文件服务器中确定待播放的主电影和/或主电影补充内容后,读取到播放器中进行播放。 After VID0N movie file stores a plurality of main section main movie films and supplemental content, when the player is performing playback, to be played back is determined in VIDON main movie file server and / or supplemental content main movie, the player to read play. 需要说明的是播放器可以为任意适当的能够播放MKV文件的播放器, 例如:DVD Watch Box盒子播放器。 It should be noted that the player can appropriate player capable of playing any MKV file, such as: DVD Watch Box box player. 播放器可以通过有线或者无线网络与文件服务器进行交互。 The player can interact with wired or wireless network file server.

[0047] 本发明实施例中的VID0N文件是在MKV文件格式的基础上,增加多个逻辑数据段后生成新的格式的数据段。 After the file VID0N embodiment is based on the MKV file format, the plurality of logical data segments increases Embodiment [0047] The present invention generates new data segment format. VID0N文件可以是高清标准兼容的MKV扩展文件,也可以是标清标准兼容的MKV文件。 VID0N files can be standards-compliant HD MKV file extension, it can be compatible with standard SD MKV files.

[0048]其中,所述文件包括:位于文件开头的主电影数据段、位于文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有第二数据段的地址信息,第二数据段中存储有各逻辑数据段的地址信息。 [0048] wherein, said file comprising: a main movie beginning of the file data segment, the data segment located at a first end of the file fixed length data segments, and a second plurality of logical data segments, said first segment of data is stored address information of the second data segments, the second data segments stored logical address information of each data segment.

[0049] MKV扩展文件中包括的各逻辑数据段包括但不限于:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 Each logical segment [0049] MKV extension files included include but are not limited to: supplemental and additional content data segment, the document identification data segment, a navigation user interface data segment, the navigation control data section, the stream data segment and identifies the flow of data segments . 并且,当MKV扩展文件为高清标准兼容的MKV文件时,逻辑数据段还包括章节信息数据段。 And, when the extension file MKV HD standard is compatible with MKV files, logical data segment a data segment further includes chapter information.

[0050] 下面分别对文件中包含的各逻辑数据段中存储的数据进行说明: [0050] The following are the data of each file contains the logical data storage segments will be described:

[0051] 主电影数据段中存储有多段主电影,即该数据段中存储的数据由视频、音频及字幕流混合而成,是完整电影情节部分。 [0051] the main movie data segment storage section how the main movie, i.e., the data stored in the data segment by the mixing of video, audio and subtitle stream from, is part of a complete movie plot. 将主电影数据段设置成位于文件开头的数据段,在对文件进行播放是即便不采用导航播放方法,而采用普通的MKV播放方法也可以对主电影数据段中存储的主电影进行顺序播放。 The main movie data segments arranged into a data section at the beginning of the file, in the file play is even without using the navigation playback method, and using conventional MKV playback method may be sequential playback of the main movie data segments stored in the main movie. 可见,通过将主电影数据段设置成首个数据段既可以满足文件导航的播放需求又可以满足类似于MKV播放的普通播放需求。 Visible, the main movie data by segment is set to play only meet the demand of the first file navigation data segment but also to meet the needs similar to normal playback MKV playback.

[0052]主电影数据段中,每段主电影对应有多类音频,以及多类字幕,音频类别可以达到16种国家的语言,当然,也可以更多也可以仅设置几种常用的音频类别,对于字幕类别也同样,对于音频类别、字幕类别的具体设置可以由本领域技术人员根据实际需求进行设置,本发明实施例中对此不作具体限制。 [0052] the main movie data segments, each corresponding to how the main movie class audio, as well as many types of subtitles, audio category up to 16 languages ​​of the country, of course, can also be set up only a few more common audio category for category caption Similarly, for audio class, particularly the subtitle settings category can be set according to actual demand by those skilled in the art, this embodiment of the present invention is not particularly limited. 不仅如此,主电影数据段中还包括各主电影包含的各章节的信息,通过章节信息可以定位到主电影的具体章节。 Moreover, the main movie data segment further comprises information of each chapter included in each of the main movie, can be targeted to specific sections of the main movie by chapter information. 其中,章节信息包括章节标识,各章节对应的起始时间以及结束时间。 Wherein the chapter information including section identifier, start time of each chapter and the corresponding end time.

[0053]补充和额外内容数据段中存储有多段电影补充内容,该段数据中存储的数据也由视频、音频及字幕流混合而成,是一些电影预告短片及菜单背景等内容。 [0053] supplemented with additional content and data stored in multiple segments complementary segments movie content, data stored in the data segment is also a mixture of video, audio and subtitle streams from, some movie trailers, clips and menu background and so on.

[0054]第一数据段中存储有第二数据段的地址信息。 [0054] In a first data segment is stored in the address information of the second data segment. 第一数据段设置在文件末尾且设置成固定长度既可以保证文件对MKV格式的兼容,又可以达到对文件中的第一数据段的准确定位的目的。 A first data segment and the end of the file is provided to a fixed length may be provided to ensure compatibility of the MKV file format, and can achieve accurate first data segment file location.

[0055]第二数据段中存储有文件中各逻辑数据段在文件中的地址信息。 [0055] In a second data segment stored in each logical address information file in the file data segment.

[0056] 文件标识数据段中存储有文件标识。 [0056] In the document identification data segment stored file identifier. 文件标识的具体设置可以由本领域技术人员在实际应用过程中根据实际需求进行设置,只要能够指示其所在文件为特定格式的文件即可。 The setting file may be identified by those skilled in the art in practical application process provided according to actual requirements, as long as they can indicate the specific file format. 例如:用“MKUDVD”标识VID0N文件。 For example: with "MKUDVD" logo VID0N file.

[0057]导航用户界面数据段中存储有生成导航用户界面的数据,例如:记录用户交互显示时各显示元素的位置、开始显示时间等信息。 [0057] The user interface navigation data to navigate data generating section stores a user interface, for example: recording position of each display element when a user interactive display, display start time and other information. 用户通过这些显示元素生成的导航用户界面可以设定播放媒体流数据时需要的音频类别、字幕语言类别以及具体章节等内容。 Generated by the user to navigate the user interface display elements can set desired content while playing the media stream data of the audio type, class and specific sections of the subtitle language and the like.

[0058]导航控制数据段中存储有用来控制完整导航播放过程的导航控制程序。 [0058] In the navigation control data section stores a control program for controlling a navigation during playback of a complete navigation.

[0059]信息流数据段中存储有媒体流数据索引标识、各段媒体流数据时长等信息。 [0059] In the stream data stream segment storage media data index ID, and long time period of each media data stream. 其中, 媒体流数据包括主电影数据段中存储的各段主电影以及补充和额外内容数据段中存储的各段电影补充内容。 Wherein the media data stream segments comprising a main movie data segments stored in the main movie and the movie segments supplemental data and additional content segments stored supplemental content. 信息流数据段中存储有各段主电影的索引标识、时长等信息;同时还存储有各段电影补充内容的索引标识、时长等信息。 The stream data segments are stored index identifies each segment of the main movie, duration and other information; paragraphs also stores index label film supplemental content, duration and other information.

[0060]标识流数据段中存储有类别标识符表,该类别标识符表中针对每段主电影记录有主电影的标识,以及对应的不同语言的音频类别标识及字幕类别标识。 [0060] stream identifying data segments stored class identifier table, the table has a category identifier identifying the primary film, and the different languages ​​corresponding to category identification audio and subtitles for each piece of the main movie category identification record. 当用户通过导航用户界面选择主电影、音频类别以及字幕类别时,通过该类别标识符表即可确定主电影标识、 音频类别标识、以及字幕类别标识,通过这些标识从主电影数据段中提取相应的主电影进行播放即可。 When the user interface to select the main movie, audio and subtitle category by navigating a user category by the category identifier table to determine the identification of the main movie, audio category identification, category identification and subtitles, the movie data is extracted from the main block by identifying the respective the main movie can be played.

[0061]章节信息数据段中存储主电影数据段中存储的各主电影中各个章节的起始时间、 以及终止时间。 Start Time [0061] each of the main sections of the film storing main information data in the movie data segment stored in the segment of each section, and end time.

[0062] —种优选的存储方式为:将第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中。 [0062] - species is preferred storage: address information of each segment in the logical data stored in the second data set in the address segment index table. 本发明实施例中,以将逻辑数据段的地址信息设置在地址索引表中为例进行后续说明。 Embodiment of the present invention, the address information is set to a logical address in the data segment as an example index table described subsequently.

[0063]步骤S204:播放器读取第一数据段中存储的第二数据段的地址信息。 [0063] Step S204: the player reads the address information stored in the first data segment of the second data segment.

[OOM]其中,在对文件中的第一数据段的长度进行设置时,可以将第一数据段长度设置成第一设定值。 [The OOM] wherein, when the data length of the first segment of the file is set, the first data segment length is set to a first set value. 优选地,第一设定值为63字节。 Preferably, the first set value is 63 bytes. 将第一数据段设置成63字节长,既可以满足对第二数据段的地址信息的存储需求,又可以不过多的占用文件的存储空间。 The first data segment is set to 63 bytes long, not only to meet the storage needs for the address information of the second segment of data, but they can take up much storage space the file. 若将第一设定值设定的过大,虽然也可以满足对第二数据段的地址信息的存储需求,但是会占用文件的有效存储空间。 If the first set value is set too high, though also meet the storage needs for address information for the second data segment, but the effective storage space will be occupied by the file. 若将第一设定值设定的过小,虽然能够节省文件的有效存储空间,但无法满足对第二数据段的地址信息的存储需求。 If the first set value is set too low, although effective can save storage space in the file, but can not meet the storage needs for address information for the second data segment.

[0065]当然,第一数据段的长度并不局限于63字节。 [0065] Of course, the length of the first data segment is not limited to 63 bytes. 在具体实现过程中,可以由本领域技术人员根据实际需求进行设置,如可将第一数据段设置成70字节、60字节、55字节等。 In a specific implementation, may be performed by those skilled in the art according to actual demand setting, such as a first data segment may be set to 70 bytes, 60 bytes, 55 bytes and the like.

[0066] —种优选的读取第一数据段中存储的第二数据段的地址信息的方式为:读取距文件末尾第一设定值范围内的数据,从读取的数据中获取第二数据段的地址信息。 [0066] - which are preferably read data stored in the first segment of the second embodiment of the data segment address information is: the end of reading the data file from the first set range of values, acquires the read data from the first the address information of the second data segment.

[0067]例如:第一数据段的固定长度为63字节,在读取第一数据段中存储的第二数据段的地址信息时,定位到文件的末尾,读取从文件末尾起向前读取63字节的数据,即可得到第二数据段的地址信息。 [0067] For example: the fixed-length first data segment is 63 bytes, the second data segment address information stored in the first data segment is read, to locate the end of the file is read from the forward end of the file read 63 bytes of data, to obtain the address information of the second data segment.

[0068] 步骤S206:依据第二数据段的地址信息读取第二数据段中存储的地址索引表。 [0068] Step S206: reading the address segment index table in the second data according to the address information stored in the second data segment. [0069]第二数据段的地址信息的具体形式可以由本领域技术人员根据实际需求进行设置,本发明实施例中对此不作具体限制。 [0069] The specific form of the second data segment address information can be set according to actual demand by those skilled in the art, this embodiment of the present invention is not particularly limited. 例如:第二数据段的地址信息可以为第二数据段的起始位置信息以及结束位置信息,也可以为第二数据段的标识信息以及该数据段的起始位置信息。 For example: the address information of the second data segment may start position information of the second data segment and the end position information may be identification information for the start position information of the second data segment and the data segment.

[0070] 其中,第二数据段的长度可以由本领域技术人员根据实际需求进行设置,本发明实施例对此不作具体限制。 [0070] wherein the length of the second data segment may be set according to actual demand by those skilled in the art, this embodiment of the present invention is not particularly limited. 如随着逻辑数据段数量的增加将第二数据段的长度增大,随着逻辑数据段数量的减少将第二数据段的长度减小。 As with the increase in the number of the logical data section of the second data segment length increases with the decrease of the number of the logical data segments to reduce the length of the second data segment.

[0071] 步骤S208:播放器从读取的地址索引表中获取各逻辑数据段的地址信息。 [0071] Step S208: the address information of each player acquires the logical address of a data segment from the reading of the index table.

[0072] 对于各逻辑数据段的地址信息在地址索引表中的具体存储形式,可以由本领域技术人员根据实际需求进行设置,本发明实施例中对此不作具体限制。 [0072] For each logical address information of the specific data segments stored in the form of the address of the index table can be set according to actual demand by those skilled in the art, this embodiment of the present invention is not particularly limited. 例如:在地址索引表中将逻辑段的标识与地址信息一一对应进行存储。 For example: identification stored in correspondence with the address information in the logical segment address of the index table. L〇〇73」步骤S210:播放器依据各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 L〇〇73 "Step S210: the player according to the address information of each logical data segments corresponding to the read data stored in each logical data section, for reading the contents of the file.

[0074]播放器在获取到文件中的各逻辑数据段的地址信息后,即可依据地址信息针对性的定位到逻辑数据段,读取逻辑数据段中存储的数据。 [0074] After the player obtains the address of each logical information file data segment, according to the address information to target specific logical data segment, the read data stored in the logical data section.

[0075]例如:需要进行文件导航播放,则需要在获取到各逻辑数据段的地址信息后,首先定位到导航控制数据段读取导航控制数据;其次,依据导航控制数据中的具体导航控制程序确定需要获取哪些逻辑数据段;然后再通过逻辑数据段的地址信息对应读取逻辑数据段中存储的数据。 [0075] For example: file navigation player is required, it is necessary after obtaining the logical address information of each data segment, the first segment positioned to the navigation control data to control the read navigation data; secondly, the navigation control data based on a control program specific navigation determining which logical segments need to get data; then the data segment corresponding to the stored logical data read by the logical data address information segment. 再例如:打开文件时,需要首先获取补充和额外内容数据段中存储的电影补充内容,则在获取到各逻辑数据段的地址信息后,确定补充和额外内容数据段对应的地址信息,并依据该地址信息对该数据段进行定位并进行数据读取。 Another example: When you open a file, you need to get the movie to add content to supplement and additional content data segment stored, then after obtaining the address information of each logical data segments, to determine the address information supplements and additional content data corresponding to the segment, and based on the address information of the data section to locate and read the data.

[0076]通过本发明实施例提供的文件内容读取方法,针对包含多个逻辑数据段的文件进行内容读取。 Reading document content method provided in the [0076] embodiment of the present invention, for reading the content file containing a plurality of logical data segments. 文件中设置有多个逻辑数据段、主电影数据段以及位于文件末尾固定长度的第一数据段以及存储有各逻辑数据段地址信息的第二数据段。 It is provided with a plurality of logical file data segments, a first data segment and the data segment is located in the main movie file is stored at the end of a fixed length and a second data segment for each logical data segment address information. 在进行文件读取时,先定位到第一数据段获取第二数据段的地址信息,然后依据获取到的地址信息定位到存储有各逻辑数据段地址信息的第二数据段,从该数据断下获取到各逻辑数段的地址信息,然后,依据获取到的地址信息即可对逻辑数据段进行快速定位读取所需的数据,以实现对文件内容的读取。 During document reading, to locate a first data segment address information of the second data acquiring section, and then positioning each of the stored logical data segment address information of the second data segments based on the acquired address information from the data off Get the number of logical address information of each section, then the logical data segment can quickly locate the desired data is read based on the obtained address information, to enable reading of the contents of the file. 可见,本发明实施例提供的文件内容读取方法,能够依据逻辑数据段的地址信息直接定位到所需读取的数据段,相较于现有的需要从文件的首个数据段依次读取各数据段直至读取到所需的数据段为止的文件内容读取方案,能够提升文件内容的读取速度,实现对文件内容的快速读取。 Seen, the file content reading method according to an embodiment of the present invention, can be positioned according to the address information of the logical data segments directly to the period required to read data, compared to the existing needs to be read from the first data file segments sequentially each data segment until the read program to read the file contents data until the desired segment, it is possible to enhance the reading speed of the document content, fast reading of the contents of the file.

[0077]下面以一具体实例对本发明实施例的文件内容读取方法进行说明: [0077] Next, a specific example of the file contents to embodiments of the present invention will be described reading methods:

[0078]假设Vidon文件包括以下数据段:主电影数据段-预告片1数据段(g卩补充和额外内容数据段1)-预告片2数据段(S卩补充和额外内容数据段1) -Navigation UI数据段(即导航用户界面数据段)-Navigation Control数据段(导航控制数据段)。 [0078] Suppose Vidon file includes the following data group: main movie segment - Trailer 1 data segment (g Jie supplemental and additional content data segment 1) - Trailer second data segment (S Jie supplemental and additional content data segment 1) - navigation UI data segment (i.e., segment navigation user interface data) -Navigation control data segment (segment navigation control data).

[0079]现有的做法并不建立各数据段地址索引表。 [0079] The current practice does not establish each data segment address index table. 只是按顺序依次存储数据段内容,并在每个数据段开始位置设置标识。 SUMMARY just sequentially stored data segments sequentially disposed and identifies the start position of each data segment. 在导航播放文件时,第一次读取,从第一个数据段顺序读到地五个数据段,才能够读取Navigation Control数据段中存储的内容得到导航控制程序;假设导航控制程序中设定的导航程序为先播放预告片2,然后显示UI即导航用户界面, 那么在进行文件导航时,则需要第二次读取文件,从第一个数据段顺序读到第三个数据段获取到预告片2进行播放;在按要求显示UI时,则需要第三次读取文件,从第一数据开始顺序读到第四个数据段,读取UI生成数据生成UI并显示。 When playing the navigation file, the first reading, five data segments to read a data segment from the first sequence, to be able to read the contents of the data segment stored Navigation Control obtain navigation control program; assuming the navigation control program provided the navigation program is given first player trailer 2, i.e., navigation and display user interface UI, the file during the navigation, it is necessary to read the second file, read the third data segment from the first data segment acquired sequence Trailer 2 to play; required when displaying the UI, it is necessary to read the third file, and display the generated UI data generating a first read data from the fourth data segments sequentially read starting UI. 可见,这个过程需要反复多次从头读取文件。 Yet, this process requires repeated re-read the file.

[0080]本具体实例中,在Vidon文件末尾设置固定长度的第一数据段,并且,在第一数据段中建立地址索引表,然后将Vidon文件中各逻辑数据段的地址信息存储在地址索引表中。 [0080] In the present specific example, provided at a first end of the file Vidon fixed length data segment, and establish the address index table in the first data segment, and then the address information is stored in the address index file Vidon each logical data segments table. 也就是说,本发明实施例中的Vidon文件包括以下数据段:主电影数据段-预告片1数据段(即补充和额外内容数据段1)-预告片2数据段(即补充和额外内容数据段1)-Navigation UI数据段(即导航用户界面数据段)-Navigation Control数据段(导航控制数据段)-第二数据段-第一数据段。 That is, the embodiment of the present invention Vidon file data segment includes the following: the main movie segment - segment Trailer 1 (i.e., supplemental and additional content data segment 1) - 2 Trailer data segment (i.e., supplementary data and additional content segment 1) -Navigation UI data segment (i.e., segment navigation user interface data) -Navigation control data segment (data segment navigation control) - second data segments - a first data segment.

[0081]在导航播放文件时,首先读取Vidon文件末尾的第一数据段,从第一数据段中获取第二数据段的地址信息,依据第二数据段的地址信息获取第二数据段中存储的各数据段的地址信息;然后确定Navigation Control数据段的地址信息,依据确定的地址信息获取定Navigation Control数据段中存储的内容以得到导航控制程序。 [0081] When the navigation playback file, the file is first read at the end of a first data segment Vidon, obtains the address of the second data segment from the first segment, the second data acquiring section according to the address information of the second data segment address information of each data segment stored; then determining navigation control data segment address information, the address determined based on a predetermined information acquiring content navigation control data segment stored in the control program to obtain the navigation. 依然假设导航控制程序中设定的导航程序为先播放预告片2,然后显示UI即导航用户界面,那么在进行文件导航时, 则先确定预告片2对应的地址信息,依据确定的地址信息读取预告片2中存储的数据进行预告片2的播放;然后,确定Navigation UI数据段的地址信息,依据确定的地址信息读取Navigation UI数据段下存储的生成UI的数据,生成UI进行显示。 Still assumed that the navigation control program for the first set of navigation program playback trailer 2, i.e., navigation and display user interface UI, the navigation during document, first determine whether the address information corresponding to the trailer 2, based on the determined address information is read 2 takes data stored in the playback Trailer Trailer 2; then, determining the address information of UI Navigation data segment, the read data stored in the generated UI UI Navigation data segment determined according to the address information, to generate the UI display. 可见,本发明实施例提供的文件内容读取方法,可以避免重复多次从文件开始读取文件的繁复过程,仅一次读取索引表内容,就知道全部数据段的位置信息,在需要某个数据段中存储的内容时,可以按地址快速索引速定位至相应的数据段读取存储的数据进行文件内容提取,能够实现对文件内容的快速读取。 Seen, the file content reading method according to an embodiment of the present invention can avoid complicated process is repeated a plurality of times to start reading the file from the file, the contents of the index table is read only once, to know where the entire data segment needed a when the content stored in the data segment address may be indexed by fast speed positioning to a respective read data stored in the file data segment content extraction can be achieved quickly read the content of the document.

[0082] 实施例三 [0082] Example three

[0083] 参照图3,示出了本发明实施例三的一种文件内容读取装置的结构框图。 [0083] Referring to FIG. 3, there is shown a block diagram of embodiments of the present invention III A document reading device according to the contents.

[0084]本发明实施例的文件内容读取装置包括:定位模块302,用于定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息;第一地址信息读取模块304,用于读取所述第一数据段中存储的所述第二数据段的地址信息;第二地址信息读取模块306,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息;文件读取模块308,用于依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 [0084] Example contents of the file reading means of the present invention comprises: a positioning module 302, for positioning to the end of the file; wherein, said file comprising: a main section at the beginning of the movie data file, located in the a first end of the file data segment of fixed length data segments, and a second plurality of logical data segments, said first segment of data is stored address information of the second data segments, said second data segment stored in each logical data segment address information; a first address information reading module 304 for reading the address information of the second data segments stored in the first data section; a second address information reading module 306 for according to the address information corresponding to each logical data segment read file reading module 308 for; data segment address information of the second read address information of each logical data segment stored in the segment data in accordance with a second each logical data stored in the data segment, for reading the contents of the file.

[0085]通过本发明实施例提供的文件内容读取装置,针对包含多个逻辑数据段的文件进行内容读取。 [0085] Example contents of the file provided by the embodiment of the present invention, reading means for reading the content data file containing a plurality of logical segments. 文件中设置有多个逻辑数据段、主电影数据段以及位于文件末尾固定长度的第一数据段以及存储有各逻辑数据段地址信息的第二数据段。 It is provided with a plurality of logical file data segments, a first data segment and the data segment is located in the main movie file is stored at the end of a fixed length and a second data segment for each logical data segment address information. 在进行文件读取时,先定位到第一数据段获取第二数据段的地址信息,然后依据获取到的地址信息定位到存储有各逻辑数据段地址信息的第二数据段,从该数据断下获取到各逻辑数段的地址信息,然后,依据获取到的地址信息即可对逻辑数据段进行快速定位读取所需的数据,以实现对文件内容的读取。 During document reading, to locate a first data segment address information of the second data acquiring section, and then positioning each of the stored logical data segment address information of the second data segments based on the acquired address information from the data off Get the number of logical address information of each section, then the logical data segment can quickly locate the desired data is read based on the obtained address information, to enable reading of the contents of the file. 可见,本发明实施例提供的文件内容读取装置,能够依据逻辑数据段的地址信息直接定位到所需读取的数据段,相较于现有的需要从文件的首个数据段依次读取各数据段直至读取到所需的数据段为止的文件内容读取方案,能够提升文件内容的读取速度,实现对文件内容的快速读取。 Seen, an embodiment of the content of the document reading apparatus of the present invention, the data segment can be positioned directly according to the required address information read logical data segment, compared to the existing needs to be read from the first data file segments sequentially each data segment until the read program to read the file contents data until the desired segment, it is possible to enhance the reading speed of the document content, fast reading of the contents of the file.

[0086] 实施例四 [0086] Fourth Embodiment

[0087]参照图4,示出了本发明实施例四的一种文件内容读取装置的结构框图。 [0087] Referring to Figure 4, there is shown a block diagram of embodiments of the present invention, four contents A document reading device embodiment.

[0088] 本发明实施例的文件内容读取装置是对实施例三中的文件内容读取装置的进一步优化,优化后文件内容读取装置包括:定位模块402,用于定位至所述文件的末尾;其中, 所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾的第一数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息;第一地址信息读取模块404,用于读取所述第一数据段中存储的所述第二数据段的地址信息;第二地址信息读取模块406,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息;文件读取模块408, 用于依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 [0088] Example contents of the file reading means of the present invention is a further optimization of the embodiment of the apparatus 3 reads the contents of the file, the file contents optimized reading device comprising: a positioning module 402, for positioning to the file end; wherein the file comprises: a main section at the beginning of the movie data file, the data segment in the first end of the file and a plurality of logical data segments, said first data segment of said stored second address information of the data segment, the data segment is stored in the second address information each logical data segment; the first address information reading module 404, configured to read said first data stored in the second data segment segment address information; and a second address information reading module 406, according to the address information for reading the second data segment address information of each segment in the logical data stored in the second data segments; file reading module 408 for each of the read data corresponding to the logical address according to the data stored in the segment information of each logical data segments, the contents of the file to be read.

[0089] 优选地,所述第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中,所述第二地址信息读取模块406包括:表读取模块4062,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的地址索引表;信息读取模块4064,用于从读取的所述地址索引表中获取各逻辑数据段的地址信息。 [0089] Preferably, the logical address information of each data segment stored in the second data set in the address segment index table in said second address information reading module 406 includes: a reading module table 4062, according to the data segment address information of the second read address of the index table stored in the second data segments; information reading module 4064, configured to obtain the logical address information of each data segment read from the address in the index table .

[0090] 优选地,所述第一数据段长第一设定值,所述第一地址信息读取模块404读取所述第一数据中存储的所述第二数据段的地址信息时:读取距所述文件末尾第一设定值范围内的数据,从读取的该段数据中获取所述第二数据段的地址信息。 [0090] Preferably, the first data segment length a first set value, said first address information reading module 404 to read the address information of the second data segments stored in the first data when: the end of the data file read from said first set range of values, obtaining address information of the data segment from the second segment in the read data.

[0091] 优选地,所述第一数据段的长度为63字节。 [0091] Preferably, the length of the first data segment is 63 bytes.

[0092] 优选地,所述文件为MKV扩展文件;所述各逻辑数据段包括:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 [0092] Preferably, the file is a file extension MKV; each of said logical segments comprises: supplemental data and additional content segments, segment the document identification data, the navigation user interface data segment, segment navigation control data, and traffic data segment identification data stream segment.

[0093] 本发明实施例的文件内容读取装置用于实现前述实施例一、二中相应的文件内容读取方法,并具有与方法实施例相应的有益效果,在此不再赘述。 [0093] Example contents of the file reading means of the present invention for achieving the content of the document reading method corresponding to Examples 1 and 2 in the embodiment, and has advantageous effects corresponding to the embodiment of the method, not described herein again.

[0094] 对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。 [0094] For the apparatus of the embodiment, since the method of the embodiment which is substantially similar, the description of a relatively simple, some embodiments of the methods see relevant point can be described.

[0095]在此提供的文件内容读取方案不与任何特定计算机、虚拟系统或者其它设备固有相关。 [0095] The contents of the file read program is not provided herein, the virtual system or other device inherently related to any particular computer. 各种通用系统也可以与基于在此的示教一起使用。 Various general-purpose systems may also be used with the teachings herein based. 根据上面的描述,构造具有本发明方案的系统所要求的结构是显而易见的。 According to the above description, according to the present embodiment having the system configuration of the claimed invention will be apparent structure. 此外,本发明也不针对任何特定编程语言。 Further, the present invention is not to any particular programming language. 应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。 It should be appreciated that a variety of programming languages ​​may be utilized to achieve the present invention described herein, the above description and specific language is made to the disclosure of preferred embodiments of the present invention.

[0096]在此处所提供的说明书中,说明了大量具体细节。 [0096] In the description provided herein, numerous specific details are described. 然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。 However, it can be understood that the embodiments of the present invention may be practiced without these specific details. 在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。 In some examples, not shown in detail in well-known methods, structures and techniques, so as not to obscure the understanding of this description.

[0097]类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。 [0097] Similarly, it should be understood that the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects in the description of exemplary embodiments of the present invention, various features of the invention are sometimes grouped into a single together embodiment, FIG, or the description thereof. 然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。 However, the methods disclosed herein should not be interpreted as reflecting an intention: that the claimed invention requires more features than in each of the claims expressly recited. 更确切地说,如权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。 More specifically, as reflected in the book as claimed in claim, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. 因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。 Thus, the claims following the specific embodiments are hereby incorporated into this Detailed Description explicitly, with each claim itself as a separate embodiment of the present invention.

[0098]本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。 [0098] Those skilled in the art can understand may be made to change adaptively embodiment device module and provided them with one or more devices different from this embodiment of the. 可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。 The embodiments may be modules or units into one module or component or components or units, and in addition they can be divided into a plurality of sub-modules or sub-units or sub-assemblies. 除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。 Any method other than such features and / or process, or at least some of the units are mutually exclusive, any combination of the present specification (including the accompanying claims, abstract and drawings) All of the features disclosed in, or disclosed herein and such All process units or equipment combination. 除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。 Unless expressly stated otherwise, each feature of the present specification (including the accompanying claims, abstract and drawings) may be provided by the same disclosed, characterized equivalents or similar purpose may be substituted.

[0099] 此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。 [0099] Moreover, those skilled in the art will appreciate that although in some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant in the present within the scope of the invention and form different embodiments. 例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。 For example, in any combination can be used in the manner of any one of claims embodiment, as claimed.

[0100] 本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。 Example [0100] The various components of the present invention may be implemented in hardware, or as software modules running on one or more processors, or in a combination thereof. 本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的文件内容读取方案中的一些或者全部部件的一些或者全部功能。 Those skilled in the art will appreciate that a microprocessor may be used or a digital signal processor (DSP) to implement in practice, in accordance with some or all of the functions of the file to read the contents of the solutions of the embodiments of the present invention, some or all of the components. 本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。 The present invention may also be implemented as a part or all of the device or apparatus programs for performing the methods described herein (e.g., computer programs and computer program products). 这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。 Such a program implementing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. 这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。 Such signals can be downloaded from the Internet website, or provided on a carrier signal, or in any other form.

[0101] 应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。 [0101] It should be noted that the embodiments of the present invention, the above-described embodiments illustrate rather than limit the invention, and those skilled in the art without departing from the scope of the appended claims may be devised alternative embodiments. 在权利要求中, 不应将位于括号之间的任何参考符号构造成对权利要求的限制。 In the claims, should not be limited by any reference signs located claimed configured to claims between parentheses. 单词“包含”不排除存在未列在权利要求中的元件或步骤。 The word "comprising" does not exclude the presence of elements or steps not listed in the appended claims. 位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。 Preceding an element of the word "a" or "an" does not exclude the presence of a plurality of such elements. 本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。 The present invention by means of hardware comprising several distinct elements, and by means of a suitably programmed computer implemented. 在列举了若干装置的单元权利要求中,这些装置中的若千个可以是通过同一个硬件项来具体体现。 Unit claims enumerating several means, these means may be one thousand if embodied by the same item of hardware. 单词第一、第二、以及第三等的使用不表示任何顺序。 Word of the first, second, and third, etc. does not denote any order. 可将这些单词解释为名称。 These words can be interpreted as names.

Claims (10)

1.一种文件内容读取方法,其特征在于,包括: 定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段,所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息; 读取所述第一数据段中存储的所述第二数据段的地址信息; 依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息; 依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 A method for reading file content, characterized by comprising: positioning to the end of the file; wherein, said file comprising: a main section at the beginning of the movie data file, the file is located at the end of a fixed length a first segment, a second segment and a plurality of logical data segments, said first segment of data is stored address information of the second data segments, said second data segment address is stored in each logical data segments read address according to the address information of the second data segment in the second data storage segments each segment of the logical data; information; and reading the address information of the second data segments stored in a first data segment information; according to the address information of each logical data segments each corresponding to the read data stored in the logical data section, for reading the contents of the file.
2. 根据权利要求1所述的方法,其特征在于,所述第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中,所述依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息的步骤包括: 依据所述第二数据段的地址信息读取所述第二数据段中存储的地址索引表; 从读取的所述地址索引表中获取各逻辑数据段的地址信息。 2. The method according to claim 1, wherein each logical address information is set in the data segment of the second data segments stored in the address index table, according to the address information of the second data segments the step of reading the address information of the data of each logical segment of the second data storage section comprises: a read address index table in the second data segments stored according to the address information of the second data segments; reading from the address table index obtaining address information of each logical data segment.
3. 根据权利要求2所述的方法,其特征在于,所述第一数据段的固定长度为第一设定值,所述读取所述第一数据中存储的所述第二数据段的地址信息的步骤包括: 读取距所述文件末尾第一设定值范围内的数据,从读取的数据中获取所述第二数据段的地址信息。 3. The method according to claim 2, wherein said first fixed length data segment is a first set value, the first reading of the data stored in the second data segments address information comprises the step of: reading the file data from the end of the range of values ​​of the first set, obtains the address information of the second data segment from the read data.
4. 根据权利要求3所述的方法,其特征在于,所述第一数据段的长度为63字节。 4. The method according to claim 3, characterized in that the length of the first data segment is 63 bytes.
5. 根据权利要求1-4任一项所述的方法,其特征在于,所述文件为MKV扩展文件; 所述各逻辑数据段包括:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 The method according to any one of claims 1-4, wherein said file is a file extension MKV; each of said logical segments comprises: supplemental data and additional content segments, segment the document identification data, navigation user interface data segment, the navigation control data segment, the data segment stream and identifying data stream segment.
6. —种文件内容读取装置,其特征在于,包括: 定位模块,用于定位至所述文件的末尾;其中,所述文件包括:位于所述文件开头的主电影数据段、位于所述文件末尾固定长度的第一数据段、第二数据段以及多个逻辑数据段, 所述第一数据段中存储有所述第二数据段的地址信息,所述第二数据段中存储有各逻辑数据段的地址信息; 第一地址信息读取模块,用于读取所述第一数据段中存储的所述第二数据段的地址信息; 第二地址信息读取模块,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的各逻辑数据段的地址信息; 文件读取模块,用于依据所述各逻辑数据段的地址信息对应读取各逻辑数据段中存储的数据,以进行文件内容读取。 6. - kind of document content reading apparatus comprising: positioning means for positioning to the end of the file; wherein, said file comprising: a main film of the beginning of the file data segment, located in the a first end of the file data segment of fixed length data segments, and a second plurality of logical data segments, said first segment of data is stored address information of the second data segments, said second data segment stored in each logical data segment address information; a first address information reading means for reading the address information of the first data segment in the second data storage section; a second address information reading module, according to the the address information of the second address information of said read data segment in the second data storage segments each logical data segment; file reading module configured according to the logical address information of each data segment corresponding to the respective logical data read data stored in the segment, the contents of the file to be read.
7. 根据权利要求6所述的装置,其特征在于,所述第二数据段中存储的各逻辑数据段的地址信息设置在地址索引表中,所述第二地址信息读取模块包括: 表读取模块,用于依据所述第二数据段的地址信息读取所述第二数据段中存储的地址索引表; 信息读取模块,用于从读取的所述地址索引表中获取各逻辑数据段的地址信息。 7. The device according to claim 6, wherein each logical address information is set in the data segment of the second data segments stored in the index table address, the second address information reading module comprises: a table reading module configured according to the data segment address information of the second read data stored in the second address segment index table; information reading module, configured to obtain said address from each of the read index table logical data segment address information.
8. 根据权利要求7所述的装置,其特征在于,所述第一数据段的固定长度为第一设定值,所述第一地址信息读取模块读取所述第一数据中存储的所述第二数据段的地址信息时: 读取距所述文件末尾第一设定值范围内的数据,从读取的数据中获取所述第二数据段的地址信息。 8. The apparatus according to claim 7, wherein said first fixed length data segment is a first set value, said first address information reading module reads the data stored in the first the address information of the second data segment when: reading data from the end of the file within the first set range of values, obtaining address information of the second data segment from the read data.
9. 根据权利要求8所述的装置,其特征在于,所述第一数据段的长度为63字节。 9. The apparatus according to claim 8, characterized in that the length of the first data segment is 63 bytes.
10. 根据权利要求6-9任一项所述的装置,其特征在于,所述文件为MKV扩展文件; 所述各逻辑数据段包括:补充和额外内容数据段、文件标识数据段、导航用户界面数据段、导航控制数据段、信息流数据段以及标识流数据段。 10. Device according to any one of claims 6-9, wherein said file is a file extension MKV; each of said logical segments comprises: supplemental data and additional content segments, segment the document identification data, navigation user interface data segment, the navigation control data segment, the data segment stream and identifying data stream segment.
CN201510717761.3A 2015-10-29 2015-10-29 File content reading method and apparatus CN105405457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510717761.3A CN105405457B (en) 2015-10-29 2015-10-29 File content reading method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510717761.3A CN105405457B (en) 2015-10-29 2015-10-29 File content reading method and apparatus

Publications (2)

Publication Number Publication Date
CN105405457A CN105405457A (en) 2016-03-16
CN105405457B true CN105405457B (en) 2018-03-16

Family

ID=55470898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510717761.3A CN105405457B (en) 2015-10-29 2015-10-29 File content reading method and apparatus

Country Status (1)

Country Link
CN (1) CN105405457B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1542624A (en) * 2003-04-29 2004-11-03 大唐移动通信设备有限公司 Method for quickening logic block mapping speed in Flash file system
CN1554094A (en) * 2001-09-10 2004-12-08 汤姆森特许公司 Extension of M3U file format to support user interface and navigation tasks in a digital audio player
WO2008048067A1 (en) * 2006-10-19 2008-04-24 Lg Electronics Inc. Encoding method and apparatus and decoding method and apparatus
CN101325681A (en) * 2008-07-25 2008-12-17 北京声迅电子有限公司 Method for storing AVS encoding file format for video recorder and video server
CN101477575A (en) * 2009-01-22 2009-07-08 中兴通讯股份有限公司 Multimedia information storing and playing method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1554094A (en) * 2001-09-10 2004-12-08 汤姆森特许公司 Extension of M3U file format to support user interface and navigation tasks in a digital audio player
CN1542624A (en) * 2003-04-29 2004-11-03 大唐移动通信设备有限公司 Method for quickening logic block mapping speed in Flash file system
WO2008048067A1 (en) * 2006-10-19 2008-04-24 Lg Electronics Inc. Encoding method and apparatus and decoding method and apparatus
CN101325681A (en) * 2008-07-25 2008-12-17 北京声迅电子有限公司 Method for storing AVS encoding file format for video recorder and video server
CN101477575A (en) * 2009-01-22 2009-07-08 中兴通讯股份有限公司 Multimedia information storing and playing method and apparatus

Also Published As

Publication number Publication date
CN105405457A (en) 2016-03-16

Similar Documents

Publication Publication Date Title
US7982802B2 (en) Text subtitle decoder and method for decoding text subtitle streams
EP2223230B1 (en) Chunk header incorporating binary flags and correlated variable-length fields
CN1839628B (en) Reproduction apparatus, and reproduction method
CN100556118C (en) Recording method, reproduction device,and reproduction method
US8150237B2 (en) Reproducing apparatus, reproducing method, reproducing program, and recording medium
CN101853683B (en) Flow supply means
CN1969335B (en) Reproduction device and reproduction method
US20100325547A1 (en) Systems and Methods for Sharing Multimedia Editing Projects
US20090307258A1 (en) Multimedia distribution and playback systems and methods using enhanced metadata structures
US20050058435A1 (en) Information storage medium for storing information for downloading text subtitles, and method and apparatus for reproducing the subtitles
JP4907653B2 (en) Aspects of the rendering of the media content
US20050196143A1 (en) Reproducing apparatus, reproducing method, reproducing program, and recording medium
JP3195284B2 (en) The image display apparatus the video reproduction control method and a method thereof is applied
US8630531B2 (en) Apparatus and method for reproducing storage medium that stores metadata for providing enhanced search function
JP4965716B2 (en) Recording medium which text-based subtitle data including style information is recorded, reproducing apparatus and reproducing method
CN101238518B (en) Recording method, reproducing apparatus and method
CN102523457B (en) Reproduction device and reproduction method
CN1288540C (en) System and method for reproducing information stored on a data recording medium in an interactive networked environment
CN1867991B (en) Recording and reproducing methods and apparatuses having data structure for managing reproduction of text subtitle data
CN1855277B (en) Method and apparatus for reproducing data from recording medium using local storage
JP4611995B2 (en) Data reproducing method and reproducing apparatus using the generation method and reproduction management file of the reproduction management file for the recording medium
US20050262149A1 (en) Method of and apparatus for reproducing downloaded data along with data recorded on storage medium
US20050223039A1 (en) Method and apparatus for playing multimedia play list and storage medium therefor
CN101371307A (en) Information reproducing system using information storage medium
JP5128291B2 (en) Recorded recording medium metadata for providing an enhanced search function, the reproducing method and apparatus

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01