The present invention concerns an encoding method for encoding a description element of an instance of an XML-like schema defining a hierarchical structure of description elements, said hierarchical structure comprising hierarchical levels, parent description elements and child description elements, said description element to be encoded comprising a content.
It also concerns a decoding method for decoding a fragment comprising a content and a sequence of identification information.
It also concerns a encoder intended for implementing said encoding method, a decoder intended for implementing said decoding method, and a transmission system comprising such a encoder and/or such a decoder.
It further concerns a table intended to be used in such an encoding or decoding method and a signal transporting encoded description elements generated by using such an encoding method.
The invention is applicable to XML-like instances of XML-like schema. In particular it is applicable to MPEG-7 documents.
XML is a recommendation of the W3C consortium (extensible Markup Language 1.0 dated Oct. 6, 2000). XML-schema is also a recommendation of the W3C consortium. An XML-schema defines a hierarchical structure of description elements (called element or attribute in the W3C recommendation). An instance of an XML-schema comprises description elements structured as defined in said XML-schema.
An object of the invention is to propose an encoding and a decoding method for transmitting and storing one or more description element(s) of an XML-like document which is an instance of an XML-like schema.
According to the invention an encoding method as described in the introductory paragraph is characterized in that it consists in:
When a description element is defined in the schema as possibly having multiple occurrences, said table further comprises for said description element an occurrence information for indicating that said description element may have multiple occurrences in an instance, and when an occurrence having a given rank is scanned during the encoding, the corresponding retrieved identification information is indexed with said rank.
And a decoding method according to the invention as described in the introductory paragraph is characterized in that it consists in:
When a description element is defined in the schema as possibly having multiple occurrences, said table further comprises for said description element an occurrence information for indicating that said description element may have multiple occurrences in an instance, and when said sequence comprises an indexed identification information, said index is interpreted as an occurrence rank for the associated description element, same description element(s) of lower rank(s) being added to said hierarchical memory representation if not already contained in it.
According to the invention each description element is represented by an independent fragment in the stream ensuring random-access to elements and attributes as well as a high level of flexibility as far as the incremental transfer is concerned. This fragment approach also takes into account the fundamental flexible and extensible nature of MPEG-7 by using schemas to compute the sequence of identification information associated to a given description element. The fragment approach allows the proposed binary format to fulfill the following properties:
The other advantages of the invention are captured by the use of an intermediate representation of the schema. Indeed, the table which is directly and unambiguously generated from the schema, allows to share a common knowledge about the possible valid instances between a server and a client, in a form dedicated to the binary encoding and decoding of these instances. This common knowledge, gathering information such as structure, type, and tag name of the elements and attributes, does not need to be sent to the client, which leads to an efficient schema-aware encoding of the instances. This allows also the binary format to achieve a full extensibility support for future schemas defined inside or outside MPEG-7.
Further features and advantages of the invention will become more readily apparent from the following detailed description, which specifies and shows a preferred embodiment of the invention in which:
The invention will now be described by reference to XML instances of XML-schemas. This is not restrictive. The invention is applicable to any instances and schemas written in Markup Language of the same type.
An XML-like schema defines a hierarchical structure of description elements (either an element or an attribute in the XML terminology) comprising parent description elements and child description elements. An instance of an XML-like schema is an XML-like document comprising description elements structured as defined in said XML-like schema. Some of the description elements of an instance have a content. Other are only structural containers.
As described in
They also have access to at least one table EDT, called Element Declaration Table, directly and unambiguously generated from the XML-schema. The Element Declaration Table is primarily intended to contain all the information needed to encode and decode any instance that is valid with respect to a given schema definition. The Element Declaration Table is generated once and available for coding and decoding an instance that refers to the associated schema. It doesn't have to be sent to the client.
The encoder scans a hierarchical memory representation DM-C of an instance XML-C (a DOM representation as defined in the W3C specification<<Document Object Model, level 1 specification, version 1.0, Oct. 1, 1998>>, or any other hierarchical memory representation of the instance) and uses the information contained in the Element Declaration Table in order to generate one or more binary fragments BiM-F each binary fragment being associated to a description element of the instance.
According to the invention, the description elements that have a primitive type content (e.g. built-in type, simple type, a descriptor with its own binary representation) are encoded as an independent fragment composed of a sequence of identification information (also called instance structuring key) and a content value. The description elements within the XML hierarchy that are only structural containers (i.e. having no content value) are not transmitted but inferred at the decoder side from the Element Declaration Table.
The binary fragments BiM-F are transmitted over a transmission network NET and received by the decoder BiM-D. The decoder uses the Element Declaration Table in order to retrieve:
The decoder BiM-D updates accordingly a hierarchical memory representation DM-D. An XML instance XML-D is then generated from the updated hierarchical memory representation.
One can see the Element Declaration Table as an exhaustive definition of the possible valid instances, generated uniquely and unambiguously from the schema by developing the element and attribute declaration structures. Indeed, the XML-schema gives mainly two kinds of information: On the one hand, the location of all the possible elements and attributes within the XML instance hierarchy is specified by means of complex type definitions (either named or anonymous) and element declarations. On the other hand, the type of their value is given through the use of built-in datatypes and simple type definitions. For each element or attribute that is specified in the schema and that can be found in the instance, the Element Declaration Table gathers its name (e.g. the tag name for an element), its type, its nature (element or attribute) and a key (called table structuring key) specifying unambiguously its location within the hierarchical XML structure. While the schema is defining what an instance should look like for validation and interoperability purpose, the Element Declaration Table is stating what an instance will look like from a structural perspective for coding purpose.
The basics of the Element Declaration Table and its use in the encoding and decoding process stand in the table structuring key, intended to uniquely identify:
The syntax of this structuring key is a dotted notation where the dots denote hierarchy levels and the numbering at each level is performed by expanding all the elements and attributes declarations from the schema. The last digit of the notation is an identification information solely identifying a description element in its hierarchical level. The previous digits are pointing information used for retrieving a child description element from its parent description element.
When a description element is defined in the schema as having or possibly having multiple occurrences, an occurrence information is added at the end of the dotted notation (in the following of the description the occurrence information is represented by brackets).
The process of generating the Element Declaration Table is comparable to browse through all the element declarations in the schema in order to come up with a hierarchical memory representation of the biggest instance (the one instantiating all possible elements and attributes) corresponding to a given schema. Nevertheless, this “biggest” instance is infinite as soon as the schema defines self-embedding structures, commonly used within MPEG-7. Hence, there is a clear need for capturing the self-containment in the Element Declaration Table. This is done by specifying, in case of a self-contained description element, the table structuring key of its ancestor in the tree structure that has the same complex type. Such an element is thus not expanded further in the Element Declaration Table. The table structuring key of the ancestor is called self-containment key. It is also used for retrieving a child description element from its parent description element.
The pointing information together with the self-containment key are the structural information used to retrieve any child description element from its parent description element. When a parent description element is a self-contained description element, its children are the description elements which pointing information are identical to the self-contained key of said parent description element. When a parent is not a self-contained description element, its children description elements are the description elements which pointing information are identical to said parent table structuring key.
The Element Declaration Table allows to state a unique and unambiguous numbering of all possible instances of the schema. We will now give examples of schemas and corresponding Element Declaration Table.
The Element Declaration Table, seen as a development of all schema element declarations, would contain among other information the following element names together with their corresponding table structuring key:
0
The underlined digits are the identification information.
The Element Declaration Table contains, among other information such as the name and key of the elements, the self-containment field when relevant:
The underlined digits of the table structuring key are the identification information. The non-underlined digits of the table structuring key and the self-containment key are the structural information used to retrieve any child description element from its parent description element.
Note that the brackets in the Element2 table structuring key denote the presence of a multiple occurrence element. Moreover, Element2 and Element4 are taken into account in the numbering even though they are optional elements. Note also that the Element1 appears twice in the table since it can be instantiated at different locations within the tree structure.
The underlined digits of the table structuring key are the identification information. The non-underlined digits of the table structuring key and the self-containment key are the structural information used to retrieve any child description element from its parent description element.
A method for encoding a description element of an instance of a schema will now be described by reference to
An example of such an encoding process will now be given in reference to the above described EXAMPLE 3.
ARRAY 1 below gives an example of an instance of the schema described in EXAMPLE 3. On the left are given the instance structuring key of the element defined in the corresponding line of the array. On the right are given the instance structuring key of the attribute defined in the corresponding line of the array. Those instance structuring keys have been obtained by using the above described encoding method.
The encoding of the description element <MediaTime timeunit=“PT1N30F”> appearing in bold character in Array 1 will now be described step by step as illustrative purpose.
step 1-1: a hierarchical memory representation of the instance is scanned from parent description element to child description element until reaching the description element to be encoded (here the attribute “timeUnit” of an element “MediaTime”); the scanned description elements are:
step 1-2: the corresponding identification information (including the index if applicable) are retrieved from Table 3:
Step 1-3: a sequence of the retrieved identification information is built: 0.3 [0].3[1].2.2. This sequence is the instance structuring key associated to the encoded description element.
The other instance structuring keys given in Array 1 can be derived in the same way.
The instance structuring key can also be seen as an instantiation of the table structuring key. Indeed, the multiple occurrence elements are actually indexed (resulting in instance structuring keys such as 0.3[0], 0.3[1], . . . ) and the self-containment loops are developed (resulting in instance structuring keys such as 0.3[0].3[1].2.2 that do not appear in the table but can be computed from it). The instance structuring key is encoded as a description element identifier in an instance binary fragment.
A method for decoding a fragment will now be described by reference to
In practice the received sequence is scanned, identification information by identification information, and the following algorithm is applied to update the hierarchical memory representation of the instance:
Algorithm (1):
For example, at step 4-2, the current description element can be retrieved by using the following algorithm given in C-like code:
Algorithm (2):
which means that the current description element is Element 4.
In case of non-self-contained hierarchies, the mapping between the table structuring key and the instance structuring key is straightforward. Indeed, one has simply to remove the indexes found in the instance structuring key to retrieve the corresponding table structuring key. In the above described EXAMPLE 1, a description element represented by the instance structuring key 0.1 [5] is the fifth Element2 present in a globalElement.
In an advantageous embodiment of the invention the table structuring key and the instance structuring key are compacted as will now be described. Experiments have shown that such a compression of the structuring key leads to a significant gain regarding the size of the key while offering exactly the same functionality.
The resulting keys are referred as compact key (in short CSK). In the simpler case (no self-containment), the CSK is the structuring key Element Declaration Table record number.
First, we need to add a key to the current list of EDT fields by numbering the Element Declaration Table records. Applied on the above described EXAMPLE 2, this leads to:
Table2bis:
Algorithm (3) is used to compute the CSK in the general case (with self-contained structures) from the instance structuring key:
Algorithm (3):
We want to compute the CSK corresponding to the following structuring key: 0.0.1.1.0
Applying step by step the algorithm described above gives:
prefix(instance_key)=0.0.1
Which leads finally to:
The only purpose of the compact structuring key is to reduce the size of the stream. Therefore the instance compact structuring key is firstly decoded to its expanded form (instance structuring key) by the decoder before the above described decoding phase. Algorithm 4 given below returns the instance structuring key corresponding to a instance compact key:
Algorithm (4):
We want to generate the instance structuring key corresponding to the following CSK 3.3.2
Applying step by step the algorithm described above gives:
An example of binary syntax will now be described. Fragments are part of a file having a header. The header of the file contains at least an identifier of the schema (either an MPEG-defined ID or a URL as proposed in M6142).
Each fragment is composed of an instance compact structuring key K(DEi) (or an instance structuring key) and a description element value C(DEi) (also called content) as described on
Key[ind][ind]( . . . )[ind].Key[ind][ind]( . . . )[ind].( . . . ), where each group Key[ind][ind]( . . . )ind] is called token. Tokens of an instance structuring key comprise at most one index. Tokens of instance compact structuring keys may comprise several indexes. All keys and indexes are integer values coded using a variable number of bytes. The whole structuring key is thus coded using a variable set of bytes, each of them being controlled by the 2 most significant bits with the following semantics:
The length is thus coded by default using one byte, with the most significant bit being interpreted as follows:
As already mentioned, a major advantage of the proposed coding scheme is to encode only the attributes and elements that contain a primitive type value, and skip the elements that are only structural containers (e.g. with a complex type). This is allowed given that the structure can be inferred at the decoder side using the Element Declaration Table.
Consider the following instance fragment (found in the core experiment test set):
In this case, only the MediaURL would be encoded (as a string) using a structuring key that allows the decoder to reconstruct the whole structure from the Element Declaration Table. The other container elements would not be transmitted.
In the general case, all the elements which type is primitive (i.e. for which a binary representation is available in a standard way which ensures interoperability) shall be encoded.
Examples of such primitive types are the XML-schema built-in types (e.g. string, float, . . . ) as well as the MPEG-7 specific basic types (e.g. unsignedInt1, unsignedInt2, MediaTime, Matrix, . . . ).
Primitive types also include extended types that might include complex types in the following cases:
These criteria are certainly fulfilled in the case of descriptors as defined by the video and audio group of MPEG-7. Indeed, a compact binary representation has already been defined and should be used. Furthermore, there is (most of the time) no need for accessing the individual parts of the descriptors (they make sense as a whole).
The efficiency (in terms of content compression) will increase with an increasing number of primitive types (which are encoded in an optimal way), but so does the complexity of the decoder which is supposed to include the decoding methods for all the standard primitive types.
ARRAY 2 below is an example of compact instance structuring key for the instance already used in ARRAY 1. The compact instance structuring key associated to the description element <MediaTime timeUnit=‘PT1N30F’> is 7[0].7[1].6. The binary representation of this compact instance structuring key is ‘10-000111 00-000000 10-000111 00-000001 11-000110’. The length of the content is encoded on 1 byte:0-0000111. And the value PT1N30F is converted from string characters to bytes using usual character coding.
Number | Date | Country | Kind |
---|---|---|---|
00402876 | Oct 2001 | EP | regional |
Number | Name | Date | Kind |
---|---|---|---|
6236395 | Sezan et al. | May 2001 | B1 |
6360234 | Jain et al. | Mar 2002 | B2 |
6549922 | Srivastava et al. | Apr 2003 | B1 |
6564263 | Bergman et al. | May 2003 | B1 |
6593936 | Huang et al. | Jul 2003 | B1 |
6646676 | DaGraca et al. | Nov 2003 | B1 |
6665731 | Kumar et al. | Dec 2003 | B1 |
6748382 | Mohan et al. | Jun 2004 | B1 |
6772180 | Li et al. | Aug 2004 | B1 |
6877134 | Fuller et al. | Apr 2005 | B1 |
6883137 | Girardot et al. | Apr 2005 | B1 |
6963972 | Chang et al. | Nov 2005 | B1 |
6966027 | Krasinski | Nov 2005 | B1 |
7028312 | Merrick et al. | Apr 2006 | B1 |
7089543 | Rising, III | Aug 2006 | B2 |
7203692 | Tabatabai et al. | Apr 2007 | B2 |
7231394 | Walker et al. | Jun 2007 | B2 |
7240285 | Rising et al. | Jul 2007 | B2 |
20010018693 | Jain et al. | Aug 2001 | A1 |
20020120652 | Rising et al. | Aug 2002 | A1 |
20020126666 | Rising et al. | Sep 2002 | A1 |
20020138514 | Rising et al. | Sep 2002 | A1 |
20020159519 | Tabatabai et al. | Oct 2002 | A1 |
20020170070 | Rising et al. | Nov 2002 | A1 |
20020184336 | Rising, III | Dec 2002 | A1 |
20020198905 | Tabatabai et al. | Dec 2002 | A1 |
20030028557 | Walker et al. | Feb 2003 | A1 |
20030031260 | Tabatabai et al. | Feb 2003 | A1 |
20030037301 | Rising, III | Feb 2003 | A1 |
20050193425 | Sull et al. | Sep 2005 | A1 |
20070234192 | Rising et al. | Oct 2007 | A1 |
Number | Date | Country |
---|---|---|
WO9734240 | Mar 1997 | WO |
WO 0028725 | May 2000 | WO |
Number | Date | Country | |
---|---|---|---|
20020138517 A1 | Sep 2002 | US |