Adaptive graceful start-stop method and device for various databases

By dynamically parsing database configuration files to generate a start/stop sequence list, using a unified interface to execute start/stop operations, and performing environment checks and status verifications before and after start/stop, the system solves the problems of complex dependencies and independent environment checks in the start/stop maintenance of various types of databases, thus achieving efficient and stable database operation and maintenance.

CN120892104APending Publication Date: 2025-11-04AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511002664.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

During the data stack migration process, the start-up and shutdown maintenance of multiple database products are subject to complex dependencies, high error rates in manual configuration, and high failure risks due to the independence of environment checks and start-up/shutdown operations. Furthermore, the lack of a unified multi-database adaptation framework results in high maintenance costs, low efficiency, and an inability to quickly adapt to technological changes.

Method used

The system dynamically parses the database configuration file to generate a start/stop sequence list, calls start/stop commands based on a unified interface, executes dependent sequence operations, performs environment checks and status verifications before and after start/stop, generates reports, and automatically rolls back operations to restore the system state and notifies the administrator if an anomaly is detected.

Benefits of technology

It ensures the accuracy and stability of database start-up and shutdown operations, reduces the difficulty of fault handling, improves operation and maintenance efficiency, reduces the risk of business interruption, and achieves universality and scalability for various types of databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892104A_ABST
    Figure CN120892104A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive graceful start-stop method and device for various databases, and relates to the technical field of data processing. When the method is executed, firstly, a database configuration file is obtained and dynamically analyzed, and a start-stop sequence list is generated; calling different database start-stop commands based on a uniform interface, and operating according to a dependency sequence; and finally, environment inspection and state verification are carried out before and after starting and stopping, and a report is generated. And if starting and stopping are abnormal, automatically rolling back and notifying an administrator. In the method, the dynamic analysis can accurately grasp the component dependence and ensure that the start-stop sequence is correct; an interface is unified to shield instruction differences, and universality and expandability are improved; the environment inspection and state verification guarantee process is stable and reliable; the abnormal rollback can quickly recover the system, and the fault influence is reduced. According to the method, the accuracy, stability and universality of starting and stopping of various databases are improved, the fault processing difficulty is reduced, the operation and maintenance efficiency is effectively improved, stable operation of the system is guaranteed, and the service interruption risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to an adaptive graceful start-stop method and apparatus for various types of databases. Background Technology

[0002] During data stack migration, enterprise data centers often operate multiple database products simultaneously. Due to the numerous database software components, starting and stopping them presents many challenges. For example, using traditional tools such as scripts or simple automation tools for data migration relies on manual configuration of the database component start-up and shutdown order. However, database component dependencies are complex and dynamically changing, making manual configuration not only costly but also prone to errors. An incorrect start-up and shutdown order can cause database services to fail to start or become unstable, impacting the reliability of the entire system.

[0003] Furthermore, existing tools do not pre-verify environmental conditions when starting or stopping databases. Startup and shutdown operations and environmental checks are independent, failing to form a closed loop. This allows startups and shutdowns to proceed undetected due to insufficient disk space, network anomalies, or system resource constraints, easily leading to startup / shutdown failures or database malfunctions, increasing the difficulty of troubleshooting and the risk of business interruption. Different vendors' database startup / shutdown commands and component characteristics vary significantly, and there is currently a lack of a unified multi-database adaptation framework. Each database requires a separate startup / shutdown script, which is labor-intensive and inefficient. When a new database is introduced, scripts must be redeveloped, hindering rapid adaptation to technological changes and impeding enterprise digital transformation.

[0004] Therefore, it is essential to develop a database start-up, shutdown, and maintenance technology solution that can effectively address the above problems. Summary of the Invention

[0005] To address the above issues, this application provides an adaptive graceful start-up and shutdown method for various types of databases, including the following:

[0006] Firstly, this application provides an adaptive graceful start-up and shutdown method for various types of databases, the method comprising:

[0007] Obtain the database configuration file, dynamically parse the database configuration file, and generate a start / stop order list;

[0008] Start and stop commands for different databases are invoked based on a unified interface, and start and stop operations are executed in the order of dependency.

[0009] Environmental checks and status verifications are performed before and after startup and shutdown, generating check and verification result reports. If an abnormality occurs during startup and shutdown, a rollback operation is automatically performed to restore the system to its initial state.

[0010] Optionally, the dynamic parsing of the database configuration file comprises:

[0011] The pre- and post- start-stop relationships of each component of the database are identified, and a list containing the start-stop sequence of the components is generated; the list is used to guide the subsequent start-stop operation to be performed in the dependent sequence, so as to avoid component abnormalities caused by disordered sequence.

[0012] Optionally, before the start-stop commands of different databases are called based on the unified interface, the method further comprises:

[0013] The start-stop commands of multiple databases are encapsulated, and the unified interfaces startDatabase() and stopDatabase() are provided.

[0014] Optionally, the environment check comprises:

[0015] The disk space, process state, transaction state, master-slave state and synchronization mode are checked;

[0016] A check result report is generated, and if any check item fails, the start-stop process is terminated to prevent start-stop failure or data damage caused by unsatisfied environment conditions.

[0017] Optionally, the state verification comprises:

[0018] The process state, log error and synchronization state of the component after the start-stop operation are verified;

[0019] A verification result report is generated, and if the verification fails, a rollback operation is triggered to ensure system state consistency.

[0020] Optionally, the automatic execution of the rollback operation comprises:

[0021] The started components are stopped in reverse order, and the system is restored to the initial state before the start-stop operation;

[0022] The system administrator is notified of the abnormal information through email or short message, so as to facilitate timely intervention and processing.

[0023] Optionally, the calling of the start-stop commands of different databases based on the unified interface comprises:

[0024] The start-stop commands are executed in parallel or serial mode according to actual requirements; the start-stop execution state of each component is monitored, and if the start-stop of a component fails, an abnormal processing mechanism is triggered immediately, subsequent operations are terminated and rollback is performed.

[0025] In a second aspect, the application provides an adaptive graceful start-stop device for multiple types of databases, which comprises:

[0026] An acquisition unit is configured to acquire a database configuration file, dynamically parse the database configuration file, and generate a start-stop sequence list;

[0027] A processing unit is configured to call start-stop commands of different databases based on a unified interface, and perform start-stop operations in a dependent sequence.

[0028] A verification unit is configured to perform environment checking and state verification before and after start-stop, respectively, to generate checking and verification result reports; if an exception occurs during start-stop, a rollback operation is automatically performed to restore the system to an initial state.

[0029] Optionally, the dynamic parsing of the database configuration file by the acquisition unit comprises:

[0030] The pre-start and post-stop relationships of components of the database are identified, and a list containing start-stop sequences of the components is generated; the list is used to guide subsequent start-stop operations to be performed in a dependent sequence, so as to avoid component exceptions caused by disordered sequences.

[0031] Optionally, before the processing unit calls start-stop commands of different databases based on a unified interface, the processing unit is further configured to encapsulate start-stop commands of multiple databases, and provide unified interfaces startDatabase() and stopDatabase().

[0032] Optionally, the environment checking by the verification unit comprises:

[0033] Checking disk space, process state, transaction state, master-slave state, and synchronization mode.

[0034] A checking result report is generated, and if any checking item fails, the start-stop process is terminated to prevent start-stop failure or data damage caused by unsatisfied environment conditions.

[0035] Optionally, the verification by the verification unit comprises verifying process state, log error, and synchronization state of the components after the start-stop operation is completed; a verification result report is generated, and if the verification fails, a rollback operation is triggered to ensure system state consistency.

[0036] Optionally, the automatic execution of the rollback operation by the verification unit comprises:

[0037] Components that have been started are stopped in reverse order, and the system is restored to an initial state before the start-stop operation.

[0038] System administrators are notified of exception information through emails or short messages, so as to facilitate timely intervention and processing.

[0039] Optionally, the processing unit calling start-stop commands of different databases based on a unified interface and performing start-stop operations in a dependent sequence comprises:

[0040] According to actual needs, the start-stop command is executed in parallel or serial mode; the execution state of each component is monitored, and if a component fails to start or stop, an exception handling mechanism is triggered immediately to terminate subsequent operations and perform rollback.

[0041] In a third aspect, the present application provides a device, comprising a memory and a processor, wherein the memory is configured to store instructions or codes, and the processor is configured to execute the instructions or codes to enable the device to perform the method described in any of the implementation manners of the first aspect.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores codes, and when the codes are executed, a device executing the codes performs the method described in any of the implementation manners of the first aspect.

[0043] The present application provides a self-adaptive graceful start-stop method for multiple types of databases. In the execution of the method, a database configuration file is first obtained, the database configuration file is dynamically parsed to generate a start-stop sequence list, then start-stop commands of different databases are called based on a unified interface, start-stop operations are performed in a dependent order, finally environment checking and state verification are performed before and after start-stop, and a checking and verification result report is generated; if an exception occurs during start-stop, a rollback operation is automatically performed to restore the system to an initial state.

[0044] In this way, by dynamically parsing the database configuration file to generate the start-stop sequence list, the dependency relationship between different database components can be accurately grasped, ensuring that the start-stop operation is performed in the correct order and avoiding component exceptions caused by chaotic order; based on the unified interface to call the start-stop command, the differences in start-stop instructions of different databases are shielded, improving the universality and scalability of the method, and there is no need to write start-stop codes for each database separately; environment checking and state verification are performed before and after start-stop, and detailed reports are generated, which can discover environmental problems in advance, confirm the effect of start-stop operation in time, and ensure the stability and reliability of the database start-stop process; if an exception occurs, a rollback operation is automatically performed and the administrator is notified, which can quickly restore the system to the initial state, reduce the scope of failure impact, and facilitate the administrator to intervene and handle in time. The accuracy, stability, universality of the start-stop operation of multiple types of databases are improved, and the difficulty of failure handling is reduced. In this way, the database operation and maintenance efficiency can be effectively improved, the continuous and stable operation of the database system is ensured, and the risk of business interruption caused by improper start-stop is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0045] In order to make the technical solutions of the embodiments or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and other accompanying drawings can be obtained by those skilled in the art without creative effort.

[0046] Figure 1 A flowchart of an adaptive graceful start-stop method for a multi-type database provided by an embodiment of the present application;

[0047] Figure 2 A structural schematic diagram of an adaptive graceful start-stop device for a multi-type database provided by an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the technical solutions of the embodiments or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and other accompanying drawings can be obtained by those skilled in the art without creative effort.

[0049] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0050] Figure 1 A flowchart of an adaptive graceful start-stop method for a multi-type database provided by an embodiment of the present application. In combination with Figure 1 The adaptive graceful start-stop method for a multi-type database provided by the embodiment of the present application can include:

[0051] S101, a database configuration file is acquired, and the database configuration file is dynamically parsed to generate a start-stop sequence list.

[0052] A database refers to a system or software for organizing, storing, managing and accessing data, and its core goal is to efficiently, securely and reliably manage a large amount of data and support users to perform operations such as adding, deleting, modifying and querying data.

[0053] Firstly, the database configuration file needs to be obtained, which contains various configuration information required for the operation of the database system. The database configuration file is a file used to store configuration information related to the database system. These information covers various aspects of the database, such as connection parameters of the database, such as server address, port number, username and password, storage settings, such as the storage path of data files and log files, the configuration of storage engines, performance tuning parameters, such as cache size, concurrent connection number, and related configurations of database components.

[0054] Then the obtained database configuration file is dynamically parsed, which is a flexible and real-time analysis method according to the actual configuration content. In the dynamic parsing process, the pre-start and post-stop relationships between the components of the database are identified, that is, the order of dependence between each component when starting and stopping is determined. Based on the identified start-stop relationship, a list containing the start-stop order of the components is generated. This start-stop order list plays an important role, providing clear guidance for subsequent start-stop operations of the database, ensuring that the operations can be performed in order according to the dependence order between components, thereby avoiding component running abnormities caused by chaotic start-stop order, and ensuring the stability and reliability of the database system.

[0055] The dynamic parsing of the database configuration file includes identifying the pre-start and post-stop relationships of the components of the database, and generating a list containing the start-stop order of the components; the list is used to guide the subsequent start-stop operation to be performed in the order of dependence, avoiding component abnormalities caused by chaotic order.

[0056] Dynamic parsing refers to the process of analyzing and interpreting the actual content in the configuration file in real time during program execution, rather than using a fixed, pre-set method when processing the database configuration file. Unlike static parsing, which usually determines fixed parsing rules during program compilation or loading, dynamic parsing can flexibly handle complex and variable information in the configuration file, extract key information according to different configuration situations, and process it.

[0057] The pre-start and post-stop relationships of the components of the database refer to the pre-start relationship, which means that before starting a certain database component, other components that must be started first. For example, a database service component may depend on a certain storage management component, so before starting the database service component, it is necessary to ensure that the storage management component has been successfully started. The post-stop relationship refers to the fact that after a certain component is stopped, other dependent components can be stopped. For example, a log recording component may depend on a database core service component, and when the database core service component is stopped, the log recording component can be stopped, otherwise it may cause incomplete log recording.

[0058] The start-stop sequence list obtained through dynamic analysis is a list of component names or identifiers arranged according to a specific rule. The rule is determined based on the pre-start and post-stop relationships between components in the database. It specifies the order in which components should be started one after another when starting the database, and the order in which components should be stopped one after another when stopping the database, to ensure stable operation of the database system and avoid errors or exceptions caused by improper start-stop sequence of components.

[0059] S102, invoke start-stop commands of different databases based on the unified interface, and perform start-stop operations in the dependency order.

[0060] The unified interface provides a standardized access method for different functions or components. In the embodiments of the present application, the start-stop commands of multiple databases are first encapsulated, and the unified interfaces startDatabase() and stopDatabase() are provided. Through the unified interface, multiple different types of databases can call their start-stop commands through the same two interfaces. This can mask the differences in start-stop commands of different databases, so that the upper-layer application does not need to care about the type of the specific database, and only needs to use the unified interface to complete the operation, improving the code generality and maintainability.

[0061] The start-stop command is an instruction for controlling the start and stop of the database. For different database products such as MySQL, Oracle, and SQL Server, there are usually specific start-stop command formats and parameters. For example, the start command of MySQL is mysqld console, and the stop command is mysqladmin shutdown. These commands directly interact with the database service to realize the start and stop functions of the database.

[0062] The dependency order refers to the precedence relationship between components of the database when starting and stopping. Some components must be started after other components, or need to stop the components that depend on it first when stopping. For example, the core service component of the database may depend on the storage management component, so when starting, the storage management component needs to be started first, and then the core service component; when stopping, it is the opposite.

[0063] When invoking start-stop commands of different databases based on a unified interface and performing start-stop operations in a dependency order, parallel or serial mode can be selected to execute the start-stop commands according to actual needs, where the parallel mode is a way of executing tasks, in which mode multiple tasks can be performed simultaneously without interfering with each other. In the database start-stop operation, using the parallel mode means that multiple database components without strict dependency relationship can be started or stopped simultaneously to improve the efficiency of the start-stop operation and shorten the overall time. The serial mode is opposite to the parallel mode, which requires tasks to be executed in a certain order one after another. For components with strict dependency relationship, the serial mode is usually used to start or stop one by one in the dependency order to ensure the correctness of the operation.

[0064] During execution, the start-stop execution status of each component is monitored. If it is found that a component fails to start or stop, an exception handling mechanism is triggered immediately to terminate the subsequent operations that have not been executed, and a rollback operation is performed to undo the already executed operations, so that the database system is restored to a stable state before the operation, thereby ensuring the safety and reliability of the database start-stop operation. The exception handling mechanism is a set of rules and processes in a program for handling unexpected situations or errors. When an exception such as component start-stop failure occurs during the database start-stop process, the exception handling mechanism is triggered, which will take appropriate measures according to the pre-set rules, such as terminating subsequent operations, performing a rollback operation (undoing the already executed operations to restore the system to the state before the operation), etc., to avoid further expansion of errors and ensure the stability of the system and the consistency of the data. Rollback is a database operation that restores the state of the database to a specific time point or state before the operation. In the database start-stop process, if a component fails to start or stop, performing a rollback operation can restore the component that has been successfully started or stopped to the state before the operation, preventing the database system from being in an inconsistent state due to partial operation success and partial operation failure.

[0065] S103, environment check and state verification are performed before and after start-stop, respectively, to generate a check and verification result report; if an exception occurs during the start-stop process, a rollback operation is automatically performed to restore the system to the initial state.

[0066] The start-stop operation comprehensively checks the external environment conditions on which the database runs, covering multiple aspects such as disk space, process state, transaction state, master-slave state and synchronization mode. Specifically, it includes checking whether the disk space is sufficient to ensure sufficient space to store database files and logs; whether the process state is normal to avoid conflicting or abnormal processes affecting the database start-stop; whether the transaction state is complete to prevent data inconsistency due to incomplete transactions; and whether the master-slave state and synchronization mode meet the requirements to ensure the high availability of the database and the accuracy of data synchronization.

[0067] After the inspection is completed, an inspection result report is generated. If any of the inspection items fails, it indicates that the current environment condition does not meet the requirements of the database start-stop, at which time the start-stop process is terminated immediately to prevent serious consequences such as start-stop failure or data damage due to environment problems.

[0068] After the start-stop operation is completed, state verification is performed, mainly verifying the process state, log error and synchronization state of the components. After the verification is completed, a verification result report is generated. If the verification fails, it indicates that the start-stop operation does not achieve the expected effect, and the system state may have problems, at which time a rollback operation is triggered automatically. The rollback operation will stop the started components in reverse order to restore the system to the initial state before the start-stop operation, ensuring the consistency of the system state. At the same time, the system administrator is notified of the abnormal information through email or SMS, so that the administrator can know the problem in time and intervene to ensure the stable operation of the database system.

[0069] The above is some specific implementation modes of the adaptive graceful start-stop method for various databases provided by the embodiments of the present application. Based on this, the present application also provides a corresponding device. The device provided by the embodiments of the present application will be introduced from the perspective of functional modularization.

[0070] Figure 2 The structure diagram of the device for adaptive graceful start-stop of various databases provided by the embodiments of the present application is shown. In combination with Figure 2 The device for adaptive graceful start-stop of various databases provided by the embodiments of the present application 200 includes:

[0071] The acquisition unit 210 is configured to acquire a database configuration file, dynamically analyze the database configuration file, and generate a start-stop sequence list.

[0072] The processing unit 220 is configured to call start-stop commands of different databases based on a unified interface, and execute start-stop operations in a dependent order.

[0073] The verification unit 230 is configured to perform environment inspection and state verification before and after the start-stop, respectively, to generate inspection and verification result reports. If an exception occurs during the start-stop process, a rollback operation is automatically performed to restore the system to the initial state.

[0074] In an implementation mode of the embodiments of the present application, the dynamic analysis of the database configuration file by the acquisition unit includes:

[0075] The pre-stop and post-stop relationship of each component of the database is identified, and a list containing the start-stop sequence of the components is generated. The list is used to guide the subsequent start-stop operation to be executed in a dependent order to avoid component exceptions caused by chaotic order.

[0076] In an implementation form of the embodiment of the application, the processing unit is further configured to encapsulate the start and stop commands of the plurality of databases before invoking the start and stop commands of the different databases via the unified interface startDatabase() and stopDatabase().

[0077] In an implementation form of the embodiment of the application, the verification unit performs environment checking, including:

[0078] checking disk space, process state, transaction state, master-slave state and synchronization mode;

[0079] generating a checking result report, and terminating the start and stop process if any checking item fails, so as to prevent start and stop failure or data damage caused by unsatisfied environment conditions.

[0080] In an implementation form of the embodiment of the application, the verification unit performs verification, including verifying the process state, log error and synchronization state of the components after the start and stop operation is completed, and generating a verification result report, and triggering a rollback operation if the verification fails, so as to ensure system state consistency.

[0081] In an implementation form of the embodiment of the application, the verification unit automatically performs the rollback operation, including:

[0082] stopping the started components in reverse order, and restoring the system to the initial state before the start and stop operation;

[0083] informing the system administrator of abnormal information through email or short message, so as to facilitate timely intervention and processing.

[0084] In an implementation form of the embodiment of the application, the processing unit invokes the start and stop commands of the different databases based on the unified interface, and performs the start and stop operation in the dependency order, including:

[0085] selecting parallel or serial mode to execute the start and stop commands according to actual requirements, monitoring the start and stop execution state of each component, and triggering an abnormal processing mechanism immediately if the start and stop of a component fails, so as to terminate subsequent operations and perform rollback.

[0086] The embodiment of the application further provides a corresponding device and a computer storage medium, for implementing the scheme provided by the embodiment of the application.

[0087] The device includes a memory and a processor, the memory is configured to store instructions or codes, and the processor is configured to execute the instructions or codes, so that the device executes the method described in any embodiment of the application.

[0088] The computer storage medium stores codes, and when the codes are executed, the device executing the codes implements the method described in any embodiment of the application.

[0089] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of the present application.

[0090] It can be understood that, in the specific embodiments of the present application, the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved need to obtain user permission or consent when the above embodiments of the present application are applied to specific products or technologies, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0091] It should be noted that, in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the phrase "comprising a... " does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0092] It should be further noted that each of the various embodiments described in the specification are described using a progressive format, and the same or similar parts among the various embodiments can be mutually referred to, and each of the embodiments focuses on the differences from other embodiments. In particular, for the device and apparatus embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the description of the method embodiments. The above-described device and apparatus embodiments are only illustrative, and the units described as separate components can or can not be physically separated, and the components indicated as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0093] The above describes only one specific implementation of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A multi-class database oriented adaptive graceful shutdown method, characterized in that, The method comprises: obtaining a database configuration file, dynamically parsing the database configuration file, and generating a start-stop sequence list; calling start-stop commands of different databases based on a unified interface, and executing start-stop operations in a dependent sequence; performing environment checking and state verification before and after start-stop, respectively, and generating checking and verification result reports; if an exception occurs during start-stop, automatically performing a rollback operation to restore the system to an initial state.

2. The method of claim 1, wherein, The dynamic parsing of the database configuration file comprises: identifying the pre-stop and post-stop relationships of each component of the database, and generating a list containing the start-stop sequence of the components; the list is used to guide the subsequent start-stop operation to be executed in a dependent sequence, avoiding component exceptions caused by chaotic sequence.

3. The method of claim 1, wherein, Before calling the start-stop commands of different databases based on the unified interface, the method further comprises: encapsulating start-stop commands of multiple databases, and providing unified interfaces startDatabase() and stopDatabase().

4. The method of claim 1, wherein, The environment checking comprises: checking disk space, process state, transaction state, master-slave state, and synchronization mode; generating a checking result report, and terminating the start-stop process if any checking item fails, preventing start-stop failure or data damage caused by unsatisfied environment conditions.

5. The method of claim 1, wherein, The state verification comprises: verifying the process state, log error, and synchronization state of the components after the start-stop operation is completed; generating a verification result report, and triggering a rollback operation if the verification fails, ensuring system state consistency.

6. The method of claim 1, wherein, The automatic execution of the rollback operation comprises: stopping the started components in reverse order, and restoring the system to the initial state before the start-stop operation; informing the system administrator of the exception information through email or SMS, facilitating timely intervention and processing.

7. The method of claim 1, wherein, The calling of the start-stop commands of different databases based on the unified interface, and the execution of the start-stop operation in a dependent sequence comprise: selecting parallel or serial mode to execute the start-stop commands according to actual needs; monitoring the start-stop execution state of each component, and immediately triggering an exception processing mechanism if the start-stop of a component fails, terminating the subsequent operation and executing rollback.

8. A multi-class database oriented adaptive graceful shutdown apparatus, characterized by, The device comprises: an acquisition unit configured to obtain a database configuration file, dynamically parse the database configuration file, and generate a start-stop sequence list; a processing unit configured to call start-stop commands of different databases based on a unified interface, and execute start-stop operations in a dependent sequence; a verification unit configured to perform environment checking and state verification before and after start-stop, respectively, and generate checking and verification result reports; if an exception occurs during start-stop, automatically performing a rollback operation to restore the system to an initial state.

9. A computing device, comprising: The computing device comprises a memory and a processor; the memory is configured to store a computer program; the processor is configured to execute the computer program to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1 to 7.