Method for configuring router equipment

By building a semantic analysis model based on CLI command syntax, allowing configuration commands to be entered in natural language in the router configuration interface, the problem of inconvenience in CLI configuration is solved, the intuitiveness and efficiency of configuration is improved, and the accuracy of configuration is enhanced.

CN119152843APending Publication Date: 2024-12-17BEIJING INHAND NETWORKS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310711664.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, it is inconvenient to configure router equipment in CLI, especially for non-professional personnel, which is not intuitive and easy to use, which may lead to misconfiguration and network failures, and inefficient batch configuration.

Method used

A semantic analysis model based on CLI command syntax is built, allowing configuration commands to be input in natural language in the router configuration interface, corresponding CLI commands are generated through the semantic analysis model, and configuration is executed, improving configuration intuitiveness and efficiency.

Benefits of technology

Entering configuration commands through natural language, generating and executing router configuration CLI commands improves the intuitiveness of router configuration and the efficiency of batch configuration, reduces the risk of misconfiguration, and enhances configuration accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152843A_ABST
    Figure CN119152843A_ABST
Patent Text Reader

Abstract

The invention discloses a method for configuring router equipment. The method comprises the following steps: constructing a semantic analysis model based on CLI command grammar; inputting a configuration command in a natural language on a router configuration interface; after receiving the configuration command, the router calls a semantic analysis model interface and inputs the configuration command into a semantic analysis model; generating a corresponding router configuration CLI command by the semantic analysis model according to the input configuration command; returning the router configuration CLI command to the router configuration interface so as to wait for confirmation; when the router configuration CLI command is confirmed, the router configuration CLI command is input to a router configuration service, and the router configuration CLI command is executed; and returning a router configuration execution result to the router configuration interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer networks, and in particular to a method for configuring router equipment. Background Art

[0002] The router device is one of the essential network devices in the computer network. It is responsible for connecting different networks to achieve information transmission and exchange. For the configuration of router devices, the traditional methods include Web interface configuration and CLI configuration.

[0003] Web interface configuration is a router configuration method based on a graphical user interface (GUI). Users can access the router's management interface through a web browser to perform configuration operations. Web interface configuration has advantages such as intuitiveness and ease of use, but it also has some disadvantages: the interface design is simple and the configuration flexibility is poor; it is inefficient for large-scale configuration; for routers from different manufacturers, the interface style and configuration method are different, and users need to relearn.

[0004] CLI configuration is a router configuration method based on the command line interface (CLI). Users can configure the router by entering corresponding commands on the CLI. CLI configuration has the following advantages: high configuration flexibility and strong customizability; batch configuration can be achieved through scripts, which is highly efficient; and it is not affected by interface differences. However, CLI configuration also has some shortcomings: it is not intuitive and easy to use for non-professionals; it requires mastering certain CLI command syntax; and incorrect configuration may occur, leading to network failures.

[0005] It can be seen that in the prior art, a new method for configuring router devices needs to be provided, so that CLI configuration can be more easily used by users, thereby improving the work efficiency and accuracy of batch router configuration. Summary of the invention

[0006] The invention provides a method for configuring a router device, which solves the problem that the current router is inconvenient to configure using a CLI command line.

[0007] To achieve the above technical objectives, the present invention provides a method for configuring a router device, the method comprising:

[0008] Build a semantic analysis model based on CLI command syntax;

[0009] Enter configuration commands in natural language on the router configuration interface;

[0010] After receiving the configuration command, the router calls the semantic analysis model interface and inputs the configuration command into the semantic analysis model;

[0011] The semantic analysis model generates the corresponding router configuration CLI command according to the input configuration command; and returns the router configuration CLI command to the router configuration interface to wait for confirmation;

[0012] When the router configuration CLI command is confirmed, the router configuration CLI command is input into the router configuration service, and the router configuration CLI command is executed;

[0013] The router configuration execution result is returned to the router configuration interface.

[0014] In one embodiment, the construction of the semantic analysis model includes:

[0015] Describe in document form the CLI configuration commands supported by the router;

[0016] Prepare a certain number of CLI command examples and their corresponding natural language annotations to build a model dataset;

[0017] A recurrent neural network-encode-decode (RNN-Encode-Decode) model is used as the semantic analysis training model of the present invention;

[0018] The model parameters are optimized by minimizing the loss function.

[0019] In one embodiment, the documented description of the CLI configuration commands supported by the router includes: compiling all CLI configuration commands supported by the device into a document, fully describing the function of each supported command, all parameters supported by the command and the definition of the parameters.

[0020] In one embodiment, the preparation of a certain number of CLI command examples and their corresponding natural language annotations to construct a model data set includes: collecting router CLI configuration commands generated in an actual application environment, and through manual labeling and data screening, ensuring that the collected router CLI configuration commands all have corresponding natural language annotations, and the model data set uses a Lyra data set.

[0021] In one embodiment, the minimization loss function is:

[0022]

[0023] Among them, θ represents all the parameters in the model, L(θ) is the loss value of the loss function, N is the total amount of data in the training set, T is the length of each target sentence, and cost it is the cost function of the tth word in the i-th target sentence, and its physical meaning is the gap between the generated single target language sentence and the real sentence.

[0024] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0026] Figure 1 It is a flowchart of a method for configuring a router device of the present invention;

[0027] Figure 2 It is a schematic diagram of the construction process of the semantic analysis model of the present invention. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings.

[0029] The method for configuring the router device in this embodiment includes:

[0030] Build a semantic analysis model based on CLI command syntax;

[0031] Enter configuration commands in natural language on the router configuration interface;

[0032] After receiving the configuration command, the router calls the semantic analysis model interface and inputs the configuration command into the semantic analysis model;

[0033] The semantic analysis model generates the corresponding router configuration CLI command according to the input configuration command; and returns the router configuration CLI command to the router configuration interface to wait for confirmation;

[0034] When the router configuration CLI command is confirmed, the router configuration CLI command is input into the router configuration service, and the router configuration CLI command is executed;

[0035] The router configuration execution result is returned to the router configuration interface.

[0036] In this embodiment, the construction of the semantic analysis model includes:

[0037] 1. Describe the CLI configuration commands supported by the router in a documented form. Write down all the CLI configuration commands supported by the device, fully describe the function of each supported command, all the parameters supported by the command and the definition of the parameters.

[0038] 2. Prepare a certain number of CLI command examples and their corresponding natural language annotations to construct the model dataset. The construction of the model dataset of the present invention mainly collects router CLI configuration commands generated in the actual application environment, and through necessary manual annotation and data screening, the collected router CLI configuration commands all have corresponding natural language descriptions. The model dataset of the present invention can adopt the Lyra dataset to facilitate the subsequent generation of CLI commands.

[0039] 3. Construct a semantic analysis training model. In the present invention, a recurrent neural network-encode-decode (RNN-Encode-Decode) model is used as the semantic analysis training model of the present invention. The recurrent neural network-encode-decode model involves two languages, one is the source language and the other is the target language. In task decomposition, a task usually corresponds to multiple subtasks. Therefore, the task in the form of natural language provided by the user is regarded as the source language of the model, and the subtask sequence is regarded as the target language of the algorithm. Multiple subtasks will be concatenated into a statement and distinguished by two semicolons ";;" in the middle. For a given sentence x in the source language, the model will generate a sentence y in the target language.

[0040] Therefore, to achieve the above goal, the model will first convert all the characters x1, x2,..., x of the input sentence T into a fixed-length vector, h t = f(h t-1 , x t ); c = h Tx . Where is a non-linear function, which is used to calculate the current hidden state h t according to the current input character x t-1 and the previous hidden state h t . When the last character x T is input, the last hidden state h Tx is calculated and used as the context vector c of the input sentence x, which contains all the context information of the input sentence.

[0041] For example, when the input natural language is "Set the IP address of interface eth0 to 192.168.1.1" to generate its corresponding CLI configuration command. The encoder RNN will first read the words in the input sentence one by one. When it reads the first character "Set", it will convert "Set" into a vector x1 for representation and calculate the current hidden state h1 according to the value of x1; then the encoder RNN will continue to read the second character "interface", convert it into a vector x2 for representation, and update the current hidden state h2 according to the hidden state h1 and x2. And so on, until it reads the last end symbol and updates the current hidden state h TxThe final hidden state h Tx will be selected as the up and down vectors c of the entire input sentence.

[0042] Next, the model will calculate the word c based on the previously calculated word y1, ..., y t-1 Predict each word y in the output sentence y one by one t In this process, the encoder RNN is used to convert a variable-length source language sentence into a fixed-length context vector c; the decoder RNN is used to build a language model of the target language and generate a sentence of the target language based on the context vector generated by the encoder RNN. During the calculation process, the encoder RNN will read the words one by one in the order of the input sentence. Each time a word is read, it will calculate and update the current hidden state. At step t, a word x is read. t , the encoder RNN will be based on the current word x t and the previous hidden state h t-1 Calculate the current hidden state h t When the terminal symbol of the sentence is read, the encoder RNN will calculate the last hidden state h Tx And use it as the context vector c of the input sentence. Next, the decoder RNN will generate a sentence in the target language based on the context vector. First, the decoder RNN will treat the context vector c as the initial hidden state, and then continuously calculate the hidden state and generate new words based on the generated words until the terminal symbol is generated. <eos>, the whole calculation process is completed.

[0043] For example, the natural sentence input above is converted into:

[0044] "interface eth0

[0045] ip address 192.168.1.1"

[0046] 4. Evaluate the semantic analysis model. The goal of the model training process is to maximize the conditional log-likelihood function, which physically means to make the overall target language sentence generated by the RNN closer to the real sentence, that is, to minimize the loss function. The loss function used in the present invention is as follows:

[0047]

[0048] Where N is the total amount of data in the training set, T is the length of each target sentence, and cost it is the cost function of the tth word in the i-th target sentence, and its physical meaning is the gap between the generated single target language sentence and the real sentence. The cost function is calculated by the following formula

[0049] cost it = -log p θ (y it |x i )

[0050] Where θ represents all the parameters in the model. θ (y it |x i ) represents the given model parameter θ for a given source language sentence x i , the probability of the model generating the tth word in the target language sentence. During the model training process, the objective function can be optimized by using some common algorithms, such as the gradient descent algorithm, in order to achieve the best model parameter θ.

[0051] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the computer-readable recording medium includes any mechanism for storing or transmitting information in a computer (e.g., computer) readable form. For example, a machine-readable medium includes a read-only memory (ROM), a random access memory (RAM), a disk storage medium, an optical storage medium, a flash storage medium, an electrical, optical, acoustic or other form of propagation signal (e.g., a carrier wave, an infrared signal, a digital signal, etc.), etc. The computer software product includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

[0053] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices (equipment), or computer program products. Therefore, the present application can be implemented in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can be implemented in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0054] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0055] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0057] The above description is only a specific implementation case of the present invention, and the protection scope of the present invention is not limited thereto. Any modification or replacement of the present invention by any technician familiar with the present technology within the technical specifications described in the present invention should be within the protection scope of the present invention.< / eos>

Claims

1. A method for configuring a router device, characterized in that: The method includes: Build a semantic analysis model based on CLI command syntax; Enter configuration commands in natural language on the router configuration interface; After receiving the configuration command, the router calls the semantic analysis model interface and inputs the configuration command into the semantic analysis model; The semantic analysis model generates the corresponding router configuration CLI command according to the input configuration command; and returns the router configuration CLI command to the router configuration interface to wait for confirmation; When the router configuration CLI command is confirmed, the router configuration CLI command is input into the router configuration service, and the router configuration CLI command is executed; The router configuration execution result is returned to the router configuration interface.

2. The method for configuring a router device according to claim 1, characterized in that: The construction of the semantic analysis model includes: Describe in document form the CLI configuration commands supported by the router; Prepare a certain number of CLI command examples and their corresponding natural language annotations to build a model dataset; A recurrent neural network-encode-decode (RNN-Encode-Decode) model is used as the semantic analysis training model of the present invention; The model parameters are optimized by minimizing the loss function.

3. The method for configuring a router device according to claim 2, characterized in that: The documented description of the CLI configuration commands supported by the router includes: compiling all CLI configuration commands supported by the device into a document, fully describing the function of each supported command, all parameters supported by the command and the definition of the parameters.

4. The method for configuring a router device according to claim 2, characterized in that: The preparing of a certain number of CLI command examples and their corresponding natural language annotations to construct a model data set includes: collecting router CLI configuration commands generated in an actual application environment, and through manual labeling and data screening, ensuring that the collected router CLI configuration commands all have corresponding natural language annotations, and the model data set adopts the Lyra data set.

5. The method for configuring a router device according to claim 2, characterized in that: The minimization loss function is: Among them, θ represents all the parameters in the model, L(θ) is the loss value of the loss function, N is the total amount of data in the training set, T is the length of each target sentence, and cost it is the cost function of the tth word in the i-th target sentence, and its physical meaning is the gap between the generated single target language sentence and the real sentence.

6. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the document generation method described in any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the document generation method according to any one of claims 1 to 5.