Database management method, database management device and computing device cluster
By creating a second database of a higher version of the kernel on the cloud management platform and synchronizing incremental data, the problem of the database kernel falling back from a higher version to a lower version is solved, and the user's fallback needs and incremental data are synchronized, improving the user experience.
Patent Information
- Application Number
- CN202510458159.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-11
AI Technical Summary
After upgrading the database kernel from a low version to a high version, it is difficult for users to fall back from a high version to a low version, resulting in difficulty in falling back from a high version.
Create a second database with a higher version of the kernel by managing services on the cloud management platform, and synchronize the full amount of data from the first database to the second database. Then, the incremental data of the second database is synchronized to the first database based on the site information using the data replication service, thereby realizing the function of the user to access the incremental data. When receiving the user's fallback request, configure the user to access the first database to ensure that the user can access the original lower version of the kernel database.
It realizes the function of falling back from higher version to lower version, meeting the user's fallback needs, while avoiding the loss of incremental data and improving user experience.
Smart Images

Figure CN119988355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a database management method, a database management device, and a computing device cluster. Background Art
[0002] In the database field, kernel upgrades are usually implemented directly based on the original database. When users upgrade the database kernel from a low version to a high version, if they need to roll back to the original low version, they may face version compatibility issues. Since the high version kernel may involve changes in data structure or storage format, this method of directly upgrading on the original system will make version rollback difficult, and it is impossible to roll back the kernel from a high version to a low version, which cannot meet the user's rollback needs. Summary of the invention
[0003] The present application provides a database management method, a database management device, and a computing device cluster, which can meet the user's rollback requirements after upgrading the database kernel.
[0004] In the first aspect, the present application provides a database management method. The method is applied to a cloud management platform, the cloud management platform is used to manage infrastructure, the infrastructure includes multiple areas, each area 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 data of the first database is synchronized to 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 the kernel version of the first database, and the incremental synchronization information includes the location information of the first database; the data replication service synchronizes the incremental data of the second database to the first database according to the location information, and the incremental data is the data generated by the user of the first database accessing the second database; in the case of receiving a fallback request from 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.
[0005] In the above solution, when the kernel of the first database is upgraded, the management service upgrades it by adding a second database. As a result, the original first database with a lower version kernel can be retained in the infrastructure for a period of time. In other words, in order to support the possible fallback needs of subsequent users, the first database with a lower version kernel and the second database with a higher version kernel are retained during this time. When the user needs to fall back, the user can still access the original first database. In addition, the management service synchronizes the incremental data in the second database to the first database through DRS to avoid the loss of incremental data.
[0006] In one possible implementation, a data replication service synchronizes incremental data of a second database to a first database based on location information, including: determining a target log to be synchronized in the second database based on the location information; generating a structured query language statement that matches the first database based on the target log; and sending a structured query language statement to the first database, wherein 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 structured query language (SQL) statements matching the first database according to the target log, so that the first database can perform incremental data playback by executing these SQL statements, thereby achieving incremental data synchronization.
[0008] In a possible implementation, the location information includes a transaction identifier and / or a log sequence number.
[0009] In the above solution, the data replication service can perform incremental data synchronization based on the transaction identifier and / or the log sequence number.
[0010] In a possible implementation, the method further includes: when the full data of the first database is synchronized to the second database, the management service determines the location 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 based on the last transaction identifier and / or the last log sequence number at the end of 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 a user of the first database to access the second database.
[0013] In a possible implementation, configuring a user of the first database to access the second database includes: configuring the second database according to a virtual internet protocol (VIP) address configured in the first database.
[0014] In the above solution, before the kernel is upgraded, 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 a source database and information of a 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, which 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 data of the first database is synchronized to the second database. The kernel version of the second database is higher than the kernel version of the first database, and the incremental synchronization information includes the location information of the first database.
[0018] The replication module is used to synchronize the incremental data of the second database to the first database according to the location information, and the incremental data is the data generated when the user of the first database accesses the second database.
[0019] The management module is further used to manage the service configuration of the user accessing the first database when receiving a rollback request from the user, wherein the user accessing the first database includes accessing incremental data.
[0020] In one possible implementation, the replication module is also used to: determine a target log to be synchronized in the second database based on the location information; generate a structured query language statement that matches the first database based on the target log; and send a structured query language statement to the first database, wherein after the first database executes the structured query language statement, the first database includes incremental data.
[0021] In a possible implementation, the location 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 location information according to the last transaction identifier and / or the last log sequence number of the first database when the full data of the first database is synchronized to the second database.
[0023] In a possible implementation manner, the management module is further configured to: before sending the incremental synchronization information, configure users of the first database to access the second database.
[0024] In a possible implementation, the management module is further used to: configure the second database according to the VIP configured in the first database.
[0025] In a possible implementation, the incremental synchronization information includes: information of a source database and information of a 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 also provides a computing device cluster. The cluster may include at least one computing device, each computing device including a processor and a memory. The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs the method provided by the first aspect or any possible implementation 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 executed by a computing device cluster, the computing device cluster executes the method provided by the first aspect or any possible implementation 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 computing device cluster, the computing device cluster executes the method provided by the first aspect or any possible implementation of the first aspect.
[0029] Any of the above-mentioned devices, computing device clusters, computer storage media, or computer program products are used to execute the methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding schemes in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a structural diagram of a cloud environment provided by this application; Figure 2 This is a schematic diagram of the structure of a cloud data center in a cloud environment provided by the present application; Figure 3 is a flow chart of a database management method provided by an embodiment of the present application; Figure 4 It is a schematic diagram of the interaction between the management service and the user in the cloud management platform provided by the embodiment of the present application to determine whether to upgrade the kernel; Figure 5 It is a schematic diagram of the management service provided by the embodiment of the present application upgrading the kernel of the first database by adding a second database; Figure 6 It is a schematic diagram of the management service configuration DRS for incremental synchronization provided by an embodiment of the present application; Figure 7 is a schematic diagram of DRS performing incremental synchronization provided by an embodiment of the present application; Figure 8 is a flow chart of another database management method provided by an embodiment of the present application; Fig. 9is a schematic diagram of synchronizing the full amount of data of the first database through the DRS by the management service provided in an embodiment of the present application; Fig.10 It is a structural diagram of a database management device provided in an embodiment of the present application; Fig.11 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application; Fig.12 and Fig.13 It is a structural diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, 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 in conjunction with the accompanying drawings.
[0032] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0033] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple screen terminals refers to two or more screen terminals.
[0034] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0035] Before introducing the embodiments of the present application, the technical terms mentioned in the embodiments of the present application are explained below.
[0036] Data replication service (DRS) is a cloud service in the cloud management platform for data synchronization between databases. DRS can connect the source database and the target database at the same time, and synchronize the migration objects in the source database to the target database. The migration objects can be the full data and / or incremental data in the source database. DRS can support data synchronization in multiple networks. DRS can achieve data synchronization between databases in multiple business scenarios through the links in these networks. The multiple networks can include but are not limited to public networks, dedicated lines, virtual private clouds (VPC) networks, and virtual private networks (VPN).
[0037] The location information is used to determine the starting position of data synchronization. The location information may 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.
[0038] The user access rights of the database may include: read permission, write permission, and read and write permission. When the database has read permission, the user can only read data from the database. When the database has write permission, the user can only write data to the database. When the database has read permission, the user can only read data from the database and can also write data to the database.
[0039] In the database field, the database kernel upgrade is usually performed on the original database. Generally, the management service stops the database, replaces the lower version kernel with the higher version kernel, and then restarts the database to complete the upgrade. In specific applications, after upgrading the database kernel, the user may need to roll back the database kernel, that is, roll back the higher version kernel to the lower version kernel. If the kernel upgrade is performed on the original database, the rollback requirement of the user cannot be met.
[0040] To this end, an embodiment of the present application provides a database management method that can solve the above problems.
[0041] The database management method provided in 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, and the method may include: the management service synchronizes the full data of the first database to the second database, and the kernel version of the second database is higher than the kernel version of the first database; the management service sends incremental synchronization information to the data replication service, and the incremental synchronization information includes the location information of the first database; the data replication service synchronizes the incremental data of the second database to the first database according to the location information, wherein the incremental data is the data generated by the user of the first database accessing 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, wherein the user accessing the first database includes accessing the incremental data.
[0042] In this solution, after the management service performs a kernel upgrade on the user's database of the low-version kernel (i.e., the first database), it synchronizes the incremental data generated in the database of the high-version kernel (i.e., the second database) to the original database of the low-version kernel through DRS. After receiving the user's rollback request, the management service can, on the one hand, promptly process the user's rollback request and configure the user to access the original database of the low-version kernel; on the other hand, it can avoid the loss of incremental data in the database of the high-version kernel, thereby improving the user experience.
[0043] Before introducing the database management method provided in the embodiment of the present application, the application scenario of the embodiment of the present application is first introduced below.
[0044] Figure 1 This is a schematic diagram of the structure of a cloud environment provided by this application. Figure 1 As shown, the cloud environment may include an infrastructure 10 and a cloud management platform 20. Figure 1 In the example, the infrastructure 10 includes cloud data center clusters arranged in multiple regions. For example, the multiple regions may include Figure 1 A first region 11, a second region 12, and a third region 13 are shown.
[0045] Each region is provided with a cloud data center cluster, and each cloud data center cluster includes multiple cloud data centers. For example, 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 are shown. The cloud data center cluster located in the second area 12 may include the third cloud data center 121 and the fourth cloud data center 122. The cloud data center cluster located in the third area 13 may include the fifth cloud data center 131 and the sixth cloud data center 132.
[0046] exist Figure 1In the example, 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 through the account pre-registered in the cloud management platform 20 and bound to the first user C1. After logging in, the first user C1 can enter the management service in the cloud management platform 20 and create a database of the first user C1 in the infrastructure 10 through the management service. Similarly, the second user can connect to the Internet through the second client and log in to the cloud management platform 20 with the account pre-registered in the cloud management platform 20 and bound to the second user C2. After logging in, the second user C2 can enter the management service in the cloud management platform 20 and create a database of the second user C2 in the infrastructure 10 through the management service. The first client and the second client can be mobile phones with Internet access function, personal computers, car hosts or other terminal devices with Internet access function.
[0047] 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 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. Moreover, in the embodiments of the present application, the name of "management service" is only an exemplary expression, and its naming method is not limited by the embodiments. For services of the same type with other names, as long as their functional implementation method is equivalent to the functions implemented in this application, they all fall within the scope of protection of this application.
[0048] Figure 2 This application provides Figure 1 The structural diagram of the first cloud data center 111 is shown. It should be noted that: Figure 2 The structure of the first cloud data center 111 included in the first area 11 is only shown as an example. 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 and the following Figure 2 The present application embodiment will not elaborate on this.
[0049] like Figure 2 As shown, the first cloud data center 111 may include multiple nodes such as a first node 1111 and a second node 1112. Each node included in the first cloud data center 111 includes a hardware layer and a software layer.
[0050] In the first cloud data center 111, one or more databases may be created on the software layer of each node. 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 database in each node runs on the operating system. 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.
[0051] The hardware layer of each node can include components such as memory, processor, network card, hard disk, etc. Figure 2 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 structure of other nodes in the first cloud data center 111, and the nodes and Figure 2 The structure of the nodes shown is similar, please refer to Figure 2 The structure shown and the above description of the structure of the first node 1111 and the second node 1112 are not repeated here.
[0052] It is worth noting that in the embodiment of the present application, the number of databases created on each node in the infrastructure 10 can be set as needed, and the embodiment of the present application does not limit this.
[0053] After introducing the application scenarios of the embodiments of the present application, Figure 1 Taking the cloud environment shown as an example, the database management method provided by the embodiment of the present application is introduced in combination with the accompanying drawings. In the database management method provided by the embodiment of the present application, the cloud management platform 20 includes DRS in addition to management services. DRS is used to synchronize the incremental data in the database of the high-version kernel obtained by kernel upgrade of the database of the low-version kernel to the database of the low-version kernel.
[0054] Figure 3 1 is a flow chart of a database management method provided in an embodiment of the present application. The method can be executed by the management service and DRS in the cloud management platform 20. Figure 3 As shown, the method may include S301 to S306. Figure 3 The steps shown are described in Figure 3 In the illustrated embodiment, the database of the lower version kernel is the first database, and the database of the higher version kernel is the second database.
[0055] S301, the management service creates a second database according to an upgrade request of a user of a first database, wherein the kernel version of the second database is higher than the kernel version of the first database.
[0056] The management service can perform a kernel upgrade on the first database according to an upgrade request from a user of the first database. Figure 4 For example, after determining that a higher version kernel exists in the first database 11111, the management service may send an update message to the first user of the first database 11111. The update message is used to indicate that the first database 11111 can be updated to a higher version kernel. After receiving the update message, the first user may 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.
[0057] The management service may upgrade the kernel of the first database by: creating a second database in the infrastructure 10 according to the higher version kernel of the first database. The first database and the second database may be located in the same area of the infrastructure 10, or in different areas. Furthermore, the first database and the second database may be located in the same node of the same area, or in different nodes of the same area. Figure 5 For example, the management service may create a second database 11121 in the second node 1112 based on a higher version kernel of the first database 11111.
[0058] S302: The management service instructs the first database to synchronize all data of the first database to the second database.
[0059] After the management service creates the second database, it can instruct the first database to perform full data synchronization through a data synchronization message. The data synchronization message can include information about the second database. After the first database receives the data synchronization message, it can synchronize the full data to the second database based on the information about the second database in the data synchronization message. 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 data synchronization message includes information such as the IP address and port number of the second database 11121. 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 the full amount of data to the second database through the replication tool of the first database 11111.
[0060] The first database can establish a communication connection with the second database based on the information of the second database, and then synchronize the full amount of data to the second database through the replication tool in the first database.
[0061] S303: The management service configures users of the first database to access the second database.
[0062] After all the data in the first database is synchronized to the second database, the management service can be configured so that users of the first database can access the second database.
[0063] Managing the service configuration of the first database user accessing the second database may include: modifying the user access rights of the first database and the second database. Modifying the user access rights of the first database and the second database may include: modifying the user access rights of the second database to read and write rights, and modifying the user access rights of the first database to read rights.
[0064] Taking the example of a user accessing the first database through a virtual Internet protocol VIP address, the management service configuration of the user of the first database accessing the second database may also include: mounting the VIP of the first database on the second database. After mounting, the user can access the second database through the VIP.
[0065] Taking the example of a user accessing the first database through an Internet Protocol IP address, the management service may send the IP address of the second database to the user, so that the user may access the second database through the IP address of the second database.
[0066] After configuring the user to access the second database of the higher version kernel, the user's access to the second database will result in incremental data being generated in the second database. Figure 5 As shown, when a user accesses the second database 11121, data that does not exist in the first database 11111, namely, incremental data, will be generated in the second database 11121. Therefore, the management service can configure an incremental synchronization task to the DRS to synchronize the incremental data of the second database to the first database through the DRS. The specific process will be described below.
[0067] In some embodiments, the management service may further configure users of the first database to access the second database after sending the incremental synchronization information to the DRS. That is, the management service may first execute S304 and then execute S303.
[0068] S304: The management service sends incremental synchronization information to the data replication service.
[0069] The incremental synchronization information may include the location information of the first database, the information of the source database, and the information of the target database. Figure 5Taking the shown scenario as an example, the location information of the first database is the location information of the first database 11111, the source database includes the second database 11121, and the target database includes the first database 11111.
[0070] The location information may include a transaction identifier and / or a log sequence number. After the full data of the first database is synchronized to the second database, the management service records the last transaction identifier and / or the last log sequence number of the first database, and determines the location information based on the last transaction identifier and / or the last log sequence number of the first database. The transaction identifier included in the location information may be the next transaction identifier of the last transaction identifier. The log sequence number included in the location information may be the next log sequence number of the last log sequence number.
[0071] The database information may include the database's Internet Protocol IP address, port number, database type, and other information.
[0072] S305: The data replication service synchronizes the incremental data of the second database to the first database according to the location information, wherein the incremental data is the data generated when the user of the first database accesses the second database.
[0073] After receiving the incremental synchronization information, DRS Figure 6 As shown, a DRS link from the second database to the first database can be created based on 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, based on 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 a latency test on the two communication connections included in the DRS link, and perform incremental data synchronization when the latency obtained by the test meets the preset latency threshold.
[0074] In the incremental data synchronization process, DRS can determine the target log to be synchronized in the second database based on the location information. Figure 7For example, DRS can obtain the log of the second database 11121 through a communication connection with the second database 11121. Then, according to the site information, the target log to be synchronized is determined from the log of the second database 11121. Taking the example that the site information includes a transaction identifier, DRS can compare the transaction identifier in the log of the source database with the transaction identifier in the site information to determine the target log to be synchronized in the source database. Taking the example that the site information includes a log sequence number, DRS can compare the log sequence number in the log of the source database with the log sequence number in the site information to determine the target log to be synchronized in the source database.
[0075] In the incremental data synchronization process, after determining the target log, DRS can generate a structured query language statement that matches the first database based on the target log, 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. Figure 7 For example, DRS can generate SQL statements supported by the first database 11111 from the operations performed by the second database 11121 recorded in the target log, so that the first database 11111 can correctly process the SQL statements, thereby achieving incremental data synchronization. After the first database 11111 executes the received structured query language statement, the first database 11111 includes the incremental data in the second database 11121.
[0076] S306, when receiving the rollback request from the user, the management service configures the user to access the first database, wherein the user accessing the first database may include accessing the above-mentioned incremental data.
[0077] Managing service users' access to the first database may include: modifying user access rights of the first database and the second database. Modifying user access rights of the first database and the second database may include: modifying user access rights of the first database to read-write rights and modifying user access rights of the second database to read rights.
[0078] Taking the example of a user accessing the first database through a virtual Internet protocol VIP address, the management service configuration of the user accessing the first database may also include: mounting the VIP on the first database. After mounting, the user can access the first database through the VIP.
[0079] Taking the example of a user accessing the first database through an Internet Protocol IP address, the management service configuration of the user accessing the first database may also include: the management service may 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.
[0080] Since the incremental data in the second database has been synchronized to the first database through the DRS, the user's access to the first database may include accessing the incremental data in the first database. That is, when the user's access request includes an operation on the incremental data, the first database may respond to the user's access request.
[0081] Above Figure 3 In the illustrated embodiment, when performing a kernel upgrade on the first database of the low-version kernel, the management service upgrades it by adding a second database of the high-version kernel. As a result, the original first database of the low-version kernel can be retained in the infrastructure for a period of time. In other words, in order to support the possible fallback needs of subsequent users, the first database of the low-version kernel and the second database of the high-version kernel are retained during this time. When the user needs to fall back, the user can still access the original first database. In addition, the management service synchronizes the incremental data in the second database to the first database through DRS, which can avoid the loss of incremental data.
[0082] based on Figure 3 In the embodiment shown, the embodiment of the present application also provides another database management method.
[0083] Figure 8 1 is a flow chart of a database management method provided in an embodiment of the present application. The method can be executed by the management service and DRS in the cloud management platform 20. In the method, the management service can synchronize the full amount of data of the first database to the second database through the DRS. Figure 8 As shown, the method may include S801 to S807. Figure 8 The steps shown are described in Figure 8 In the illustrated embodiment, the database of the lower version kernel is the first database, and the database of the higher version kernel is the second database.
[0084] S801: The management service creates a second database according to the upgrade request of the user of the first database. The kernel version of the second database is higher than the kernel version of the first database. The specific process of this step can be referred to above. Figure 3 The introduction of S301 in the illustrated method embodiment will not be repeated here.
[0085] S802: The management service sends full synchronization information to the data replication service.
[0086] After the management service creates the second database, it can synchronize all the data in the first database to the second database through DRS. Fig. 9As shown, the management service can send full synchronization information to the DRS. The full synchronization information can include information about the source database and information about the target database. Figure 5 Taking the illustrated scenario as an example, the source database includes a first database 11111, and the target database includes a second database 11121. The database information may include the Internet Protocol IP address, port number, database type, and other information of the database.
[0087] S803: The data replication service synchronizes all the data in the first database to the second database.
[0088] After receiving the full synchronization information, the DRS can create a DRS link from the second database to the first database based on 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 synchronization information. For example, the DRS can establish communication connections with the source database and the target database, respectively, based on 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, the DRS can test the DRS link, and after the test passes, execute the full data synchronization process. Testing the DRS link may include testing the latency of the DRS link. For example, the DRS can perform a latency test on the two communication connections included in the DRS link, and perform full data synchronization when the latency obtained by the test meets the preset latency threshold.
[0089] In the full data synchronization process, DRS can obtain the target log to be synchronized from the first database. Since the types of the first database and the second database may be different, there may be differences in the structured query language SQL statements supported by the first database and the second database. After determining the target log, DRS can generate a structured query language statement that matches the second database based on the target log, and send the structured query language statement to the second database. After the second database executes the received structured query language statement, the second database includes the full data in the first database.
[0090] S804: Manage the service configuration of users in the first database to access the second database. Figure 3 The introduction of S303 in the illustrated method embodiment will not be repeated here.
[0091] S805: The management service sends incremental synchronization information to the data replication service. The specific process of this step can be referred to above. Figure 3 The introduction of S304 in the illustrated method embodiment will not be repeated here.
[0092] S806: The data replication service synchronizes the incremental data of the second database to the first database according to the location information. The incremental data is the data generated by the user of the first database accessing the second database. The specific process of this step can be referred to above. Figure 3 The introduction of S305 in the illustrated method embodiment will not be repeated here.
[0093] S807: Upon receiving the rollback request from the user, the management service configures the user to access the first database. The user accessing the first database may include accessing the above-mentioned incremental data. The specific process of this step may refer to the above-mentioned Figure 3 The introduction of S306 in the illustrated method embodiment will not be repeated here.
[0094] based on Figure 3 and Figure 8 The method embodiment shown, the embodiment of the present application also provides a database management device.
[0095] Fig.10 is a schematic diagram of the structure of a database management device 1000 provided in an embodiment of the present application. The method can be used to execute the above Figure 3 and / or Figure 8 All or part of the steps in the method embodiment shown.
[0096] like Fig.10 As shown, the database management device 1000 may include a management module 1001 and a replication module 1002 .
[0097] Among them, the management module is used to send incremental synchronization information to the data replication service after the full data of the first database is synchronized to the second database. The kernel version of the second database is higher than the kernel version of the first database, and the incremental synchronization information includes the location information of the first database.
[0098] The replication module is used to synchronize the incremental data of the second database to the first database according to the location information, and the incremental data is the data generated when the user of the first database accesses the second database.
[0099] The management module is further used to manage the service configuration of the user accessing the first database when receiving a rollback request from the user, wherein the user accessing the first database includes accessing incremental data.
[0100] In one possible implementation, the replication module is also used to: determine a target log to be synchronized in the second database based on the location information; generate a structured query language statement that matches the first database based on the target log; and send a structured query language statement to the first database, wherein after the first database executes the structured query language statement, the first database includes incremental data.
[0101] In a possible implementation, the location information includes a transaction identifier and / or a log sequence number.
[0102] In a possible implementation, the management module is further used to: determine the location information according to the last transaction identifier and / or the last log sequence number of the first database when the full data of the first database is synchronized to the second database.
[0103] In a possible implementation manner, the management module is further configured to: before sending the incremental synchronization information, configure users of the first database to access the second database.
[0104] In a possible implementation, the management module is further used to: configure the second database according to the VIP configured in the first database.
[0105] In a possible implementation, the incremental synchronization information includes: information of a source database and information of a target database, the source database includes the second database, and the target database includes the first database.
[0106] It should be noted that Fig.10 The database management device 1000 provided in the embodiment shown in the figure only uses the division of the above-mentioned functional modules as an example to illustrate when executing the database management method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Figure 3 and Figure 8 The method embodiments shown belong to the same concept, and their specific implementation process is detailed in Figure 3 and Figure 8 The method embodiments shown are not described in detail here.
[0107] When the above modules are used 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 a physical host (computing device), a virtual machine, a container, and other computing devices. Furthermore, the above computing device 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 used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Generally, a region may include multiple AZs.
[0108] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0109] When the above module is used as an example of a hardware functional unit, the module may include at least one computing device, such as a server, etc. Alternatively, the module may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. The above PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0110] 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 AZ or in different AZs. Similarly, the multiple computing devices included in the module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0111] It should be noted that, in other embodiments, the management module 1001 and the copy module 1002 can be used to execute Figure 3 and Figure 8 The steps implemented by the management module 1001 and the replication module 1002 can be specified as needed, and the management module 1001 and the replication module 1002 can be respectively implemented Figure 3 and Figure 8 The different steps in the method shown are used to implement the entire functions of the database management device 1000 .
[0112] The present application also provides a computing device 1100. Fig.11 As 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 the present application does not limit the number of processors and memories in the computing device 1100.
[0113] The bus 1101 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 The bus 1101 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 1101 may include a path for transmitting information between various components of the computing device 1100 (for example, the memory 1103, the processor 1102, and the communication interface 1104).
[0114] The processor 1102 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0115] 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).
[0116] The memory 1103 stores executable program codes, and the processor 1102 executes the executable program codes to respectively implement the functions of the aforementioned management module 1001 and the replication module 1002, thereby implementing Figure 3 , and / or Figure 8 That is, the memory 1103 stores a method for executing Figure 3 , and / or Figure 8 Instructions for the method shown.
[0117] The communication interface 1104 uses modules such as, but not limited to, a network interface card, a transceiver, etc. to implement communication between the computing device 1100 and other devices or communication networks.
[0118] based on Figure 3 and Figure 8 In addition to the method embodiment shown, the present application embodiment also provides a computing device cluster.
[0119] Fig.12 is a computing device cluster provided in an embodiment of the present application. The computing device cluster can be used to execute Figure 3 , and / or Figure 8 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.
[0120] like Fig.12As shown, the computing device cluster includes at least one computing device 1100. The memory 1103 in one or more computing devices 1100 in the computing device cluster may store the same Figure 3 , and / or Figure 8 Instructions for the method shown.
[0121] In some possible implementations, the memory 1103 of one or more computing devices 1100 in the computing device cluster may also store a program for executing Figure 3 , and / or Figure 8 In other words, the combination of one or more computing devices 1100 can jointly execute instructions for executing Figure 3 , and / or Figure 8 Instructions for the method shown.
[0122] It should be noted that the memory 1103 in different computing devices 1100 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the database management apparatus 1000. That is, the instructions stored in the memory 1103 in different computing devices 1100 may implement the functions of one or more modules in the management module 1001 and the replication module 1002.
[0123] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.13 A possible implementation is shown. Fig.13 As shown, the first computing device 1100A and the second computing device 1100B are connected via a network, wherein the first computing device 1100A and the second computing device 1100B belong to different trusted domains, including but not limited to different regions or different availability zones.
[0124] Specifically, the communication interface in each computing device is used to connect to the network. In this possible implementation, the memory 1103 in the first computing device 1100A stores instructions for executing the functions of the management module 1001. Meanwhile, the memory 1103 in the second computing device 1100B stores instructions for executing the functions of the replication module 1002. Fig.13 The connection mode between the computing device clusters shown may be that considering that the method provided by the present application requires a large amount of storage resources and computing resources (for example, a large amount of data storage), it is considered that the functions implemented by the management module 1001 are executed by the first computing device 1100A, and the functions implemented by the replication module 1002 are executed by the second computing device 1100B. It should be understood that Fig.13The functions of the first computing device 1100A shown in FIG. 1100A may also be completed by multiple computing devices 1100. Similarly, the functions of the second computing device 1100B may also be completed by multiple computing devices 1100.
[0125] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.12 and Fig.13 The difference is that the memory 1103 in one or more computing devices 1100 in the computing device cluster may store the same memory for executing Figure 3 , and / or Figure 8 Instructions for the method shown.
[0126] In some possible implementations, the memory 1103 of one or more computing devices 1100 in the computing device cluster may also store a program for executing Figure 3 , and / or Figure 8 In other words, the combination of one or more computing devices 1100 can jointly execute instructions for executing Figure 3 , and / or Figure 8 Instructions for the method shown.
[0127] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes Figure 3 , and / or Figure 8 The method shown.
[0128] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 3 , and / or Figure 8 The method shown, or instructing a computing device to execute Figure 3 , and / or Figure 8 The method shown.
[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, 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 embodiments of the present invention.
Claims
1. A database management method, characterized in that: The method is applied to a cloud management platform, the cloud management platform is used to manage infrastructure, the infrastructure includes multiple areas, each area includes at least one node, the cloud management platform includes management services and data replication services, the method includes: After the full data of the first database is synchronized to 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 the kernel version of the first database, and the incremental synchronization information includes the location information of the first database; The data replication service synchronizes the incremental data of the second database to the first database according to the location information, wherein the incremental data is data generated by a user of the first database accessing the second database; In case of receiving a rollback request from the user, the management service configures the user to access the first database, wherein the user's access to the first database includes accessing the incremental data.
2. The method according to claim 1, characterized in that The data replication service synchronizes the incremental data of the second database to the first database according to the location information, including: Determining a target log to be synchronized in the second database according to the location information; Generating, according to the target log, a structured query language statement matching the first database; The structured query language statement is sent to the first database, wherein after the first database executes the structured query language statement, the first database includes the incremental data.
3. The method according to claim 1, characterized in that The location information includes a transaction identifier and / or a log sequence number.
4. The method according to claim 3, characterized in that The method further comprises: When synchronization of all data of the first database to the second database is completed, the management service determines the location 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, characterized in that Before the management service sends the incremental synchronization information to the data replication service, the method further includes: The management service configures users of the first database to access the second database.
6. The method according to claim 5, characterized in that The configuring a user of the first database to access the second database comprises: The second database is configured according to the virtual Internet Protocol VIP address configured in the first database.
7. The method according to claim 1, characterized in that The incremental synchronization information also includes: information of a source database and information of a target database, the source database includes the second database, and the target database includes the first database.
8. A database management device, characterized in that: The database management device comprises: a management module, configured to send incremental synchronization information to the data replication service after the full data of the first database is synchronized to the second database, the kernel version of the second database being higher than the kernel version of the first database, and the incremental synchronization information including the location information of the first database; a replication module, configured to synchronize incremental data of the second database to the first database according to the location information, wherein the incremental data is data generated when a user of the first database accesses the second database; The management module is further used to, upon receiving a rollback request from the user, configure the management service to allow the user to access the first database, wherein the user's access to the first database includes accessing the incremental data.
9. The database management device according to claim 8, characterized in that: The replication module is also used to: Determining a target log to be synchronized in the second database according to the location information; Generating, according to the target log, a structured query language statement matching the first database; The structured query language statement is sent to the first database, wherein after the first database executes the structured query language statement, the first database includes the incremental data.
10. The database management device according to claim 8, characterized in that: The location information includes a transaction identifier and / or a log sequence number.
11. The database management device according to claim 10, characterized in that: The management module is also used for: When synchronization of all data of the first database to the second database is completed, the location information is determined according to the last transaction identifier and / or the last log sequence number of the first database.
12. The database management device according to claim 8, characterized in that: The management module is further used to: before sending the incremental synchronization information, configure the user of the first database to access the second database.
13. The database management device according to claim 12, characterized in that: The management module is also used to configure the second database according to the virtual Internet Protocol VIP address configured in the first database.
14. The database management device according to claim 8, characterized in that: The incremental synchronization information includes: information of a source database and information of a target database, the source database includes the second database, and the target database includes the first database.
15. A computing device cluster, 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 to 7.
16. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
DB2 database data synchronization method, device and system
CN110737720A
Incremental data breakpoint resuming method and device, equipment and storage medium
CN113760862A
Data synchronization method and device
CN118585577A
Database configuration method, system and equipment and storage medium
CN119513199A
Database access method and apparatus, and computer readable storage medium
WO2024193269A1