CN109947995B - Automatic mapping method and system for high-level model and low-level model - Google Patents

Automatic mapping method and system for high-level model and low-level model Download PDF

Info

Publication number
CN109947995B
CN109947995B CN201910115051.1A CN201910115051A CN109947995B CN 109947995 B CN109947995 B CN 109947995B CN 201910115051 A CN201910115051 A CN 201910115051A CN 109947995 B CN109947995 B CN 109947995B
Authority
CN
China
Prior art keywords
level model
low
level
mapping
model
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.)
Active
Application number
CN201910115051.1A
Other languages
Chinese (zh)
Other versions
CN109947995A (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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201910115051.1A priority Critical patent/CN109947995B/en
Publication of CN109947995A publication Critical patent/CN109947995A/en
Priority to PCT/CN2019/124187 priority patent/WO2020164300A1/en
Application granted granted Critical
Publication of CN109947995B publication Critical patent/CN109947995B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion

Abstract

The invention discloses an automatic mapping method and system of a high-level model and a low-level model, and relates to the technical field of communication. The invention can solve the problem of difference between models when the high-level model and the low-level model are automatically mapped by setting the mapping relation file, so that the design of the high-level model is decoupled from the low-level model, and the communication equipment can use one set of general low-level model to correspond to a plurality of sets of high-level models by setting additional parameters. The mapping of the invention is compatible with a plurality of sets of high-level models such as the traditional mainstream YANG, MIB, CLI and the like. Meanwhile, the invention realizes the automatic mapping of the high-level model and the low-level model by setting the mapping relation file without encoding, saves a large amount of development cost and avoids the risk of high error rate caused by human participation.

Description

Automatic mapping method and system for high-level model and low-level model
Technical Field
The invention relates to the technical field of communication, in particular to an automatic mapping method and system of a high-level model and a low-level model.
Background
The Command Line Interface (CLI) is the most widely used network management protocol for communication devices, and has been the earliest birth. The CLI specifies the way the user interacts with the device by means of a specific syntax. The CLI model is in a tree structure, related function configurations are combined into configuration blocks through view realization, and the configuration blocks are arranged layer by layer in a progressive mode.
Simple Network Management Protocol (SNMP) was published in 1988 and is a standard Protocol published by the Internet Engineering Task Force (IETF). SNMP is widely supported by communication devices due to its early release time and standardization. SNMP uses the Information management Base (MIB) as its data model.
A Network Configuration Protocol (NETCONF) was published in 2006 and is a standard Protocol published by IETF. NETCONF has richer functions than CLI and SNMP. NETCONF uses a YANG Model (YANG Model) as its data Model. The YANG model has good readability and extensibility, and provides richer functionality than the CLI and MIB models.
Network management data models such as CLI, MIB, and YANG are collectively referred to as high-level models, and although different high-level models occur at different times and depend on different network management protocols, they have similar syntax and structure.
Terms in the high-level model:
element (element): a node containing data. Corresponding to parameters in CLI, scalar nodes in MIB and leaves in YANG;
list (list): there are multi-instance nodes, containing one or more elements. Corresponding to the view containing the keywords in the CLI, the table in the MIB and the list in the YANG;
keyword (key): one or more elements of the list instance are uniquely identified. Corresponding to the index in CLI, the index in MIB and the keyword in YANG;
container (container): a node that does not contain data may contain one or more simple or complex nodes. Corresponding to a view without keywords in CLI, nodes in MIB, and containers in YANG;
within the communication device, the communication device is managed using a unified low-level model, a generic model. The general model is characterized in that: in Class (Class), it is a flat model. The low-level model is a Protocol-neutral (Protocol-neutral) information model.
As shown in fig. 1, which shows a common network management protocol and its advanced model between a communication device and a network manager, the current communication device needs to support different network management protocols and its advanced model at the same time. Regardless of which high-level model is used, the communication device needs to be mapped to a low-level model before processing. Regardless of the configuration issued by any advanced model, it is supported to use other advanced models for acquisition, and vice versa. However, different high-level models cannot be guaranteed to correspond to the low-level models one to one due to different grammars, different supported characteristics and the like of the high-level models. Moreover, in addition to these objective reasons, in the subjective view of developers, the low-level models are usually designed with reference to the currently prevailing high-level models, and when new high-level models appear, the designed low-level models cannot completely support the new high-level models due to differences between the high-level models. Meanwhile, there may still be coupling of low-level models and high-level models. This coupling leads to the following challenges when the same set of low-level models corresponds to multiple sets of high-level models:
1. parameters in the low-level model are not present in the high-level model;
2. parameters in the low-level model become data-free nodes in the high-level model;
3. one parameter in the low-level model, there are multiple correspondences in the high-level model;
4. low-level models, in order to be compatible with one high-level model, result in incompatibility with another high-level model.
Current mappings often use manual coding of each model to address the various difference scenarios described above, but there are also a number of problems. Firstly, the difference between high-level models is processed by manual coding without universality, the abstraction degree is low, and the repeated labor degree is high; secondly, the manual coding has high error probability due to high human participation degree; thirdly, the current communication devices support a variety of scenarios, including a plurality of device forms such as PTN, digital to telecommunications, OTN, switch, SDN/NFV, etc., the number of the related models is hundreds, and the number of the related models is thousands, and each node of each model is encoded, which results in a huge development cost.
Disclosure of Invention
The present invention is directed to overcome the above-mentioned drawbacks of the background art, and provides a method and a system for automatically mapping a high-level model and a low-level model, and a multi-scene mapping between the high-level model and the low-level model.
The invention provides an automatic mapping method of a high-level model and a low-level model, which comprises the following steps:
adding extension attributes in the high-level model for supporting the mapping of the high-level model node names to the low-level model element names;
loading a mapping relation file of the high-level model and the low-level model, wherein the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of nodes of the high-level model and attributes of corresponding elements of the low-level model, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
analyzing the extended attribute of the high-level model, establishing a corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and according to the mapping relation, mapping between the high-level model and the low-level model is executed.
On the basis of the scheme, in the process of loading the mapping relation file of the high-level model and the low-level model, when 1 high-level model node corresponds to n low-level model elements, the additional parameters of the mapping relation file comprise n preset conditions and n corresponding mapping updating actions;
when n high-level model nodes correspond to 1 low-level model element, the additional parameters of the mapping relation file of each high-level model node all include 1 preset condition +1 corresponding mapping updating action.
On the basis of the scheme, the attributes of the high-level model nodes comprise node names, types and paths, and the attributes of the low-level model elements comprise class names, element names, types, descriptions and value ranges.
On the basis of the scheme, the preset conditions comprise values, combinations and positions of single or multiple parameters of the high-level model or the low-level model; and when the preset condition is not specified, the default condition is satisfied, and the corresponding mapping updating action is directly executed.
On the basis of the scheme, the high-level model comprises a YANG model, an MIB model and a CLI model.
The present invention also provides an automatic mapping system of a high-level model and a low-level model, comprising:
an extended attribute adding module for adding extended attributes in the high-level model for supporting mapping of high-level model node names to low-level model element names;
the mapping relation file loading module is used for loading a mapping relation file of the high-level model and the low-level model, the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of nodes of the high-level model and attributes of corresponding elements of the low-level model, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
the mapping relation generation module is used for analyzing the extended attribute of the high-level model, establishing the corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and the mapping module is used for executing mapping between the high-level model and the low-level model according to the mapping relation.
On the basis of the scheme, in the process of loading the mapping relation file of the high-level model and the low-level model by the mapping relation file loading module, when 1 high-level model node corresponds to n low-level model elements, the additional parameters of the mapping relation file comprise n preset conditions and n corresponding mapping updating actions;
when n high-level model nodes correspond to 1 low-level model element, the additional parameters of the mapping relation file of each high-level model node all include 1 preset condition +1 corresponding mapping updating action.
On the basis of the scheme, the attributes of the high-level model nodes comprise node names, types and paths, and the attributes of the low-level model elements comprise class names, element names, types, descriptions and value ranges.
On the basis of the scheme, the preset conditions comprise values, combinations and positions of single or multiple parameters of the high-level model or the low-level model; and when the preset condition is not specified, the default condition is satisfied, and the corresponding mapping updating action is directly executed.
On the basis of the scheme, the high-level model comprises a YANG model, an MIB model and a CLI model.
Compared with the prior art, the invention has the following advantages:
(1) the invention can solve the problem of difference between models when the high-level model and the low-level model are automatically mapped by setting the mapping relation file, so that the design of the high-level model is decoupled from the low-level model, and the communication equipment can use one set of general low-level model to correspond to a plurality of sets of high-level models by setting additional parameters. The mapping of the invention is compatible with a plurality of sets of high-level models such as the traditional mainstream YANG, MIB, CLI and the like.
(2) According to the invention, the automatic mapping of the high-level model and the low-level model is realized by setting the mapping relation file, coding is not required, a large amount of development cost is saved, and the risk of high error rate caused by human participation is avoided.
Drawings
FIG. 1 is a diagram of a background art high-level model and low-level model mapping scenario;
FIG. 2 is a flow diagram illustrating a method for automatic mapping of high-level models to low-level models, in accordance with an embodiment of the present invention;
FIG. 3 is a diagram illustrating the correspondence between CLI high-level models and low-level models according to an embodiment of the present invention;
FIG. 4 is a flow diagram illustrating a method for automatic mapping of CLI high-level models to low-level models, in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of CLI high-level model to low-level model data mapping according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a many-to-one correspondence between YANG high-level models and low-level models according to an embodiment of the present invention;
FIG. 7 is a flow diagram of a many-to-one automatic mapping method of YANG high-level models to low-level models according to an embodiment of the present invention;
FIG. 8 is a schematic illustration of a many-to-one mapping of a YANG high level model to low level model data for an embodiment of the present invention;
FIG. 9 is a schematic diagram of a one-to-many correspondence between YANG high-level models and low-level models of an embodiment of the present invention;
FIG. 10 is a flow diagram illustrating a one-to-many automatic mapping method of a YANG high level model to a low level model in accordance with an embodiment of the present invention;
FIG. 11 is a schematic diagram of a one-to-many mapping of a YANG high level model to low level model data in accordance with an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments.
Referring to fig. 2, an embodiment of the present invention provides an automatic mapping method for a high-level model and a low-level model, including the following steps:
s1, adding extension attributes in the high-level model for supporting the mapping from the node name of the high-level model to the element name of the low-level model;
s2, loading a mapping relation file of the high-level model and the low-level model, wherein the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of the high-level model nodes and attributes of corresponding low-level model elements, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
s3, analyzing the extended attribute of the high-level model, establishing the corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and S4, executing the mapping between the high-level model and the low-level model according to the mapping relation.
The first implementation scenario of the present application is the automatic mapping of the CLI high-level model to the low-level model.
As shown in fig. 3, it shows a correspondence relationship between the CLI high-level model and the low-level model of the constraint path (explicit path) configuration. Because the low-level model is designed by fully referring to the CLI high-level model, the CLI high-level model and the CLI high-level model are in one-to-one correspondence.
With the automatic mapping method in the present application, as shown in fig. 4, the specific process is as follows:
step A1, add extended attributes to CLI high-level models to support the CLI high-level model to low-level model mapping capability.
Step A2, when the program is started, the low-level model file is loaded, and the low-level model is built in the memory.
Step A3, when the program is started, loading the mapping relation file of the CLI high-level model and the CLI low-level model. The mapping file comprises names, indexes, include/exclude of CLI high-level models, names, types, PATHs of ip-address nodes and the required parameters of EXPLICIT-PATH types, NEXTHOP type names, element names, types, descriptions, value ranges, additional parameters and the like in the corresponding low-level models.
Step A4, when the program is started, loading a CLI high-level model file, constructing a CLI high-level model tree in a memory, analyzing the extended attributes of the CLI high-level model, constructing the corresponding relation between the CLI high-level model node and the low-level model element name, acquiring all the attributes of the low-level model element corresponding to the CLI high-level model node from the mapping file in the step A3 according to the corresponding relation, binding the attributes of the low-level model element with the attributes of the CLI high-level model node in the memory, and finishing the registration of the corresponding relation between the CLI high-level model node and the elements in the low-level model. As indicated by the arrows in fig. 3.
Step a5, when the device receives a request for mapping the CLI high-level model to the low-level model, for example, for configuration editing of the CLI high-level model, as shown in fig. 4, traverse each node of the CLI high-level model used in the configuration editing message, construct the low-level model according to the mapping relationship registered in the memory, and convert it into configuration editing of the low-level model.
Step a6, when the device receives a request for mapping the low-level model to the CLI-level model, for example, for configuration or status reading of the CLI-level model, the device obtains data from the low-level model, and constructs the CLI-level model according to the mapping relationship registered in the memory.
As a preferred embodiment, step a1 specifically includes the following steps:
step A101, the CLI advanced model is converted into XML form representation.
<node=”explicit name”/>
Step A102, adding an extended attribute class and an element in the XML, and labeling the class name and the element name of the corresponding low-level model.
<node=”explicit name”class=”EXPLICIT-PATH”element=”name”/>
As a preferred embodiment, step a4 specifically includes the following steps:
step A401, when loading a CLI high-level model, traversing each node of a CLI high-level model tree to obtain the extended attribute of each node, and obtaining the corresponding relation between the CLI high-level model node name and the low-level model class name and the element name;
step A402, binding necessary parameters of the type, description, value range and additional parameters of the low-level model type name and the element name in the corresponding relation obtained in the step A3;
step A403, the child nodes in the CLI advanced model tree need to add the keywords of the father node into the context. Adding the name element of the EXPLICIT-PATH class into the context of the NEXTHOP class.
As a preferred embodiment, step a5 specifically includes the following steps:
step A501, the device reads the data message of the CLI advanced model, traverses each corresponding node according to the principle of the forward traversal, and generates a data tree, as shown in the left side of FIG. 5;
step A502, extracting corresponding low-level model parameters according to the registered corresponding relation in step A4;
step a503, according to the additional parameters in the corresponding relation in step a4, selecting the parameters of the low-level model that satisfy the preset conditions, and converting the data of each node in the data tree into the data of the low-level model, as shown in the right side of fig. 5. Because the CLI high-level models correspond to the low-level models one-to-one, no additional parameters are required;
step A504, packing the final low-level model data EXPLICIT-PATH class and NEXTHOP class according to the low-level model class.
As a preferred embodiment, step a6 specifically includes the following steps:
step A601, the device traverses the data specified by the acquisition operation from the low-level model, as shown in the right side of FIG. 5;
step A602, according to the registered corresponding relation in step A4, taking out the corresponding CLI advanced model path;
step A603, selecting a path meeting preset conditions according to the additional parameters in the corresponding relation in step A4, and constructing a CLI advanced model tree node by node from a father to a son starting from a root node of the path, as shown in the left side of FIG. 5;
step A604, when the data of one low-level model class is constructed, constructing the next low-level model class until all classes are constructed.
The second implementation scenario of the present application is a many-to-one automatic mapping of the YANG high level model to the low level model.
Since the CLI high level model is known earlier than the YANG high level model, the low level model of the device is designed according to the CLI model. In the low-level model, the constraint parameter is used to store the (include | exception) parameter in the CLI model, and the value is one of the two parameters. However, in YANG, the data types of include and exccle are containers, i.e., no data; and the two are separated and are not the same parameter any more. The difference between the two high-level models arises and the low-level model cannot guarantee a one-to-one correspondence with both.
FIG. 6 is a many-to-one correspondence of the low-level model of the constraint path to the YANG high-level model. It can be seen that the solid arrows in the figure indicate that two nodes in the YANG high level model correspond to one node in the low level model. In addition, the dotted arrow portion of the figure indicates that the elements in the low level model become containers without data in the YANG high level model.
The embodiment mainly shows how to solve the solution of mapping different high-level models to the same set of low-level models, as shown in fig. 7, the specific flow is as follows:
step B1, add extended attributes to the high-level model to support the mapping capability of the high-level model to the low-level model.
And step B2, loading the low-level model file when the program is started, and constructing the low-level model in the memory.
And step B3, loading the mapping relation file of the high-level model and the low-level model when the program is started. The mapping file comprises names, indexes and names, types and PATHs of the name, index and ip-address nodes of the YANG high-level model and necessary parameters such as an EXPLICIT-PATH class, a NEXTHOP class name, an element name, a type, a description, a value range, additional parameters and the like in the corresponding low-level model.
And B4, loading the high-level model file when the program is started, constructing a high-level model tree in the memory, analyzing the extended attributes of the high-level model, constructing the corresponding relation between the high-level model node and the low-level model element names, acquiring all the attributes of the low-level model element corresponding to the high-level model node from the mapping file in the step B3 according to the corresponding relation, binding the low-level model element attributes with the high-level model node attributes in the memory, and finishing the registration of the corresponding relation between the high-level model node and the elements in the low-level model. As indicated by the arrows in fig. 6.
Step B5, when the device receives the request of mapping the high-level model to the low-level model, for example, for the configuration edit of the high-level model, traverse each node of the high-level model used by the configuration edit message, construct the low-level model according to the mapping relation registered in the memory, and convert it into the configuration edit of the low-level model.
Step B6, when the device receives the request for mapping the low-level model to the high-level model, for example, for the configuration or status reading of the high-level model, the device obtains data from the low-level model, and constructs the high-level model according to the mapping relationship registered in the memory.
As a preferred embodiment, step B1 specifically includes the following steps:
and step B101, converting the high-level model into an XML form for representation. In order to embody the hierarchical structure, the unimportant parameters are cut.
Figure GDA0002765303940000121
And step B102, adding extension attribute in the XML, and labeling the class name and the element name of the corresponding low-level model.
Figure GDA0002765303940000122
Figure GDA0002765303940000131
As a preferred embodiment, step B4 specifically includes the following steps:
step B401, when the high-level model is loaded, traversing each node of the high-level model tree to obtain the extended attribute of each node, and obtaining the corresponding relation between the node name of the high-level model and the class name and the element name of the low-level model;
step B402, binding necessary parameters of the type, description, value range and additional parameters of the low-level model type name and the element name in the corresponding relation obtained in the step B3;
in step B403, the child nodes in the high-level model tree need to add the keywords of the parent node into the context. Adding the name element of the EXPLICIT-PATH class into the context of the NEXTHOP class.
As a preferred embodiment, step B5 specifically includes the following steps:
step B501, the device reads the data message of the advanced model, traverses each corresponding node according to the principle of forward traversal, and generates a data tree, as shown in the left side of FIG. 8;
step B502, extracting corresponding low-level model parameters according to the registered corresponding relation in step B4;
and step B503, selecting the parameters of the low-level model meeting the preset conditions according to the additional parameters in the corresponding relation in the step B4, and converting the data of each node in the data tree into the data of the low-level model. Since the constraint element in the low-level model corresponds to a container type without data in the YANG high-level model, the YANG does not issue the value of the constraint element. By adding parameters, the include and the include containers in the YANG high level model can be supplemented with data down to the low level model. For the exception container of the YANG high-level model, the action of assigning an exception to the constraint element of the low-level model is executed by default without meeting the preset condition. The additional parameters are expressed as follows:
<paddedPara class=”NEXTHOP”element=”constraint”value=”exclude”>
similarly, for the include container of the YANG high-level model, the default execution is to complement the constraint element of the low-level model with the assignment include action without satisfying the preset condition. The additional parameters are expressed as follows:
<paddedPara class=”NEXTHOP”element=”constraint”value=”include”>
and step B504, finishing the processing of the additional parameters, and packing the final low-level model data EXPLICIT-PATH class and NEXTHOP class according to the low-level model class after the constraint value is supplemented.
As a preferred embodiment, step B6 specifically includes the following steps:
step B601, the device traverses the data specified by the acquisition operation from the low-level model, as shown in the right side of FIG. 8;
step B602, taking out the corresponding advanced model path according to the registered corresponding relation in step B4;
and step B603, selecting a path meeting preset conditions according to the additional parameters in the corresponding relation in the step B4, and constructing a high-level model tree node by node from a father to a son from a root node of the path. For an ip-address element in a low-level model, which corresponds to a path in a YANG high-level model, there are two possibilities: ip-address leaves located in include containers, or ip-addresses leaves located in include containers. Which path is specifically selected can be judged according to the value of the constraint element in the low-level model. When a preset condition that the constraint element value in the low-level model is equal to the exception is met, the ip-address element of the low-level model is positioned in the exception container of the YANG high-level model; when the preset condition "constraint element value in low level model equals include" is satisfied, the ip-address element of the low level model is located in include container of YANG high level model. The above-mentioned judgment logic is implemented in the additional parameters of the correspondence relationship, and is expressed in the following manner. The path is written in XPATH syntax.
<when condition=”constraint=‘exclude’”
path=”/explicit-paths/explicit-path/nexthop/exclude”/>
<when condition=”constraint=‘include’”
path=”/explicit-paths/explicit-path/nexthop/include”/>
Step B604, when the construction of the data of the EXPLICIT-PATH low-level model class is completed, constructing the NEXTHOP low-level model class until all classes are constructed.
The third implementation scenario of the present application is a one-to-many automatic mapping of the YANG high level model to the low level model.
The present embodiment takes a model of an interface as an example. In the YANG high level model, the interface list contains the management of all types of interfaces. In the low-level model, each type of interface has its own separate class, such as an Ethernet interface, a Flexible Ethernet (FlexE) interface, and so on. Because of the differences in attributes of different types of interfaces, the low-level model is designed in a manner that facilitates maintaining attributes specific to a particular interface type. The design mode of the YANG high-level model abstracts all interfaces into an interface list, so that the interfaces can be managed uniformly.
FIG. 9 is a one-to-many correspondence of the low-level model of the interface to the YANG high-level model. It can be seen that the solid arrows in the figure indicate that one node in the YANG high level model corresponds to two nodes in the low level model.
The embodiment mainly shows how the solution of mapping different low-level models by a high-level model is solved, as shown in fig. 10, the specific flow is as follows:
step C1, add extended attributes to the high-level model to support the mapping capability of the high-level model to the low-level model.
And step C2, loading the low-level model file when the program is started, and constructing the low-level model in the memory.
And step C3, loading the mapping relation file of the high-level model and the low-level model when the program is started. The mapping file comprises the name, type and path of the name node of the YANG high-level model and necessary parameters such as ETHERNET-IF class, FLEXE-IF class name, element name, type, description, value range, additional parameters and the like in the corresponding low-level model.
And step C4, when the program is started, loading the high-level model file, constructing a high-level model tree in the memory, analyzing the extended attributes of the high-level model, constructing the corresponding relation between the high-level model node and the low-level model element names, acquiring all the attributes of the low-level model element corresponding to the high-level model node from the mapping file in the step C3 according to the corresponding relation, binding the low-level model element attributes and the high-level model node attributes in the memory, and finishing the registration of the corresponding relation between the high-level model node and the elements in the low-level model. As indicated by the arrows in fig. 9.
Step C5, when the device receives the request for mapping the high-level model to the low-level model, for example, for the configuration edit of the high-level model, traverse each node of the high-level model used by the configuration edit message, construct the low-level model according to the mapping relation registered in the memory, and convert it into the configuration edit of the low-level model.
Step C6, when the device receives a request for mapping the low-level model to the high-level model, for example, for configuration or status reading of the high-level model, the device obtains data from the low-level model, and constructs the high-level model according to the mapping relationship registered in the memory.
As a preferred embodiment, step C1 specifically includes the following steps:
and step C101, converting the high-level model into an XML form for representation. In order to embody the hierarchical structure, the unimportant parameters are cut.
Figure GDA0002765303940000171
And step C102, adding extension attribute in the XML, and labeling the class name and the element name of the corresponding low-level model.
Figure GDA0002765303940000172
Figure GDA0002765303940000181
As a preferred embodiment, step C4 specifically includes the following steps:
step C401, when the high-level model is loaded, traversing each node of the high-level model tree, obtaining the extended attribute of each node, and obtaining the corresponding relation between the node name of the high-level model and the class name and the element name of the low-level model;
the extended attribute means that when the content of the name field starts with ETHERNET, it is mapped to the ETHERNET-IF class, and when the content of the name field starts with FLEXE, it is mapped to the FLEXE-IF class
Step C402, binding necessary parameters of the type, description, value range and additional parameters of the low-level model type name and the element name in the corresponding relation obtained in the step C3;
as a preferred embodiment, step C5 specifically includes the following steps:
step C501, the device reads the data packet of the high-level model, traverses each corresponding node according to the principle of forward traversal, and generates a data tree, as shown in the left side of fig. 11;
step C502, extracting the corresponding low-level model parameters according to the correspondence registered in step C4;
step C503, according to the additional parameters in the corresponding relationship in step C4, selecting the low-level model parameters meeting the preset conditions, i.e. ETHERNET-IF classes, and converting the data of each node in the data tree into the data of the low-level model.
And step C504, packaging the final low-level model data ETHERNET-IF class according to the low-level model class.
As a preferred embodiment, step C6 specifically includes the following steps:
step C601, the device traverses the data specified by the acquisition operation from the low-level model, as shown in the right side of FIG. 11;
step C602, according to the registered corresponding relation in step C4, taking out the corresponding advanced model path;
and step C603, selecting a path meeting the preset condition according to the additional parameters in the corresponding relation in the step C4, and constructing a high-level model tree node by node from a father to a son from a root node of the path. For the name element in the low level model, it is unique to correspond to the path in the YANG high level model.
An embodiment of the present invention further provides an automatic mapping system for a high-level model and a low-level model, including:
an extended attribute adding module for adding extended attributes in the high-level model for supporting mapping of high-level model node names to low-level model element names;
the mapping relation file loading module is used for loading a mapping relation file of the high-level model and the low-level model, the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of nodes of the high-level model and attributes of corresponding elements of the low-level model, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
the mapping relation generation module is used for analyzing the extended attribute of the high-level model, establishing the corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and the mapping module is used for executing mapping between the high-level model and the low-level model according to the mapping relation.
As a preferred embodiment, in the process of loading the mapping relationship file between the high-level model and the low-level model by the mapping relationship file loading module, when 1 high-level model node corresponds to n low-level model elements, the additional parameters of the mapping relationship file include n preset conditions + n corresponding mapping update actions;
when n high-level model nodes correspond to 1 low-level model element, the additional parameters of the mapping relationship file of each high-level model node include 1 preset condition +1 corresponding mapping update action.
As a preferred embodiment, the attributes of the high-level model node include node name, type, and path, and the attributes of the low-level model element include class name, element name, type, description, and value range.
In a preferred embodiment, the preset conditions include values, combinations and positions of single or multiple parameters of the high-level model or the low-level model; and when the preset condition is not specified, the default condition is satisfied, and the corresponding mapping updating action is directly executed.
In a preferred embodiment, the high-level models include a YANG model, a MIB model, and a CLI model.
Various modifications and variations of the embodiments of the present invention may be made by those skilled in the art, and they are also within the scope of the present invention, provided they are within the scope of the claims of the present invention and their equivalents. What is not described in detail in the specification is prior art that is well known to those skilled in the art.

Claims (10)

1. A method for automatic mapping of high-level models to low-level models, comprising the steps of:
when the high-level model is converted into an XML form to express or construct a high-level model tree, adding an extended attribute in the high-level model for supporting the mapping from the node name of the high-level model to the element name of the low-level model;
loading a mapping relation file of the high-level model and the low-level model, wherein the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of nodes of the high-level model and attributes of corresponding elements of the low-level model, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
analyzing the extended attribute of the high-level model, establishing a corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and according to the mapping relation, mapping between the high-level model and the low-level model is executed.
2. The method of claim 1, wherein: in the process of loading the mapping relation file of the high-level model and the low-level model, when 1 high-level model node corresponds to n low-level model elements, the additional parameters of the mapping relation file comprise n preset conditions and n corresponding mapping updating actions;
when n high-level model nodes correspond to 1 low-level model element, the additional parameters of the mapping relation file of each high-level model node all include 1 preset condition +1 corresponding mapping updating action.
3. The method of claim 1, wherein: the attributes of the high-level model nodes comprise node names, types and paths, and the attributes of the low-level model elements comprise class names, element names, types, descriptions and value ranges.
4. The method of claim 1, wherein: the preset conditions comprise values, combinations and positions of single or multiple parameters of the high-level model or the low-level model; and when the preset condition is not specified, the default condition is satisfied, and the corresponding mapping updating action is directly executed.
5. The method of claim 1, wherein: the advanced models include a YANG model, an MIB model, and a CLI model.
6. A system for automatic mapping of high-level models to low-level models, comprising:
the extended attribute adding module is used for adding extended attributes in the high-level model when the high-level model is converted into an XML form to represent or construct a high-level model tree, and is used for supporting the mapping from the node names of the high-level model to the element names of the low-level model;
the mapping relation file loading module is used for loading a mapping relation file of the high-level model and the low-level model, the mapping relation file comprises necessary parameters and additional parameters, the necessary parameters comprise attributes of nodes of the high-level model and attributes of corresponding elements of the low-level model, the additional parameters comprise preset conditions and corresponding mapping updating actions, and when the preset conditions are met, the corresponding mapping updating actions are executed;
the mapping relation generation module is used for analyzing the extended attribute of the high-level model, establishing the corresponding relation between the name of the node of the high-level model and the name of the element of the low-level model, binding the attribute and the additional parameter of the element of the low-level model with the attribute of the node of the high-level model according to the mapping relation file, and generating the mapping relation between the node of the high-level model and the element of the low-level model;
and the mapping module is used for executing mapping between the high-level model and the low-level model according to the mapping relation.
7. The system of claim 6, wherein: in the process of loading the mapping relation file of the high-level model and the low-level model by the mapping relation file loading module, when 1 high-level model node corresponds to n low-level model elements, the additional parameters of the mapping relation file comprise n preset conditions and n corresponding mapping updating actions;
when n high-level model nodes correspond to 1 low-level model element, the additional parameters of the mapping relationship file of each high-level model node include 1 preset condition +1 corresponding mapping update action.
8. The system of claim 6, wherein: the attributes of the high-level model nodes comprise node names, types and paths, and the attributes of the low-level model elements comprise class names, element names, types, descriptions and value ranges.
9. The system of claim 6, wherein: the preset conditions comprise values, combinations and positions of single or multiple parameters of the high-level model or the low-level model; and when the preset condition is not specified, the default condition is satisfied, and the corresponding mapping updating action is directly executed.
10. The system of claim 6, wherein: the advanced models include a YANG model, an MIB model, and a CLI model.
CN201910115051.1A 2019-02-14 2019-02-14 Automatic mapping method and system for high-level model and low-level model Active CN109947995B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910115051.1A CN109947995B (en) 2019-02-14 2019-02-14 Automatic mapping method and system for high-level model and low-level model
PCT/CN2019/124187 WO2020164300A1 (en) 2019-02-14 2019-12-10 Automatic mapping method and system for high-level model and low-level model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910115051.1A CN109947995B (en) 2019-02-14 2019-02-14 Automatic mapping method and system for high-level model and low-level model

Publications (2)

Publication Number Publication Date
CN109947995A CN109947995A (en) 2019-06-28
CN109947995B true CN109947995B (en) 2020-12-15

Family

ID=67007610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910115051.1A Active CN109947995B (en) 2019-02-14 2019-02-14 Automatic mapping method and system for high-level model and low-level model

Country Status (2)

Country Link
CN (1) CN109947995B (en)
WO (1) WO2020164300A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947995B (en) * 2019-02-14 2020-12-15 烽火通信科技股份有限公司 Automatic mapping method and system for high-level model and low-level model
CN110460461B (en) * 2019-07-10 2022-01-11 烽火通信科技股份有限公司 Mapping method and system from YANG mode language to command line
CN110474794B (en) * 2019-07-10 2021-04-27 烽火通信科技股份有限公司 Information conversion method and system of SDN framework
CN112583630B (en) 2019-09-29 2022-07-12 华为技术有限公司 Device management method, device, system, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1632794A (en) * 2004-12-27 2005-06-29 中国科学院软件研究所 Method for mapping XML type to RDB table
US8849873B2 (en) * 2009-03-18 2014-09-30 Bentley Systems, Incorporated Specifications automation system and method
CN104243198A (en) * 2013-06-21 2014-12-24 中兴通讯股份有限公司 Network management method and system based on network configuration protocol
CN104850623A (en) * 2015-05-19 2015-08-19 杭州迅涵科技有限公司 Dynamic extension method and system for multidimensional data analysis model
CN105912665A (en) * 2016-04-12 2016-08-31 清华大学 Method for model conversion and data migration of Neo4j to relational database
CN107315768A (en) * 2017-05-17 2017-11-03 上海交通大学 The distribution information interacting method and system mapped based on Heterogeneous Information model
CN108363545A (en) * 2017-01-26 2018-08-03 华为技术有限公司 A kind of data configuration method and data configuration device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9462006B2 (en) * 2015-01-21 2016-10-04 Palo Alto Research Center Incorporated Network-layer application-specific trust model
CN106559251B (en) * 2015-09-30 2019-03-15 中兴通讯股份有限公司 A kind of Compilation Method and corresponding interface, component and system based on YANG model
CN109947995B (en) * 2019-02-14 2020-12-15 烽火通信科技股份有限公司 Automatic mapping method and system for high-level model and low-level model

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1632794A (en) * 2004-12-27 2005-06-29 中国科学院软件研究所 Method for mapping XML type to RDB table
US8849873B2 (en) * 2009-03-18 2014-09-30 Bentley Systems, Incorporated Specifications automation system and method
CN104243198A (en) * 2013-06-21 2014-12-24 中兴通讯股份有限公司 Network management method and system based on network configuration protocol
CN104850623A (en) * 2015-05-19 2015-08-19 杭州迅涵科技有限公司 Dynamic extension method and system for multidimensional data analysis model
CN105912665A (en) * 2016-04-12 2016-08-31 清华大学 Method for model conversion and data migration of Neo4j to relational database
CN108363545A (en) * 2017-01-26 2018-08-03 华为技术有限公司 A kind of data configuration method and data configuration device
CN107315768A (en) * 2017-05-17 2017-11-03 上海交通大学 The distribution information interacting method and system mapped based on Heterogeneous Information model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于本体差异化分析的信息模型映射技术";杜哲 等;《电网技术》;20150630;第39卷(第6期);1525-1531 *

Also Published As

Publication number Publication date
CN109947995A (en) 2019-06-28
WO2020164300A1 (en) 2020-08-20

Similar Documents

Publication Publication Date Title
CN109947995B (en) Automatic mapping method and system for high-level model and low-level model
US11924068B2 (en) Provisioning a service
US10419285B2 (en) Configuration management device, configuration interface device and method for vendor-independent network device configuration
CN102447585B (en) Method and device for converting network configuration protocol response message into command line
EP1696606B1 (en) Service framework for home network
JP2007524939A (en) Automatic update system and method using meta MIB
CN101156379B (en) Method and system for selecting service quality policy
WO2013063950A1 (en) Inspection method and system of multimode communication device
US10495336B2 (en) Energy operations across domains
CN105591825B (en) The method of modification configuration in household gateway update
WO2016107397A1 (en) System and method for model-based search and retrieval of networked data
Rojas From software-defined to human-defined networking: Challenges and opportunities
US20150127798A1 (en) Object version management
US10680852B2 (en) Configuration of a managed device
CN113016162A (en) Configuration of networked devices
CN112398683B (en) Configuration method and device of multi-device hybrid networking supporting yang protocol
US11500690B2 (en) Dynamic load balancing in network centric process control systems
CN111740851B (en) Configuration message generation method, device and system
CN104320718B (en) It is a kind of to avoid multiple DMC from pushing the method and device that media play produces conflict
CN105207811B (en) Method and device for replacing non-AllJoyn equipment
CN101166108B (en) Method for a distributed task dispatching soft bus with dynamic scalability
CN115065594B (en) Data configuration method, device, apparatus, readable storage medium and program product
WO2022041279A1 (en) Device management method and apparatus in internet of things, computer device and storage medium
WO2023050815A1 (en) Slice service configuration method, network device, network system, and storage medium
WO2023065218A1 (en) Mapping relationship generation method and apparatus and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant