Standardized configuration method and device for CLI command line
By matching and applying standardized policies, the CLI command line is standardized to configure, which solves the problem of the lack of unified standards in the CLI command line and improves management efficiency and consistency.
Patent Information
- Application Number
- CN202411850504.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, the CLI command line lacks unified standards, resulting in inconsistent CLI command lines of different manufacturers, causing trouble to users.
By determining the CLI command line type to be standardized, match the corresponding standardized policy, and use this policy to standardize the CLI command line. The specific steps include obtaining the module name or keyword of the functional module and determining it as a keyword of the CLI command line to achieve standardized configuration.
It realizes standardized configuration of the CLI command line, reduces the difficulty of learning and operation for users, and improves the efficiency and consistency of device management.
Smart Images

Figure CN119814545A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for standardizing configuration of a CLI command line. Background Art
[0002] There are many ways to manage data communication equipment, such as CLI configuration command line, SNMP / SMI / MIB network management system, NETCONF and other methods. However, at present, the most basic and important way to manage network equipment is CLI (Command Line Interface). Since CLI configuration and display information are more comprehensive and rich, CLI configuration distribution and viewing are also more efficient. CLI is frequently used by a large number of communication equipment development and maintenance and professional testers, operator solution planners, and maintenance engineers (hereinafter referred to as "users"). In addition, in general equipment function development, CLI is often developed first, and MIB and NETCONF are developed after the CLI function is stable, because CLI can be debugged more efficiently, and it is easier to fully view device information and find problems. In the existing technology, there is no unified standard for CLI command line, and the CLI command lines of different manufacturers are different, which causes great trouble to users.
[0003] In summary, how to implement standardized configuration of CLI command lines is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0004] In view of this, the present application provides a method and device for standardizing configuration of a CLI command line, aiming to achieve standardization of the configuration of the CLI command line.
[0005] In a first aspect, the present application provides a standardized configuration method for a CLI command line, comprising:
[0006] Determine the types of CLI command lines to be standardized;
[0007] Using the CLI command line type to be standardized, matching the standardization policy corresponding to the CLI command line type to be standardized;
[0008] The CLI command line to be standardized is configured in a standardized manner using the standardized strategy.
[0009] Optionally, the type of the CLI command line to be standardized is a function module CLI command line, and the step of using the standardization strategy to standardize the CLI command line to be standardized includes:
[0010] Get the lowercase letter of the module name or module abbreviation of the function module;
[0011] The lowercase letters of the module name or the module abbreviation are determined as keywords of the function module CLI command line, so as to perform standardized configuration on the function module CLI command line.
[0012] Optionally, the type of the CLI command line to be standardized is a CLI command line corresponding to a global configuration or a system view configuration, and the step of using the standardization strategy to standardize the CLI command line to be standardized includes:
[0013] Get the keywords of the function module;
[0014] The keyword of the functional module is determined as the first keyword of the CLI command line corresponding to the global configuration or the system view configuration, so as to perform standardized configuration on the CLI command line corresponding to the global configuration or the system view configuration.
[0015] Optionally, the type of the CLI command line to be standardized is a CLI command line of a Port view, and the step of using the standardization strategy to standardize the CLI command line to be standardized includes:
[0016] Port is determined as the first keyword of the CLI command line of the Port view, so as to perform standardized configuration on the CLI command line of the Port view.
[0017] Optionally, the type of the CLI command line to be standardized is a CLI command line corresponding to a subview, and the step of using the standardization strategy to standardize the CLI command line to be standardized includes:
[0018] Get the subview string of the subview;
[0019] The sub-view character string is determined as the first keyword of the CLI command line corresponding to the sub-view, so as to perform standardized configuration on the CLI command line corresponding to the sub-view.
[0020] In a second aspect, the present application provides a standardized configuration device for a CLI command line, including:
[0021] A determination module, used to determine the type of CLI command line to be standardized;
[0022] A matching module, used to match the standardization policy corresponding to the CLI command line type to be standardized by using the CLI command line type to be standardized;
[0023] A configuration module is used to perform standardized configuration on the CLI command line to be standardized by using the standardized strategy.
[0024] Optionally, the CLI command line type to be standardized is a function module CLI command line, and the configuration module includes:
[0025] A first acquisition unit is used to acquire the lowercase letters of the module name or module abbreviation of the functional module;
[0026] The first configuration unit is used to determine the lowercase letters of the module name or the module abbreviation as keywords of the function module CLI command line, so as to perform standardized configuration on the function module CLI command line.
[0027] Optionally, the CLI command line type to be standardized is a CLI command line corresponding to a global configuration or a system view configuration, and the configuration module includes:
[0028] A second acquisition unit, used to acquire keywords of the functional module;
[0029] The second configuration unit is used to determine the keyword of the functional module as the first keyword of the CLI command line corresponding to the global configuration or the system view configuration, so as to perform standardized configuration on the CLI command line corresponding to the global configuration or the system view configuration.
[0030] Optionally, the CLI command line type to be standardized is a CLI command line of a Port view, and the configuration module includes:
[0031] The third configuration unit is configured to determine port as the first keyword of the CLI command line of the Port view, so as to perform standardized configuration on the CLI command line of the Port view.
[0032] Optionally, the CLI command line type to be standardized is a CLI command line corresponding to a subview, and the configuration module includes:
[0033] A third obtaining unit, used to obtain a subview string of the subview;
[0034] The fourth configuration unit is configured to determine the sub-view character string as the first keyword of the CLI command line corresponding to the sub-view, so as to perform standardized configuration on the CLI command line corresponding to the sub-view.
[0035] In a third aspect, an embodiment of the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a standardized configuration method for a CLI command line as described in any one of the implementation methods in the first aspect of the embodiment of the present application.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes a standardized configuration method of the CLI command line as described in any one of the implementation methods in the first aspect of the embodiment of the present application.
[0037] The present application provides a method for standardizing configuration of a CLI command line. When executing the method, the type of CLI command line to be standardized is first determined, and then the type of CLI command line to be standardized is used to match the standardization policy corresponding to the type of CLI command line to be standardized, and finally, the standardization policy is used to perform standardization configuration on the CLI command line to be standardized. In this way, different standardization policies are configured for different types of CLI command lines, and the corresponding CLI command lines are standardizedly configured using the standardization policies, so that the CLI command line can be standardizedly configured. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a standardized configuration method of a CLI command line provided in an embodiment of the present application;
[0040] Figure 2 A functional schematic diagram of a VLAN provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of the structure of a standardized configuration device for a CLI command line provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The present application provides a standardized configuration method and device for a CLI command line, which is used in the field of computer technology. The above is only an example and does not limit the application field of the method and device name provided by the present application.
[0044] There are many ways to manage data communication equipment, such as CLI configuration command line, SNMP / SMI / MIB network management system, NETCONF and other methods. However, at present, the most basic and important way to manage network equipment is CLI (Command Line Interface). Since CLI configuration and display information are more comprehensive and rich, CLI configuration distribution and viewing are also more efficient. CLI is frequently used by a large number of communication equipment development and maintenance and professional testers, operator solution planners, and maintenance engineers (hereinafter referred to as "users"). In addition, in general equipment function development, CLI is often developed first, and MIB and NETCONF are developed after the CLI function is stable, because CLI can be debugged more efficiently, and it is easier to fully view device information and find problems. In the existing technology, there is no unified standard for CLI command line, and the CLI command lines of different manufacturers are different, which causes great trouble to users.
[0045] After research, the inventor proposed the technical solution of this application. First, the type of CLI command line to be standardized is determined. Then, the type of CLI command line to be standardized is used to match the standardized policy corresponding to the type of CLI command line to be standardized. Finally, the standardized policy is used to perform standardized configuration on the CLI command line to be standardized. In this way, different standardized policies are configured for different types of CLI command lines, and the corresponding CLI command lines are standardized using the standardized policies, so that the standardized configuration of the CLI command line can be achieved.
[0046] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. It should be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0047] See also Figure 1 , Figure 1 A flowchart of a standardized configuration method of a CLI command line provided in an embodiment of the present application includes:
[0048] S101: Determine a CLI command line type to be standardized.
[0049] First, you need to determine the CLI command line types to be standardized, which include but are not limited to functional module CLI command lines, CLI command lines corresponding to global configuration or system view configuration, CLI command lines for Port view, and CLI command lines corresponding to subviews.
[0050] S102: Using the CLI command line type to be standardized, matching the standardization policy corresponding to the CLI command line type to be standardized.
[0051] Before executing step S102, standardized policies corresponding to different types of CLI command lines are required. Figure 2 A functional diagram of a VLAN provided in an embodiment of the present application, taking the function of VLAN as an example:
[0052] When the CLI command line type is a function module CLI command line, obtain the lowercase letters of the module name or module abbreviation of the function module; determine the lowercase letters of the module name or module abbreviation as keywords of the function module CLI command line. Figure 2 As shown in item 1 of the , to create a VLAN, use "vlan" as the keyword of the CLI command line.
[0053] When the CLI command line type is a CLI command line corresponding to global configuration or system view configuration, obtain the keyword of the function module; determine the keyword of the function module as the first keyword of the CLI command line corresponding to global configuration or system view configuration. Figure 2 As shown in the first item of the , use "vlan" as the first keyword to create a VLAN. Do not use multiple similar strings as the first character of the CLI, for example, do not use ip route xxx and ip-route xxx to configure the same function of IP Router.
[0054] When the CLI command line type is a CLI command line in a port view, port is determined as the first keyword in the CLI command line in a port view. Figure 2 The "port xxx" shown in the second item in the module. You can also use the module abbreviation as the first keyword. It is not recommended to use other strings as the first keyword because it is not convenient to search.
[0055] When the CLI command line type is the CLI command line corresponding to the subview, obtain the subview string of the subview; determine the subview string as the first keyword of the CLI command line corresponding to the subview, so as to perform standardized configuration on the CLI command line corresponding to the subview. Either use the abbreviation of the function module as the first keyword, and it is not recommended to use other strings as the first keyword.
[0056] To display the CLI, use the format of "show / display+module abbreviation+display content keyword".
[0057] When using prompts, try to use abbreviated function names and character strings that are consistent with international protocols.
[0058] Configuration failed. The format is "module abbreviation + set failed: failure reason string".
[0059] For command line help, use "?" to get prompts.
[0060] Unified default login user configuration, username: root, password: manufacturer's English name or Chinese abbreviation pinyin.
[0061] The default IP address of the unified management port is 192.168.0.1.
[0062] The unified MAC address input and display format is "HHHH-HHHH-HHHH", and the unified IP address format is dotted decimal format.
[0063] S103: Performing standard configuration on the CLI command line to be standardized by using the standardization policy.
[0064] The standardized configuration of the CLI command line to be standardized is performed using the standardized policy provided in S102, which will not be described in detail here.
[0065] In the embodiment provided by the present application, the type of CLI command line to be standardized is first determined, and then the type of CLI command line to be standardized is used to match the standardized policy corresponding to the type of CLI command line to be standardized, and finally, the standardized policy is used to perform standardized configuration on the CLI command line to be standardized. In this way, different standardized policies are configured for different types of CLI command lines, and the corresponding CLI command lines are standardized configured using the standardized policies, so that the standardized configuration of the CLI command line can be achieved.
[0066] The above are some specific implementations of the standardized configuration method of the CLI command line provided in the embodiments of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiments of the present application will be introduced from the perspective of functional modularization.
[0067] See also Figure 3 , Figure 3 A schematic diagram of a structure of a standardized configuration device for a CLI command line provided in an embodiment of the present application, wherein the standardized configuration device 300 for a CLI command line includes:
[0068] A determination module 310, configured to determine a type of CLI command line to be standardized;
[0069] A matching module 320, configured to match a standardization policy corresponding to the CLI command line type to be standardized using the CLI command line type to be standardized;
[0070] The configuration module 330 is used to perform standardized configuration on the CLI command line to be standardized by using the standardized policy.
[0071] Optionally, the CLI command line type to be standardized is a function module CLI command line, and the configuration module 330 includes:
[0072] A first acquisition unit is used to acquire the lowercase letters of the module name or module abbreviation of the functional module;
[0073] The first configuration unit is used to determine the lowercase letters of the module name or the module abbreviation as keywords of the function module CLI command line, so as to perform standardized configuration on the function module CLI command line.
[0074] Optionally, the CLI command line type to be standardized is a CLI command line corresponding to a global configuration or a system view configuration, and the configuration module 330 includes:
[0075] A second acquisition unit, used to acquire keywords of the functional module;
[0076] The second configuration unit is used to determine the keyword of the functional module as the first keyword of the CLI command line corresponding to the global configuration or the system view configuration, so as to perform standardized configuration on the CLI command line corresponding to the global configuration or the system view configuration.
[0077] Optionally, the CLI command line type to be standardized is a CLI command line of a Port view, and the configuration module 330 includes:
[0078] The third configuration unit is configured to determine port as the first keyword of the CLI command line of the Port view, so as to perform standardized configuration on the CLI command line of the Port view.
[0079] Optionally, the CLI command line type to be standardized is a CLI command line corresponding to a subview, and the configuration module 330 includes:
[0080] A third obtaining unit, used to obtain a subview string of the subview;
[0081] The fourth configuration unit is configured to determine the sub-view character string as the first keyword of the CLI command line corresponding to the sub-view, so as to perform standardized configuration on the CLI command line corresponding to the sub-view.
[0082] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.
[0083] like Figure 4 As shown, the computer device 01 is in the form of a general computing device. The components of the computer device 01 may include but are not limited to: one or more processors or processing units 03, a system memory 08, and a bus 04 connecting different system components (including the system memory 08 and the processing unit 03).
[0084] Bus 04 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0085] The computer device 01 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 01, including volatile and non-volatile media, removable and non-removable media.
[0086] The system memory 08 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 09 and / or cache memory 10. The computer device 01 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 11 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 04 via one or more data medium interfaces. The memory 08 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0087] A program / utility 12 having a set (at least one) of program modules 13 may be stored, for example, in the memory 08, such program modules 13 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 13 generally perform the functions and / or methods of the embodiments described herein.
[0088] The computer device 01 may also communicate with one or more external devices 02 (e.g., keyboard, pointing device, display 07, etc.), one or more devices that enable a user to interact with the computer device 01, and / or any device that enables the computer device 01 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via input / output (I / O) interface 06. Furthermore, the computer device 01 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via network adapter 05. Figure 4 As shown, the network adapter 05 communicates with other modules of the computer device 01 via the bus 04. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with computer device 01, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0089] The processor unit 03 executes various functional applications and data processing by running programs stored in the system memory 08, for example, implementing a standardized configuration method of a CLI command line provided in an embodiment of the present application.
[0090] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0091] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0092] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0093] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A standardized configuration method for a CLI command line, characterized in that: include: Determine the types of CLI command lines to be standardized; Using the CLI command line type to be standardized, matching the standardization policy corresponding to the CLI command line type to be standardized; The CLI command line to be standardized is configured in a standardized manner using the standardized strategy.
2. The method according to claim 1, characterized in that The type of the CLI command line to be standardized is a function module CLI command line, and the standardization strategy is used to standardize the CLI command line to be standardized, including: Get the lowercase letter of the module name or module abbreviation of the function module; The lowercase letters of the module name or the module abbreviation are determined as keywords of the function module CLI command line, so as to perform standardized configuration on the function module CLI command line.
3. The method according to claim 1, characterized in that The type of the CLI command line to be standardized is a CLI command line corresponding to a global configuration or a system view configuration, and the standardization strategy is used to standardize the CLI command line to be standardized, including: Get the keywords of the function module; The keyword of the functional module is determined as the first keyword of the CLI command line corresponding to the global configuration or the system view configuration, so as to perform standardized configuration on the CLI command line corresponding to the global configuration or the system view configuration.
4. The method according to claim 1, characterized in that The type of the CLI command line to be standardized is a CLI command line of a Port view, and the standardization strategy is used to standardize the CLI command line to be standardized, including: Port is determined as the first keyword of the CLI command line of the Port view, so as to perform standardized configuration on the CLI command line of the Port view.
5. The method according to claim 1, characterized in that The type of the CLI command line to be standardized is a CLI command line corresponding to a subview, and the standardization strategy is used to standardize the CLI command line to be standardized, including: Get the subview string of the subview; The sub-view character string is determined as the first keyword of the CLI command line corresponding to the sub-view, so as to perform standardized configuration on the CLI command line corresponding to the sub-view.
6. A standardized configuration device for a CLI command line, characterized in that: include: A determination module, used to determine the type of CLI command line to be standardized; A matching module, used to match the standardization policy corresponding to the CLI command line type to be standardized by using the CLI command line type to be standardized; A configuration module is used to perform standardized configuration on the CLI command line to be standardized by using the standardized strategy.
7. The device according to claim 6, characterized in that The CLI command line type to be standardized is a function module CLI command line, and the configuration module includes: A first acquisition unit is used to acquire the lowercase letters of the module name or module abbreviation of the functional module; The first configuration unit is used to determine the lowercase letters of the module name or the module abbreviation as keywords of the function module CLI command line, so as to perform standardized configuration on the function module CLI command line.
8. The device according to claim 6, characterized in that The CLI command line type to be standardized is a CLI command line corresponding to a global configuration or a system view configuration, and the configuration module includes: A second acquisition unit, used to acquire keywords of the functional module; The second configuration unit is used to determine the keyword of the functional module as the first keyword of the CLI command line corresponding to the global configuration or the system view configuration, so as to perform standardized configuration on the CLI command line corresponding to the global configuration or the system view configuration.
9. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the standardized configuration method for the CLI command line according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the standardized configuration method of the CLI command line according to any one of claims 1 to 5.