The environment provided by the reference model can easily test and verify applications, and applications designed in full accordance with the reference model can usually run smoothly. For application providers, their rights and interests are also protected. Because they can design flexible applications, they can be widely used in different platforms and are not limited by the bottom of the set-top box.
DVB-TAM defines an application as a functional application that can realize interactive services with software modules. An application can also be regarded as a series of functions that can activate MHP software and hardware resources.
An interactive application consists of the following two basic parts:
Application scripts (explanatory or procedural);
Content/scene (user graphical interface and media stream).
User Graphical Interface (GUI) is the interface for users to interact with the set-top box, including scene design, selection buttons, still images, text and so on. The whole user graphical interface can be said to be composed of many scenes, and each scene is composed of a series of widgets, programming objects and attributes. The connection between the scene and the programming object is completed by a special mechanism.
Procedural application is a program based on low-end functions and class libraries, which is usually used when it is necessary to optimize host resources (such as maximizing the use of transmission network resources). ). It is generally platform-related, so it needs to be changed when porting to different host platforms.
Interpretative application consists of high-end functions and class libraries. This allows us to use a platform-independent reference model to test whether an application is platform compatible.
In fact, applications are not always explanatory or procedural. For example, we can embed procedural code in explanatory applications, which can greatly reduce the code length and program execution efficiency. The platform independence problem is solved by the real-time engine and virtual machine embedded in the host. Of course, if compatibility is not considered in platform design, it is difficult to achieve good portability of different platforms.
The application is recognizable, and it can be run automatically or on request. The display mode of the application can be resized or run in the background. Application management includes: interrupt, error handling, priority mode and dynamic resource management. When you exit the application, you should release system resources.
(2) Application delivery mechanism.
Program scripts and related content are packaged into application objects and converted into DSM-CC objects. DSM-CC standard is formulated by MPEG organization. Similar to network communication protocol, there must be a set of communication protocol between data broadcasting front-end and data broadcasting receiving equipment to ensure data transmission and decoding. The sixth part of MPEG-2 standard, DSMCC, is such an open protocol. Compared with other protocols, DSMCC mainly considers how to realize fast data transmission under the condition of limited equipment resources at the receiving end. DSM-CC UU is an interface that allows us to obtain objects in DSM-CC format from broadcast streams or remote servers.
The DSM-CC object allows the data ring module to carry one or more program objects. Object is modular, which can optimize memory usage performance. DSM-CC also provides compression tools to format program objects and data ring objects, and the sending mechanism also ensures the security of downloading data ring objects.
(3) Programming Interface Definition (API)
DVB-TAM defines API as a series of high-end functions, data structures and protocols, which are used to represent the standard interface of platform-independent software. It applies object-oriented language and can flexibly reuse existing functions.
An application describes a series of objects according to the definition of high-end API. It defines the interface between the application and local hardware and software resources.
The API defines the following requirements.
Inheritance: It is reusable. For object-oriented languages, inheritability is a very important feature. Data or methods in a superclass can be inherited by its subclasses, and so can subclasses of subclasses, which realizes data reuse and greatly improves programming efficiency.
Openness: It can be referenced by other interface instances.
Abstract: Low-end functions are encapsulated by abstract data types and cannot be used directly. Only through authorized behavior can we interact with the outside world, thus ensuring the integrity and security of the source code.
Flexibility: independent of hardware, API can be upgraded due to hardware upgrade and switching to different hardware systems in the future. For example, you can add a new class library by downloading.
According to different application formats, the low-end API is used to handle process functions and the high-end API is used to handle interpretation functions.
The low-end API corresponds to a process program. This API should not only clarify the application function, but also care about resources.
The high-end API corresponds to the interpreter. The higher the level of abstract interpretation layer, the stronger the independence of the system. The API only needs to specify the application function, and does not need to care whether the resource is activated. The definition of open API will ensure that DVB STB can realize hardware-independent functions.
DVB-MHP describes the function of API as follows.
Applications that support local storage or real-time download.
Support what you see is what you get.
Support access to databases (such as DVB-SI forms).
Compatibility.
As the core part of MHP plan, an open and promising API standard should be modular, portable, flexible and extensible. It allows content and service providers to apply different but compatible platforms to provide services.
(4) Navigation/selection system
When the set-top box is started, the embedded navigation function runs the navigation program of the first layer by calling the corresponding API. The API can also be used to control TS streams, such as browsing channels and programs.
Navigation can also be run directly by executable code without using API and related interpreter. In the model recommended by DVB-TAM, the navigation system module and API are at the same level, so that data can be easily obtained from the data pipeline and TS stream.
The basic navigation system includes the following two functions.
List all available programs.
Provide shortcut keys to facilitate users to access program content.
The enhanced navigation system is realized by electronic program guide (EPG), and the enhanced functions include user folders and bookmarks.
(5) Application startup and control.
The running of the application program includes startup, application and demonstration. The program code can reside in the set-top box or be downloaded from a remote server. If downloaded from a remote server, the application can be automatically upgraded.
The function of the application manager is.
Acquire and release system resources.
Error management and exception handling.
Initial and interrupted sessions.
Verify the integrity of code and data.
Synchronize instructions and information.
Adjust the display graphics format to meet the requirements of different platforms.
Allow * * * to enjoy content and variables.
Have an orderly and neat expression style.
(6) Encryption function (security function)
Although the definition of encryption module has not been completed, DVB still defines the requirements of API related to encryption.
Public encryption module should be used to ensure the compatibility of different broadcast operators and content providers when exchanging programs.
The API involved in encryption should be independent of the conditional access system. If necessary, MHP API should be open to CA-related functions.
Important safety considerations also relate to:
Prevent system resources from being abused, such as excessive access to memory.
Protect private data from unauthorized access.
(7) Middleware
Program service providers publish various services in the form of applications through transmission channels (such as broadband multimedia data network and cable TV network) (such as EPG), and users turn on the TV and browse through the set-top box. The user's demand information (such as video on demand (VOD)) is transmitted to the video server through the uploading channel (such as telephone line modem or cable TV cable), and the corresponding service items are selected according to the request, and downloaded to the flash memory of the user terminal-set-top box in the form of application programs through the transmission channel. The application program calls the API contained in the middleware in the set-top box Flash, executes the application program, and completes the function requested by the user.
The purpose of middleware is to provide STB manufacturers with basic and general functions in the form of API, so as to standardize the interactive functions of digital TV, and at the same time minimize the amount of data downloaded from service items (through transmission channels in the form of applications) to user terminals-STB. Middleware products are generally provided by third parties other than program providers and set-top box manufacturers, which is very beneficial for program providers and set-top box manufacturers to further simplify and standardize program production. This is a concrete manifestation of the more subdivided market in the era of knowledge economy.
The realization of middleware directly depends on the format of application (whether explanatory or procedural) and the application of high-end or low-end API. Every successful middleware implementation is customized according to the characteristics of the local platform.
There are different ways to implement interactive and real-time engines, but usually the following modules are needed.
Library function;
Script and content interpreter;
Event manager (dealing with remote control and other devices, user response, identification, timing, error handling);
Boot program (loader).
By using API, the real-time engine provides the underlying interface with the system hardware and software. The real-time engine can wake up the programs that reside in the local computer, and the programs that reside can be platform-dependent, thus improving the system performance and reducing the operational limitations of interpreting the application level (such as compressing the size of downloaded application objects). Real-time engine is executable code, which is optimized according to the characteristics of each platform with reference to the reference model.
Virtual machines are usually used to run program functions (such as complex calculation, information and text processing, data compression) or resident programs to enhance the performance of explanatory applications.
Due to the application of real-time engine and virtual machine, API can realize platform-independent applications.
(8) Software and hardware resources.
MHP should have a friendly user interface. For peripheral devices, display devices, input devices such as (remote control) are necessary. In addition, you can choose to use keyboard, local built-in or external storage devices. The connection of these peripheral devices should be "plug and play".
For a set-top box based on MHP, the internal hardware resources include: front-end, demultiplexing, decoding, filtering, general interface, communication interface, CA system, memory and related drivers.
To realize the standard functions of DVB, the set-top box needs at least 1MB flash memory and 1MB memory, and the speed of CPU needs to reach 20MIPS. If you have 16MB flash memory, 32MB memory and 100 IPS CPU, it can be easily done. Hardware resources can be specially allocated, for example, 70% of CPU processing time is designated for running applications, and the remaining 30% is used for system management.
The following contents are stored in the memory:
Interpreter of API;
Library function;
Real-time engine and virtualizer;
Boot program (loader);
System tools;
File system;
Firmware;
Operating system (including startup, memory management, task management, resource management, hour hand, etc.). );
Drive;
Navigation system.
Allows multiple versions of an application to be downloaded to flash memory. At the same time, the memory management is also quite flexible, using block management, different programs use different identification of memory segments, and only one memory segment can be refreshed.
Applications sent periodically by DSM-CC are stored in RAM, which can be used to store data buffers for video and audio decoding, for dynamic platform management (such as stack and process queuing), and for storing variables used in applications.
The most basic system settings and factory settings are usually stored in EEPROM (generally not more than 10KB).