Method for acquiring data page and related device

By controlling the node device to send prefetch requests to other node devices under prefetch conditions in the database cluster, it ensures that data pages are stored in local memory, solves the query time-consuming problem caused by frequent IO operations, and improves the business query of the database cluster. performance.

WO2024198751A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/076740
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-02-07
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Frequent IO operations (disk IO or network IO) in existing database clusters increase the time consuming of the query process and limit the business query performance of the database cluster.

Method used

By controlling the node device to send prefetch requests to other node devices under prefetch conditions, it is ensured that the data page to be read is stored in local memory, thereby reducing disk IO or network IO operations the next time the data page is obtained.

Benefits of technology

It effectively shortens the query time of the database cluster, improves the business query performance, makes full use of the memory sharing characteristics of each node in the memory pool cluster, and reduces the IO operations when actually reading the data page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024076740_03102024_PF_FP_ABST
    Figure CN2024076740_03102024_PF_FP_ABST
Patent Text Reader

Abstract

A method for acquiring a data page and a related device, relating to the field of computers, for use in shortening time consumed for querying a data page in a database cluster and improving the service query performance of the database cluster. The method comprises: receiving a prefetching request from a first node device in a database cluster, wherein the prefetching request is sent by the first node device under a prefetching condition, and the prefetching request comprises an identifier of a first data page; and controlling a second node device to possess the first data page, wherein the first data page is a prefetched data page corresponding to a second data page currently processed by the first node device, the first node device is any node device in the database cluster, and the second node device is different from the first node device.
Need to check novelty before this filing date? Find Prior Art

Description

A method for obtaining data pages and related equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 29, 2023, with application number 202310336479.5 and application name “A method for obtaining data pages and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computers, and in particular to a method, apparatus, node device, and computer-readable storage medium for obtaining a data page. Background Art

[0003] To improve database reliability and performance, database clusters emerged. A database cluster is a collection of multiple physical machines with database applications installed, working together to provide external services. Each physical machine acts as a node in a database cluster and is referred to as a node device.

[0004] Currently, the more popular database cluster uses a distributed memory management system (DMS), which is also called a cluster with a memory pooling architecture. Each node device shares an underlying storage disk. Through a high-speed network interconnected between node devices, the memory resources of each node device are connected and shared. The memory of node devices in the entire cluster can be accessed by each other, and the underlying storage disk is shared at the same time, which can achieve real-time consistency of data between nodes.

[0005] In a database cluster, when a node device retrieves a data page, the smallest unit of data storage, it first queries local memory. If the local memory does not match, it then queries the control node to see if the local memory of other nodes in the cluster holds the data page. If the local memory of other nodes holds the data page, it retrieves the data page from the other nodes through network input and output (I / O) operations. If no node holds the data page, it loads the data page from the shared disk through disk I / O operations.

[0006] Frequent IO operations (disk IO or network IO) will inevitably increase the time consumption of the query process and limit the business query performance of the database cluster.

[0007] Summary of the Invention

[0008] The present application provides a method, apparatus, node device, and computer-readable storage medium for obtaining data pages, so as to shorten the query time of data pages in a database cluster and improve the business query performance of the database cluster.

[0009] To achieve the above objectives, the present invention adopts the following technical solutions:

[0010] In a first aspect, a method for retrieving a data page is provided. The method can be applied to a control node device in a database cluster. The method may include: receiving a prefetch request including an identifier of a first data page from a first node device in the database cluster, and controlling a second node device to hold the first data page. The second node device is different from the first node device. The prefetch request is sent by the first node device under prefetch conditions; the first data page is a prefetched data page corresponding to a second data page currently being processed by the first node device; and the first node device is any node device in the database cluster.

[0011] Through the method for obtaining data pages provided by the present application, under the pre-fetch condition (the data page to be read can be determined), it is ensured that the first data page corresponding to the second data page is stored in the local memory of the second node device, and the memory sharing characteristics of each node in the memory pooling cluster are fully utilized. When the second node device reads the first data page, it can hit the local memory without IO. When other node devices read the first data page, network IO can be used without disk IO, thereby reducing the disk IO or network IO for obtaining the data page next time, thereby shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0012] In a possible implementation, the second data page may be a data page to be acquired by the first node device. Accordingly, the above-mentioned pre-fetching conditions may include: the second data page is not hit in the local memory of the first node device, and it is a sequential scan. The first data page includes: in the data page sequence of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial numbers start from the next data page of the second data page. N is greater than or equal to 1. In a sequential scan, the node device acquires the data pages in sequence according to the data page order, and stores the N data pages after the currently processed second data page as pre-fetched data pages in advance to the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to acquire the data page from the node device through network IO, without loading the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0013] In another possible implementation, the second data page can be a data page held by the first node device; the prefetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page. In a hot scenario, the frequently accessed data page is used as a prefetched data page and pre-loaded into the local memory of the node device. When subsequently acquiring the hot data page, the node device only needs to obtain the data page from other node devices via network IO, or it can directly hit the local memory without loading the data page from disk. Therefore, it can effectively reduce disk IO or network IO in cluster queries and shorten query time.

[0014] In another possible implementation, when the pre-fetch condition indicates that the second data page is a hot data page, the pre-fetch condition may include: within a preset time period, the number of times the second data page is fetched is greater than or equal to a first threshold; or within the preset time period, the proportion of the number of times the second data page is fetched to the total number of times data pages are fetched is greater than or equal to a second threshold.

[0015] In another possible implementation, the second node device is M node devices in the database cluster, excluding the first node device, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1. In this implementation, M node devices in the database cluster, excluding the first node device, prefetch the first data page. The number of M can be configured based on actual needs. A larger number of M can effectively reduce network I / O or disk I / O, shortening query time.

[0016] In another possible implementation, the second data page is a data page to be acquired by the first node device, and M is 1.

[0017] In another possible implementation, the second data page is a data page held by the first node device, and M is the total number of node devices in the database cluster minus 1, that is, the second node device is all node devices in the database cluster except the first node device.

[0018] In another possible implementation, controlling the second node to hold the first data page includes: if the second node device in the database cluster does not hold the first data page, controlling the second node to obtain and hold the first data page.

[0019] In another possible implementation, if the second node device in the database cluster does not hold the first data page, controlling the second node to obtain and hold the first data page includes: if the second node device does not hold the first data page, and the number of data pages held by the second node device is less than a third threshold, controlling the second node to obtain and hold the first data page.

[0020] In another possible implementation, controlling the second node to obtain and hold the first data page can be specifically implemented by sending a prefetch message including an identifier of the first data page to the second node device, so that the second node device loads the first data page from other node devices or a disk.

[0021] In a second aspect, another method for acquiring a data page is provided, applied to a first node device in a database cluster. The method may include: under a prefetch condition, sending a prefetch request including a first data page to a control node device of the database cluster, the prefetch request being used to indicate that a second node device in the database cluster holds the first data page. The second node device is different from the first node device, the first data page is a prefetched data page corresponding to a second data page currently being processed by the first node device, and there are one or more first data pages.

[0022] Through the method for obtaining data pages provided by the present application, under the pre-fetch condition (the data page to be read can be determined), it is ensured that the first data page corresponding to the second data page is stored in the local memory of the second node device, and the memory sharing characteristics of each node in the memory pooling cluster are fully utilized. When the second node device reads the first data page, it can hit the local memory without IO. When other node devices read the first data page, network IO can be used without disk IO, thereby reducing the disk IO or network IO for obtaining the data page next time, thereby shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0023] In a possible implementation, the second data page may be a data page to be acquired by the first node device. Accordingly, the above-mentioned pre-fetching conditions may include: the second data page is not hit in the local memory of the first node device, and it is a sequential scan. The first data page includes: in the data page sequence of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial numbers start from the next data page of the second data page. N is greater than or equal to 1. In a sequential scan, the node device acquires the data pages in sequence according to the data page order, and stores the N data pages after the currently processed second data page as pre-fetched data pages in advance to the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to acquire the data page from the node device through network IO, without loading the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0024] In another possible implementation, the second data page can be a data page held by the first node device; the prefetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page. In a hot scenario, the frequently accessed held data page is preloaded into the local memory of the node device as a prefetched data page. When subsequently acquiring the hot data page, the node device only needs to obtain the data page from the node device via network IO, without having to load the data page from disk. It can even directly hit the local memory. Therefore, it can effectively reduce disk IO or network IO in cluster queries and shorten query time.

[0025] In another possible implementation, when the pre-fetch condition indicates that the second data page is a hot data page, the pre-fetch condition may include: within a preset time period, the number of times the second data page is fetched is greater than or equal to a first threshold; or within the preset time period, the proportion of the number of times the second data page is fetched to the total number of times data pages are fetched is greater than or equal to a second threshold.

[0026] In another possible implementation, the second node device is M node devices in the database cluster, excluding the first node device, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1. In this implementation, M node devices in the database cluster, excluding the first node device, prefetch the first data page. The number of M can be configured based on actual needs. A larger number of M can effectively reduce network I / O or disk I / O, shortening query time.

[0027] In another possible implementation, the second data page is a data page to be acquired by the first node device, and M is 1.

[0028] In another possible implementation, the second data page is a data page held by the first node device, and M is the total number of node devices in the database cluster minus 1, that is, the second node device is all node devices in the database cluster except the first node device.

[0029] In a third aspect, a device for obtaining a data page is provided, which can be deployed on a control node device in a database cluster. The device may include: a receiving unit and a processing unit.

[0030] A receiving unit is configured to receive a prefetch request from a first node device in a database cluster. The prefetch request is sent by the first node device under prefetch conditions and includes an identifier of a first data page. The first data page is a prefetched data page corresponding to a second data page currently being processed by the first node device. The first node device is any node device in the database cluster.

[0031] The processing unit is configured to control a second node device to hold the first data page, wherein the second node device is different from the first node device.

[0032] In a possible implementation, the second data page may be a data page to be acquired by the first node device. Accordingly, the above-mentioned pre-fetching conditions may include: the second data page is not hit in the local memory of the first node device, and it is a sequential scan. The first data page includes: in the data page sequence of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial numbers start from the next data page of the second data page. N is greater than or equal to 1. In a sequential scan, the node device acquires the data pages in sequence according to the data page order, and stores the N data pages after the currently processed second data page as pre-fetched data pages in advance to the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to acquire the data page from the node device through network IO, without loading the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0033] In another possible implementation, the second data page can be a data page held by the first node device; the prefetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page. In a hot scenario, the frequently accessed held data page is preloaded into the local memory of the node device as a prefetched data page. When subsequently acquiring the hot data page, the node device only needs to obtain the data page from the node device via network IO, without having to load the data page from disk. It can even directly hit the local memory. Therefore, it can effectively reduce disk IO or network IO in cluster queries and shorten query time.

[0034] In another possible implementation, when the pre-fetch condition indicates that the second data page is a hot data page, the pre-fetch condition may include: within a preset time period, the number of times the second data page is fetched is greater than or equal to a first threshold; or within the preset time period, the proportion of the number of times the second data page is fetched to the total number of times data pages are fetched is greater than or equal to a second threshold.

[0035] In another possible implementation, the second node device is M node devices in the database cluster, excluding the first node device, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1. In this implementation, M node devices in the database cluster, excluding the first node device, prefetch the first data page. The number of M can be configured based on actual needs. A larger number of M can effectively reduce network I / O or disk I / O, shortening query time.

[0036] In another possible implementation, the second data page is a data page to be acquired by the first node device, and M is 1.

[0037] In another possible implementation, the second data page is a data page held by the first node device, and M is the total number of node devices in the database cluster minus 1, that is, the second node device is all node devices in the database cluster except the first node device.

[0038] In another possible implementation, the processing unit is specifically configured to: if the second node device does not hold the first data page, control the second node to obtain and hold the first data page.

[0039] In another possible implementation, the processing unit is specifically configured to: if the second node device does not hold the first data page and the number of data pages held by the second node device is less than a third threshold, control the second node to obtain and hold the first data page.

[0040] In another possible implementation, controlling the second node to obtain and hold the first data page can be specifically implemented by sending a prefetch message including an identifier of the first data page to the second node device, so that the second node device loads the first data page from other node devices or a disk.

[0041] It should be noted that the device provided in the third aspect is used to execute the method provided in the above-mentioned first aspect or any possible implementation of the first aspect, and the specific implementation will not be repeated here.

[0042] In a fourth aspect, another apparatus for obtaining a data page is provided, which can be deployed on a first node device in a database cluster. The apparatus may include: a determining unit and a sending unit.

[0043] A determination unit is configured to determine a prefetch request under a prefetch condition. The prefetch request includes an identifier of a first data page, and the prefetch request is configured to indicate that a second node device in the database cluster holds the first data page. The second node device is different from the first node device. The first data page is a prefetched data page corresponding to a second data page currently being processed by the first node device. There are one or more first data pages.

[0044] The sending unit is used to send a pre-fetch request to a control node device of the database cluster.

[0045] In a possible implementation, the second data page may be a data page to be acquired by the first node device. Accordingly, the above-mentioned pre-fetching conditions may include: the second data page is not hit in the local memory of the first node device, and it is a sequential scan. The first data page includes: in the data page sequence of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial numbers start from the next data page of the second data page. N is greater than or equal to 1. In a sequential scan, the node device acquires the data pages in sequence according to the data page order, and stores the N data pages after the currently processed second data page as pre-fetched data pages in advance to the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to acquire the data page from the node device through network IO, without loading the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0046] In another possible implementation, the second data page can be a data page held by the first node device; the prefetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page. In a hot scenario, the frequently accessed held data page is preloaded into the local memory of the node device as a prefetched data page. When subsequently acquiring the hot data page, the node device only needs to obtain the data page from the node device via network IO, without having to load the data page from disk. It can even directly hit the local memory. Therefore, it can effectively reduce disk IO or network IO in cluster queries and shorten query time.

[0047] In another possible implementation, when the pre-fetch condition indicates that the second data page is a hot data page, the pre-fetch condition may include: within a preset time period, the number of times the second data page is fetched is greater than or equal to a first threshold; or within the preset time period, the proportion of the number of times the second data page is fetched to the total number of times data pages are fetched is greater than or equal to a second threshold.

[0048] In another possible implementation, the second node device is M node devices in the database cluster, excluding the first node device, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1. In this implementation, M node devices in the database cluster, excluding the first node device, prefetch the first data page. The number of M can be configured based on actual needs. A larger number of M can effectively reduce network I / O or disk I / O, shortening query time.

[0049] In another possible implementation, the second data page is a data page to be acquired by the first node device, and M is 1.

[0050] In another possible implementation, the second data page is a data page held by the first node device, and M is the total number of node devices in the database cluster minus 1, that is, the second node device is all node devices in the database cluster except the first node device.

[0051] It should be noted that the device provided in the fourth aspect is used to execute the method provided in the above-mentioned second aspect or any possible implementation of the second aspect, and the specific implementation will not be repeated here.

[0052] In a fifth aspect, a node device is provided, which includes a memory and at least one processor, the memory being used to store a set of computer instructions; when the processor executes the set of computer instructions as a control node device in the first aspect or any possible implementation of the first aspect, it executes the operating steps of the method described as a scheduler in the first aspect or any possible implementation of the first aspect.

[0053] In the sixth aspect, another node device is provided, which includes a memory and at least one processor, the memory being used to store a set of computer instructions; when the processor executes the set of computer instructions as the first node device in the second aspect or any possible implementation of the second aspect, it executes the operating steps of the method described as the scheduler in the second aspect or any possible implementation of the second aspect.

[0054] In the seventh aspect, a database cluster system is provided, which includes a control node device and multiple slave node devices, the control node device is used to execute the operating steps of the method described in the first aspect or any possible implementation of the first aspect, and the slave node device is used to execute the operating steps of the method described in the second aspect or any possible implementation of the second aspect.

[0055] In an eighth aspect, a computer-readable storage medium is provided, comprising: computer software instructions; when the computer software instructions are executed in a node device in a database cluster, the node device executes the operating steps of the method described in the first aspect or the second aspect or any one of the above possible implementations.

[0056] In a ninth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the operating steps of the method described in the first aspect or the second aspect or any possible implementation manner described above.

[0057] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] FIG1 is a schematic diagram of the architecture of a distributed memory management system DMS;

[0059] FIG2 is a flow chart of a method for obtaining a data page;

[0060] FIG3 is a schematic diagram of the structure of a node device provided in an embodiment of the present application;

[0061] FIG4 is a flow chart of a method for obtaining a data page according to an embodiment of the present application;

[0062] FIG5 is a flow chart of another method for obtaining a data page according to an embodiment of the present application;

[0063] FIG6 is a flow chart of another method for obtaining a data page according to an embodiment of the present application;

[0064] FIG7 is a flow chart of another method for obtaining a data page according to an embodiment of the present application;

[0065] FIG8 is a schematic structural diagram of an apparatus for obtaining a data page according to an embodiment of the present application;

[0066] FIG9 is a schematic structural diagram of another apparatus for acquiring a data page provided in an embodiment of the present application;

[0067] FIG10 is a schematic diagram of the structure of another node device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] To facilitate understanding, the terms involved in the embodiments of this application are first explained.

[0069] Prefetching: refers to fetching data into the local memory of a node before actually requesting the data.

[0070] Data page: refers to the smallest data storage unit defined by the database. For example, the size of a data page can be 8 kilobytes (KB).

[0071] Sequential scan: refers to the data scanning method used by the database during the query process, which is based on the order of data page numbers.

[0072] Hot data pages: These are data pages that are frequently accessed within a certain timeframe. In actual applications, you can configure the access frequency of hot data pages based on actual needs.

[0073] The control node (Master node) is a node device that logically plays a control role in the DMS system. The Master node is used to manage the distribution of data pages in the cluster across all nodes in the cluster. For example, any physical node in the cluster can serve as a Master node.

[0074] The distributed resource catalog (DRC) is used to record the distribution of data pages across all nodes in the cluster. The distribution of data pages across all nodes in the cluster reflects the local memory of the node devices in which the data pages are distributed. In other words, it records which data pages are stored (held) in the local memory of each node device. The DRC can be in the form of a hash table. Of course, the form of the DRC can also be configured according to actual needs, which is not limited by this application.

[0075] Local memory hit: refers to the data page being stored in local memory.

[0076] The node device holds the data page: this means that the data page is stored in the local memory of the node device.

[0077] The DMS (memory pooling) system architecture is shown in Figure 1. Nodes in a cluster have local memory, which is accessible across nodes via a high-speed network. Each node also shares underlying disks via a storage area network. In the DMS architecture, upper-layer services can send read and write requests to any node in the cluster.

[0078] In a database cluster with a memory pooling architecture, when an upper-layer service sends a read or write request to a node device, the node device must retrieve the data page related to the read or write request and store it in local memory to complete the read or write needs of the upper-layer service. The process of a node device in the cluster (for example, node device 1) retrieving a data page (for example, data page A) can be shown in Figure 2, including the following steps:

[0079] Step 1: Node device 1 searches the local memory for data page A.

[0080] If data page A already exists in the local memory, data page A is fed back to the upper layer business.

[0081] If data page A does not exist in the local memory, execute step 2 to further obtain data page A and store it in the local memory.

[0082] Step 2: Node device 1 sends a request message for obtaining data page A to the control node device.

[0083] Step 3: After receiving the request message, the control node device queries whether data page A exists in the DRC.

[0084] That is, in step 3, the control node device queries whether there is a node device in the cluster that has stored data page A in its local memory.

[0085] Specifically, if data page A does not exist in the DRC, it means that no node device in the cluster has data page A stored in its local memory, so node device 1 needs to load data page A from the disk, control the node device to execute step 4, and return a message that it needs to be loaded from the disk to node device 1.

[0086] If data page A exists in the DRC, it means that data page A is already stored in the local memory of another node device in the cluster. Data page A can be transferred to node device 1 via the high-speed network between nodes. Assuming that data page A is already stored in the local memory of node device 2 in the cluster, the control node device executes step 5.

[0087] Step 4: The control node device sends a response message to node device 1 indicating that the data page needs to be loaded from the disk.

[0088] The response message indicating that the data page needs to be loaded from the disk is used to instruct the node device 1 to load and obtain the data page A from the disk.

[0089] Step 5: The control node device sends a transfer request to node device 2.

[0090] The transfer request includes the identifier of data page A and the identifier of node device 1 , and is used to instruct node device 2 to send data page A to node device 1 .

[0091] Step 6: After receiving the transfer request, node device 2 sends data page A to node device 1.

[0092] Step 7: Node device 1 performs differentiated processing based on the received message to obtain data page A and store it in the local disk.

[0093] If the node device 1 receives the response message through the above step 4, the node device 1 loads and obtains the data page A from the disk through the storage area network.

[0094] If node device 1 receives the message carrying data page A sent by node device 2 through step 6 above, data page A is directly obtained from the message.

[0095] Step 8: Node device 1 sends an update message to the control node device.

[0096] Among them, the update message is used to indicate that node device 1 holding data page A is added in DRC. After the control node device receives the update message, it updates the current node information of data page A in DRC and adds the identifier of node device 1 to the current node information of data page A in DRC.

[0097] Exemplarily, the update message may include the identifier of the node device 1 and the identifier of the data page A.

[0098] Step 9: Node device 1 returns data page A to the upper layer.

[0099] From the process of obtaining data pages described in Figure 2 above, it can be seen that when a node device obtains a data page according to business needs, if the local memory does not hit, it is necessary to obtain the data page from other node devices through network IO (data pages are transmitted between nodes in the cluster through a high-speed network) or load the data page from the disk through disk IO (nodes in the cluster load data pages from the disk through the storage LAN).

[0100] When a node device serially retrieves different data pages multiple times, the node device needs to frequently perform IO operations (network IO or disk IO). Alternatively, in scenarios where hot services are frequently accessed, different node devices frequently access the same data pages. However, if the hot data pages are only distributed in the local memory of individual node devices, more node devices need to obtain the hot data pages from individual node devices through network IO. In both scenarios, IO operations are required to obtain data pages, which takes a long time to query the database cluster, limiting the business query performance of the database cluster.

[0101] However, in the business query scenario of a database cluster, the data pages to be read can be determined in advance based on the current business situation. In this way, the resources of idle node devices in the cluster (memory resources or central processing unit (CPU) resources) can be utilized to store the data pages to be read in the local memory of the node device before actually reading the data pages, reducing the number of IO operations when actually reading the data pages, shortening the query time of the database cluster, and improving the business query performance of the database cluster.

[0102] Based on this, the present application provides a method and related equipment for obtaining data pages, which is configured to indicate a prefetching condition for determining the prefetched data page. Under the prefetching condition, the control node controls other node devices in the cluster to prefetch the first data page, and the first data page is the prefetched data page corresponding to the second data page currently processed by the node device. In this way, under the prefetching condition (the data page to be read can be judged), it is ensured that the first data page corresponding to the second data page currently processed is stored in the local memory of the second node device, making full use of the memory sharing characteristics of each node in the memory pooling cluster. When the second node device reads the first data page, it can hit the local memory without IO. When other node devices read the first data page, they can use network IO without disk IO, thereby reducing the disk IO or network IO for the next data page acquisition, thereby shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0103] For example, in the scenario of sequential scanning of a database cluster, after node device 1 obtains data page A, the next request must be to obtain data page A+1. If data page A+1 does not exist in the local memory of any node device in the cluster, then node device 1 needs to load A+1 from the disk. In the process of obtaining data pages (data page A and data page A+1) in series for two times, the memory or CPU resources of other node devices in the cluster are idle and not fully utilized, but node device 1 does need multiple disk IO operations to obtain data pages. In this scenario, through the solution provided by this application, when node device A obtains data page A, it can request the control node to control other node devices in the cluster to obtain data page A+1 and store it in local memory. When node device 1 needs to obtain data page A+1, it only needs to perform network IO without disk IO, which can shorten the query time of the database cluster.

[0104] For example, in a scenario where hot services are frequently accessed, if data page A held in the local memory of node device 1 is frequently accessed, when node device 2 receives a request to obtain data page A, it needs to transfer data page A from node device 1 to the local memory of node device 2 via network IO. In this scenario, through the solution provided by this application, when data page A is frequently accessed on node device 1, it can be determined that data page A is hot data and is likely to be accessed simultaneously on other nodes. The control node can be requested to control other node devices in the cluster to obtain data page A and store it in local memory. When other node devices need to obtain data page A, they can obtain it locally without performing IO, which can shorten the query time of the database cluster.

[0105] The solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0106] The solution provided in this application can be applied to the DMS architecture shown in FIG1 .

[0107] The node device shown in FIG1 mainly provides the operations of reading and writing business data, and can be a server, a physical machine, or other product forms.

[0108] The shared storage shown in Figure 1 mainly provides data storage and sharing functions. The shared storage can be a hard disk, a disk array (centralized or distributed), or other product forms.

[0109] In one aspect, an embodiment of the present application provides a node device 30. FIG3 is a schematic diagram of the structure of the node device 30. The node device 30 may be any of the node devices shown in FIG1.

[0110] 3 , the node device 30 may include a processor 310 , a bus 320 , a memory 330 , and a communication interface 340 . The processor 310 , the memory 330 , and the communication interface 340 are connected via the bus 320 .

[0111] It should be understood that in this embodiment, the processor 310 may be a CPU, but may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] The processor 310 may also be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present application.

[0113] The communication interface 340 is used to implement communication between the node device 30 and external devices or components.

[0114] The bus 320 may include a path for transmitting information between the above-mentioned components (such as the processor 310 and the memory 330). In addition to the data bus, the bus 320 may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 320 in the figure. The bus 320 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 320 can be divided into an address bus, a data bus, a control bus, etc.

[0115] As an example, node device 30 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).

[0116] It is worth noting that FIG3 only takes the node device 30 including 1 processor 310 and 1 memory 330 as an example. Here, the processor 310 and the memory 330 are respectively used to indicate a type of device or equipment. In a specific embodiment, the number of each type of device or equipment can be determined according to business requirements.

[0117] Memory 330 may be a volatile memory pool or a non-volatile memory pool, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may be 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 random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0118] Exemplarily, the processor 310 may perform the following functions by running or executing software programs and / or modules stored in the memory 330:

[0119] A prefetch request is received from a first node device in a database cluster. The prefetch request is sent by the first node device under prefetch conditions and includes an identifier of a first data page. A second node device is controlled to hold the first data page. The first data page is a prefetched data page corresponding to the second data page. The first node device is any node device in the database cluster. The second node device is different from the first node device.

[0120] Exemplarily, the processor 310 may perform the following functions by running or executing software programs and / or modules stored in the memory 330:

[0121] Under prefetch conditions, a prefetch request is sent to a control node device of a database cluster. The prefetch request includes an identifier of a first data page. The prefetch request is used to indicate that a second node device in the database cluster holds the first data page, where the first data page is a prefetched data page corresponding to the second data page. The second node device is different from the first node device. There are one or more first data pages.

[0122] On the other hand, an embodiment of the present application provides a method for obtaining a data page, which is applied to a process in which a node device in a database cluster obtains a data page.

[0123] It should be noted that the process for each node device in the database cluster to obtain a data page is the same, and the process for a node device to obtain different data pages is also the same. The following embodiments of this application use the process of processing a second data page during the interaction between a first node device and a control node device as an example, and do not constitute a specific limitation. The first node device can be any node device in the database cluster.

[0124] As shown in FIG4 , the method for obtaining a data page provided in an embodiment of the present application may include:

[0125] S401: Under a prefetch condition, a first node device sends a prefetch request to a control node device of a database cluster.

[0126] The above-mentioned pre-fetching condition is used to indicate a scenario in which the data page to be read can be determined. The content of the condition can be configured according to actual needs and is not limited in the embodiment of the present application.

[0127] Specifically, the first data page is a pre-fetched data page corresponding to the second data page, and there may be one or more first data pages.

[0128] It should be noted that when the state of the second data page is different, the content of the pre-fetch condition is different; when the content of the pre-fetch condition is different, the first data page corresponding to the second data page is also different.

[0129] In one possible implementation, the second data page is the data page to be retrieved by the first node device, that is, the second data page corresponds to the read / write request sent by the upper-layer service. Accordingly, the prefetch condition may include condition 1, which states: the second data page is not found in the local memory of the first node device, and the scan is sequential. The first data page may include: a data page not held by the first node device, among N consecutive data pages in the data page sequence of the database cluster, starting with the data page immediately following the second data page, where N is greater than or equal to 1.

[0130] Specifically, in a sequential scan scenario, when the first node device receives a read / write request to obtain the second data page, it will inevitably sequentially obtain the next data page of the second data page in the data page sequence of the database cluster. At this time, the N consecutive data pages in the data page sequence of the database cluster starting from the next data page of the second data page can be used as pre-fetched data pages. Then, the local memory is queried to determine which of the N consecutive data pages starting from the next data page of the second data page hit the local memory (i.e., stored in the local memory). The data page of the N consecutive data pages starting from the next data page of the second data page that does not hit the local memory is used as the first data page.

[0131] The value of N can be determined according to actual needs and is not limited in this embodiment of the present application.

[0132] Exemplarily, N can be total blocks*X. Here, total blocks represents the total number of file pages, and X represents the prefetch range ratio (which can be expressed as a percentage). X can be determined based on actual needs. The larger X is, the larger the prefetch range is. Since the total resources in the cluster (the sum of the memory resources of all nodes) are fixed, the number of prefetches is not necessarily more. The prefetch range can be adjusted according to actual business needs, and this is not limited in the embodiments of the present application.

[0133] In this implementation, after receiving the read / write request for obtaining the second data page, the first node device can determine whether the pre-fetch condition is currently met. If so, execute S401; otherwise, obtain the second data page according to the process of obtaining data pages shown in FIG. 2 .

[0134] In another possible implementation, the second data page is a data page held by the first node device. Accordingly, the above pre-fetch condition includes condition 2, which is used to indicate that the second data page is a hot data page. The first data page is the second data page.

[0135] For example, the above condition 2 may include: within a preset time period, the number of times the second data page is obtained is greater than or equal to a first threshold. The length of the preset time period and the value of the first threshold may be configured according to actual needs and are not limited in this embodiment of the application.

[0136] For example, the above condition 2 may include: within a preset time period, the proportion of the number of times the second data page is acquired to the total number of times the data page is acquired is greater than or equal to a second threshold. The length of the preset time period and the value of the second threshold can be configured according to actual needs and are not limited in this embodiment of the application.

[0137] In this implementation, the first node device periodically determines whether the current scene meets the pre-fetching condition. If so, it executes S401. Otherwise, the process ends and the next period determines whether the current scene meets the pre-fetching condition again. The interval of this period can be configured according to actual needs and is not limited in this embodiment of the application.

[0138] Furthermore, the pre-fetch request includes an identifier of the first data page, and the pre-fetch request is used to indicate that the second node device in the database cluster holds the first data page.

[0139] The identifier of the first data page is used to uniquely indicate the first data page, and the embodiment of the present application does not limit the specific content and form of the identifier.

[0140] Specifically, the second node device is different from the first node device. The second node device is M node devices in the database cluster other than the first node device, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1.

[0141] In one possible implementation, the second node device is a node device other than the first node device in the database cluster, and the second node device is determined by the control node device. That is, a node device in the cluster pre-fetches the first data page to reduce disk IO for query services in the cluster.

[0142] Exemplarily, when the pre-fetching condition is condition 1, the second node device is a node device other than the first node device in the database cluster.

[0143] In one possible implementation, the second node device is each node device in the database cluster except the first node device. That is, each node device in the cluster pre-fetches the first data page to reduce disk IO and network IO for query services in the cluster.

[0144] Exemplarily, when the pre-fetch condition is condition 2, the second node device may be each node device in the database cluster except the first node device.

[0145] In one possible implementation, the second node devices are part of the database cluster, excluding the first node devices. The number of second node devices is determined by the control node device. That is, some node devices in the cluster prefetch the first data page to reduce disk I / O and network I / O for query services in the cluster.

[0146] S402: The control node device receives a pre-fetch request from a first node device in the database cluster.

[0147] It should be noted that the pre-fetch request received by the control node device in S402 is the pre-fetch request sent by the first node device in S401, which will not be described in detail here.

[0148] Furthermore, in S402 , after receiving the pre-fetch request, the control node device first determines the second node device, and then determines whether the second node device holds the first data page.

[0149] In a possible implementation, the second node device is a node device other than the first node device in the database cluster. The node device other than the first node device in the database cluster holding the least number of data pages is determined as the second node device.

[0150] In another possible implementation, the second node devices are all node devices in the database cluster except the first node device, and all node devices in the database cluster except the first node device are determined as the second node devices.

[0151] In another possible implementation, the second node device is some node devices in the database cluster other than the first node device. If the number of second node devices is fixed to Y, then Y node devices in the database cluster other than the first node device, holding data pages from small to large, are determined as second node devices.

[0152] In another possible implementation, the second node device is some node devices in the database cluster other than the first node device. If the number of second node devices is dynamic, according to the mechanism for determining the number of second node devices, the number Z of second node devices is first determined, and then the Z node devices in the database cluster other than the first node device, holding the smallest to largest number of data pages, are determined as second node devices.

[0153] The mechanism for determining the number of second node devices may be based on business volume or business scenarios. Of course, the mechanism for determining the number of second node devices may be configured according to actual needs, and this embodiment of the application is not limited thereto.

[0154] S403: The control node device controls the second node device to hold the first data page.

[0155] Specifically, in S403, the control node device controls the second node device to hold the first data page. This can be specifically implemented as follows: the control node device determines whether each second node device holds the first data page; the control node device sends a prefetch request to the second node device that does not hold the first data page, where the prefetch request includes an identifier of the first data page, so that after receiving the prefetch request, the second node device obtains and holds the first data page through the data page acquisition process illustrated in FIG2. For the second node device that already holds the first data page, the process can be terminated.

[0156] It should be noted that the control node device executes the process of S403 for each second node device respectively, and the process is the same.

[0157] Furthermore, when an upper limit is set for the number of data pages held by node devices in the cluster, S403 can be specifically implemented as follows: if the second node device does not hold the first data page, and the number of data pages held by the second node device is less than a third threshold, control the second node to obtain and hold the first data page.

[0158] Among them, the third threshold is the upper limit of the number of data pages held by the node device, which can be configured according to actual needs. The implementation of this application does not limit the value of the third threshold.

[0159] Through the method for obtaining data pages provided by the present application, under the pre-fetch condition (the data page to be read can be determined), it is ensured that the first data page corresponding to the second data page is stored in the local memory of the second node device, and the memory sharing characteristics of each node in the memory pooling cluster are fully utilized. When the second node device reads the first data page, it can hit the local memory without IO. When other node devices read the first data page, network IO can be used without disk IO, thereby reducing the disk IO or network IO for obtaining the data page next time, thereby shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0160] Furthermore, as shown in FIG5 , the method for obtaining a data page provided in the embodiment of the present application may further include S404 .

[0161] S404: The control node device updates data page distribution information.

[0162] The data page distribution information is used to record the distribution of data pages across all nodes in the cluster.

[0163] Illustratively, the data page distribution information may be the aforementioned DRC.

[0164] Specifically, in S404, the control node device may receive an update message sent by the node device. The update message is sent by the node device holding the changed data page. The update message carries the identifier of the data page. The control node device updates the data page distribution information according to the update message. This embodiment of the application does not elaborate on this update process.

[0165] The solution provided in this application is described in detail below through specific examples.

[0166] Example 1: For a sequential scan scenario of a database cluster, taking the interaction process between physical node device 1, physical node device 2, and logical node device (control node device) as an example, the method for obtaining a data page provided by an embodiment of the present application is described. As shown in FIG6 , the method may specifically include:

[0167] S601: Node device 1 enters the process of obtaining data page A, and first determines whether data page A exists in the local memory.

[0168] If it is determined in S601 that data page A exists in the local memory of node device 1, data page A is returned to the upper layer application after a hit.

[0169] If it is determined in S601 that data page A does not exist in the local memory of node device 1, execute S602.

[0170] S602: Node device 1 determines whether the current scenario is a sequential scanning scenario.

[0171] If it is determined in S602 that the scenario is not a sequential scan scenario, then the process of obtaining data pages shown in FIG2 is followed to obtain data page A without executing other steps.

[0172] If it is determined in S602 that the scenario is a sequential scan scenario, then according to the process of obtaining data pages shown in FIG2 , data page A is obtained and S603 is executed at the same time.

[0173] S603 , node device 1 determines whether the data pages with page numbers (A+1) to (A+X) are in the local memory, and determines whether there is a pre-fetched first data page.

[0174] Among them, X can be configured according to actual needs.

[0175] If it is determined in S603 that the data pages with page numbers (A+1) to (A+X) are all in the local memory, the pre-fetch logic ends.

[0176] If it is determined in S603 that there are data pages in the data pages with page numbers (A+1) to (A+X) that are not in the local memory, these data pages are used as the first data pages to be prefetched, and S604 is executed.

[0177] S604: Node device 1 sends a pre-fetch request to the control node device, where the pre-fetch request includes an identifier of the first data page.

[0178] In a possible implementation, the pre-fetch request may include identifiers of all first data pages.

[0179] In another possible implementation, the pre-fetch request may include an identifier of a first data page. When there are multiple first data pages, multiple pre-fetch requests may be sent.

[0180] Assuming that, in S603, it is determined that among the data pages with page numbers (A+1) to (A+X), the data pages with page numbers (A+1) and (A+2) are not in the local memory, then the prefetch request sent in S604 includes page numbers (A+1) and (A+2), and the prefetch request is used to instruct the control node device to control other node devices to hold the data pages with page numbers (A+1) and (A+2).

[0181] S605: After receiving the pre-fetch request, the control node device sequentially determines whether each first data page exists in the DRC.

[0182] When a page exists in the DRC, it indicates that a node device holds the page.

[0183] The steps after S605 are the same for each first data page, and the subsequent steps are described by taking the first data page as data page (A+1) as an example.

[0184] If it is determined in S605 that the data page (A+1) exists in the DRC, the pre-fetch process for the data page (A+1) is terminated.

[0185] If it is determined in S605 that the data page (A+1) does not exist in the DRC, S606 is executed to continue the pre-fetch process of the data page (A+1).

[0186] S606: The control node device selects a node that currently holds the least number of data pages, which is not node device 1, and sends an acquisition request.

[0187] For example, assuming that the control node device selected in S606 is node device 2, an acquisition request is sent to node device 2, including an identifier of data page (A+1), to instruct node device 2 to acquire and hold data page (A+1).

[0188] S607 , after receiving the acquisition request for data page (A+1), node device 2 acquires data page (A+1) according to the process of acquiring data page shown in FIG2 , and the pre-fetch process of data page (A+1) ends.

[0189] S608. Node device 2 sends an update message to the control node device. The update message includes the identifier of data page (A+1).

[0190] The update message sent by the node device 2 in S608 is used to instruct the control node device to update the DRC. In the updated DRC, the node device 2 holds the data page (A+1) included in the update message.

[0191] S609: The control node device updates the DRC according to the update message.

[0192] It should be noted that the control node device executes the processes from S605 to S609 for each first data page in the pre-fetch request, and details thereof will not be described in detail.

[0193] Through this example 1, while node device 1 is acquiring page A, the cluster pre-fetches data pages (A+1) to (A+X) into the local memory of the designated node in the cluster. Due to the sequential scanning scenario, the next data page acquired by the business request on node device 1 must be data page (A+1). When node device 1 acquires data page (A+1), because data page (A+1) already exists in the local memory of other nodes in the cluster, it can be transferred to node device 1 via network IO without having to be acquired from the disk via disk IO. In actual applications, the idle ratio of network IO is higher than that of disk IO, so acquiring data pages through the network will be faster, shortening the time taken for business queries in the database cluster and improving the performance of business queries.

[0194] Example 2: For hot data access scenarios, taking the interaction process of a physical node device (node ​​device 1, target node device) and a logical node device (control node device) as an example, the method for obtaining a data page provided by an embodiment of the present application is described, as shown in FIG7 , which may specifically include:

[0195] S701: Node device 1 has a resident background service thread that periodically scans data pages in the local memory.

[0196] S702: Node device 1 obtains the hotspot data page that meets the hotspot condition in the current memory by scanning.

[0197] Among them, the hotspot condition can be the above-mentioned condition 2, which will not be repeated here.

[0198] If no data page meets the hotspot condition in S702 , the pre-fetch process ends.

[0199] If there is a data page that meets the hotspot condition in S702, S703 is executed.

[0200] S703: Node device 1 sends a pre-fetch request to the control node device, where the pre-fetch request includes an identifier of the hot data page.

[0201] In a possible implementation, the pre-fetch request may include identifiers of all hot data pages.

[0202] In another possible implementation, the pre-fetch request may include an identifier of a hot data page. When there are multiple hot data pages, multiple pre-fetch requests may be sent.

[0203] S704: After receiving the pre-fetch request, the control node device sequentially determines the distribution of each hot data page in the DRC.

[0204] The steps after S704 are the same for each hot data page. The subsequent steps are described by taking the hot data page H as an example.

[0205] If it is determined in S704 that the data page H exists in every node device in the DRC, the pre-fetching process for the data page H is terminated.

[0206] If it is determined in S704 that the data page H does not exist in some node devices in the DRC, the node device that does not hold the data page H is used as the target node device, and S705 is executed to continue the pre-fetching process of the data page H.

[0207] S705: The control node device determines whether the number of data pages currently held by the target node device is less than a threshold L.

[0208] For a target node device whose number of currently held data pages is greater than or equal to the threshold L, no further operation is performed and no data page H needs to be pre-fetched.

[0209] For a target node device whose number of currently held data pages is less than the threshold L, S706 is executed to continue the pre-fetching process of data page H.

[0210] S706: The control node device sends an acquisition request to the target node device whose number of data pages currently held is less than the threshold L.

[0211] The acquisition request includes the identifier of the data page H to instruct the target node device to acquire and hold the data page H.

[0212] S707 : After receiving the acquisition request for data page H, the target node device acquires data page H according to the process of acquiring data page shown in FIG. 2 .

[0213] S708: The target node device sends an update message to the control node device. The update message includes the identifier of the data page H.

[0214] The update message sent by the target node device in S708 is used to instruct the control node device to update the DRC. In the updated DRC, the target node device holds the data page H included in the update message.

[0215] S709: The control node device updates the DRC according to the update message.

[0216] It should be noted that the processes from S706 to S709 are respectively executed for each target node device, and the control node device respectively executes the processes from S704 to S709 for each hot data page in the prefetch request, which will not be described in detail.

[0217] Through Example 2, hot data pages are regularly distributed to all node devices through transfer, thereby speeding up access to hot data pages on each node device. When the upper-layer business requests the same hot data page on other node devices, it can be directly hit in the local memory without having to be transferred from node 1 through network IO, reducing the network IO transmission of the original process.

[0218] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the working principle of the node device in the database cluster. It can be understood that in order to realize the above functions, the node device, etc. includes a hardware structure and / or software module corresponding to the execution of each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 to exceed the scope of the present invention.

[0219] In the embodiments of the present invention, node devices, etc., can be divided into functional modules according to the above-mentioned method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into a single processing module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the module division in the embodiments of the present invention is schematic and is only a logical functional division. In actual implementation, other division methods may be used.

[0220] In the case of dividing each functional module into corresponding functional modules, Figure 8 illustrates a device for obtaining a data page provided by an embodiment of the present application, which is used to implement the function of controlling the node device in the above embodiment. As shown in Figure 8, the device 80 for obtaining a data page may include: a receiving unit 801 and a processing unit 802. The receiving unit 801 is used to execute the process S402 in Figure 4 or Figure 5; the processing unit 802 is used to execute the process S403 in Figure 4 or Figure 5. Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0221] In the case of dividing each functional module into corresponding functional modules, Figure 9 illustrates another device for obtaining a data page provided by an embodiment of the present application, which is used to implement the function of the first node device in the above embodiment. As shown in Figure 9, the device 90 for obtaining a data page may include: a determination unit 901 and a sending unit 902. The determination unit 901 is used to determine a prefetch request under a prefetch condition. The sending unit 902 is used to execute process S401 in Figure 4 or Figure 5. Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0222] In the case of adopting an integrated unit, as shown in Figure 10, a node device 100 provided in an embodiment of the present application is used to implement the functions of the control node device or the first node device in the above-mentioned embodiment. The node device 100 includes a processing module 1001 and a communication module 1002. The processing module 1001 is used to control and manage the actions of the node device 100, and the communication module 1002 is used to communicate with other devices. For example, the processing module 1001 is used to execute the process S403 in Figure 4 or Figure 5; the communication module 1002 is used to execute the process S401 or S402 in Figure 4 or Figure 5. The node device 100 may also include a storage module 1003 for storing the program code and data of the node device 100.

[0223] The processing module 1001 may be the processor 310 in the physical structure of the node device 30 shown in FIG3 , and may be a processor or controller. For example, it may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processing module 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The communication module 1002 may be the communication interface 340 in the physical structure of the node device 30 shown in FIG3 . The communication module 1002 may be a communication port, or may be a transceiver, a transceiver circuit, or a communication interface. Alternatively, the communication interface may communicate with other devices through the aforementioned transceiver components. The transceiver components may be implemented by antennas and / or radio frequency devices. The storage module 1003 may be the memory 330 in the physical structure of the node device 30 shown in FIG3 .

[0224] As mentioned above, the device 80 or node device 100 for obtaining data pages in the storage device provided in the embodiment of the present application can be used to implement the function of controlling the node device in the above embodiment of the present application, and the device 90 or node device 100 for obtaining data pages in the storage device provided in the embodiment of the present application can be used to implement the function of the first node device in the above embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the embodiments of the present application.

[0225] The present application also provides a database cluster system, which includes a control node device and multiple slave node devices. The control node device can be the above-mentioned device for obtaining data pages 80 or node device 100. The slave node device can be the above-mentioned device for obtaining data pages 90 or node device 100.

[0226] As another form of this embodiment, a computer-readable storage medium is provided, on which computer software instructions are stored. When the computer software instructions are executed, the method for obtaining a data page in the above method embodiment is performed.

[0227] As another form of this embodiment, a computer program product containing instructions is provided. When the computer program product is run on a computer, the computer is caused to execute the method for obtaining a data page in the above method embodiment.

[0228] The embodiment of the present application further provides a chip system, which includes a processor for implementing the technical method of the embodiment of the present application. In one possible design, the chip system also includes a memory for storing the necessary program instructions and / or data of the embodiment of the present invention. In one possible design, the chip system also includes a memory for the processor to call the application code stored in the memory. The chip system can be composed of one or more chips, or can include chips and other discrete devices, which is not specifically limited in the embodiment of the present application.

[0229] It is understood that in order to implement the functions in the above embodiments, the processor of the node device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily appreciate that, in combination with the units and method steps of the various examples described in the embodiments disclosed in this application, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a computer software-driven hardware manner depends on the specific application scenario and design constraints of the technical solution.

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

[0231] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions 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 obtaining a data page, characterized in that: Applied to a control node device in a database cluster, the method comprises: receiving a prefetch request from a first node device in the database cluster, wherein the prefetch request is sent by the first node device under a prefetch condition, and the prefetch request includes an identifier of a first data page; the first data page is a prefetch data page corresponding to a second data page currently processed by the first node device; the first node device is any node device in the database cluster; The second node device is controlled to hold the first data page; wherein the second node device is different from the first node device.

2. The method according to claim 1, characterized in that The second data page is a data page to be acquired by the first node device; The pre-fetch condition includes: the second data page is not hit in the local memory of the first node device, and is scanned sequentially; The first data page includes: in the data page sequence of the database cluster, a data page not held by the first node device among N consecutive data pages whose sequence number starts from the next data page of the second data page, where N is greater than or equal to 1.

3. The method according to claim 1, characterized in that: The second data page is a data page held by the first node device; the pre-fetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page.

4. The method according to claim 3, characterized in that The pre-fetching conditions include: Within a preset time period, the number of times the second data page is acquired is greater than or equal to a first threshold; or, Within a preset time period, a proportion of the number of times the second data page is acquired in the total number of times the data pages are acquired is greater than or equal to a second threshold.

5. The method according to any one of claims 1 to 4, characterized in that: The second node device is M node devices other than the first node device in the database cluster, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1.

6. The method according to any one of claims 1 to 5, characterized in that: The controlling the second node device to hold the first data page includes: If the second node device does not hold the first data page, control the second node device to obtain and hold the first data page.

7. The method according to claim 6, characterized in that If the second node device in the database cluster does not hold the first data page, controlling the second node to obtain and hold the first data page includes: If the second node device does not hold the first data page, and the number of data pages held by the second node device is less than a third threshold, control the second node to obtain and hold the first data page.

8. A device for obtaining a data page, characterized in that: A control node device deployed in a database cluster, the device comprising: a receiving unit, configured to receive a prefetch request from a first node device in the database cluster, wherein the prefetch request is sent by the first node device under a prefetch condition, and the prefetch request includes an identifier of a first data page; the first data page is a prefetch data page corresponding to a second data page currently processed by the first node device; the first node device is any node device in the database cluster; A processing unit is used to control the second node device to obtain and hold the first data page.

9. The device according to claim 8, characterized in that The second data page is a data page to be acquired by the first node device; The pre-fetch condition includes: the second data page is not hit in the local memory of the first node device, and is scanned sequentially; The first data page includes: in the data page sequence of the database cluster, a data page not held by the first node device among N consecutive data pages whose sequence number starts from the next data page of the second data page, where N is greater than or equal to 1.

10. The device according to claim 8, characterized in that The second data page is a data page held by the first node device; the pre-fetch condition is used to indicate that the second data page is a hot data page; and the first data page is the second data page.

11. The device according to claim 10, characterized in that The pre-fetching conditions include: Within a preset time period, the second data page is acquired a number of times greater than or equal to a first threshold; or, Within a preset time period, a proportion of the number of times the second data page is acquired in the total number of times the data pages are acquired is greater than or equal to a second threshold.

12. The device according to any one of claims 8 to 11, characterized in that: The second node device is M node devices other than the first node device in the database cluster, where M is greater than or equal to 1 and less than or equal to the total number of node devices in the database cluster minus 1.

13. A node device, characterized in that: The node device includes a memory and at least one processor, wherein the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions, the operation steps of the method described in any one of claims 1 to 7 are performed.

14. A computer-readable storage medium, characterized in that: include: Computer software instructions; when the computer software instructions are executed in a computing device, the computing device is caused to execute the operation steps of the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data reading method, device and system

    CN104462225A

  • Data search method and device

    CN108205539A

  • System and method for improved prefetching

    US20060026386A1