WO2020164300A1 - 一种高级模型与低级模型的自动映射方法及系统 - Google Patents
一种高级模型与低级模型的自动映射方法及系统 Download PDFInfo
- Publication number
- WO2020164300A1 WO2020164300A1 PCT/CN2019/124187 CN2019124187W WO2020164300A1 WO 2020164300 A1 WO2020164300 A1 WO 2020164300A1 CN 2019124187 W CN2019124187 W CN 2019124187W WO 2020164300 A1 WO2020164300 A1 WO 2020164300A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- level model
- low
- level
- model
- mapping
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information 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/81—Indexing, e.g. XML tags; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information 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/84—Mapping; Conversion
Definitions
- the invention relates to the field of communication technology, in particular to a method and system for automatically mapping a high-level model and a low-level model.
- Command Line Interface is the most widely used network management protocol for communication equipment, and it was born the earliest.
- the CLI defines the way of interaction between the user and the device through a specific syntax.
- the CLI model is in a tree structure, and related functional configurations are combined into configuration blocks through views, and the configuration blocks are progressively advanced.
- SNMP Simple Network Management Protocol
- IETF Internet Engineering Task Force
- MIB Information Management Base
- NETCONF Network Configuration Protocol
- CLI and SNMP The Network Configuration Protocol
- NETCONF uses YANG Model as its data model. The YANG model has good readability and scalability. Compared with the CLI and MIB models, it provides richer functions.
- CLI, MIB, YANG and other network management data models are collectively referred to as advanced models. Although different advanced models were born at different times and depend on different network management protocols, they have similar syntax and structure.
- Element A node that contains data.
- CLI scalar nodes in MIB, leaves in YANG;
- List A node with multiple instances, containing one or more elements.
- list A node with multiple instances, containing one or more elements.
- list corresponding to the view with keywords in CLI, the table in MIB, and the list in YANG;
- Container A node that does not contain data and can contain one or more simple or complex nodes. Corresponding to views without keywords in CLI, nodes in MIB, and containers in YANG;
- a unified low-level model-a general model is used to manage the communication equipment.
- the feature of this general model is that it is a flat model with a class as a unit.
- the low-level model is an information model that has nothing to do with the network management protocol (Protocol-neutral).
- FIG 1 it shows the commonly used network management protocols and their high-level models between communication devices and network managers.
- Current communication devices need to support different network management protocols and their high-level models at the same time.
- the configuration issued must be able to support the use of other advanced models for acquisition, and vice versa.
- the design of low-level models usually takes the mainstream high-level models as a reference from the subjective point of the developer.
- the parameters in the low-level model become nodes without data in the high-level model
- a parameter in the low-level model has multiple correspondences in the high-level model
- the low-level model is incompatible with another high-level model in order to be compatible with a certain high-level model.
- the current mapping mostly uses manual coding for each model to solve the above-mentioned different scenarios, but there are also many problems.
- manual coding does not have universality in handling differences between advanced models, with low abstraction and high repetitive work;
- manual coding has a high probability of error due to a high degree of human involvement;
- third, current communication equipment supports There are many scenarios, including PTN, data communication, OTN, switch, SDN/NFV and other equipment forms.
- the number of models involved ranges from hundreds to thousands. Each node of each model is coded and developed. The cost is huge.
- the purpose of the present invention is to overcome the shortcomings of the above-mentioned background technology and provide an automatic mapping method and system for high-level models and low-level models, and multi-scene mapping for high-level models and low-level models.
- the present invention provides an automatic mapping method between a high-level model and a low-level model, including the following steps:
- the mapping relationship file includes the required parameters and additional parameters.
- the required parameters include the attributes of the high-level model nodes and the attributes of the corresponding low-level model elements.
- the additional parameters include the preset conditions and the corresponding mapping update actions. , When the preset conditions are met, execute the corresponding mapping update action;
- Analyze the extended attributes of the high-level model establish the corresponding relationship between the name of the high-level model node and the name of the low-level model element, and bind the attributes and additional parameters of the low-level model element with the attributes of the high-level model node according to the mapping relationship file to generate the high-level model node and the low-level model node
- the mapping relationship of model elements
- mapping relationship the mapping between the high-level model and the low-level model is performed.
- the additional parameters of the mapping file include n preset conditions + n The corresponding mapping update action
- the additional parameters of the mapping relationship file of each high-level model node include 1 preset condition + 1 corresponding mapping update action.
- the attributes of the high-level model node include node name, type, and path
- the attributes of the low-level model element include class name, element name, type, description, and value range.
- the preset conditions include the value, combination, and location of single or multiple parameters of the high-level model or the low-level model; when the preset conditions are not specified, the default is that the conditions are met, and the corresponding The mapping update action.
- the advanced models include YANG model, MIB model and CLI model.
- the present invention also provides an automatic mapping system for high-level models and low-level models, including:
- the extended attribute adding module is used to add extended attributes to the high-level model to support the mapping of high-level model node names to low-level model element names;
- the mapping relationship file loading module is used to load the mapping relationship file between the high-level model and the low-level model.
- the mapping relationship file includes required parameters and additional parameters.
- the required parameters include the attributes of the high-level model nodes and the attributes of the corresponding low-level model elements.
- the additional parameters include The preset conditions and the corresponding mapping update actions, when the preset conditions are met, execute the corresponding mapping update actions;
- the mapping relationship generation module is used to analyze the extended attributes of the high-level model, establish the corresponding relationship between the name of the high-level model node and the name of the low-level model element, and bind the attributes and additional parameters of the low-level model element to the attributes of the high-level model node according to the mapping relationship file Define, generate the mapping relationship between high-level model nodes and low-level model elements;
- the mapping module is used to perform the mapping between the high-level model and the low-level model according to the mapping relationship.
- mapping relationship file loading module loads the mapping relationship file between the high-level model and the low-level model
- the additional parameters of the mapping file include n Preset conditions + n corresponding mapping update actions
- the additional parameters of the mapping relationship file of each high-level model node include 1 preset condition + 1 corresponding mapping update action.
- the attributes of the high-level model node include node name, type, and path
- the attributes of the low-level model element include class name, element name, type, description, and value range.
- the preset conditions include the value, combination, and location of single or multiple parameters of the high-level model or the low-level model; when the preset conditions are not specified, the default is that the conditions are met, and the corresponding The mapping update action.
- the advanced models include YANG model, MIB model and CLI model.
- the present invention can solve the problem of the difference between the models when the high-level model and the low-level model are automatically mapped, decouple the design of the high-level model from the low-level model, and realize the use of a communication device by setting additional parameters.
- the general low-level model corresponds to multiple sets of high-level models.
- the mapping of the present invention is compatible with multiple sets of advanced models such as existing mainstream YANG, MIB and CLI.
- the present invention realizes automatic mapping between high-level models and low-level models by setting the mapping relationship file, without coding, saving a lot of development costs, and avoiding the risk of high error rate due to human participation.
- Fig. 1 is a schematic diagram of a scene of mapping a high-level model and a low-level model of the background technology
- FIG. 2 is a schematic flowchart of an automatic mapping method of a high-level model and a low-level model according to an embodiment of the present invention
- FIG. 3 is a schematic diagram of the corresponding relationship between the CLI high-level model and the low-level model according to an embodiment of the present invention
- FIG. 4 is a schematic flowchart of an automatic mapping method between a CLI high-level model and a low-level model according to an embodiment of the present invention
- FIG. 5 is a schematic diagram of data mapping between a CLI high-level model and a low-level model according to an embodiment of the present invention
- FIG. 6 is a schematic diagram of the many-to-one correspondence between the YANG high-level model and the low-level model according to an embodiment of the present invention
- FIG. 7 is a schematic flowchart of a many-to-one automatic mapping method between a YANG high-level model and a low-level model according to an embodiment of the present invention
- FIG. 8 is a schematic diagram of a many-to-one mapping of YANG high-level model and low-level model data according to an embodiment of the present invention.
- FIG. 9 is a schematic diagram of a one-to-many correspondence between a YANG high-level model and a low-level model according to an embodiment of the present invention.
- FIG. 10 is a schematic flowchart of a one-to-many automatic mapping method between a YANG high-level model and a low-level model according to an embodiment of the present invention
- FIG. 11 is a schematic diagram of one-to-many mapping of YANG high-level model and low-level model data according to an embodiment of the present invention.
- an embodiment of the present invention provides an automatic mapping method between a high-level model and a low-level model, including the following steps:
- S1 add extended attributes to the high-level model to support the mapping of high-level model node names to low-level model element names
- the mapping relationship file includes the necessary parameters and additional parameters.
- the necessary parameters include the attributes of the high-level model node and the corresponding low-level model element.
- the additional parameters include the preset conditions and the corresponding mapping. Update action, when the preset conditions are met, execute the corresponding mapping update action;
- the first implementation scenario of this application is the automatic mapping between the CLI high-level model and the low-level model.
- FIG. 3 shows the correspondence between the CLI high-level model and the low-level model of the explicit path configuration. Because the low-level model is designed with reference to the CLI high-level model, the two correspond neatly.
- Step A1 Add extended attributes to the CLI high-level model to support the mapping capabilities of the CLI high-level model to the low-level model.
- Step A2 when the program starts, load the low-level model file and build the low-level model in the memory.
- Step A3 when the program starts, load the mapping relationship file between the CLI high-level model and the low-level model.
- the mapping file includes the name, index, include/exclude, ip-address node name, type, and path of the CLI high-level model, and the EXPLICIT-PATH class, NEXTHOP class name, element name, type, etc. in the corresponding low-level model. Description, value range, additional parameters and other necessary parameters.
- Step A4 when the program starts, load the CLI high-level model file, build the CLI high-level model tree in the memory, analyze the extended attributes of the CLI high-level model, and construct the correspondence relationship between the CLI high-level model node and the low-level model element name, and according to the corresponding relationship , Get all the attributes of the low-level model elements corresponding to the CLI high-level model node from the mapping file in step A3, bind the low-level model element attributes with the CLI high-level model node attributes in the memory, and complete the CLI high-level model node and the low-level model The registration of the corresponding relationship between the elements. As shown by the arrow in Figure 3.
- Step A5 When the device receives a request to map the CLI high-level model to the low-level model, for example, for configuration editing of the CLI high-level model, as shown in Figure 4, each node of the CLI high-level model used by the configuration editing message is traversed, according to the memory The registered mapping relationship constructs a low-level model and converts it into configuration editing of the low-level model.
- Step A6 When the device receives a request for mapping from a low-level model to a CLI high-level model, for example, for the configuration or status reading of the CLI high-level model, the device obtains data from the low-level model, and constructs the CLI high-level model according to the mapping relationship registered in the memory .
- step A1 specifically includes the following steps:
- Step A101 Convert the CLI high-level model to an XML format representation.
- Step A102 Add extended attributes class and element to XML, and mark the class name and element name of the corresponding low-level model.
- step A4 specifically includes the following steps:
- Step A401 when loading the CLI high-level model, traverse each node of the CLI high-level model tree to obtain its extended attributes, and obtain the corresponding relationship between the CLI high-level model node name and the low-level model class name and element name;
- Step A402 bind the necessary parameters of the type, description, value range, and additional parameters in the corresponding relationship obtained in step 3 through the name of the low-level model class and element name;
- Step A403 the child node in the CLI advanced model tree needs to add the keyword of the parent node to its context. Add the name element of the EXPLICIT-HOP class to the context of the NEXTHOP class.
- 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 preorder traversal, and generates a data tree, as shown in the left side of Figure 5;
- Step A502 extract the corresponding low-level model parameters according to the registered correspondence in step A4;
- Step A503 according to the additional parameters in the corresponding relationship in step A4, select the low-level model parameters that meet the preset conditions, and convert the data of each node in the data tree into the data of the low-level model, as shown on the right side of Figure 5. Since the CLI high-level model corresponds to the low-level model one-to-one, no additional parameters are required;
- step A504 the final low-level model data EXPLICIT-PATH class and NEXTHOP class are packaged according to the low-level model class.
- step A6 specifically includes the following steps:
- Step A601 the device traverses the low-level model to obtain the data specified by the operation, as shown on the right side of Figure 5;
- Step A602 extract the corresponding CLI advanced model path according to the registered correspondence in step A4;
- Step A603 according to the additional parameters in the corresponding relationship in step A4, select the path that meets the preset conditions, starting from the root node of the path, and building the CLI advanced model tree node by node from parent to child, as shown on the left side of Figure 5;
- step A604 after the data construction of a low-level model class is completed, the next low-level model class is constructed until all classes are constructed.
- the second implementation scenario of this application is the many-to-one automatic mapping between the YANG high-level model and the low-level model.
- the low-level model of the device is designed according to the CLI model.
- the constraint parameter is used to store the (include
- the data type of include and exclude is a container, that is, it does not contain data; and the two are separated and no longer the same parameter. There are differences between the two high-level models, and the low-level models cannot be guaranteed to correspond to both.
- Figure 6 shows the many-to-one correspondence between the low-level model of the constraint path and the high-level YANG model. It can be seen that the solid arrow in the figure shows that two nodes in the high-level YANG model correspond to one node in the low-level model. In addition, the dotted arrow in the figure indicates that the elements in the low-level model have become containers without data in the YANG high-level model.
- This embodiment mainly reflects how this application solves the solution of mapping different high-level models from the same set of low-level models, as shown in FIG. 7, and the specific process is as follows:
- Step B1 Add extended attributes to the high-level model to enable it to support the mapping capability from the high-level model to the low-level model.
- Step B2 when the program starts, load the low-level model file, and build the low-level model in the memory.
- Step B3 when the program is started, the mapping relationship file between the high-level model and the low-level model is loaded.
- the mapping file includes the name, index, and ip-address node name, type, and path of the YANG high-level model, and the EXPLICIT-PATH class, NEXTHOP class name, element name, type, description, and value in the corresponding low-level model. Necessary parameters such as range and additional parameters.
- Step B4 When the program starts, load the high-level model file, build the high-level model tree in the memory, analyze the extended attributes of the high-level model, build the correspondence between the high-level model node and the low-level model element name, and according to the correspondence, proceed from step B3 Get all the attributes of the low-level model elements corresponding to the high-level model nodes in the mapping file, bind the low-level model element attributes with the high-level model node attributes in the memory, and complete the registration of the correspondence between the high-level model nodes and the low-level model elements. As shown by the arrow in Figure 6.
- Step B5 When the device receives a request to map a high-level model to a low-level model, for example, for configuration editing of the high-level model, it traverses each node of the high-level model used by the configuration editing message, and constructs the low-level model according to the mapping relationship registered in the memory. Model, convert it into configuration editing for low-level models.
- Step B6 When the device receives a request for mapping from a low-level model to a 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.
- step B1 specifically includes the following steps:
- Step B101 Convert the high-level model to an XML format representation. In order to reflect the hierarchical structure, unimportant parameters have been tailored.
- Step B102 Add the extension attribute extension to the XML, and mark the class name and element name of the corresponding low-level model.
- step B4 specifically includes the following steps:
- Step B401 when the high-level model is loaded, each node of the high-level model tree is traversed to obtain its extended attributes, and the corresponding relationship between the high-level model node name and the low-level model class name and element name is obtained;
- Step B402 bind the necessary parameters of the type, description, value range, and additional parameters in the corresponding relationship obtained in step B3 through the name of the low-level model class and element name;
- Step B403 the child node in the advanced model tree needs to add the keyword of the parent node to its context. Add the name element of the EXPLICIT-PATH class to the context of the NEXTHOP class.
- 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 preorder traversal, and generates a data tree, as shown in the left side of Fig. 8;
- Step B502 Take out the corresponding low-level model parameters according to the registered correspondence in step B4;
- Step B503 According to the additional parameters in the corresponding relationship in step B4, the low-level model parameters that meet the preset conditions are selected, and the data of each node in the data tree is converted into the data of the low-level model. Since the constraint element in the low-level model corresponds to the container type without data in the YANG high-level model, YANG will not issue the value of the constraint element. With additional parameters, you can add data for the include and exclude containers in the YANG high-level model to the low-level model. For the exclude container of the YANG high-level model, the action of adding the value of exclude to the constraint element of the low-level model is executed by default, without meeting the preset conditions.
- the additional parameter expression is as follows:
- the action of adding the value include to the constraint element of the low-level model is executed by default, without meeting the preset conditions.
- the additional parameter expression is as follows:
- step B504 the additional parameter processing is completed, and after the constraint value is added, the final low-level model data EXPLICIT-PATH class and NEXTHOP class are packaged according to the low-level model class.
- step B6 specifically includes the following steps:
- Step B601 the device traverses the low-level model to obtain the data specified by the operation, as shown on the right side of Figure 8;
- Step B602 extract the corresponding high-level model path according to the registered correspondence in step B4;
- Step B603 According to the additional parameters in the corresponding relationship in step B4, a path that meets the preset conditions is selected, starting from the root node of the path, and building a high-level model tree node by node from parent to child.
- a path that meets the preset conditions is selected, starting from the root node of the path, and building a high-level model tree node by node from parent to child.
- the ip-address element in the low-level model there are two possibilities for its corresponding path in the YANG high-level model: the ip-address leaf in the include container, or the ip-adress leaf in the exclude container. Which path to choose can be judged according to the value of the constraint element in the low-level model.
- the ip-address element of the low-level model is located in the exclude container of the YANG high-level model; when the preset condition “the value of the constraint element in the low-level model is equal to include” is met At the time, the ip-address element of the low-level model is located in the include container of the YANG high-level model.
- the above judgment logic is implemented in the additional parameters of the corresponding relationship and expressed in the following way. The path is written in XPATH syntax.
- step B604 after the data construction of the EXPLICIT-PATH low-level model class is completed, the NEXTHOP low-level model class is constructed again until all the classes are constructed.
- the third implementation scenario of this application is the one-to-many automatic mapping between the YANG high-level model and the low-level model.
- This embodiment takes the model of the interface as an example.
- the interface list includes management of all types of interfaces.
- each type of interface has its own separate class, such as Ethernet interface, Flexible Ethernet (Flexible Ethernet, FlexE) interface, etc. Due to the differences in the attributes of different types of interfaces, the design of low-level models is convenient for maintaining the unique attributes of a certain interface type.
- the design method of YANG advanced model abstracts all interfaces into an interface list, which is convenient for unified management of interfaces.
- Figure 9 shows the one-to-many correspondence between the low-level model of the interface and the high-level YANG model. It can be seen that the solid arrow in the figure shows that one node in the high-level YANG model corresponds to two nodes in the low-level model.
- This embodiment mainly reflects how this application solves the solution of mapping different low-level models from a high-level model, as shown in FIG. 10, the specific process is as follows:
- Step C1 Add extended attributes to the high-level model to support the mapping capability from the high-level model to the low-level model.
- Step C2 when the program starts, load the low-level model file, and build the low-level model in the memory.
- Step C3 when the program is started, the mapping relationship file between the high-level model and the low-level model is loaded.
- the mapping file includes the name, type, and path of the name node of the YANG high-level model, and the ETHERNET-IF class, FLEXE-IF class name, element name, type, description, value range, and additional parameters in the corresponding low-level model. Wait for the necessary parameters.
- Step C4 when the program starts, load the high-level model file, build the high-level model tree in the memory, analyze the extended attributes of the high-level model, build the correspondence between the high-level model node and the low-level model element name, and according to the correspondence, from step C3 Get all the attributes of the low-level model elements corresponding to the high-level model nodes in the mapping file, bind the low-level model element attributes with the high-level model node attributes in the memory, and complete the registration of the correspondence between the high-level model nodes and the low-level model elements.
- the program starts, load the high-level model file, build the high-level model tree in the memory, analyze the extended attributes of the high-level model, build the correspondence between the high-level model node and the low-level model element name, and according to the correspondence, from step C3 Get all the attributes of the low-level model elements corresponding to the high-level model nodes in the mapping file, bind the low-level model element attributes with the high-level model node attributes in the memory, and
- Step C5 When the device receives a request to map a high-level model to a low-level model, for example, for configuration editing of the high-level model, it traverses each node of the high-level model used by the configuration editing message, and constructs the low-level model according to the mapping relationship registered in the memory. Model, convert it into configuration editing for low-level models.
- Step C6 When the device receives a request for mapping from a low-level model to a 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.
- step C1 specifically includes the following steps:
- Step C101 Convert the high-level model to an XML representation. In order to reflect the hierarchical structure, unimportant parameters have been tailored.
- Step C102 Add the extension attribute extension to XML, and mark the class name and element name of the corresponding low-level model.
- step C4 specifically includes the following steps:
- Step C401 When the high-level model is loaded, each node of the high-level model tree is traversed to obtain its extended attributes, and the corresponding relationship between the high-level model node name and the low-level model class name and element name is obtained;
- the meaning of the extended attribute is 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 bind the necessary parameters of the type, description, value range, and additional parameters in the correspondence relationship obtained in step C3 through the name of the low-level model class and element name;
- step C5 specifically includes the following steps:
- Step C501 the device reads the data message of the advanced model, traverses each corresponding node according to the pre-order traversal principle, and generates a data tree, as shown in the left side of Figure 11;
- Step C502 extract the corresponding low-level model parameters according to the registered correspondence in step C4;
- Step C503 according to the additional parameters in the corresponding relationship in step C4, select the low-level model parameters that meet the preset conditions, that is, the ETHERNET-IF class, and convert the data of each node in the data tree into the data of the low-level model.
- the preset conditions that is, the ETHERNET-IF class
- Step C504 Pack the final low-level model data ETHERNET-IF class according to the low-level model class.
- step C6 specifically includes the following steps:
- Step C601 the device traverses the low-level model to obtain the data specified by the operation, as shown on the right side of Figure 11;
- Step C602 extract the corresponding high-level model path according to the registered correspondence in step C4;
- Step C603 According to the additional parameters in the corresponding relationship in step C4, a path that meets the preset conditions is selected, starting from the root node of the path, and building a high-level model tree node by node from parent to child. For the name element in the low-level model, its corresponding path in the YANG high-level model is unique.
- the embodiment of the present invention also provides an automatic mapping system for high-level models and low-level models, including:
- the extended attribute adding module is used to add extended attributes to the high-level model to support the mapping of high-level model node names to low-level model element names;
- the mapping relationship file loading module is used to load the mapping relationship file between the high-level model and the low-level model.
- the mapping relationship file includes required parameters and additional parameters.
- the required parameters include the attributes of the high-level model nodes and the attributes of the corresponding low-level model elements.
- the additional parameters include The preset conditions and the corresponding mapping update actions, when the preset conditions are met, execute the corresponding mapping update actions;
- the mapping relationship generation module is used to analyze the extended attributes of the high-level model, establish the corresponding relationship between the name of the high-level model node and the name of the low-level model element, and bind the attributes and additional parameters of the low-level model element to the attributes of the high-level model node according to the mapping relationship file Define, generate the mapping relationship between high-level model nodes and low-level model elements;
- the mapping module is used to perform the mapping between the high-level model and the low-level model according to the mapping relationship.
- mapping relationship file loading module loads the mapping relationship file between the high-level model and the low-level model
- the additional parameters of the mapping file include n Preset condition + n corresponding mapping update actions
- the additional parameters of the mapping relationship file of each high-level model node include 1 preset condition + 1 corresponding mapping update action.
- the attributes of the high-level model node include node name, type, and path
- the attributes of the low-level model element include class name, element name, type, description, and value range.
- the preset conditions include the value, combination, and location of single or multiple parameters of the high-level model or the low-level model; when the preset conditions are not specified, the default is that the conditions are met, and the corresponding Map update action.
- the high-level model includes a YANG model, an MIB model, and a CLI model.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
一种高级模型与低级模型的自动映射方法及系统,涉及通信技术领域。通过设置映射关系文件,可解决高级模型与低级模型的自动映射时模型之间的差异问题,使高级模型的设计与低级模型解耦,通过设置附加参数实现通信设备使用一套通用低级模型对应多套高级模型。且映射兼容现有的主流YANG、MIB和CLI等多套高级模型。同时,通过设置映射关系文件,实现高级模型与低级模型的自动映射,无须编码,节约了大量的开发成本,避免因人为参与导致出错率高的风险。
Description
本发明涉及通信技术领域,具体是涉及一种高级模型与低级模型的自动映射方法及系统。
命令行界面(Command Line Interface,CLI)是通信设备使用最广泛的网络管理协议,其诞生时间最早。CLI通过特定的语法规定用户与设备的交互方式。CLI的模型呈树形结构,通过视图实现将相关的功能配置组合成配置块,以及配置块的层层递进。
简单网络管理协议(Simple Network Management Protocol,SNMP)发布于1988年,是互联网工程任务组(Internet Engineering Task Force,IETF)发布的标准协议。SNMP因其发布时间早、标准化,被通信设备广泛支持。SNMP使用信息管理库(Module Information Base,MIB)作为其数据模型。
网络配置协议(Network Configuration Protocol,NETCONF)发布于2006年,是IETF发布的标准协议。NETCONF相较于CLI和SNMP具有更丰富的功能。NETCONF使用YANG模型(YANG Model)作为其数据模型。YANG模型具有良好的可读性和可扩展性,相比于CLI和MIB模型,提供了更为丰富的功能。
CLI、MIB、YANG等网络管理数据模型,统称为高级模型,虽然不同的高级模型诞生的时间不同、依赖的网络管理协议不同,但有相似的语法和结构。
高级模型中的术语:
元素(element):包含数据的节点。对应CLI中的参数,MIB中的标量节点,YANG中的叶子;
列表(list):存在多实例的节点,包含一个或多个元素。对应CLI中含关键字的视图,MIB中的表格,YANG中的列表;
关键字(key):唯一标识列表实例的一个或多个元素。对应CLI中的索引,MIB中的索引,YANG中的关键字;
容器(container):不含数据的节点,可包含一个或多个简单或复杂节点。对应CLI中不含关键字的视图,MIB中的节点,YANG中的容器;
在通信设备内部,使用统一的低级模型——一种通用模型来对通信设备进行管理。该通用模型的特征是:以类(Class)为单位,是一种扁平的模型。低级模型是一种与网络管理协议无关(Protocol-neutral)的信息模型。
如图1所示,其示出了通信设备与网络管理者之间所常用的网络管理协议及其高级模型,当前的通信设备需要同时支持不同的网络管理协议及其高级模型。通信设备不论使用哪一种高级模型,均需要先映射为低级模型再进行处理。不论使用哪一种高级模型下发的配置,均要能支持使用其他高级模型来进行获取,反之亦然。但不同的高级模型间,由于高级模型本身语法不同、支持的特性不同等原因,无法保证与低级模型能一一对应。不仅如此,除去这些客观原因之外,从开发者主观上,低级模型的设计通常以当时主流的高级模型作为参考,当新的高级模型出现后,因高级模型间的差异,导致已设计的低级模型无法完全支持新的高级模型。同时,低级模型与高级模型目前仍可能存在耦合。这种耦合导致同一套低级模型对应多套高级模型时,面 临以下场景的挑战:
1、低级模型中的参数在高级模型中不存在;
2、低级模型中的参数在高级模型中变成了不含数据的节点;
3、低级模型中的一个参数,在高级模型中有多处对应;
4、低级模型为了兼容某一种高级模型,导致对另一种高级模型不兼容。
现行的映射多采用对每个模型手工编码来解决上述的种种差异场景,但也存在诸多问题。第一,手动编码对高级模型间差异的处理不具备通用性,抽象程度低,重复劳动程度高;第二,手动编码因人为参与程度高,导致出错概率高;第三,现在的通信设备支持的场景繁多,包括PTN、数通、OTN、交换机、SDN/NFV等多种设备形态,所涉及的模型数量少则上百,多则上千,对每个模型的每个节点进行编码,开发成本巨大。
发明内容
本发明的目的是为了克服上述背景技术的不足,提供一种高级模型与低级模型的自动映射方法及系统,高级模型与低级模型的多场景映射。
本发明提供一种高级模型与低级模型的自动映射方法,包括以下步骤:
在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;
加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性及对应的低级模型元素的属性,附加参数包括预置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;
解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;
根据所述映射关系,执行高级模型与低级模型之间的映射。
在上述方案的基础上,加载高级模型与低级模型的映射关系文件的过程中,当1个高级模型节点对应n个低级模型元素时,映射关系文件的附加参数包括n个预置条件+n个对应的映射更新动作;
当n个高级模型节点对应1个低级模型元素时,每个高级模型节点的映射关系文件的附加参数均包括1个预置条件+1个对应的映射更新动作。
在上述方案的基础上,所述高级模型节点的属性包括节点名称、类型、路径,低级模型元素的属性包括类名称、元素名称、类型、描述、取值范围。
在上述方案的基础上,所述预置条件包括高级模型或低级模型的单个或多个参数的取值、组合、所处的位置;未指定预置条件时,默认为条件满足,直接执行对应的映射更新动作。
在上述方案的基础上,所述高级模型包括YANG模型、MIB模型与CLI模型。
本发明还提供一种高级模型与低级模型的自动映射系统,包括:
扩展属性添加模块,其用于在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;
映射关系文件加载模块,其用于加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性以及对应的低级模型元素的属性,附加参数包括预 置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;
映射关系生成模块,其用于解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;
映射模块,其用于根据所述映射关系,执行高级模型与低级模型之间的映射。
在上述方案的基础上,所述映射关系文件加载模块加载高级模型与低级模型的映射关系文件的过程中,当1个高级模型节点对应n个低级模型元素时,映射关系文件的附加参数包括n个预置条件+n个对应的映射更新动作;
当n个高级模型节点对应1个低级模型元素时,每个高级模型节点的映射关系文件的附加参数均包括1个预置条件+1个对应的映射更新动作。
在上述方案的基础上,所述高级模型节点的属性包括节点名称、类型、路径,低级模型元素的属性包括类名称、元素名称、类型、描述、取值范围。
在上述方案的基础上,所述预置条件包括高级模型或低级模型的单个或多个参数的取值、组合、所处的位置;未指定预置条件时,默认为条件满足,直接执行对应的映射更新动作。
在上述方案的基础上,所述高级模型包括YANG模型、MIB模型与CLI模型。
与现有技术相比,本发明的优点如下:
(1)本发明通过设置映射关系文件,可解决高级模型与低级模 型的自动映射时模型之间的差异问题,使高级模型的设计与低级模型解耦,通过设置附加参数实现通信设备使用一套通用低级模型对应多套高级模型。且本发明的映射兼容现有的主流YANG、MIB和CLI等多套高级模型。
(2)本发明通过设置映射关系文件,实现高级模型与低级模型的自动映射,无须编码,节约了大量的开发成本,避免因人为参与导致出错率高的风险。
图1是背景技术的高级模型与低级模型映射的场景示意图;
图2是本发明实施例的高级模型与低级模型的自动映射方法的流程示意图;
图3是本发明实施例的CLI高级模型与低级模型之间的对应关系示意图;
图4是本发明实施例的CLI高级模型与低级模型的自动映射方法的流程示意图;
图5是本发明实施例的CLI高级模型与低级模型数据映射的示意图;
图6是本发明实施例的YANG高级模型与低级模型之间的多对一的对应关系示意图;
图7是本发明实施例的YANG高级模型与低级模型的多对一的自动映射方法的流程示意图;
图8是本发明实施例的YANG高级模型与低级模型数据多对一的映射的示意图;
图9是本发明实施例的YANG高级模型与低级模型之间的一对多的对应关系示意图;
图10是本发明实施例的YANG高级模型与低级模型的一对多的自动映射方法的流程示意图;
图11是本发明实施例的YANG高级模型与低级模型数据一对多的映射的示意图。
下面结合附图及具体实施例对本发明作进一步的详细描述。
参见图2所示,本发明实施例提供一种高级模型与低级模型的自动映射方法,包括以下步骤:
S1,在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;
S2,加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性及对应的低级模型元素的属性,附加参数包括预置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;
S3,解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;
S4,根据所述映射关系,执行高级模型与低级模型之间的映射。
本申请的第一个实施场景,是CLI高级模型与低级模型的自动映射。
如图3所示,其示出了约束路径(explicit path)配置的CLI高级模型与低级模型之间的对应关系。因为低级模型设计时完全参考CLI高级模型,所以二者一一对应整齐。
采用本申请中的自动映射方法,如图4所示,具体流程如下:
步骤A1,在CLI高级模型中添加扩展属性,使其支持CLI高级模型到低级模型的映射能力。
步骤A2,程序启动时,加载低级模型文件,在内存中构建低级模型。
步骤A3,程序启动时,加载CLI高级模型与低级模型的映射关系文件。映射文件中,包括CLI高级模型的name、index、include/exclude、ip-address节点的名称、类型、路径以及其所对应的低级模型中的EXPLICIT-PATH类、NEXTHOP类名称、元素名称、类型、描述、取值范围、附加参数等必要的参数。
步骤A4,程序启动时,加载CLI高级模型文件,在内存中构建CLI高级模型树,并解析CLI高级模型的扩展属性,构建CLI高级模型节点与低级模型元素名称的对应关系,并根据该对应关系,从步骤A3的映射文件中获取到CLI高级模型节点所对应的低级模型元素的所有属性,在内存中将低级模型元素属性与CLI高级模型节点属性相绑定,完成CLI高级模型节点与低级模型中元素对应关系的注册。如图3中的箭头所示。
步骤A5,当设备收到CLI高级模型向低级模型映射的请求时,例如针对CLI高级模型的配置编辑,如图4,遍历配置编辑报文所使用的CLI高级模型的每个节点,根据内存中注册的映射关系构建出低级模型,将其转换为对低级模型的配置编辑。
步骤A6,当设备收到低级模型向CLI高级模型映射的请求时,例如针对CLI高级模型的配置或者状态读取,设备从低级模型中获取数据,根据内存中注册的映射关系构建出CLI高级模型。
作为优选的实施方式,步骤A1具体包括以下步骤:
步骤A101,将CLI高级模型转换为XML形式表示。
<node=”explicit name”/>
步骤A102,在XML中添加扩展属性class和element,标注其对应的低级模型的类名和元素名。
<node=”explicit name”class=”EXPLICIT-PATH”element=”name”/>
作为优选的实施方式,步骤A4具体包括以下步骤:
步骤A401,加载CLI高级模型时,遍历CLI高级模型树每个节点,获取其扩展属性,得到CLI高级模型节点名称与低级模型类名称、元素名称的对应关系;
步骤A402,通过低级模型类名称、元素名称在步骤3获取到的对应关系中,绑定其类型、描述、取值范围、附加参数的必要的参数;
步骤A403,CLI高级模型树中的子节点,需将父节点的关键字加入其上下文。将EXPLICIT-HOP类的name元素,加入到NEXTHOP类的上下文中。
作为优选的实施方式,步骤A5具体包括以下步骤:
步骤A501,设备读取CLI高级模型的数据报文,按照前序遍历的原则遍历其对应的每个节点,生成数据树,如图5左侧;
步骤A502,根据步骤A4中已注册的对应关系,取出对应的低级模型参数;
步骤A503,根据步骤A4中对应关系里的附加参数,选择满足预置条件的低级模型参数,将数据树中每个节点的数据转换为低级模型的数据,如图5右侧。由于CLI高级模型与低级模型一一对应,故不需要附加参数;
步骤A504,将最终的低级模型数据EXPLICIT-PATH类和NEXTHOP类按照低级模型类进行打包。
作为优选的实施方式,步骤A6具体包括以下步骤:
步骤A601,设备从低级模型中遍历获取操作所指定的数据,如图5右侧;
步骤A602,根据步骤A4中已注册的对应关系,取出对应的CLI高级模型路径;
步骤A603,根据步骤A4中对应关系里的附加参数,选择满足预置条件的路径,从路径的根节点开始,由父到子逐节点构建CLI高级模型树,如图5左侧;
步骤A604,当一个低级模型类的数据构建完成后,再构建下一个低级模型类,直到所有的类都构建完毕。
本申请的第二个实施场景,是YANG高级模型与低级模型的多对一的自动映射。
由于CLI高级模型早于YANG高级模型面世,设备的低级模型是按照CLI模型设计。在低级模型中,constraint参数用来存储CLI模型中的(include|exclude)参数,取值为二者中的一个。但在YANG中,include和exclude的数据类型是容器,即不含数据;且二者分开,不再是同一个参数。两种高级模型出现了差异,低级模型无法保证与两者都一一对应。
图6是约束路径的低级模型与YANG高级模型的多对一的对应关系。可以看到,图中实线箭头的部分,出现了YANG高级模型中两个节点对应低级模型一个节点的情况。除此之外,图中虚线箭头的部分表示,低级模型中的元素,在YANG高级模型中变为了不含数据的容器。
本实施例主要体现本申请如何解决同一套低级模型映射不同的高级模型的解决方案,如图7所示,具体流程如下:
步骤B1,在高级模型中添加扩展属性,使其支持高级模型到低级模型的映射能力。
步骤B2,程序启动时,加载低级模型文件,在内存中构建低级模型。
步骤B3,程序启动时,加载高级模型与低级模型的映射关系文件。映射文件中,包括YANG高级模型的name、index、ip-address节点的名称、类型、路径以及其所对应的低级模型中的EXPLICIT-PATH类、NEXTHOP类名称、元素名称、类型、描述、取值范围、附加参数等必要的参数。
步骤B4,程序启动时,加载高级模型文件,在内存中构建高级模型树,并解析高级模型的扩展属性,构建高级模型节点与低级模型元素名称的对应关系,并根据该对应关系,从步骤B3的映射文件中获取到高级模型节点所对应的低级模型元素的所有属性,在内存中将低级模型元素属性与高级模型节点属性相绑定,完成高级模型节点与低级模型中元素对应关系的注册。如图6中的箭头所示。
步骤B5,当设备收到高级模型向低级模型映射的请求时,例如针对高级模型的配置编辑,遍历配置编辑报文所使用的高级模型的每个节点,根据内存中注册的映射关系构建出低级模型,将其转换为对低级模型的配置编辑。
步骤B6,当设备收到低级模型向高级模型映射的请求时,例如针对高级模型的配置或者状态读取,设备从低级模型中获取数据,根据内存中注册的映射关系构建出高级模型。
作为优选的实施方式,步骤B1具体包括以下步骤:
步骤B101,将高级模型转换为XML形式表示。为体现层次结构,对不重要的参数进行了裁剪。
步骤B102,在XML中添加扩展属性extension,标注其对应的低级模型的类名和元素名。
作为优选的实施方式,步骤B4具体包括以下步骤:
步骤B401,加载高级模型时,遍历高级模型树每个节点,获取其扩展属性,得到高级模型节点名称与低级模型类名称、元素名称的 对应关系;
步骤B402,通过低级模型类名称、元素名称在步骤B3获取到的对应关系中,绑定其类型、描述、取值范围、附加参数的必要的参数;
步骤B403,高级模型树中的子节点,需将父节点的关键字加入其上下文。将EXPLICIT-PATH类的name元素,加入到NEXTHOP类的上下文中。
作为优选的实施方式,步骤B5具体包括以下步骤:
步骤B501,设备读取高级模型的数据报文,按照前序遍历的原则遍历其对应的每个节点,生成数据树,如图8左侧;
步骤B502,根据步骤B4中已注册的对应关系,取出对应的低级模型参数;
步骤B503,根据步骤B4中对应关系里的附加参数,选择满足预置条件的低级模型参数,将数据树中每个节点的数据转换为低级模型的数据。由于低级模型中的constraint元素在YANG高级模型中对应的是不含数据的容器类型,故YANG不会下发constraint元素的值。通过附加参数,可以为YANG高级模型中的include和exclude容器补充数据下给低级模型。对YANG高级模型的exclude容器,默认执行对低级模型的constraint元素补上赋值exclude的动作,无需满足预置条件。附加参数表达方式如下:
<paddedPara class=”NEXTHOP”element=”constraint”value=”exclude”>
同理,对YANG高级模型的include容器,默认执行对低级模型的constraint元素补上赋值include的动作,无需满足预置条件。附加参数表达方式如下:
<paddedPara class=”NEXTHOP”element=”constraint” value=”include”>
步骤B504,完成附加参数的处理,补上constraint值后,将最终的低级模型数据EXPLICIT-PATH类和NEXTHOP类按照低级模型类进行打包。
作为优选的实施方式,步骤B6具体包括以下步骤:
步骤B601,设备从低级模型中遍历获取操作所指定的数据,如图8右侧;
步骤B602,根据步骤B4中已注册的对应关系,取出对应的高级模型路径;
步骤B603,根据步骤B4中对应关系里的附加参数,选择满足预置条件的路径,从路径的根节点开始,由父到子逐节点构建高级模型树。对于低级模型中的ip-address元素而言,其对应在YANG高级模型中的路径,存在两种可能:位于include容器内的ip-address叶子,或者位于exclude容器内的ip-adress叶子。具体选择哪一条路径,可根据低级模型中的constraint元素的取值来判断。当满足预置条件“低级模型中的constraint元素值等于exclude”时,低级模型的ip-address元素位于YANG高级模型的exclude容器内;当满足预置条件“低级模型中的constraint元素值等于include”时,低级模型的ip-address元素位于YANG高级模型的include容器内。上述这段判断逻辑,落实到对应关系的附加参数中,使用如下方式表达。路径采用XPATH语法编写。
<when condition=”constraint=‘exclude’”path=”/explicit-paths/explicit-path/nexthop/exclude”/>
<when condition=”constraint=‘include’”path=”/explicit-paths/explicit-path/nexthop/include”/>
步骤B604,当EXPLICIT-PATH低级模型类的数据构建完成后,再构建NEXTHOP低级模型类,直到所有的类都构建完毕。
本申请的第三个实施场景,是YANG高级模型与低级模型的一对多的自动映射。
本实施例以接口的模型为例。在YANG高级模型中,interface列表包含所有类型接口的管理。在低级模型中,每种类型的接口有其单独的类,例如以太网接口、弹性以太网(Flexible Ethernet,FlexE)接口等。因不同类型的接口所具备的属性存在差异,故低级模型的设计方式便于维护某种接口类型所特有的属性。YANG高级模型的设计方式,则将所有的接口都抽象为一个interface列表,便于接口的统一管理。
图9是接口的低级模型与YANG高级模型的一对多的对应关系。可以看到,图中实线箭头的部分,出现了YANG高级模型中一个节点对应低级模型两个节点的情况。
本实施例主要体现本申请如何解决高级模型映射不同的低级模型的解决方案,如图10所示,具体流程如下:
步骤C1,在高级模型中添加扩展属性,使其支持高级模型到低级模型的映射能力。
步骤C2,程序启动时,加载低级模型文件,在内存中构建低级模型。
步骤C3,程序启动时,加载高级模型与低级模型的映射关系文件。映射文件中,包括YANG高级模型的name节点的名称、类型、路径以及其所对应的低级模型中的ETHERNET-IF类、FLEXE-IF类名称、元素名称、类型、描述、取值范围、附加参数等必要的参数。
步骤C4,程序启动时,加载高级模型文件,在内存中构建高级 模型树,并解析高级模型的扩展属性,构建高级模型节点与低级模型元素名称的对应关系,并根据该对应关系,从步骤C3的映射文件中获取到高级模型节点所对应的低级模型元素的所有属性,在内存中将低级模型元素属性与高级模型节点属性相绑定,完成高级模型节点与低级模型中元素对应关系的注册。如图9中的箭头所示。
步骤C5,当设备收到高级模型向低级模型映射的请求时,例如针对高级模型的配置编辑,遍历配置编辑报文所使用的高级模型的每个节点,根据内存中注册的映射关系构建出低级模型,将其转换为对低级模型的配置编辑。
步骤C6,当设备收到低级模型向高级模型映射的请求时,例如针对高级模型的配置或者状态读取,设备从低级模型中获取数据,根据内存中注册的映射关系构建出高级模型。
作为优选的实施方式,步骤C1具体包括以下步骤:
步骤C101,将高级模型转换为XML形式表示。为体现层次结构,对不重要的参数进行了裁剪。
步骤C102,在XML中添加扩展属性extension,标注其对应的低级模型的类名和元素名。
作为优选的实施方式,步骤C4具体包括以下步骤:
步骤C401,加载高级模型时,遍历高级模型树每个节点,获取其扩展属性,得到高级模型节点名称与低级模型类名称、元素名称的对应关系;
其扩展属性的含义为,当name字段的内容以ethernet开始时,映射到ETHERNET-IF类,当name字段的内容以flexe开始时,映射到FLEXE-IF类
步骤C402,通过低级模型类名称、元素名称在步骤C3获取到的对应关系中,绑定其类型、描述、取值范围、附加参数的必要的参数;
作为优选的实施方式,步骤C5具体包括以下步骤:
步骤C501,设备读取高级模型的数据报文,按照前序遍历的原则遍历其对应的每个节点,生成数据树,如图11左侧;
步骤C502,根据步骤C4中已注册的对应关系,取出对应的低级模型参数;
步骤C503,根据步骤C4中对应关系里的附加参数,选择满足预置条件的低级模型参数,即ETHERNET-IF类,将数据树中每个节点的 数据转换为低级模型的数据。
步骤C504,将最终的低级模型数据ETHERNET-IF类按照低级模型类进行打包。
作为优选的实施方式,步骤C6具体包括以下步骤:
步骤C601,设备从低级模型中遍历获取操作所指定的数据,如图11右侧;
步骤C602,根据步骤C4中已注册的对应关系,取出对应的高级模型路径;
步骤C603,根据步骤C4中对应关系里的附加参数,选择满足预置条件的路径,从路径的根节点开始,由父到子逐节点构建高级模型树。对于低级模型中的name元素而言,其对应在YANG高级模型中的路径是唯一的。
本发明实施例还提供一种高级模型与低级模型的自动映射系统,包括:
扩展属性添加模块,其用于在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;
映射关系文件加载模块,其用于加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性以及对应的低级模型元素的属性,附加参数包括预置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;
映射关系生成模块,其用于解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;
映射模块,其用于根据所述映射关系,执行高级模型与低级模型之间的映射。
作为优选的实施方式,所述映射关系文件加载模块加载高级模型与低级模型的映射关系文件的过程中,当1个高级模型节点对应n个低级模型元素时,映射关系文件的附加参数包括n个预置条件+n个对应的映射更新动作;
当n个高级模型节点对应1个低级模型元素时,每个高级模型节点的映射关系文件的附加参数包括1个预置条件+1个对应的映射更新动作。
作为优选的实施方式,所述高级模型节点的属性包括节点名称、类型、路径,低级模型元素的属性包括类名称、元素名称、类型、描述、取值范围。
作为优选的实施方式,所述预置条件包括高级模型或低级模型的单个或多个参数的取值、组合、所处的位置;未指定预置条件时,默认为条件满足,直接执行对应的映射更新动作。
作为优选的实施方式,所述高级模型包括YANG模型、MIB模型与CLI模型。
本领域的技术人员可以对本发明实施例进行各种修改和变型,倘若这些修改和变型在本发明权利要求及其等同技术的范围之内,则这些修改和变型也在本发明的保护范围之内。说明书中未详细描述的内容为本领域技术人员公知的现有技术。
Claims (10)
- 一种高级模型与低级模型的自动映射方法,其特征在于,包括以下步骤:在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性及对应的低级模型元素的属性,附加参数包括预置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;根据所述映射关系,执行高级模型与低级模型之间的映射。
- 如权利要求1所述的方法,其特征在于:加载高级模型与低级模型的映射关系文件的过程中,当1个高级模型节点对应n个低级模型元素时,映射关系文件的附加参数包括n个预置条件+n个对应的映射更新动作;当n个高级模型节点对应1个低级模型元素时,每个高级模型节点的映射关系文件的附加参数均包括1个预置条件+1个对应的映射更新动作。
- 如权利要求1所述的方法,其特征在于:所述高级模型节点的属性包括节点名称、类型、路径,低级模型元素的属性包括类名称、元素名称、类型、描述、取值范围。
- 如权利要求1所述的方法,其特征在于:所述预置条件包括 高级模型或低级模型的单个或多个参数的取值、组合、所处的位置;未指定预置条件时,默认为条件满足,直接执行对应的映射更新动作。
- 如权利要求1所述的方法,其特征在于:所述高级模型包括YANG模型、MIB模型与CLI模型。
- 一种高级模型与低级模型的自动映射系统,其特征在于,包括:扩展属性添加模块,其用于在高级模型中添加扩展属性,用于支持高级模型节点名称到低级模型元素名称的映射;映射关系文件加载模块,其用于加载高级模型与低级模型的映射关系文件,映射关系文件包括必需参数和附加参数,必需参数包括高级模型节点的属性以及对应的低级模型元素的属性,附加参数包括预置条件和对应的映射更新动作,当满足预置条件时,执行对应的映射更新动作;映射关系生成模块,其用于解析高级模型的扩展属性,建立高级模型节点名称与低级模型元素名称的对应关系,根据映射关系文件,将低级模型元素的属性及附加参数与高级模型节点的属性绑定,生成高级模型节点与低级模型元素的映射关系;映射模块,其用于根据所述映射关系,执行高级模型与低级模型之间的映射。
- 如权利要求6所述的系统,其特征在于:所述映射关系文件加载模块加载高级模型与低级模型的映射关系文件的过程中,当1个高级模型节点对应n个低级模型元素时,映射关系文件的附加参数包括n个预置条件+n个对应的映射更新动作;当n个高级模型节点对应1个低级模型元素时,每个高级模型节 点的映射关系文件的附加参数包括1个预置条件+1个对应的映射更新动作。
- 如权利要求6所述的系统,其特征在于:所述高级模型节点的属性包括节点名称、类型、路径,低级模型元素的属性包括类名称、元素名称、类型、描述、取值范围。
- 如权利要求6所述的系统,其特征在于:所述预置条件包括高级模型或低级模型的单个或多个参数的取值、组合、所处的位置;未指定预置条件时,默认为条件满足,直接执行对应的映射更新动作。
- 如权利要求6所述的系统,其特征在于:所述高级模型包括YANG模型、MIB模型与CLI模型。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910115051.1 | 2019-02-14 | ||
| CN201910115051.1A CN109947995B (zh) | 2019-02-14 | 2019-02-14 | 一种高级模型与低级模型的自动映射方法及系统 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020164300A1 true WO2020164300A1 (zh) | 2020-08-20 |
Family
ID=67007610
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/124187 Ceased WO2020164300A1 (zh) | 2019-02-14 | 2019-12-10 | 一种高级模型与低级模型的自动映射方法及系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109947995B (zh) |
| WO (1) | WO2020164300A1 (zh) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109947995B (zh) * | 2019-02-14 | 2020-12-15 | 烽火通信科技股份有限公司 | 一种高级模型与低级模型的自动映射方法及系统 |
| CN110460461B (zh) * | 2019-07-10 | 2022-01-11 | 烽火通信科技股份有限公司 | Yang模式语言到命令行的映射方法及系统 |
| CN110474794B (zh) * | 2019-07-10 | 2021-04-27 | 烽火通信科技股份有限公司 | 一种sdn架构的信息转换方法和系统 |
| CN112583630B (zh) | 2019-09-29 | 2022-07-12 | 华为技术有限公司 | 设备管理方法、装置、系统、设备及存储介质 |
| CN119420643B (zh) * | 2024-10-18 | 2025-11-04 | 新华三技术有限公司 | 一种设备配置方法、装置及相关设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104243198A (zh) * | 2013-06-21 | 2014-12-24 | 中兴通讯股份有限公司 | 一种基于网络配置协议的网络管理方法和系统 |
| US20160212148A1 (en) * | 2015-01-21 | 2016-07-21 | Palo Alto Research Center Incorporated | Network-layer application-specific trust model |
| CN106559251A (zh) * | 2015-09-30 | 2017-04-05 | 中兴通讯股份有限公司 | 一种基于yang模型的编译方法、及对应的接口、组件和系统 |
| CN109947995A (zh) * | 2019-02-14 | 2019-06-28 | 烽火通信科技股份有限公司 | 一种高级模型与低级模型的自动映射方法及系统 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1632794A (zh) * | 2004-12-27 | 2005-06-29 | 中国科学院软件研究所 | 可扩展标记语言类型至关系数据库表的映射方法 |
| US8849873B2 (en) * | 2009-03-18 | 2014-09-30 | Bentley Systems, Incorporated | Specifications automation system and method |
| CN104850623B (zh) * | 2015-05-19 | 2018-08-07 | 杭州迅涵科技有限公司 | 多维度数据分析模型动态扩展方法和系统 |
| CN105912665B (zh) * | 2016-04-12 | 2019-05-03 | 清华大学 | 一种Neo4j向关系型数据库的模型转换和数据迁移方法 |
| CN108363545B (zh) * | 2017-01-26 | 2021-12-03 | 华为技术有限公司 | 一种数据配置方法及数据配置装置 |
| CN107315768A (zh) * | 2017-05-17 | 2017-11-03 | 上海交通大学 | 基于异构信息模型映射的配网信息交互方法及系统 |
-
2019
- 2019-02-14 CN CN201910115051.1A patent/CN109947995B/zh active Active
- 2019-12-10 WO PCT/CN2019/124187 patent/WO2020164300A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104243198A (zh) * | 2013-06-21 | 2014-12-24 | 中兴通讯股份有限公司 | 一种基于网络配置协议的网络管理方法和系统 |
| US20160212148A1 (en) * | 2015-01-21 | 2016-07-21 | Palo Alto Research Center Incorporated | Network-layer application-specific trust model |
| CN106559251A (zh) * | 2015-09-30 | 2017-04-05 | 中兴通讯股份有限公司 | 一种基于yang模型的编译方法、及对应的接口、组件和系统 |
| CN109947995A (zh) * | 2019-02-14 | 2019-06-28 | 烽火通信科技股份有限公司 | 一种高级模型与低级模型的自动映射方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109947995B (zh) | 2020-12-15 |
| CN109947995A (zh) | 2019-06-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020164300A1 (zh) | 一种高级模型与低级模型的自动映射方法及系统 | |
| CN112187632B (zh) | 工业设备一体化模型及构建方法、边缘网关装置、工业设备一体化系统 | |
| CN112287007B (zh) | 基于Flink SQL引擎的工业生产数据实时处理方法、系统 | |
| CN113508403B (zh) | 用于自动化系统组件与多个信息源的可互操作通信的系统和方法 | |
| US20240111500A1 (en) | Method and Apparatus for an Internet of Things Controller | |
| CN104133953B (zh) | 智能变电站二次设计系统 | |
| CN102611199B (zh) | 智能变电站设计配置一体化系统 | |
| EP3172866B1 (en) | System and method for metadata enhanced inventory management of a communications system | |
| US20120079461A1 (en) | Extensible device object model | |
| EP3780677B1 (en) | Operation triggering method and apparatus for machine-to-machine communications | |
| CN113381870B (zh) | 报文处理方法和设备 | |
| CN101635645B (zh) | 一种网络拓扑的管理方法及装置 | |
| CN110710161A (zh) | 生成网络的设备级逻辑模型 | |
| CN104636490A (zh) | 一种智能变电站scd文件图形化比对方法 | |
| Gu et al. | Design and implementation of UPnP-based surveillance camera system for home security | |
| Granzer et al. | Information modeling in heterogeneous building automation systems | |
| WO2016107397A9 (en) | System and method for model-based search and retrieval of networked data | |
| CN111526052A (zh) | 网元指令管理方法、装置、网络设备及存储介质 | |
| CN105824944B (zh) | 一种基于脚本语言的xml配置数据维护方法及系统 | |
| CN1910854B (zh) | 使用元管理信息库的自动更新系统以及方法 | |
| CN101202670B (zh) | 一种网络管理拓扑的处理方法及系统 | |
| US20060190571A1 (en) | Service framework for home network | |
| US11956123B1 (en) | Monitoring interface configurations for network devices in fabrics | |
| CN109918050B (zh) | 一种软件需求描述规则语言与转换方法 | |
| CN113438095B (zh) | 配置数据的管理方法、装置、设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19915230 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19915230 Country of ref document: EP Kind code of ref document: A1 |





