Application configuration method and system of network equipment

By using a configuration management program to uniformly manage network device applications, the problems of configuration conflicts and asynchrony among multiple applications are resolved. This enables unified management and persistence of configuration files, thereby improving code reusability.

CN120979940APending Publication Date: 2025-11-18HANGZHOU SHIFEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311754417.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In existing technologies, managing configuration files for multiple applications on network devices is cumbersome and difficult to resolve configuration conflicts and synchronization issues.

Method used

The configuration management program provides unified management of application configuration data. The application determines the target node path according to the configuration requirements and establishes a connection with the configuration management program through ZMQ, gRPC or RESTful inter-process communication technology to achieve unified management and persistence of configuration files.

Benefits of technology

It resolves configuration conflicts and synchronization issues between multiple applications, improves code reusability, and achieves unified management and persistence of configuration files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120979940A_ABST
    Figure CN120979940A_ABST
Patent Text Reader

Abstract

The invention discloses an application configuration method and system of network equipment. The method comprises the steps that an application program determines a target node path according to a configuration requirement; the application program sends the target node path to a configuration management program; the configuration management program determines target configuration data according to the target node path; the configuration management program sends the target configuration data to the application program; according to the embodiment, configuration conflicts and configuration asynchronization among multiple applications in the prior art can be solved, unified management of the configuration files of the application programs according to the configuration management program is achieved, and persistence of the configuration files is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an application configuration method and system for network devices. Background Technology

[0002] In recent years, as the functions of network devices have improved, the devices themselves have become increasingly complex, increasing the difficulty of their development and posing challenges to the embedded software design of network devices.

[0003] In current technologies, a single network device often runs multiple applications, and each application needs to be correctly configured before the device can function properly. Each application manages its own configuration file, which is cumbersome and makes it difficult to resolve configuration conflicts and misalignments between multiple applications.

[0004] Therefore, how to manage the configuration files of multiple applications in a unified manner has become an urgent problem to be solved. Summary of the Invention

[0005] This invention provides a method and system for configuring network devices to solve the problems of configuration conflicts and asynchronous configurations among multiple applications in the prior art. It enables unified management of configuration files for multiple applications and improves code reusability.

[0006] According to one aspect of the present invention, an application configuration method for a network device is provided, comprising:

[0007] The application determines the target node path based on configuration requirements;

[0008] The application sends the target node path to the configuration management program;

[0009] The configuration management program determines the target configuration data based on the target node path;

[0010] The configuration management program sends the target configuration data to the application.

[0011] Before the application determines the target node path according to configuration requirements, it also includes:

[0012] After the application starts, it establishes a communication connection with the configuration management program and calls the interface of the configuration management program to obtain the path of each node corresponding to the preset configuration file in the configuration management program. The preset configuration file uses a tree structure to represent the mapping relationship between the node path and the configuration data.

[0013] The application determines the target node path according to configuration requirements, including:

[0014] Based on the configuration requirements, the target field is determined, and the target field is matched with the node paths corresponding to the preset configuration file. The target node path is determined based on the matching results.

[0015] After the application sends the target node path to the configuration manager, the following is also included:

[0016] The configuration management program adds the application and the target node path corresponding to the application to the subscription list.

[0017] The configuration management program determines the target configuration data based on the target node path, including:

[0018] Based on the preset mapping relationship between node paths and configuration data, all configuration data under the target node path is taken as the target configuration data.

[0019] After the configuration management program sends the target configuration data to the application, the process further includes:

[0020] The configuration management program determines whether the target configuration data in the subscription list has changed, identifies the target application in the subscription list corresponding to the changed target configuration data, and sends the changed target configuration data to the target application.

[0021] The configuration management program determines whether the target configuration data in the subscription list has changed, including:

[0022] The configuration management program determines whether the target node path corresponding to the target configuration data in the subscription list has been added, deleted, or modified.

[0023] After the application starts, it establishes a communication connection with the configuration management program, including:

[0024] After startup, the application establishes a communication connection with the configuration management program through ZMQ, gRPC, or RESTful inter-process communication technologies.

[0025] The data format of the configuration file includes:

[0026] YAML, JSON or Toml.

[0027] According to another aspect of the present invention, an application configuration system for a network device is provided, comprising: a configuration management program and at least one application program, wherein the application configuration system for the network device is used to execute the application configuration method for the network device described in any embodiment of the present invention.

[0028] The technical solution of this invention involves a configuration management program that uniformly manages the configuration data of applications; the application determines the target node path based on configuration requirements; the application sends the target node path to the configuration management program; the configuration management program determines the target configuration data based on the target node path; and the configuration management program sends the target configuration data to the application. This solution can resolve configuration conflicts and configuration asynchrony between multiple applications in the prior art, enabling unified management of application configuration files by the configuration management program and achieving file persistence.

[0029] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

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

[0031] Figure 1 This is a flowchart of an application configuration method for a network device according to Embodiment 1 of the present invention;

[0032] Figure 2 This is a flowchart of another application configuration method for a network device provided according to Embodiment 2 of the present invention;

[0033] Figure 3 This is a schematic diagram of the structure of an application configuration system for a network device according to Embodiment 3 of the present invention. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0035] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.

[0036] Example 1

[0037] Figure 1 This is a flowchart illustrating an application configuration method for a network device according to Embodiment 1 of the present invention. This embodiment is applicable to configuring applications. The method can be executed by an application configuration system for a network device, which can be implemented in hardware and / or software. Figure 1 As shown, the method includes:

[0038] S110, The application determines the target node path according to configuration requirements.

[0039] Here, an application can be a computer program developed and running on an operating system to complete one or more specific tasks. An application is an application that runs on a network device to implement functions such as network device management and connection. Configuration requirements can be the program configuration requirements necessary to ensure the operation of the application. The target node path can be the target node path in the configuration management program that corresponds to the configuration requirements of the application. Specifically, the target node path can exist in the configuration management program as a tree node. There is a correspondence between configuration requirements and target node paths. The target node path can be determined based on the configuration requirements.

[0040] It should be noted that there can be at least one application in this embodiment, which can be configured as needed, and this embodiment does not impose any specific limitations on it.

[0041] For example, before the application determines the target node path according to the configuration requirements, it may also include: after the application starts, it establishes a communication connection with the configuration management program, calls the configuration management program interface to obtain the node paths corresponding to the preset configuration files in the configuration management program, wherein the preset configuration files use a tree structure to represent the mapping relationship between node paths and configuration data.

[0042] The preset configuration file can be a configuration file designed by the developers according to the standard. The application can obtain the path of each node corresponding to the preset configuration file by accessing the configuration management program interface. Specifically, the node path can be represented in the form of / a / b / c / d, where a, b, and c are node numbers.

[0043] In a specific implementation, the configuration management program can read configuration data from the configuration file and generate a configuration tree in memory. The tree structure represents the mapping relationship between node paths and configuration data. Specifically, a node path can include multiple nodes, such as parent nodes and leaf nodes. This embodiment does not make specific limitations on this.

[0044] For example, a configuration management program can generate a configuration tree corresponding to the configuration file in memory based on the hierarchical relationship of the configuration data in the configuration file. This hierarchical relationship can include the relationship between headings and content, numbering order, or punctuation marks, etc.

[0045] In a specific implementation, the type of a node path can include, but is not limited to, numbers, strings, lists, and dictionaries.

[0046] For example, the data format of the configuration file may include YAML, JSON, or TOML.

[0047] YAML, JSON, or TOML are data formats that can support tree structures, and this embodiment does not specifically limit them.

[0048] Specifically, as an example, a sample configuration file in YAML format may include at least one node path, at least one parent node, configuration items corresponding to leaf nodes, and configuration values, etc.

[0049] For example, the application can determine the target node path based on configuration requirements, which may include: determining the target field based on configuration requirements, matching the target field with the node paths corresponding to the preset configuration file, and determining the target node path based on the matching results.

[0050] The configuration requirement can carry at least one target field, and the number of target fields can be set according to the requirements. This embodiment does not make a specific limit on this.

[0051] In a specific implementation, if the node path is a node number, the number can be determined based on the field of the configuration requirement, and the configuration requirement number can be matched with the node path number. The target node path can then be determined based on the matching result.

[0052] In a specific implementation, since the target field corresponds to each node path in the preset configuration file, the target field is matched with each node path in the preset configuration file. If the target field matches at least one node path, the node path with the matching result is taken as the target node path.

[0053] For example, establishing a communication connection between an application and a configuration manager after startup may include: the application establishing a communication connection with the configuration manager through ZMQ, gRPC, or RESTful inter-process communication technologies after startup.

[0054] Once the application and the configuration management program establish a communication connection, the application can subscribe to and modify configuration data.

[0055] S120, The application sends the target node path to the configuration management program.

[0056] In the above embodiments, when the application determines that the preset configuration file of the configuration management program contains the target node path, it can send the target node path to the configuration management program. The application can then subscribe to the configuration data based on the target node path.

[0057] S130. The configuration management program determines the target configuration data based on the target node path.

[0058] For example, the configuration management program can determine the target configuration data based on the target node path, which may include: taking all configuration data under the target node path as the target configuration data according to the preset mapping relationship between node paths and configuration data.

[0059] In a specific implementation, if the target node path is " / ", then the complete configuration file under that path will be used as the target configuration data; if the target node path is " / common, / gnss", then all configuration data under the common parent node and the gnss parent node can be used as the target configuration data; if the target node path is a leaf node, then the values ​​defined under the leaf node will be used as the target configuration data.

[0060] S140, The configuration management program sends the target configuration data to the application.

[0061] In one specific implementation, after successful configuration data subscription, the configuration manager can return the target configuration data to the application.

[0062] In a specific implementation, the application can call the read interface of the configuration manager to query the corresponding target configuration data in the configuration manager according to the target node path. The configuration manager then returns all configuration data under the target node queried by the application.

[0063] Specifically, if the target node path to be read is " / clock / common / synce-wtr", then a configuration value of 300 can be returned.

[0064] This invention allows at least one application to access a configuration management program, enabling unified management of application configuration files and achieving file persistence. It also resolves configuration conflicts and asynchrony issues between multiple applications in existing technologies.

[0065] Example 2

[0066] Figure 2 This is a flowchart illustrating another application configuration method for a network device provided in Embodiment 2 of the present invention. Figure 2 As shown, the method includes:

[0067] S210, The application determines the target node path according to configuration requirements.

[0068] S220, The application sends the target node path to the configuration manager.

[0069] S230, The configuration management program adds the application and the target node path corresponding to the application to the subscription list.

[0070] In a specific implementation, after successful configuration data subscription, the configuration management program can add the application and its corresponding target node path to the subscription list. The configuration management program can then query which applications have subscribed to which target node paths based on the subscription list.

[0071] S240. The configuration management program determines the target configuration data based on the target node path.

[0072] S250, the configuration management program sends the target configuration data to the application.

[0073] S260. The configuration management program determines whether the target configuration data in the subscription list has changed, identifies the target application in the subscription list that corresponds to the changed target configuration data, and sends the changed target configuration data to the target application.

[0074] In a specific implementation, after successful subscription to configuration data, if the target configuration data in the subscription list changes, the target application corresponding to the changed target configuration data will be pushed to the target application as a configuration change message.

[0075] In a specific implementation, after configuration data changes, the configuration management program can send configuration change events through inter-process communication technologies such as ZMQ, gRPC, or RESTful to notify the target application.

[0076] In a specific implementation, after successful subscription of configuration data, the configuration management program determines whether the target configuration data in the subscription list has been updated, identifies the target application in the subscription list that corresponds to the updated target configuration data, and sends the updated target configuration data to the target application.

[0077] Specifically, the configuration management program can update the configuration data based on the parameter values ​​passed in from the configuration interface.

[0078] For example, the configuration management program can determine whether the target configuration data in the subscription list has changed by determining whether the target node path corresponding to the target configuration data in the subscription list has been added, deleted, or modified.

[0079] Changing the configuration data can involve adding, deleting, or modifying configuration tree nodes.

[0080] In a specific implementation, configuration data can be modified based on the passed configuration path node and value. Once the configuration data is successfully modified, the modification can be automatically saved and pushed to applications that have subscribed to the configuration data.

[0081] This invention employs a unified configuration management program to manage configuration programs. Each application only needs to connect to this program to access a unified configuration management interface and achieve configuration file persistence, thus improving code reusability.

[0082] Example 3

[0083] Figure 3 This is a schematic diagram of the structure of an application configuration system for a network device provided in Embodiment 3 of the present invention. Figure 3 As shown, the system includes:

[0084] Configuration management program 310 and at least one application 320, wherein the configuration management program can uniformly store and modify configuration files.

[0085] The process involves the application determining the target node path based on configuration requirements, the application sending the target node path to the configuration management program, the configuration management program determining the target configuration data based on the target node path, and the configuration management program sending the target configuration data to the application.

[0086] The network device application configuration system provided in this embodiment of the invention can execute a network device application configuration method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0087] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for configuring an application on a network device, characterized in that, include: The application determines the target node path based on configuration requirements; The application sends the target node path to the configuration management program; The configuration management program determines the target configuration data based on the target node path; The configuration management program sends the target configuration data to the application.

2. The method according to claim 1, characterized in that, Before the application determines the target node path according to configuration requirements, it also includes: After the application starts, it establishes a communication connection with the configuration management program and calls the interface of the configuration management program to obtain the path of each node corresponding to the preset configuration file in the configuration management program. The preset configuration file uses a tree structure to represent the mapping relationship between the node path and the configuration data.

3. The method according to claim 2, characterized in that, The application determines the target node path according to configuration requirements, including: Based on the configuration requirements, the target field is determined, and the target field is matched with the node paths corresponding to the preset configuration file. The target node path is determined based on the matching results.

4. The method according to claim 1, characterized in that, After the application sends the target node path to the configuration manager, the following is also included: The configuration management program adds the application and the target node path corresponding to the application to the subscription list.

5. The method according to claim 1, characterized in that, The configuration management program determines the target configuration data based on the target node path, including: Based on the preset mapping relationship between node paths and configuration data, all configuration data under the target node path is taken as the target configuration data.

6. The method according to claim 4, characterized in that, After the configuration management program sends the target configuration data to the application, the following is also included: The configuration management program determines whether the target configuration data in the subscription list has changed, identifies the target application in the subscription list corresponding to the changed target configuration data, and sends the changed target configuration data to the target application.

7. The method according to claim 6, characterized in that, The configuration management program determines whether the target configuration data in the subscription list has changed, including: The configuration management program determines whether the target node path corresponding to the target configuration data in the subscription list has been added, deleted, or modified.

8. The method according to claim 2, characterized in that, After the application starts, it establishes a communication connection with the configuration management program, including: After startup, the application establishes a communication connection with the configuration management program through ZMQ, gRPC, or RESTful inter-process communication technologies.

9. The method according to claim 2, characterized in that, The data format of the configuration file includes: YAML, JSON or Toml.

10. An application configuration system for a network device, characterized in that, The network device's application configuration system includes a configuration management program and at least one application program, and is used to perform the method as described in any one of claims 1-9.