一种通过文件系统访问轮播数据的方法 技术领域 Method for accessing carousel data through file system
本发明涉及一种通过文件随机访问轮播数据的方法, 特别是指一种在数字电视接收设 备中基于数据轮播格式和协议技术对数据进行随机访问和有效提取的技术。 属于数字电视 接收技术领域。 背景技术 数字电视接收设备泛指能够接收、 解码和显示数字电视信号的硬件设备, 它应用于数 字电视领域, 是模拟电视数字化得以实现的终端(见图 1 )。数字电视接收设备所接收的是 数字化的图像和数据信息, 因此, 不同于传统的模拟电视信号的接收与处理, 数字电视接 收设备对数字化的图像信息和数据的接收及处理是通过其内部的 CPU及与其相连接的外 围器件进行的。 接收系统就是在相应的硬件及操作系统的基础上开发出数字电视接收设备 适用的应用程序; 同样, 一些专业的数字广播内容服务商也需要根据不同的数字电视接收 设备的硬件性能和功能开发出相应的服务软件。 The invention relates to a method for randomly accessing carousel data through a file, and particularly to a technology for performing random access and effective extraction of data in a digital television receiving device based on a data carousel format and a protocol technology. It belongs to the field of digital television receiving technology. BACKGROUND OF THE INVENTION Digital television receiving equipment generally refers to hardware equipment capable of receiving, decoding, and displaying digital television signals. It is applied in the field of digital television and is a terminal for the realization of digitization of analog television (see Figure 1). Digital television receiving equipment receives digital image and data information. Therefore, unlike traditional analog television signal receiving and processing, digital television receiving equipment receives and processes digital image information and data through its internal CPU. And peripheral devices connected to it. The receiving system is based on the corresponding hardware and operating system to develop applications suitable for digital television receiving equipment; Similarly, some professional digital broadcast content service providers also need to develop according to the hardware performance and functions of different digital television receiving equipment Corresponding service software.
在电视台或电视运营商的广播设备中, 音视频信号与数据内容经过前端的复用器混 合, 形成传输流(TS流)。 传输流经过调制形成电磁信号传送到数字电视接收设备中。 数 字电视接收设备 (机顶盒)工作的原理如下- In the broadcast equipment of a TV station or TV operator, audio and video signals and data content are mixed through a front-end multiplexer to form a transport stream (TS stream). The transmission stream is modulated to form an electromagnetic signal and transmitted to a digital television receiving device. The working principle of digital TV receiving equipment (set-top box) is as follows-
♦ 调谐 /选择模块接受到电磁信号并选择一定范围的带宽。 ♦ The tuning / selection module receives electromagnetic signals and selects a certain range of bandwidth.
♦ 解调模块把信号转换为数据流(Bitstreams:)。 ♦ The demodulation module converts signals into data streams (Bitstreams :).
♦ 解复用模块从数据流(Bitstreams)中抽出期望信息并将其以合适的方式提供给不 同的解码器, 它包括与条件接收模块合作的解扰器。 ♦ The demultiplexing module extracts the desired information from the data streams (Bitstreams) and provides it to different decoders in a suitable way. It includes a descrambler that works with the conditional access module.
♦ 视频解码模块转换显示的图像序列中的视频位流。 ♦ The video decoding module converts the video bit stream in the displayed image sequence.
♦ 音频解码模块转换模拟音频信号中的音频位流。 ♦ The audio decoding module converts the audio bit stream in the analog audio signal.
♦ 图形引擎建立图形层在发送之前将其和对 PAL/NTSC的模拟信号请求中的视频混 合。
♦ 前面控制板部分负责解释通过接收遥控器、 无线键盘或前面板发出的用户命令。 视频位流与音频位流经过图像处理器与图像相混合, 变成模拟的音视频信号, 输出到 显示屏(电视机)上。数据流则通过解复用器流入到 CPU中, 由在中央处理器(CPU)上 运行的系统程序进行处理。处理的结果可以与音视频流一起进行混合,输出到显示器件上。 ♦ The graphics engine creates the graphics layer and mixes it with the video in the PAL / NTSC analog signal request before sending it. ♦ The front control panel is responsible for interpreting user commands issued by the remote control, wireless keyboard or front panel. The video bit stream and audio bit stream are mixed with the image through the image processor, and become analog audio and video signals, which are output to the display screen (TV). The data stream flows into the CPU through the demultiplexer and is processed by the system program running on the central processing unit (CPU). The processed results can be mixed with the audio and video streams and output to the display device.
数字电视在原有音视频业务的基础上增加了大量的数据业务, 数据通过轮播方式循环 与数字电视信号一起通过 TS流的方式广播到数字电视接收设备。数据轮播 (Data Carousel) 技术是根据 ISO/IEC13818-6标准 DSM-CC技术而规定的。 数据轮播方式主要有数据转盘 和对象转盘两种。数字电视广播用的数据转盘是建立在 DSM-CC数据转盘基础之上的,转 盘中的数据以模块的形式发送, 每个模块又被分割成多个大小相同的数据块。 数字电视广 播用的对象转盘是建立在 DSM-CC对象转盘基础之上的, 每个转盘代表一个特殊的服务 域, 该域由 DSM-CC U-U对象集合构成, 这些对象包括文件、 目录、 事件、 以及流事件。 根据 ISO/IEC13818-6标准,数据轮播协议使用消息来封装数据与控制信息,要广播的数据 的 目 录结构信息 由数据表格 DSI ( DownloadServerlnitiate ) 消息和 DII ( Downloadlnfolndirection) 消息传送, 将实际的数据文件放入数据转盘协议所定义的 DownloadDataBlock (DDB) 消息中进行传送。 在一个数据轮播中, 除每个模块的最后一 个数据块外, 模块的所有数据块都具有同样的长度。 模块是逻辑上独立的数据的集合, 多 个模块可以组成一个组(Group), 多个组(Group)则组成一个超级组( SuperGroup )。 DSI 消息描述了在超级组中的组的信息; DII消息描述了组中的模块的信息。 接收设备根据控 制消息可以决定接收哪些模块。 轮播数据的播发格式见图 1。 Digital TV adds a large number of data services on the basis of the original audio and video services. Data is circulated in a carousel manner and broadcasted to the digital TV receiving device in a TS stream with digital TV signals. The data carousel (Data Carousel) technology is based on the ISO / IEC13818-6 standard DSM-CC technology. There are two types of data carousel: data carousel and object carousel. The data turntable for digital TV broadcasting is based on the DSM-CC data turntable. The data in the turntable is sent in the form of modules, and each module is divided into multiple data blocks of the same size. The object turntable for digital television broadcasting is based on the DSM-CC object turntable. Each turntable represents a special service domain. This domain consists of a collection of DSM-CC UU objects. These objects include files, directories, events, As well as stream events. According to the ISO / IEC13818-6 standard, the data carousel protocol uses messages to encapsulate data and control information. The directory structure information of the data to be broadcast is transmitted by the data table DSI (DownloadServerlnitiate) message and DII (Downloadlnfolndirection) message, and the actual data file is transmitted. Put into a DownloadDataBlock (DDB) message as defined by the data carousel protocol for transmission. In a data carousel, all data blocks of a module have the same length except the last data block of each module. A module is a collection of logically independent data. Multiple modules can form a group, and multiple groups can form a supergroup. The DSI message describes the information of the group in the super group; the DII message describes the information of the modules in the group. The receiving device can decide which modules to receive based on the control message. The transmission format of carousel data is shown in Figure 1.
在现代的计算技术中,数据的组织结构一般通过文件系统来实现。虚拟文件系统 (VFS) 是一种常用的文件系统组织结构技术。 而在数字电视领域, 由于通过 DSM— CC方式广播 的数据是通过表结构的形式广播的,如何将轮播数据与 VFS文件系统结合与关联起来目前 并没有特定的技术。 In modern computing technology, the organization of data is generally implemented through a file system. Virtual File System (VFS) is a common file system organization technology. In the field of digital television, since the data broadcast by DSM-CC is broadcast in the form of a table structure, there is currently no specific technology on how to combine and associate the carousel data with the VFS file system.
不管是数据转盘方法还是对象转盘方法都能够通过轮播的方式传送数据。 然而, 要获
取这些数据, 需要将它们即时装载, 存放于缓存中。 但是对于需要使用这些数据的应用而 言, 上述方法非常的不方便, 耗时繁琐。 Both the data carousel method and the object carousel method can transfer data through a carousel. However, to get To fetch these data, they need to be loaded instantly and stored in the cache. However, for applications that need to use this data, the above method is very inconvenient and time consuming.
本发明的方法就是针对传统技术的不足而提出的解决办法。 发明内容 The method of the present invention is a solution proposed for the deficiency of traditional technology. Summary of the invention
本发明要解决的技术问题是一种文件系统访问轮播数据的方法。 该方法的好处是通过 在数字电视接收设备设置一个数据缓冲区, 从数字电视数据信号中获取的通过轮播协议传 输的数据存储于数据缓冲区, 数据缓冲区与文件系统相联, 应用时直接以普通文件的方式 访问数据, 从而消除轮播数据获取的繁琐。 The technical problem to be solved by the present invention is a method for a file system to access carousel data. The advantage of this method is that by setting a data buffer in the digital TV receiving device, the data transmitted from the digital TV data signal and transmitted through the carousel protocol is stored in the data buffer. The data buffer is associated with the file system and is directly applied during application. Access the data as a normal file, thereby eliminating the tedious acquisition of carousel data.
本发明通过以下的技术方案使以上问题得到解决。 本发明的方法在于设定一种缓存, 通过传统的文件系统(如通过虚拟文件系统 VPS)与此缓存相关联, 当需要获取轮播数据 时, 只需打开和读取相应的文件, 从而方便使用, 提高数字电视接收设备的反应速度和数 据利用效率。 The present invention solves the above problems through the following technical solutions. The method of the present invention is to set a cache, which is associated with the cache through a traditional file system (such as a virtual file system VPS). When the carousel data needs to be obtained, only the corresponding file needs to be opened and read, which is convenient Use, improve the response speed and data utilization efficiency of digital television receiving equipment.
下面详细说明本发明的技术方案。 The technical solution of the present invention is described in detail below.
本方法的步骤: Steps of the method:
本发明提供一种基于 DSM— CC转盘的传输方法, 通过目录文件系统的方式来获取数 据。不管是 DSM— CC数据转盘协议(Data Carousel)还是对象转盘协议(对象轮播 Object Carousel), 本方法对于它们都是适用的。 这两种协议的不同只是体现在数据装载方式的不 同而已。 下面以数据转盘 (或称数据轮播) 为例来说明如何建立缓存和将文件系统与轮播 数据关联起来, 从而达到通过文件系统来有效获取数据的目的。 The present invention provides a transmission method based on a DSM-CC turntable, which acquires data through a directory file system. This method is applicable to both DSM-CC Data Carousel and Object Carousel. The difference between the two protocols is only reflected in the different data loading methods. The following uses the data carousel (or data carousel) as an example to explain how to establish a cache and associate the file system with the carousel data, so as to achieve the purpose of effectively obtaining data through the file system.
要进行 DSM— CC轮播数据的装载, 并将它们与文件系统进行关联, 一般有下列几个 子模块: To load DSM-CC carousel data and associate them with the file system, there are generally the following sub-modules:
1. Service Gateway: 负责提供对外公用接口, 并且协调该系统各个模块的任务执行; 1. Service Gateway: responsible for providing external public interfaces and coordinating the task execution of each module of the system;
2. Cache: 负责存储有关的文件数据, 并提供搜寻和删除功能;
3. DSM FS: DSM文件系统, 提供与上层文件系统进行关联的操作接口。 2. Cache: Responsible for storing related file data, and providing search and delete functions; 3. DSM FS: DSM file system, which provides an operation interface associated with the upper file system.
Cache (缓存) 的作用: cache用来存取已经装载的数据, 使得无需经常地装载数据。 当缓存一个 Carousel时, 将首先接收所有的 DSI和 DII消息, 将整个文件系统结构缓存下 来, 但应用调用某个文件时, 临时从信道中获取, 并缓存下来。 当使用完一个文件并被关 闭后, 可以将其所占用内存业被释放。 Cache的结构以 DDB作为缓存的基本单元, 一个 Carousel对应 Group链表, 每个 Group节点指向一个 Module链表, 每个 Module节点指向 —个 DDB链表。 Cache的结构见图 3。 The role of cache (cache): cache is used to access already loaded data, so that there is no need to load data frequently. When a Carousel is cached, all DSI and DII messages will be received first, and the entire file system structure will be cached, but when an application calls a certain file, it will temporarily obtain it from the channel and cache it. After a file is used and closed, the memory occupied by it can be released. The structure of the cache uses DDB as the basic unit of the cache. A Carousel corresponds to a Group linked list. Each Group node points to a Module linked list, and each Module node points to a DDB linked list. The structure of the cache is shown in Figure 3.
与文件系统的关联(DSM FS): DSM—CC数据 cache本身并没有一个约定俗成的文 件系统, 为了数据获取的方便, 应该将 Cache数据与一个文件系统关联, 使得可以通过文 件系统来访问数据。上层的文件系统的组织结构与 Cache的组织并不需要相同。 DSM-CC 与文件系统 (如 VFS) —般需要定义文件系统关联必须的数据结构和函数。 Association with file system (DSM FS): The DSM-CC data cache itself does not have a conventional file system. For the convenience of data acquisition, the cache data should be associated with a file system so that the data can be accessed through the file system. The organizational structure of the upper file system does not need to be the same as that of the cache. DSM-CC and file systems (such as VFS) need to define the data structures and functions necessary for file system association.
下面通过附图对本发明的方法来做进一步的说明。 附图说明 The method of the present invention will be further described below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
图 1是数字电视设备工作的框图。 数字电视信号进入接收设备, 经过解调和解复用模 块的处理, 将音视频信号和数据信号分开, 数据信号中所携带的事件信息数据经过处理和 存储, 用于显示在电视机屏幕上。 Figure 1 is a block diagram of the operation of digital television equipment. The digital TV signal enters the receiving device and is processed by the demodulation and demultiplexing module to separate the audio and video signals from the data signal. The event information data carried in the data signal is processed and stored for display on the TV screen.
图 2显示了轮播数据的组织结构。在数据轮播中,传输的数据被存储到模块(Module) 中; 而每个模块被分成若干数据块(Block)。 在一个数据轮播中, 除每个模块的最后一个 数据块外, 模块的所有数据块都具有同样的长度。 模块是逻辑上独立的数据的集合, 多个 模块可以组成一个组(Group), 多个组 (Group)则组成一个超级组(SuperGroup)。 数据 轮播协议使用消息来封装数据与控制信息。数据由 DDB消息携带;控制则由 DII,DSI等消 息携带。 DSI消息描述了在超级组中的组的信息; DII消息描述了组中的模块的信息。 接 收设备根据控制消息可以决定接收哪些模块。
图 3显示了文件系统的结构。在本发明中, Flash模块作为文件系统的一个驱动, 它是 可读可写的存储模块; DSMCC作为文件系统的另一个驱动, 它是可读而不可写的, 因为 它是一个循环轮播的系统, 写是没有意义的。 Figure 2 shows the organization of carousel data. In a data carousel, the transmitted data is stored in modules; each module is divided into several data blocks. In a data carousel, all data blocks of a module have the same length except the last data block of each module. A module is a collection of logically independent data. Multiple modules can form a group, and multiple groups can form a supergroup. The data carousel protocol uses messages to encapsulate data and control information. Data is carried by DDB messages; control is carried by DII, DSI and other messages. The DSI message describes the information of the group in the super group; the DII message describes the information of the modules in the group. The receiving device can decide which modules to receive according to the control message. Figure 3 shows the structure of the file system. In the present invention, the Flash module is used as a driver of the file system, which is a readable and writable storage module; DSMCC is used as another driver of the file system, which is readable but not writable because it is a circular carousel System, writing is meaningless.
图 4显示了 DSM—CC数据的模块结构以及与文件系统的关联。 Org.dvb.dsmcc模块通 过 SG接口指示需要将某个轮播(Carousel)装载入 Cache。然后 VFS便可以通过文件系统 的常用函数进行数据的访问。 Figure 4 shows the module structure of DSM-CC data and its association with the file system. The Org.dvb.dsmcc module indicates through the SG interface that a carousel needs to be loaded into the cache. VFS can then access data through common functions of the file system.
图 5 显示了 Cache 的组织结构: Cache 采用层次存储结构,按 DSI(Carousel Node)->DII(Group Node)-> Module分类。 Figure 5 shows the organizational structure of the Cache: Cache uses a hierarchical storage structure and is classified by DSI (Carousel Node)-> DII (Group Node)-> Module.
以下结合具体的实施实例对本发明作进一步的详细说明。 具体实施方式 具体的实施方式如下: The present invention will be further described in detail below with reference to specific implementation examples. DETAILED DESCRIPTION Specific implementations are as follows:
1. 获得轮播数据的信息 Get information about carousel data
装载 PMT表, 分析 stream— identifier— descriptor描述子, 装载 EIT或 SDT表, 分析 data— broadcast—descriptor描述子, 获取数据播发的 PID信息和轮播的类型和轮播的级别等 信息。 Load the PMT table, analyze the stream_identifier_descriptor descriptor, load the EIT or SDT table, analyze the data_broadcast_descriptor descriptor, and obtain the PID information of the data broadcast, the type of the carousel, and the level of the carousel.
调用 MBT— SilGetCarousellnfo ()获取需要的 data— broadcast— descriptor描述子。 Call MBT— SilGetCarousellnfo () to get the required data — broadcast — descriptor descriptor.
2. 关联轮播 Associated carousel
在 DSM-CC模块启动时, 根据获得的 data— broadcast—descriptor描述子, 调用 When the DSM-CC module is started, according to the obtained data_broadcast_descriptor descriptor, call
MBT—DlAttachGateway()将对应的数据轮播挂载到 VFS的文件系统上。 MBT—DlAttachGateway () mounts the corresponding data carousel on the VFS file system.
々 调用 MBT__DlDetachGateway()可以取消关联, 并卸载 DSM-CC文件系统。 々 Call MBT__DlDetachGateway () to cancel the association and unmount the DSM-CC file system.
在关联轮播数据时, 需要装载 DSI和 DII表以获取具体的数据组织结构。 与虚拟文件 系统 VFS关联时, 需要进行以下的操作:
a) 定义 DSM— CC文件系统的类型: 其名称为: "dsmfs"; b) 定义文件系统 spuer— block和 inode的结构; c) 定义文件系统 super— operation操作的三个方法: void (*read— inode) (struct inode *), void(*put_super)(struct super— block *), int (*statfs) (struct super— block *, struct statfs *. int) When correlating carousel data, DSI and DII tables need to be loaded to obtain specific data organization structure. When associated with a virtual file system VFS, the following operations need to be performed: a) Define the type of DSM-CC file system: Its name is: "dsmfs"; b) Define the structure of file system spuer- block and inode; c) Define three methods of file system super- operation operation: void (* read — Inode) (struct inode *), void (* put_super) (struct super— block *), int (* statfs) (struct super— block *, struct statfs *. Int)
d) 定义文件系统 file inode 操作需要的四个方法: dsmfs_file— operations , dsmfs—file—inode— create,, dsmfs— inode— lookup, dsmfs— inode— unlink e) 定义文件系统 dir inode 操作需要的三个方法: dsmfs—dir— operations, dsmfs_inode_looku , dsmfs—inode— unlink f) 定义文件系统 file— operation读写的三个方法: dsmfs— file— read, dsmfs— file— write, dsmfs— file— readdir\ d) Define the four methods required for file inode operations on the file system: dsmfs_file— operations, dsmfs—file—inode—create ,, dsmfs— inode— lookup, dsmfs— inode— unlink e) Define the three required dir inode operations for the file system Methods: dsmfs—dir— operations, dsmfs_inode_looku, dsmfs_inode_ unlink f) Three methods to define the file system file—operation read and write: dsmfs— file— read, dsmfs— file— write, dsmfs— file— readdir \
g) 定义文件系统 dir operation目录操作的读取方法: dsmfs— dir— readdir h) 定 义 DSM — CC 文件系 统注册 到 VFS 文件系 统 的方法 : register_filesystem(&dsmfs_fs_type) g) Define the read method of the file system dir operation: dsmfs— dir— readdir h) Define the DSM — CC file system Register with the VFS file system: register_filesystem (& dsmfs_fs_type)
i) 定义 DSM— CC文件系统的注销的方法: unregister— filesystem(&romfs— fs— type) 按照上述步骤,通过实现所述的结构和方法,将 DSM— CC与 VFS文件系统就关联了 起来。 i) Define the method of unregistering the DSM_CC file system: unregister_ filesystem (& romfs_fs_type) According to the above steps, by implementing the described structure and method, the DSM_CC and VFS file system are associated.
3. 文件操作 3. File operations
调用 VFS文件系统操作的函数访问文件, 此时装载 DDB消息以提供具体的数据。 最后所应说明的是: 本发明提供的是一种通过文件系统访问轮播数据的方法及其设计 思想, 以上实施例仅用以说明而非限制本发明的技术方案, 尽管参照上述实施例对本发明 进行了详细说明, 本领域的普通技术人员应当理解: 依然可以对本发明进行修改或者等同 替换, 而不脱离本发明的精神和范围的任何修改或局部替换, 其均应涵盖在本发明的权利 要求范围当中。
The function of the VFS file system operation is called to access the file, and DDB messages are loaded at this time to provide specific data. What should be explained at last: The present invention provides a method for accessing carousel data through a file system and its design concept. The above embodiments are only used to illustrate rather than limit the technical solutions of the present invention. The invention has been described in detail, and those of ordinary skill in the art should understand that the invention can still be modified or equivalently replaced without any modification or partial replacement that departs from the spirit and scope of the invention, which should be covered by the rights of the invention Among the requirements.