Unified configuration and recovery method based on relationship model and readable storage medium
By adopting a unified configuration and recovery method based on a relational model, the problems of difficult maintenance of network device configuration parameters and inconsistent states are solved, realizing seamless management of parameter dependencies and consistency of configuration states, thereby improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AEROSPACE XINTONG TECH CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-03
AI Technical Summary
Maintaining the configuration parameters of existing network devices is difficult, parameter dependencies cannot be determined when distributing configurations, the state is inconsistent when restoring configurations, and system updates cause inconsistencies between user configurations and system configurations.
A unified configuration and recovery method based on a relational model is adopted. Parameter and dependency verification are performed through the relational model. Configuration parameters are stored in memory and hard disk. After version check, the configuration distribution steps are executed in sequence to generate a new configuration table to be compatible with the old configuration table.
It achieves seamless dependency management of configuration parameters, improves development efficiency, maintains consistency between system and user configuration states, and simplifies the handling of configuration dependencies.
Smart Images

Figure CN115858044B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of configuration management technology, specifically to a unified configuration and recovery method based on a relational model and a readable storage medium. Background Technology
[0002] With the development of SDN (Software-Defined Networking) architecture, the management and control planes are gradually being separated from the hardware layer and transformed into software-defined implementations. The demand for multi-parameter configurable and flexible configuration of HMIs (Human-Machine Interfaces) is becoming increasingly apparent. One-time configuration based on the REST (Representational State Transition) style will gradually replace the traditional configuration method of multiple commands being issued in a time-sharing and step-by-step manner. This will lead to increased coupling and dependencies of configuration parameters.
[0003] Most existing network device configuration saving methods restore configuration parameters by loading user-issued command lines or calling operation logs. However, these methods have the following problems:
[0004] 1. Regarding configuration distribution, the configuration cannot determine parameter dependencies and needs to be handled by the lower-level control plane. Each control plane module needs to maintain parameter dependencies separately at the code level.
[0005] 2. Regarding configuration recovery, when configuration parameters change, the original operation configuration records will become invalid;
[0006] 3. When the system configuration is updated by other non-user-triggered conditions, it will cause the user configuration status to be inconsistent with the system configuration status. Summary of the Invention
[0007] One of the objectives of this invention is to provide a unified configuration and recovery method based on a relational model to solve the technical problems of difficulty in maintaining configuration parameters and inconsistency between user configuration and system configuration status in the existing equipment configuration distribution and storage.
[0008] The basic solution provided by this invention is a unified configuration and recovery method based on a relational model, which includes the following:
[0009] Model generation steps: Obtain the schema definition and parse it to generate the relational model;
[0010] Configuration distribution steps: Perform rule validation and dependency validation on the configuration parameters according to the relational model. After the validation passes, distribute the configuration parameters according to the database trigger.
[0011] Configuration saving steps: Configure according to the distributed configuration parameters. After successful configuration, temporarily save the configuration parameters in memory. When the configuration is saved, save the configuration parameters to the hard disk.
[0012] Furthermore, the model generation steps specifically include the following: obtaining the schema definition, analyzing whether there are any invalid data definitions or incomplete field definitions, parsing the data structure to generate independent forms, and generating a relational model based on the independent forms.
[0013] Furthermore, rule validation specifically includes the following: validating the type, size, regular expression, and enumeration of configuration parameters, or calling preset custom rules to perform rule validation on configuration parameters.
[0014] Furthermore, the form includes a system configuration table, which in turn includes a user configuration table. It has preset distribution methods for add, delete, and modify operations. Database triggers distribute configuration parameters based on the operations performed on the form using different distribution methods.
[0015] Furthermore, when a user sends a save configuration command, or when other custom save configuration conditions are triggered, the save configuration is activated.
[0016] Furthermore, it also includes the following: Configuration recovery steps: After the process starts, the data structure of the configuration parameters is checked for version, a configuration list is generated based on the version check results, and the configuration distribution steps are executed in sequence according to the configuration list.
[0017] Furthermore, based on the version check results, a configuration list is loaded and generated, which includes the following: when the versions are inconsistent, the data in the original configuration table is expanded into a new data structure to form a new configuration table, and new fields are filled with default values. If there are no default values, they are filled with null.
[0018] Furthermore, based on the version check results, a configuration list is loaded and generated, specifically including the following: when the versions are consistent, it is determined whether the configuration table is empty. If the configuration table is empty, it is determined whether the Schema has a default field. If it exists, the default field is used as a configuration parameter to load and generate the configuration list; if the configuration table is not empty, the disk is queried and the configuration list is loaded and generated based on the configuration parameters.
[0019] Beneficial effects:
[0020] This solution adds a unified configuration relationship model between the management and control planes. This relationship module constrains the range and type of configuration parameters, as well as the dependencies between them. Simultaneously, version checks identify differences in the configuration tables, and expansions are made based on these differences to generate new configuration tables, thus ensuring compatibility with older tables and preventing existing operation configuration records from becoming invalid. With this solution, developers only need to focus on the relationships between business processes, without needing to consider configuration dependencies between modules, achieving seamless control over configuration dependencies and improving development efficiency.
[0021] The second objective of this invention is to provide a readable storage medium for a unified configuration and recovery method based on a relational model.
[0022] The present invention provides a second basic solution: a readable storage medium for a unified configuration and recovery method based on a relational model, wherein the readable storage medium stores computer instructions, and the computer instructions execute the aforementioned unified configuration and recovery method based on a relational model when they are run. Attached Figure Description
[0023] Figure 1 This is a schematic diagram illustrating the configuration distribution steps of an embodiment of the unified configuration and recovery method based on a relational model of the present invention.
[0024] Figure 2 This is a schematic diagram illustrating the configuration saving steps in an embodiment of the unified configuration and recovery method based on a relational model of the present invention.
[0025] Figure 3 This is a schematic diagram illustrating the configuration and recovery steps in an embodiment of the unified configuration and recovery method based on a relational model of the present invention.
[0026] Figure 4 This is a schematic diagram of the HTTP-based device configuration distribution process, which is an embodiment of the unified configuration and recovery method and readable storage medium based on the relational model of the present invention. Detailed Implementation
[0027] The following detailed description illustrates the specific implementation method:
[0028] Example
[0029] A unified configuration and recovery method based on a relational model is characterized by including the following:
[0030] Model generation steps: Obtain the schema definition and parse it to generate the relational model.
[0031] Configuration distribution steps: Perform rule validation and dependency validation on the configuration parameters according to the relational model. After the validation passes, distribute the configuration parameters according to the database triggers.
[0032] Configuration saving steps: Configure according to the distributed configuration parameters. After successful configuration, temporarily save the configuration parameters in memory. When the configuration is saved, save the configuration parameters to the hard disk.
[0033] Configuration recovery steps: After the process starts, the data structure of the configuration parameters is checked for version. Based on the version check results, a configuration list is generated and the configuration distribution steps are executed in sequence according to the configuration list.
[0034] The model generation steps specifically include the following:
[0035] Obtain the schema definition, analyze whether there are any invalid data definitions or incomplete field definitions, parse the data structure to generate independent forms, and generate a relational model based on the independent forms.
[0036] The configuration distribution steps are as follows: Figure 1 As shown, it specifically includes the following:
[0037] Configuration distribution mainly includes the rule_check module, db_constraint module, and db_trigger module.
[0038] The `rule_check` module performs rule validation on configuration parameters. Specifically, it validates the type, size, regular expression, and enumeration of configuration parameters, or invokes preset custom rules to perform rule validation. At the code logic level, data constraints are applied based on the constraints of the schema configuration file to validate the type, size, regular expression, and enumeration of configuration parameters. In other embodiments, custom rules `self_define()` are set, and limitations are applied based on these custom rules, making the rule validation of configuration parameters more closely aligned with actual application scenarios.
[0039] The forms include a system configuration table, which in turn includes a user configuration table. The `db_constraint` module performs dependency validation on configuration parameters, specifically validating dependencies between fields in different tables within the configuration table. Relational model data constraints are applied, validating key dependencies and uniqueness dependencies in the configuration table based on the schema configuration file.
[0040] After both rule validation and dependency validation pass, configuration parameters are distributed via a database trigger (i.e., the db_trigger module). If either validation fails, an exception is returned and distribution is stopped.
[0041] There are pre-defined dispatch methods for adding, deleting, and modifying configuration tables. When the configuration table changes, database triggers activate different dispatch methods based on the table operations, routing the configuration parameters to different apps. When querying the configuration table, no dispatch method is triggered; instead, the corresponding system configuration table or user configuration table is queried based on the request.
[0042] The configuration saving steps are as follows: Figure 2 As shown, it specifically includes the following:
[0043] Configuration saving mainly includes the db_storage module, which includes the db mem module (data memory) and the db disk module (data hard disk).
[0044] Configuration parameters are distributed via the `db_trigger` module. After successful configuration, the `db_storage` module temporarily stores the configuration parameters in the `db mem` module. When a user-issued save configuration command is received, or when other custom save configuration conditions are triggered, the configuration is saved in the `db disk` module, achieving persistent storage of the configuration parameters. An exception is returned if configuration fails.
[0045] Configure recovery steps, as attached. Figure 3 As shown, it specifically includes the following:
[0046] Configuration recovery mainly includes the ver_check module, the default_config module, and the recovery module.
[0047] After the process starts, it automatically enters the configuration recovery step, and performs version checks on the configuration parameters through the ver_check module. Specifically, it dynamically detects whether the data structure of the user configuration parameters has changed. If it has changed, the version is inconsistent; otherwise, the version is consistent.
[0048] Based on the version check results, a configuration list is generated, which includes the following:
[0049] When versions are inconsistent, data migration is performed, expanding the data in the original configuration table into a new data structure to form a new configuration table. New fields are filled with default values, and if there are no default values, they are filled with null.
[0050] When the versions are consistent, check if the configuration table is empty. If the configuration table is empty, check if the Schema has a default field through the default_config module. If it exists, use the value of the default field as a configuration parameter to load and generate the configuration list. If the configuration table is not empty, query the disk and load and generate the configuration list according to the configuration parameters.
[0051] After generating the configuration list, the configuration distribution step is executed, distributing the configuration parameters in sequence according to the configuration list.
[0052] This solution strictly follows the pipeline filter design style between each process, meaning that the failure of any link will prevent the next process from executing, and each process is globally dependent on the relationship model.
[0053] A readable storage medium for a unified configuration and recovery method based on a relational model, wherein the readable storage medium stores computer instructions that, when executed, perform the aforementioned unified configuration and recovery method based on a relational model.
[0054] The steps of this solution are illustrated with a specific example, as shown in the appendix. Figure 4As shown, the specific implementation process of the HTTP-based device configuration distribution process is as follows:
[0055] 1. Enter the initialization of the HTTP distribution service;
[0056] 2. Add a unified configuration recovery component;
[0057] 3. Registration application service module model;
[0058] 4. Register routing information;
[0059] 5. Perform initialization of this component;
[0060] 6. Enter listening mode and wait for user input;
[0061] 7. Receive HMI input from web or console;
[0062] 8. This component determines whether the route is valid;
[0063] 9. This component executes the route distribution processing module;
[0064] 10. Rule validation: If the validity of a configuration entry fails validation, distribution will not be executed.
[0065] 11. Dependency validation: If the dependency validation of a configuration entry fails, distribution will not be performed.
[0066] 12. Proceed to route distribution processing;
[0067] 13. When the application service module is configured successfully, this component will save the configuration; otherwise, it will enter exception handling.
[0068] This solution, based on a relational model, allows users to perceive the dependencies in business configurations, while developers remain unaware of the dependencies between underlying modules. Compared to existing technologies, this solution separates complex business configuration dependency logic from business processing logic, eliminating the need for underlying modules to implement complex configuration dependencies.
[0069] Meanwhile, this solution dynamically defines configurations based on a relational model and expands attributes by comparing differences in configuration tables to generate new configuration tables. This ensures that the new configuration tables are compatible with the old ones, thus solving the problem in existing technologies where, after data structure modifications, the old configuration tables cannot be adapted and can only be deleted and reconfigured.
[0070] In addition, this solution integrates user configuration with system configuration. Through the settings of the db_trigger module, user "create, delete, and modify" actions can trigger the configuration of lower-level modules, while "query" actions can be distributed to either the database or the system. This effectively maintains the consistency between system state and user configuration state.
[0071] The above descriptions are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.
Claims
1. A unified configuration and recovery method based on a relational model, characterized in that, Includes the following: Model generation steps: Obtain the schema definition and parse it to generate the relational model; Configuration distribution steps: Perform rule validation and dependency validation on the configuration parameters according to the relational model. After the validation passes, distribute the configuration parameters according to the database trigger. Configuration recovery steps: After the process starts, the data structure of the configuration parameters is checked for version, a configuration list is generated based on the version check results, and the configuration distribution steps are executed in sequence according to the configuration list; Based on the version check results, a configuration list is generated, which includes the following: When the versions are consistent, check if the configuration table is empty. If the configuration table is empty, check if the Schema has a default field. If it does, use the default field as a configuration parameter to load and generate the configuration list. If the configuration table is not empty, query the hard drive and load and generate the configuration list according to the configuration parameters; Configuration saving steps: Configure according to the distributed configuration parameters. After successful configuration, temporarily save the configuration parameters in memory. When the configuration is saved, save the configuration parameters to the hard disk.
2. The unified configuration and recovery method based on a relational model according to claim 1, characterized in that: Model generation steps, in detail Includes the following: Obtain the schema definition, analyze whether there are any invalid data definitions or incomplete field definitions, parse the data structure to generate independent forms, and generate a relational model based on the independent forms.
3. The unified configuration and recovery method based on a relational model according to claim 1, characterized in that: Rule validation specifically includes the following: The system can validate the type, size, regular expression, and enumeration of configuration parameters, or call preset custom rules to validate the configuration parameters.
4. The unified configuration and recovery method based on a relational model according to claim 2, characterized in that: The form includes a system configuration table, which in turn includes a user configuration table. There are preset distribution methods for add, delete, and modify operations. Database triggers distribute configuration parameters based on the operations performed on the form using different distribution methods.
5. The unified configuration and recovery method based on a relational model according to claim 1, characterized in that: The configuration is saved when a user sends a save configuration command, or when other custom save configuration conditions are triggered.
6. The unified configuration and recovery method based on a relational model according to claim 1, characterized in that: Based on the version check results, a configuration list is generated, which includes the following: When versions are inconsistent, the data in the original configuration table is expanded into a new data structure to form a new configuration table. New fields are filled with default values, and if there are no default values, they are filled with null.
7. A readable storage medium for a unified configuration and recovery method based on a relational model, characterized in that: The readable storage medium stores computer instructions, which, when executed, perform the unified configuration and recovery method based on the relational model as described in any one of claims 1-6.