An atomic capability storage and rendering method, system, electronic device and storage medium about vendor YANG files
By using atomic storage and rendering methods for YANG files, the problems of long adjustment cycles and high coupling of device configuration during SDN controller version upgrades are solved, enabling rapid adaptation and flexible device configuration management, and improving device operation efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2026-03-20
AI Technical Summary
Existing SDN controllers have a long adjustment cycle when handling vendor YANG file version upgrades, making it difficult to quickly respond to vendor upgrade changes. Furthermore, the high degree of coupling in device configuration content affects the efficiency of business operations.
The atomic capability storage and rendering method is adopted. By determining the data nodes and hierarchical relationships of the YANG file, the atomic capability storage table is designed, the vendor's YANG file is parsed to generate a Swagger file, and a tree transformation algorithm is used to transform the non-standard tree structure into a standard structure. Configuration data is recorded and distributed, and device configuration for multiple scenarios is supported.
It enables rapid adaptation to changes in vendor YANG files, reduces the coupling of device configuration content, supports multi-vendor version upgrades, updates device configurations in a timely manner, reduces misconfigurations, and improves the flexibility and efficiency of device operation.
Smart Images

Figure CN115951822B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of network communication, in particular to an atomic capability storage and rendering method and system about vendor YANG files, electronic equipment and storage medium. BACKGROUND
[0002] In the field of operator network communication, there are mainly two ways for the configuration and control of network devices: the integrator manual operation mode and the SDN controller mode.
[0003] The integrator manual operation mode generally uses CLI commands to directly interact with the device to complete device startup, backbone trunk opening, service opening, device upgrade and maintenance, etc. However, this mode is greatly affected by space and time, and is limited by the technical level and efficiency of network engineers. Once the response to a major failure is not fast enough, it may cause irreparable loss to the customer's business.
[0004] As for the SDN (Software Defined Network) controller mode, the SDN controller has a globally controllable control plane and an efficient forwarding plane. The controller user can make decisions based on the network information, and adjust and optimize according to the real-time changes of network traffic. The adjustment and optimization includes issuing maintenance changes, service opening, etc. to the device. The existing SDN controller has the following schemes for device configuration: 1) based on the CLI commands supported by the network device, abstract multiple CLI commands to form atomic capabilities. This way is easy for network engineers to read, but the disadvantage is that the CLI commands integrate multiple protocol contents, and there is no standard for the division of the smallest delivery unit, making it difficult to accurately solve practical problems. 2) based on the existing vendor YANG file, abstract the code structure, and realize the relationship between protocols through mutual reference between objects. This way is based on the vendor YANG file, and can better adapt to the smallest delivery capability unit supported by the device. However, this way is not flexible enough to support version upgrades of the vendor. When the vendor version upgrade leads to changes in the YANG file, the code needs to be redeveloped for adaptation, and the adjustment period is long, which cannot quickly respond to changes in vendor upgrades. SUMMARY
[0005] The present application provides an atomic capability storage and rendering method and system about vendor YANG files, electronic equipment and storage medium to quickly adapt to changes in vendor YANG files, efficiently complete upgrade iteration, complete version management, and meet the reading habits of users.
[0006] To achieve the above purpose, the present application adopts the following technical scheme:
[0007] An atomic capability storage and rendering method about vendor YANG files, comprising:
[0008] According to the specification YANG file provided by the manufacturer, the data nodes existing in the YANG file are determined, and the hierarchical relationship and tree structure of the data nodes are determined;
[0009] The atomic capability storage table is designed, and the structure of the atomic capability storage table conforms to the parent-child node relationship of the atomic capability.
[0010] The swagger file generated by parsing the manufacturer YANG file is obtained, the atomic capability and non-standard tree structure are obtained, and the non-standard tree structure is transformed into a standard tree structure by using a tree shaping transformation algorithm.
[0011] If the YANG file is an old version, the atomic capability corresponding to the YANG file is stored in the atomic capability storage table in the standard tree structure, the version of the current atomic capability is recorded, and the atomic capability is combined according to the template corresponding to the current atomic capability; the configuration data is issued to the router switch using the template, and the issued configuration data is stored persistently.
[0012] If the YANG file is a new version, the historical template of the atomic capability is found and disabled, the atomic capability of the previous version is recorded in the standard tree structure to the historical atomic capability storage table, and the atomic capability of the current version is recorded in the standard tree structure to the new atomic capability storage table; the nodes of the current atomic capability are combined to form a template, and the configuration data is issued to the router switch after analyzing the template content, and the configuration data is recorded in the transaction dimension.
[0013] A data structure understandable by the front end is provided, the data nodes are returned to the front end in a json format, and the atomic capability structure relationship is rendered.
[0014] To optimize the above technical solutions, the specific measures taken also include:
[0015] Further, the determination of the data nodes existing in the YANG file is specifically to determine the leaf nodes, leaf list nodes, container nodes and list nodes.
[0016] Further, the determination of the hierarchical relationship and tree structure of the data nodes is specifically to take the container nodes and list nodes as parent nodes, and take the leaf nodes and leaf list nodes as child nodes.
[0017] Further, the design of the atomic capability storage table is specifically:
[0018] The type field is used to identify the node type, the container, leaf, list and leaf list are designed to represent the container node, leaf node, list node and leaf list node respectively, the parent field is used to store the parent-child relationship between data nodes, and a unified root node root is set for all atomic capabilities; the child_exit field is set in cooperation with the parent field, and whether the current node has a child node is identified.
[0019] Further, the non-standard tree structure is transformed into a standard tree structure using a tree shaping transformation algorithm, and the non-standard tree structure is transformed into a standard tree structure.
[0020] The index is used to identify the position of the child node of the list and the leaf list, and the child node under the list belongs to which instantiation object of the list is distinguished, and a standard tree structure is formed.
[0021] Further, the nodes of the current atomic capability are combined to form a template, and the nodes of the current atomic capability are combined to form a template.
[0022] The leaf node or the leaf list node is selected, and all parent nodes containing the child node are combined to form a template, and the calculate_rule field is added in the template to record the variable name.
[0023] Further, the configuration data is delivered to the router switch, and the transaction mechanism is used to deliver the configuration data in parallel or in sequence.
[0024] The application also provides an atomic capability storage and rendering system for a vendor YANG file, the system comprising a file analysis module, a data processing module, a data storage module and a configuration delivery module.
[0025] The file analysis module is used to determine whether the version of the YANG file is an old version or a new version, determine the data nodes existing in the YANG file, determine the hierarchical relationship and tree structure of the data nodes, analyze the swagger file generated by the vendor YANG file, and obtain the atomic capability and non-standard tree structure.
[0026] The data processing module uses a tree shaping transformation algorithm to transform the non-standard tree structure into a standard tree structure, and is also used to find the historical template of the atomic capability.
[0027] The data storage module is used to record the atomic capability of the previous version in the standard tree structure into the historical atomic capability storage table, record the atomic capability of the new version in the standard tree structure into the new atomic capability storage table, combine the atomic capability, record the version of the atomic capability, and perform persistent storage on the delivered configuration data.
[0028] The configuration issuing module is configured to parse the template content and issue configuration data to the router switch.
[0029] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the atomic capability storage and rendering method for vendor YANG files as described above when executing the computer program.
[0030] The present application also provides a computer readable storage medium storing a computer program, and the computer program enables a computer to execute the atomic capability storage and rendering method for vendor YANG files as described above.
[0031] The present application has the following beneficial effects:
[0032] (1) The vendor YANG files are stored in a tree structure, and the user usability is strong;
[0033] (2) The vendor single YANG file is taken as an atomic capability, the atomic capability tree structure of independent protocols is taken as a whole, and the data nodes in the atomic capability tree are taken as the smallest unit for adjustment, so that the coupling degree of device configuration content is reduced;
[0034] (3) When the multi-vendor YANG file version is upgraded, the atomic capability structure can be quickly responded, iterated, and synchronized, the device configuration template can be updated in time, the business issuing is not affected, and the situation of error configuration issuing is effectively reduced;
[0035] (4) For the historical version YANG file, the version management minimum granularity is an atomic capability, and the rollback of a single atomic capability does not affect the remaining atomic capabilities;
[0036] (5) The device configuration issuing template supports multiple scene variables, and the device configuration issuing content can be traced back. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 is a flowchart of the atomic capability storage and rendering method;
[0038] Figure 2 is a tree reconstruction schematic diagram. DETAILED DESCRIPTION
[0039] The present application will be further described in detail in combination with the drawings.
[0040] In an embodiment, the present application provides an atomic capability storage and rendering method for vendor YANG files, and the overall flowchart of the method is shown in Figure 1 , which comprises:
[0041] After obtaining the vendor YANG file, the YANG file is judged. If it is not an updated YANG file, the atomic capability corresponding to the YANG file is tree-shapedly reformed and falls into the atomic capability storage table in the database, records the version of the current atomic capability, combines the atomic capability with a template, uses the template to issue a configuration to the router switch device, and stores the issued configuration persistently. If it is an updated YANG file, the historical template formed by the atomic capability combination is found and disabled, the atomic capability of the previous version is recorded into the historical atomic capability storage table, the atomic capability corresponding to the new YANG file is tree-shapedly reformed, the updated atomic capability is recorded into the new atomic capability storage table, and then the combination is performed to form a template for subsequent configuration issuing.
[0042] Specifically, according to the specification YANG file provided by the vendor, the existing data nodes are determined. The specification YANG file provided by the vendor is analyzed to confirm that the four main types of data nodes that need to be supported are leaf nodes, leaf list nodes, container nodes and list nodes, and the four types of data nodes are in a nested relationship. The node data type, node description information, node enumeration value, value range, default value and other information need to be included in the data structure. In addition, there is a mutual dependency relationship between the data nodes, for example, the list node mandatory item and the list node unique value, which need special processing, which will be described in the subsequent steps.
[0043] According to the four types of data nodes determined, the hierarchical relationship and tree structure between the nodes are determined, wherein the container node and the list node can be parent nodes, and the leaf node and the leaf list node can be child nodes, and the relationship between the data nodes conforms to the tree structure, so the data nodes are stored in the relational database in the form of tree structure. The list node needs to be tree-shapedly reformed, and the list node is different from the remaining container nodes. When the list node appears as a node, if the list contains N elements, the N elements are all child nodes of the current list node.
[0044] After the four types of data nodes are determined, the database storage structure conforming to the tree structure is designed. First, the type field is needed to identify the node type, and the container, leaf, list and leaf list are designed to represent the container node, leaf node, list node and leaf list node respectively. The parent field is used to store the parent-child relationship between nodes. For multiple YANG files provided by the manufacturer, each YANG file corresponds to an atomic capability, and a uniform root node root is set for all atomic capabilities. When the root bit is queried, the full atomic capability information can be obtained. The child_exit field is set in cooperation with the parent field, which is used to identify whether the current node has child nodes. For leaf and leaf list type nodes, there is always a parent and no child.
[0045] The remaining database fields are auxiliary fields, and the name field is used to identify the node name. For leaf nodes, the default value of the node needs to be saved, and the default field is used to record the default value of the current node.
[0046] The swagger file provided by the manufacturer is parsed, and whether the atomic capability is new is analyzed. If the YANG file is not a new version, the tree-shaped transformation algorithm is used to transform the nodes in the swagger file into a tree shape, and the atomic capability is stored in the database. If the YANG file is a new version, the template using the atomic capability needs to be found, the template is disabled, the old atomic capability falls into the history library, and the new atomic capability is recorded in the current library.
[0047] For the YANG file provided by the manufacturer, the relationship between nodes is not a strict tree structure. Since there are list and leaf list type nodes, the stored atomic capability and the template composed of atomic capabilities need to be tree-shaped transformed. The index is used to identify the position of the list and leaf list child nodes, which can effectively distinguish which instantiation object the list child node belongs to. As shown in the following figure, the left side is a general tree structure, where root is the root node, aaa and acl are the child nodes of root, id and seq are the child nodes of aaa, and rule is the child node of acl. The relationship between nodes is clear. The structure on the right side is the transformed tree structure. As can be seen from the figure, aaa is a list type node, and the child nodes of aaa are id and seq, but there are also multiple combinations of id and seq, which need to be distinguished by index. Figure 2
[0048] The nodes in the atomic capability can be combined as the smallest unit to form a template. An atomic capability acl is as follows:
[0049]
[0050] The combination of the node of the atomic capability is selected to form a template as follows:
[0051]
[0052] It can be seen that the atomic capability acl has multiple sub-nodes, but when the acl is combined with other atomic capabilities, only the required nodes of the target template can be taken, and the entire acl atomic capability does not need to be combined. It should be noted that the taken nodes must be leaf nodes or leaf list nodes, and all parent nodes of the leaf nodes must be included.
[0053] In order to make the template composed of atomic capabilities support different values according to different scenarios, and avoid users from repeatedly creating templates, a calculate_rule field is added in the template composed of atomic capabilities to record the variable name. The meaning represented by the variable will change in different business scenarios, and the variable in the template is assigned a value when the template is parsed and is then sent to the device.
[0054] When interacting with the device, a transaction mechanism is used, and the configuration content is sent in parallel or sequentially. After completing the transaction scheduling, the configuration content of the device is recorded in the transaction dimension for historical record viewing.
[0055] For the atomic capabilities stored in the database, the atomic capability structure relationship cannot be intuitively presented to the user. Therefore, a front-end understandable data structure is provided, and the node name, node type, node value and sub-node information are returned in the json format.
[0056] In another embodiment, the present application provides an atomic capability storage and rendering system for a vendor YANG file, the system comprising: a file analysis module, a data processing module, a data storage module and a configuration sending module;
[0057] The file analysis module is used to determine whether the version of the YANG file is an old version or a new version, determine the data nodes existing in the YANG file, determine the hierarchical relationship and tree structure of the data nodes, parse the swagger file generated by the vendor YANG file, and obtain the atomic capabilities and non-standard tree structure;
[0058] The data processing module uses a tree shaping reconstruction algorithm to reconstruct the non-standard tree structure into a standard tree structure, and is also used to find the historical templates of the atomic capabilities;
[0059] The data storage module is configured to record the atomic capabilities of the previous version in a standard tree structure into a historical atomic capability storage table, and record the atomic capabilities of the new version in a standard tree structure into a new atomic capability storage table; combine the atomic capabilities; record the atomic capability version; and persistently store the configuration data that has been issued.
[0060] The configuration issuing module is configured to parse the template content and issue the configuration data to the router switch.
[0061] In another embodiment, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the atomic capability storage and rendering method for vendor YANG files as described above when executing the computer program.
[0062] In another embodiment, the present application provides a computer readable storage medium storing a computer program, wherein the computer program causes a computer to execute the atomic capability storage and rendering method for vendor YANG files as described above.
[0063] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium, which can contain or store programs for use by or in connection with an instruction execution system, apparatus or device. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the above. More specific examples of the computer storage medium can include one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
[0064] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions according to each specific application, but such implementation should not be considered beyond the scope of the present application.
[0065] The above are only preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical scheme falling within the concept of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled in the art, some improvements and refinements without departing from the principles of the present application shall be considered as the protection scope of the present application.
Claims
1. A method for storing and rendering atomic capabilities of manufacturer YANG files, characterized in that, include: Based on the YANG file provided by the manufacturer, identify the data nodes in the YANG file, and determine the hierarchical relationship and tree structure of the data nodes; Design an atomic capability storage table such that its structure conforms to the parent-child node relationship of atomic capabilities; specifically, the design of the atomic capability storage table is as follows: Use the type field to identify the node type. Design container, leaf, list, and leaf list to represent container nodes, leaf nodes, list nodes, and leaf list nodes, respectively. Use the parent field to store the parent-child relationship between data nodes. Set a unified root node bit for all atomic capabilities. The `child_exit` field can be set in conjunction with the `parent` field to indicate whether the current node has child nodes; The Swagger file generated by parsing the YANG file of the manufacturer is used to obtain atomic capabilities and non-standard tree structure. The non-standard tree structure is then transformed into a standard tree structure using a tree transformation algorithm. If the YANG file is an older version, store the atomic capabilities corresponding to the YANG file in the atomic capability storage table in a standard tree structure, record the version of the current atomic capability, and combine the atomic capabilities according to the template corresponding to the current atomic capability. Use templates to send configuration data to routers and switches, and persistently store the sent configuration data. If the YANG file is a new version, then find the historical template of the atomic capability and disable it. Record the atomic capabilities of the previous version in the historical atomic capability storage table in a standard tree structure, and record the atomic capabilities of the current version in the new atomic capability storage table in a standard tree structure. Combine the nodes with the current atomic capabilities to form a template. After parsing the template content, send the configuration content to the router and switch and record the configuration content in the transaction dimension. Provides a data structure that the front end can understand, returns data nodes to the front end in JSON format, and renders atomic capability structure relationships.
2. The method for storing and rendering atomic capabilities of vendor YANG files according to claim 1, characterized in that: The specific data nodes for determining the existence of the YANG file are leaf nodes, leaf list nodes, container nodes, and list nodes.
3. The method for storing and rendering atomic capabilities of manufacturer YANG files according to claim 2, characterized in that, The specific method for determining the hierarchical relationship and tree structure of data nodes is as follows: container nodes and list nodes are used as parent nodes, and leaf nodes and leaf list nodes are used as child nodes.
4. The method for storing and rendering atomic capabilities of manufacturer YANG files according to claim 2, characterized in that, The specific steps of using a tree-transformation algorithm to transform a non-standard tree structure into a standard tree structure are as follows: The index identifies the position of the child nodes of the list and leaf list, distinguishing which instance of the list the child node belongs to, thus forming a standard tree structure.
5. The method for storing and rendering atomic capabilities of manufacturer YANG files according to claim 2, characterized in that, The specific steps for combining the nodes of the current atomic capabilities to form a template are as follows: Select leaf nodes or leaf list nodes, and combine all parent nodes that contain child nodes to form a template. Add a `calculate_rule` field to the template to record the variable name.
6. The method for storing and rendering atomic capabilities of vendor YANG files according to claim 1, characterized in that: Specifically, the configuration content is sent to the router and switch using a transaction mechanism, either concurrently or sequentially.
7. A system for storing and rendering atomic capabilities of manufacturer YANG files, characterized in that, The system includes: a file analysis module, a data processing module, a data storage module, and a configuration distribution module; The file analysis module is used to determine whether the YANG file is an old or new version, identify the data nodes in the YANG file, determine the hierarchical relationship and tree structure of the data nodes, parse the swagger file generated by the vendor's YANG file, and obtain atomic capabilities and non-standard tree structures. The data processing module uses a tree transformation algorithm to transform a non-standard tree structure into a standard tree structure, and is also used to find historical templates of atomic capabilities; The data storage module is used to record the previous version of atomic capabilities in a standard tree structure to the historical atomic capability storage table, and to record the new version of atomic capabilities in a standard tree structure to the new atomic capability storage table; combine atomic capabilities; record atomic capability versions; and persistently store the issued configuration content; the atomic capability storage table uses the type field to identify the node type, and designs container, leaf, list, and leaf list to represent container nodes, leaf nodes, list nodes, and leaf list nodes, respectively. The parent field is used to store the parent-child relationship between data nodes, and a unified root node is set for all atomic capabilities; the child_exit field is set in conjunction with the parent field to indicate whether the current node has child nodes; The configuration distribution module is used to parse the template content and then distribute the configuration content to the router and switch.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the atomic capability storage and rendering method for a vendor YANG file as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer program stores a computer program that causes the computer to perform the atomic capability storage and rendering method for a vendor YANG file as described in any one of claims 1-6.
Citation Information
Patent Citations
YANG model configuration data processing method and device, terminal device and storage medium
CN110018835A
Control subtask engine module based on arrangement control process service fulfillment
CN112558934A