Network control command processing method, device and electronic equipment
By obtaining and verifying the command description file and converting the target command into the northbound interface, the problem of the SDN controller lacking a command line interface is solved, and simple and efficient network operation and maintenance are achieved.
Patent Information
- Application Number
- CN202310277627.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-03-17
AI Technical Summary
Existing SDN controllers lack a command line interface, resulting in unsupported network configuration commands, a lack of unified command standards, and complex configuration, which affects network operation and maintenance efficiency.
Provided are a network control command processing method and device, which obtains a command description file, performs a legality check, converts it into a target northbound interface, and sends it to a network controller for execution.
It enables network operation and maintenance personnel to control the entire network as simply and efficiently as controlling a single switch or router, alleviating the problems of unsupported network configuration commands, lack of unified command standards, and complex configuration.
Smart Images

Figure CN116319329B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software-defined network technology, and in particular to a network control command processing method, device and electronic equipment. Background Art
[0002] Generally, switches and routers provide a command line interface (CLI) for device configuration and management. This is achieved by entering command lines through an SSH terminal. This operation method is a common device operation and maintenance method used by network operators.
[0003] Today, network operations and management are oriented towards the network rather than individual devices. Software-defined network (SDN) controllers can be used to centrally manage and control a large number of software and hardware resources within the communication network. For network operations, SDN controllers generally provide programming interfaces (such as northbound interfaces like RESTful APIs), and some SDN controllers also provide a graphical user interface (GUI). However, SDN controllers do not provide a command line interface (CLI) for operations personnel. In actual network operations, the simplicity and efficiency brought by command line operations have been widely accepted by operations engineers. Network operations engineers hope to be able to control the entire network as simply, efficiently, and smoothly as they control a single switch or router through the CLI.
[0004] Although switches or routers currently provide CLIs, and command line operations have become the primary means of network operation and maintenance, the existing CLI command line operations have obvious disadvantages, including: (1) they do not support network configuration commands and only support single device configuration commands; (2) there is a lack of unified standards for commands, and commands from different manufacturers are different, and even different versions of commands from the same manufacturer may be different; (3) commands must be executed according to configuration views and levels, the configuration process is complex and has many parameters, and the operation efficiency is low. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a network control command processing method, device and electronic device to alleviate the problems existing in the related art such as lack of support for network configuration commands, lack of unified standards for commands, and complex command configuration.
[0006] In the first aspect, an embodiment of the present invention provides a network control command processing method, the method comprising: obtaining a command description file; wherein the command description file includes a command template library file and a command set file, the command template library file predefines the input syntax and output parameter format requirements of the command, and the command set file predefines the detailed content requirements of the command and the correspondence between the command and the northbound interface; performing a legitimacy check on the target command based on the command description file; if the legitimacy check passes, converting the target command into a corresponding target northbound interface based on the command description file; sending the target northbound interface to the network controller so as to execute the target northbound interface through the network controller.
[0007] In the second aspect, an embodiment of the present invention also provides a network control command processing device, which includes: an acquisition module for acquiring a command description file; wherein the command description file includes a command template library file and a command set file, the command template library file predefines the input syntax and output parameter format requirements of the command, and the command set file predefines the detailed content requirements of the command and the correspondence between the command and the northbound interface; a verification module for performing a legitimacy check on the target command based on the command description file; a conversion module for converting the target command into a corresponding target northbound interface based on the command description file if the legitimacy check passes; an execution module for sending the target northbound interface to the network controller so as to execute the target northbound interface through the network controller.
[0008] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned network control command processing method.
[0009] The embodiments of the present invention provide a network control command processing method, device, and electronic device. The method first obtains a command description file, then performs a validity check on the target command based on the command description file. If the validity check passes, the target command is converted into a corresponding target northbound interface based on the command description file, and the target northbound interface is sent to the network controller to execute the target northbound interface through the network controller. The above technology provides a universal command processing solution for network control, which allows network operation and maintenance personnel to control the entire network as simply, efficiently, and smoothly as controlling a single switch or router through the CLI, thereby alleviating problems existing in related technologies such as the lack of support for network configuration commands, the lack of unified command standards, and the complexity of command configuration.
[0010] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0011] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 Schematic diagram of a flow chart of a method for processing network control commands according to an embodiment of the present invention;
[0014] Figure 2 This is an example diagram of the overall architecture of a network control command processing device according to an embodiment of the present invention;
[0015] Figure 3 This is an example diagram of the workflow of a network control command processing device in an embodiment of the present invention;
[0016] Figure 4 This is a structural diagram of another network control command processing device according to an embodiment of the present invention;
[0017] Figure 5 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0019] Generally, switches and routers provide a command line interface (CLI) for device configuration and management. This is achieved by entering command lines through an SSH terminal. This operation method is a common device operation and maintenance method used by network operators.
[0020] Today, network operations and management are oriented towards the network rather than individual devices. Software-defined network (SDN) controllers can be used to centrally manage and control a large number of software and hardware resources within the communication network. For network operations, SDN controllers generally provide programming interfaces (such as northbound interfaces like RESTful APIs), and some SDN controllers also provide a graphical user interface (GUI). However, SDN controllers do not provide a command line interface (CLI) for operations personnel. In actual network operations, the simplicity and efficiency brought by command line operations have been widely accepted by operations engineers. Network operations engineers hope to be able to control the entire network as simply, efficiently, and smoothly as they control a single switch or router through the CLI.
[0021] Although switches or routers currently provide CLIs, and command line operations have become the primary means of network operation and maintenance, the existing CLI command line operations have obvious disadvantages, including: (1) they do not support network configuration commands and only support single device configuration commands; (2) there is a lack of unified standards for commands, and commands from different manufacturers are different, and even different versions of commands from the same manufacturer may be different; (3) commands must be executed according to configuration views and levels, the configuration process is complex and has many parameters, and the operation efficiency is low.
[0022] Based on this, the present invention provides a network control command processing method, device and electronic device, which can alleviate the problems existing in related technologies such as lack of support for network configuration commands, lack of unified standards for commands, and complex command configuration.
[0023] To facilitate understanding of this embodiment, a network control command processing method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method may include the following steps:
[0024] Step S102: Obtain a command description file.
[0025] The command description file can include a command template library file and a command set file. The command template library file predefines the command input syntax and output parameter format requirements, while the command set file predefines the detailed content requirements of the command and the correspondence between the command and the northbound interface. The northbound interface can be the interface defined by the manufacturer or operator to access and manage the network.
[0026] Step S104: verify the validity of the target command based on the command description file.
[0027] For example, a command line interface is provided through the terminal, and the operation and maintenance personnel can enter a line of command (i.e., the target command) on the command line interface. The terminal then reads the command definition information in the command description file (i.e., the input syntax and output parameter format requirements of the command in the command template library file and the detailed content requirements of the command in the command set file) and uses the read command definition information as a unified reference standard to perform a validity check on the input target command; if the target command does not meet the reference standard, the validity check fails (i.e., the validity check fails), and the target command can be determined as an illegal command; if the target command meets the reference standard, the validity check passes, and the target command can be determined as a legal command.
[0028] Step S106: If the validity check passes, the target command is converted into the corresponding target northbound interface based on the command description file.
[0029] For example, continuing with the previous example, after the terminal receives a line of legal target commands entered by the operation and maintenance personnel on the command line interface, the terminal will search for the target northbound interface corresponding to the target command based on the conversion information in the command description file (that is, the correspondence between the command and the northbound interface in the command set file). If it can be found, the target command will be converted into the corresponding target northbound interface. If it cannot be found, the target command conversion fails.
[0030] Step S108: Send the target northbound interface to the network controller so that the target northbound interface is executed by the network controller.
[0031] An embodiment of the present invention provides a network control command processing method, which first obtains a command description file, then performs a validity check on the target command based on the command description file. If the validity check passes, the target command is converted into a corresponding target northbound interface based on the command description file, and the target northbound interface is sent to the network controller to execute the target northbound interface through the network controller. The above technology provides a universal command processing solution for network control, which allows network operation and maintenance personnel to control the entire network in a simple, efficient, and smooth manner, just like controlling a single switch or router through the CLI, thereby alleviating problems existing in related technologies such as the lack of support for network configuration commands, the lack of unified command standards, and the complexity of command configuration.
[0032] As a possible implementation, the above-mentioned step S104 (i.e., performing a validity check on the target command based on the command description file) may include: (11) performing a first validity check on the input syntax and output parameters of the target command based on the command template library file; (12) performing a second validity check on the detailed content of the target command based on the detailed content requirements of the command in the command set file.
[0033] For example, continuing with the previous example, after the terminal receives a line of command (i.e., the target command) entered by the operation and maintenance personnel on the command line interface, the terminal will first parse the input syntax and output parameters of the target command, and perform a verification on the input syntax and output parameters of the target command according to the input syntax and output parameter format requirements of the command in the command template library file (i.e., perform a first legitimacy check); if the first legitimacy check fails, the target command can be determined as an illegal command; if the first legitimacy check passes, the terminal will further parse the detailed content of the target command, and further verify the detailed content of the target command according to the detailed content requirements of the command in the command set file (i.e., perform a second legitimacy check); if the second legitimacy check fails, the target command can be determined as an illegal command; if the second legitimacy check passes, the target command can be determined as a legal command.
[0034] As a possible implementation method, the above-mentioned northbound interface can be a Restful interface; based on this, the above-mentioned step of converting the target command into the corresponding target northbound interface based on the command description file may include: based on the correspondence between the command and the northbound interface in the command set file, converting the target command into the corresponding target northbound interface.
[0035] For example, continuing with the previous example, the command set file predefines the correspondence between commands and RESTful interfaces. After the terminal receives a line of legal target commands entered by the operation and maintenance personnel on the command line interface, the terminal will search for the RESTful interface corresponding to the target command based on the correspondence between commands and RESTful interfaces in the command description file. If it can be found, the target command is converted into the corresponding RESTful interface found. If it cannot be found, the target command conversion fails. When the target command conversion fails, a message reminder of the conversion failure can also be sent to inform the operation and maintenance personnel of the conversion failure.
[0036] As a possible implementation method, the above-mentioned network control command processing method may further include: (21) defining the input syntax and output parameter format requirements of the command in the command template library file through the RPC (Remote Procedure Call) of the YANG model; wherein the input syntax includes command action, command object type and command parameters; (22) defining the detailed content requirements of the command in the command set file and the correspondence between the command and the northbound interface through JSON; wherein the detailed content requirements include regular requirements of the command action name, command object type name and parameter value.
[0037] For example, continuing with the previous example, an NLI (Network Language Interface) command consists of a string, and its input syntax includes command action (action), command object (object), command object type (objecttype), and command parameters (parameters). The command action name, command object type name, and command parameter name are keywords and cannot be changed after definition, and all keywords are lowercase. The input syntax of the NLI command is defined as follows: in action, add represents an add operation, del represents a delete operation, set represents a set operation, get represents a read operation, up represents a start, down represents a shutdown, pull represents a pull / find, find represents a search, show represents a display, and ping represents a check for network connectivity. In the object type field, domain represents a network domain, net represents a network, subnet represents a subnet, slice represents a slice, node represents a node, vnode represents a virtual node, vnf represents a network function container, link represents a link, path represents a path, tunnel represents a tunnel, l3vpn represents an L3VPN service, and l2vpn represents an L2VPN service. [key=value]* represents one or more command parameters. Keys are lowercase. Values can be in array list format, such as [value1, value2]. Values can be in JSON object string format, such as {"name":"nihao","age":20}.
[0038] The command template library file can define the basic syntax elements of NLI commands, action, object, and parameters, through the RPC of the YANG model. The code sample is as follows:
[0039]
[0040]
[0041]
[0042] The command set file can define the detailed content requirements of the NLI command through JSON. The detailed content requirements can include the action name, object type name, parameter name and parameter value regular expression requirements. The code sample is as follows:
[0043]
[0044]
[0045] In the preceding code example, "value-pattern": "^.{1,64}$" specifies a regular expression for a parameter value, meaning that the parameter value must be within the byte length range of 1 to 64 bits.
[0046] The command set file also provides information on how to convert NLI command keywords to RESTful interfaces and their parameters, such as the corresponding information for "api" and "api-key" in the preceding code example.
[0047] If the above command template library file and command set file are imported into a network controller that interacts with NLI commands, the network controller can parse, verify and convert the NLI commands according to the relevant definitions.
[0048] As a possible implementation method, after the above-mentioned step S102 (i.e., obtaining the command description file), the above-mentioned network control command processing method may further include: (31) identifying the command of the input keyword based on the command description file; (32) if the identification is successful, determining the identified command containing the keyword as the target command, and executing the above-mentioned step of converting the target command into the corresponding target northbound interface based on the command description file.
[0049] For example, continuing with the previous example, after the terminal receives a line of keywords (such as the beginning string of a command) input by the operation and maintenance personnel, the terminal will search for the only complete line of commands containing the keywords according to the pre-defined information in the command description file (that is, the command of the input keyword is identified). If the complete command can be found (that is, the identification is successful), the terminal will determine the found complete command as the target command, and convert the target command into the corresponding Restful interface according to the correspondence between the command and the Restful interface in the command description file.
[0050] As a possible implementation method, the above-mentioned network control command processing method may further include: (41) performing SSH authentication on the input user login information; wherein the user login information may include a user name and / or a user login password; (42) if the SSH authentication passes, the login is successful; if the SSH authentication fails, the login fails.
[0051] For example, continuing with the previous example, after the terminal receives the username and user login password input by the operation and maintenance personnel, it will perform SSH authentication on the input username and user login password; if the SSH authentication passes, the login is successful, and the user to which the input username and user login password belong can be determined as a legal user; if the SSH authentication fails, the login fails, and the user to which the input username and user login password belong can be determined as an illegal user. Using this operation method, the terminal only allows users who have passed the SSH authentication (i.e., legal users) to log in successfully, and only users who have successfully logged in have the authority to enter commands, and the terminal can only execute commands entered by users who have successfully logged in. In addition, when the SSH authentication fails, the terminal can also send a corresponding message reminder so that the operation and maintenance personnel know that the SSH authentication has failed.
[0052] As a possible implementation, the network control command processing method may further include: storing the command description file in a preset command library; wherein the preset command library may be a structured database or an unstructured database. Based on this, the above step S102 (i.e., obtaining the command description file) may include: reading the command description file from the preset command library.
[0053] For example, continuing with the previous example, a structured database or an unstructured database can be pre-established as an NLI command library, and the template library file defined by the RPC of the YANG model and the command set file defined by JSON can be imported into the NLI command library according to the standards of the Yang model and JSON, so that the required files can be read from the NLI command library file later.
[0054] As a possible implementation method, after the above-mentioned step S108 (i.e., sending the target northbound interface to the network controller so as to execute the target northbound interface through the network controller), the above-mentioned network control command processing method may also include: obtaining and displaying the process data and / or result data of the network controller executing the target northbound interface.
[0055] For example, continuing with the previous example, when the terminal executes the Restful interface converted from the command entered by the operation and maintenance personnel (i.e., the target command), the terminal will obtain the data generated during the execution process and the data generated after the execution is completed, and display the obtained data through the display screen.
[0056] Based on the above network control command processing method, the embodiment of the present invention provides a network control command processing device by taking a specific application as an example. Figure 2As shown in the figure, the overall architecture of the device is an independent application functional entity operated by an SDN controller (which can be a single domain controller for a specific private network domain or a central controller that provides multi-domain management of the entire network). The specific way the SDN controller manages the network can be selected according to the actual situation of the network, such as using CLI, Netconf, SNMP, Restful API, etc., and there is no limitation on this. The device provides a universal NLI that allows network operation and maintenance personnel (i.e. Figure 2 Operators in the network can manage the entire network simply and efficiently through NLI command line operations, just like managing a single router or switch.
[0057] For ease of understanding, Figure 3 The execution process of the network control command processing device is described as follows. Figure 3 As shown, the device may include an NLI command loading module, an NLI command library, an NLI user authentication and authorization module, an NLI command parsing module, an NLI command translation module and an NLI command execution module.
[0058] Figure 3 The NLI command description file defines the input syntax and output parameter format requirements of the NLI command and the detailed parameter requirements of the specific NLI command.
[0059] Specifically, the NLI command description file can include the NLI command template library file and the NLI command set file. The NLI command template library file defines the input syntax and output parameter format requirements of the NLI command through the RPC of the YANG model. The NLI command set file defines the regular requirements of the NLI command action name, object type name, parameter name and parameter value through JSON, as well as the conversion information from the NLI command keyword to the Restful interface and its parameters.
[0060] In addition, the NLI command description file may also be defined and described using other specifications, which is not limited to this. For example, the NLI command template library file may be described using YAML, and the NLI command set file may be described using XML Schema.
[0061] Figure 3 In the present invention, the NLI command loading module is used to read the NLI command description file, and import the NLI command template library file and the NLI command set file contained in the NLI command description file into the pre-established NLI command library.
[0062] Specifically, the input of the NLI command loading module can be an NLI command description file. The processing process of the NLI command loading module may include: reading the NLI command description file through the file import interface provided by the NLI command loading module, and importing the NLI template library file and the NLI command set file into the relevant specified NLI command library according to the Yang model and JSON standards; wherein the NLI command library can adopt a traditional structured database or an unstructured database. The output of the NLI command loading module can be the import result of the NLI command description file (import success or import failure).
[0063] Figure 3 The NLI user authentication and authorization module is used to determine whether the logged-in user is a legitimate user and has the authority to execute relevant commands through SSH authentication and command authorization verification.
[0064] Specifically, the input of the NLI user authentication and authorization module may include: the user name and / or user login password entered by the operator (i.e., the operation and maintenance personnel), and the command entered by the operator. The processing process of the NLI user authentication and authorization module may include: SSH authentication of the input user name and / or user login password to determine whether the user is a legitimate user and whether he has the authority to execute relevant commands; only users who pass the SSH authentication are legitimate users (i.e., users with the relevant command execution authority), only legitimate users can successfully log in, and only users who successfully log in can input and execute subsequent commands. Otherwise, a reminder message of "no command execution authority" is returned, and the execution of subsequent commands is rejected. The output of the NLI user authentication and authorization module may include: SSH authentication passed, login successful; SSH authentication failed, login failed; if the input NLI command passes the command authorization check, the input NLI command can be executed; if the input NLI command does not pass the command authorization check, the input NLI command cannot be executed.
[0065] Figure 3 In the NLI command parsing module, the NLI command parsing module is used to verify the legality of the input NLI command according to the command definition information in the NLI command library.
[0066] Specifically, the input of the NLI command parsing module may include an input command line. The processing process of the NLI command parsing module may include: reading command definition information from the NLI command library, parsing the input NLI command, and performing a validity check on the input NLI command. The output of the NLI command parsing module may include: outputting a "Command Error" reminder message if the input NLI command fails the validity check; and using the parsed complete NLI command as input to the NLI command translation module if the input NLI command passes the validity check.
[0067] In addition, the NLI command parsing module can also provide some friendly processing functions for input assistance, as described below:
[0068] 1) Input auxiliary function of the “?” key.
[0069] That is, for the partial command field entered, the remaining command parameter prompts of the complete command are given. For example, for the input information "add node? <Enter>", the prompt information "add node name=$ip=$" is given.
[0070] 2) Input auxiliary function of command history.
[0071] That is, the command record that has been entered is displayed. For example, for the input message "history <Enter>", the command record that has been entered is displayed.
[0072] 3) Input assistance function for reusing historical commands.
[0073] This means reusing the specified command from the command history. For example, if you enter "!100", the command numbered 100 in the command history is retrieved as the current command to be executed.
[0074] 4) Input auxiliary function: Use the up and down arrow keys to browse the history commands, and the left and right arrow keys to browse the parameter contents of the same history command.
[0075] Use the up and down arrow keys to scroll through the command history, and use the left and right arrow keys to scroll through the parameters of the same command. For example, if the command history is "add l3vpn name=cctv endp=[10.10.20.1 / eth1.1.1,10.10.30.1 / eth1.1.1]bw=100M" and the current input is "add l3vpn name=cctvendp=," if you continue typing with the right cursor, [10.10.20.1 / eth1.1.1,10.10.30.1 / eth1.1.1] will be automatically listed, eliminating the need to enter the lengthy string.
[0076] 5) Input assistance function that provides prompts for missing required items.
[0077] That is, when the required items required for a complete command are missing content input, a corresponding prompt message will be given.
[0078] 6) Input assistance functions for valid value detection and violation prompts.
[0079] That is, it detects whether the input information is valid information related to the complete command, and gives a corresponding prompt message when the input information is not valid information (that is, the input information violates the rules).
[0080] Based on the above input assistance function, the input of the NLI command parsing module may also include some fields involved in the above input assistance function, and the output of the NLI command parsing module may also include a complete command (ie, auxiliary command) generated after parsing some of the input fields.
[0081] Accordingly, the detailed processing of the NLI command parsing module can include the following parts:
[0082] A) Intelligent recognition and completion of keyword phrases.
[0083] That is, for an input keyword (such as the beginning of a string), as long as the input keyword can uniquely identify the complete command, the complete command can be recognized even if other information is omitted. For example, for the input information "sh", the unique command "show" can be recognized, so "sh" can be directly completed to "show".
[0084] B) NLI command syntax check.
[0085] That is, based on the definition information of the NLI command template library file, the various contents of the input NLI command are checked. If the input command is illegal, a reminder message of "command input error" is returned.
[0086] C) Command parameter value verification.
[0087] That is, check the parameter type and value range. If they are illegal, an error will be returned.
[0088] D) Default parameter auto-completion.
[0089] That is, according to the definition information in the NLI command set file, the relevant default parameters are automatically completed and then sent to the NLI command translation module.
[0090] Figure 3 In the NLI command translation module, after receiving the parsed complete NLI command, it translates the simplified NLI command into a Restful API that interfaces with the SDN controller based on the interface conversion information of the relevant commands in the NLI command library.
[0091] Specifically, the input of the NLI command translation module can be an NLI command processed by the command parsing module. The processing process of the NLI command translation module may include: after receiving a legal NLI command, translating the parsed NLI command into the corresponding Restful API according to the conversion information in the NLI command set file; if the translation fails, returning a reminder message of "NLI command translation failed" and the NLI command exits. The translation content includes: the Restful interface name, which can be specifically the api project content of the relevant command structure from the NLI command set file; the Restful interface parameters, which can be specifically the api-key content of the relevant command structure from the NLI command set file. The output of the NLI command translation module may include: the Restful API for docking the SDN controller, or returning an error reminder message of command translation failure.
[0092] Figure 3 In the NLI command execution module, the NLI command execution module is used to send the translated Restful API to the SDN controller for execution and return the execution result.
[0093] Specifically, the input of the NLI command execution module can be a RESTful API. The processing process of the NLI command execution module may include: sending the translated RESTful API to the SDN controller for execution, and obtaining the execution result returned by the SDN controller. The output of the NLI command execution module may be: the execution result of the RESTful API, or a response due to an execution timeout.
[0094] The above-mentioned network control command processing device can also use the back-end system to identify a unique command ID for each command input by the user, and give an echo after the user enters the command, such as displaying the command ID in the form of "COMMAND-ID=#####".
[0095] The network control command processing device can also provide a display function for the RESTful API execution process. Specifically, after the command is issued, the command input terminal will wait for the command to complete execution, during which time it can output intermediate process results or information. If there are no intermediate results for a long time, a dot will be output every 10 seconds, as shown in the following code example:
[0096] …
[0097] Processing information / output
[0098] …
[0099] The above-mentioned network control command processing device can also provide a display function for the execution results of the Restful API.
[0100] If the Restful API is successfully executed, the code sample of the Restful API execution result is as follows:
[0101] =====================
[0102] SUCCESS
[0103] This example shows that the RESTful API was successfully executed.
[0104] If the RESTful API fails to execute, the code sample of the RESTful API execution result is as follows:
[0105] =====================
[0106] FAIL
[0107] Error Code:#####
[0108] Error Message:#####
[0109] This example indicates the RESTful API failure, failure code, and failure reason.
[0110] The above-mentioned network control command processing device can also provide an exception handling function. Specifically, it can include a timeout handling function and a terminal closing function. The timeout handling function specifically involves: if the command has not been completed for a long time, the command echo can be manually terminated by entering Ctrl+C in the command terminal, but this does not affect the actual execution of the command background. The terminal closing function specifically involves: since terminal closing does not affect the execution of the sent command, the user can close the current command input terminal and then start a new terminal to enter the relevant command to view the corresponding information.
[0111] The above-mentioned network control command processing device can also provide an operation log recording function, so as to make a complete record of the execution process of each of the above-mentioned modules, including the input commands, execution results, etc., which can facilitate audit review of operation and maintenance management.
[0112] For the above network control command processing device, you can follow Figure 2 The process shown is deployed and applied to the SDN controller. Specifically, the network control command processing device opens an SSH service port for network operation and maintenance command line interaction and provides an NLI command description file import interface. The interface opened internally by the network control command processing device is the RESTful API for connecting to the SDN controller.
[0113] The network control command processing device can be integrated into the SDN network controller system in one of the following two ways:
[0114] (1) Integrated module method.
[0115] For an SDN controller whose software module architecture is implemented in an OSGi module integration manner, such as OpenDaylight, each module of the above-mentioned network control command processing device can be loaded into the SDN controller in the form of a feature module.
[0116] (2) Distributed mode.
[0117] For cloud-based SDN controller platforms, a microservice architecture is generally adopted. Therefore, the various modules of the above-mentioned network control command processing device can be deployed on the SDN controller platform in a microservice manner. For example, as a Docker application container, services are provided by publishing application service interfaces.
[0118] The CLIs of traditional routers and switches lack support for network-level function configuration. However, the network control command processing device described above can provide network-level function configuration and, combined with traditional manual configuration methods using command lines by network operations engineers or the currently popular DevOps script-based operation and maintenance management methods, achieve the effect of controlling and maintaining network-level functions through command-line operations. The following describes some specific issues and application scenarios.
[0119] (1) Various issues facing network operation and maintenance
[0120] SDN controllers are widely used in software-defined networks (SDNs). Much of network operations and maintenance (O&M) involves operating SDN controllers. While SDN controllers typically feature graphical user interfaces (GUIs), traditional command-line operations are popular with O&M personnel for their simplicity and efficiency, and are particularly well-suited for programmable network functions and automated network operations. As networks become increasingly complex, simple, unified command-line operations are becoming increasingly important. Specific challenges in network operations and maintenance include:
[0121] 1. Deployment: Controllers can manage multi-domain and multi-layer networks, and currently all adopt on-site zero configuration. The control center implements network automation or semi-automatic network discovery and initial startup configuration.
[0122] 2. Commissioning: In a complex, multi-vendor, heterogeneous network, the control center must initiate pre-test drills to ensure normal operation of the network after commissioning.
[0123] 3. Activation: How to efficiently activate cross-domain network services without requiring operations personnel to remember various complex configuration items and implement lengthy configurations of separate networks, segments, and devices.
[0124] 4. Diagnosis: Rapidly locating and troubleshooting network problems is an important task in operation and maintenance. There is an urgent need for simple and effective tools like ping to perform domain-, layer-, and segment-based diagnosis of large networks.
[0125] 5. Tuning: During operation and maintenance, it is necessary to tune the network with degraded performance. Initiate network performance tests through commands and use monitoring tools to adjust the network operation to a better state.
[0126] 6. Upgrade: It can provide flexible upgrades like Internet facilities, such as AB testing, grayscale release, etc. And the upgrade commands are simplified.
[0127] 7. Cutover: Complex cutover work can be directly performed through command scripts, which is simple and efficient.
[0128] 8. Expansion: A simple command is required to execute, just like installing a complex software, which includes the entire process in the complete execution and outputs the execution results of key steps.
[0129] To address these issues, NLI command description files can be defined. These files are then loaded by the network control command processing device and successfully connected to the northbound interface of the SDN controller. This provides network operators with an efficient and concise way to perform network-level NLI operation and maintenance command line operations. Complex issues can be resolved with just a few NLI commands. Furthermore, NLI can be integrated with popular DevOps automation scripting languages, such as Ansible, to provide a solution for programmable and automated network operation and maintenance management.
[0130] (2) List of application scenarios for network operation and maintenance
[0131] The various network operation and maintenance issues mentioned above can be addressed by importing relevant command description files through the NLI command loading module in the network control and management command processing device. Specifically, the network control and management command processing device supports NLI commands for the various application scenarios listed below, enabling simpler and more efficient operation and maintenance than through the network management interface.
[0132] 1. Network discovery.
[0133] First, complete the construction of the basic physical network, and then complete the connection of the management and control channel between the SDN controller and the physical network. You can use the following network discovery NLI command "#pull network name=new-network gateway=10.1.1.1" on the SDN controller to instruct the SDN controller to extract network topology information from the gateway network element 10.1.1.1 and establish the new network.
[0134] 2. Add network elements.
[0135] The user can add a network element by entering the network element name, type and network element management address. The code sample for entering the NLI command is as follows:
[0136] #add node name=nodeA type=A1 ip=10.10.10.1
[0137] 3. Create a subnet.
[0138] The following is a sample code for entering the NLI command:
[0139] #add subnet name=core-network node=[10.10.10.1,10.10.10.2]
[0140] This NLI command instructs the SDN controller to create the subnet core-network and add 10.10.10.1 and 10.10.10.2 to the subnet.
[0141] 4. Add a link.
[0142] The user can manually create a physical link by entering the ports at both ends of the link. The code sample for entering the NLI command is as follows:
[0143] #add link source=nodeA-eth0 / 1 / 1dest=nodeZ-eth0 / 1 / 1
[0144] 5. Create a cross-domain tunnel.
[0145] The following is a sample code for entering the NLI command:
[0146] #add tunnel name=new-tunnel endpoints=[10.10.10.1,11.11.11.1]
[0147] The NLI command indicates that the SDN controller establishes a tunnel between nodes in two different network domains.
[0148] 6. Create L3VPN services.
[0149] The following is a sample code for entering the NLI command:
[0150] #add l3vpn name=cctv endp=[10.10.20.1 / eth1.1.1,10.10.30.1 / eth1.1.1]bw=100M
[0151] This NLI command instructs the SDN controller to create the Layer 3 VPN service cctv and configure the service interface and bandwidth.
[0152] 7. Tunnel diagnosis.
[0153] The following is a sample code for entering the NLI command:
[0154] #ping tunnel name=new-tunnel from=10.10.10.1
[0155] The NLI command initiates a ping test from 10.10.10.1 on the tunnel new-tunnel.
[0156] 8. Display serious alarms in the network.
[0157] The following is a sample code for entering the NLI command:
[0158] #show alarm severity=critical
[0159] 9. Path calculation.
[0160] The following is a sample code for entering the NLI command:
[0161] #find path from=nodeA to=nodeZ policy=bw
[0162] The NLI command indicates that the most suitable path from nodeA to nodeB is found according to the specified strategy.
[0163] The above-mentioned network control command processing device has abandoned the drawbacks of arbitrary development of CLI command lines of traditional equipment from the beginning of its definition for the general command line of the SDN controller. It uses the standardized YANG model to define the general command line framework, uses simple keywords to facilitate user memory and operation, uses command description files to define the specifications of specific commands, and calls the controller's northbound interface to execute specific commands.
[0164] For example, traditional command line port configuration requires entering the following command line:
[0165] interface GigabitEthernet1 / 0 / 1
[0166] port link-type trunk
[0167] port trunk allow-pass vlan 2
[0168] If the network control command processing device is deployed on an SDN controller, you only need to enter the following command:
[0169] set port id=nodeid.ge1 / 0 / 1link-type=trunk allow-vlan=2
[0170] The network control command processing device provides a convenient way for network operators to perform network-level operations. For example, to create an end-to-end SRTE tunnel spanning multiple devices, one only needs to enter the following command into the SDN controller:
[0171] add tunnel name=t1 type=srte from=node1 to=node2
[0172] This type of network-level end-to-end configuration command ensures consistent command definition standards during the command description file definition phase, making the commands simple, efficient, and easy to remember. Traditional single-device CLIs lack this functional support and can only be implemented by entering CLI configuration commands separately on multiple related network device nodes. This process is cumbersome, inefficient, and prone to errors.
[0173] Based on the above network control command processing method, the embodiment of the present invention also provides another network control command processing device, see Figure 4 As shown, the device may include the following modules:
[0174] Acquisition module 402 is used to obtain a command description file; wherein, the command description file includes a command template library file and a command set file, the command template library file predefines the input syntax and output parameter format requirements of the command, and the command set file predefines the detailed content requirements of the command and the correspondence between the command and the northbound interface.
[0175] The verification module 404 is configured to verify the validity of the target command based on the command description file.
[0176] The conversion module 406 is configured to convert the target command into a corresponding target northbound interface based on the command description file if the validity check passes.
[0177] The execution module 408 is configured to send the target northbound interface to a network controller so that the target northbound interface is executed by the network controller.
[0178] An embodiment of the present invention provides a network control command processing device that first obtains a command description file, then performs a validity check on the target command based on the command description file. If the validity check passes, the target command is converted into a corresponding target northbound interface based on the command description file, and the target northbound interface is sent to the network controller so that the target northbound interface is executed by the network controller. The above technology provides a universal command processing solution for network control, which allows network operation and maintenance personnel to control the entire network in a simple, efficient, and smooth manner, just like controlling a single switch or router through the CLI, thereby alleviating problems existing in related technologies such as the lack of support for network configuration commands, the lack of unified command standards, and the complexity of command configuration.
[0179] The above-mentioned verification module 404 can also be used to: perform a first validity check on the input syntax and output parameters of the target command based on the command template library file; and perform a second validity check on the detailed content of the target command based on the detailed content requirements of the command in the command set file.
[0180] The above-mentioned northbound interface can be a Restful interface; based on this, the above-mentioned conversion module 406 can also be used to: convert the target command into a corresponding target northbound interface based on the correspondence between the command in the command set file and the northbound interface.
[0181] See also Figure 4 As shown, the device may also include:
[0182] Definition module 410 is used to: define the input syntax and output parameter format requirements of the commands in the command template library file through the RPC of the YANG model; wherein the input syntax includes command action, command object type and command parameters; define the detailed content requirements of the commands in the command set file and the correspondence between the commands and the northbound interface through JSON; wherein the detailed content requirements include regular requirements for command action name, command object type name and parameter value.
[0183] The determination module 412 is used to: identify the command of the input keyword based on the command description file; if the identification is successful, determine the identified command containing the keyword as the target command, and execute the step of converting the target command into the corresponding target northbound interface based on the command description file.
[0184] The authentication module 414 is used to perform SSH authentication on the input user login information, wherein the user login information includes a user name and / or a user login password. If the SSH authentication passes, the login is successful; if the SSH authentication fails, the login fails.
[0185] The storage module 416 is configured to store the command description file in a preset command library, wherein the preset command library is a structured database or an unstructured database.
[0186] The acquisition module 402 may also be configured to read the command description file from the preset command library.
[0187] See also Figure 4 As shown, the device may include:
[0188] The display module 418 is configured to obtain and display process data and / or result data of the network controller executing the target northbound interface.
[0189] The network control command processing device provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned network control command processing method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.
[0190] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it is a structural diagram of the electronic device, wherein the electronic device includes a processor 51 and a memory 50, the memory 50 stores computer executable instructions that can be executed by the processor 51, and the processor 51 executes the computer executable instructions to implement the above-mentioned network control command processing method.
[0191] exist Figure 5 In the illustrated embodiment, the electronic device further includes a bus 52 and a communication interface 53 , wherein the processor 51 , the communication interface 53 and the memory 50 are connected via the bus 52 .
[0192] Among them, the memory 50 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 52 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0193] The processor 51 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method may be performed by hardware integrated logic circuits or software instructions in the processor 51. The processor 51 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor 51 reads the information in the memory and completes the steps of the network control command processing method of the aforementioned embodiment in combination with its hardware.
[0194] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0195] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0196] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0197] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A network control command processing method, characterized in that: The method comprises: The input syntax and output parameter format requirements of the command in the command template library file are defined through the RPC of the YANG model; wherein the input syntax includes command action, command object type and command parameters; The detailed content requirements of the commands in the command set file and the correspondence between the commands and the northbound interface are defined using JSON; wherein the detailed content requirements include regular requirements for the command action name, command object type name, and parameter values, and the northbound interface is a RESTful interface; Obtaining a command description file; wherein the command description file includes the command template library file and the command set file; Recognizing commands based on the input keywords in the command description file; If the recognition is successful, the recognized command containing the keyword is determined as a target command, and the legitimacy of the target command is verified based on the command description file; If the legitimacy check passes, converting the target command into a corresponding target northbound interface based on the correspondence between the command and the northbound interface in the command description file; The target northbound interface is sent to a network controller so that the target northbound interface is executed by the network controller.
2. The method according to claim 1, characterized in that The step of performing a validity check on the target command based on the command description file includes: Based on the command template library file, performing a first legitimacy check on the input syntax and output parameters of the target command; Based on the detailed content requirements of the command in the command set file, a second legality check is performed on the detailed content of the target command.
3. The method according to claim 1, characterized in that The method further comprises: Perform SSH authentication on the input user login information; wherein the user login information includes a user name and / or a user login password; If SSH authentication passes, the login is successful; if SSH authentication fails, the login fails.
4. The method according to claim 1, wherein The method further comprises: Storing the command description file in a preset command library; wherein the preset command library is a structured database or an unstructured database; The steps to obtain a command description file include: The command description file is read from the preset command library.
5. The method according to claim 1, characterized in that After sending the target northbound interface to the network controller so as to execute the target northbound interface through the network controller, the method further includes: Acquire and display process data and / or result data of the network controller executing the target northbound interface.
6. A network control command processing device, characterized in that: The device comprises: A definition module is used to: define the input syntax and output parameter format requirements of the commands in the command template library file through the RPC of the YANG model; wherein the input syntax includes the command action, command object type, and command parameters; define the detailed content requirements of the commands in the command set file and the correspondence between the commands and the northbound interface through JSON; wherein the detailed content requirements include the regular requirements of the command action name, command object type name, and parameter value, and the northbound interface is a RESTful interface; An acquisition module, configured to acquire a command description file; wherein the command description file includes the command template library file and the command set file; a determination module, configured to: identify a command based on the input keyword in the command description file; if the identification is successful, determine the identified command containing the keyword as a target command; A verification module, configured to verify the validity of the target command based on the command description file; A conversion module, configured to convert the target command into a corresponding target northbound interface based on the correspondence between the command and the northbound interface in the command description file if the legitimacy check passes; The execution module is used to send the target northbound interface to the network controller so that the target northbound interface is executed by the network controller.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, related equipment and computer storage medium
CN111723036A