A database management method, a database management device, and a computing device cluster

By using management services and DRS in the cloud management platform to upgrade the database kernel and synchronize incremental data, the problem of database version rollback is solved, the retention of incremental data and the processing of rollback requests is realized, and the user experience is improved.

CN119988355BActive Publication Date: 2025-07-04SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510458159.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-07-04
Estimated Expiration
2045-04-11

AI Technical Summary

Technical Problem

When the database kernel falls back from a higher version to a lower version, the existing technology faces version compatibility issues, resulting in the inability to effectively implement the fallback and the incremental data may be lost.

Method used

By using management services and data replication services (DRS) in the cloud management platform, the incremental data of the database of higher-version kernels is synchronized to the lower-version kernel database, and the site information is used to generate structured query language statements for data playback, ensuring the synchronization of incremental data and supporting fallback requests.

Benefits of technology

It realizes that after the kernel is upgraded, it can process fallback requests in a timely manner, avoid incremental data loss, improve user experience, and meet users' backback needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988355B_ABST
    Figure CN119988355B_ABST
Patent Text Reader

Abstract

A database management method, a database management device, and a computing device cluster are provided, relating to the field of database technology. The method is applied to a cloud management platform, which includes a management service and a data replication service. The method includes: the management service synchronizes the full amount of data of a first database to a second database, where the kernel version of the second database is higher than that of the first database; the management service sends incremental synchronization information to the data replication service, and the incremental synchronization information includes position information; the data replication service synchronizes the incremental data of the second database to the first database according to the position information; in the case of receiving a rollback request from a user, the management service configures the user to access the first database, where the user accessing the first database includes accessing incremental data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technologies, and in particular, to a database management method, a database management apparatus, and a cluster of computing devices. Background Art

[0002] In the field of databases, kernel upgrades are usually implemented directly based on the original database. When a user upgrades the database kernel from a lower version to a higher version, if they need to roll back to the original lower version, they may face version compatibility issues. Since the higher version kernel may involve changes in data structures or storage formats, this direct upgrade method on the original system makes it difficult to roll back the version, and it is impossible to roll back the kernel from a higher version to a lower version, thus unable to meet the user's rollback requirements. Summary of the Invention

[0003] This application provides a database management method, a database management apparatus, and a cluster of computing devices, which can meet the user's rollback requirements after upgrading the database kernel.

[0004] In a first aspect, this application provides a database management method. This method is applied to a cloud management platform, which is used to manage infrastructure. The infrastructure includes multiple regions, and each region includes at least one node. The cloud management platform includes a management service and a data replication service (DRS). The method includes: after the full amount of data of a first database is synchronized to a second database, the management service sends incremental synchronization information to the data replication service. The kernel version of the second database is higher than that of the first database, and the incremental synchronization information includes the position information of the first database; the data replication service synchronizes the incremental data of the second database to the first database according to the position information, and the incremental data is the data generated when a user of the first database accesses the second database; in the case of receiving a rollback request from the user, the management service configures the user to access the first database, where the user accessing the first database includes accessing the incremental data.

[0005] In the above solution, when upgrading the kernel of the first database, the management service upgrades by adding a second database. Thus, the first database with the original lower version kernel can be retained in the infrastructure for a period of time. That is to say, in order to support possible rollback requirements of subsequent users, within this time, both the first database with the lower version kernel and the second database with the higher version kernel are retained. When the user needs to roll back, the user can still access the original first database. Moreover, the management service synchronizes the incremental data in the second database to the first database through DRS, which can avoid losing incremental data.

[0006] In a possible implementation, the data replication service synchronizes the incremental data of the second database to the first database according to the position information, including: determining the target log to be synchronized in the second database according to the position information; generating a structured query language statement matching the first database according to the target log; sending the structured query language statement to the first database. After the first database executes the structured query language statement, the first database includes the incremental data.

[0007] In the above solution, the data replication service generates a structured query language (SQL) statement matching the first database according to the target log, so that the first database can replay the incremental data by executing these SQL statements, thereby realizing the synchronization of the incremental data.

[0008] In a possible implementation, the position information includes a transaction identifier and / or a log sequence number.

[0009] In the above solution, the data replication service can synchronize the incremental data according to the transaction identifier and / or the log sequence number.

[0010] In a possible implementation, the method further includes: when the full data synchronization of the first database to the second database ends, the management service determines the position information according to the last transaction identifier and / or the last log sequence number of the first database.

[0011] In the above solution, the management service instructs the data replication service to perform subsequent incremental data synchronization according to the last transaction identifier and / or the last log sequence number at the end of the full data synchronization.

[0012] In a possible implementation, before the management service sends the incremental synchronization information to the data replication service, the method further includes: the management service configures the user of the first database to access the second database.

[0013] In a possible implementation, configuring the user of the first database to access the second database includes: configuring the second database according to the virtual internet protocol (VIP) address configured by the first database.

[0014] In the above solution, before the kernel upgrade, the user accesses the first database through the VIP address, and the management service switches the VIP address to the second database, so that the user can still access the second database through the VIP address.

[0015] In a possible implementation, the incremental synchronization information further includes: information of the source database and information of the target database, the source database includes the second database, and the target database includes the first database.

[0016] In a second aspect, the present application provides a database management device. The database management device includes: a management module and a replication module.

[0017] Among them, the management module is used to send incremental synchronization information to the data replication service after the full amount of data in the first database is synchronized to the second database. The kernel version of the second database is higher than that of the first database, and the incremental synchronization information includes the position information of the first database.

[0018] Among them, the replication module is used to synchronize the incremental data of the second database to the first database according to the position information. The incremental data is the data generated when the user of the first database accesses the second database.

[0019] Among them, the management module is further used to configure the user to access the first database when receiving the rollback request of the user. Among them, the user accessing the first database includes accessing the incremental data.

[0020] In a possible implementation, the replication module is further used to: determine the target log to be synchronized in the second database according to the position information; generate a structured query language statement that matches the first database according to the target log; send the structured query language statement to the first database. After the first database executes the structured query language statement, the incremental data is included in the first database.

[0021] In a possible implementation, the position information includes a transaction identifier and / or a log sequence number.

[0022] In a possible implementation, the management module is further used to: determine the position information according to the last transaction identifier and / or the last log sequence number of the first database when the full amount of data in the first database is synchronized to the second database ends.

[0023] In a possible implementation, the management module is further used to: configure the user of the first database to access the second database before sending the incremental synchronization information.

[0024] In a possible implementation, the management module is further used to: configure the second database according to the VIP configured by the first database.

[0025] In a possible implementation, the incremental synchronization information includes: information of the source database and information of the target database, the source database includes the second database, and the target database includes the first database.

[0026] In a third aspect, the present application further provides a cluster of computing devices. The cluster may include at least one computing device, and each computing device includes a processor and a memory. The processor of at least one computing device is configured to execute instructions stored in the memory of at least one computing device, so that the cluster of computing devices executes the method provided in the above first aspect or any possible implementation manner of the first aspect.

[0027] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium includes computer program instructions, and when the computer program instructions are run by a cluster of computing devices, the cluster of computing devices is caused to execute the method provided in the above first aspect or any possible implementation manner of the first aspect.

[0028] In a fifth aspect, the present application further provides a computer program product. The computer program product includes computer program instructions. When the computer program instructions are executed by a cluster of computing devices, the cluster of computing devices executes the method provided in the above first aspect or any possible implementation manner of the first aspect.

[0029] Any of the above provided apparatuses, clusters of computing devices, computer storage media, or computer program products are all used to execute the method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding solutions in the corresponding method provided above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a schematic structural diagram of a cloud environment provided by the present application;

[0031] Figure 2 is a schematic structural diagram of a cloud data center in a cloud environment provided by the present application;

[0032] Figure 3 is a flowchart of a database management method provided by an embodiment of the present application;

[0033] Figure 4 is a schematic diagram of a management service in a cloud management platform provided by an embodiment of the present application interacting with a user to determine whether to upgrade the kernel;

[0034] Figure 5 is a schematic diagram of a management service provided by an embodiment of the present application upgrading the kernel of a first database by adding a second database;

[0035] Figure 6 is a schematic diagram of a management service provided by an embodiment of the present application configuring DRS for incremental synchronization;

[0036] Figure 7 is a schematic diagram of DRS provided by an embodiment of the present application performing incremental synchronization;

[0037] Figure 8 is a flowchart of another database management method provided by an embodiment of the present application;

[0038] Figure 9 is a schematic diagram of the management service synchronizing the full amount of data of the first database through DRS provided by an embodiment of the present application;

[0039] Figure 10 is a schematic structural diagram of a database management device provided by an embodiment of the present application;

[0040] Figure 11 is a schematic structural diagram of a computing device provided by an embodiment of the present application;

[0041] Figure 12 and Figure 13 is a schematic structural diagram of a computing device cluster provided by an embodiment of the present application. Detailed implementation manners

[0042] In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0043] In the description of the embodiments of the present application, words such as "exemplary", "for example", or "for instance" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary", "for example", or "for instance" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary", "for example", or "for instance" is intended to present related concepts in a specific manner.

[0044] In the description of the embodiments of the present application, the term "and / or" only describes the association relationship of associated objects and means that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and both A and B exist simultaneously. In addition, unless otherwise specified, the meaning of the term "plural" refers to two or more. For example, a plurality of systems refers to two or more systems, and a plurality of screen terminals refers to two or more screen terminals.

[0045] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0046] Before introducing the embodiments of the present application, the technical terms mentioned in the embodiments of the present application will be explained below.

[0047] The data replication service (DRS) is a cloud service in the cloud management platform for data synchronization between databases. DRS can connect to the source database and the target database simultaneously, and synchronize the migration objects in the source database to the target database. Among them, the migration objects can be the full amount of data and / or incremental data in the source database. DRS can support data synchronization of multiple networks. Through the links in these networks, DRS can achieve data synchronization between databases in various business scenarios. Among them, the multiple networks can include, but are not limited to, public network, dedicated line network, virtual private cloud (VPC) network, and virtual private network (VPN).

[0048] The site information is used to determine the starting position of data synchronization. The site information can specifically include a transaction identifier and / or a log sequence number. The transaction identifier is used to identify a transaction in the database. The log sequence number is used to identify a log in the database.

[0049] The user access rights of the database can include: read permission, write permission, and read / write permission. In the case of the database having read permission, the user can only read data from the database. In the case of the database having write permission, the user can only write data to the database. In the case of the database having read / write permission, the user can not only read data from the database but also write data to the database.

[0050] In the field of databases, the kernel upgrade of a database is usually performed on the original database. Generally, the management service stops the database from running, replaces the low-version kernel with a high-version kernel, and then restarts the database to complete the upgrade. In specific applications, after upgrading the kernel of the database, the user may need to roll back the database kernel, that is, roll back the high-version kernel to the low-version kernel. If the kernel upgrade is performed on the original database, the rollback requirement of the user cannot be met.

[0051] Therefore, the embodiments of the present application provide a database management method that can solve the above problems.

[0052] The database management method provided by the embodiment of the present application is applied to a cloud management platform. The cloud management platform includes a management service and a data replication service. The method may include: The management service synchronizes the full amount of data of the first database to the second database, and the kernel version of the second database is higher than that of the first database; The management service sends incremental synchronization information to the data replication service, and the incremental synchronization information includes the position information of the first database; The data replication service synchronizes the incremental data of the second database to the first database according to the position information, where the incremental data is the data generated when the user of the first database accesses the second database; In the case of receiving a rollback request from the user, the management service configures the user to access the first database, where the user accessing the first database includes accessing the incremental data.

[0053] In this solution, after the management service upgrades the kernel of the database with a lower version kernel of the user (i.e., the first database), the DRS synchronizes the incremental data generated in the database with a higher version kernel (i.e., the second database) to the original database with a lower version kernel. After receiving the rollback request from the user, on the one hand, the management service can process the user's rollback request in a timely manner and configure the user to access the original database with a lower version kernel. On the other hand, it can avoid losing the incremental data in the database with a higher version kernel, thereby improving the user experience.

[0054] Before introducing the database management method provided by the embodiment of the present application, the application scenario of the embodiment of the present application will be introduced first.

[0055] Figure 1 is a schematic structural diagram of a cloud environment provided by the present application. As Figure 1 shown, the cloud environment may include an infrastructure 10 and a cloud management platform 20. In Figure 1 it, the infrastructure 10 includes cloud data center clusters set in multiple regions. Exemplarily, the multiple regions may include Figure 1 the first region 11, the second region 12, and the third region 13 shown in

[0056] Each region is provided with a cloud data center cluster, and each cloud data center cluster includes multiple cloud data centers. Exemplarily, the cloud data center cluster located in the first region 11 may include Figure 1 the first cloud data center 111 and the second cloud data center 112 shown in

[0057] In Figure 1In this case, the cloud management platform 20 is used to manage the infrastructure 10. The first user C1 can connect to the Internet through the first client and log in to the cloud management platform 20 with an account bound to the first user C1 and pre-registered in the cloud management platform 20. After logging in, the first user C1 can enter the management service in the cloud management platform 20 and create a database for the first user C1 in the infrastructure 10. Similarly, the second user can connect to the Internet through the second client and log in to the cloud management platform 20 with an account bound to the second user C2 and pre-registered in the cloud management platform 20. After logging in, the second user C2 can enter the management service in the cloud management platform 20 and create a database for the second user C2 in the infrastructure 10. Among them, the first client and the second client can be a mobile phone with Internet access function, a personal computer, a vehicle-mounted host or other terminal devices with Internet access function.

[0058] It should be noted that in the embodiments of the present application, the functions of the management service may include creating a database and performing a kernel upgrade on the database. In other embodiments, the functions of the management service may also include other functions that need to be implemented by other cloud management platforms. The embodiments of the present application do not specifically limit other functions included in the management service. And in the embodiments of the present application, the name of the "management service" is only an exemplary expression, and its naming method is not limited by the embodiments. For the same type of service with other names, as long as the function implementation method is equivalent to the function implemented by the present application, it belongs to the scope protected by the present application.

[0059] Figure 2 provided by the present application Figure 1 is a schematic structural diagram of the first cloud data center 111 shown in. It should be noted that Figure 2 only exemplarily shows the structure of the first cloud data center 111 included in the first area 11. Other cloud data centers included in the first area 11 in the infrastructure 10 and / or cloud data centers included in other areas can refer to Figure 2 the structure shown in and the following introduction to Figure 2 The embodiments of the present application will not elaborate on this.

[0060] As Figure 2 shown, the first cloud data center 111 may include multiple nodes such as the first node 1111 and the second node 1112. Each node included in the first cloud data center 111 includes a hardware layer and a software layer.

[0061] In the first cloud data center 111, one or more databases can be created on the software layer of each node. For example Figure 2As shown, a first database 11111 can be created on the software layer of the first node 1111, and a second database 11121 can be created on the software layer of the second node 1112. The software layer of each node also includes an operating system, and the databases in each node run on the operating system. For example Figure 2 As shown, the software layer of the first node 1111 also includes a first operating system 11112, and the first database 11111 runs on the first operating system 11112; the software layer of the second node 1112 also includes a second operating system 11122, and the second database 11121 runs on the second operating system 11122.

[0062] The hardware layer of each node may include components such as memory, a processor, a network card, and a hard disk. Figure 2 which are not shown in the figure. Among them, the network card included in each node can communicate with the cloud management platform 20, so that the cloud management platform 20 can manage each node in the infrastructure. The structures of other nodes in the first cloud data center 111 and the nodes included in other cloud data centers in the infrastructure 10 are Figure 2 similar to the structure of the node shown, and can specifically refer to Figure 2 the structure shown and the description of the structures of the first node 1111 and the second node 1112 above, and will not be elaborated here.

[0063] It should be noted that in the embodiments of the present application, the number of databases created on each node in the infrastructure 10 can be set as needed, and the embodiments of the present application do not limit this.

[0064] After introducing the application scenarios of the embodiments of the present application, the following takes the Figure 1 cloud environment shown as an example, and introduces the database management method provided by the embodiments of the present application in combination with the accompanying drawings. In the database management method provided by the embodiments of the present application, the cloud management platform 20 includes, in addition to management services, DRS. DRS is used to synchronize the incremental data in the database with a high-version kernel obtained by kernel upgrade of the database with a low-version kernel to the database with the low-version kernel.

[0065] Figure 3 is a flowchart of a database management method provided by the embodiments of the present application. This method can be executed by the management service and DRS in the cloud management platform 20. As Figure 3 shown, this method may include S301 to S306. The following introduces Figure 3 each step shown. In the Figure 3 embodiment shown, the database with a low-version kernel is the first database, and the database with a high-version kernel is the second database.

[0066] S301. The management service creates a second database according to the upgrade request of the user in the first database. Among them, the kernel version of the second database is higher than that of the first database.

[0067] The management service can perform a kernel upgrade on the first database according to the upgrade request of the user from the first database. For Figure 4 example, after determining that there is a high-version kernel in the first database 11111, the management service can send an update message to the first user of the first database 11111. This update message is used to indicate that the first database 11111 can be updated to a high-version kernel. After receiving the update message, the first user can send an upgrade request to the management service according to actual needs to upgrade the kernel of the first database 11111. After receiving the upgrade request, the management service enters the kernel upgrade process of the first database 11111.

[0068] The management service performing a kernel upgrade on the first database can include: creating a second database in the infrastructure 10 according to the high-version kernel of the first database. Among them, the first database and the second database can be located in the same area or different areas in the infrastructure 10. And, the first database and the second database can be located on the same node or different nodes in the same area. For Figure 5 example, the management service can create a second database 11121 in the second node 1112 according to the high-version kernel of the first database 11111.

[0069] S302. The management service instructs the first database to synchronize all the data of the first database to the second database.

[0070] After creating the second database, the management service can instruct the first database to perform a full-data synchronization through a data synchronization message. Among them, the information of the second database can be included in this data synchronization message. After receiving the data synchronization message, the first database can synchronize all the data to the second database according to the information of the second database in the data synchronization message. For example, Figure 5 for example, after creating the second database 11121, the management service can send a data synchronization message to the first database 11111. The information such as the IP address and port number of the second database 11121 is included in this data synchronization message. The first database 11111 establishes a communication connection with the second database 11121 according to the IP address and port number of the second database 11121, and then synchronizes all the data to the second database through the replication tool of the first database 11111.

[0071] The first database can establish a communication connection with the second database based on the information of the second database, and then synchronize all data to the second database through the replication tool in the first database.

[0072] S303, the management service configures the users of the first database to access the second database.

[0073] After all the data in the first database is synchronized to the second database, the management service can be configured to allow the users of the first database to access the second database.

[0074] The management service configuring the users of the first database to access the second database may include: modifying the user access permissions of the first database and the second database. Among them, modifying the user access permissions of the first database and the second database may include: modifying the user access permission of the second database to read-write permission, and modifying the user access permission of the first database to read permission.

[0075] Taking the example that the user accesses the first database through the virtual Internet protocol VIP address, the management service configuring the users of the first database to access the second database may further include: mounting the VIP of the first database on the second database. After mounting, the user can access the second database through the VIP.

[0076] Taking the example that the user accesses the first database through the Internet protocol IP address, the management service can send the IP address of the second database to the user, so that the user can access the second database through the IP address of the second database.

[0077] After configuring the user to access the second database with a higher version kernel, the user accessing the second database will cause incremental data to be generated in the second database. As Figure 5 shown, when the user accesses the second database 11121, data that does not exist in the first database 11111 will be generated in the second database 11121, that is, incremental data. Therefore, the management service can configure an incremental synchronization task for the DRS, and synchronize the incremental data of the second database to the first database through the DRS. The specific process will be introduced below.

[0078] In some embodiments, the management service can also configure the users of the first database to access the second database after sending incremental synchronization information to the DRS. That is to say, the management service can execute S304 first and then S303.

[0079] S304, the management service sends incremental synchronization information to the data replication service.

[0080] The incremental synchronization information may include the position information of the first database, the information of the source database, and the information of the target database. Taking Figure 5Taking the scenario shown as an example, the site information of the first database is the site information of the first database 11111, the source database includes the second database 11121, and the target database includes the first database 11111.

[0081] Among them, the site information may include a transaction identifier and / or a log sequence number. After the full data synchronization of the first database to the second database is completed, the management service records the last transaction identifier and / or the last log sequence number of the first database, and determines the site information according to the last transaction identifier and / or the last log sequence number of the first database. The transaction identifier included in the site information may be the next transaction identifier of the last transaction identifier. The log sequence number included in the site information may be the next log sequence number of the last log sequence number.

[0082] Among them, the information of the database may include information such as the Internet Protocol (IP) address of the database, the port number, and the type of the database.

[0083] S305, the data replication service synchronizes the incremental data of the second database to the first database according to the site information. Among them, the incremental data is the data generated when the user of the first database accesses the second database.

[0084] After DRS receives the incremental synchronization information, as Figure 6 shown, it can create a DRS link from the second database to the first database according to the information of the source database (i.e., the second database 11121) and the information of the target database (i.e., the first database 11111) in the incremental synchronization information. For example, DRS can establish communication connections with the source database and the target database respectively according to the information of the source database and the information of the target database. After establishing communication connections with the source database and the target database, DRS can test the DRS link, and after the test passes, execute the incremental data synchronization process. Testing the DRS link may include testing the latency of the DRS link. For example, DRS can perform latency tests on the two communication connections included in the DRS link, and perform incremental data synchronization when the latency obtained from the test meets the preset latency threshold.

[0085] In the incremental data synchronization process, DRS can determine the target log to be synchronized in the second database according to the site information. For example, taking Figure 7For example, DRS can obtain the logs of the second database 11121 through the communication connection with the second database 11121. Then, according to the site information, determine the target logs to be synchronized from the logs of the second database 11121. Taking the site information including the transaction identifier as an example, DRS can compare the transaction identifier in the logs of the source database with the transaction identifier in the site information to determine the target logs to be synchronized in the source database. Taking the site information including the log sequence number as an example, DRS can compare the log sequence number in the logs of the source database with the log sequence number in the site information to determine the target logs to be synchronized in the source database.

[0086] In the incremental data synchronization process, after determining the target logs, DRS can generate a Structured Query Language statement that matches the first database based on the target logs, and send the Structured Query Language statement to the first database. Since the types of the first database and the second database may be different, the Structured Query Language (SQL) statements supported by the first database and the second database may be different. Taking Figure 7 as an example, DRS can generate an SQL statement supported by the first database 11111 for the operations performed by the second database 11121 recorded in the target logs, so that the first database 11111 can correctly process the SQL statement, thereby achieving incremental data synchronization. Among them, after the first database 11111 executes the received Structured Query Language statement, the incremental data in the second database 11121 is included in the first database 11111.

[0087] S306. In the case of receiving the user's rollback request, the management service configures the user to access the first database. Among them, the user's access to the first database may include accessing the above-mentioned incremental data.

[0088] The management service's user access to the first database may include: modifying the user access permissions of the first database and the second database. Modifying the user access permissions of the first database and the second database may include: modifying the user access permission of the first database to read-write permission, and modifying the user access permission of the second database to read permission.

[0089] Taking the user's access to the first database through the Virtual Internet Protocol (VIP) address as an example, the management service's configuration of the user's access to the first database may further include: mounting the VIP on the first database. After mounting, the user can access the first database through the VIP.

[0090] Taking the user's access to the first database through the Internet Protocol (IP) address as an example, the management service's configuration of the user's access to the first database may further include: the management service can send the IP address of the first database to the user's client, so that the user can access the first database through the IP address of the first database.

[0091] Since the incremental data in the second database has been synchronized to the first database through DRS, the user's access to the first database may include accessing the incremental data in the first database. That is to say, when the user's access request includes an operation on the incremental data, the first database can respond to the user's access request.

[0092] The above Figure 3 In the embodiment shown above, when upgrading the kernel of the first database with a lower version kernel, the management service upgrades by adding a second database with a higher version kernel. Thus, the original first database with the lower version kernel can be retained in the infrastructure for a period of time. That is to say, in order to support the possible fallback requirements of subsequent users, both the first database with the lower version kernel and the second database with the higher version kernel are retained during this period. When the user needs to fallback, the user can still access the original first database. Moreover, the management service synchronizes the incremental data in the second database to the first database through DRS, which can avoid losing incremental data.

[0093] Based on Figure 3 the embodiment shown above, the embodiment of the present application also provides another database management method.

[0094] Figure 8 is a flowchart of a database management method provided by an embodiment of the present application. This method can be executed by the management service and DRS in the cloud management platform 20. In this method, the management service can synchronize the full amount of data of the first database to the second database through DRS. As Figure 8 shown, this method may include S801~S807. The following introduces Figure 8 each step shown above. In Figure 8 the embodiment shown above, the database with the lower version kernel is the first database, and the database with the higher version kernel is the second database.

[0095] S801, the management service creates a second database according to the upgrade request of the users of the first database. Among them, the kernel version of the second database is higher than that of the first database. The specific process of this step can refer to the introduction of S301 in the method embodiment shown above Figure 3 and will not be elaborated here.

[0096] S802, the management service sends full amount synchronization information to the data replication service.

[0097] After the management service creates the second database, the management service can synchronize the full amount of data of the first database to the second database through DRS. For example, as Figure 9As shown, the management service can send full - volume synchronization information to the DRS. The full - volume synchronization information can include information about the source database and information about the target database. Take Figure 5 the scenario shown as an example. The source database includes the first database 11111, and the target database includes the second database 11121. Among them, the information of the database can include information such as the Internet Protocol (IP) address of the database, the port number, and the type of the database.

[0098] S803, the data replication service synchronizes the full - volume data of the first database to the second database.

[0099] After receiving the full - volume synchronization information, the DRS can create a DRS link from the second database to the first database according to the information of the source database (i.e., the first database 11111) and the information of the target database (i.e., the second database 11121) in the full - volume synchronization information. For example, the DRS can establish communication connections with the source database and the target database respectively according to the information of the source database and the target database. After establishing communication connections with the source database and the target database, the DRS can test the DRS link. After the test passes, it executes the full - volume data synchronization process. Testing the DRS link can include testing the latency of the DRS link. For example, the DRS can perform latency tests on the two communication connections included in the DRS link. When the latency obtained from the test meets the preset latency threshold, full - volume data synchronization is performed.

[0100] In the full - volume data synchronization process, the DRS can obtain the target logs to be synchronized from the first database. Since the types of the first database and the second database may be different, the Structured Query Language (SQL) statements supported by the first database and the second database may be different. After determining the target logs, the DRS can generate SQL statements that match the second database according to the target logs and send the SQL statements to the second database. After the second database executes the received SQL statements, the second database includes the full - volume data in the first database.

[0101] S804, the management service configures the users of the first database to access the second database. The specific process of this step can refer to the introduction of S303 in the above Figure 3 method embodiment shown, which will not be elaborated here.

[0102] S805, the management service sends incremental synchronization information to the data replication service. The specific process of this step can refer to the introduction of S304 in the above Figure 3 method embodiment shown, which will not be elaborated here.

[0103] S806. The data replication service synchronizes the incremental data of the second database to the first database according to the site information. The incremental data is the data generated when the users of the first database access the second database. The specific process of this step can refer to the description of S305 in the method embodiment shown above Figure 3 and will not be elaborated here.

[0104] S807. When receiving the rollback request of the user, the management service configures the user to access the first database. The user accessing the first database may include accessing the above incremental data. The specific process of this step can refer to the description of S306 in the method embodiment shown above Figure 3 and will not be elaborated here.

[0105] Based on Figure 3 and Figure 8 the method embodiments shown, the embodiment of the present application further provides a database management device.

[0106] Figure 10 FIG. is a schematic structural diagram of a database management device 1000 provided by the embodiment of the present application. This method can be used to execute all or part of the steps in the method embodiments shown above Figure 3 and / or Figure 8 shown.

[0107] As Figure 10 shown, the database management device 1000 may include a management module 1001 and a replication module 1002.

[0108] Among them, the management module is used to send incremental synchronization information to the data replication service after the full amount of data in the first database is synchronized to the second database. The kernel version of the second database is higher than that of the first database, and the incremental synchronization information includes the site information of the first database.

[0109] Among them, the replication module is used to synchronize the incremental data of the second database to the first database according to the site information. The incremental data is the data generated when the users of the first database access the second database.

[0110] Among them, the management module is further used to, when receiving the rollback request of the user, manage the service to configure the user to access the first database, where the user accessing the first database includes accessing the incremental data.

[0111] In a possible implementation manner, the replication module is further used to: determine the target log to be synchronized in the second database according to the site information; generate a structured query language statement matching the first database according to the target log; send the structured query language statement to the first database. After the first database executes the structured query language statement, the first database includes incremental data.

[0112] In a possible implementation, the locus information includes a transaction identifier and / or a log sequence number.

[0113] In a possible implementation, the management module is further configured to: when the full data synchronization of the first database to the second database ends, determine the locus information according to the last transaction identifier and / or the last log sequence number of the first database.

[0114] In a possible implementation, the management module is further configured to: before sending the incremental synchronization information, configure the user of the first database to access the second database.

[0115] In a possible implementation, the management module is further configured to: configure the second database according to the VIP configured for the first database.

[0116] In a possible implementation, the incremental synchronization information includes: information of the source database and information of the target database, where the source database includes the second database and the target database includes the first database.

[0117] It should be noted that Figure 10 When the database management device 1000 provided in the illustrated embodiment executes the database management method, only the division of the above function modules is used as an example for illustration. In practical applications, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the database management device provided in the above embodiment and Figure 3 and Figure 8 the method embodiment shown belong to the same concept, and the specific implementation process is detailed in Figure 3 and Figure 8 the method embodiments shown, which will not be elaborated here.

[0118] When the above module is taken as an example of a software functional unit, the database management device 1000 may include code running on a computing instance. The computing instance may be at least one of computing devices such as a physical host (computing device), a virtual machine, a container, etc. Further, the above computing devices may be one or more. For example, the database management device 1000 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers for running the code may be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple geographically proximate data centers. Usually, one region may include multiple AZs.

[0119] Similarly, the multiple hosts / virtual machines / containers for running the code may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.

[0120] When the above module is taken as an example of a hardware functional unit, the module may include at least one computing device such as a server, etc. Or, the module may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0121] The multiple computing devices included in the module can be distributed in the same region or in different regions. The multiple computing devices included in the module can be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the module can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices can be any combination of computing devices such as servers, application-specific integrated circuits (ASICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), and generic array logic (GALs).

[0122] It should be noted that in other embodiments, the management module 1001 and the replication module 1002 can be used to execute Figure 3 and Figure 8 any of the steps in the method shown. The steps to be implemented by the management module 1001 and the replication module 1002 can be specified as needed, and the entire function of the database management apparatus 1000 can be implemented by separately implementing Figure 3 and Figure 8 different steps in the method shown.

[0123] This application also provides a computing device 1100. As Figure 11 shown, the computing device 1100 includes: a bus 1101, a processor 1102, a memory 1103, and a communication interface 1104. The processor 1102, the memory 1103, and the communication interface 1104 communicate with each other through the bus 1101. The computing device 1100 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1100.

[0124] The bus 1101 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 11 only one line is shown in the figure, but it does not mean that there is only one bus or one type of bus. The bus 1101 can include a path for transmitting information between various components (such as the memory 1103, the processor 1102, and the communication interface 1104) of the computing device 1100.

[0125] The processor 1102 may include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0126] The memory 1103 may include a volatile memory, such as a random access memory (RAM). The processor 1102 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0127] The memory 1103 stores executable program codes, and the processor 1102 executes the executable program codes to respectively implement the functions of the foregoing management module 1001 and replication module 1002, thereby implementing Figure 3 、and / or Figure 8 the method. That is, the memory 1103 stores instructions for executing Figure 3 、and / or Figure 8 the method shown.

[0128] The communication interface 1104 uses modules such as, but not limited to, a network interface card and a transceiver to implement communication between the computing device 1100 and other devices or communication networks.

[0129] Based on Figure 3 and Figure 8 the method embodiments shown, the embodiments of the present application further provide a computing device cluster.

[0130] Figure 12 is a computing device cluster provided by the embodiments of the present application. The computing device cluster can be used to execute Figure 3 、and / or Figure 8 the method shown. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0131] As Figure 12As shown, the computing device cluster includes at least one computing device 1100. Instructions for executing Figure 3 and / or Figure 8 the method shown may be stored in the memory 1103 of one or more of the computing devices 1100 in the computing device cluster.

[0132] In some possible implementation manners, instructions for executing Figure 3 and / or Figure 8 the method shown may also be stored separately in the memory 1103 of one or more of the computing devices 1100 in the computing device cluster. In other words, a combination of one or more computing devices 1100 may jointly execute instructions for executing Figure 3 and / or Figure 8 the method shown.

[0133] It should be noted that the memories 1103 in different computing devices 1100 in the computing device cluster may store different instructions, respectively for executing partial functions of the database management apparatus 1000. That is to say, the instructions stored in the memories 1103 of different computing devices 1100 may implement the functions of one or more of the management module 1001 and the replication module 1002.

[0134] In some possible implementation manners, one or more computing devices in the computing device cluster may be connected through a network. Wherein, the network may be a wide area network or a local area network, etc. Figure 13 FIG. shows a possible implementation manner. As Figure 13 shown, a connection is made between the first computing device 1100A and the second computing device 1100B through a network. Wherein, the first computing device 1100A and the second computing device 1100B belong to different trusted domains, including but not limited to belonging to different regions or different availability zones.

[0135] Specifically, a connection is made to the network through the communication interfaces in each computing device. In this type of possible implementation manner, instructions for executing the functions of the management module 1001 are stored in the memory 1103 of the first computing device 1100A. At the same time, instructions for executing the functions of the replication module 1002 are stored in the memory 1103 of the second computing device 1100B. Figure 13 The connection manner between the computing device clusters shown in FIG. may be considered in view of the fact that the method provided in this application requires a large amount of storage resources and computing resources (such as storing a large amount of data), so it is considered to hand over the functions implemented by the management module 1001 to the first computing device 1100A for execution, and hand over the functions implemented by the replication module 1002 to the second computing device 1100B for execution. It should be understood that Figure 13The functions of the first computing device 1100A shown can also be completed by multiple computing devices 1100. Similarly, the functions of the second computing device 1100B can also be completed by multiple computing devices 1100.

[0136] Embodiments of this application also provide another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to Figure 12 and Figure 13 the connection method of the computing device cluster. The difference is that the same instructions for executing Figure 3 and / or Figure 8 the methods shown can be stored in the memory 1103 of one or more of the computing devices 1100 in this computing device cluster.

[0137] In some possible implementation manners, the memory 1103 of one or more of the computing devices 1100 in this computing device cluster can also separately store partial instructions for executing Figure 3 and / or Figure 8 the methods shown. In other words, the combination of one or more computing devices 1100 can jointly execute the instructions for executing Figure 3 and / or Figure 8 the methods shown.

[0138] Embodiments of this application also provide a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, it causes at least one computing device to execute Figure 3 and / or Figure 8 the methods shown.

[0139] Embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc. The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 3 and / or Figure 8 the methods shown, or instruct the computing device to execute Figure 3 and / or Figure 8 the methods shown.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A database management method, characterized in that, The method is applied to a cloud management platform for managing infrastructure. The infrastructure includes multiple regions, and each region includes at least one node. The cloud management platform includes a management service and a data replication service. The method includes: After the full data of the first database is synchronized to the second database, the management service configures the users of the first database to access the second database; The management service sends incremental synchronization information to the data replication service. The kernel version of the second database is higher than that of the first database. The incremental synchronization information includes the position information of the first database. The first database and the second database are deployed on the nodes included in the region; The data replication service synchronizes the incremental data of the second database to the first database according to the position information. The incremental data is the data generated when the users of the first database access the second database; When receiving the rollback request of the user, the management service configures the user to access the first database. Wherein, the user accessing the first database includes accessing the incremental data; 2. The method according to claim 1, wherein The data replication service synchronizing the incremental data of the second database to the first database according to the position information includes: Determining the target log to be synchronized in the second database according to the position information; Generating a structured query language statement matching the first database according to the target log; Sending the structured query language statement to the first database. After the first database executes the structured query language statement, the incremental data is included in the first database; 3. The method according to claim 1, wherein The position information includes a transaction identifier and / or a log sequence number; 4. The method according to claim 3, characterized in that, The method further includes: When the full data synchronization of the first database to the second database ends, the management service determines the position information according to the last transaction identifier and / or the last log sequence number of the first database; 5. The method according to claim 1, wherein The configuring the users of the first database to access the second database includes: Configuring the second database according to the virtual Internet protocol VIP address configured by the first database; 6. The method according to claim 1, wherein The incremental synchronization information further includes information of the source database and information of the target database. The source database includes the second database, and the target database includes the first database; 7. A database management device, characterized in that, The database management device includes: A management module, configured to, after the full data of the first database is synchronized to the second database, configure the users of the first database to access the second database, and send incremental synchronization information to the replication module. The kernel version of the second database is higher than that of the first database. The incremental synchronization information includes the position information of the first database; A replication module, configured to synchronize the incremental data of the second database to the first database according to the position information. The incremental data is the data generated when the users of the first database access the second database; The management module is further configured to, when receiving a fallback request from the user, configure the user to access the first database, where the user's access to the first database includes accessing the incremental data.

8. The database management apparatus according to claim 7, wherein The replication module is further configured to: Determine the target log to be synchronized in the second database according to the position information; Generate a Structured Query Language statement that matches the first database according to the target log; Send the Structured Query Language statement to the first database, where after the first database executes the Structured Query Language statement, the incremental data is included in the first database.

9. The database management apparatus according to claim 7, wherein The position information includes a transaction identifier and / or a log sequence number.

10. The database management device according to claim 9, wherein The management module is further configured to: When the full data synchronization of the first database to the second database ends, determine the position information according to the last transaction identifier and / or the last log sequence number of the first database.

11. The database management device according to claim 7, wherein The management module is further configured to: configure the second database according to the Virtual Internet Protocol (VIP) address configured for the first database.

12. The database management apparatus according to claim 7, wherein The incremental synchronization information includes: information of the source database and information of the target database, where the source database includes the second database, and the target database includes the first database.

13. A cluster of computing devices, characterized in that, Comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1-6.

14. A computer-readable storage medium, characterized in that, Comprising computer program instructions, when the computer program instructions are run by the computing device cluster, the computing device cluster executes the method according to any one of claims 1-6.

15. A computer program product, characterized in that, Comprising computer program instructions, when the computer program instructions are executed by the computing device cluster, the computing device cluster executes the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Database configuration method, system and equipment and storage medium

    CN119513199A