Apparatus and method for structuring data written according to ISO/8824/ASN.1 specification

Abstract: In a data structuring apparatus, input character strings written in accordance with the specification of ISO/8824/ASN.1 are decomposed and keywords representative of types and attributes are detected from the decomposed character strings. Type nodes are created from the detected type representative keywords and attribute nodes are created from the attribute representative keywords. Internode linking means is provided for establishing links between the type nodes and the attribute nodes according to hierarchical relationships between them and forming a tree structure by the established links. The tree structure is traced and the input character strings are translated according to the traced tree structure into a declaration sentence which can be processed by a computer program.

Description: The present invention relates generally to the structuring of data to be stored in a program for processing protocols, and more particularly to an apparatus and method for structuring abstract syntax to be used as protocols for the application layer of the ISO (International Organization for Standardization) Open Systems Interconnection (OSI) seven-layer network model according to the ISO 8824 "Specification of Abstract Syntax Notation One (ASN.1)". In conventional computer networks, one signal processing method involves analyzing the data structure of a received signal by utilizing the relatively simple structure of syntax. If this method is adopted for processing signals according to the ISO/8824/ASN.1 specification (1 st edition, December 15, 1987), the program for processing the protocols would become prohibitively complex for implementation. Another processing method involves storing the ASN.1 notation as a string of characters in a program and scanning the strings to analyze the data structure of a signal. If the latter is adopted, however, the scanning process must be performed at each end of an on-line network and would, therefore, prohibitively increase the overhead of a communication. The document Computer Networks and ISDN Systems, volume 14, no. 2-5, 1987, Amsterdam, NL, pages 297-303; F. Caneschi et al: "An Architecture for an ASN.1 Encoder/Decoder" deals with the implementation of architectural problems in the ISO presentation layer, particularly with reference to the encoding/decoding aspects. In particular, said document relates the abstract data types definition to an actual representation of the associated data values, possibly generated in a programming language data structure. Furthermore, said document relates to the OSI presentation layer, i.e., the ASN.1 encoder/decoder. Said system also relates to the automatic generation, and the target language of the data types associated with the ASN.1 definition so as to free the application implementor from this task. It is therefore an object of the present invention to provide a method for structuring the ISO/8824/ASN.1 character strings into a declaration programming language in order to permit computers to directly process telecommunication signals. This object is solved with the features of the claims. An apparatus as described comprises a scanning means for decomposing input character strings written in accordance with the specification of ISO/8824/ASN.1 (International Organization for Standardization 8824 Abstract Syntax Notation One). Keywords representative of types and attributes are detected from the decomposed character strings and type nodes are created from the detected type representative keywords and attribute nodes are created from the attribute representative keywords. Internode linking means is provided for establishing links between the type nodes and the attribute nodes according to hierarchical relationships between the type nodes and the attribute nodes and forming a tree structure by the established links. The tree structure is traced and the input character strings are translated according to the traced tree structure into a declaration sentence which can be processed by a computer program. A method for structuring data as described comprises the steps of decomposing input character strings written in accordance with the specification of ISO/8824/ASN.1, detecting keywords representative of types and attributes from the decomposed character strings, deriving type nodes from the detected keywords representative of the types, deriving attribute nodes from the detected keywords representative of the attributes, establishing links between the type nodes and the attribute nodes according to hierarchical relationships between the type nodes and the attribute nodes and forming a tree structure by the established links; and tracing the tree structure and translating the input character strings according to the tree structure into a declaration sentence which can be processed by a computer program. The present invention will be described in further detail with reference to the accompanying drawings, in which: Fig. 1 is a block diagram of an ISO/8824/ASN.1 data structuring apparatus according to the present invention; Fig. 2 is a flow diagram of the data structuring apparatus of Fig. 1; Fig. 3 is a flow diagram of the attribute node generating means of Fig. 1; Fig. 4 is a flow diagram of the attribute node generating means of Fig. 2; Fig. 5 is an illustration of a typical example of character strings written in accordance with the ISO/8824/ASN.1 which are supplied to the data structuring apparatus of Fig. 1; Fig. 6 is an illustration of decomposed character strings after the input character strings are processed by the scanning means of Fig. 1; Fig. 7 is an illustration of a tree structure derived from the input character strings; and Fig. 8 is an illustration of a typical example of a C-language declaration sentence as an output of the data structuring apparatus. Referring now to Fig. 1, there is shown an ASN.1 data structuring apparatus according to an embodiment of the present invention. The ASN.1 data structuring apparatus, indicated at 10 in Fig. I, comprises an ASN.1 scanning means 1, an ASN.1 keyword detecting means 2, a type node generating means 3, an attribute node generating means 4, an internode linking means 5 and a C-language declaration sentence generating means 6. The ASN.1 scanning means 1 receives ASN.1 character strings which are described in accordance with the ISO/8824/ASN.1 specification and scans the character strings. The ASN.1 keyword detecting means 2 is associated with the scanning means 1 to detect keywords which can be classified as "type" and "attribute". The type node generating means 3 is associated with the keyword detecting means 2 to generate a node of fixed size (two items, for example) in accordance with a "type" keyword detected in the scanned character strings. The attribute node generating means 4 is also coupled to the keyword detecting means 2 to generate an attribute node of fixed size (four items, for example) in accordance with an "attribute" keyword detected in the scanned character strings. The internode linking means 5 establishes links between the type nodes and attribute nodes in tree form according to their hierarchical relationships. The C-language declaration sentence generating means 6 is associated with the node generating means 3 and 4 and internode linking means 5 to provide translation of the ASN.1 character string into character strings in the C-programming language by tracing the links established between the type and attribute nodes. As shown in Fig. 2, the ASN.1 data structuring apparatus 10 is programmed to begin signal processing with operations block 11 which directs the scanning means 1 to receive ASN.1 character strings. Operations block 11 is followed by operations block 12 which directs the scanning means 2 to scan the loaded data to decompose it into individual character strings which are separated by blanks. Therefore, if protocol data units (PDU) as shown in Fig. 5 are applied to the data structuring apparatus 10, they are decomposed into a form as shown in Fig. 6. Exit then is to subroutine 13 which directs the ASN.1 keyword detecting means 2 to detect "type" keywords such as "INTEGER", "IA5String" and "SEQUENCE" in the decomposed character strings, directs the node generating means 3 and 4 to generate nodes in cooperation with the internode linking means 5 in a manner described hereinbelow. In Fig. 3, the node generating subroutine 13 of Fig. 2 begins with a decision block 15 which determines if each of the detected "type" keywords (elements) has a subelement. If the answer is affirmative, exit is to subroutine 16 which directs the attribute node generating means 4 to successively generate "attribute" nodes beginning with a subelement having a lowermost rank. Thus, in respect of "INTEGER", attribute nodes ea 11 and ea 13 are successively created and in respect of "IA5String" and "SEQUENCE" attribute nodes ea 12 and ea 14 are created, respectively (see Fig. 7). As shown in detail in Fig. 4, the subroutine 16 of Fig 3 begins with a decision block 41 which determines if there is a lower ranking subelement in the elements detected by operations block 13. If there is one, exit is to operations block 42 which causes the internode linking means 5 to establish links between such subelements and directs the writing of pointers linking the above-mentioned "attribute" nodes into the first item of such attribute nodes having a lower ranking subelement. If there is no lower ranking subelement in the detected subelements, exit is to operations block 43 which directs the writing of a null pointer (- -) into the first item of an attribute node having no lower ranking subelement. As shown in Fig. 7, if attribute nodes ea 11, ea 12, ea 13 and ea 14 are ranked in an increasing order named, a pointer to attribute node ea 11 is written into the first item of node ea 12, a pointer to node ea 12 is written into the first item of node ea 13, and a null pointer (- -) is written into the first item of attribute nodes ea 11 and ea 14. The attribute node generating means 4 proceeds to operations block 44 which directs the writing of a value corresponding to the identifier of a subelement into the second item of each attribute node. For example, identifiers "c", "b" and "a" are converted to numerical data "3","2" and "1", respectively, and written into the second item of the attribute nodes ea 11, ea 12 and ea 13, respectively, and "0" is written into the second item of node ea 14 indicating that there is no identifier (see Fig. 7). The attribute node generating means 4 advances to operations block 45 which directs the writing of an "attribute" value representative of the attribute of each subelement (such as "optional" attribute, "default" attribute, and "implicit" attribute) into the third item of each attribute node. As shown in Fig. 7, for example, the "OPTIONAL" attribute of "INTEGER" is written into the third item of attribute node ea 11, and "0" is written into the third item of each of the attribute nodes ea 12, ea 13 and ea 14 to indicate that there is no attribute for such nodes. The attribute node generating means 4 further proceeds to operations block 46 which causes the internode linking means 5 to detect a pointer linking each attribute node to a "type" node and directs the writing of such a pointer into the fourth item of each node. As shown in Fig. 7, for example, a pointer to a type node tt 11 is written into the fourth item of attribute node ea 11, a pointer to a type node tt 12 is written into the fourth item of attribute node ea 12, a pointer to a type node tt 11 is written into the fourth item of attribute node ea 13 and a pointer to type node tt 14 is written into the fourth item of attribute node ea 14. If the answer is negative in decision block 15 or subroutine 16 has been executed, control proceeds to subroutine 17 which directs the type node generating means 3 to write a value indicative of the type of each node into the first item of that node and directs the internode linking means 5 to detect a pointer linking each type node to a higher ranking attribute node if there is one and writes the pointer into the second item of type nodes. If there is no subelement, a null pointer is written into the second item of type nodes. As shown in Fig. 7, for example, "INTEGER", "IA5String", and "SEQUENCE" are written into the first item of the type nodes tt 11, tt 12 and tt 14, respectively, and a null pointer is written into the second item of type nodes tt 11 and tt 12 and a pointer to attribute node ea 13 is written into the second item of type node tt 14. In this way, attribute node and type nodes are linked in tree form. In operations block 14, the C-language declaration sentence generating means 6 traces the links between the various nodes and generates character strings written in the C-programming language as shown in Fig. 8 which are available as an output of the data structuring apparatus 10 to be processed in a C-language program. As a result, protocols structured in accordance with the present invention can be directly processed by computers, eliminating the need for developing programs which would involve intensive development effort and the need for excessive overhead for syntax recognition.

Claims: A data structuring apparatus comprising: a scanner (1) for decomposing input character strings of OSI (Open Systems Interconnection reference model) application layer protocol data containing keywords representative of attributes of said types, said attributes having associative relationships with said types and having different hierarchical relationships among said attributes; keyword detector means (2) for detecting the type-representative keywords and the attribute-representative keywords from said decomposed character strings; node generator means (3, 4) for creating a plurality of first nodes (tt11, tt12, tt14, Fig. 7) corresponding to the detected type-representative keywords, creating a plurality of second nodes (ea11, ea12, ea13, ea14) each providing a pointer to a corresponding first node according to said associative relationships, said second nodes either corresponding to the detected attribute-representative keywords (ea11) or, where no such attribute-representative keyword was detected, corresponding to attribute values implicitly equal to zero (ea12, ea13, ea14, Fig. 7), and providing pointers in the first nodes and the second nodes according to all said hierarchical relationships of said attributes so that said pointers indicate connective interrelationships of all of said first and second nodes; link generator means (5) for associating all of said first and second nodes according to said pointers and establishing links among said first and second nodes so that all of said first and second nodes are interconnected by said links in a tree structure; and means (6) for tracing the links of said tree structure and translating said input character strings into a declaration sentence of a computer programming language. A method of structuring data, comprising the steps of: a) decomposing input character strings of OSI (Open Systems Interconnection reference model) application layer protocol data containing keywords representative of attributes of said types, said attributes having associative relationships with said types and having different hierarchical relationships among said attributes; b) detecting the type-representative keywords and the attribute-representative keywords from said decomposed character strings; c) creating a plurality of first nodes (tt11, tt12, tt14, Fig. 7) corresponding to the detected type-representative keywords and a plurality of second nodes (ea11, ea12, ea13, ea14) each providing a pointer to a corresponding first node according to said associative relationships, said second nodes either corresponding to the detected attribute-representative keywords (ea11) or, where no such attribute-representative keyword was detected, corresponding to attribute values implicitly equal to zero (ea12, ea13, ea14, Fig. 7) and providing pointers in the first nodes and the second nodes according to all said hierarchical relationships of said attributes so that said pointers indicate connective interrelationships of all of said first and second nodes; d) associating all of said first and second nodes according to said pointers and establishing links among said first and second nodes so that all of said first and second nodes are interconnected by said links in a tree structure; and e) translating the input character strings into a declaration sentence of a computer programming language by tracing the links of said tree structure.

Inventors: ANEZAKI AKIHIRO, ANEZAKI, AKIHIRO
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1989
Main classification: G06F9
IPC codes: G06F13, H04L29, G06F9