CN111930460B - Configuration method and device of general embedded CLI component - Google Patents
Configuration method and device of general embedded CLI component Download PDFInfo
- Publication number
- CN111930460B CN111930460B CN202010807570.7A CN202010807570A CN111930460B CN 111930460 B CN111930460 B CN 111930460B CN 202010807570 A CN202010807570 A CN 202010807570A CN 111930460 B CN111930460 B CN 111930460B
- Authority
- CN
- China
- Prior art keywords
- command
- module
- command line
- initializing
- configuration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 230000006870 function Effects 0.000 claims description 13
- 206010063385 Intellectualisation Diseases 0.000 abstract description 4
- 238000011161 development Methods 0.000 description 6
- 230000003068 static effect Effects 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
Abstract
The invention relates to a configuration method and a device of a general embedded CLI component, wherein the configuration method comprises a command line module initialization flow and a service module configuration flow; the command line module initialization flow comprises the following steps: initializing a CLI component; initializing a command parameter structure; serial port parameter information initialization and telnet parameter information initialization. The service module configuration flow comprises the following steps: defining command line configuration parameter information; defining command line registration parameter information; initializing a service module; initializing a service module command line; registering a command word; the registration command word parses the callback function. The invention has the characteristics of portability, expandability, tailorability, intellectualization, multilingual and the like.
Description
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a method and an apparatus for configuring a general embedded CLI component.
Background
CLI (Command Line Interface ) is the most widely used user interface before graphical user interfaces are popular, and although there are two graphical interface systems based on Web and SNMP in the configuration of embedded devices at present, CLI has great advantages in the management of network communication devices for development efficiency, process repeatability and unusual problems, so many devices still adopt or retain CLI configuration components.
However, most of the existing CLI configuration schemes are based on customization of characteristic equipment, have no portability and extensibility, need repeated development and scheduling for each product, and increase the time and cost of product development and maintenance.
Disclosure of Invention
Based on this, it is necessary to provide a method and a device for configuring a general embedded CLI component, which have the characteristics of portability, expandability, tailorability, intellectualization, multilingual and the like.
In order to achieve the above object, the present invention adopts the following technical scheme.
The invention provides a configuration method of a general embedded CLI component, wherein the CLI component comprises a command line module and a service module, and the configuration method comprises a command line module initialization flow and a service module configuration flow;
the command line module initialization flow comprises the following steps:
initializing a CLI component;
initializing a command parameter structure;
initializing serial port parameter information and telnet parameter information;
the service module configuration flow comprises the following steps:
defining command line configuration parameter information;
defining command line registration parameter information;
initializing a service module;
initializing a service module command line;
registering a command word;
the registration command word parses the callback function.
In the above configuration method, the step of initializing the command parameter structure specifically includes:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
In the above configuration method, the command line configuration parameters include a command name, a command word ID, a command word type, a command word range, and a command word language.
In the configuration method, the command line registration parameters include a password of a command word, a hooking node of the command word, a command line configuration parameter and a command line callback function.
In the above configuration method, the step of initializing the service module command line specifically includes:
registering command lines needed by the service module with the command line module.
The invention also correspondingly provides a configuration device of the general embedded CLI component, wherein the CLI component comprises a command line module and a service module, and the configuration device comprises a command line module initialization unit and a service module configuration unit;
wherein the command line module initialization unit includes:
the first initialization module is used for initializing the CLI component;
the second initialization module is used for initializing the command parameter structure;
the third initialization module is used for initializing serial port parameter information and telnet parameter information;
the service module configuration unit includes:
the first defining module is used for defining command line configuration parameter information;
the second definition module is used for defining command line registration parameter information;
the fourth initialization module is used for initializing the service module;
a fifth initialization module for initializing the service module command line;
the first registration module is used for registering the command word; and
and the second registration module is used for registering the command word to analyze the callback function.
In the above configuration device, the second initialization module is specifically configured to:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
In the configuration device, the command line configuration parameters include a command name, a command word ID, a command word type, a command word range, and a command word language.
In the configuration device, the command line registration parameters include a password of a command word, a hooking node of the command word, a command line configuration parameter and a command line callback function.
In the above configuration device, the fifth initialization module is specifically configured to:
registering command lines needed by the service module with the command line module.
The configuration method can be directly transplanted in different CPU (such as arm, mips and the like) systems, and can also support release in the form of a static lib library. Moreover, when the C language is adopted for programming, the method does not depend on any third party interface, and has the advantages of good expandability, tailorability, intellectualization, multilingual and the like.
Drawings
FIG. 1 is a flow chart of the initialization of the command line module in the present embodiment;
fig. 2 is a schematic flow chart of service module configuration in the present embodiment;
fig. 3 is a block diagram illustrating a command line module initializing unit according to the present embodiment.
The achievement of the objectives of the present invention, as well as its function and principles, will be further described in connection with the accompanying drawings in the detailed description.
Detailed Description
Further description will be made with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, the present embodiment provides a method for configuring a general embedded CLI component, where the CLI component includes a command line module and a service module, both of which are compiled by a C language. The configuration method comprises a command line module initialization flow and a service module configuration flow.
The command line module comprises a user configuration interface, a protocol layer, a command line shell, a command analysis layer, a parameter callback analysis layer and a storage configuration layer (database or configuration file), and the command line module initialization flow comprises the following steps:
s11: initializing a CLI component;
s12: initializing a command parameter structure;
s13: initializing serial port parameter information and telnet parameter information;
the service module includes functional modules, and referring to fig. 2, the service module configuration flow is used for registering the own command line of the functional module through the interface provided by the command line module, and specifically includes the following steps:
s21: defining command line configuration parameter information;
s22: defining command line registration parameter information;
s23: initializing a service module;
s24: initializing a service module command line;
s25: registering a command word;
s26: the registration command word parses the callback function.
The step S12 of initializing the command parameter structure specifically includes:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
In step S21, the command line configuration parameters include a name of the command, a command word ID, a command word type, a command word range, and a language of the command word. Therefore, when the languages of the command words are set to be multilingual, as the parameters of the command lines, different languages can be displayed according to different language modes during display.
In step S22, the command line registration parameters include a password of the command word, a hooking node of the command word, a command line configuration parameter, and a command line callback function.
In this embodiment, the step S24 of initializing the service module command line specifically includes:
registering command lines needed by the service module with the command line module.
Each functional module of the system needs to use a command line, and the service module can directly register the command line with the command line module, only the corresponding configuration file needs to be changed, and compiling is not needed, so that development time and development workload are greatly saved.
Referring to fig. 3, the present invention correspondingly provides a configuration device 100 of a general embedded CLI component, where the CLI component includes a command line module and a service module, and the configuration device 100 includes a command line module initializing unit 110 and a service module configuring unit 120;
wherein the command line module initializing unit 110 includes:
a first initialization module 111, configured to initialize the CLI component;
a second initialization module 112 for initializing the command parameter structure;
a third initialization module 113, configured to initialize serial port parameter information and telnet parameter information;
the service module configuration unit 120 includes:
a first defining module 121 for defining command line configuration parameter information;
a second definition module 122, configured to define command line registration parameter information;
a fourth initialization module 123, configured to initialize the service module;
a fifth initialization module 124, configured to initialize a service module command line;
a first registration module 125 for registering the command word; and
the second registration module 126 registers the command word parsing callback function.
The second initialization module 112 is specifically configured to:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
The command line configuration parameters include the name of the command, the command word ID, the command word type, the command word range, and the language of the command word. The command line registration parameters include a password of a command word, a hooking node of the command word, a command line configuration parameter, and a command line callback function.
The fifth initialization module 124 is specifically configured to:
registering command lines needed by the service module with the command line module.
Each functional module of the system needs to use a command line, and the service module can directly register the command line with the command line module, only the corresponding configuration file needs to be changed, and compiling is not needed, so that development time and development workload are greatly saved.
In summary, the present invention can be directly transplanted in different CPU (such as arm, mips, etc.) systems through the configuration method, and can also support release in the form of static lib library. Moreover, when the C language is adopted for programming, the method does not depend on any third party interface, and has the advantages of good expandability, tailorability, intellectualization, multilingual and the like.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the invention and are described in detail herein without thereby limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention.
Claims (10)
1. The configuration method of the general embedded CLI component comprises a command line module and a service module, and is characterized by comprising a command line module initialization flow and a service module configuration flow;
the command line module initialization flow comprises the following steps:
initializing a CLI component;
initializing a command parameter structure;
initializing serial port parameter information and telnet parameter information;
the service module configuration flow comprises the following steps:
defining command line configuration parameter information;
defining command line registration parameter information;
initializing a service module;
initializing a service module command line;
registering a command word;
the registration command word parses the callback function.
2. The method for configuring a generic embedded CLI-component of claim 1, wherein the step of initializing a command parameter structure comprises:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
3. The method of claim 1, wherein the command line configuration parameters include a name of a command, a command word ID, a command word type, a command word range, and a language of a command word.
4. The method of claim 1, wherein the command line registration parameters include a password for a command word, a hooking node for a command word, a command line configuration parameter, and a command line callback function.
5. The method for configuring a generic embedded CLI-component of claim 1, wherein said step of service module command line initialization comprises:
registering command lines needed by the service module with the command line module.
6. A configuration device of a general embedded CLI component, wherein the CLI component comprises a command line module and a service module, and the configuration device is characterized by comprising a command line module initialization unit and a service module configuration unit;
wherein the command line module initialization unit includes:
the first initialization module is used for initializing the CLI component;
the second initialization module is used for initializing the command parameter structure;
the third initialization module is used for initializing serial port parameter information and telnet parameter information;
the service module configuration unit includes:
the first defining module is used for defining command line configuration parameter information;
the second definition module is used for defining command line registration parameter information;
the fourth initialization module is used for initializing the service module;
a fifth initialization module for initializing the service module command line;
the first registration module is used for registering the command word; and
and the second registration module is used for registering the command word to analyze the callback function.
7. The configuration device of a generic embedded CLI component of claim 6, wherein the second initialization module is specifically configured to:
initializing a global command parameter structure;
the module commands the initialization of the parameter structure.
8. The configuration device of a generic embedded CLI component of claim 6 wherein the command line configuration parameters include a name of a command, a command word ID, a command word type, a command word range, and a language of a command word.
9. The configuration apparatus of a generic embedded CLI component of claim 6, wherein the command line registration parameters comprise a password of a command word, a hooking node of a command word, a command line configuration parameter, and a command line callback function.
10. The configuration device of a generic embedded CLI component of claim 6, wherein the fifth initialization module is specifically configured to:
registering command lines needed by the service module with the command line module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010807570.7A CN111930460B (en) | 2020-08-12 | 2020-08-12 | Configuration method and device of general embedded CLI component |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010807570.7A CN111930460B (en) | 2020-08-12 | 2020-08-12 | Configuration method and device of general embedded CLI component |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111930460A CN111930460A (en) | 2020-11-13 |
CN111930460B true CN111930460B (en) | 2023-10-24 |
Family
ID=73310742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010807570.7A Active CN111930460B (en) | 2020-08-12 | 2020-08-12 | Configuration method and device of general embedded CLI component |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111930460B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546264A (en) * | 2009-04-27 | 2009-09-30 | 成都市华为赛门铁克科技有限公司 | command line processing method, device and communication system |
CN103488524A (en) * | 2012-06-13 | 2014-01-01 | 北大方正集团有限公司 | Command management device and command management method |
CN111147400A (en) * | 2019-12-04 | 2020-05-12 | 杭州迪普科技股份有限公司 | Method and device for command line configuration synchronization and electronic equipment |
CN111209125A (en) * | 2019-12-31 | 2020-05-29 | 瑞斯康达科技发展股份有限公司 | Multi-process command line implementation method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7181746B2 (en) * | 2001-06-29 | 2007-02-20 | Intel Corporation | Initialization, reconfiguration, and shut down of a module function |
-
2020
- 2020-08-12 CN CN202010807570.7A patent/CN111930460B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546264A (en) * | 2009-04-27 | 2009-09-30 | 成都市华为赛门铁克科技有限公司 | command line processing method, device and communication system |
CN103488524A (en) * | 2012-06-13 | 2014-01-01 | 北大方正集团有限公司 | Command management device and command management method |
CN111147400A (en) * | 2019-12-04 | 2020-05-12 | 杭州迪普科技股份有限公司 | Method and device for command line configuration synchronization and electronic equipment |
CN111209125A (en) * | 2019-12-31 | 2020-05-29 | 瑞斯康达科技发展股份有限公司 | Multi-process command line implementation method |
Non-Patent Citations (2)
Title |
---|
WAG54G路由器Unnumbered IP功能和命令行配置的实现;徐旭彬;《中国优秀博硕士学位论文全文数据库 (硕士)信息科技辑》(第4期);I136-38 * |
通用命令行模块的设计及实现;黄玮伟 等;《中国优秀硕士学位论文全文数据库信息科技辑》(第2期);I138-139 * |
Also Published As
Publication number | Publication date |
---|---|
CN111930460A (en) | 2020-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10997092B2 (en) | Enabling out-of-band hardware management via an in-band communications channel | |
CN110324169B (en) | Interface management method and device | |
US20080222617A1 (en) | Server side application integration framework | |
CN102946415B (en) | A kind of implementation method of mobile terminal this locality application and device | |
US7484226B2 (en) | Web client endpoint emulator | |
CN102591724B (en) | Method and device for information interaction | |
CN102810066A (en) | Terminal adapting method and terminal and server based on terminal characteristic configuration program | |
WO2018035195A1 (en) | Middleware interface and middleware interface generator | |
WO2024077885A1 (en) | Management method, apparatus and device for container cluster, and non-volatile readable storage medium | |
CN108804313A (en) | A kind of method, apparatus and server of remote debugging program | |
RU2003111213A (en) | EXTENDABLE COMMUNICATION CONTROLS | |
US20030009334A1 (en) | Speech processing board for high volume speech processing applications | |
FI120286B (en) | A method and device arrangement for managing a server-client environment | |
CN101136780A (en) | Method, system to obtain user command information, and user command registered device | |
WO2005103915A2 (en) | Method for collecting monitor information | |
CN111930460B (en) | Configuration method and device of general embedded CLI component | |
US8051191B2 (en) | Ethernet extensibility | |
WO2023245985A1 (en) | Smart-gateway adaptation system based on thing model, and operation method therefor | |
CN109274715B (en) | Platform resource management system of vehicle-mounted multi-channel communication system | |
CN116155978A (en) | Multi-registry adaptation method, device, electronic equipment and storage medium | |
US8260821B2 (en) | Global, dynamic, remote and central system for database driver configuration | |
CN113691413B (en) | Method and system for realizing compatibility of Internet of things equipment with multiple modules | |
US11372627B2 (en) | System and method for providing integrated development environment (IDE) for programmable software system | |
CN112134922B (en) | Service calling method and device based on micro-service and storage medium | |
WO2021057351A1 (en) | Apparatus and method for controlling android bluetooth in glibc environment, and terminal device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |