A cross-platform database management method, device and electronic device

Through the cross-platform database management method, using the extended service platform to identify and manage database instances, the problem of high access cost in the delivery of privatized databases in the ToB industry is solved, and the effect of reducing access costs and improving user experience is achieved.

CN113656482BActive Publication Date: 2025-02-11BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110968402.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2025-02-11
Estimated Expiration
2041-08-23

Smart Images

  • Figure CN113656482B_ABST
    Figure CN113656482B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a cross-platform database management method, device and electronic device, which relate to the field of database management technology. The specific implementation scheme is: determine the target management function that needs to be executed for the database system; obtain the specified metadata of each database instance in the database system; based on the first metadata in the obtained specified metadata, filter the database instance to execute the target management function from each database instance as the target instance; execute the target management function on the target instance according to the second metadata of the target instance and by scheduling the machine resources in the database system; and feed back the result information obtained after executing the target management function to the database management platform in the database system. Through this scheme, it is possible to reduce the access cost during the database delivery process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database management, and in particular to a cross-platform database management method, device and electronic equipment. Background Art

[0002] The database management platform carries a variety of management functions such as database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery, and auditing. Database service providers in the industry generally have their own database management platforms to achieve closed-loop management of the database life cycle. In the ToB (To Business) industry, it is usually necessary to deliver private databases to enterprises.

[0003] In the related technology, in the process of delivering private databases in the ToB industry, the user's database is generally migrated as a whole to the database management platform of the database service provider. However, this method of data migration is huge, and there are risks of security supervision and application compatibility, resulting in a very high access cost.

[0004] Therefore, how to reduce the access cost during database delivery is an urgent problem that needs to be solved. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a cross-platform database management method, device and electronic device to reduce the access cost during the database delivery process. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a cross-platform database management method, which is applied to an extended service platform, wherein the extended service platform communicates with a database system, and the method includes:

[0007] Determining target management functions to be performed on the database system;

[0008] Acquire specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be based on when executing the target management function;

[0009] Based on the first metadata in the acquired designated metadata, selecting a database instance to be executed with the target management function from each database instance as a target instance;

[0010] According to the second metadata of the target instance, and by scheduling machine resources in the database system, executing the target management function on the target instance;

[0011] The result information obtained after executing the target management function is fed back to the database management platform in the database system.

[0012] Optionally, the obtaining of specified metadata of each database instance in the database system includes:

[0013] Obtaining system configuration information of the database system;

[0014] Data analysis is performed on the system configuration information to obtain specified metadata of each database instance in the database system.

[0015] Optionally, the step of feeding back the result information obtained after executing the target management function to the database management platform in the database system includes:

[0016] Converting the result information obtained after executing the target management function into a data format compatible with the database management platform in the database system;

[0017] The result information after format conversion is fed back to the database management platform.

[0018] Optionally, the obtaining system configuration information of the database system includes:

[0019] Calling a first application program interface to obtain system configuration information of the database system;

[0020] The first application program interface is a pre-configured interface for requesting system configuration information of the database system from the database management platform.

[0021] Optionally, the scheduling method of the machine resources in the database system includes:

[0022] A second application program interface is called to schedule machine resources in the database system; wherein the second application program interface is a pre-configured interface for scheduling machine resources of the database system.

[0023] Optionally, converting the data format of the management result into a data format compatible with the database management platform in the database system includes:

[0024] calling a third application program interface to convert the data format of the management result;

[0025] The third application program interface is a pre-configured interface for converting the data format of data into a data format compatible with the database management platform.

[0026] Optionally, the target management functions include: database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery, or auditing.

[0027] Optionally, the machine resources include: one or more of computing, storage, network and security resources.

[0028] In a second aspect, an embodiment of the present invention provides a cross-platform database management device, which is applied to an extended service platform, wherein the extended service platform communicates with a database system, and the device includes:

[0029] A determination module, used to determine the target management function to be performed on the database system;

[0030] an acquisition module, configured to acquire the specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be used as a basis for executing the target management function;

[0031] A screening module, configured to screen, from various database instances, a database instance on which the target management function is to be executed as a target instance based on the first metadata in the acquired designated metadata;

[0032] an execution module, configured to execute the target management function on the target instance according to the second metadata of the target instance and by scheduling machine resources in the database system;

[0033] The feedback module is used to feed back the result information obtained after executing the target management function to the database management platform in the database system.

[0034] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0035] Memory, used to store computer programs;

[0036] The processor is used to implement the cross-platform database management method provided by the first aspect when executing the program stored in the memory.

[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the cross-platform database management method provided in the first aspect is implemented.

[0038] An embodiment of the present invention also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned cross-platform database management methods.

[0039] The cross-platform database management method provided by the embodiment of the present invention first determines the target management function to be executed for the database system, and obtains the specified metadata of each database instance in the database system; then, based on the specified metadata, the database instance targeted by the target management function is screened as the target instance, and the target management function is executed on the target instance by scheduling the machine resources in the database system; finally, the result information obtained after executing the target management function is fed back to the database management platform in the database system, thereby realizing cross-platform database management. Compared with the prior art, in this solution, there is no need to migrate the original database data to the new database management platform, but the extended service platform identifies the database instance targeted by the management function to be executed in the database system, and calls the machine resources in the database system to manage the database instance across platforms, thereby reducing the access cost generated during the database delivery process, and the user does not need to reconstruct the original database management platform, further improving the user experience.

[0040] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0042] Figure 1 A flowchart of a cross-platform database management method provided by an embodiment of the present invention;

[0043] Figure 2 Another flow chart of a cross-platform database management method provided by an embodiment of the present invention;

[0044] Figure 3 A working principle diagram of a cross-platform database management method provided by an embodiment of the present invention;

[0045] Figure 4 A schematic diagram of the structure of a cross-platform database management device provided by an embodiment of the present invention;

[0046] Figure 5The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0048] Database service providers in the industry generally have their own database management platforms, which carry multiple management functions such as database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery, and auditing, to achieve closed-loop management of the database life cycle. In the ToB industry (ToB is a business model in which enterprises are used as service entities to provide platforms, products or services to enterprise users and earn profits), database service providers in the industry often need to deliver users' databases in a private manner. In other words, the database service provider's database products (including two main components, the database kernel and the database management platform) need to be deployed in the user's own computer room or private network to provide users with private database management services.

[0049] In the related art, in the delivery process of privatized databases in the ToB industry, the delivery method generally adopted is to migrate the user's database as a whole to the database management platform of the database service provider, and use the database management platform of the database service provider to manage the user's database. In this way, the database service provider does not need to change its own database management platform, but only needs to migrate the user's self-built database to the database management platform of the database service provider. However, the data migration workload of this method is huge, and there are risks of security supervision and application compatibility during the migration process, resulting in a high access cost during the database delivery process.

[0050] At the same time, in the prior art, there is also a delivery method in which the database service provider provides the basic database kernel functions and the user builds the database management platform by himself. In this delivery method, since the database service provider only provides the database kernel functions, the user needs to reconstruct the original self-built database management platform according to the database kernel characteristics provided by the database service provider, resulting in a poor user experience.

[0051] Based on the above content, in order to reduce the access cost during the database delivery process while ensuring the user experience, the embodiments of the present invention provide a cross-platform database management method, device, system and electronic device.

[0052] The following first introduces a cross-platform database management method provided by an embodiment of the present invention.

[0053] A cross-platform database management method provided in an embodiment of the present invention is applied to an extended service platform, and the extended service platform communicates with a database system. The extended service platform may be a service platform that can provide a variety of database management functions, and the management functions may be: high availability, backup and recovery, auditing, etc. The database system may include: a database management platform, several database instances (which may belong to different clusters), and machine resources.

[0054] It should be noted that the extended service platform can be applied and deployed on an electronic device. In a specific application, the electronic device can be a server, and the server can be a cloud server of a database service provider. The extended service platform can be a dedicated database extended service software, or a database extended service plug-in embedded in an existing database extended service software.

[0055] The cross-platform database management method provided by the embodiment of the present invention may include the following steps:

[0056] Determining target management functions to be performed on the database system;

[0057] Acquire specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be based on when executing the target management function;

[0058] Based on the first metadata in the acquired designated metadata, selecting a database instance to be executed with the target management function from each database instance as a target instance;

[0059] According to the second metadata of the target instance, and by scheduling machine resources in the database system, executing the target management function on the target instance;

[0060] The result information obtained after executing the target management function is fed back to the database management platform in the database system.

[0061] In the solution provided by the embodiment of the present invention, first, the target management function to be executed for the database system is determined, and the specified metadata of each database instance in the database system is obtained; then, based on the specified metadata, the database instance targeted by the target management function is screened as the target instance, and the target management function is executed on the target instance by scheduling the machine resources in the database system; finally, the result information obtained after executing the target management function is fed back to the database management platform in the database system, thereby realizing cross-platform database management. Compared with the prior art, in this solution, there is no need to migrate the original database data to the new database management platform. Instead, the extended service platform identifies the database instance targeted by the management function to be executed in the database system, and calls the machine resources in the database system to manage the database instance across platforms, thereby reducing the access cost generated during the database delivery process, and the user does not need to reconstruct the original database management platform, further improving the user experience.

[0062] The following describes a cross-platform database management method provided by an embodiment of the present invention in conjunction with the accompanying drawings.

[0063] like Figure 1 As shown, the cross-platform database management method provided by the embodiment of the present invention may include the following steps:

[0064] S101, determining a target management function to be performed on the database system;

[0065] In this embodiment, the target management function may include: database deployment, monitoring and alarming, operation and maintenance, high availability, backup and recovery or auditing, etc. Specifically, database deployment may be to create a database cluster, etc.; database monitoring and alarming may be to monitor the resource occupancy of a database instance (which may be deployed on a physical machine, container platform, virtual machine, etc.), whether there is a downtime, etc.; database operation and maintenance may be to upgrade or downgrade a database instance (increase or decrease the data resource occupancy), set / change database operation parameters, set various policies, etc.; database high availability may be to switch between master and slave instances in response to downtime or unexpected interruption of a database instance, so as to restore the availability of the database as soon as possible; database backup and recovery may be to back up a database instance, so as to restore data when the database system crashes; database auditing may be to perform file auditing or network packet capture auditing and other auditing operations on the master instance.

[0066] It is understandable that when managing a database system, a database management platform in the database system is generally used to implement closed-loop management of the database life cycle. The database management platform in the database system carries multiple management functions such as database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery, and audit. In order to achieve cross-platform database management, it is first necessary to determine the target management function to be performed for the database system, and then expand the service platform to perform the target management function on the database system, without the need for the database management platform in the database system to perform the target management function.

[0067] S102, obtaining specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be based on when executing the target management function;

[0068] A person skilled in the art should know that metadata, also known as intermediate data or relay data, is data that describes data, mainly information that describes data attributes, and is used to support functions such as indicating storage location, historical data, resource search, and file records.

[0069] In this embodiment, the specified metadata of each database instance in the database system includes first metadata indicating whether the target management function is to be executed for the database instance and second metadata required as a basis for executing the target management function. Specifically, the specified metadata may include data such as cluster name, instance role, instance status, audit role or audit status. Moreover, for different target management functions, the specified metadata may include different first metadata and second metadata. Exemplarily, for the target management function of high availability, the first metadata may be the instance status, and the second metadata may be the instance role; and for the target management function of auditing, the first metadata may be the instance role, and the second metadata may be the audit mode; wherein the instance status may include a healthy state, an abnormal state, etc., the instance role may include a master instance, a slave instance, etc., and the audit mode may include a file audit, a network packet capture audit, etc.

[0070] S103, based on the first metadata in the acquired designated metadata, selecting a database instance to be used for executing the target management function from various database instances as a target instance;

[0071] The database instance on which the target management function is to be executed is screened, that is, the database instance on which the target management function is to be executed is screened from a plurality of database instances in the database system.

[0072] It is understandable that, since there are multiple database instances in the database system, not all database instances need to be executed with management functions, and the first metadata can indicate whether it is necessary to execute the target management function on the database instance, therefore, the instance can be screened based on the first metadata to obtain the target instance. Exemplarily, for the target management function of high availability, the first metadata can be the instance status. When the instance status of a database instance in the database system is in a healthy state, the database instance can be not processed, and when the instance status of a database instance in the database system is in an abnormal state, the instance is screened out as the target instance; Exemplarily, for the target management function of auditing, since the auditing function is to audit the master instance, the first metadata can be the instance role. When the instance role of a database instance in the database system is a slave instance, the database instance can be not processed, and when the instance role of a database instance in the database system is a master instance, the instance is screened out as the target instance to facilitate subsequent processing of the target instance.

[0073] S104, executing the target management function on the target instance according to the second metadata of the target instance and by scheduling machine resources in the database system;

[0074] It can be understood that, since the second metadata represents the metadata required to perform the target management function, when performing the target management function on the target instance, the information of the second metadata can be relied upon. In this embodiment, the machine resources in the database system may include one or more of computing, storage, network and security resources. Exemplarily, for the target management function of high availability, the second metadata may be the instance role. When the high availability function is performed on the target instance, the high availability master-slave instance switching operation is performed on the target instance by scheduling the storage resources and computing resources in the database system. Exemplarily, for the target management function of auditing, the second metadata may be the network packet capture audit mode. When performing the audit function on the target instance, the network packet capture audit is performed on the target instance by scheduling the network resources and computing resources in the database system.

[0075] Specifically, the function module for executing the target management function on the target instance in step S104 may be a plug-in with a database management function provided by the extended service platform, and the plug-in may execute the target management function on the target instance by calling machine resources in the database system. The plug-in with a database management function may be a database kernel plug-in provided by a database service provider. Since the plug-in does not exist in the original database system, in order to manage the original database system through the plug-in with a database management function, it is necessary to call the machine resources in the original database system, and the processing results need to be returned to the original database system.

[0076] Optionally, in one implementation, the scheduling method of the machine resources in the database system includes: calling a second application interface to schedule the machine resources in the database system; wherein the second application interface is a preconfigured interface for scheduling machine resources for the database system. Exemplarily, for the target management function of high availability, the second application interface may be a resource scheduling interface, and a plug-in with high availability function calls storage resources, computing resources, etc. in the database system through the resource scheduling interface to perform the target management function on the target instance. Exemplarily, for the target management function of auditing, the second application interface may be a resource scheduling interface, and a plug-in with auditing function calls computing resources, network resources, etc. in the database system through the resource scheduling interface to perform the target management function on the target instance.

[0077] It can be understood that since the plug-in with database management function provided by the extended service platform dispatches the machine resources in the database system to execute the target management function on the target instance by calling the second application interface, compared with the prior art, there is no need to deploy the plug-in with database management function in the user's original database system, thereby eliminating the need for code compatibility with the user's original database system and reducing the access cost.

[0078] S105, feeding back the result information obtained after executing the target management function to the database management platform in the database system.

[0079] In this embodiment, after scheduling the machine resources in the database system through the plug-in with database management function provided by the extended service platform and executing the target management function on the target instance, in order to manage the database instance across platforms, it is necessary to return the result information obtained after executing the target management function to the database management platform in the original database system. Since the extended service platform communicates with the database system, the result information obtained after executing the target management function can be fed back to the database management platform in the original database system.

[0080] Optionally, in one implementation, feeding back the result information obtained after executing the target management function to the database management platform in the database system may include steps A1-A2:

[0081] A1, converting the result information obtained after executing the target function into a data format compatible with the database management platform in the database system;

[0082] It is understandable that when the result information obtained after executing the target management function is fed back to the database management platform in the database system, since the data format in the database management platform may be incompatible with the data format of the result information, it is necessary to convert the data format of the result information into a data format that is compatible with the database management platform in the database system.

[0083] Specifically, converting the data format of the management results into a data format compatible with the database management platform in the database system includes: calling a third application interface to convert the data format of the management results; wherein the third application interface is a pre-configured interface for converting the data format of the data into a data format compatible with the database management platform.

[0084] Exemplarily, when performing data format conversion, the third application interface may have a clear output data format, such as JSON (JavaScript Object Notation) format or XML (Extensible Markup Language) format, and may also support user-defined result format conversion.

[0085] A2, feeding back the result information after format conversion to the database management platform in the database system.

[0086] It can be understood that by feeding the result information back to the database management platform in the database system, the result information can be displayed on the database management platform in the database system, thereby realizing a cross-platform database management function.

[0087] In the solution provided by the embodiment of the present invention, first, the target management function to be executed for the database system is determined, and the specified metadata of each database instance in the database system is obtained; then, based on the specified metadata, the database instance targeted by the target management function is screened as the target instance, and the target management function is executed on the target instance by scheduling the machine resources in the database system; finally, the result information obtained after executing the target management function is fed back to the database management platform in the database system, thereby realizing cross-platform database management. Compared with the prior art, in this solution, there is no need to migrate the original database data to the new database management platform. Instead, the extended service platform identifies the database instance targeted by the management function to be executed in the database system, and calls the machine resources in the database system to manage the database instance across platforms, thereby reducing the access cost generated during the database delivery process, and the user does not need to reconstruct the original database management platform, further improving the user experience.

[0088] Optionally, in another embodiment of the present invention, Figure 1 Based on the embodiment shown, Figure 2 As shown, the above step S102 may include S1021-S1022:

[0089] S1021, obtaining system configuration information of the database system;

[0090] Optionally, in one implementation, obtaining the system configuration information of the database system includes: calling a first application program interface to obtain the system configuration information of the database system; wherein the first application program interface is a pre-configured interface for requesting the system configuration information of the database system from the database management platform, and the system configuration information includes the cluster topology information.

[0091] Specifically, the system configuration information of the database system may include information such as cluster name, cluster topology, cluster hardware configuration (the hardware configuration of the cluster where the database instance is located).

[0092] S1022: Perform data analysis on the system configuration information to obtain specified metadata of each database instance in the database system.

[0093] In this embodiment, after obtaining the system configuration information of the database system, data analysis can be performed on the system configuration information, that is, the system configuration information is screened to obtain the specified metadata of each database instance in the database system, wherein the metadata may be instance topology, state machine of management logic, data verification state information, state information of database instance, etc. It can be understood that since there are multiple types of system configuration information obtained, and different target management functions require different system configuration information, after obtaining the system configuration information of the database system, data analysis needs to be performed on the system configuration information to manage the specified metadata obtained after the analysis, so as to facilitate the subsequent processing of the database instance by relying on the specified metadata.

[0094] Based on the relevant description of the above embodiments, it can be known that the cross-platform database management method provided by the present invention does not need to migrate the original database data to the new database management platform, but the extended service platform identifies the database instance for the management function to be executed in the database system, and calls the machine resources in the database system to manage the database instance across platforms, thereby reducing the access cost generated during the database delivery process, and the user does not need to reconstruct the original database management platform, further improving the user experience. In addition, by calling the interface, the system configuration information of the database system is obtained, and then after obtaining the system configuration information of the database system, the system configuration information is analyzed to manage the specified metadata obtained after the analysis, so as to facilitate the subsequent processing of the database instance relying on the specified metadata.

[0095] In order to better explain the content of the embodiments of the present invention, Figure 3 The working principle of the present invention is described.

[0096] like Figure 3 As shown, the user's original environment is the user's original database system described above, and the user's original environment includes a database management platform, a database instance, and basic resources (corresponding to the machine resources above), wherein the database management platform can implement database management operations based on the basic resources, such as deployment, high availability, backup, etc.; the extended service content is the database function extension service provided by the above-mentioned extended service platform to the user; the extended service platform interacts with the user's original environment through an API (Application Programming Interface).

[0097] The extended service content includes a configuration acquisition API (corresponding to the first application program interface mentioned above), an output data conversion API (corresponding to the third application program interface mentioned above), a resource scheduling API (corresponding to the second application program interface mentioned above) and a management plug-in module (corresponding to the plug-in with database management function mentioned above). Among them, the configuration acquisition API can obtain the cluster topology information from the user's original environment. The cluster topology information includes information such as database instances in the cluster and the machine locations where the instances are deployed in the cluster; the output data conversion API is used to convert the data format into a data format compatible with the database management platform; the resource scheduling API is used to call basic resources from the user's original environment; the management plug-in module is a plug-in with database management function provided by the extended service platform. The management function can be high availability, backup and recovery, auditing, monitoring, etc.

[0098] When using the extended service content provided by the extended service platform to manage the database in the user's original environment, first, obtain the object configuration information (corresponding to the system configuration information of the database system mentioned above) through the configuration acquisition API, that is, the topology and other information of the database instance; then, based on the obtained object configuration information, manage the object configuration information, that is, manage the metadata set of the database instance (corresponding to the specified metadata mentioned above), such as: instance topology, state machine of management logic, data verification status information, status information of the database instance, etc.; then, the management plug-in module calls the basic resources in the user's original environment by calling the resource scheduling API to implement instance change operations of different management functions; then, use the output data conversion API to convert the output data of the management plug-in module (such as JSON format or XML format, etc.) into a data format compatible with the user's original environment database management platform.

[0099] Based on the above description of the working principle of the present invention, it can be known that the present invention performs management functions by extending the management plug-in module provided by the service platform, thereby providing database management services to users in a plug-in mode. Users can access the database management function by providing an API, and there is almost no need to change the management process of the original database management platform, and users can access a variety of database management plug-ins as needed to achieve complete database management. Therefore, users can incorporate database management functions online without migrating database data. Users do not need to migrate database data in the original environment to the new database management platform, which is lower in cost and reduces the access cost. Users almost do not need to reconstruct the original database management platform to obtain stable database management functions.

[0100] In order to better understand the present invention Figure 3 The working principle shown is described below in conjunction with two specific extended service examples.

[0101] The following is an example of a high availability extended service function:

[0102] (1) Obtain object configuration information from the database management platform of the user's original environment through the configuration acquisition API, which may include: database cluster information, database cluster topology information, hardware configuration information, and backup path address information, as shown in the following table:

[0103]

[0104]

[0105] (2) Based on the object configuration information obtained in step (1), a metadata set of the database instance high availability service, namely, "management object configuration information", is constructed, wherein the first metadata is the instance state, and the second metadata is the instance role, as shown in the following table:

[0106]

[0107] (3) The management plug-in module determines the target instance by monitoring the instance status based on the metadata set constructed in step (2). Specifically, the database instance detection and status detection can be enabled to monitor the instance status. The criteria for determining whether the database instance status is healthy can be whether the database instance is connected, the status information reported regularly by the database instance, etc. When a database instance fails, the processing scenarios are as follows:

[0108] The first scenario: When the master instance of the database fails, such as the master instance 1.1.1.1 of cluster1, the slave instance 1.1.1.2 will be promoted to the master instance, and the failed original master instance 1.1.1.1 will be downgraded to a slave instance. At the same time, a master-slave relationship will be established between the slave instance 1.1.1.3 and the new master instance 1.1.1.2. When the original master instance 1.1.1.1 cannot be restored (such as a machine crash), the resource scheduling API needs to be called to schedule a new machine from the user's original environment, and a database slave instance 1.1.1.4 will be rebuilt using the data backed up from 1.1.1.3, and a master-slave relationship will be established with the new master instance 1.1.1.2, so that cluster1 can be restored to an available state. The results after processing are shown in the following table:

[0109]

[0110] The second scenario: the database slave instance fails, such as the database slave instance 1.1.2.2 of cluster2. At this time, the management plug-in module first tries to restart the database slave instance 1.1.2.2 to restore the service. If it cannot be restored (such as the machine crashes), it is necessary to call the resource scheduling API to schedule a new machine from the user's original environment, and use the backup data to rebuild a database slave instance 1.1.2.3, and establish its master-slave relationship with the original database master instance 1.1.2.1. At the same time, the database backup service source is switched to the newly created slave instance 1.1.2.3, so that cluster2 can be restored to an available state. The results after processing are shown in the following table:

[0111]

[0112] (4) After the management plug-in module completes the database cluster failure recovery operation, it needs to call the output data conversion API to notify the database management platform of the user's original environment of the cluster topology information change, thereby ensuring the consistency of the database service status and the view in the management platform.

[0113] The following is an example of the audit extension service function:

[0114] (1) Obtain object configuration information from the database management platform of the user's original environment through the configuration acquisition API, which may include: database cluster information, cluster topology information, and hardware configuration information, as shown in the following table:

[0115]

[0116] (2) Based on the object configuration information obtained in step (1), a metadata set of the database instance audit service (database audit only audits the main instance) is constructed, namely, "management object configuration information", where the first metadata is the instance role and the second metadata is the audit mode, as shown in the following table:

[0117]

[0118] (3) The management plug-in module calls the resource scheduling API to schedule a new machine to deploy the audit tool from the user's original environment based on the metadata set constructed in step (2) and starts the audit operation. The specific audit operation can be determined based on the audit mode in the metadata set (file-based audit or network packet capture-based audit), and the audit results are written to the storage location of the audit results.

[0119] (4) After the management plug-in module completes the audit operation, the management plug-in module calls the output data conversion API to feed back the audit result information to the database management platform of the user's original environment for display.

[0120] The cross-platform database management method provided by the embodiment of the present invention first determines the target management function to be executed for the database system, and obtains the specified metadata of each database instance in the database system; then, based on the specified metadata, the database instance targeted by the target management function is screened as the target instance, and the target management function is executed on the target instance by scheduling the machine resources in the database system; finally, the result information obtained after executing the target management function is fed back to the database management platform in the database system, thereby realizing cross-platform database management. Compared with the prior art, in this solution, there is no need to migrate the original database data to the new database management platform, but the extended service platform identifies the database instance targeted by the management function to be executed in the database system, and calls the machine resources in the database system to manage the database instance across platforms, thereby reducing the access cost generated during the database delivery process, and the user does not need to reconstruct the original database management platform, further improving the user experience.

[0121] Corresponding to the above method embodiment, the embodiment of the present invention further provides a cross-platform database management device, which is applied to an extended service platform, wherein the extended service platform communicates with a database system, such as Figure 4 As shown, the device comprises:

[0122] A determination module 410 is used to determine a target management function to be performed on the database system;

[0123] The acquisition module 420 is used to acquire the specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be based on when executing the target management function;

[0124] A screening module 430 is used to screen a database instance to be executed with the target management function from various database instances based on the first metadata in the acquired designated metadata as a target instance;

[0125] An execution module 440 is used to execute the target management function on the target instance according to the second metadata of the target instance and by scheduling machine resources in the database system;

[0126] The feedback module 450 is used to feed back the result information obtained after executing the target management function to the database management platform in the database system.

[0127] Optionally, the acquisition module includes:

[0128] A topology information acquisition unit, used to acquire system configuration information of the database system;

[0129] The construction unit is used to perform data analysis on the system configuration information to obtain specified metadata of each database instance in the database system.

[0130] Optionally, the feedback module includes:

[0131] A format conversion unit, used to convert the result information obtained after executing the target management function into a data format compatible with the database management platform in the database system;

[0132] The result feedback unit is used to feed back the result information after format conversion to the database management platform.

[0133] Optionally, the topology information acquiring unit is specifically used to:

[0134] Calling a first application program interface to obtain system configuration information of the database system;

[0135] The first application program interface is a pre-configured interface for requesting system configuration information of the database system from the database management platform.

[0136] Optionally, the scheduling method of the machine resources in the database system includes:

[0137] A second application program interface is called to schedule machine resources in the database system; wherein the second application program interface is a pre-configured interface for scheduling machine resources of the database system.

[0138] Optionally, the format conversion unit is specifically used to:

[0139] calling a third application program interface to convert the data format of the management result;

[0140] The third application program interface is a pre-configured interface for converting the data format of data into a data format compatible with the database management platform.

[0141] Optionally, the target management functions include: database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery, or auditing.

[0142] Optionally, the machine resources include: one or more of computing, storage, network and security resources.

[0143] Among them, the content of the cross-platform database management device in the embodiment of the present invention is the same as the content of the above-mentioned cross-platform database management method, and will not be repeated here.

[0144] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0145] Memory 503, used for storing computer programs;

[0146] The processor 501 is used to implement the steps of any of the above-mentioned data acquisition methods when executing the program stored in the memory 503.

[0147] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0148] The communication interface is used for communication between the above electronic device and other devices.

[0149] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0150] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0151] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned cross-platform database management methods are implemented.

[0152] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any cross-platform database management method in the above-mentioned embodiments.

[0153] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0154] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0155] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A cross-platform database management method, characterized in that: Applied to an extended service platform, the extended service platform communicates with a database system, the method comprising: Determining target management functions to be performed on the database system; Calling a first application program interface to obtain system configuration information of the database system; wherein the system configuration information is description information related to a cluster, and the cluster is a cluster where a database instance of the database system is located; the first application program interface is a pre-configured interface for requesting the system configuration information of the database system from the database management platform; Performing data analysis on the system configuration information, and obtaining the specified metadata of each database instance in the database system from the system configuration information; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required as a basis for executing the target management function; Based on the first metadata in the acquired designated metadata, selecting a database instance to be executed with the target management function from each database instance as a target instance; According to the second metadata of the target instance, and by scheduling the machine resources in the database system, the target management function is executed on the target instance; wherein the scheduling method of the machine resources in the database system includes: calling a second application program interface to schedule the machine resources in the database system; wherein the second application program interface is a pre-configured interface for scheduling the machine resources of the database system; The result information obtained after executing the target management function is fed back to the database management platform in the database system.

2. The method according to claim 1, characterized in that: Feeding back the result information obtained after executing the target management function to the database management platform in the database system includes: Converting the result information obtained after executing the target management function into a data format compatible with the database management platform in the database system; The result information after format conversion is fed back to the database management platform.

3. The method according to claim 2, characterized in that The converting of the data format of the management result into a data format compatible with the database management platform in the database system includes: calling a third application program interface to convert the data format of the management result; The third application program interface is a pre-configured interface for converting the data format of data into a data format compatible with the database management platform.

4. The method according to claim 1, characterized in that The target management functions include: database deployment, monitoring and alarm, operation and maintenance, high availability, backup and recovery or auditing.

5. The method according to claim 1, characterized in that The machine resources include: one or more of computing, storage, network and security resources.

6. A cross-platform database management device, characterized in that: Applied to an extended service platform, the extended service platform communicates with a database system, the device comprises: A determination module, used to determine the target management function to be performed on the database system; an acquisition module, configured to acquire the specified metadata of each database instance in the database system; wherein the specified metadata of each database instance includes first metadata indicating whether to execute the target management function for the database instance, and second metadata required to be used as a basis for executing the target management function; A screening module, configured to screen, from various database instances, a database instance on which the target management function is to be executed as a target instance based on the first metadata in the acquired designated metadata; an execution module, configured to execute the target management function on the target instance according to the second metadata of the target instance and by scheduling machine resources in the database system; A feedback module, used to feed back the result information obtained after executing the target management function to the database management platform in the database system; The step of obtaining the specified metadata of each database instance in the database system includes: Acquire system configuration information of the database system; wherein the system configuration information is description information related to a cluster, and the cluster is a cluster where a database instance of the database system is located; Data analysis is performed on the system configuration information to obtain specified metadata of each database instance in the database system from the system configuration information.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data calculation and analysis system and method

    CN110134729A