A method for realizing network equipment automation based on compilation

Through customizing extensible syntax trees and compilers, the problem of existing technology not being able to adapt to the automation operation and maintenance of multiple devices is solved, and the automation capabilities and flexible expansion of multi-brand devices are achieved, adapting to complex network needs and improving network automation adaptability and scalability.

CN114371851BActive Publication Date: 2024-12-06BANK OF SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210019180.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-07
Publication Date
2024-12-06
Estimated Expiration
2042-01-07

AI Technical Summary

Technical Problem

The existing network automation technology cannot adapt to multiple types, multiple brands, and multiple versions of network equipment, cannot achieve comprehensive automation operation and maintenance, and cannot adapt to the network needs of complex data centers and branches, and cannot handle network service requests ( Network services other than triple and five tuple).

Method used

Adopt a custom extensible syntax tree, including a core syntax tree and a vendor expansion syntax tree, compile user change scripts into device commands through the compiler, and supports multiple protocols, such as Telnet, SSH, and API, to achieve plug-and-play Network equipment automation.

Benefits of technology

It realizes automation capabilities for different brands and versions of equipment, reduces development volume, supports flexible expansion, ensures idempotence and error detection of atomic operations, can adapt to a variety of network service needs, improves the adaptability of network automation and Extensibility.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a method for realizing network equipment automation based on compilation, which is applied to the network automation operation and maintenance of a data center, and comprises a user-defined extensible syntax tree: the syntax tree designed according to the command structure of the network equipment can be flexibly expanded according to actual needs, so as to reduce the development amount and standardize the development content; at the same time, the syntax tree defines the attribute specification of each atomic statement, including prompt, error reporting, pre-input detection, post-input detection and other standard contents, so that the atomic statement can have idempotence; the syntax tree consists of two parts: the invention is constructed based on the SSH, Telnet and other protocols of the network equipment, and an independent script syntax is constructed through the syntax tree, so as to realize; the invention supports that devices of different manufacturers and versions can use the same script to issue after command atomic encapsulation, thereby eliminating the manpower of writing different scripts for different devices and issuing them in batches through different tasks, realizing manufacturer shielding, and can carry out self-development and enrichment of atomic operation contents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of network automation, and in particular relates to a method for realizing network equipment automation based on compilation. Background Art

[0002] In network operation and maintenance, network automation operation and maintenance capabilities based on multiple categories, multiple brands, and multiple versions are currently available. This patent aims to solve the problems of insufficient initial development efforts, incomplete automation scope, and inability to adapt to all devices in network automation through language customization and self-organization, so that network automation function modules can be minimized to atomic operations and plug-and-play, which not only ensures the effectiveness of network automation development, but also provides a basic foundation for subsequent expansion. For existing technology, reference can be made to CN201510577739.3, a compilation method, compilation device, and controller for network service requests; this invention embodiment discloses a compilation method, compilation device, and controller for network service requests, which are used to realize the automatic compilation of user network requests in NaaS, thereby providing a basis for network automation deployment. The method of the embodiment of the invention includes: receiving a network service request submitted by a user, decomposing the network service request into a basic service tuple according to a preset decomposition rule, compiling the basic service elements in the basic service tuple to obtain a basic network element, and then processing the results of the compilation of the basic service elements in the basic service tuple to obtain a basic network element group; the technology is based on Neutron implementation and is only suitable for Openstack and its related networks, and cannot cope with the complex and changeable automation requirements of various network devices in data centers and branches; it only compiles for the connection between network service requests (triplets, quintuples), and cannot adapt to other types of network services in actual production, such as office business port opening, terminal access, etc., and cannot fully adapt to the actual production requirements of data centers. Summary of the invention

[0003] The purpose of the present invention is to provide a compilation-based network device automation implementation method to solve the problems raised in the above background technology.

[0004] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a compilation-based network equipment automation implementation method, which is applied to the automated operation and maintenance of data center networks, including a custom extensible syntax tree: the syntax tree designed according to the command structure of the network equipment can be flexibly expanded according to actual needs, reducing the development volume and standardizing the development content; at the same time, the syntax tree defines the attribute specifications for each atomic statement, including prompts, errors, pre-input detection, post-input detection and other standard contents, so that the atomic statement can have idempotence; the syntax tree consists of two parts: a core syntax tree and an extended syntax tree; the core syntax tree uses a tree data structure to define the meta-languages ​​that can be used by users to change the script; the core syntax tree is responsible for standardizing the commands of different types of equipment from all manufacturers, and the manufacturer's extended syntax tree implements commands at all levels through specifications, so as to achieve the purpose that the same set of meta-languages ​​can be applied to equipment of different brands of manufacturers, while ensuring flexibility, so that the same script can be used to issue commands for multi-brand equipment;

[0005] Compiler: The compiler renders the atomic statement into the corresponding configuration template according to its position in the syntax tree and the instance device attributes, generates the content to be sent, and compiles it into the corresponding device command;

[0006] Design distribution: The design distribution adopts the driver mode, which is also completed by rendering the configuration template. It supports Telnet, SSH, API and other forms. If you need to expand the support mode horizontally, you only need to add the configuration template to achieve plug-and-play.

[0007] Preferably, when writing a change script, the user must follow the definition of the core syntax tree, and each line must be able to match the definition of the core syntax tree.

[0008] Preferably, the manufacturer's extended syntax tree is implemented based on the core syntax tree, which is a subtree of the core syntax tree; by instantiating and commanding the nodes on the core syntax tree, the process of converting the primitive language into the configuration command is achieved.

[0009] Preferably, the compilation process of the compiler is as follows: the compilation process includes the following core steps: 1) compiling the core syntax tree; the core syntax tree verification is to generate a syntax tree entity class instance by traversing each item of the main configuration, thereby completing the construction of the core syntax tree of the tree data structure; if the static syntax check is successful, the syntax tree entity class is generated, otherwise the verification error information is recorded and the next cycle is entered; the overall core syntax tree static verification will verify each configuration item, summarize the error information and then return it to the caller, so it needs to complete the collection of all static verification error information at one time;

[0010] 2) Split and clean user change scripts;

[0011] 3) Generate user change tree;

[0012] Preprocess the user change script to generate a tree traversal structure; write it according to the meta-language defined in the core syntax tree. The change script needs to be written strictly according to the definition, otherwise the compilation will fail;

[0013] 4) Recursively associate the core syntax tree;

[0014] Recursively traverse the user change script generation tree in the core syntax tree to verify whether it complies with the syntax rules;

[0015] The user change script file requires the user change data file to be used. The user change data file provides the data of each parameter defined in the user change script;

[0016] 5) Generate manufacturer specific commands item by item;

[0017] By traversing the results, a command list with variable parameters is generated according to the traversal order;

[0018] 6) Generate commands to be issued based on data;

[0019] The final delivery command is generated through parameter replacement.

[0020] Preferably, the delivery layer defines an abstract interface applicable to various protocols and implements the main part of protocol processing, namely the protocol base class. The manufacturer extension package supports multiple protocols through subfolders and subclasses. Each protocol extension package must provide an inheritance class to support specific protocols. When a new protocol needs to be implemented, it needs to be implemented through the following steps:

[0021] 1) The issuing layer implements the protocol processing base class;

[0022] The base class design uses inheritable JSON configuration to configure the core parameters in the protocol interaction process;

[0023] 2) Each required vendor extension package adds the configuration issued by the vendor;

[0024] The manufacturer's extended configuration inherits from the base class configuration. The child configuration can redefine the main configuration items, and the configuration items will completely cover the configuration items of the parent configuration. Each manufacturer's expansion package needs to implement a copy of the manufacturer's extended configuration.

[0025] Compared with the prior art, the beneficial effects of the present invention are: 1. The present invention defines a syntax tree based on a language, and through the instantiation of the syntax tree, the current syntax tree for each type of equipment, each model, and each software version accurately defines the current automation capabilities of this type of equipment, and retains subsequent expansion capabilities.

[0026] 2. The present invention is built based on SSH, Telnet and other protocols of network equipment, and is implemented by building an independent script grammar through a syntax tree.

[0027] 3. The present invention supports the use of the same script to issue commands to devices of different manufacturers and versions after atomically encapsulating the commands, eliminating the need for writing different scripts for different devices and issuing them in batches through different tasks, achieving manufacturer shielding and enabling self-development of rich atomic operation content.

[0028] 4. The present invention defines basic attributes and extended attributes for each atomic operation, supports verification of each atomic operation before and after the operation, can perform error judgment and analysis, and judge whether the prompt of the issued command meets the requirements, thereby avoiding the erroneous issuance of the command. DETAILED DESCRIPTION

[0029] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0030] The present invention provides a technical solution: a compilation-based network equipment automation implementation method, which is applied to the network automation operation and maintenance of a data center, and includes a custom extensible syntax tree: the syntax tree designed according to the command structure of the network equipment can be flexibly expanded according to actual needs, reducing the development amount and standardizing the development content; at the same time, the syntax tree defines the attribute specifications of each atomic statement, including prompts, error reports, pre-input detection, post-input detection and other standard contents, so that the atomic statement can have idempotence; the syntax tree consists of two parts: a core syntax tree and an extended syntax tree; the core syntax tree uses a tree data structure to define the meta-languages ​​that can be used by the user to change the script; the core syntax tree is responsible for standardizing the commands of different types of equipment from all manufacturers, and the manufacturer's extended syntax tree implements commands at all levels through specifications, so as to achieve the purpose that the same set of meta-languages ​​can be applied to equipment of different brands of manufacturers, while ensuring flexibility, so that the same script can be used to issue commands for multi-brand equipment;

[0031] Compiler: The compiler renders the atomic statement into the corresponding configuration template according to its position in the syntax tree and the instance device attributes, generates the content to be sent, and compiles it into the corresponding device command;

[0032] Design distribution: The design distribution adopts the driver mode, which is also completed by rendering the configuration template. It supports Telnet, SSH, API and other forms. If you need to expand the support mode horizontally, you only need to add the configuration template to achieve plug-and-play.

[0033] In this embodiment, preferably, when writing a change script, the user must follow the definition of the core syntax tree, and each line must be able to match the definition of the core syntax tree.

[0034] In this embodiment, preferably, the manufacturer's extended syntax tree is implemented based on the core syntax tree, which is a subtree of the core syntax tree; by instantiating and commanding the nodes on the core syntax tree, the process of converting the primitive language into the configuration command is achieved.

[0035] In this embodiment, preferably, the compilation process is: the compilation process includes the following core steps: 1) compiling the core syntax tree; the core syntax tree verification is to generate a syntax tree entity class instance by traversing each item of the main configuration, thereby completing the construction of the core syntax tree of the tree data structure; if the static syntax check is successful, the syntax tree entity class is generated, otherwise the verification error information is recorded and the next cycle is entered; the overall core syntax tree static verification will verify each configuration item, and the error information will be summarized and then returned to the caller, so it needs to complete the collection of all static verification error information at one time;

[0036] 2) Split and clean user change scripts;

[0037] 3) Generate user change tree;

[0038] Preprocess the user change script to generate a tree traversal structure; write it according to the meta-language defined in the core syntax tree. The change script needs to be written strictly according to the definition, otherwise the compilation will fail;

[0039] 4) Recursively associate the core syntax tree;

[0040] Recursively traverse the user change script generation tree in the core syntax tree to verify whether it complies with the syntax rules;

[0041] The user change script file requires the user change data file to be used. The user change data file provides the data of each parameter defined in the user change script;

[0042] 5) Generate manufacturer specific commands item by item;

[0043] By traversing the results, a command list with variable parameters is generated according to the traversal order;

[0044] 6) Generate commands to be issued based on data;

[0045] The final delivery command is generated through parameter replacement.

[0046] In this embodiment, preferably, the issuing layer defines an abstract interface applicable to various protocols, and implements the main part of the protocol processing, namely the protocol base class. The manufacturer extension package implements the support of multiple protocols through subfolders and subclasses. Each protocol extension package must provide an inheritance class to implement support for specific protocols. When a new protocol needs to be implemented, it needs to be implemented through the following steps:

[0047] 1) The issuing layer implements the protocol processing base class;

[0048] The base class design uses inheritable JSON configuration to configure the core parameters in the protocol interaction process;

[0049] 2) Each required vendor extension package adds the configuration issued by the vendor;

[0050] The manufacturer's extended configuration inherits from the base class configuration. The child configuration can redefine the main configuration items, and the configuration items will completely cover the configuration items of the parent configuration. Each manufacturer's expansion package needs to implement a copy of the manufacturer's extended configuration.

[0051] Embodiment 1:

[0052] Target: Modify batch device configuration templates

[0053] Assumptions: The network point equipment needs to adjust the clock NTP server and other configurations, and needs to be modified uniformly, including different models of different manufacturers.

[0054] The specific implementation is as follows:

[0055] 1. Define a custom script. The first line of the script is a variable definition, which is used to replace the corresponding parameters.

[0056] 2. If there is an existing atomic statement, call it directly in the script; if a new atomic statement needs to be defined, add the corresponding atomic statement in the syntax tree configuration file according to the actual command.

[0057] 3. Select the device list, define the login information, and write the login information list.

[0058] 4. Pass in the script and parameters, specify the corresponding device, and automatically compile and send commands in batches.

[0059] 5. If you need to adjust the batch delivery content later, you only need to modify the script task without additional development.

[0060] Embodiment 2:

[0061] Implementation object: port opening operation

[0062] Assumption: The customer needs to open a port. After selecting the corresponding opening mode, the corresponding configuration is issued according to the corresponding device port to complete the configuration issuance.

[0063] The specific implementation is as follows:

[0064] 1. The customer fills out the port opening application and registers on the page.

[0065] 2. Automatically identify the network devices and ports to be operated.

[0066] 3. Call the corresponding script, automatically generate parameters, and call the compiler to generate the script.

[0067] 4. The script calls the driver to execute, and the port is automatically opened.

[0068] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for realizing network equipment automation based on compilation, characterized in that: Applied to data center network automation operation and maintenance, including custom extensible syntax trees: the syntax tree designed according to the command structure of network equipment can be expanded according to actual needs; at the same time, the syntax tree defines the attribute specifications for each atomic statement, including prompts, errors, pre-input detection, and post-input detection, so that the atomic statement has idempotence; the syntax tree consists of two parts: the core syntax tree and the manufacturer's extended syntax tree; the core syntax tree uses a tree data structure to define the meta-languages ​​that users can use to change the script; the core syntax tree is responsible for standardizing the commands of different types of equipment from all manufacturers, while the manufacturer's extended syntax tree implements commands at all levels through specifications, so that the same set of meta-languages ​​can be applied to equipment from different brands, so that the same script can be used to issue commands for multi-brand equipment; Compiler: The compiler renders the atomic statement into the corresponding configuration template according to its position in the syntax tree and the instance device attributes, generates the content to be sent, and compiles it into the corresponding device command; The compilation process of the compiler is as follows: The compilation process includes the following core steps: 1) compiling a core syntax tree; the core syntax tree verification is to generate a syntax tree entity class instance by traversing each item of the main configuration, thereby completing the construction of the core syntax tree of the tree data structure; If the static syntax check succeeds, the syntax tree entity class is generated, otherwise the check error information is recorded and the next cycle is entered; the core syntax tree static check will check each configuration item, summarize the error information and return it to the caller, which needs to complete the collection of all static check error information at one time; 2) Split and clean user change scripts; 3) Generate a user change script generation tree; Preprocess the user change script to generate a tree traversal structure; The change script is written according to the meta-language defined in the core syntax tree. The change script needs to be written strictly according to the definition, otherwise the compilation will fail; 4) Recursively associate the core syntax tree; Recursively traverse the user change script generation tree in the core syntax tree to verify whether it complies with the syntax rules; The user change script file requires the user change data file to be used. The user change data file provides the data of each parameter defined in the user change script; 5) Generate manufacturer-specific commands item by item; By traversing the results, a command list with variable parameters is generated according to the traversal order; 6) Generate commands to be issued based on data; Generate the final delivery command through parameter replacement; The delivery layer adopts the driver mode, which is completed by configuring template rendering and supports multiple forms such as Telnet, SSH, and API. If you need to expand the support mode horizontally, you only need to add the configuration template to achieve plug-and-play; The distribution layer defines abstract interfaces applicable to various protocols and implements the main part of protocol processing, namely the protocol base class. The vendor extension package supports multiple protocols through subfolders and subclasses. Each vendor extension package must provide an inheritance class to support specific protocols. When a new protocol needs to be implemented, it needs to be implemented through the following steps: 1) The issuing layer implements the protocol processing base class; The base class design uses inheritable JSON configuration to configure the core parameters in the protocol interaction process; 2) Each required vendor extension package adds the configuration issued by the vendor; The vendor extension configuration inherits from the base class configuration. The child configuration can redefine the parent configuration, and the configuration items of the child configuration will completely cover the configuration items of the parent configuration. Each vendor extension package needs to implement a vendor extension configuration.

2. A method for realizing network device automation based on compilation according to claim 1, characterized in that: When writing a change script, the user must follow the definition of the core syntax tree, and each line must be able to match the definition of the core syntax tree.

3. The method for realizing network device automation based on compilation according to claim 1, characterized in that: The vendor-extended syntax tree is implemented based on the core syntax tree and is a subtree of the core syntax tree. By instantiating and imperatively transforming the nodes on the core syntax tree, the process of converting the primitive language into configuration commands is achieved.