Data storage method, apparatus and computing device

By migrating cold data to cloud storage and storing its metadata in the cloud database system, the problem of excessive costs and idle backup nodes caused by high-performance storage is solved, achieving the effect of saving storage costs and ensuring access performance.

WO2024187922A1PCT designated stage expired Publication Date: 2024-09-19HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2024/070488
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-16
Filing Date
2024-01-04
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

In database systems, high-performance storage results in excessively high storage costs, and the deployment of one master and multiple backups leads to idle backup nodes, resulting in a waste of computing resources. How to save storage costs and overhead without affecting performance.

Method used

By migrating cold data to cloud storage services in the cloud database system, storing the metadata of the cold data locally on the database node, and using the metadata to access the cold data in the cloud storage, storage costs are reduced, while hot data is cached locally on the main node. data and warm data to ensure access performance.

Benefits of technology

It effectively reduces storage costs and overhead, avoids standby nodes being idle, and ensures database access performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024070488_19092024_PF_FP_ABST
    Figure CN2024070488_19092024_PF_FP_ABST
Patent Text Reader

Abstract

A data storage method, an apparatus and a computing device. The method comprises: during a process in which a first node processes a plurality of access requests, caching hot data at a local storage of the first node, migrating cold data to a cloud storage service, and caching metadata of the cold data at the local storage of the first node. The cloud storage service is a service deployed by a cloud computing platform in a cloud computing resource, and the cloud computing platform deploys a cloud database system in the cloud computing resource managed by the cloud computing platform. The first node is a database master node or a database slave node of the cloud database system, the hot data and the cold data are different data tables of a database or different table partitions of the data tables, and the hot data and the cold data are determined according to one or two of the number of times of accessing the table partitions of the data tables and data volumes. The present method can save data storage costs without affecting performance.
Need to check novelty before this filing date? Find Prior Art

Description

Data storage method, device and computing equipment

[0001] This application claims priority to Chinese patent application number 202310266217.6 filed on March 16, 2023, entitled “Data Storage Method, Apparatus, and Computing Device,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of cloud computing, and more specifically, to a data storage method, apparatus, and computing device. Background Art

[0003] During database use, large amounts of data are written and updated daily. However, only data within a short timeframe, such as within a month or even a week, is frequently updated and accessed. This frequently accessed data is called hot data, while infrequently accessed data is called cold data (e.g., historical e-commerce orders, historical banking transaction records, time series data, etc.). In production environments, high-performance storage is often used to meet write performance requirements, which comes at a high cost. Data is also stored on high-performance storage media in production environments, resulting in excessively high storage costs.

[0004] Furthermore, to ensure high availability and reliability, most database systems typically employ a single-master, multiple-backup deployment (with the primary and backup nodes typically being homogeneous). This involves storing consistent copies of data across multiple compute nodes to ensure that if the primary node fails, the backup node can take over and restore operations. This further increases storage costs. Furthermore, this single-master, multiple-backup deployment often results in the backup nodes being idle, resulting in a significant waste of computing resources.

[0005] Therefore, how to save storage costs and overhead without affecting performance has become a technical problem that needs to be solved urgently.

[0006] Summary of the Invention

[0007] The present application provides a data storage method, apparatus, and computing device, which can save data storage costs without affecting performance.

[0008] In a first aspect, a method for data storage is provided, wherein a cloud database system includes a database master node and one or more database slave nodes, a cloud computing platform deploys the cloud database system on the cloud computing resources it manages, and the cloud computing platform deploys a cloud storage service on the cloud computing resources, the method comprising: a first node receiving multiple access requests for accessing a database, the first node being a database master node or a database slave node of the cloud database system; caching hot data in a local storage of the first node during processing of the multiple access requests by the first node; migrating cold data to the cloud storage service and caching metadata of the cold data in a local storage of the first node during processing of the multiple access requests by the first node; wherein the hot data and the cold data are different data tables of the database, or the hot data and the cold data are different table partitions of the data table; wherein the hot data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0009] In the above technical solution, hot data and cold data are determined based on one or both of the number of times a table partition of a data table is accessed and the amount of data. The cold data is then migrated to the cloud storage service, and metadata for the cold data is cached in the local storage of the first node. This metadata is used to access the cold data in the cloud storage service. In this way, migrating the cold data to the cloud storage service reduces data storage costs, and by caching the metadata for the cold data in the local storage of the first node, even after the cold data is migrated to the cloud storage service, the first node can still access the cold data in the cloud storage service using the metadata for the cold data cached in the local storage, without affecting subsequent access performance.

[0010] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: in the process of the first node processing the multiple access requests, migrating the warm data to the cloud storage service, and caching the metadata of the warm data in the local storage of the first node; wherein the hot data, the warm data and the cold data are different data tables of the database, or the hot data, the warm data and the cold data are different table partitions of the data table; wherein the hot data, the warm data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data, the warm data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the first node is the database master node of the cloud database system, and the method also includes: in the process of the first node processing the multiple access requests, migrating the warm data to the cloud storage service, and caching the warm data in the local storage of the first node, and one or more database slave nodes included in the cloud database system locally store metadata of the warm data.

[0012] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the first node maintaining a first table, the first table being used to record storage conditions of the hot data, the cold data, and the warm data.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the multiple access requests include a write request, and the write request includes data to be written. The method also includes: the first node performs a write operation on the cold data stored in the cloud storage service according to the write request, and caches the data to be written in the form of incremental data in the local storage of the first node.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the multiple access requests include a write request, and the write request includes data to be written. The method also includes: the first node performs a write operation on the warm data stored in the cloud storage service according to the write request, and caches the data to be written in the form of incremental data in the local storage of the first node.

[0015] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: the first node merging the incremental data in the local storage of the first node and the cold data or the warm data stored in the cloud storage service, and migrating the merged data to the cloud storage service.

[0016] In combination with the first aspect, in some implementations of the first aspect, the first table is further used to record the existence of the incremental data.

[0017] In a second aspect, a data storage device is provided. The cloud database system includes a database master node and one or more database slave nodes. The cloud computing platform deploys the cloud database system on the cloud computing resources it manages. The cloud computing platform deploys cloud storage services on the cloud computing resources. The device is applied to a first node, which is a database master node or a database slave node of the cloud database system. The device includes: a receiving module, a cache module, and a migration module, wherein the receiving module is used to receive multiple access requests for accessing the database, and the first node is a database master node or a database slave node of the cloud database system; the cache module is used to process In the process of processing the multiple access requests, the hot data is cached in the local storage of the first node; the migration module is used to migrate the cold data to the cloud storage service in the process of processing the multiple access requests, and cache the metadata of the cold data in the local storage of the first node; wherein the hot data and the cold data are different data tables of the database, or the hot data and the cold data are different table partitions of the data table; wherein the hot data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0018] In combination with the second aspect, in certain implementations of the second aspect, the migration module is further used to migrate the warm data to the cloud storage service during processing the multiple access requests, and cache the metadata of the warm data in the local storage of the first node; wherein the hot data, the warm data and the cold data are different data tables of the database, or the hot data, the warm data and the cold data are different table partitions of the data table; wherein the hot data, the warm data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data, the warm data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0019] In combination with the second aspect, in certain implementations of the second aspect, the first node is the database master node of the cloud database system, and the migration module is also used to migrate the warm data to the cloud storage service during the process of processing the multiple access requests, and cache the warm data in the local storage of the first node, and the metadata of the warm data is stored locally in one or more database slave nodes included in the cloud database system.

[0020] In combination with the second aspect, in some implementations of the second aspect, the device further includes: a maintenance module, configured to maintain a first table, wherein the first table is configured to record storage conditions of the hot data, the cold data, and the warm data.

[0021] In combination with the second aspect, in certain implementations of the second aspect, the multiple access requests include a write request, which includes data to be written. The cache module is also used to perform a write operation on the cold data stored in the cloud storage service according to the write request, and cache the data to be written in the form of incremental data in the local storage of the first node.

[0022] In combination with the second aspect, in certain implementations of the second aspect, the multiple access requests include a write request, which includes data to be written. The cache module is also used to perform a write operation on the warm data stored in the cloud storage service according to the write request, and cache the data to be written in the form of incremental data in the local storage of the first node.

[0023] In combination with the second aspect, in certain implementations of the second aspect, the device also includes: a merging module for merging the incremental data in the local storage of the first node and the cold data or the warm data stored in the cloud storage service; the migration module is also used to migrate the merged data to the cloud storage service.

[0024] In combination with the second aspect, in certain implementations of the second aspect, the first table is further used to record the existence of the incremental data.

[0025] In a third aspect, a computing device is provided, comprising a processor and a memory, and optionally, an input / output interface. The processor is configured to control the input / output interface to send and receive information, the memory is configured to store a computer program, and the processor is configured to retrieve and execute the computer program from the memory to perform the method of the first aspect or any possible implementation of the first aspect.

[0026] Optionally, the processor may be a general-purpose processor, which may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated into the processor or located independently of the processor.

[0027] In a fourth aspect, a computing device cluster is provided, 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 used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.

[0028] In a fifth aspect, a chip is provided, which obtains instructions and executes the instructions to implement the method in the above-mentioned first aspect and any implementation manner of the first aspect.

[0029] Optionally, as an implementation, the chip includes a processor and a data interface, and the processor reads instructions stored in the memory through the data interface to execute the method in the above-mentioned first aspect and any implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.

[0030] Optionally, as an implementation method, the chip may also include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in the first aspect and any one of the implementation methods of the first aspect, or execute the method in the second aspect or any one of the possible implementation methods of the second aspect.

[0031] In a sixth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device, the computing device executes the method in the first aspect and any one of the implementations of the first aspect.

[0032] In a seventh aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any one of the implementations of the first aspect.

[0033] In an eighth aspect, a computer-readable storage medium is provided, characterized in that it includes computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method in the above-mentioned first aspect and any one of the implementations of the first aspect.

[0034] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0035] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium.

[0036] In the ninth aspect, a computer-readable storage medium is provided, characterized in that it includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the above-mentioned first aspect and any one of the implementations of the first aspect.

[0037] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0038] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] FIG1 is a schematic block diagram of a cloud scenario applicable to an embodiment of the present application.

[0040] FIG2 is a schematic flowchart of a data storage method provided in an embodiment of the present application.

[0041] FIG3 is a schematic diagram of dividing cold data, warm data, and hot data in a database provided by an embodiment of the present application.

[0042] FIG4 is a schematic block diagram of a storage situation before data migration in a database system provided in an embodiment of the present application.

[0043] FIG5 is a schematic block diagram of data storage after data migration according to a migration strategy provided by an embodiment of the present application.

[0044] FIG6 is another schematic block diagram of data storage after data migration according to a migration strategy provided by an embodiment of the present application.

[0045] FIG7 is a schematic diagram of a read-write conflict processing logic provided in an embodiment of the present application.

[0046] FIG8 is a schematic block diagram of a data storage device 800 provided in an embodiment of the present application.

[0047] FIG9 is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of the present application.

[0048] FIG10 is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of the present application.

[0049] FIG11 is a schematic diagram of a network connection between computing devices 1500A and 1500B provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solution in this application will be described below with reference to the accompanying drawings.

[0051] This application will present various aspects, embodiments, or features around systems including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.

[0052] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.

[0053] In the embodiments of the present application, “corresponding” and “relevant” may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0054] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0055] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0056] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0057] During database use, large amounts of data are written and updated daily. However, only data within a short timeframe, such as within a month or even a week, is frequently updated and accessed. This frequently accessed data is called hot data, while infrequently accessed data is called cold data (e.g., historical e-commerce orders, historical banking transaction records, time series data, etc.). In production environments, high-performance storage is often used to meet write performance requirements, which comes at a high cost. Data is also stored on high-performance storage media in production environments, resulting in excessively high storage costs.

[0058] Furthermore, to ensure high availability and reliability, most database systems typically employ a single-master, multiple-backup deployment (with the primary and backup nodes typically being homogeneous). This involves storing consistent copies of data across multiple compute nodes to ensure that if the primary node fails, the backup node can take over and restore operations. This further increases storage costs. Furthermore, this single-master, multiple-backup deployment often results in the backup nodes being idle, resulting in a significant waste of computing resources.

[0059] Therefore, in order to achieve high availability and high reliability, both online and offline database systems have increased operating costs to a certain extent.

[0060] In view of this, an embodiment of the present application provides a data storage method that can save storage costs and expenses without affecting performance.

[0061] In one possible implementation, the data storage method provided in the embodiments of the present application can be applied to a cloud service scenario, with the data storage method being executed by a cloud management platform within the cloud service scenario. For example, a cloud database system includes a database master node and one or more database slave nodes. The cloud computing platform deploys the cloud database system on the cloud computing resources it manages, and the cloud computing platform deploys cloud storage services on the cloud computing resources.

[0062] For ease of description, the cloud service scenario is described in detail below with reference to FIG1 .

[0063] FIG1 is a schematic block diagram of a cloud scenario applicable to an embodiment of the present application. As shown in FIG1 , the cloud scenario may include: a cloud management platform 110 , the Internet 120 , and a client 130 .

[0064] As shown in Figure 1, the cloud management platform 110 is used to manage the infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each of which includes multiple servers, each of which includes cloud service resources to provide corresponding cloud services to tenants.

[0065] The cloud management platform 110 can be located in a cloud data center, which can provide an access interface (such as an interface or an application program interface (API)). The tenant can operate the client 130 to remotely access the access interface to register a cloud account and password on the cloud management platform 110, and log in to the cloud management platform 110. After the cloud management platform 110 successfully authenticates the cloud account and password, the tenant can further pay to select and purchase a virtual machine with specific specifications (processor, memory, disk) on the cloud management platform 110. After the payment is successful, the cloud management platform 110 provides the remote login account and password of the purchased virtual machine, and the client 130 can remotely log in to the virtual machine, install and run the tenant's application in the virtual machine. Therefore, the tenant can create, manage, log in and operate virtual machines in the cloud data center through the cloud management platform 110. Among them, the virtual machine can also be called a cloud server (elastic compute service, ECS) or an elastic instance (different cloud service providers have different names).

[0066] It should be understood that tenants of cloud services can be individuals, enterprises, schools, hospitals, administrative agencies, etc.

[0067] The functions of the cloud management platform 110 include, but are not limited to, a user console, computing management services, network management services, storage management services, authentication services, and image management services. The user console provides an interface or API for interacting with tenants. The computing management service is used to manage servers running virtual machines and containers, as well as bare metal servers. The network management service is used to manage network services (such as gateways and firewalls). The storage management service is used to manage storage services (such as data bucket services). The authentication service is used to manage tenant accounts and passwords. The image management service is used to manage virtual machine images. Tenants can use the client 130 to log in to the cloud management platform 110 via the Internet 120 to manage the rented cloud services.

[0068] Figure 2 is a schematic flow chart of a data storage method provided by an embodiment of the present application. As shown in Figure 2, the method may include steps 210-230, and steps 210-230 are described in detail below.

[0069] Step 210: The first node receives a plurality of access requests for accessing a database.

[0070] As an example, the first node may be a database master node or a database slave node of a cloud database system, which is not limited in the embodiments of the present application. The first node receives multiple access requests for accessing a database.

[0071] Step 220: During the process of the first node processing multiple access requests, hot data is cached in the local storage of the first node.

[0072] As an example, the hot data may be different data tables of the above database, or may be table partitions of different data tables in the above database, which is not specifically limited in the embodiment of the present application.

[0073] As an example, the hot data can be determined based on one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data can also be determined based on one or both of the number of times a data table is accessed and the amount of data, which is not specifically limited in the present embodiment. Below, in conjunction with the example in FIG3 , a detailed description will be given of how to determine hot data based on the number of times a data table or a table partition of a data table is accessed and the amount of data, which will not be described in detail here.

[0074] For example, in an embodiment of the present application, a TieredMeta component can be added to the database system, and the TieredMeta component is used to count the number of accesses and / or the amount of data accesses in the database within a statistical period.

[0075] It should be understood that the above-mentioned TieredMeta component can be deployed in any node or process that can obtain the execution status of the database and the transaction execution status, or it can also be deployed independently as a proxy to achieve statistics on periodic table-level access and transaction execution status, etc. The embodiments of this application do not make specific limitations on this.

[0076] In an embodiment of the present application, for hot data, since hot data is frequently accessed online data, it has high requirements for storage performance and high requirements for data access. Therefore, the first node can cache the hot data in the local storage of the first node to ensure access requirements.

[0077] As an example, the local storage of the first node may include but is not limited to: a solid state drive (SSD), a high-performance cloud disk, a power-saving memory, and a non-volatile memory express (NVME). This embodiment does not specifically limit this.

[0078] Step 230: When the first node processes multiple access requests, the cold data is migrated to the cloud storage service, and metadata of the cold data is cached in the local storage of the first node.

[0079] As an example, the cold data may be different data tables of the above database, or may be table partitions of different data tables in the above database, which is not specifically limited in the embodiment of the present application.

[0080] As an example, the cold data can be determined based on one or both of the number of times a table partition of a data table is accessed and the amount of data, or can also be determined based on one or both of the number of times a data table is accessed and the amount of data, which is not specifically limited in the present embodiment. The following will describe in detail how to determine cold data based on the number of times a data table or a table partition of a data table is accessed and the amount of data, with reference to the example in FIG3 , and will not be described in detail here.

[0081] In the embodiment of the present application, for cold data, since cold data refers to offline data that is not frequently accessed, such as backup and archive data, it has lower requirements for storage performance and data access. Therefore, the first node can migrate the cold data to the cloud storage service and cache the metadata of the cold data in the local storage of the first node, which can save storage costs. Moreover, even if the cold data is migrated to the cloud storage service, the first node can access the cold data in the cloud storage service through the metadata of the cold data cached in the local storage, without affecting the subsequent access performance.

[0082] In a possible implementation, the metadata of the cold data stored in the local storage cache of the first node may include, but is not limited to, information pointing to the address and size of the cold data stored in the cloud storage service.

[0083] In the above technical solution, hot data and cold data are determined based on one or both of the number of times a table partition of a data table is accessed and the amount of data, and the cold data is migrated to the cloud storage service. The metadata of the cold data is cached in the local storage of the first node, and this metadata is used to access the cold data in the cloud storage service. In this way, since the cost of local storage of database nodes is relatively high, migrating the cold data to the cloud storage service saves data storage costs, and by caching the metadata of the cold data in the local storage of the first node, even after the cold data is migrated to the cloud storage service, the first node can still access the cold data in the cloud storage service through the metadata of the cold data cached in the local storage, without affecting subsequent access performance.

[0084] Optionally, in some embodiments, the method further includes: during the process of the first node processing the multiple access requests, migrating the warm data to the cloud storage service, and caching metadata of the warm data in the local storage of the first node.

[0085] As an example, the hot data, the warm data, and the cold data are different data tables of the database, or the hot data, the warm data, and the cold data are different table partitions of the data table.

[0086] As an example, the hot data, the warm data, and the cold data are determined according to one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data, the warm data, and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data, and the embodiments of the present application do not specifically limit this.

[0087] In the embodiment of the present application, since the probability of warm data being accessed is still lower than that of hot data, it is also possible to migrate the warm data to the cloud storage service, and cache the metadata of the warm data in the local storage of the first node, which can save storage costs. Moreover, even if the warm data is migrated to the cloud storage service, the first node can still access the warm data in the cloud storage service through the metadata of the warm data cached in the local storage, without affecting subsequent access performance.

[0088] Optionally, in some embodiments, if the first node is the database master node of the cloud database system, the cloud database system further includes one or more database slave nodes. In an embodiment of the present application, in the process of the first node processing the multiple access requests, the warm data can be migrated to the cloud storage service, and the warm data can be cached in the local storage of the first node. The one or more database slave nodes included in the cloud database system locally store the metadata of the warm data, or one or more database slave nodes partially store the warm data locally, and another part of the slave nodes locally store the metadata of the warm data. In this way, since the access volume of warm data is still relatively large compared to cold data, on the one hand, caching the warm data in the local storage of the database master node can ensure the write performance of the database master node. On the other hand, since the cost of local storage of the database node is relatively high, the storage cost can be further reduced by reducing the number of copies of the warm data in the slave nodes of the database.

[0089] As an example, a method provided in an embodiment of the present application is listed below for determining cold data, warm data, or hot data based on one or both of the number of times a data table or a table partition of a data table is accessed and the amount of data.

[0090] For example, as shown in FIG3 , (warm_min, warm_max) is the range of the number of accesses and / or the amount of data accessed to the warm data, where warm_min is the minimum number of accesses and / or the amount of data accessed to the warm data, and warm_max is the maximum number of accesses and / or the amount of data accessed to the warm data.

[0091] Cold data: If the number of accesses and / or access volume of data in a database within a period is lower than warm_min, the data in the database can be defined as cold data.

[0092] Warm data: If the number of accesses and / or the amount of accesses to a piece of data in a database during a period is higher than warm_min but lower than warm_max, the data in the database can be defined as warm data.

[0093] Hot data: If the number of accesses and / or the amount of accesses to a data item in a database during a period is higher than warm_max, the data item in the database can be defined as hot data.

[0094] FIG4 is a schematic block diagram of a storage situation before data migration in a database system provided in an embodiment of the present application.

[0095] It should be understood that the embodiment of the present application does not specifically limit the number of nodes in the database system. It can include only a master node, or a master node and at least one backup node. Figure 4 illustrates an example of one master node and three backup nodes.

[0096] As shown in Figure 4, the database system includes a master node (Node 1) and three standby nodes (also called slave nodes, namely Node 2, Node 3, and Node 4). Table 1, Table 2, Table 3, and Table 4 are the data tables stored in the database. Before data migration, Table 1, Table 2, Table 3, and Table 4 are stored in the local storage of the master node (Node 1). The data is synchronized to the three standby nodes (Node 2, Node 3, and Node 4) through asynchronous remote replication or other means. That is, the local storage of Nodes 1 through 4 stores Table 1, Table 2, Table 3, and Table 4, respectively.

[0097] Since the local storage cost of nodes 1 to 4 is relatively high, it is possible to determine which data in Tables 1 to 4 are cold data, warm data, and hot data based on the number of times Tables 1, 2, 3, and 4 are accessed and / or the amount of data accessed during the statistical period, and migrate the data to a storage with lower storage cost (for example, a cloud storage service) according to the corresponding migration strategy, thereby saving data storage costs and overhead.

[0098] As an example, an embodiment of the present application counts the number of table-level data accesses and / or access volume for Tables 1 to 4 stored in the database system in FIG4 according to a time window. In one possible implementation, taking FIG3 as an example, assuming that the number of accesses and / or access volume of Table 1 is higher than warm_max, then Table 1 is hot data. Assuming that the number of accesses and / or access volume of Tables 2 to 3 is higher than warm_min but lower than warm_max, then Tables 2 to 3 are warm data. Assuming that the number of accesses and / or access volume of Table 4 is lower than warm_min, then Table 4 is cold data.

[0099] In conjunction with Figures 5-6, taking Table 1 as hot data, Table 2 to Table 3 as warm data, and Table 4 as cold data as an example, the data storage after data migration according to the migration strategy provided by the embodiment of the present application is described in detail. It should be understood that the examples of Figures 5-6 are only to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the application embodiments to the specific numerical values ​​or specific scenarios illustrated in Figures 5-6. Those skilled in the art can obviously make various equivalent modifications or changes based on the following examples given in Figures 5-6, and such modifications and changes also fall within the scope of the embodiments of the present application.

[0100] FIG5 is a schematic block diagram of data storage after data migration according to a migration strategy provided by an embodiment of the present application.

[0101] For example, the following describes in detail a possible migration strategy for cold data, warm data, and hot data.

[0102] 1. Migration strategy for hot data (Strategy 1)

[0103] The migration strategy for hot data is to not migrate the hot data and keep it persistent in the local storage (first storage). In other words, the hot data is not migrated to the second storage (corresponding to the cloud storage service mentioned above, also known as cold storage) for storage.

[0104] As an example, referring to FIG5 , since Table 1 is hot data, the data entities of Table 1 are all stored in the local storage (in the first memory) of nodes 1 to 4, while the data entities of Table 1 are not stored in the second memory (cold storage).

[0105] 2. Migration strategy for cold data (Strategy 2)

[0106] For cold data, the cold data can be migrated to a secondary memory (cold storage) for storage. Only the metadata corresponding to the cold data is retained in the local storage. This metadata points to the cold data stored in the cold storage. This metadata can also be referred to as the pointing information of the cold data stored in the cold storage. This pointing information may include, but is not limited to, the size and address of the cold data stored in the cold storage. This ensures that when a business connects to the node, normal read access can still be provided, or when other nodes fail, the node can participate in the election to ensure that it can take over the corresponding business.

[0107] As an example, referring to Figure 5 , since Table 4 is cold data, it is migrated to the second memory (cold storage) for storage. Only the metadata of Table 4 is stored in the local storage (first memory) of nodes 1 through 4. This allows any node from 1 through 4 to read and access Table 4 from the second memory (cold storage) based on its locally stored metadata of Table 4.

[0108] 3. Migration strategy for warm data (Strategy 3)

[0109] For warm data, all warm data can be migrated to the second memory (cold storage) for storage, following the same treatment as cold data. Since warm data is accessed frequently or in large volumes, the data entities storing warm data in master node 1 and the data stored in the local storage (first memory) of the three backup nodes (nodes 2, 3, and 4) can be determined according to the following different implementations.

[0110] In a possible implementation, according to the hot data processing method, the local storage (in the first memory) of the three standby nodes (node ​​2, node 3, and node 4) can store data entities of warm data.

[0111] In another possible implementation, according to the cold data processing method, the metadata of the warm data can be stored in the local storage (in the first memory) of the three backup nodes (node ​​2, node 3, and node 4), and the metadata points to the warm data stored in the cold storage.

[0112] In another possible implementation, the hotter the warm data, the more copies of the data the standby node retains. As the hotness of the warm data decreases, the number of copies is gradually reduced according to certain rules, thereby achieving the purpose of reducing costs.

[0113] As an example, referring to Figure 5 , since Tables 2 and 3 are warm data, they are migrated to the second memory (cold storage) for storage, while the data entities of Tables 2 and 3 are stored in the local storage (first storage) of Node 1. According to one implementation method described above, the number of replicas of Tables 2 and 3 on the backup nodes is reduced from three to one. That is, only one backup node (e.g., Node 2) stores the data entities of Tables 2 and 3 in its local storage, while the metadata of Tables 2 and 3 is stored in the local storage of the remaining backup nodes (e.g., Node 3 and Node 4). This metadata points to Tables 2 and 3 stored in the second memory (cold storage), allowing any of the remaining backup nodes to read and access Tables 2 and 3 from the second memory (cold storage) based on the metadata of Tables 2 and 3 stored locally. For example, the local storage (first storage) of Node 3 stores the data entities of Tables 2 and 3, while the local storage (first storage) of Nodes 2 through 4 stores the metadata of Tables 2 and 3.

[0114] It should be noted that the number of replicas of Table 2 and Table 3 on the standby node may be the same or different, and this embodiment of the present application does not specifically limit this.

[0115] FIG6 is another schematic block diagram of data storage after data migration according to a migration strategy provided by an embodiment of the present application.

[0116] For example, in this embodiment of the present application, for any type of cold data, warm data, or hot data, the data entity can be regularly migrated to the second storage (cold storage) for storage, while the data metadata is stored in the local storage (first storage) of nodes 1 to 4. This can maximize the reduction of storage costs.

[0117] Referring to Figure 6, all Tables 1 to 4 are migrated from the local storage (first storage) of nodes 1 to 4 to the second storage (cold storage) for storage. The local storage (first storage) of nodes 1 to 4 stores the metadata of Tables 1 to 4, and the metadata of Tables 1 to 4 point to the data entities of Tables 1 to 4 stored in the cold storage.

[0118] Optionally, in some embodiments, the resource load of each node in the cluster can be collected periodically so that when data is migrated, nodes with lighter loads are prioritized for data migration, thereby achieving load balancing. As an example, the resource load of the node may include, but is not limited to, the node's memory load, central processing unit (CPU) load, network load, etc.

[0119] Optionally, in some embodiments, the data entity may be preferentially retained on a node with a lighter load to achieve load balancing.

[0120] In the embodiment of the present application, after migrating data according to the above migration strategy, the current storage distribution of each data can also be recorded. For example, taking Figure 5 as an example, the table map shown in Table 1 shows the distribution of Tables 1 to 4 on all nodes in the cluster, that is, how many nodes hold the data of Tables 1 to 4 and which nodes hold the data of Tables 1 to 4.

[0121] As shown in Table 1, db_name represents the database name, table_name represents the table name, node_count represents the number of nodes holding the data, node_x represents the node ID holding the data, and deltatbl represents incremental data. If node_count is 0, the data is stored in cold storage and can be accessed from any node. Otherwise, if node_count is not 0, node_count represents the number of nodes holding the data stored after this record. For example, Table1 has data entities stored locally (on the first storage device) on nodes 2, 3, and 4. Therefore, the node_count value for Table1 is 3. Tables 2 and 3 have data entities stored only locally (on the first storage device) on node 3. Therefore, the node_count value for Tables 2 and 3 is 1, and the node holding the data is node 3. Table 4 is stored only in cold storage and has no data entities stored locally (on the first storage device) on nodes 1 through 4. Therefore, the node_count value for Table4 is 0.

[0122] Table 1 table map

[0123] It should be understood that after the data is migrated to cold storage, most cold storage only supports append writes. In order to continue to provide write services, when write operations such as insert, update, and delete occur on cold data (table or partition), they can be recorded locally in the form of incremental data. The deltatbl in Table 1 indicates that Table2 to Table4 have incremental data.

[0124] It should be noted that the deltatbl in the above table stores the table name of the incremental data, or the log file, or the file path, or related information of other types of files, and the embodiment of the present application does not make specific limitations on this.

[0125] In the embodiments of this application, newly written data generated after migration is organized as incremental data, which can be organized in various formats including, but not limited to, subtables, logs, and other open source persistent structures. This is primarily intended to address the issue of data being unable to support modification and write operations after migration to cold storage. By recording incremental data, continuous write capability is provided.

[0126] Optionally, when accessing data stored in cold storage, it may involve querying the data stored in cold storage and local incremental data at the same time. Therefore, when generating a query plan, if it is found that there is corresponding incremental data for the table in TableMap, the generated query plan needs to scan the incremental data together and merge it with the data stored in cold storage. There may be duplicate data between the incremental data and the data in cold storage, but the incremental data must be the latest data, so the query result only needs to retain the records in the incremental data. In addition, if only the most recently generated or modified data is accessed, there will be no performance loss because it is saved in the local incremental data, because the performance loss is mainly generated when accessing historical data to ensure that the full amount of historical data is read.

[0127] Optionally, in some embodiments, after running for a sufficiently long time, a large amount of local incremental data may accumulate. To prevent a large amount of incremental data from occupying the node's local storage resources, for example, in Figure 6, since hot data is saved to cold storage, there are a large number of write accesses to the hot data, which will generate a large amount of incremental data in the node's local storage. To address this situation, embodiments of the present application can also merge the incremental data with the corresponding data on the cold storage periodically or when the system is idle, thereby reducing the amount of incremental data in the local storage.

[0128] The embodiments of the present application do not specifically limit the above-mentioned merging method. In one example, the data corresponding to the incremental data can be read from the cold storage, and after merging the data with the incremental data, the data can be stored in the cold storage. In another example, the incremental data can be directly stored in the cold storage, and the incremental data and the data corresponding to the incremental data can be merged in the cold storage.

[0129] It should be understood that the above-mentioned merging operation can be automatically performed when the system is idle, or can be performed manually when there is no business, and this application does not limit this.

[0130] In the embodiment of the present application, since only the master node is writable, after the master node transaction is committed, the data needs to be synchronized to the backup machine through asynchronous remote replication or other means. Asynchronous remote replication will cause the consistency between nodes to be unable to be guaranteed in real time. Therefore, the purpose here is to record the currently submitted transactions, or the transaction information that has been submitted and has started to be replicated but has not been replicated to all nodes, as a basis for judging visibility to ensure the isolation level of the transaction. Therefore, the embodiment of the present application also adds a distributed global active transaction record, which stores transactions that are not currently submitted or have been submitted but have not yet been replicated to all copies through the consensus protocol. When the node that receives the read request conflicts with the transaction in the global active transaction record, the request is forwarded to the master node for execution. In this way, the read / write transaction isolation level of each node can be guaranteed not to be affected.

[0131] As an example, the TieredMeta component can also record information about transactions that are currently uncommitted or committed but not yet consistent across all nodes. For example, the Writing_Tables component in Table 2 records tables or partitions that have been written or are currently being written, but have not yet been replicated to all replicas recorded in the TableMap and completed playback. Because only the primary node can perform write operations and the backup node can only specify read-related operations, the writing_tables component only needs to be collected on the primary node.

[0132] Table 2 writing_tables

[0133] Take transaction 1 (txn1) in Table 2 as an example. When transaction 1 (txn1) writes to table 1, it inserts the corresponding record into the writing tables, initially in the running state. After transaction txn1 commits, it enters the replication state. Once all nodes holding the table have replicated and successfully replayed the data, it enters the committed state and deletes the record.

[0134] Optionally, in some embodiments, the embodiments of the present application may further implement the read-write conflict processing logic through the above-mentioned writing_tables, thereby ensuring the isolation level of each transaction when multiple transactions are executed concurrently.

[0135] For example, Figure 7 illustrates the logic for handling read-write conflicts. txn B is a write transaction executed on the primary node, and the "running" label under txn B indicates the running status of txn B. txn A, txn C, and txn D are three concurrently executed read transactions. Among them, txn A is a read transaction initiated after txn B, txn C is a read transaction initiated before txn B, and txn D is a read transaction initiated after txn B is committed and remote replication begins. The dashed intervals on each transaction line indicate the conflict handling logic for concurrent read transactions within the corresponding interval. Specifically, within the transaction status interval of txn B, read transactions initiated at different times are handled as follows: whether to read on any standby node or to switch to the primary node for reading.

[0136] The above describes in detail the method provided by the embodiment of the present application in conjunction with Figures 1 to 7. The following describes in detail the embodiment of the device of the present application in conjunction with Figures 8 to 11. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for parts not described in detail, reference can be made to the above method embodiment.

[0137] Figure 8 is a schematic block diagram of a data storage device 800 provided in an embodiment of the present application. The device 800 can be implemented by software, hardware, or a combination of the two. The device 800 provided in an embodiment of the present application can implement the method flow shown in the embodiment of the present application. The device 800 can be applied to a first node, which is a database master node or a database slave node of the cloud database system. The cloud computing platform deploys the cloud database system on the cloud computing resources it manages. The cloud database system includes a database master node and one or more database slave nodes. The cloud computing platform deploys a cloud storage service on the cloud computing resources. The device 800 includes: a receiving module 810, a caching module 820, and a migration module 830, wherein the receiving module 810 is used to receive multiple access requests for accessing a database, and the first node is a database master node or a database slave node of the cloud database system; the caching module 820 is used to cache hot data in the local storage of the first node during processing of the multiple access requests; the migration module 830 is used to migrate cold data to the cloud storage service during processing of the multiple access requests, and cache metadata of the cold data in the local storage of the first node; wherein the hot data and the cold data are different data tables of the database, or the hot data and the cold data are different table partitions of the data table; wherein the hot data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0138] Optionally, the migration module 830 is also used to migrate the warm data to the cloud storage service during the process of processing the multiple access requests, and cache the metadata of the warm data in the local storage of the first node; wherein the hot data, the warm data and the cold data are different data tables of the database, or the hot data, the warm data and the cold data are different table partitions of the data table; wherein the hot data, the warm data and the cold data are determined according to one or both of the number of times the table partition of the data table is accessed and the amount of data, or the hot data, the warm data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

[0139] Optionally, the first node is the database master node of the cloud database system, and the migration module 830 is also used to migrate the warm data to the cloud storage service during the process of processing the multiple access requests, and cache the warm data in the local storage of the first node, and the metadata of the warm data is stored locally in one or more database slave nodes included in the cloud database system.

[0140] Optionally, the device 800 further includes: a maintenance module, configured to maintain a first table, wherein the first table is configured to record storage conditions of the hot data, the cold data, and the warm data.

[0141] Optionally, the multiple access requests include a write request, which includes data to be written. The cache module is also used to perform a write operation on the cold data stored in the cloud storage service according to the write request, and cache the data to be written in the form of incremental data in the local storage of the first node.

[0142] Optionally, the multiple access requests include a write request, which includes data to be written. The cache module 820 is also used to perform a write operation on the warm data stored in the cloud storage service according to the write request, and cache the data to be written in the form of incremental data in the local storage of the first node.

[0143] Optionally, the device 800 further includes: a merging module for merging the incremental data in the local storage of the first node and the cold data or the warm data stored in the cloud storage service; and a migration module for migrating the merged data to the cloud storage service.

[0144] Optionally, the first table is also used to record the existence of the incremental data.

[0145] The apparatus 800 herein may be embodied in the form of a functional module. The term "module" herein may be implemented in the form of software and / or hardware, and is not specifically limited thereto.

[0146] For example, a "module" can be a software program, hardware circuit, or a combination of the two that implements the aforementioned functions. For example, the implementation of receiving module 810 will be described below using receiving module 810 as an example. Similarly, the implementation of other modules, such as cache module 820 and migration module 830, can refer to the implementation of receiving module 810.

[0147] The receiving module 810 is taken as an example of a software functional unit, and the receiving module 810 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the receiving module 810 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 code may be distributed in the same region or in different regions. Furthermore, 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 geographically close data centers. Generally, a region may include multiple AZs.

[0148] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0149] As an example of a hardware functional unit, the receiving module 810 may include at least one computing device, such as a server. Alternatively, the receiving module 810 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0150] The multiple computing devices included in the receiving module 810 can be distributed in the same region or in different regions. The multiple computing devices included in the receiving module 810 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the receiving module 810 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.

[0151] Therefore, the modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0152] It should be noted that: when the device provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual application, the above 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. For example, the receiving module 810 can be used to execute any step in the above method, the cache module 820 can be used to execute any step in the above method, and the migration module 830 can be used to execute any step in the above method. The steps that the receiving module 810, the cache module 820, and the migration module 830 are responsible for implementing can be specified as needed, and all the functions of the above device can be realized by respectively implementing different steps in the above method through the receiving module 810, the cache module 820, and the migration module 830.

[0153] In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments above and will not be repeated here.

[0154] The method provided in the embodiment of the present application can be performed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory and a memory control unit, and the function and structure of the hardware are subsequently described in detail. The operating system is any one or more computer operating systems that implement business processing through a process, for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system or a Windows operating system. The application layer includes applications such as a browser, an address book, a word processing software, and an instant messaging software. Furthermore, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and this application is not particularly limited, as long as the method provided in the embodiment of the present application can be used. The execution subject of the method provided in the embodiment of the present application can be a computing device, or a functional module in a computing device that can call a program and execute a program.

[0155] 9 , a computing device provided in an embodiment of the present application is described in detail below.

[0156] FIG9 is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of the present application. The computing device 1500 may be a server, a computer, or other device with computing capabilities. The computing device 1500 shown in FIG9 includes: at least one processor 1510 and a memory 1520.

[0157] It should be understood that this application does not limit the number of processors and memories in the computing device 1500.

[0158] The processor 1510 executes the instructions in the memory 1520 so that the computing device 1500 implements the method provided in this application. Alternatively, the processor 1510 executes the instructions in the memory 1520 so that the computing device 1500 implements the functional modules provided in this application, thereby implementing the method provided in this application.

[0159] Optionally, the computing device 1500 further includes a communication interface 1530. The communication interface 1530 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1500 and other devices or a communication network.

[0160] Optionally, the computing device 1500 further includes a system bus 1540, wherein the processor 1510, the memory 1520, and the communication interface 1530 are respectively connected to the system bus 1540. The processor 1510 can access the memory 1520 through the system bus 1540. For example, the processor 1510 can read and write data or execute code in the memory 1520 through the system bus 1540. The system bus 1540 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 1540 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in Figure 9, but this does not mean that there is only one bus or one type of bus.

[0161] In one possible implementation, the processor 1510 is primarily responsible for interpreting computer program instructions (or codes) and processing data in the computer software. The computer program instructions and the data in the computer software may be stored in the memory 1520 or the cache 1516.

[0162] Optionally, the processor 1510 may be an integrated circuit chip having signal processing capabilities. By way of example and not limitation, the processor 1510 is a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor is a microprocessor, etc. For example, the processor 1510 is a central processing unit (CPU).

[0163] Optionally, each processor 1510 includes at least one processing unit 1512 and a memory control unit 1514 .

[0164] Processing unit 1512, also known as a core, is the most important component of a processor. Processing unit 1512 is manufactured from single-crystal silicon using a specific production process. All processor calculations, command reception, command storage, and data processing are performed by the core. Each processing unit independently executes program instructions, leveraging parallel computing capabilities to accelerate program execution. Each processing unit has a fixed logical structure. For example, a processing unit includes logical units such as a level 1 cache, a level 2 cache, an execution unit, an instruction-level unit, and a bus interface.

[0165] In one implementation example, the memory control unit 1514 is configured to control data exchange between the memory 1520 and the processing unit 1512. Specifically, the memory control unit 1514 receives memory access requests from the processing unit 1512 and controls access to the memory based on the memory access requests. By way of example and not limitation, the memory control unit is a device such as a memory management unit (MMU).

[0166] In one implementation example, each memory control unit 1514 addresses the memory 1520 via the system bus. An arbiter (not shown in FIG. 9 ) is configured in the system bus to handle and coordinate competing accesses by multiple processing units 1512 .

[0167] In an implementation example, the processing unit 1512 and the memory control unit 1514 are connected to each other via connection lines inside the chip, such as address lines, so as to achieve communication between the processing unit 1512 and the memory control unit 1514.

[0168] Optionally, each processor 1510 also includes a cache 1516, which is a buffer for data exchange (called a cache). When a processing unit 1512 needs to read data, it first searches the cache for the required data. If the data is found, it executes the request directly; if not, it searches the memory. Because the cache runs much faster than the memory, the cache helps the processing unit 1512 run faster.

[0169] Memory 1520 can provide runtime space for processes in computing device 1500. For example, memory 1520 stores computer programs (specifically, program code) used to generate processes. After the computer program is executed by the processor to generate a process, the processor allocates corresponding storage space for the process in memory 1520. Furthermore, the aforementioned storage space further includes a text segment, an initialized data segment, a bit-initialized data segment, a stack segment, a heap segment, and the like. Memory 1520 stores data generated during the execution of the process, such as intermediate data or process data, in the storage space corresponding to the aforementioned process.

[0170] Optionally, the memory is also called the internal memory. Its function is to temporarily store the data processed by the processor 1510 and the data exchanged with external storage such as a hard disk. As long as the computer is running, the processor 1510 will load the data to be calculated into the internal memory for calculation. When the calculation is completed, the processing unit 1512 will transmit the result.

[0171] By way of example and not limitation, memory 1520 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Non-volatile memory is read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory 1520 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0172] The structure of the computing device 1500 listed above is only for illustrative purposes, and the present application is not limited thereto. The computing device 1500 of the embodiment of the present application includes various hardware in the computer system in the prior art. For example, the computing device 1500 also includes other memories in addition to the memory 1520, such as disk storage, etc. Those skilled in the art should understand that the computing device 1500 may also include other devices necessary to achieve normal operation. At the same time, according to specific needs, those skilled in the art should understand that the above-mentioned computing device 1500 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the above-mentioned computing device 1500 may also include only the devices necessary to implement the embodiment of the present application, and does not necessarily include all the devices shown in Figure 9.

[0173] The present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0174] As shown in Figure 10, the computing device cluster includes at least one computing device 1500. The memory 1520 in one or more computing devices 1500 in the computing device cluster may store the same instructions for executing the above method.

[0175] In some possible implementations, the memory 1520 of one or more computing devices 1500 in the computing device cluster may also store some instructions for executing the above method. In other words, the combination of one or more computing devices 1500 can jointly execute the instructions of the above method.

[0176] It should be noted that the memory 1520 in different computing devices 1500 in the computing device cluster can store different instructions, each for performing part of the functions of the above-mentioned apparatus. In other words, the instructions stored in the memory 1520 in different computing devices 1500 can implement the functions of one or more modules in the above-mentioned apparatus.

[0177] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. The network can be a wide area network (WAN) or a local area network (LAN), among others. FIG. 11 illustrates one possible implementation. As shown in FIG. 11 , two computing devices 1500A and 1500B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.

[0178] It should be understood that the functionality of the computing device 1500A shown in FIG11 may also be implemented by multiple computing devices 1500. Similarly, the functionality of the computing device 1500B may also be implemented by multiple computing devices 1500.

[0179] This embodiment 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 a computing device, it causes the computing device to perform the method provided above, or causes the computing device to implement the functions of the apparatus provided above.

[0180] This embodiment also provides a computer program product containing instructions. The computer program product may be software or a program product containing instructions that can be executed on a computing device cluster or stored on any available medium. When executed by a computing device cluster, the computer program product causes the computing device cluster to perform the method provided above, or causes the computing device cluster to implement the functions of the apparatus provided above.

[0181] This embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed on a computing device, cause the computing device to perform the method provided above.

[0182] This embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed by a computing device cluster, cause the computing device cluster to perform the method provided above.

[0183] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0184] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0185] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0186] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0187] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0189] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0190] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for data storage, characterized in that: The cloud database system includes a database master node and one or more database slave nodes. The cloud computing platform deploys the cloud database system on the cloud computing resources managed by the cloud computing platform. The cloud computing platform deploys cloud storage services on the cloud computing resources. The method includes: A first node receives a plurality of access requests for accessing a database, wherein the first node is a database master node or a database slave node of the cloud database system; During the process of the first node processing the multiple access requests, the hot data is cached in the local storage of the first node; In the process of processing the multiple access requests by the first node, the cold data is migrated to the cloud storage service, and metadata of the cold data is cached in the local storage of the first node; The hot data and the cold data are different data tables of the database, or the hot data and the cold data are different table partitions of the data table; The hot data and the cold data are determined according to one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

2. The method according to claim 1, characterized in that The method further comprises: In the process of processing the multiple access requests by the first node, the warm data is migrated to the cloud storage service, and metadata of the warm data is cached in the local storage of the first node; The hot data, the warm data and the cold data are different data tables of the database, or the hot data, the warm data and the cold data are different table partitions of the data table; The hot data, the warm data and the cold data are determined according to one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data, the warm data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

3. The method according to claim 1, characterized in that The first node is a database master node of the cloud database system, and the method further includes: During the process of the first node processing the multiple access requests, the warm data is migrated to the cloud storage service, and the warm data is cached in the local storage of the first node. One or more databases included in the cloud database system store metadata of the warm data locally from the node.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The first node maintains a first table, where the first table is used to record storage conditions of the hot data, the cold data, and the warm data.

5. The method according to any one of claims 1 to 4, characterized in that The multiple access requests include a write request, the write request includes data to be written, and the method further includes: The first node performs a write operation on the cold data stored in the cloud storage service according to the write request, and caches the data to be written in the form of incremental data in the local storage of the first node.

6. The method according to any one of claims 2 to 4, characterized in that The multiple access requests include a write request, the write request includes data to be written, and the method further includes: The first node performs a write operation on the warm data stored in the cloud storage service according to the write request, and caches the data to be written in the form of incremental data in the local storage of the first node.

7. The method according to claim 5 or 6, characterized in that: The method further comprises: The first node merges the incremental data in the local storage of the first node and the cold data or the warm data stored in the cloud storage service, and migrates the merged data to the cloud storage service.

8. The method according to any one of claims 4 to 7, characterized in that The first table is also used to record the existence of the incremental data.

9. A data storage device, characterized in that: The cloud database system includes a database master node and one or more database slave nodes. The cloud computing platform deploys the cloud database system on the cloud computing resources it manages. The cloud computing platform deploys cloud storage services on the cloud computing resources. The device is applied to a first node, which is a database master node or a database slave node of the cloud database system. The device includes: A receiving module is used to receive multiple access requests for accessing a database, wherein the first node is a database of the cloud database system. Master node or database slave node; a cache module, configured to cache hot data in a local storage of the first node during processing of the plurality of access requests; A migration module, configured to migrate the cold data to the cloud storage service and cache the metadata of the cold data in the local storage of the first node during processing of the multiple access requests; The hot data and the cold data are different data tables of the database, or the hot data and the cold data are different table partitions of the data table; The hot data and the cold data are determined according to one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

10. The device according to claim 9, characterized in that The migration module is further configured to migrate the warm data to the cloud storage service during processing of the multiple access requests, and cache metadata of the warm data in the local storage of the first node; The hot data, the warm data and the cold data are different data tables of the database, or the hot data, the warm data and the cold data are different table partitions of the data table; The hot data, the warm data and the cold data are determined according to one or both of the number of times a table partition of a data table is accessed and the amount of data, or the hot data, the warm data and the cold data are determined according to one or both of the number of times the data table is accessed and the amount of data.

11. The device according to claim 9, characterized in that The first node is a database master node of the cloud database system, The migration module is also used to migrate the warm data to the cloud storage service during the process of processing the multiple access requests, and cache the warm data in the local storage of the first node, and one or more databases included in the cloud database system locally store metadata of the warm data from the node.

12. The device according to any one of claims 9 to 11, characterized in that The device also includes: The maintenance module is used to maintain a first table, where the first table is used to record the storage status of the hot data, the cold data, and the warm data.

13. The device according to any one of claims 9 to 12, characterized in that The multiple access requests include a write request, and the write request includes data to be written. The cache module is further configured to cache the data to be written in the form of incremental data in the local storage of the first node according to the write request for performing a write operation on the cold data stored in the cloud storage service.

14. The device according to any one of claims 10 to 12, characterized in that The multiple access requests include a write request, and the write request includes data to be written. The cache module is further configured to cache the data to be written in the form of incremental data in the local storage of the first node according to the write request for performing a write operation on the warm data stored in the cloud storage service.

15. The device according to claim 13 or 14, characterized in that The device also includes: A merging module, configured to merge the incremental data in the local storage of the first node and the cold data or the warm data stored in the cloud storage service; The migration module is also used to migrate the merged data to the cloud storage service.

16. The device according to claim 12 or 15, characterized in that The first table is also used to record the existence of the incremental data.

17. A computing device, characterized in that The computer comprises a processor and a memory, wherein the processor is configured to execute instructions stored in the memory so that the computing device executes the method according to any one of claims 1 to 8.

18. 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 8.

19. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 8.

20. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 8.

21. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, which, when executed by a computing device, perform the method according to any one of claims 1 to 8.

22. 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 performs the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data storage method and device and computing equipment

    CN118708561A

  • A data processing method and device

    CN109947373A

  • Data storage method and device, electronic equipment and computer readable storage medium

    CN113220729A

  • Updating method and device of cold storage data, equipment and storage medium

    CN114416677A

  • Data processing method and device, electronic equipment and computer readable storage medium

    CN115022342A

Cited By

  • Internet of Things heterogeneous data storage method and system

    CN119536640A

  • Data storage method, device, system and storage medium

    CN119739352A

  • Computing power service data set storage method

    CN120162223A

  • Shopping mall sales data storage method based on cloud platform

    CN120371837A

  • A cloud platform-based mall sales data storage method

    CN120371837B