[go: up one dir, main page]

CN100538622C - A kind of method that improves incident transmission and processing in the apparatus of digital television receiving - Google Patents

A kind of method that improves incident transmission and processing in the apparatus of digital television receiving Download PDF

Info

Publication number
CN100538622C
CN100538622C CNB2004100181696A CN200410018169A CN100538622C CN 100538622 C CN100538622 C CN 100538622C CN B2004100181696 A CNB2004100181696 A CN B2004100181696A CN 200410018169 A CN200410018169 A CN 200410018169A CN 100538622 C CN100538622 C CN 100538622C
Authority
CN
China
Prior art keywords
event
thread
list
record
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
CNB2004100181696A
Other languages
Chinese (zh)
Other versions
CN1571483A (en
Inventor
孙军
廖洪涛
陈珊
王青
孙海生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
STMicroelectronics SA
Original Assignee
STMicroelectronics SA
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 STMicroelectronics SA filed Critical STMicroelectronics SA
Priority to CNB2004100181696A priority Critical patent/CN100538622C/en
Publication of CN1571483A publication Critical patent/CN1571483A/en
Priority to PCT/CN2005/000624 priority patent/WO2005109185A1/en
Application granted granted Critical
Publication of CN100538622C publication Critical patent/CN100538622C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Fundamental purpose of the present invention is to provide a kind of method that improves event information transmission and treatment effeciency in apparatus of digital television receiving.Label by the type to incident, regulation is carried the method for data, process that standard event registration and rope rise and agreement, pending times such as minimizing incident, thereby the communication speed between the raising disparate modules, the efficient of raising deal with data.The technological means that method of the present invention adopted is in incident of apparatus of digital television receiving design and message communicating mechanism, the mode of the type of regulation incident, the data layout that carries, Register Cancel and the strategy of processing, thus the incident that makes can effectively be carried out the transmission and the processing of information in different application and thread.The enforcement of the inventive method comprises the following steps: the registration and the cancellation of 1. event call-back functions; 2. the transmission of incident, reception and processing; 3. catching with cancellation of incident caught.

Description

一种提高数字电视接收设备中事件传递与处理的方法 A method for improving event transmission and processing in digital television receiving equipment

技术领域 technical field

本发明涉及一种事件信息传递的方法,属于数字电视接收设备技术领域。The invention relates to a method for transmitting event information and belongs to the technical field of digital television receiving equipment.

背景技术 Background technique

数字电视接收设备泛指能够接收、解码和显示数字电视信号的硬件设备,它应用于数字电视领域,是模拟电视数字化得以实现的终端(见图1)。数字电视接收设备所接收的是数字化的图像和数据信息,因此,不同于传统的模拟电视信号的接收与处理,数字电视接收设备对数字化的图像信息和数据的接收及处理是通过其内部的CPU及与其相连接的外围器件进行的。接收系统就是在相应的硬件及操作系统的基础上开发出数字电视接收设备适用的应用程序;同样,一些专业的数字广播内容服务商也需要根据不同的数字电视接收设备的硬件性能和功能开发出相应的服务软件。Digital TV receiving equipment generally refers to hardware equipment that can receive, decode and display digital TV signals. It is used in the field of digital TV and is the terminal for realizing the digitization of analog TV (see Figure 1). Digital TV receiving equipment receives digital image and data information. Therefore, unlike the reception and processing of traditional analog TV signals, digital TV receiving equipment receives and processes digital image information and data through its internal CPU and peripheral devices connected to it. The receiving system is to develop the application program applicable to digital TV receiving equipment on the basis of corresponding hardware and operating system; similarly, some professional digital broadcast content service providers also need to develop corresponding service software.

在电视台或电视运营商的广播设备中,音视频信号与数据内容经过前端的复用器混合,形成传输流(TS流)。传输流经过调制形成电磁信号传送到数字电视接收设备中。数字电视接收设备(机顶盒)工作的原理如下:In the broadcasting equipment of a TV station or a 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 sent to the digital TV receiving device. The working principle of digital TV receiving equipment (set-top box) is as follows:

◆调谐/选择模块接受到电磁信号并选择一定范围的带宽。◆The tuning/selection module receives the electromagnetic signal 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 stream (Bitstreams) and provides it to different decoders in an appropriate way, which includes a descrambler that cooperates 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的模拟信号请求中的视频混合。◆The graphics engine builds the graphics layer and mixes it with the video in the analog signal request to PAL/NTSC before sending.

◆前面控制板部分负责解释通过接收遥控器、无线键盘或前面板发出的用户命令。◆The front control panel part is responsible for interpreting user commands sent by receiving remote control, wireless keyboard or front panel.

视频位流与音频位流经过图像处理器与图像相混合,变成模拟的音视频信号,输出到显示屏(电视机)上。数据流则通过解复用器流入到CPU中,由在中央处理器(CPU)上运行的系统程序进行处理。处理的结果可以与音视频流一起进行混合,输出到显示器件上。The video bit stream and the audio bit stream are mixed with the image through the image processor to become an analog audio and video signal, which is output to the display screen (television). 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.

在数字电视接收设备中,各种功能的资源模块需要进行信息交流,而这种信息交流可以采用不同的形式。应用或线程对资源模块的每次调用可以是同步或异步的。同步调用为阻塞(Blocking)方式。被调函数返回时,该函数所发出的请求已经被执行完毕。异步调用为非阻塞(No Blocking)方式,在被调函数返回时,该函数所发出的请求可能并没有被执行,调用者并不能够立即得到执行结果。当资源模块执行了相应请求后,它会发送一事件(Event)给调用者以返回请求的执行结果和有关数据。In a digital TV receiving device, resource modules with various functions need to exchange information, and this information exchange can take different forms. Each call to a resource module by an application or thread can be synchronous or asynchronous. Synchronous calls are blocked (Blocking). When the called function returns, the request issued by the function has been executed. Asynchronous calls are non-blocking (No Blocking). When the called function returns, the request sent by the function may not be executed, and the caller cannot get the execution result immediately. When the resource module executes the corresponding request, it will send an event (Event) to the caller to return the execution result of the request and related data.

在现有的技术中,一般采用事件(event)或消息(message)的方式来进行信息交流,每个事件或消息有一个类型标识(type),依次来区分事件的性质,以达到标识事件的作用。在数字电视领域,由于数字电视的接收解码设备一般功能都很弱,CPU处理速度慢,如果采用传统的方式,就会影响数字电视的视觉效果,影响接收设备的性能。In the existing technology, the way of event (event) or message (message) is generally used for information exchange. Each event or message has a type identifier (type), which in turn distinguishes the nature of the event to achieve the purpose of identifying the event. effect. In the field of digital TV, since the receiving and decoding equipment of digital TV is generally weak in function and the CPU processing speed is slow, if the traditional method is used, it will affect the visual effect of digital TV and affect the performance of the receiving equipment.

这种传统方法的问题在于:The problem with this traditional approach is that:

1.事件只能一个一个地播发和接收;1. Events can only be broadcast and received one by one;

2.对事件附带的信息没有明确界定;2. The incidental information is not clearly defined;

3.对事件接收处理的过程没有规定具体的方法。3. There is no specific method specified for the event receiving and processing process.

本发明的方法就是针对传统技术的不足而提出的解决办法。Method of the present invention is exactly the solution that proposes for the deficiency of traditional technology.

下面给出本方法所需要的几个名词定义:The definitions of several terms required by this method are given below:

线程:是指具有一定运行环境的程序。线程之间可以通过发送事件来进行信息交流。Thread: refers to a program with a certain operating environment. Threads can exchange information by sending events.

应用:是指满足一定功能要求的和目的的程序。一个应用中可以采用多个线程。Application: Refers to a program that meets certain functional requirements and purposes. Multiple threads can be used in an application.

资源:是指数字电视接收设备中用于实现一定功能的软件或硬件,如提供音视频解码、数据装载器等。Resources: Refers to the software or hardware used to realize certain functions in digital TV receiving equipment, such as providing audio and video decoding, data loaders, etc.

资源模块:是指提供资源的软硬件模块。Resource module: refers to the software and hardware modules that provide resources.

发明内容 Contents of the invention

本发明要解决的技术问题是提供一种在数字电视接收设备中提高事件信息传递与处理效率的方法。通过对事件的类型加以标识,规定携带数据的方法,规范事件注册与索起的过程与协议,减少事件等待处理的时间,从而提高不同模块之间的通信速度,提高处理数据的效率。The technical problem to be solved by the present invention is to provide a method for improving event information transmission and processing efficiency in a digital TV receiving device. By identifying the type of event, specifying the method of carrying data, standardizing the process and protocol of event registration and retrieval, reducing the time for event waiting to be processed, thereby improving the communication speed between different modules and improving the efficiency of data processing.

本发明通过以下的技术方案使以上问题得到解决。在数字电视接收设备中设计一个事件管理器,规定事件的类型(type、code)、携带的数据格式(data)、注册注销的方式以及处理的策略、事件(event)排队的方式,从而使得事件能够有效的在不同的应用与线程进行信息的传递与处理。本方法所述的事件具有下列特征:The present invention solves the above problems through the following technical solutions. Design an event manager in the digital TV receiving device to specify the type of event (type, code), the data format (data) carried, the way of registration and cancellation, the processing strategy, and the way of queuing the event (event), so that the event It can effectively transmit and process information in different applications and threads. The events described by this method have the following characteristics:

每个事件(event)由一个类型和代码(type,code)唯一确定,调用的结果通过事件中的数据指针(data)返回给事件处理者:Each event (event) is uniquely determined by a type and code (type, code), and the result of the call is returned to the event handler through the data pointer (data) in the event:

事件的内容由以下几部分组成:The content of the event consists of the following parts:

●类型:type●Type: type

●代码:code●Code: code

●数据指针:data●Data pointer: data

data数据指针根据事件类型的不同,可以指向不同的数据结构。若没有特 别指明,则发送事件时,随事件传递的data数据指针应指向一块动态分配的数 据空间(而非传递静态空间的地址),以便应用接收到该事件时,能够通过该数 据指针获得正确的数据信息,同时,在使用完该数据后,data数据指针可由事 件的发送者释放,也可由事件的处理者释放。基干事件原理的通信机制也可以在其它情况下使用,如一个线程向其它线程发送信息。 The data data pointer can point to different data structures according to different event types. If not specified, when sending an event, the data pointer passed along with the event should point to a dynamically allocated data space (instead of passing the address of the static space), so that when the application receives the event, it can pass the data The pointer obtains correct data information, and at the same time, after using the data, the data data pointer can be released by the sender of the event , and can also be released by the handler of the event. The communication mechanism of the basic event principle can also be used in other situations, such as a thread sending information to other threads.

下面详细说明本发明的技术方案。The technical solution of the present invention will be described in detail below.

本方法的步骤:Steps in this method:

本发明的方法是在数字电视接收设备中实现一个事件管理器,用来传递与处理事件,它包括以下几个步骤。The method of the present invention is to implement an event manager in the digital TV receiving device, which is used to transmit and process events, and it includes the following steps.

一.事件的传递与处理:1. Event delivery and processing:

事件的注册与注销:Registration and deregistration of events:

在使用事件通信机制时,目标线程必须首先向事件管理器(Eventmanager)注册,给出需要监听的事件类型和其回调函数(callback)地址。当事件到来之时,事件管理器调用回调函数并传递给它一数据指针,并且将其存储的客户数据(client data)返回给回调函数。一个应用或线程可以同时注册监听多个事件。事件机制的操作流程见图2。When using the event communication mechanism, the target thread must first register with the event manager (Eventmanager), and give the type of event to be monitored and the address of its callback function (callback). When an event arrives, the event manager calls the callback function and passes it a data pointer, and returns the stored client data (client data) to the callback function. An application or thread can register to listen to multiple events at the same time. The operation flow of the event mechanism is shown in Figure 2.

如果一个线程或应用不再需要处理某个事件,它可以通过向事件管理器(Event manager)发出注销请求,事件管理器会释放未处理的事件及其相应的数据。If a thread or application no longer needs to process an event, it can send a logout request to the event manager (Event manager), and the event manager will release the unprocessed event and its corresponding data.

事件管理器为了有效的管理事件及其回调函数,可以由下列数据列表:In order to effectively manage events and their callback functions, the event manager can have the following data lists:

●线程列表● thread list

EventManager记录的数据通过线程列表串联起来,一个事件监听线程将占用线程列表中的一个记录。每个线程记录中除了包含线程id等信息外,还包含一个callbakc列表和一个事件列表。The data recorded by EventManager is connected in series through the thread list, and an event listening thread will occupy a record in the thread list. In addition to information such as thread id, each thread record also contains a callbakc list and an event list.

■回调函数列表■Callback function list

回调函数列表用于记录监听线程注册的回调函数,每当该线程注册一个回调函数时,EventManager将向callback列表中添加一个回调函数记录,当发送事件时,EventManager会察看该线程的callback记录中是否有对该事件的callback,如果有,则将该事件添加到该线程的事件列表中。;取消回调函数注册时,则会将列表中的该项记录删除,之后这种类型的事件将不会再被发送到该线程。The callback function list is used to record the callback function registered by the listening thread. Whenever the thread registers a callback function, the EventManager will add a callback function record to the callback list. When sending an event, the EventManager will check whether the callback record of the thread is There is a callback for the event, and if so, the event is added to the thread's event list. ; When the registration of the callback function is canceled, the item record in the list will be deleted, and then this type of event will no longer be sent to the thread.

■事件列表■Event list

事件列表用于记录发送到线程的事件,当某个线程试图发送事件时,EventManager将察看发送到的线程的回调函数列表中是否有对该事件的注册,如果有,则将此事件添加到该线程的事件列表中,之后,如果监听线程想要获取事件,则可以从事件列表中找到相应的事件记录。The event list is used to record the events sent to the thread. When a thread tries to send an event, the EventManager will check whether the event is registered in the callback function list of the sent thread, and if so, add this event to the After that, if the listening thread wants to get an event, it can find the corresponding event record from the event list.

上述个列表关系见图3。The relationship between the above lists is shown in Figure 3.

事件的处理:Event handling:

当一个线程或应用注册了对某事件的处理请求后,它可以处于等待此事件的状态。事件产生或到达之后,它就会处理事件。调用事件的处理器(回调函数)一是事件发送给事件管理器,由事件管理器来调用事件的处理器(回调函数)由事件的发送者直接调用事件的处理器来进行处理。这两种方式从本质上来说都是一样的。When a thread or application registers a processing request for an event, it can be in a state of waiting for the event. It handles events as they are generated or arrive. Calling the event handler (callback function) First, the event is sent to the event manager, and the event manager calls the event handler (callback function), and the sender of the event directly calls the event handler for processing. Both approaches are essentially the same.

在多个线程可以执行的情况下,RTOS调度程序负责决定执行哪一个线程。In cases where multiple threads can execute, the RTOS scheduler is responsible for deciding which thread to execute.

所有的线程(包括驱动层线程和应用程序线程均可以使用事件管理器。所以每个事件管理函数应当是线程安全的。All threads (including driver layer threads and application program threads) can use the event manager. So each event management function should be thread-safe.

二.事件管理器的实现和使用的详细方法:2. The detailed method of the implementation and use of the event manager:

Figure C200410018169D0008081717QIETU
事件回调函数的注册与注销
Figure C200410018169D0008081717QIETU
Registration and cancellation of event callback function

注册回调函数的主要工作流程见图4。The main workflow of registering a callback function is shown in Figure 4.

取消注册过程工作原理类似,首先得到线程记录,然后根据callbackId找到该回调在callback列表中的记录,删除该记录,如果该线程的所有回调函数都被删除,则清除该线程记录,包括其中的事件记录等。The deregistration process works similarly. First get the thread record, then find the callback record in the callback list according to the callbackId, and delete the record. If all the callback functions of the thread are deleted, clear the thread record, including the events in it. records etc.

Figure C200410018169D0008081717QIETU
事件的发送、接收和处理
Figure C200410018169D0008081717QIETU
Sending, receiving and processing of events

发送事件的主要工作流程如下The main workflow for sending events is as follows

1.检查事件是否被捕获1. Check if the event is caught

a)如果事件被捕获且捕获线程不是当前线程,则返回错误代码a) If the event is captured and the capturing thread is not the current thread, an error code is returned

b)否则继续b) otherwise continue

2.对所有线程记录重复如下操作:2. Repeat the following operations for all thread records:

a)如果线程id与发送到的线程id相同,或发送到的线程id为0,则a) If the thread id is the same as the thread id sent to, or the thread id sent to is 0, then

i.对线程的所有callback记录作如下操作:i. Do the following operations on all callback records of the thread:

1.如果callback记录的事件类型与发送事件类型相符,则1. If the event type recorded by the callback matches the sent event type, then

a)向该线程的事件列表添加事件记录a) Add an event record to the thread's event list

b)关联该事件的callback记录b) Associate the callback record of the event

c)释放线程的条件交量,以便等待事件的线程被唤醒c) Release the conditional delivery of the thread so that the thread waiting for the event is woken up

3.如果没有找到监听该事件的线程,则返回错误代码3. If no thread is found to listen to the event, an error code is returned

否则返回成功标志Otherwise return success flag

获取事件的主要工作流程如下The main workflow for getting events is as follows

1.得到监听线程在线程列表中的记录1. Get the record of the listening thread in the thread list

2.对线程记录的事件列表重复如下操作:2. Repeat the following operations for the event list recorded by the thread:

a)如果事件type,code与所要处理的事件的type、code相同,则a) If the event type and code are the same as the type and code of the event to be processed, then

i.对线程的所有callback记录作如下操件:i. Perform the following operations on all callback records of the thread:

a)如果callback记录的事件类型与发送事件类型相符,则a) If the event type recorded by the callback matches the send event type, then

i.拷贝事件内容,i. Copy event content,

ii.跳转至3ii. Jump to 3

3.如果接收到事件或者使用的是非阻塞方式,则跳转到53. If an event is received or a non-blocking method is used, jump to 5

4.如果没有接收到事件,则等待线程条件变量(会在发送事件时释放)4. If no event is received, wait for the thread condition variable (will be released when the event is sent)

5.如果接收到事件,则5. If an event is received, then

a)修改线程当前事件标志a) Modify the current event flag of the thread

b)输出事件信息b) Output event information

c)返回成功标志c) return success flag

否则,返回错误代码Otherwise, an error code is returned

处理事件的主要工作流程如下The main workflow for handling events is as follows

1.得到监听线程在线程列表中的记录1. Get the record of the listening thread in the thread list

2.如果线程记录的当前事件与被处理事件不相同,则返回错误代码否则2. If the current event recorded by the thread is not the same as the processed event, return an error code otherwise

a)得到事件关联的回调函数、数据释放函数a) Obtain the callback function and data release function associated with the event

b)删除事件记录b) Delete event records

c)调用事件回调函数c) Call the event callback function

d)检查是否所有监听该事件的线程都已处理过该事件,如果是,则调用事件数据释放函数d) Check whether all threads listening to the event have processed the event, if so, call the event data release function

e)返回callback函数的返回值e) Return the return value of the callback function

其他说明:other instructions:

由于事件监听处理线程的处理速度有可能赶不上事件的发送,为了保证处理事件能够符合先进线出的原则,在线程结构中加入了事件头指针,同时,事件结构中加入了next指针,指向下一个事件,进而形成事件的单链表,每次去事件的时候,都是取这个链表的第一个事件,发送事件时则都添加到链表末端,这样就可以避免监听线程处理事件的顺序混乱了。Since the processing speed of the event monitoring processing thread may not be able to keep up with the sending of events, in order to ensure that processing events can comply with the principle of first-in-line output, an event head pointer is added to the thread structure. At the same time, a next pointer is added to the event structure to point to the next Events, and then form a single-linked list of events. Every time you go to an event, you take the first event in the linked list, and add it to the end of the linked list when you send an event, so that you can avoid confusion in the order in which the listening thread processes events.

Figure C200410018169D0008081717QIETU
事件的捕获与取消捕获
Figure C200410018169D0008081717QIETU
Event capture and uncapture

捕获/取消捕获事件功能是通过一个捕获列表管理的,当某个线程试图捕获某个事件时,事件管理器(EventManager)首先查看事件是否已经被该线程独占,如果是,则不做任何操作,否则向捕获列表添加一个记录,该记录总是添加到捕获链表的头端,并记录捕获事件的type,code和捕获线程id,这样当发送事件时,首先在捕获列表中按照从头到尾的顺序查找该事件的记录,如果有记录且线程id与将要发送到的线程id不同,则不向该线程发送事件。取消捕获事件时则在捕获列表中查找对应记录,并删除记录。The capture/uncapture event function is managed through a capture list. When a thread tries to capture an event, the Event Manager (EventManager) first checks whether the event has been exclusively occupied by the thread, and if so, does nothing. Otherwise, add a record to the capture list, which is always added to the head of the capture list, and record the type, code and capture thread id of the capture event, so that when an event is sent, it will be first in the capture list in order from beginning to end Look for a record of the event, and if there is a record and the thread id is different from the thread id it will be sent to, then do not send the event to the thread. When canceling the capture event, find the corresponding record in the capture list and delete the record.

下面结合附图,对本发明的方法作进一步的说明。Below in conjunction with accompanying drawing, the method of the present invention is described further.

附图说明 Description of drawings

图1描述了数字电视接收设备的主要作用。Figure 1 describes the main role of digital TV receiving equipment.

图2描述了事件机制的操作流程。线程向事件管理器(Event manager)注册,给出需要监听的事件类型和其回调函数(callback)地址。当事件到来之时,事件管理器调用回调函数并传递给它一数据指针,并且将其存储的客户数据(client data)返回给回调函数。一个应用或线程可以同时注册监听多个事件。Figure 2 describes the operation flow of the event mechanism. The thread registers with the event manager (Event manager), and gives the type of event to be monitored and the address of its callback function (callback). When an event arrives, the event manager calls the callback function and passes it a data pointer, and returns the stored client data (client data) to the callback function. An application or thread can register to listen to multiple events at the same time.

图3描述了事件数据及处理函数的列表。Figure 3 describes the list of event data and processing functions.

图4描述注册回调函数的主要工作流程。Figure 4 describes the main workflow of registering a callback function.

以下结合具体的实施实例对本发明作进一步的详细说明。The present invention will be further described in detail below in conjunction with specific implementation examples.

具体实施方式 Detailed ways

具体实施方式如下:The specific implementation is as follows:

1.事件管理器使用前需要进行初始化,初始化函数比如为MBT_EvtInit(),1. The event manager needs to be initialized before use. The initialization function is MBT_EvtInit(), for example.

2.事件机制的基本使用方式为2. The basic usage of the event mechanism is

a)接收事件的使用(详细说明见上面关于事件机制的说明):a) The use of receiving events (see the description of the event mechanism above for details):

i.注册事件回调函数i. Register event callback function

ii.进入事件处理循环ii. Enter the event processing loop

1.等待事件1. Waiting for an event

2.当收到事件后处理事件2. Handle the event after receiving the event

3.在某种条件下推出循环(或者永不退出)3. Exit the loop on some condition (or never exit)

iii.当不再需要监听事件时取消对回调函数的注册iii. Cancel the registration of the callback function when it is no longer necessary to listen to the event

b)发送事件的使用b) Use of sending events

i.可以将事件发送到某个线程或以广播方式发送到所有监听该事件的线程i. Events can be sent to a thread or broadcast to all threads listening to the event

ii.发送事件时如果发送事件的data数据是动态分配的,则应给出数据释放函数ii. When sending an event, if the data data of the sending event is allocated dynamically, a data release function should be given

c)独占事件的使用c) Use of exclusive events

i.当需要捕获事件时,调用捕获事件函数,使某个事件为其独占,此时其他线程将无法收到该事件,除非之后其他线程再次捕获该事件i. When an event needs to be captured, call the capture event function to make an event exclusive to it. At this time, other threads will not be able to receive the event unless other threads capture the event again later.

ii.如果不再希望独占某个事件,则调用取消捕获事件函数,放开对事件的独占。ii. If you no longer want to monopolize an event, call the function of uncapturing the event to release the monopoly on the event.

最后所应说明的是:本发明提供的是一种提高数字电视接收设备中事件传递与处理的方法及其设计思想,以上实施例仅用以说明而非限制本发明的技术方案,尽管参照上述实施例对本发明进行了详细说明,本领域的普通技术人员应当理解:依然可以对本发明进行修改或者等同替换,而不脱离本发明的精神和范围的任何修改或局部替换,其均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that: the present invention provides a method for improving event transmission and processing in digital television receiving equipment and its design ideas. The above embodiments are only used to illustrate and not limit the technical solutions of the present invention. The embodiment has described the present invention in detail, and those of ordinary skill in the art should understand that: the present invention can still be modified or equivalently replaced, and any modification or partial replacement without departing from the spirit and scope of the present invention should be covered by this within the scope of the claims of the invention.

Claims (9)

1、一种提高数字电视接收设备中事件传递与处理的效率的方法,其特征在于,在数字电视接收设备中对要传输的事件的类型加以标识,规定携带数据的方法,规范事件注册与索起的过程与协议,而且所述方法通过以线程为序组织事件存储和处理队列,将事件处理的回调函数队列与其相应的线程联系起来,在所述数字电视接收设备中设计一个事件管理器,其中事件的内容包括类型、代码和数据指针,每个事件由类型和代码唯一确定,事件携带的数据通过数据指针传递给事件处理者,所述事件管理器记录的数据通过线程列表串联起来,每个事件监听线程占据线程列表中的一个记录,每个线程记录还包括一个回调函数列表和一个事件列表,所述回调函数列表用于记录监听线程注册的回调函数,所述事件列表用于记录发送到监听线程的事件。1. A method for improving the efficiency of event delivery and processing in digital television receiving equipment, characterized in that, in digital television receiving equipment, the type of event to be transmitted is identified, the method for carrying data is specified, and event registration and retrieval are regulated The process and protocol started, and the method organizes event storage and processing queues in the order of threads, links the callback function queues of event processing with their corresponding threads, and designs an event manager in the digital TV receiving device, The content of the event includes type, code and data pointer. Each event is uniquely determined by the type and code. The data carried by the event is passed to the event handler through the data pointer. The data recorded by the event manager is connected in series through the thread list. Each event listening thread occupies a record in the thread list, and each thread record also includes a callback function list and an event list, the callback function list is used to record the callback function registered by the listening thread, and the event list is used to record sending to the event of the listening thread. 2、根据权利要求1所述的一种提高事件传递与处理效率的方法,其特征在于,所述方法通过发送、删除、捕获与取消捕获事件来传递事件信息。2. A method for improving the efficiency of event transmission and processing according to claim 1, characterized in that the method transmits event information by sending, deleting, capturing and uncapturing events. 3、根据权利要求1所述的一种提高事件传递与处理效率的方法,其特征在于,所述方法通过注册、注销和修改事件处理的回调函数使事件得以被处理。3. A method for improving the efficiency of event delivery and processing according to claim 1, characterized in that the method allows events to be processed by registering, canceling, and modifying callback functions for event processing. 4、根据权利要求2或3所述的一种提高事件传递与处理效率的方法,其特征在于,所述方法允许事件的发送者直接调用事件处理的回调函数,使得事件能够直接处理。4. A method for improving event transmission and processing efficiency according to claim 2 or 3, characterized in that the method allows the sender of the event to directly call the callback function of event processing, so that the event can be processed directly. 5、根据权利要求1所述的提高数字电视接收设备中事件传递与处理效率的方法,其特征在于,在通过事件管理器传递和处理事件时,监听线程首先向事件管理器注册,给出需要监听的事件类型和其回调函数地址,当事件到来时,事件管理器调用回调函数并通过数据指针将事件携带的数据传递给回调函数。5. The method for improving event delivery and processing efficiency in a digital TV receiving device according to claim 1, characterized in that, when the event is delivered and processed by the event manager, the listening thread first registers with the event manager, and gives the required The type of event to monitor and the address of its callback function. When the event arrives, the event manager calls the callback function and passes the data carried by the event to the callback function through the data pointer. 6、根据权利要求5所述的提高数字电视接收设备中事件传递与处理效率的方法,其特征在于,当所述监听线程注册一个回调函数时,所述事件管理器向所述监听线程的回调函数列表中添加一个回调函数记录;当所述监听线程取消回调函数注册时,所述事件管理器将所述监听线程的回调函数列表中相应的回调函数记录删除。6. The method for improving event delivery and processing efficiency in a digital TV receiving device according to claim 5, characterized in that, when the monitoring thread registers a callback function, the callback function of the event manager to the monitoring thread A callback function record is added in the function list; when the listening thread cancels the registration of the callback function, the event manager deletes the corresponding callback function record in the callback function list of the listening thread. 7、根据权利要求6所述的提高数字电视接收设备中事件传递与处理效率的方法,其特征在于,在向监听线程发送事件时,所述事件管理器查看所述监听线程的回调函数列表中是否有对应所述事件的回调函数,如果有,则将所述事件添加到所述监听线程的事件列表中;而当监听线程获取事件时,则从所述监听线程的事件列表中找到相应的事件记录。7. The method for improving event delivery and processing efficiency in a digital TV receiving device according to claim 6, characterized in that, when sending an event to a listening thread, the event manager checks the callback function list of the listening thread Whether there is a callback function corresponding to the event, if so, add the event to the event list of the listening thread; and when the listening thread obtains an event, find the corresponding event from the event list of the listening thread record. 8、根据权利要求7所述的提高数字电视接收设备中事件传递与处理效率的方法,其特征在于,在处理事件时,事件管理器删除所述事件列表中相应的事件记录,并检查是否所有监听线程都已处理过所述事件,如果是,则调用所述事件的数据释放函数。8. The method for improving event delivery and processing efficiency in a digital TV receiving device according to claim 7, characterized in that, when processing an event, the event manager deletes the corresponding event record in the event list, and checks whether all The listening threads have all processed the event, and if so, call the data release function of the event. 9、根据权利要求8所述的提高数字电视接收设备中事件传递与处理效率的方法,其特征在于,所述事件管理器还包括捕获列表,所述捕获列表用于记录监听线程对事件的独占,当发送事件时,首先在捕获列表中查找所述事件的记录,如果有记录且线程id与将要发送到的线程id不同,则不向所述要发送到的线程发送事件;取消捕获事件时,则在捕获列表中查找对应记录,并删除记录。9. The method for improving event delivery and processing efficiency in a digital TV receiving device according to claim 8, wherein the event manager further includes a capture list, and the capture list is used to record the exclusive use of events by the listening thread , when sending an event, first look for the record of the event in the capture list, if there is a record and the thread id is different from the thread id to be sent to, then the event will not be sent to the thread to be sent to; when canceling the capture event , then find the corresponding record in the capture list and delete the record.
CNB2004100181696A 2004-05-09 2004-05-09 A kind of method that improves incident transmission and processing in the apparatus of digital television receiving Expired - Lifetime CN100538622C (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CNB2004100181696A CN100538622C (en) 2004-05-09 2004-05-09 A kind of method that improves incident transmission and processing in the apparatus of digital television receiving
PCT/CN2005/000624 WO2005109185A1 (en) 2004-05-09 2005-05-08 A method for improving efficiency of events transmission and processing in digital television receiving device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100181696A CN100538622C (en) 2004-05-09 2004-05-09 A kind of method that improves incident transmission and processing in the apparatus of digital television receiving

Publications (2)

Publication Number Publication Date
CN1571483A CN1571483A (en) 2005-01-26
CN100538622C true CN100538622C (en) 2009-09-09

Family

ID=34479380

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100181696A Expired - Lifetime CN100538622C (en) 2004-05-09 2004-05-09 A kind of method that improves incident transmission and processing in the apparatus of digital television receiving

Country Status (2)

Country Link
CN (1) CN100538622C (en)
WO (1) WO2005109185A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX338614B (en) 2009-09-03 2016-04-22 Opentv Inc System and method to provide gift media.
CN102402457A (en) * 2010-09-17 2012-04-04 希姆通信息技术(上海)有限公司 Method for processing mobile phone application program interaction event
CN104185096B (en) * 2014-09-12 2019-07-02 上海斐讯数据通信技术有限公司 A kind of ONU registration authorization method and system
CN104618432B (en) * 2014-12-30 2019-03-08 北京红马传媒文化发展有限公司 A kind of processing method and processing system that event sends and receives
CN106162166B (en) * 2015-03-23 2018-04-17 Tcl集团股份有限公司 A kind of factory's remote controller key event-handling method and device
CN112040317B (en) * 2020-08-21 2022-08-09 海信视像科技股份有限公司 Event response method and display device
CN112749024A (en) * 2020-12-28 2021-05-04 深兰人工智能(深圳)有限公司 Data distribution method and device for multiple sensors

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69227664T2 (en) * 1991-10-15 1999-04-22 Hewlett Packard Co Hardware-configured operating system core for a multitask processor
US5566337A (en) * 1994-05-13 1996-10-15 Apple Computer, Inc. Method and apparatus for distributing events in an operating system
AU1424697A (en) * 1995-12-29 1997-07-28 Powertv, Inc. Event filtering feature for a computer operating system in home communications terminal
US5974541A (en) * 1997-07-22 1999-10-26 National Instruments Corporation GPIB system and method which provides asynchronous event notification

Also Published As

Publication number Publication date
WO2005109185A1 (en) 2005-11-17
CN1571483A (en) 2005-01-26

Similar Documents

Publication Publication Date Title
US8099528B2 (en) Data filtering using central DMA mechanism
US8601097B2 (en) Method and system for data communications in cloud computing architecture
JP5516398B2 (en) Multiprocessor system and method for sharing device between OS of multiprocessor system
EP3416313A1 (en) Receiving device, receiving method, and program
US20050114900A1 (en) Methods and apparatus for hardware registration in a network device
EP1545052A1 (en) Method for waking up a sleeping device, a related network element, a related waking device and a related sleeping device
CN1360695A (en) Methods and apparatus for managing application according to application lifecycle
CN100538622C (en) A kind of method that improves incident transmission and processing in the apparatus of digital television receiving
US12131161B2 (en) Multi-core communication through a communication layer via a publish-subscribe layer
US8139568B2 (en) Communication method, communication system, relaying device and communication device
CN101304496A (en) Realization Method of Mobile TV Based on JAVA
US20120090012A1 (en) Event booking mechanism
CN112507329A (en) Safety protection method and device
CN102014002B (en) Method and system for managing multiple kinds of network element equipment
CN115134352A (en) Method, device, equipment and medium for uploading data of buried points
US20010018716A1 (en) Multi-tasking software architecture
WO2005109865A1 (en) A method for realizing embedded digital television service platform
WO2020173345A1 (en) Method for service decision distribution among multiple terminal devices and system
CN110321094A (en) Android record screen throws screen using the method for JAVA NIO transmission H264, H265 data format
CN100474918C (en) Frequency hopping method of cable modem, cable modem and transmission system
CN102014302B (en) Method for high-performance module scheduling of set-top box
US20110197247A1 (en) Content reception apparatus, content transmission apparatus, and content transmission and reception control apparatus
CN102244822A (en) Remote broadcast control method in IPTV (Internet Protocol Television) system, device and system thereof
WO2005109868A1 (en) A method for improving the efficiency of extracting eit
CN1349350A (en) TV top box with single processor for completing multitask

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C57 Notification of unclear or unknown address
DD01 Delivery of document by public notice

Addressee: Liao Hongtao

Document name: Deemed not to advise

C57 Notification of unclear or unknown address
DD01 Delivery of document by public notice

Addressee: Wang Zhaolin

Document name: Notice of conformity

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CX01 Expiry of patent term

Granted publication date: 20090909

CX01 Expiry of patent term