Command line-based configuration management method and system, electronic device, and storage medium

CN117785187BActive Publication Date: 2026-10-30BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311735015.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2026-10-30
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

[0003]但是由于历史发展和继承的原因,早期的配置管理系统都是采用C语言开发,随着业务策略复杂程度提升,需要采用C语言编写大量代码管理配置对象,生成各种业务系统需要的数据,在处理紧急问题或灵活的用户需求时,修改或编写新命令行,需要将新命令行编译到配置管理系统中或者生成动态库,同时要合入到升级包中,对设备系统进行升级,不利于快速解决问题

Benefits of technology

[0047]本公开实施例提供一种基于命令行的配置管理方法,该方法确定获取的第一命令行是原命令行还是新命令行,如果第一命令行是原命令行,则直接基于原编程语言环境对获取第一配置对象,从而快速且准确地生成第一业务配置文件、第一业务命令行和第一业务配置对象,如果第一命令行是新命令行,根据新编程语言环境解析得到多个第二命令行,并基于第一命令行和第二命令行获取通用配置对象,该方法实现跨编程语言的配置管理,同时支持原有的基于原编程语言的配置管理方式和基于新编程语言的新配置管理方式,更好地适应多样化的业务系统需求,允许不同业务系统根据自身需求生成不同的配置文件、命令行和配置对象,提高了配置的灵活性和适应性,无需采用原编程语言大量编写代码,也无需基于新命令行合入升级包对设备系统进行升级,便于快速处理紧急问题和灵活的满足用户需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785187B_ABST
    Figure CN117785187B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure discloses a command line-based configuration management method and system, an electronic device and a storage medium. The method comprises the following steps: obtaining a first command line; if it is determined that the first command line is an original command line, obtaining a first configuration object based on the first command line in an original programming language environment; converting the first configuration object into a first business configuration file, a first business command line and a first business configuration object and sending them to a business system; if it is determined that the first command line is a new command line, parsing the first command line in a new programming language environment to obtain a plurality of second command lines, and obtaining a general configuration object based on the first command line and the second command lines; and converting the general configuration object into a second business configuration file, a second business command line and a second business configuration object and sending them to the business system. The method can simultaneously support an original configuration management mode based on an original programming language and a new configuration management mode based on a new programming language, and better meet the needs of the business system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of network security technology, and in particular to a command-line based configuration management method and system, electronic device, and storage medium. Background Technology

[0002] Network security devices or embedded devices provide an independent Configuration Management System (CMS). The CMS interacts with the device via a web management page and command line, and manages the device's network ports, IP addresses, ports, routes, and service policies. The CMS maintains the logical relationships between these contents, converts the configuration information into data that meets the requirements of the business system, and then sends it to the business system.

[0003] However, due to historical development and inheritance, early configuration management systems were developed using the C language. As the complexity of business strategies increased, a large amount of code needed to be written in C to manage configuration objects and generate data required by various business systems. When dealing with urgent problems or flexible user needs, new command lines needed to be modified or written. These new command lines needed to be compiled into the configuration management system or generated into a dynamic library and then merged into the upgrade package to upgrade the device system, which was not conducive to quickly solving problems. Summary of the Invention

[0004] In view of this, the present disclosure provides a command-line based configuration management method and system, electronic device, and storage medium that can simultaneously support the original configuration management method based on the original programming language and the new configuration management method based on the new programming language, thus better meeting the needs of business systems.

[0005] Firstly, this disclosure provides a command-line based configuration management method, employing the following technical solution:

[0006] Get the first command line;

[0007] If it is determined that the first command line is the original command line, then in the original programming language environment, the first configuration object is obtained based on the first command line;

[0008] The first configuration object is converted into a first business configuration file, a first business command line, and a first business configuration object, and then sent to the business system.

[0009] If it is determined that the first command line is a new command line, then the first command line is parsed in the new programming language environment to obtain several second command lines, and a general configuration object is obtained based on the first command line and the second command lines;

[0010] The general configuration object is converted into a second business configuration file, a second business command line, and a second business configuration object, and then sent to the business system.

[0011] Optionally, the command-line based configuration management method further includes:

[0012] If the name of the first command line matches the name of the first data table, then the first command line is determined to be the original command line.

[0013] If the name of the first command line matches the name of the second data table, then the first command line is determined to be a new command line.

[0014] Optionally, obtaining the first configuration object based on the first command line includes:

[0015] In the third configuration objects of multiple pre-stored original command lines, the third configuration object corresponding to the first command line is queried based on the name of the first command line;

[0016] If found, the retrieved third configuration object will be used as the first configuration object;

[0017] If the query fails, a first object is created, and the first command line and its parameters are stored in the first object to obtain the first configuration object.

[0018] Optionally, before querying the third configuration object corresponding to the first command line based on the name of the first command line in the pre-stored third configuration object, the method further includes:

[0019] Perform a permission check on the first command line based on the first permission table;

[0020] The first command line is formatted based on the first format rule base;

[0021] The first permission table and the first format rule base are implemented using the original programming language.

[0022] Optionally, the parsing of the first command line in the new programming language environment to obtain several second command lines includes:

[0023] Retrieve the script corresponding to the first command line based on its name;

[0024] The script is used to parse out several second command lines that are dependent on the first command line;

[0025] The script is implemented using a new programming language.

[0026] Optionally, before parsing the first command line in the new programming language environment to obtain several second command lines, the method further includes:

[0027] Perform a permission check on the first command line based on the second permission table;

[0028] The format of the first command line is checked based on the second format rule base;

[0029] The second permission table and the second format rule base are implemented using a new programming language.

[0030] Optionally, obtaining the general configuration object based on the first command line and the second command line includes:

[0031] Create a first general object, store the first command line and its parameters into the first general object, and obtain a first sub-general configuration object;

[0032] If it is determined that the second command line is the original command line, then the second configuration object is obtained based on the second command line;

[0033] If it is determined that the second command line is a new command line, then a second general object is created, and the second command line and its parameters are stored in the second general object to obtain a second sub-general configuration object;

[0034] The first sub-general configuration object, the second configuration object, and / or the second sub-general configuration object are integrated into a general configuration object.

[0035] Secondly, this disclosure also provides a command-line based configuration management system, which adopts the following technical solution:

[0036] The acquisition unit is used to acquire the first command line;

[0037] The first determining unit is configured to, if it is determined that the first command line is the original command line, obtain the first configuration object based on the first command line in the original programming language environment;

[0038] The first conversion unit is used to convert the first configuration object into a first business configuration file, a first business command line, and a first business configuration object and send them to the business system;

[0039] The second determining unit is used to parse the first command line in a new programming language environment if it is determined that the first command line is a new command line, obtain a number of second command lines, and obtain a general configuration object based on the first command line and the second command lines;

[0040] The second conversion unit is used to convert the general configuration object into a second business configuration file, a second business command line, and a second business configuration object, and send them to the business system.

[0041] Thirdly, this disclosure also provides an electronic device that adopts the following technical solution:

[0042] The electronic device includes:

[0043] At least one processor; and,

[0044] A memory communicatively connected to the at least one processor; wherein,

[0045] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform any of the command-line based configuration management methods described above.

[0046] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer instructions for causing a computer to execute any of the command-line based configuration management methods described above.

[0047] This disclosure provides a command-line based configuration management method. The method determines whether the obtained first command line is the original command line or a new command line. If the first command line is the original command line, it directly obtains the first configuration object based on the original programming language environment, thereby quickly and accurately generating the first business configuration file, the first business command line, and the first business configuration object. If the first command line is the new command line, it parses multiple second command lines according to the new programming language environment and obtains a common configuration object based on the first and second command lines. This method achieves cross-programming language configuration management, supporting both the original configuration management method based on the original programming language and the new configuration management method based on the new programming language. It better adapts to diverse business system needs, allowing different business systems to generate different configuration files, command lines, and configuration objects according to their own needs, improving the flexibility and adaptability of configuration. It eliminates the need to write extensive code in the original programming language and to upgrade the device system by merging it into an upgrade package based on the new command line, facilitating rapid handling of urgent issues and flexible fulfillment of user needs.

[0048] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 A flowchart illustrating the command-line-based configuration management method provided in this embodiment of the disclosure;

[0051] Figure 2 A schematic diagram of a command-line based configuration management system provided in this embodiment of the disclosure;

[0052] Figure 3 Another principle block diagram of the command-line-based configuration management system provided in this disclosure embodiment;

[0053] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0054] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0055] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0056] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0057] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0058] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0059] Reference Figure 1 This disclosure provides a command-line based configuration management method, including the following steps:

[0060] S1: Get the first command line.

[0061] The configuration management subsystem is used to convert configuration information into data that meets the requirements of the business system and then distribute it to the business system. Developed using the original programming language, the subsystem processes command lines within this environment; these command lines are referred to as the original command lines. However, as business strategies become more complex, the original programming language environment is no longer sufficient for handling new command lines. Conversely, if a completely new configuration management subsystem is developed using a new programming language, the new programming language environment may not be able to handle the original command lines. Therefore, this disclosure improves the configuration management subsystem using a new programming language, resulting in a command-line-based configuration management system that can process both original and new command lines quickly. The original programming language is C, and the new programming language is Python; however, depending on the specific needs, the original and new programming languages ​​can be extended to other languages.

[0062] Users log in to the device management system through the web management page of the device terminal, and send an authentication request, user ID and password to the device management system. The device management system authenticates the user based on the user ID and password, and sends the authentication request and authentication result including the user ID to the command-line based configuration management system. If the authentication is successful, the user can configure policies on the management page of the device management system, and send the policies in the form of a first command line to the command-line based configuration management system. The command-line based configuration management system then performs subsequent configuration management operations based on the first command line.

[0063] S2: If it is determined that the first command line is the original command line, then in the original programming language environment, obtain the first configuration object based on the first command line.

[0064] The name of the first command line is matched with the first data table. If the match is successful, the first command line is determined to be the original command line. Permission and format checks are performed on the first command line in the original programming language environment. In this disclosure, the first data table can be a hash table, with the names of all the original command lines used as the keys of the first data table.

[0065] The permission check includes: obtaining the user identifier corresponding to the first command line; querying the first identifier in the first permission table that is the same as the user identifier; obtaining the first permission rule corresponding to the first identifier; and determining whether the first command line conforms to the first permission rule. If it does not conform, the process terminates; if it does conform, a format check is performed on the first command line. The first permission table includes several first identifiers and their corresponding first permission rules.

[0066] Format checks include: performing syntax checks and parameter checks on the first command line based on the first format rule base. Parameter checks refer to checking the format of the parameters of the first command line. Depending on actual needs, the validity of the parameters can also be checked.

[0067] The command-line-based configuration management system stores multiple third configuration objects from the original command lines before its improvement. When syntax and parameter checks pass, it queries the third configuration object corresponding to the first command line based on the name of the first command line. If found, the queried third configuration object is used as the first configuration object. If not found, the first object is created, and the first command line and its parameters are stored in the first object to obtain the first configuration object. The first command line and its parameters are configuration information. According to actual needs, configuration information such as IP, port, and routing can also be stored in the first object. The members of the policy data structure are defined according to the requirements of the business system, and the first object is stored using the policy data structure.

[0068] S3: Convert the first configuration object into the first business configuration file, the first business command line, and the first business configuration object, and send them to the business system.

[0069] The configuration information in the first configuration object is converted into a first business configuration file, a first business command line, and a first business configuration object that meet the requirements of the business system, and then the first business configuration file, the first business command line, and the first business configuration object are sent to the business system.

[0070] S4: If it is determined that the first command line is a new command line, then parse the first command line in the new programming language environment to obtain several second command lines, and obtain a general configuration object based on the first and second command lines.

[0071] The name of the first command line is matched with the second data table. If the match is successful, the first command line is determined to be a new command line. In the new programming language environment, the first command line is subjected to permission and format checks. If the first command line is neither the original command line nor the new command line, it indicates that the first command line may have security issues and may be under attack. The relevant steps of the first command line are not executed. In this disclosure, the second data table can be a hash table, with the names of all new command lines used as the keys of the second data table.

[0072] The permission check includes: obtaining the user identifier corresponding to the first command line; querying the second identifier in the second permission table that is the same as the user identifier; obtaining the second permission rule corresponding to the second identifier; and determining whether the first command line conforms to the second permission rule. If it does not conform, the process terminates; if it does conform, a format check is performed on the first command line. The second permission table includes several second identifiers and their corresponding second permission rules.

[0073] The format check includes: performing syntax and parameter checks on the first command line based on the second format rule base. The parameter check refers to checking the format of the parameters of the first command line. Depending on the actual needs, the validity of the parameters can also be checked.

[0074] A default configuration information database is provided, which includes multiple third data tables. Each third data table stores a first command line and its related data, and there is a one-to-one correspondence between the third data tables and the first command lines.

[0075] When syntax and parameter checks pass, the system searches the script directory for a script with the same name as the first command line. The searched script is then loaded and executed. Internally, the script parses the first command line to obtain second command lines that have dependencies on it. The first and second command lines, along with their dependencies, are stored in a third data table corresponding to the first command line. For example, the first command line might be A, and A might reference two second command lines, one named B and the other C.

[0076] Create a first generic object, and encapsulate the first command line and its parameters into the first generic object to obtain the first sub-generic configuration object. The first command line and its parameters contain configuration information; depending on actual needs, configuration information such as IP address, port number, and routing can also be encapsulated into the first generic object.

[0077] The method for determining whether the second command line is the original command line or the new command line is based on the first data table and the second data table. The principle of this method is the same as that for determining whether the first command line is the original command line or the new command line, and will not be repeated here.

[0078] If the second command line is the original command line, then a third configuration object corresponding to the second command line is queried based on its name. If found, the queried third configuration object is used as the second configuration object. If not found, a second object is created, and the second command line and its parameters are encapsulated within it to obtain a new second configuration object. If the second command line is a new command line, a second general object is created, and the second command line and its parameters are encapsulated within it to obtain a second sub-general configuration object. The second command line and its parameters contain configuration information. Depending on actual needs, configuration information such as IP address, port number, and routing information can also be stored in the second object or the second general object.

[0079] The first sub-general configuration object, the second configuration object, and / or the second sub-general configuration object are integrated into a general configuration object, and the first sub-general configuration object, the general configuration object, the second configuration object, and / or the second sub-general configuration object are stored in a third data table corresponding to the first command line. Each of the second configuration object, the first sub-general configuration object, the second sub-general configuration object, and the general configuration object has its own ID as an identifier.

[0080] S5: Convert the general configuration object into a second business configuration file, a second business command line, and a second business configuration object, and send them to the business system.

[0081] The configuration information in the general configuration object is converted into a second business configuration file, a second business command line, and a second business configuration object that meet the requirements of the business system, and then the second business configuration file, the second business command line, and the second business configuration object are sent to the business system.

[0082] This disclosed command-line based configuration management method determines whether the first command line obtained is the original command line or a new command line. If the first command line is the original command line, the first configuration object is obtained directly based on the original programming language environment, thereby quickly and accurately generating the first business configuration file, the first business command line, and the first business configuration object. If the first command line is a new command line, multiple second command lines are parsed according to the new programming language environment, and a common configuration object is obtained based on the first and second command lines. This method achieves cross-programming language configuration management, that is, it simultaneously supports the original configuration management method and the new configuration management method. This allows for flexible configuration operations in different programming language environments, better adapts to diverse business system needs, and allows different business systems to generate different configuration files, command lines, and configuration objects according to their own needs, improving the flexibility and adaptability of configuration. It eliminates the need to write a large amount of code in the original language to manage configuration objects and generate the data required by various business systems, and it also eliminates the need to upgrade the device system by merging it into an upgrade package based on the new command line, facilitating rapid handling of urgent problems and flexible fulfillment of user needs.

[0083] This method manages configuration via command line, which simplifies the configuration process and improves operational efficiency. Users only need to configure the policy, and the command line generated by the policy can be parsed and transformed to generate the corresponding configuration file, command line, and configuration object, avoiding tedious manual configuration steps and improving the efficiency of configuration management.

[0084] Reference Figure 2 This disclosure provides a command-line based configuration management system, including:

[0085] The acquisition unit is used to acquire the first command line;

[0086] The first determining unit is used to obtain the first configuration object based on the first command line in the original programming language environment if it is determined that the first command line is the original command line.

[0087] The first conversion unit is used to convert the first configuration object into a first business configuration file, a first business command line, and a first business configuration object, and then send them to the business system.

[0088] The second determining unit is used to parse the first command line in the new programming language environment if it is determined that the first command line is a new command line, obtain several second command lines, and obtain a general configuration object based on the first command line and the second command lines.

[0089] The second conversion unit is used to convert the general configuration object into a second business configuration file, a second business command line, and a second business configuration object, and then send them to the business system.

[0090] Reference Figure 3 The command-line based configuration management system includes a configuration management subsystem, a configuration agent subsystem, and a configuration information database. The configuration management subsystem includes an authentication service module, a configuration file module, a first permission check module, a first format check module, a configuration object module, and a general configuration object module. The configuration agent subsystem includes a protocol agent module, a command script module, a second permission check module, and a second format check module.

[0091] The configuration management subsystem is developed using the original programming language, while the configuration agent subsystem is developed using a new programming language. The second permission check module is derived from the first permission check module using two conversion methods: first, converting the first permission check module into a dynamic library; second, converting the logic of the first permission check module into a script in the new programming language. Similarly, the second format check module is derived from the first format check module using two conversion methods: first, converting the first format check module into a dynamic library; second, converting the logic of the first format check module into a script in the new programming language. The original programming language is C, and the new programming language is Python; however, depending on the specific circumstances, the original and new programming languages ​​can be extended to other languages.

[0092] Furthermore, upon startup of the command-line based configuration management system, the protocol proxy module and command script module are initialized. The protocol proxy module parses the original command-line configuration files in the configuration file module to obtain the names of all original command lines, creates a first data table, and uses the names of the original command lines as the keys of the first data table. The command script module provides a loading interface, which loads the scripts for all new command lines from the script directory. Each new command line script provides a unified initialization method for external modules to call. The name of the new command line is the name of the corresponding script. A second data table is created, and the name of the script is used as the key of the second data table. Both the first and second data tables are hash tables.

[0093] The device management system responds to the authentication request sent by the user's device terminal, authenticates the user, and sends the authentication request and authentication result including the user's identifier to the configuration agent subsystem. The protocol agent module determines that the user has management privileges based on the authentication request and authentication result, and forwards the authentication request and authentication result to the configuration management subsystem. The authentication service module determines that the user has management privileges based on the authentication request and authentication result.

[0094] The device management system sends the first command line to the protocol proxy module. The protocol proxy module determines whether the first command line is the original command line based on the first data table. If the first command line is the original command line, the first permission check module performs a permission check on the first command line, and the first format check module performs a format check on the first command line. When both the syntax check and parameter check pass, the configuration object module queries or generates the first configuration object based on the first command line, converts the first configuration object into the first business configuration file, the first business command line, and the first business configuration object, and sends them to the business system.

[0095] If the first command line is not the original command line, the interface of the command script module is called. Internally, the interface queries the second data table to find the name of the first command line, confirming it as the new command line. The second permission check module performs permission checks on the first command line, and the second format check module performs format checks. If both syntax and parameter checks pass, the command script module queries the script corresponding to the first command line and executes it. Internally, the script parses the first command line to obtain a second command line that has a dependency on it. Similarly, the protocol proxy module and the command script module determine whether the second command line is the original or new command line based on the first and second data tables, respectively. If the second command line is the original command line, the configuration object module obtains the second configuration object based on it. If the second command line is the new command line, the general configuration object module obtains the second sub-general configuration object based on it. The general configuration object module also obtains the first sub-general configuration object based on the first command line, and integrates the first sub-general configuration object, the second configuration object, and / or the second sub-general configuration object into a general configuration object.

[0096] The configuration information database stores the first command line and the second command line, as well as the dependencies between them. If the configuration object module obtains the second configuration object, it returns the second configuration object to the configuration agent subsystem. After the general configuration object module obtains the first sub-general configuration object and the general configuration object, it returns the first sub-general configuration object and the general configuration object to the configuration agent subsystem. If the general configuration object module obtains the second sub-general configuration object, it returns the second sub-general configuration object to the configuration agent subsystem. The configuration agent subsystem stores the received objects in the configuration information database. It is worth noting that the second configuration object, the first sub-general configuration object, the second sub-general configuration object, and the general configuration object all have their own IDs as identifiers.

[0097] The configuration agent subsystem converts the general configuration object into a second business configuration file, a second business command line, and a second business configuration object, and sends them to the configuration management subsystem. The configuration management subsystem then forwards the second business configuration file, the second business command line, and the second business configuration object to the business system.

[0098] Furthermore, the configuration agent subsystem sends a "storage service configuration" command and command parameters to the configuration management subsystem. The command parameters include at least one or more of the following: second configuration object identifier, first sub-general configuration object identifier, second sub-general configuration object identifier, and general configuration object identifier. The configuration management subsystem processes the command parameters and related configuration information, and selects one of the following three processing methods according to actual needs: storing the command parameters and related configuration information as a file, storing the command parameters and related configuration information in shared memory, or executing the command line in the configuration information.

[0099] The configuration agent subsystem parses the first command line to obtain the operations issued by the device management system. These operations include modification, deletion, and save operations. If it is a modification or deletion operation, the script corresponding to the first command line sends relevant commands to the configuration management subsystem based on the data about the first command line stored in the configuration information database. If it is a save operation, the configuration agent subsystem sends a save command to the configuration management subsystem, which saves the original command line and simultaneously saves the command line from the general configuration object module to the configuration file module.

[0100] Furthermore, the general configuration object module is implemented using the original programming language. The configuration management subsystem provides the general configuration object module with interfaces and corresponding command lines for adding, modifying, deleting, querying, storing configurations, and storing business configurations. The attributes of the general configuration object module include business type, object type, object ID, object name, business configuration information space, and configuration information space.

[0101] For storage configuration, the general configuration object module's configuration information space stores all the contents of the new command line. The storage configuration interface stores the contents of this space in the configuration file module. For storage business configuration, the general configuration object module's configuration information space stores the contents of the new command line converted into business configuration information. The storage business configuration interface stores the contents of this space in the configuration file module or shared memory. During storage, if the content is found to be command line type, the command line will be executed. Other interfaces provide functions for adding, modifying, deleting, and querying based on object ID, object name, etc. The general configuration object module can store information in various formats such as XML, JSON, text, and binary.

[0102] As can be seen, the protocol proxy module executes the method steps of the acquisition unit, the protocol proxy module and the configuration object module execute the method steps of the first determination unit, the configuration object module executes the method steps of the first conversion unit, the command script module, the configuration object module, and the general configuration object module execute the method steps of the second determination unit, and the configuration management subsystem and the configuration proxy subsystem jointly complete the method steps of the second conversion unit.

[0103] This disclosed command-line based configuration management system employs proxy technology to support existing configuration management methods while also supporting new ones. It seamlessly expands the functionality and capabilities of new configuration services, flexibly adapting to various business configuration management needs. When the device management system issues the original command line, the configuration proxy subsystem forwards it to the configuration management subsystem, which then completes the configuration management according to the original process. When the device management system issues a new command line, the configuration proxy subsystem checks the new command line's permissions and format permissions, and temporarily stores policy-related information in the configuration information database. This enables the management of logical relationship-related information. A new programming language script and configuration information database management strategy are used; the configuration information database is only used for temporary storage and management of various policy reference logic relationships. The relevant objects are forwarded to the configuration management subsystem, generating corresponding configuration objects and general configuration objects. Finally, the configuration management subsystem transmits the converted, business-compliant data to the business system. This system improves the efficiency of configuration management coding and command-line problem resolution by designing a new programming language proxy configuration and configuration information storage management method.

[0104] Developers using this design can quickly write and debug command lines using scripts based on business needs. It features convenience, flexibility, small code size, and low complexity, improving coding and debugging efficiency. When solving urgent problems, scripts can be modified or written on-site, eliminating the need for compilation or system upgrades, significantly saving time. Employing dynamic script loading technology allows for the rapid addition of command-line scripts, improving development and debugging efficiency. Scripts use a configuration information database to store information such as configuration object relationships, implementing the functionality of new command lines and referencing existing ones. The configuration management subsystem is solely responsible for storage and execution, thus enhancing coding efficiency.

[0105] The various variations and specific examples of the command-line-based configuration management method provided above are also applicable to the command-line-based configuration management system provided in this disclosure. Through the foregoing detailed description of the command-line-based configuration management method, those skilled in the art can clearly understand the implementation method of the command-line-based configuration management system. For the sake of brevity, they will not be described in detail here.

[0106] An electronic device according to embodiments of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), a hard disk, flash memory, etc.

[0107] The processor may be a central processing unit (CPU) or other processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the electronic device to perform all or part of the steps of the command-line based configuration management method of the foregoing embodiments of this disclosure.

[0108] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.

[0109] like Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the electronic device in the embodiment of the present disclosure. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0110] like Figure 4 As shown, an electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0111] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices (such as edge computing devices) to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0112] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. When the computer program is executed by a processor, all or part of the steps of the command-line based configuration management method of embodiments of this disclosure are performed.

[0113] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0114] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the command-line-based configuration management methods described in the foregoing embodiments of the present disclosure are performed.

[0115] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).

[0116] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0117] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0118] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.

[0119] Additionally, as used herein, the “or” used in a list of items beginning with “at least one” indicates a separate list, such that a list of, for example, “at least one of A, B, or C” means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word “exemplary” does not imply that the described example is preferred or better than other examples.

[0120] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.

[0121] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0122] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0123] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A command-line based configuration management method, characterized in that, include: Get the first command line; If it is determined that the first command line is the original command line, then in the original programming language environment, the first configuration object is obtained based on the first command line; wherein, the original programming language is C language; The first configuration object is converted into a first business configuration file, a first business command line, and a first business configuration object, and then sent to the business system. If it is determined that the first command line is a new command line, then the first command line is parsed in the new programming language environment to obtain several second command lines, and a general configuration object is obtained based on the first command line and the second command lines; wherein, the new programming language is Python. The general configuration object is converted into a second business configuration file, a second business command line, and a second business configuration object, and then sent to the business system.

2. The command-line based configuration management method according to claim 1, characterized in that, Also includes: If the name of the first command line matches the name of the first data table, then the first command line is determined to be the original command line. If the name of the first command line matches the name of the second data table, then the first command line is determined to be a new command line.

3. The command-line based configuration management method according to claim 1, characterized in that, The step of obtaining the first configuration object based on the first command line includes: In the third configuration objects of multiple pre-stored original command lines, the third configuration object corresponding to the first command line is queried based on the name of the first command line; If found, the retrieved third configuration object will be used as the first configuration object; If the query fails, a first object is created, and the first command line and its parameters are stored in the first object to obtain the first configuration object.

4. The command-line based configuration management method according to claim 3, characterized in that, In the third configuration object of the multiple pre-stored original command lines, before querying the third configuration object corresponding to the first command line based on the name of the first command line, the following steps are included: Perform a permission check on the first command line based on the first permission table; The first command line is formatted based on the first format rule base; The first permission table and the first format rule base are implemented using the original programming language.

5. The command-line based configuration management method according to claim 1, characterized in that, The first command line is parsed in the new programming language environment to obtain several second command lines, including: Retrieve the script corresponding to the first command line based on its name; The script is used to parse out several second command lines that are dependent on the first command line; The script is implemented using a new programming language.

6. The command-line based configuration management method according to claim 5, characterized in that, Before parsing the first command line in the new programming language environment to obtain several second command lines, the following steps are also included: Perform a permission check on the first command line based on the second permission table; The format of the first command line is checked based on the second format rule base; The second permission table and the second format rule base are implemented using a new programming language.

7. The command-line based configuration management method according to claim 1, characterized in that, The process of obtaining the general configuration object based on the first command line and the second command line includes: Create a first general object, store the first command line and its parameters into the first general object, and obtain a first sub-general configuration object; If it is determined that the second command line is the original command line, then the second configuration object is obtained based on the second command line; If it is determined that the second command line is a new command line, then a second general object is created, and the second command line and its parameters are stored in the second general object to obtain a second sub-general configuration object; The first sub-general configuration object, the second configuration object, and / or the second sub-general configuration object are integrated into a general configuration object.

8. A command-line based configuration management system, characterized in that, include: The acquisition unit is used to acquire the first command line; The first determining unit is configured to, if it is determined that the first command line is the original command line, obtain a first configuration object based on the first command line in the original programming language environment; wherein the original programming language is C language; The first conversion unit is used to convert the first configuration object into a first business configuration file, a first business command line, and a first business configuration object and send them to the business system; The second determining unit is configured to, if it is determined that the first command line is a new command line, parse the first command line in a new programming language environment to obtain several second command lines, and obtain a general configuration object based on the first command line and the second command lines; wherein, the new programming language is Python. The second conversion unit is used to convert the general configuration object into a second business configuration file, a second business command line, and a second business configuration object, and send them to the business system.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the command-line based configuration management method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the command-line based configuration management method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Configuration updating method and related product

    CN109800008A

  • Hosting system and hosting method for power system scene and configuration

    CN115313642A