A database all-in-one machine operation and maintenance management platform configuration parameter synchronization method and device
By storing configuration parameters in the database and utilizing Spring Factory and remote method calls, the problem of the DM shared cluster monitoring and maintenance platform being unable to synchronize configuration parameters in real time after modification was solved, achieving parameter configuration synchronization without downtime and improving configuration efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING DAMENG DATABASE TECH CO LTD
- Filing Date
- 2022-12-12
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, the DM shared cluster monitoring and maintenance platform requires a system restart to take effect after configuration parameters are modified, resulting in low parameter configuration efficiency and server downtime, and inability to synchronize configuration parameters in a timely manner.
By saving the modified configuration parameters in the database and using the Spring factory to call the interface in a loop, the class notification platform and the agent-side business reset service are implemented. Combined with remote method calls, parameter synchronization is achieved, thus avoiding system downtime.
It enables real-time synchronization of configuration parameters without downtime, ensuring the continuous operation of the monitoring and maintenance platform and improving the efficiency of parameter configuration.
Smart Images

Figure CN115840782B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer network technology, and specifically to a method, apparatus, electronic device, and storage medium for synchronizing configuration parameters of a database integrated machine operation and maintenance management platform. Background Technology
[0002] Configuration parameters are a fundamental function of an application system. They are typically loaded into the cache via a database or configuration file when the system starts. Each business module uses configuration parameters to load services during initialization, such as starting scheduled tasks, loading data sources, thread pools, etc. Modifications to these configuration parameters usually require a system restart to take effect.
[0003] The Dameng shared cluster monitoring and maintenance platform consists of a platform management system and multiple agent programs. The platform and agent programs are two independently running programs deployed on different servers. The agent programs are responsible for collecting the hardware and database node operating status on their respective servers and sending the data to the platform. The platform program is responsible for receiving the data collected by the agent programs and storing it in the database, while also providing an interface for the front-end page to display the required data. The agent programs do not depend on the platform for startup and operation. When the platform is running normally, the agent programs communicate directly with the platform after collecting data and send the data to the platform for storage. In the event of a platform failure, the data collected by the agent programs is saved locally and synchronized again after the platform returns to normal. This ensures a certain degree of continuity in the collected data. In existing technologies, if the Dameng shared cluster monitoring and maintenance platform modifies configuration parameters, a system restart is required for the platform program to synchronize the configuration parameters with the agent programs for the changes to take effect. This parameter configuration process is slow to take effect and can cause server downtime, reducing the efficiency of parameter configuration. Summary of the Invention
[0004] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide a method, device, electronic device and storage medium for synchronizing configuration parameters of a database appliance operation and maintenance management platform, thereby solving the technical problem in the prior art that the platform program cannot immediately and synchronously transmit configuration parameters to the agent program after the configuration parameters of the DM shared cluster monitoring and maintenance platform are modified.
[0005] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a method for synchronizing configuration parameters of a database appliance operation and maintenance management platform, comprising the following steps:
[0007] Save the modified configuration parameters to the database and update the corresponding cached configuration parameter objects.
[0008] Determine the type of the configuration parameter;
[0009] If the configuration parameters are platform configuration parameters, then the first interface implementation class is called in a loop through the Spring factory to notify the platform business to reset the service;
[0010] If the configuration parameters are proxy configuration parameters, then the proxy receives the configuration parameters by calling the interface via a remote method.
[0011] Save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache;
[0012] Based on the configuration parameters, the Spring factory is used to call the second interface implementation class in a loop to notify the proxy business to reset the service.
[0013] In some embodiments, before determining the type of the configuration parameter, the method further includes:
[0014] Save both the platform configuration parameters and the agent configuration parameters to the platform configuration parameter table;
[0015] The platform configuration parameters and agent configuration parameters in the platform configuration parameter table are classified according to platform class and agent class;
[0016] In some embodiments, classifying platform configuration parameters and proxy configuration parameters according to platform class and proxy class includes classifying platform configuration parameters and proxy configuration parameters by adding a parameter type field.
[0017] In some embodiments, before the step of cyclically calling the first interface implementation class and the second interface implementation class through the Spring factory, the method further includes:
[0018] Define the interface and method for changing the configuration parameters.
[0019] In some embodiments, the platform configuration parameter change interface is IPlatformConfigChangeService, and the agent configuration parameter change interface is IAgentConfigChangeService.
[0020] In some embodiments, the configuration file is a yml file, and the yml configuration file includes comment and definition functions.
[0021] In some embodiments, the notification platform service and / or agent-side service reset service includes the ApplicationContextAware interface, the context.getBeansOfType method, and the notifyChange method.
[0022] Secondly, the present invention also provides a configuration parameter synchronization device for a database appliance operation and maintenance management platform, comprising:
[0023] The first save and update module is used to save the modified configuration parameters to the database and update the corresponding configuration parameter objects in the cache.
[0024] The judgment module is used to determine the type of the configuration parameter;
[0025] The platform business reset service module is used to notify the platform business to reset the service by calling the first interface implementation class in a loop through the Spring factory if the configuration parameter is a platform configuration parameter.
[0026] A receiving module is configured to, if the configuration parameters are agent-side configuration parameters, invoke an interface via a remote method to enable the agent to receive the configuration parameters.
[0027] The second save and update module is used to save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache;
[0028] The proxy-side business reset service module is used to notify the proxy-side business reset service by using the Spring factory to call the second interface implementation class in a loop according to the configuration parameters.
[0029] Thirdly, the present invention also provides an electronic device, comprising: a processor and a memory;
[0030] The memory stores a computer-readable program that can be executed by the processor;
[0031] When the processor executes the computer-readable program, it implements the steps in the database appliance operation and maintenance management platform configuration parameter synchronization method as described above.
[0032] Fourthly, the present invention also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the database appliance operation and maintenance management platform configuration parameter synchronization method as described above.
[0033] Compared with existing technologies, the database appliance operation and maintenance management platform configuration parameter synchronization method, device, electronic device, and storage medium provided by this invention, after modifying the configuration parameters, saves the modified configuration parameters to the database and updates the corresponding cached configuration parameter objects. Subsequently, regarding the type of the modified configuration parameters, if the configuration parameters are platform configuration parameters, the first interface implementation class is called repeatedly through the Spring factory to notify the platform business to reset the service according to the configuration parameters; if the configuration parameters are proxy configuration parameters, the interface is called remotely to allow the proxy to receive the configuration parameters, achieving configuration parameter synchronization without system downtime. After the proxy configuration parameters are synchronized, the configuration parameters are saved to the configuration file and the corresponding cached configuration parameter objects are updated. Then, the second interface implementation class is called repeatedly through the Spring factory to notify the proxy business to reset the service. This invention, combining the characteristics of the Spring factory and remote method calls, realizes the functions of platform management and proxy configuration parameter synchronization and reset services in the DM shared cluster monitoring and maintenance platform, achieving the goal of uninterrupted operation of the monitoring and maintenance platform. Attached Figure Description
[0034] Figure 1 This is a flowchart of an embodiment of the configuration parameter synchronization method for the database appliance operation and maintenance management platform provided by the present invention;
[0035] Figure 2 This is a schematic diagram of an embodiment of the configuration parameter synchronization method for the database appliance operation and maintenance management platform provided by the present invention, before determining the configuration parameter type;
[0036] Figure 3 This is a schematic diagram of an embodiment of the configuration parameter synchronization device for the database appliance operation and maintenance management platform provided by the present invention;
[0037] Figure 4 This is a schematic diagram of the operating environment of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0039] The Dameng Shared Cluster Monitoring and Maintenance Platform consists of a platform management system and multiple agent programs. The platform and agent programs are two independently running programs deployed on different servers. The agent programs are responsible for collecting the operating status of the hardware and database nodes on their respective servers and sending the data to the platform. The platform program is responsible for receiving the data collected by the agent programs and storing it in the database. It also provides an interface for the front-end page to display the required data. The agent programs do not depend on the platform for startup and operation. When the platform is running normally, the agent programs communicate directly with the platform after collecting data and send the data to the platform for storage. When the platform is abnormal, the data collected by the agent programs will be saved locally and synchronized after the platform returns to normal. This can ensure the continuity of the collected data to a certain extent.
[0040] In an embodiment of the configuration parameter synchronization method for a database appliance operation and maintenance management platform provided by this invention, both the platform management and the agent program are written in Java and developed and run based on the Spring Boot framework. The platform program starts and runs based on a web container, and the agent program starts and runs based on a JAR package. The platform and agent programs run independently of each other. The parameter synchronization between them adopts Java's RMI remote call method, and the instant effect function after parameter synchronization utilizes the characteristics of the Spring Bean Factory. By searching for the business logic instance involved in the parameter change in the bean factory, the relevant business modules are notified to reset the service. The platform and agent business modules belong to different project directories. This method can solve the code call coupling problem.
[0041] The methods, apparatus, devices, or computer-readable storage media involved in this invention can be integrated with the above-mentioned systems or can be relatively independent.
[0042] Figure 1 This is a flowchart of the configuration parameter synchronization method for the database appliance operation and maintenance management platform provided in this embodiment of the invention. Please refer to [link / reference]. Figure 1 The method for synchronizing configuration parameters of the database appliance operation and maintenance management platform includes the following steps:
[0043] S101. Save the modified configuration parameters to the database and update the corresponding configuration parameter object in the cache.
[0044] S102. Determine the type of the configuration parameter;
[0045] S103. If the configuration parameters are platform configuration parameters, the first interface implementation class is called in a loop through the Spring factory to notify the platform business to reset the service.
[0046] S104. If the configuration parameters are agent-side configuration parameters, then the agent-side receives the configuration parameters by calling the remote method interface.
[0047] S105. Save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache;
[0048] S106. Based on the configuration parameters, the Spring factory is used to call the second interface implementation class in a loop to notify the agent-side business to reset the service.
[0049] In this embodiment, both the platform management and the agent program are written in Java and developed and run based on the Spring Boot framework. The platform program starts and runs based on a web container, while the agent program starts and runs based on a JAR file. The platform and agent programs run independently of each other. Parameter synchronization between them adopts Java's RMI remote call method, and the instant effect function after parameter synchronization utilizes the characteristics of the Spring Bean Factory. By looking up the business logic instance involved in the parameter change in the bean factory, the relevant business modules are notified to reset the service. The platform and agent business modules belong to different project directories. This method can solve the code call coupling problem.
[0050] It should be noted that the configuration parameter maintenance function of the Dameng shared cluster monitoring and maintenance platform includes platform configuration parameter maintenance and agent configuration parameter maintenance functions. The platform configuration parameters are loaded from the database, while the agent program configuration parameters are loaded from the YAML configuration file. The YAML file is a superset of the JSON file. YAML simplifies the syntax definition of the JSON file and also supports the definition function of comments. The platform management program is responsible for maintaining the configuration parameters of the entire system. After the configuration parameters are modified, in addition to resetting the relevant services of the platform, some parameters also need to be synchronized to the agent program and the relevant services of the agent need to be reset.
[0051] Furthermore, the platform and proxy-side business modules use the CommandLineRunner and Ordered interfaces provided by Spring to load business module services in sequence at startup. The Ordered interface ensures that configuration parameters are loaded before other business modules by manually specifying the loading order.
[0052] In some embodiments, please refer to Figure 2 Before determining the type of the configuration parameter, the method further includes:
[0053] S201. Save both the platform configuration parameters and the agent configuration parameters to the platform configuration parameter table;
[0054] S202. Classify the platform configuration parameters and agent configuration parameters in the platform configuration parameter table according to platform class and agent class.
[0055] In this embodiment, the modified configuration parameters are uniformly stored in the platform configuration parameter table. When the configuration parameter modification page is opened, the parameters are uniformly read from the configuration parameter table and displayed in groups according to parameter type.
[0056] In some embodiments, classifying platform configuration parameters and proxy configuration parameters according to platform class and proxy class includes classifying platform configuration parameters and proxy configuration parameters by adding a parameter type field.
[0057] In this embodiment, platform configuration parameters and agent configuration parameters are classified by adding a parameter type field. Based on the classification result, it is determined whether the configuration parameter belongs to the platform or the agent before proceeding with subsequent operations.
[0058] In some embodiments, before the step of cyclically calling the first interface implementation class and the second interface implementation class through the Spring factory, the method further includes:
[0059] Define the interface and method for changing the configuration parameters.
[0060] In this embodiment, the purpose of defining the configuration parameter change interface is to resolve the interdependence between the configuration parameter maintenance module and the data acquisition business module. Secondly, the configuration parameter maintenance logic implements the ApplicationContextAware interface, which is provided by the Spring bean factory. Its function is to provide access to the bean factory for the configuration parameter maintenance logic instance. Finally, in the configuration parameter saving method, the context.getBeansOfType method is used to obtain all business logic instances that implement the configuration parameter change interface, and the notifyChange method is called in a loop to notify all business modules that the parameters have changed.
[0061] In some embodiments, the platform configuration parameter change interface is IPlatformConfigChangeService, and the agent configuration parameter change interface is IAgentConfigChangeService.
[0062] In this embodiment, the platform configuration parameter change interface and the proxy configuration parameter change interface are the basis for Spring Factory to find the business modules that need to be notified of parameter changes. The platform and proxy business modules reset the service by implementing their respective configuration parameter change interfaces.
[0063] It should be noted that in other embodiments, the changed interface may be another form of interface.
[0064] In some embodiments, the notification platform service and / or agent-side service reset service includes the ApplicationContextAware interface, the context.getBeansOfType method, and the notifyChange method.
[0065] In this embodiment, the code call coupling and inter-module dependency issues are improved by using interfaces and Spring bean factory traversal. During the configuration parameter saving process, each business module is notified to reset related services. The general approach is to call the parameter change methods of the business modules sequentially in the save method, or to use a timed scheduling method in the business modules to listen for parameter changes. However, both methods have shortcomings. Specifically, the proxy program configuration parameter maintenance module needs to call the parameter change methods of each business module when saving, while the loading and resetting service methods of each business module need to call the parameter model object in the configuration parameter maintenance module. This creates a circular dependency. Under this circular dependency, the configuration parameter module and the business modules must be developed in the same project, and the development method of Maven aggregate project cannot be used. In addition, as the number of business modules increases, the number of configuration parameters will also increase, and more business modules need to be notified when changes occur. Therefore, using the above implementation method, more business modules need to be imported, which leads to the code call coupling problem.
[0066] Furthermore, to address the code call coupling issue, a configuration parameter change interface was first defined. Its purpose is to resolve the dependency between the configuration parameter maintenance module and the data acquisition business module. Secondly, the configuration parameter maintenance logic implements the `ApplicationContextAware` interface, provided by the Spring bean factory, which provides access to the bean factory for instances of the configuration parameter maintenance logic. Finally, in the configuration parameter saving method, the `context.getBeansOfType` method retrieves all business logic instances that implement the configuration parameter change interface. By repeatedly calling the `notifyChange` method, all business modules are notified that the parameters have changed. Through these improvements, the configuration parameter maintenance logic no longer needs to import other business module logic instances, resolving the dependency issue. For newly added business function modules, only the configuration parameter change interface needs to be implemented; no modifications are required in the configuration parameter saving method to achieve parameter change functionality, thus resolving the code call coupling problem.
[0067] Based on the above-described method for synchronizing configuration parameters of a database appliance operation and maintenance management platform, this embodiment of the invention also provides a corresponding device 300 for synchronizing configuration parameters of a database appliance operation and maintenance management platform. Please refer to [link to relevant documentation]. Figure 3The database appliance operation and maintenance management platform configuration parameter synchronization device 300 includes a first save and update module 310, a judgment module 320, a platform business reset service module 330, a receiving module 340, a second save and update module 350, and an agent-end business reset service module 360.
[0068] The first save and update module 310 is used to save the modified configuration parameters to the database and update the corresponding configuration parameter objects in the cache.
[0069] The judgment module 320 is used to determine the type of the configuration parameter;
[0070] The platform business reset service module 330 is used to notify the platform business reset service by calling the first interface implementation class in a loop through the Spring factory if the configuration parameter is a platform configuration parameter.
[0071] The receiving module 340 is configured to, if the configuration parameters are agent-side configuration parameters, use a remote method call interface to enable the agent to receive the configuration parameters;
[0072] The second save and update module 350 is used to save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache;
[0073] The proxy-side business reset service module 360 is used to notify the proxy-side business reset service by using the Spring factory to call the second interface implementation class in a loop according to the configuration parameters.
[0074] like Figure 4 As shown, based on the above-described database appliance operation and maintenance management platform configuration parameter synchronization method, this invention also provides an electronic device, which can be a mobile terminal, desktop computer, laptop, handheld computer, server, or other computing device. The electronic device includes a processor 410, a memory 420, and a display 430. Figure 4 Only some components of the electronic device are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0075] In some embodiments, memory 420 may be an internal storage unit of the electronic device, such as a hard disk or memory. In other embodiments, memory 420 may be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Furthermore, memory 420 may include both internal and external storage units. Memory 420 is used to store application software and various types of data installed on the electronic device, such as program code installed on the electronic device. Memory 420 may also be used to temporarily store data that has been output or will be output. In one embodiment, memory 420 stores a database appliance operation and maintenance management platform configuration parameter synchronization program 440, which can be executed by processor 410 to implement the database appliance operation and maintenance management platform configuration parameter synchronization method of the various embodiments of this application.
[0076] In some embodiments, processor 410 may be a central processing unit (CPU), microprocessor or other data processing chip, used to run program code stored in memory 420 or process data, such as executing the database appliance operation and maintenance management platform configuration parameter synchronization method.
[0077] In some embodiments, display 430 may be an LED display, a liquid crystal display, a touch-screen liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 430 is used to display information about the configuration parameter synchronization device on the database appliance operation and maintenance management platform, as well as to display a visual user interface. Components 410-430 of the electronic device communicate with each other via a system bus.
[0078] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a memory, magnetic disk, optical disk, etc.
[0079] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for synchronizing configuration parameters of a database appliance operation and maintenance management platform, characterized in that, include: Save the modified configuration parameters to the database and update the corresponding cached configuration parameter objects. Determine the type of the configuration parameter; If the configuration parameters are platform configuration parameters, then the first interface implementation class is called in a loop through the Spring factory to notify the platform business to reset the service; If the configuration parameters are proxy configuration parameters, then the proxy receives the configuration parameters by calling the interface via a remote method. Save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache; Based on the configuration parameters, the Spring factory is used to call the second interface implementation class in a loop to notify the proxy business to reset the service; Before the step of calling the first and second interface implementation classes in a loop through the Spring factory, the method further includes: defining the configuration parameter change interface and method; The platform configuration parameter change interface is IPlatformConfigChangeService, and the agent configuration parameter change interface is IAgentConfigChangeService; The notification platform business and / or agent-side business reset service includes the ApplicationContextAware interface, the context.getBeansOfType method, and the notifyChange method. The ApplicationContextAware interface provides access to the bean factory for the configuration parameter maintenance logic instance. The context.getBeansOfType method obtains all business logic instances that implement the configuration parameter change interface. By calling the notifyChange method in a loop, all business modules are notified that the parameters have changed.
2. The method for synchronizing configuration parameters of the database appliance operation and maintenance management platform according to claim 1, characterized in that, Before determining the type of the configuration parameter, the method further includes: Save both the platform configuration parameters and the agent configuration parameters to the platform configuration parameter table; The platform configuration parameters and agent configuration parameters in the platform configuration parameter table are classified according to platform class and agent class.
3. The method for synchronizing configuration parameters of the database appliance operation and maintenance management platform according to claim 2, characterized in that, The classification of platform configuration parameters and agent configuration parameters according to platform class and agent class includes classifying platform configuration parameters and agent configuration parameters by adding a parameter type field.
4. The method for synchronizing configuration parameters of the database appliance operation and maintenance management platform according to claim 1, characterized in that, The configuration file is a yml file, which includes comment and definition functions.
5. A configuration parameter synchronization device for a database appliance operation and maintenance management platform, characterized in that, include: The first save and update module is used to save the modified configuration parameters to the database and update the corresponding configuration parameter objects in the cache. The judgment module is used to determine the type of the configuration parameter; The platform business reset service module is used to notify the platform business to reset the service by calling the first interface implementation class in a loop through the Spring factory if the configuration parameter is a platform configuration parameter. A receiving module is configured to, if the configuration parameters are agent-side configuration parameters, invoke an interface via a remote method to enable the agent to receive the configuration parameters. The second save and update module is used to save the configuration parameters to the configuration file and update the corresponding configuration parameter object in the cache; The proxy-side business reset service module is used to notify the proxy-side business reset service by using the Spring factory to call the second interface implementation class in a loop according to the configuration parameters. Before the step of calling the first and second interface implementation classes in a loop through the Spring factory, the method further includes: defining the configuration parameter change interface and method; The platform configuration parameter change interface is IPlatformConfigChangeService, and the agent configuration parameter change interface is IAgentConfigChangeService; The notification platform business and / or agent-side business reset service includes the ApplicationContextAware interface, the context.getBeansOfType method, and the notifyChange method. The ApplicationContextAware interface provides access to the bean factory for the configuration parameter maintenance logic instance. The context.getBeansOfType method obtains all business logic instances that implement the configuration parameter change interface. By calling the notifyChange method in a loop, all business modules are notified that the parameters have changed.
6. An electronic device, characterized in that, include: Processor and memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps in the database appliance operation and maintenance management platform configuration parameter synchronization method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the database appliance operation and maintenance management platform configuration parameter synchronization method as described in any one of claims 1-4.