Method for acquiring data page and related equipment

By controlling node devices 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, solving query performance problems caused by frequent IO operations and achieving faster data access.

CN118733620APending Publication Date: 2024-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310336479.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Frequent IO operations (disk IO or network IO) in existing database clusters increase the time 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 ensures that the data page to be read is stored in local memory, thereby reducing the IO operations during actual reading and utilizing memory pooling to pool the memory of the cluster. Shared features to avoid disk IO and network IO.

Benefits of technology

It shortens the query time of data pages in the database cluster, improves business query performance, and reduces disk IO and network IO operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733620A_ABST
    Figure CN118733620A_ABST
Patent Text Reader

Abstract

The invention discloses a method for acquiring a data page and related equipment, relates to the field of computers, and aims to shorten query time consumption of the data page in a database cluster and improve service query performance of the database cluster. The method comprises: receiving a prefetching request from a first node device in a database cluster, the prefetching request being sent by the first node device under a prefetching condition, the prefetching request comprising an identifier of a first data page; and controlling the second node device to hold 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 equipment. The first node equipment is any node equipment in the database cluster. The second node device is different from the first node device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] In order to improve the reliability and performance of databases, database clusters came into being. A database cluster refers to a cluster consisting of multiple physical machines with database applications installed, which jointly provide external services. A physical machine is a node in a database cluster and is called a node device.

[0003] Currently, the more popular database clusters use 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 interconnected network between node devices, the memory resources of each node device are shared. The memory between node devices in the entire cluster can access each other and share the underlying storage disk, which can achieve real-time consistency of data between nodes.

[0004] In a database cluster, when a node device obtains a data page, which is the smallest storage unit of data, it first queries the local memory; if the local memory does not hit, it then queries the local memory of other nodes in the cluster through the control node to see whether the data page is held. If the local memory of other nodes holds the data page, the data page is obtained from other nodes through network input and output (I / O) operations; if no node holds the data page, the data page is loaded from the shared disk through disk IO operations.

[0005] 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. Summary of the invention

[0006] 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.

[0007] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0008] In a first aspect, a method for acquiring a data page is provided, which can be applied to a control node device in a database cluster, and the method can include: receiving a pre-fetch 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 pre-fetch request is sent by the first node device under a pre-fetch condition; the first data page is a pre-fetched data page corresponding to a second data page currently processed by the first node device; and the first node device is any node device in the database cluster.

[0009] 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, the local memory hit can be obtained 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 achieving the purpose of shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0010] 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 order of the database cluster, the data page not held by the first node device is included in the N consecutive data pages whose serial number starts 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 data pages in sequence according to the data page order, and stores the N data pages after the second data page currently being processed as pre-fetched data pages in advance in 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 data pages from the node device through network IO, without loading data pages from the disk, which can effectively reduce the disk IO in cluster queries and shorten the query time.

[0011] In another possible implementation, the second data page may be 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. In a hot scenario, a frequently accessed data page is used as a pre-fetched data page and loaded into the local memory of the node device in advance. In the subsequent process of obtaining the hot data page, the node device only needs to obtain the data page from other node devices through network IO, or it can directly hit the local memory without loading the data page from the disk. Therefore, it can effectively reduce the disk IO or network IO in the cluster query and shorten the query time.

[0012] In another possible implementation, when the pre-fetch condition is used to indicate 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 acquired is greater than or equal to a first threshold. Alternatively, within the preset time period, the proportion of the number of times the second data page is acquired in the total number of times the data page is acquired is greater than or equal to a second threshold.

[0013] In another possible implementation, 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. In this implementation, in the database cluster, M node devices other than the first node device pre-fetch the first data page, and the number of M can be configured according to actual needs. The larger M is, the better it can reduce network IO or disk IO and shorten query time.

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

[0015] 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.

[0016] 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.

[0017] 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.

[0018] In another possible implementation, controlling the second node to obtain and hold the first data page may be specifically implemented by sending a pre-fetch 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.

[0019] In a second aspect, another method for acquiring a data page is provided, which is applied to a first node device in a database cluster, and the method may include: under a pre-fetch condition, sending a pre-fetch request including a first data page to a control node device of the database cluster, the pre-fetch 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 pre-fetched data page corresponding to a second data page currently processed by the first node device, and the first data page is one or more.

[0020] 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, the local memory hit can be obtained 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 achieving the purpose of shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0021] 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 order of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial number starts 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 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 in the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to obtain the data page from the node device through network IO, and there is no need to load the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0022] In another possible implementation, the second data page may be 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. In a hot scenario, the frequently accessed held data page is pre-loaded into the local memory of the node device as a pre-fetched data page. In the subsequent process of obtaining the hot data page, the node device only needs to obtain the data page from the node device through network IO, without loading the data page from the disk, and can even directly hit the local memory. Therefore, it can effectively reduce the disk IO or network IO in the cluster query and shorten the query time.

[0023] In another possible implementation, when the pre-fetch condition is used to indicate 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 acquired is greater than or equal to a first threshold. Alternatively, within the preset time period, the proportion of the number of times the second data page is acquired in the total number of times the data page is acquired is greater than or equal to a second threshold.

[0024] In another possible implementation, 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. In this implementation, in the database cluster, M node devices other than the first node device pre-fetch the first data page, and the number of M can be configured according to actual needs. The larger M is, the better it can reduce network IO or disk IO and shorten query time.

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

[0026] 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.

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

[0028] The receiving unit is used to receive a pre-fetch request from a first node device in the database cluster, the pre-fetch request is sent by the first node device under the pre-fetch condition, and the pre-fetch request includes an identifier of a first data page. The first data page is a pre-fetch 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.

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

[0030] 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 order of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial number starts 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 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 in the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to obtain the data page from the node device through network IO, and there is no need to load the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0031] In another possible implementation, the second data page may be 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. In a hot scenario, the frequently accessed held data page is pre-loaded into the local memory of the node device as a pre-fetched data page. In the subsequent process of obtaining the hot data page, the node device only needs to obtain the data page from the node device through network IO, without loading the data page from the disk, and can even directly hit the local memory. Therefore, it can effectively reduce the disk IO or network IO in the cluster query and shorten the query time.

[0032] In another possible implementation, when the pre-fetch condition is used to indicate 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 acquired is greater than or equal to a first threshold. Alternatively, within the preset time period, the proportion of the number of times the second data page is acquired in the total number of times the data page is acquired is greater than or equal to a second threshold.

[0033] In another possible implementation, 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. In this implementation, in the database cluster, M node devices other than the first node device pre-fetch the first data page, and the number of M can be configured according to actual needs. The larger M is, the better it can reduce network IO or disk IO and shorten query time.

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

[0035] 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.

[0036] In another possible implementation manner, 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.

[0037] 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.

[0038] In another possible implementation, controlling the second node to obtain and hold the first data page may be specifically implemented by sending a pre-fetch 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.

[0039] 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.

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

[0041] A determination unit is used 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 used to indicate that a second node device in a database cluster holds the first data page. The second node device is different from the first node device. The first data page is a prefetch data page corresponding to a second data page currently processed by the first node device. The first data page is one or more.

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

[0043] 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 order of the database cluster, the data page not held by the first node device in the N consecutive data pages whose serial number starts 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 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 in the local memory of other node devices in the cluster. In the process of acquiring data pages later, the node device only needs to obtain the data page from the node device through network IO, and there is no need to load the data page from the disk, which can effectively reduce the disk IO in the cluster query and shorten the query time.

[0044] In another possible implementation, the second data page may be 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. In a hot scenario, the frequently accessed held data page is pre-loaded into the local memory of the node device as a pre-fetched data page. In the subsequent process of obtaining the hot data page, the node device only needs to obtain the data page from the node device through network IO, without loading the data page from the disk, and can even directly hit the local memory. Therefore, it can effectively reduce the disk IO or network IO in the cluster query and shorten the query time.

[0045] In another possible implementation, when the pre-fetch condition is used to indicate 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 acquired is greater than or equal to a first threshold. Alternatively, within the preset time period, the proportion of the number of times the second data page is acquired in the total number of times the data page is acquired is greater than or equal to a second threshold.

[0046] In another possible implementation, 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. In this implementation, in the database cluster, M node devices other than the first node device pre-fetch the first data page, and the number of M can be configured according to actual needs. The larger M is, the better it can reduce network IO or disk IO and shorten query time.

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

[0048] 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.

[0049] 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.

[0050] 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, the operating steps of the method described as a scheduler in the first aspect or any possible implementation of the first aspect are executed.

[0051] In a 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, the operating steps of the method described as the scheduler in the second aspect or any possible implementation of the second aspect are executed.

[0052] 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.

[0053] 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 possible implementation method described above.

[0054] 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 operation steps of the method described in the first aspect or the second aspect or any possible implementation manner described above.

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

[0056] Figure 1 It is a schematic diagram of the architecture of a distributed memory management system DMS;

[0057] Figure 2 A flowchart of a method for obtaining a data page is shown;

[0058] Figure 3 A schematic diagram of the structure of a node device provided in an embodiment of the present application;

[0059] Figure 4 A flowchart of a method for obtaining a data page provided in an embodiment of the present application;

[0060] Figure 5 A flowchart of another method for obtaining a data page provided in an embodiment of the present application;

[0061] Figure 6 A flowchart of another method for obtaining a data page provided in an embodiment of the present application;

[0062] Figure 7 A flowchart of another method for obtaining a data page provided in an embodiment of the present application;

[0063] Figure 8 A schematic diagram of the structure of a device for obtaining a data page provided in an embodiment of the present application;

[0064] Fig. 9 A schematic diagram of the structure of another device for acquiring a data page provided in an embodiment of the present application;

[0065] Fig.10 A schematic diagram of the structure of another node device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0068] Data page: refers to the smallest data storage unit defined by the database. Exemplarily, the size of a data page may be 8 kilobytes (KB).

[0069] Sequential scanning: refers to the data scanning method used by the database in the order of data page numbers during the query process.

[0070] Hot data page: refers to a data page that is frequently accessed within a certain time range. In actual applications, the access frequency of hot data pages can be configured according to actual needs.

[0071] 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.

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

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

[0074] A node device holds a data page: this means that the data page is stored in the local memory of the node device.

[0075] The system architecture of DMS (memory pooling) can be as follows Figure 1 As shown in the figure, the node devices in the cluster have local memory. The local memory of different nodes can be accessed through the high-speed network. At the same time, each node shares the underlying disk through the storage area network. In the DMS architecture, the upper-layer business can send read and write requests to any node in the cluster.

[0076] 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 needs to obtain the data page related to the read or write request to the local memory to complete the read or write requirements of the upper-layer service. The process of a node device in the cluster (taking node device 1 as an example) obtaining a data page (taking data page A as an example) can be as follows: Figure 2 As shown, the following steps are included:

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

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

[0079] 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.

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

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

[0082] 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.

[0083] Specifically, if data page A does not exist in the DRC, it means that data page A is not stored in the local memory of any node device in the cluster, 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.

[0084] If data page A exists in the DRC, it means that data page A has been stored in the local memory of other node devices in the cluster, and data page A can be transferred to node device 1 through the high-speed network between nodes. Assuming that data page A has been stored in the local memory of node device 2 in the cluster, control the node device to execute step 5.

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

[0086] The response message 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.

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

[0088] 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 .

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

[0090] 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.

[0091] 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.

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

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

[0094] The update message is used to indicate that node device 1 holding data page A is added in the DRC. After receiving the update message, the control node device updates the current node information of data page A in the DRC and adds the identifier of node device 1 to the current node information of data page A in the DRC.

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

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

[0097] From the above Figure 2 It can be seen from the described process of obtaining data pages 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).

[0098] When a node device obtains different data pages serially 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 have high-frequency access to 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, and the query of the database cluster takes a long time, which limits the business query performance of the database cluster.

[0099] However, in the business query scenario of the database cluster, the data pages to be read can be determined in advance according to the current business situation. In this way, the resources of the idle node devices in the cluster (memory resources or central processing unit (CPU) resources) can be utilized. Before the data pages are actually read, the data pages to be read are stored in the local memory of the node device, thereby 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.

[0100] Based on this, the present application provides a method and related equipment for obtaining data pages, which are configured to indicate the pre-fetching conditions that can determine the pre-fetching data pages. Under the pre-fetching conditions, the control node controls other node devices in the cluster to pre-fetch the first data page, and the first data page is the pre-fetched data page corresponding to the second data page currently processed by the node device. In this way, under the pre-fetching conditions (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, 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 the next data page acquisition, thereby shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0101] 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, 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.

[0102] 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 is necessary to transfer data page A from node device 1 to the local memory of node device 2 through 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 stored in the local memory. When other node devices need to obtain data page A, they can hit it locally without performing IO, which can shorten the query time of the database cluster.

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

[0104] The solution provided in this application can be applied to Figure 1 Schematic DMS architecture.

[0105] in, Figure 1 The node device illustrated in the figure mainly provides business data reading and writing operations, and can be a server, physical machine or other product form.

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

[0107] On the one hand, an embodiment of the present application provides a node device 30. Figure 3 is a schematic diagram of the structure of the node device 30. The node device 30 may be Figure 1 Any node device shown in FIG.

[0108] like Figure 3 As shown, 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.

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

[0110] 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.

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

[0112] The bus 320 may include a path for transmitting information between the above 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, or 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.

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

[0114] It is worth mentioning that Figure 3 In the example, only a node device 30 including a processor 310 and a memory 330 is taken. 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.

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

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

[0117] A pre-fetch request is received from a first node device in a database cluster, the pre-fetch request is sent by the first node device under a pre-fetch condition, and the pre-fetch request includes an identifier of a first data page; and a second node device is controlled to hold the first data page. The first data page is a pre-fetch 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.

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

[0119] Under the pre-fetch condition, a pre-fetch request is sent to a control node device of a database cluster, the pre-fetch request includes an identifier of a first data page, and the pre-fetch request is used to indicate that a second node device in the database cluster holds the first data page, and the first data page is a pre-fetched data page corresponding to the second data page. The second node device is different from the first node device. The first data page is one or more.

[0120] 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.

[0121] It should be noted that the process of obtaining a data page for each node device in the database cluster is the same, and the process of a node device obtaining different data pages is also the same. The following embodiments of the present application take the process of processing the second data page during the interaction between the first node device and the control node device as an example for description, which does not constitute a specific limitation. The first node device can be any node device in the database cluster.

[0122] like Figure 4 As shown, the method for obtaining a data page provided in an embodiment of the present application may include:

[0123] S401: Under a pre-fetch condition, a first node device sends a pre-fetch request to a control node device of a database cluster.

[0124] The above-mentioned pre-fetching condition is used to indicate the 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 the embodiment of the present application is not limited thereto.

[0125] 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.

[0126] 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.

[0127] In a possible implementation, the second data page is a data page to be acquired by the first node device, that is, the second data page is a data page corresponding to the read / write request sent by the upper layer service. Accordingly, the above pre-fetching condition may include condition 1, which is: the second data page is not hit in the local memory of the first node device, and is a sequential scan. The first data page may include: 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 sequence number starts from the next data page of the second data page, where N is greater than or equal to 1.

[0128] Specifically, in a sequential scanning scenario, when the first node device receives a read / write request to obtain the second data page, it will inevitably obtain the next data page of the second data page in the data page sequence of the database cluster in sequence. At this time, the N consecutive data pages starting from the next data page of the second data page in the data page sequence of the database cluster 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), and the data page that does not hit the local memory among the N consecutive data pages starting from the next data page of the second data page is used as the first data page.

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

[0130] Exemplarily, N can be total blocks*X. Wherein, total blocks represents the total number of file pages, and X represents the pre-fetch range ratio (which can be expressed as a percentage). X can be set according to actual needs. The larger X is, the larger the pre-fetch range is. Since the total resources in the cluster (the sum of the memory resources of all nodes) are fixed, the number of pre-fetches is not necessarily more, and the pre-fetch range can be adjusted according to actual business needs, which is not limited in the embodiments of the present application.

[0131] 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, S401 is executed. Otherwise, S402 is executed according to Figure 2 The process of obtaining a data page is shown, and the second data page is obtained.

[0132] In another possible implementation, the second data page is a data page held by the first node device. Accordingly, the 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.

[0133] Exemplarily, the above condition 2 may 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. The duration of the preset time period and the value of the first threshold may be configured according to actual needs, and are not limited in the present embodiment.

[0134] Exemplarily, the above condition 2 may include: within a preset time period, the proportion of the number of times the second data page is acquired in 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 may be configured according to actual needs, and are not limited in the embodiments of the present application.

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

[0136] 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.

[0137] Among them, 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.

[0138] Specifically, the second node device is different from the first node device. 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.

[0139] In a 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 querying services in the cluster.

[0140] 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.

[0141] In a 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 of query services in the cluster.

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

[0143] In a possible implementation, the second node device is a part of the node devices in the database cluster other than the first node device, and the number of the second node devices is determined by the control node device, that is, some of the node devices in the cluster pre-fetch the first data page to reduce the disk IO and network IO of the query service in the cluster.

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

[0145] 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.

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

[0147] In a possible implementation, the second node device is a node device other than the first node device in the database cluster, and a 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.

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

[0149] 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 holding data pages from small to large in addition to the first node device in the database cluster are determined as second node devices.

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

[0151] The mechanism for determining the number of second node devices may be to determine the number of second node devices according to the business volume or business scenario. Of course, the mechanism for determining the number of second node devices may be configured according to actual needs, and the embodiment of the present application is not limited thereto.

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

[0153] Specifically, in S403, the control node device controls the second node device to hold the first data page, which 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 pre-fetch request to the second node device that does not hold the first data page, and the pre-fetch request includes an identifier of the first data page, so that after the second node device receives the pre-fetch request, Figure 2 The illustrated process of obtaining a data page is to obtain and hold a first data page. For a second node device that already holds the first data page, the process can be terminated.

[0154] 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.

[0155] 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.

[0156] 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.

[0157] 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, the local memory hit can be obtained 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 achieving the purpose of shortening the query time of the database cluster and improving the business query performance of the database cluster.

[0158] Further, such as Figure 5 As shown, the method for obtaining a data page provided in the embodiment of the present application may further include S404.

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

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

[0161] Exemplarily, the data page distribution information may be the aforementioned DRC.

[0162] 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. The present embodiment of the application does not elaborate on the update process.

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

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

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

[0166] 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.

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

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

[0169] If it is determined in S602 that it is not a sequential scanning scene, then Figure 2 The illustrated process of obtaining a data page only requires obtaining data page A without performing other steps.

[0170] If it is determined in S602 that the scene is sequential scanning, then Figure 2 The process of obtaining a data page is shown in FIG. 1 , in which data page A is obtained and S603 is executed at the same time.

[0171] 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.

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

[0173] 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 is terminated.

[0174] 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 pre-fetched, and S604 is executed.

[0175] 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.

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

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

[0178] Assuming that, among the data pages with page numbers (A+1) to (A+X) determined in S603, the data pages with page numbers (A+1) and (A+2) are not in the local memory, 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).

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

[0180] When a certain page exists in the DRC, it indicates that there is a node device holding the page.

[0181] 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.

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

[0183] 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-fetching process of the data page (A+1).

[0184] 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.

[0185] Exemplarily, 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).

[0186] S607: After receiving the acquisition request for data page (A+1), node device 2 Figure 2 The illustrated process of obtaining a data page is to obtain data page (A+1), and the pre-fetching process of data page (A+1) is completed.

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

[0188] 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.

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

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

[0191] Through this example 1, while node device 1 obtains page A, the cluster obtains data pages (A+1) to data pages (A+X) in advance into the local memory of the specified node in the cluster through pre-fetch requests. Since it is a sequential scanning scenario, the next data page to be obtained by the business request on node device 1 must be data page (A+1). When node device 1 obtains data page (A+1), because data page (A+1) already exists in the local memory of other nodes in the cluster, it can be transmitted to node device 1 through network IO, without having to obtain it from the disk through disk IO. In actual applications, the idle ratio of network IO is higher than that of disk IO, so it is faster to obtain data pages through the network, which shortens the time consumption of business queries in the database cluster and improves the performance of business queries.

[0192] 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 the embodiment of the present application is described, such as Figure 7 As shown, it may specifically include:

[0193] S701. Node device 1 has a service thread resident in the background, which periodically scans data pages in the local memory.

[0194] S702, node device 1 obtains hotspot data pages that meet hotspot conditions in the current memory through scanning.

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

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

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

[0198] 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.

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

[0200] 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.

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

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

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

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

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

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

[0207] For the 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 the data page H.

[0208] 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.

[0209] 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.

[0210] S707: After receiving the acquisition request for data page H, the target node device Figure 2 The schematic diagram shows the process of obtaining a data page, and obtaining data page H.

[0211] 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.

[0212] 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.

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

[0214] 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 pre-fetch request, which will not be described in detail.

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

[0216] 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. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this article, 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.

[0217] The embodiment of the present invention can divide the node device etc. into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0218] In the case of dividing each functional module into corresponding functional modules, Figure 8 The present invention provides a device for obtaining a data page, which is used to implement the function of controlling the node device in the above embodiment. Figure 8 As shown, 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 Figure 4 or Figure 5 Process S402 in the process; processing unit 802 is used to execute Figure 4 or Figure 5 In the process S403. 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.

[0219] In the case of dividing each functional module into corresponding functional modules, Fig. 9 Another device for obtaining a data page provided in an embodiment of the present application is illustrated, which is used to implement the function of the first node device in the above embodiment. Fig. 9 As shown, the apparatus 90 for acquiring a data page may include: a determining unit 901 and a sending unit 902. The determining unit 901 is used to determine a pre-fetch request under a pre-fetch condition. The sending unit 902 is used to execute Figure 4 or Figure 5 In the process S401. 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.

[0220] In the case of integrated units, such as Fig.10 The node device 100 provided in the embodiment of the present application is shown, which is used to implement the functions of the control node device or the first node device in the above 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 Figure 4 or Figure 5 Process S403 in the communication module 1002 is used to execute Figure 4 or Figure 5 The node device 100 may further include a storage module 1003 for storing program codes and data of the node device 100.

[0221] Among them, the processing module 1001 can be Figure 3 The processor 310 in the physical structure of the node device 30 shown can be a processor or a controller. For example, it can 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 can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processing module 1001 can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The communication module 1002 can be Figure 3 The communication interface 340 in the physical structure of the node device 30 shown in the figure, the communication module 1002 can be a communication port, or can be a transceiver, a transceiver circuit or a communication interface, etc. Alternatively, the above communication interface can realize communication with other devices through the above elements with transceiver functions. The above elements with transceiver functions can be realized by antennas and / or radio frequency devices. The storage module 1003 can be Figure 3The memory 330 in the physical structure of the node device 30 is shown.

[0222] 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 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.

[0223] The embodiment of 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 80 for obtaining data pages or a node device 100. The slave node device can be the above-mentioned device 90 for obtaining data pages or a node device 100.

[0224] 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 executed.

[0225] 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 executes the method for obtaining a data page in the above method embodiment.

[0226] 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 application. 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, and can also include chips and other discrete devices, which is not specifically limited in the embodiment of the present application.

[0227] It is understandable that in order to implement the functions in the above embodiments, the processor of the node device 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 method steps of each example described in the embodiments disclosed in this application, the present application 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 scenario and design constraints of the technical solution.

[0228] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by 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 a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center containing 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.

[0229] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope 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.