[go: up one dir, main page]

CN118467243A - A database backup method, server and shared memory device - Google Patents

A database backup method, server and shared memory device Download PDF

Info

Publication number
CN118467243A
CN118467243A CN202410390963.0A CN202410390963A CN118467243A CN 118467243 A CN118467243 A CN 118467243A CN 202410390963 A CN202410390963 A CN 202410390963A CN 118467243 A CN118467243 A CN 118467243A
Authority
CN
China
Prior art keywords
computing node
target log
log
memory device
shared memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410390963.0A
Other languages
Chinese (zh)
Inventor
蔡来师
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202410390963.0A priority Critical patent/CN118467243A/en
Publication of CN118467243A publication Critical patent/CN118467243A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供一种数据库备份方法、服务器及共享内存设备,涉及服务器技术领域,可以保证主计算节点与备计算节点中数据库的数据同步。该方法应用于共享内存设备,共享内存设备基于计算快速链路CXL协议分别与主计算节点、以及备计算节点通信;方法包括:接收主计算节点发送的目标日志;目标日志用于记录主计算节点中数据库的数据变化情况;接收备计算节点的数据读请求,数据读请求用于请求读取目标日志;响应于数据读请求,向备计算节点发送目标日志。

The embodiment of the present application provides a database backup method, a server and a shared memory device, which relates to the technical field of servers and can ensure data synchronization between the database in the main computing node and the standby computing node. The method is applied to a shared memory device, and the shared memory device communicates with the main computing node and the standby computing node respectively based on the computing fast link CXL protocol; the method includes: receiving a target log sent by the main computing node; the target log is used to record the data changes in the database in the main computing node; receiving a data read request from the standby computing node, the data read request is used to request to read the target log; in response to the data read request, sending the target log to the standby computing node.

Description

一种数据库备份方法、服务器及共享内存设备A database backup method, server and shared memory device

技术领域Technical Field

本申请实施例涉及服务器技术领域,尤其涉及一种数据库备份方法、服务器及共享内存设备。The embodiments of the present application relate to the field of server technology, and in particular to a database backup method, a server, and a shared memory device.

背景技术Background Art

对于HANA数据库来说,为了保证数据的安全,一般通过设置数据库系统以保证高可用性和容灾性。该数据库系统中包括主计算节点和备计算节点,每个节点上都部署有HANA数据库。两个节点在初始搭建时进行系统复制,后续主计算节点在运行过程中,若数据产生变化,主计算节点可以通过日志记录该数据变化情况并将日志发送至备计算节点,使得备计算节点可以根据日志对自身的数据进行更新,以实现两个节点间的数据同步。For HANA database, in order to ensure data security, the database system is generally set up to ensure high availability and disaster tolerance. The database system includes a primary computing node and a standby computing node, and a HANA database is deployed on each node. The two nodes perform system replication during the initial setup. During the subsequent operation of the primary computing node, if the data changes, the primary computing node can record the data changes through logs and send the logs to the standby computing node, so that the standby computing node can update its own data according to the logs to achieve data synchronization between the two nodes.

为了避免主计算节点每次生成日志都需要消耗网络资源将日志发送至备计算节点,目前的主计算节点中配置有传送缓冲区,用于存储待发送至备计算节点的日志,在特定情况下统一将传送缓冲区的日志发送至数据备节点,以节省网络资源。这种情况下,若主计算节点出现故障,则可能存在传送缓冲区还存在日志未发送至备计算节点的情况发生,导致备计算节点的数据无法与主计算节点的数据的保持同步。In order to avoid the need to consume network resources to send logs to the standby computing node every time the main computing node generates logs, the current main computing node is configured with a transmission buffer to store logs to be sent to the standby computing node. In certain circumstances, the logs in the transmission buffer are uniformly sent to the data standby node to save network resources. In this case, if the main computing node fails, there may be logs in the transmission buffer that have not been sent to the standby computing node, resulting in the data of the standby computing node being unable to keep pace with the data of the main computing node.

发明内容Summary of the invention

本申请实施例提供一种数据库备份方法、服务器及共享内存设备,可以保证主计算节点与备计算节点中数据库的数据同步。The embodiments of the present application provide a database backup method, a server, and a shared memory device, which can ensure data synchronization between the database in the main computing node and the backup computing node.

第一方面,本申请实施例提供一种数据库备份方法,应用于共享内存设备,共享内存设备基于计算快速链路CXL协议分别与主计算节点、以及备计算节点通信;方法包括:接收主计算节点发送的目标日志;目标日志用于记录主计算节点中数据库的数据变化情况;接收备计算节点的数据读请求,数据读请求用于请求读取目标日志;响应于数据读请求,向备计算节点发送目标日志。In a first aspect, an embodiment of the present application provides a database backup method, which is applied to a shared memory device, and the shared memory device communicates with a primary computing node and a standby computing node respectively based on a computing fast link CXL protocol; the method includes: receiving a target log sent by the primary computing node; the target log is used to record data changes in the database in the primary computing node; receiving a data read request from the standby computing node, the data read request is used to request to read the target log; and in response to the data read request, sending the target log to the standby computing node.

本申请实施例提供的数据库备份方法,该方法在主计算节点和备计算节点之间引入共享内存设备,主备计算节点分别通过CXL协议与共享内存设备通信。在主计算节点提交事务,在日志缓冲区生成目标日志后,主计算节点可以将目标日志发送到共享内存设备中,使得后续备计算节点向共享内存设备发送数据读请求后,共享内存设备可以向备计算节点发送目标日志。这样,备计算节点可以根据目标日志更新数据,实现数据库备份过程。这种通过设备独立的共享内存设备来存储待发送至备计算节点的目标日志的方式,可以保证主计算节点故障不会影响到未发送至备计算节点的日志,避免日志丢失导致主备计算节点间数据不同步的情况发生,保证数据库系统的可靠性。另外,CXL协议是高速互联协议,通过CXL协议进行通信,可以保证日志的传输效率,提高数据库系统的运行性能。The database backup method provided by the embodiment of the present application introduces a shared memory device between the main computing node and the standby computing node, and the main and standby computing nodes communicate with the shared memory device respectively through the CXL protocol. After the main computing node commits a transaction and generates a target log in the log buffer, the main computing node can send the target log to the shared memory device, so that after the subsequent standby computing node sends a data read request to the shared memory device, the shared memory device can send the target log to the standby computing node. In this way, the standby computing node can update data according to the target log to realize the database backup process. This method of storing the target log to be sent to the standby computing node through an independent shared memory device of the device can ensure that the failure of the main computing node will not affect the log that has not been sent to the standby computing node, avoid the situation where the data between the main and standby computing nodes is not synchronized due to the loss of the log, and ensure the reliability of the database system. In addition, the CXL protocol is a high-speed interconnection protocol. Communication through the CXL protocol can ensure the transmission efficiency of the log and improve the operating performance of the database system.

一种可能的实现方式中,共享内存设备配置有传送缓冲区,传送缓冲区用于存储待发送至备计算节点的日志;在接收主计算节点发送的目标日志之后,方法还包括:将目标日志保存到传送缓冲区;响应于数据读请求,向备计算节点发送目标日志,包括:响应于数据读请求,从传送缓冲区获取目标日志,并向备计算节点发送目标日志。In one possible implementation, the shared memory device is configured with a transmission buffer, which is used to store logs to be sent to the standby computing node; after receiving the target log sent by the main computing node, the method also includes: saving the target log to the transmission buffer; responding to the data read request, sending the target log to the standby computing node, including: responding to the data read request, obtaining the target log from the transmission buffer, and sending the target log to the standby computing node.

另一种可能的实现方式中,目标日志存储于传送缓冲区中的目标区域;在将目标日志保存到传送缓冲区之后,方法还包括:对目标区域配置占用标识;占用标识用于指示目标区域中的内容不可被覆盖。In another possible implementation, the target log is stored in a target area in the transmission buffer; after the target log is saved in the transmission buffer, the method further includes: configuring an occupation flag for the target area; the occupation flag is used to indicate that the content in the target area cannot be overwritten.

又一种可能的实现方式中,在从传送缓冲区中获取目标日志之后,方法还包括:删除目标区域配置的占用标识。In yet another possible implementation, after acquiring the target log from the transmission buffer, the method further includes: deleting an occupation flag configured for the target area.

又一种可能的实现方式中,共享内存设备配置有共享文件系统的服务端;接收主计算节点发送的目标日志,包括:通过服务端,接收第一客户端发送的目标日志;第一客户端配置于主计算节点。接收备计算节点的数据读请求,包括:通过服务端,接收第二客户端发送的数据读请求;第二客户端配置于备计算节点。In another possible implementation, the shared memory device is configured with a server of a shared file system; receiving a target log sent by the primary computing node includes: receiving the target log sent by a first client through the server; the first client is configured on the primary computing node. Receiving a data read request from a standby computing node includes: receiving a data read request sent by a second client through the server; the second client is configured on the standby computing node.

第二方面,本申请实施例提供一种数据库备份方法,应用于主计算节点,主计算节点基于计算快速链路CXL协议与共享内存设备通信,方法包括:主计算节点基于提交的事务,生成目标日志;其中目标日志存储在日志缓冲区;日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;从日志缓冲区获取目标日志;向共享内存设备发送目标日志,以使得备计算节点从共享内存设备中获取目标日志;将日志缓冲区中的目标日志存储在主计算节点的硬盘中。In the second aspect, an embodiment of the present application provides a database backup method, which is applied to a main computing node, and the main computing node communicates with a shared memory device based on a computing fast link CXL protocol. The method includes: the main computing node generates a target log based on a submitted transaction; wherein the target log is stored in a log buffer; the log buffer is deployed on the main computing node, and is used to cache logs generated during the operation of the main computing node; the target log is used to record data changes in the database of the main computing node due to transactions; the target log is obtained from the log buffer; the target log is sent to the shared memory device, so that the standby computing node obtains the target log from the shared memory device; and the target log in the log buffer is stored in the hard disk of the main computing node.

第三方面,本申请实施例提供一种数据库备份方法,应用于备计算节点,备计算节点基于计算快速链路CXL协议与共享内存设备通信,方法包括:向共享内存设备发送数据读请求;数据读请求用于请求读取目标日志,目标日志用于记录主计算节点中数据库的数据变化情况;接收共享内存设备发送的目标日志;根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;将目标日志存储在备计算节点的硬盘中。In a third aspect, an embodiment of the present application provides a database backup method, which is applied to a standby computing node, and the standby computing node communicates with a shared memory device based on a computing fast link CXL protocol, and the method includes: sending a data read request to the shared memory device; the data read request is used to request to read a target log, and the target log is used to record data changes in the database in the main computing node; receiving the target log sent by the shared memory device; according to the target log, updating the data in the database in the standby computing node so that the data in the database in the standby computing node is synchronized with the data in the database in the main computing node; storing the target log in the hard disk of the standby computing node.

第四方面,本申请实施例提供一种数据库备份方法,应用于数据库系统,数据库系统包括主计算节点、共享内设备和备计算节点;共享内存设备基于计算快速链路CXL协议分别与主计算节点和备计算节点通信;主计算节点基于提交的事务,生成目标日志;其中目标日志存储在日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;主计算节点从日志缓冲区获取目标日志,并向共享内存设备发送的目标日志;主计算节点将日志缓冲区中的目标日志存储在主计算节点的硬盘中;备计算节点向共享内存设备发送数据读请求,数据读请求用于请求读取目标日志;共享内存设备响应于数据读请求,向备计算节点发送目标日志;备计算节点根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;备计算节点将目标日志存储在备计算节点的硬盘中。In a fourth aspect, an embodiment of the present application provides a database backup method, which is applied to a database system, wherein the database system includes a main computing node, a shared memory device and a standby computing node; the shared memory device communicates with the main computing node and the standby computing node respectively based on the computing fast link CXL protocol; the main computing node generates a target log based on the submitted transaction; wherein the target log is stored in a log buffer, and the log buffer is deployed on the main computing node for caching logs generated during the operation of the main computing node; the target log is used to record data changes in the database of the main computing node due to transactions; the main computing node obtains the target log from the log buffer and sends the target log to the shared memory device; the main computing node stores the target log in the log buffer in the hard disk of the main computing node; the standby computing node sends a data read request to the shared memory device, and the data read request is used to request to read the target log; the shared memory device sends the target log to the standby computing node in response to the data read request; the standby computing node updates the data of the database in the standby computing node according to the target log, so that the data of the database in the standby computing node is synchronized with the data of the database in the main computing node; the standby computing node stores the target log in the hard disk of the standby computing node.

第五方面,本申请实施例提供一种数据库系统,包括主计算节点,备计算节点以及共享内存设备;共享内存设备基于计算快速链路CXL协议分别与主计算节点和备计算节点通信;主计算节点用于,基于提交的事务,生成目标日志;其中目标日志存储与日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;主计算节点还用于,从日志缓冲区获取目标日志,并向共享内存设备发送目标日志;主计算节点还用于,将日志缓冲区中的目标日志存储在主计算节点的硬盘中;备计算节点用于,向共享内存设备发送数据读请求,数据读请求用于请求读取目标日志;共享内存设备用于,响应于数据读请求,向备计算节点发送目标日志;备计算节点还用于,根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;备计算节点还用于,将目标日志存储在主计算节点的硬盘中。In a fifth aspect, an embodiment of the present application provides a database system, including a main computing node, a standby computing node and a shared memory device; the shared memory device communicates with the main computing node and the standby computing node respectively based on the computing fast link CXL protocol; the main computing node is used to generate a target log based on the submitted transaction; wherein the target log is stored in a log buffer, the log buffer is deployed on the main computing node, and is used to cache the logs generated during the operation of the main computing node; the target log is used to record the data changes in the database in the main computing node due to the transaction; the main computing node is also used to obtain the target log from the log buffer and send the target log to the shared memory device; the main computing node is also used to store the target log in the log buffer in the hard disk of the main computing node; the standby computing node is used to send a data read request to the shared memory device, the data read request is used to request to read the target log; the shared memory device is used to send the target log to the standby computing node in response to the data read request; the standby computing node is also used to update the data of the database in the standby computing node according to the target log, so that the data of the database in the standby computing node is synchronized with the data of the database in the main computing node; the standby computing node is also used to store the target log in the hard disk of the main computing node.

第六方面,本申请实施例提供一种数据库备份装置,该装置包括:接收模块和发送模块;接收模块用于,接收主计算节点发送的目标日志;目标日志用于记录主计算节点中数据库的数据变化情况;接收模块还用于,接收备计算节点的数据读请求,数据读请求用于请求读取目标日志;发送模块用于,响应于数据读请求,向备计算节点发送目标日志。In a sixth aspect, an embodiment of the present application provides a database backup device, which includes: a receiving module and a sending module; the receiving module is used to receive a target log sent by a primary computing node; the target log is used to record data changes in the database in the primary computing node; the receiving module is also used to receive a data read request from a standby computing node, the data read request is used to request to read the target log; the sending module is used to send the target log to the standby computing node in response to the data read request.

第七方面,本申请实施例提供一种数据库备份装置,该装置包括:生成模块、获取模块、发送模块和存储模块;生成模块用于,基于提交的事务生成目标日志;其中目标日志存储与日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;获取模块用于,从日志缓冲区中获取目标日志;发送模块用于,向共享内存设备发送目标日志,以使得备计算节点从共享内存设备中获取目标日志;存储模块用于,将日志缓冲区中的目标日志存储在主计算节点的硬盘中。In the seventh aspect, an embodiment of the present application provides a database backup device, which includes: a generation module, an acquisition module, a sending module and a storage module; the generation module is used to generate a target log based on a submitted transaction; wherein the target log is stored in a log buffer, and the log buffer is deployed on the main computing node to cache the logs generated during the operation of the main computing node; the target log is used to record the data changes in the database of the main computing node due to transactions; the acquisition module is used to obtain the target log from the log buffer; the sending module is used to send the target log to a shared memory device, so that the standby computing node obtains the target log from the shared memory device; the storage module is used to store the target log in the log buffer in the hard disk of the main computing node.

第八方面,本申请实施例提供一种数据库备份装置,该装置包括:发送模块、接收模块、更新模块和存储模块;发送模块用于,向共享内存设备发送数据读请求;数据读请求用于请求读取目标日志,目标日志用于记录主计算节点中数据库的数据变化情况;接收模块用于,接收共享内存设备发送的目标日志;更新模块用于,根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;存储模块用于,将目标日志存储在备计算节点的硬盘中。In an eighth aspect, an embodiment of the present application provides a database backup device, which includes: a sending module, a receiving module, an update module and a storage module; the sending module is used to send a data read request to a shared memory device; the data read request is used to request to read a target log, and the target log is used to record data changes in the database in the main computing node; the receiving module is used to receive the target log sent by the shared memory device; the update module is used to update the data in the database in the standby computing node according to the target log, so that the data in the database in the standby computing node is synchronized with the data in the database in the main computing node; the storage module is used to store the target log in the hard disk of the standby computing node.

第九方面,本申请实施例提供一种服务器,该服务器包括处理器和存储器;处理器与存储器耦合;存储器用于存储计算机指令,计算机指令由处理器加载并执行以使服务器实现上述第一方面到第四方面的方法。In the ninth aspect, an embodiment of the present application provides a server, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor so that the server implements the methods of the first to fourth aspects above.

第十方面,本申请实施例提供一种共享内存设备,执行上述第一方面的方法。In a tenth aspect, an embodiment of the present application provides a shared memory device that executes the method of the first aspect above.

第十一方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质包括:计算机软件指令;当计算机软件指令在服务器中运行时,使得服务器实现上述第一方面到第三方面的方法。In the eleventh aspect, an embodiment of the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions are executed in a server, the server implements the methods of the first to third aspects above.

第十二方面,本申请实施例提供一种计算机程序产品,当该计算机程序产品在服务器上运行时,使得服务器实现上述第一方面到第三方面的方法。In a twelfth aspect, an embodiment of the present application provides a computer program product, which, when running on a server, enables the server to implement the methods of the first to third aspects above.

上述第四方面至第十二方面的有益效果可以参考第一方面的对应描述,不再赘述。The beneficial effects of the fourth to twelfth aspects mentioned above can be referred to the corresponding description of the first aspect and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种目前数据库系统的架构示意图;FIG1 is a schematic diagram of the architecture of a current database system provided in an embodiment of the present application;

图2为本申请实施例提供的一种数据库系统的架构示意图;FIG2 is a schematic diagram of the architecture of a database system provided in an embodiment of the present application;

图3为本申请实施例提供的一种基于CXL连接共享内存设备的连接示意图;FIG3 is a schematic diagram of a connection method for connecting a shared memory device based on CXL according to an embodiment of the present application;

图4为本申请实施例提供的一种服务器的架构示意图;FIG4 is a schematic diagram of the architecture of a server provided in an embodiment of the present application;

图5为本申请实施例提供的一种共享文件系统的架构示意图;FIG5 is a schematic diagram of the architecture of a shared file system provided in an embodiment of the present application;

图6为本申请实施例提供的一种数据库备份方法的流程示意图;FIG6 is a schematic diagram of a flow chart of a database backup method provided in an embodiment of the present application;

图7为本申请实施例提供的一种数据库备份装置的组成示意图;FIG7 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application;

图8为本申请实施例提供的一种数据库备份装置的组成示意图;FIG8 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application;

图9为本申请实施例提供的一种数据库备份装置的组成示意图;FIG9 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application;

图10为本申请实施例提供的一种服务器的组成示意图。FIG. 10 is a schematic diagram of the composition of a server provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

需要说明的是,本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,本领域技术人员可以理解“第一”、“第二”等字样并不是在对数量和执行次序进行限定。In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order.

下面对本申请实施例所涉及的技术术语进行简要介绍:The following is a brief introduction to the technical terms involved in the embodiments of the present application:

1、高性能分析应用(high-performance analyt ic appl iance,HANA):是一款基于内存的面向行,列存储的关系型数据库管理系统。系统应用和产品(system appl ications and products,SAP)HANA是一个集HANA数据库、数据建模、HANA管理和数据供应于一体的组合应用,SAP HANA广泛应用于内存计算引擎来处理和分析大量的实时数据,为企业提供了实时数据分析和管理的能力。1. High-performance analytical application (HANA): It is a memory-based relational database management system that is row-oriented and column-oriented. System applications and products (SAP) HANA is a combined application that integrates HANA database, data modeling, HANA management and data supply. SAP HANA is widely used in memory computing engines to process and analyze large amounts of real-time data, providing enterprises with real-time data analysis and management capabilities.

2、事务:在数据库领域中,事务是为实现单个逻辑功能所执行的一系列操作。这些操作要么全部执行,要么全部不执行,是一个不可分割的整体。事务的主要目的是确保数据库的完整性和一致性,即使在出现故障的情况下也能保持数据的一致性。例如,通过数据库操作,使得用户A向用户B转账100元。这个数据库操作对应的事务包括以下步骤:(1)、启动事务。(2)、执行从用户A的账户扣除100元的操作。(3)、执行从用户B的账号增加100元的操作。(4)、执行在交易记录表中插入转账记录的操作。(5)、提交事务(将前述步骤(1)-(4)涉及的数据变化保存在数据库中)。该事务在执行过程中任何一个环节错误(例如用户A的账户余额不足),所有的操作都不会保存到数据库中(例如用户B的账户不会增加100元,交易记录表也不会记录转账),确保数据库的数据不会受影响。2. Transaction: In the database field, a transaction is a series of operations performed to implement a single logical function. These operations are either all executed or not executed, and are an indivisible whole. The main purpose of a transaction is to ensure the integrity and consistency of the database, and to maintain data consistency even in the event of a failure. For example, through a database operation, user A transfers 100 yuan to user B. The transaction corresponding to this database operation includes the following steps: (1) Start the transaction. (2) Execute the operation of deducting 100 yuan from user A's account. (3) Execute the operation of adding 100 yuan to user B's account. (4) Execute the operation of inserting a transfer record into the transaction record table. (5) Commit the transaction (save the data changes involved in the above steps (1)-(4) in the database). If there is an error in any link during the execution of the transaction (for example, the balance of user A's account is insufficient), all operations will not be saved in the database (for example, user B's account will not increase by 100 yuan, and the transaction record table will not record the transfer), ensuring that the database data will not be affected.

3、计算快速链接(compute express l ink,CXL):CXL协议是一种开放性互连协议标准,旨在提供处理器与专用加速器和高性能存储系统之间的高效、高速和低延时接口,以满足资源共享、内存池化和高效运算调度的需求。CXL具有高效,低延迟的特点。3. Compute Express Link (CXL): CXL is an open interconnection protocol standard that aims to provide an efficient, high-speed, and low-latency interface between processors and dedicated accelerators and high-performance storage systems to meet the needs of resource sharing, memory pooling, and efficient computing scheduling. CXL is characterized by high efficiency and low latency.

对于SAP S4/HANA和BW4/HANA(其中,S4/HANA是一款基于内存计算的、实时运行的企业资源计划系统。BW4/HANA是商务智能和数据仓库领域的解决方案)等系统来说,高可用性和容灾功能是其在构建时需要考虑的重要因素。而SAP S4/HANA和BW4/HANA都是基于HANA数据库运行的,所以如何保证HANA数据库的高可用性和容灾功能就至关重要。这里说的高可用性和容灾功能一般通过备份、存储复制、系统复制等功能实现。其中,备份指的是创建数据的副本,保存到安全的地方,当原始数据丢失或损坏时可以采用备份恢复。存储复制指的是将数据从一个存储系统复制到另一个存储系统。For systems such as SAP S4/HANA and BW4/HANA (S4/HANA is an enterprise resource planning system based on in-memory computing and running in real time. BW4/HANA is a solution in the field of business intelligence and data warehouse), high availability and disaster recovery are important factors that need to be considered when building them. Since both SAP S4/HANA and BW4/HANA run on the HANA database, it is crucial to ensure the high availability and disaster recovery of the HANA database. The high availability and disaster recovery functions mentioned here are generally achieved through backup, storage replication, system replication and other functions. Backup refers to creating a copy of the data and saving it to a safe place. When the original data is lost or damaged, the backup can be used for recovery. Storage replication refers to copying data from one storage system to another.

系统复制是HANA数据库提供的保证高可用性和容灾功能的解决方案,如图1所示,它应用于主、备计算节点构成的容灾系统中。主计算节点部署有HANA数据库,并通过系统复制在备计算节点备份相同的HANA数据库。这样,主计算节点中的服务(HANA数据库提供的特定功能或组件,用于执行例如数据存储、查询等操作)和实例(包括相关的进程和内存结构,用于支持服务的运行)与备计算节点中的服务成对应关系,两个节点中的对应服务成对通信,这种通信方式可以确保主计算节点与备计算节点之间保持同步(例如主计算节点中服务A执行了数据写入操作,则备计算节点中也是由服务A去执行对应的数据写入操作)。System replication is a solution provided by HANA database to ensure high availability and disaster recovery. As shown in Figure 1, it is applied to the disaster recovery system composed of primary and secondary computing nodes. The primary computing node is deployed with HANA database, and the same HANA database is backed up in the secondary computing node through system replication. In this way, the services (specific functions or components provided by HANA database, used to perform operations such as data storage and query) and instances (including related processes and memory structures to support the operation of services) in the primary computing node correspond to the services in the secondary computing node, and the corresponding services in the two nodes communicate in pairs. This communication method can ensure that the primary computing node and the secondary computing node remain synchronized (for example, if service A in the primary computing node performs a data write operation, then service A in the secondary computing node also performs the corresponding data write operation).

在主计算节点的运行过程中,若主计算节点中的服务A执行事务导致自身数据发生变化,则主计算节点可以生成日志记录该数据变化情况,生成的日志暂存在日志缓冲区。后续可以将日志发送至备计算节点,使得备计算节点中的服务A可以根据日志对自身的数据进行更新,以实现两个节点间的数据同步。由于日志只记录了数据更改的信息,而不是完整的数据集,因此主计算节点只需要传送日志而不是整个数据集,这样可以有效减少数据传输量和时间。用户端或应用程序服务器可以使用主计算节点提供的业务服务。当主计算节点故障时,备计算节点可以及时接管主计算节点的业务服务,即用户端或应用程序服务器通过访问备计算节点继续使用业务,保证业务的连续性,保证业务恢复的时长和数据恢复量。During the operation of the main computing node, if the service A in the main computing node executes a transaction that causes its own data to change, the main computing node can generate a log to record the data change, and the generated log is temporarily stored in the log buffer. The log can be sent to the standby computing node later, so that the service A in the standby computing node can update its own data according to the log to achieve data synchronization between the two nodes. Since the log only records the information of data changes, rather than the complete data set, the main computing node only needs to transmit the log instead of the entire data set, which can effectively reduce the amount and time of data transmission. The user end or application server can use the business services provided by the main computing node. When the main computing node fails, the standby computing node can take over the business services of the main computing node in time, that is, the user end or application server continues to use the business by accessing the standby computing node, ensuring the continuity of the business, the duration of business recovery and the amount of data recovery.

目前的数据库系统中,主计算节点和备计算节点之间一般采用同步数据复制或异步数据复制的方式进行日志备份。In current database systems, log backup is generally performed between the primary computing node and the secondary computing node using synchronous data replication or asynchronous data replication.

同步数据复制指的是,当主计算节点执行对日志进行备份的事务时,主计算节点首先获取日志,将日志通过网络发送到备计算节点。备计算节点接收到日志并持久存储在硬盘中后,向主计算节点返回一个确认信息,主计算节点接收到确认信息后,将日志持久存储在硬盘中。Synchronous data replication means that when the primary computing node executes a transaction to back up the log, the primary computing node first obtains the log and sends the log to the standby computing node through the network. After the standby computing node receives the log and stores it persistently on the hard disk, it returns a confirmation message to the primary computing node. After receiving the confirmation message, the primary computing node stores the log persistently on the hard disk.

可以看出,同步数据复制的方式,主计算节点需要等备计算节点确认后才能执行后续的“本地落盘”(即将日志存储在硬盘)的过程。为了降低数据库主备节点间传输信息的过程对主计算节点的影响,这种方式对低时延的要求较高,因此主计算节点和备计算节点一般部署在同一个机房或同城中,导致使用场景受限,且容灾能力较差。It can be seen that in the synchronous data replication method, the primary computing node needs to wait for the confirmation of the backup computing node before executing the subsequent "local disk" (that is, storing logs on the hard disk) process. In order to reduce the impact of the information transmission process between the primary and backup nodes of the database on the primary computing node, this method has high requirements for low latency. Therefore, the primary and backup computing nodes are generally deployed in the same computer room or in the same city, resulting in limited usage scenarios and poor disaster recovery capabilities.

异步复制指的是,当主计算节点执行对日志进行备份的事务时,主计算节点首先获取日志,将日志写入到自身配置的传送缓冲区(也称异步日志传送缓冲区,logshipping_async_buffer)中,然后主计算节点可以将日志持久存储在硬盘中。另外,数据库中节点会单独启动一个线程,以将传送缓冲区中的日志通过网络发送到备计算节点。应理解的是,如果每次生成日志后便将生成的日志发送到备计算节点的方式会消耗大量的网络资源,所以通过设置传送缓冲区,用于暂存待发送至备计算节点的日志,再将传送缓冲区的日志统一或者陆续发送至数据备节点,可以有效节省网络资源。Asynchronous replication means that when the main computing node executes a transaction to back up the log, the main computing node first obtains the log and writes the log to the transmission buffer configured by itself (also called asynchronous log transmission buffer, logshipping_async_buffer), and then the main computing node can store the log persistently on the hard disk. In addition, the node in the database will start a separate thread to send the log in the transmission buffer to the standby computing node through the network. It should be understood that if the generated log is sent to the standby computing node every time it is generated, a large amount of network resources will be consumed. Therefore, by setting a transmission buffer for temporarily storing the logs to be sent to the standby computing node, and then sending the logs in the transmission buffer to the data standby node in a unified or sequential manner, network resources can be effectively saved.

目前的异步数据复制的方式存在如下缺点:若主计算节点出现故障,则会出现传送缓冲区中还存在未发送至备计算节点的日志丢失情况,导致备计算节点中数据库的数据无法与主计算节点中数据库的数据的保持同步。The current asynchronous data replication method has the following disadvantages: if the main computing node fails, logs in the transmission buffer that have not been sent to the backup computing node will be lost, resulting in the data in the database of the backup computing node being unable to keep pace with the data in the database of the main computing node.

综上所述,如何保证数据库主、备节点间的数据同步不受主计算节点故障的影响,是一个亟待解决的问题。In summary, how to ensure that data synchronization between the primary and backup nodes of the database is not affected by the failure of the primary computing node is an urgent problem to be solved.

基于此,本申请实施例提供一种数据库备份方法,本申请实施例提供的数据库备份方法,该方法在主计算节点和备计算节点之间引入共享内存设备,主备计算节点分别通过CXL协议与共享内存设备通信。在主计算节点提交事务,在日志缓冲区生成目标日志后,主计算节点可以将目标日志发送到共享内存设备中,使得后续备计算节点向共享内存设备发送数据读请求后,共享内存设备可以向备计算节点发送目标日志。这样,备计算节点可以根据目标日志更新数据,实现数据库备份过程。这种通过设备独立的共享内存设备来存储待发送至备计算节点的目标日志的方式,可以保证主计算节点故障不会影响到未发送至备计算节点的日志,避免日志丢失导致主备计算节点间数据不同步的情况发生,保证数据库系统的可靠性。另外,CXL协议是高速互联协议,通过CXL协议进行通信,可以保证日志的传输效率,提高数据库系统的运行性能。Based on this, an embodiment of the present application provides a database backup method. The database backup method provided by the embodiment of the present application introduces a shared memory device between the main computing node and the standby computing node, and the main and standby computing nodes communicate with the shared memory device through the CXL protocol respectively. After the main computing node commits a transaction and generates a target log in the log buffer, the main computing node can send the target log to the shared memory device, so that after the subsequent standby computing node sends a data read request to the shared memory device, the shared memory device can send the target log to the standby computing node. In this way, the standby computing node can update data according to the target log to realize the database backup process. This method of storing the target log to be sent to the standby computing node through an independent shared memory device of the device can ensure that the failure of the main computing node will not affect the log that has not been sent to the standby computing node, avoid the situation where the data between the main and standby computing nodes is not synchronized due to the loss of the log, and ensure the reliability of the database system. In addition, the CXL protocol is a high-speed interconnection protocol. Communication through the CXL protocol can ensure the transmission efficiency of the log and improve the operating performance of the database system.

下面结合说明书附图,对本申请提供的实施例进行具体介绍。The embodiments provided in this application are described in detail below in conjunction with the accompanying drawings.

图2为本申请实施例提供的一种数据库系统的架构示意图。如图2所示,包括主计算节点、共享内存设备和备计算节点。Fig. 2 is a schematic diagram of the architecture of a database system provided by an embodiment of the present application. As shown in Fig. 2, it includes a main computing node, a shared memory device and a standby computing node.

主计算节点包括数据区、日志缓冲区、数据文件和日志文件。其中,数据区为主计算节点中的内存区域,用于处理数据。数据区的数据可以以数据文件的形式,持久存储在主计算节点的硬盘中。日志缓冲区为主计算节点的内存区域,用于缓存主计算节点运行过程中生成的日志。主计算节点可以将日志缓冲区中的日志以日志文件的形式,持久存储在主计算节点的硬盘中。The master computing node includes a data area, a log buffer, a data file, and a log file. The data area is a memory area in the master computing node, which is used to process data. The data in the data area can be persistently stored in the hard disk of the master computing node in the form of a data file. The log buffer is a memory area of the master computing node, which is used to cache logs generated during the operation of the master computing node. The master computing node can store the logs in the log buffer in the form of a log file in the hard disk of the master computing node.

共享内存设备包括传送缓冲区,传送缓冲区为共享内存设备中的内存区域,用于存储待发送至备计算节点的日志。The shared memory device includes a transmission buffer, which is a memory area in the shared memory device for storing logs to be sent to the standby computing node.

备计算节点包括数据区、日志接收区、数据文件和日志文件。其中,数据区、数据文件和日志文件的功能与主计算节点侧的功能一致,在此不再重复赘述。日志接收区为备计算节点中的内存区域,用于缓存从主计算节点获取的日志。The standby computing node includes a data area, a log receiving area, data files, and log files. The functions of the data area, data files, and log files are the same as those of the main computing node, and will not be repeated here. The log receiving area is a memory area in the standby computing node, which is used to cache logs obtained from the main computing node.

在本申请实施例中,在数据库系统启动的初始化阶段,主计算节点可以通过前述系统复制的方式,将主计算节点中的原始数据备份到备计算节点中,使得主备计算节点中原始数据保持一致。在主计算节点中运行的过程中,提交事务后,主计算节点可以将日志缓冲区中生成的目标日志复制到共享内存设备中的传送缓冲区,并将日志缓冲区中的日志存储到日志文件中。进一步的,备计算节点从日志传送缓冲区中读取日志,暂存到自身的日志接收区做进一步处理,如根据日志更新自身的数据,或者将日志存储到日志文件中等。在本实施例中,日志记录了数据更改的信息,而不是完整的数据快照,因此进行数据库备份时只需要传输这些日志,而不需要传输整个数据集。这有效减少了数据传输的量和时间,提高了备份的效率。In an embodiment of the present application, during the initialization phase of the database system startup, the main computing node can back up the original data in the main computing node to the standby computing node by means of the aforementioned system replication, so that the original data in the main and standby computing nodes remain consistent. During the operation in the main computing node, after the transaction is submitted, the main computing node can copy the target log generated in the log buffer to the transmission buffer in the shared memory device, and store the log in the log buffer in a log file. Further, the standby computing node reads the log from the log transmission buffer, and temporarily stores it in its own log receiving area for further processing, such as updating its own data according to the log, or storing the log in a log file. In this embodiment, the log records the information of data changes, rather than a complete data snapshot, so when performing a database backup, only these logs need to be transmitted, and the entire data set does not need to be transmitted. This effectively reduces the amount and time of data transmission and improves the efficiency of backup.

下面对共享内存设备进行介绍。The shared memory device is introduced below.

其中,共享内存设备中可以包括处理器、CXL控制器和存储器。如图3所示,主计算节点的处理器可以通过CXL协议与共享内存设备中的CXL控制器连接,以访问共享内存设备中的存储器。同样的,备计算节点的处理器可以通过CXL协议与共享内存设备中的CXL控制器连接,以访问共享内存设备中的存储器。其中,这里说的处理器均可以是中央处理器(central process ing unit,CPU)。The shared memory device may include a processor, a CXL controller, and a memory. As shown in FIG3 , the processor of the main computing node may be connected to the CXL controller in the shared memory device via the CXL protocol to access the memory in the shared memory device. Similarly, the processor of the standby computing node may be connected to the CXL controller in the shared memory device via the CXL protocol to access the memory in the shared memory device. The processors mentioned here may all be central processing units (CPUs).

其中,共享内存设备中的处理器,负责执行指令、进行运算和控制共享内存设备的其他部件。在本实施例中,共享内存设备中的处理器和CXL控制器协同工作,实现共享内存设备与其他组件(如主/备计算节点中的处理器)之间的高效数据传输。本实施例中,共享内存设备中配置有操作系统,操作系统中运行有共享文件系统的服务端。共享内存设备的处理器通过运行服务端,实现接收并处理主计算节点的数据写请求或备计算节点的数据读请求,以及保存日志或读取日志等操作,具体过程参见下述图6对应实施例的相关描述。Among them, the processor in the shared memory device is responsible for executing instructions, performing calculations and controlling other components of the shared memory device. In this embodiment, the processor in the shared memory device and the CXL controller work together to achieve efficient data transmission between the shared memory device and other components (such as the processors in the primary/standby computing nodes). In this embodiment, an operating system is configured in the shared memory device, and a server of a shared file system runs in the operating system. The processor of the shared memory device receives and processes data write requests from the primary computing node or data read requests from the standby computing node, as well as operations such as saving logs or reading logs by running the server. For the specific process, see the relevant description of the corresponding embodiment of Figure 6 below.

其中,CXL控制器是连接处理器和存储器的关键部件,负责管理和控制数据在这些组件之间的传输,确定数据的一致性和完整性,保证处理器和其他组件(如存储器)更高效地协同工作。CXL控制器属于CXL协议所定义的设备类型之一。The CXL controller is a key component that connects the processor and memory. It is responsible for managing and controlling the transmission of data between these components, determining the consistency and integrity of the data, and ensuring that the processor and other components (such as memory) work together more efficiently. The CXL controller is one of the device types defined by the CXL protocol.

CXL控制器遵循CXL协议中包括的两个子协议,分别为CXL.io和CXL.mem。CXL.io主要用于初始化、寄存器访问、中断处理以及内存映射I/O事务等。这使得CPU能够有效地访问外部设备的配置空间,是实现CPU与外部设备之间高效通信的关键环节。CXL.mem允许CPU使用加载和存储命令的方式访问外部设备的内存。此外,CXL协议可以用作内存扩展,使得CPU能够直接访问外部设备的内存,从而实现了内存资源的池化,有效提升了系统的内存使用效率和性能。The CXL controller follows two sub-protocols included in the CXL protocol, namely CXL.io and CXL.mem. CXL.io is mainly used for initialization, register access, interrupt processing, and memory-mapped I/O transactions. This enables the CPU to effectively access the configuration space of external devices and is a key link in achieving efficient communication between the CPU and external devices. CXL.mem allows the CPU to access the memory of external devices using load and store commands. In addition, the CXL protocol can be used as a memory extension, allowing the CPU to directly access the memory of external devices, thereby realizing the pooling of memory resources and effectively improving the system's memory utilization efficiency and performance.

示例性的,CXL控制器可以是集成在共享内存设备中的控制芯片,该控制芯片又可以称为内存扩展(CXL memory expander)芯片、CXL内存控制器(CXL memory expandercontrol ler)或CXL内存池化(CXL memory expander pool ing)芯片。Exemplarily, the CXL controller may be a control chip integrated in a shared memory device, and the control chip may also be referred to as a memory expansion (CXL memory expander) chip, a CXL memory controller (CXL memory expandercontroller) or a CXL memory pooling (CXL memory expander pooling) chip.

其中,共享内存设备中的存储器可以包括双列直插内存模块(dual inl inememory module,DIMM)、动态随机存取存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、或持久内存(pers istent memory,PMEM)。本实施例以存储器包括DIMM或DRAM为例进行说明。The memory in the shared memory device may include a dual inline memory module (DIMM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), or a persistent memory (PMEM). This embodiment is described by taking the memory including DIMM or DRAM as an example.

在本申请实施例中,共享内存设备中配置有共享内存区域,上述传送缓冲区为共享内存区域中的区域。其中,共享内存区域是向共享内存设备申请的一大片内存。对于服务器来说,服务器中的应用在运行期间,该应用经常会向服务器的操作系统申请或者释放一片内存,而频繁向操作系统申请或释放内存需要频繁进行系统调用的过程,会降低服务器的运行效率。因此,本申请实施例采用共享内存区域的方式,一次性向共享内存设备的操作系统申请一片较大内存,作为共享内存区域,后续在进行数据读写时直接使用共享内存区域中的空间,无需向操作系统申请。通过共享内存区域作为目标日志的中间存储媒介,通过CXL协议,使得主备计算节点的CPU可以直接访问到共享内存区域的内存控件,可以有效提高数据库系统的运行效率,促进数据在主备计算节点的快速传递和共享。In an embodiment of the present application, a shared memory area is configured in a shared memory device, and the above-mentioned transmission buffer is an area in the shared memory area. Among them, the shared memory area is a large piece of memory applied to the shared memory device. For a server, during the operation of an application in the server, the application often applies to or releases a piece of memory from the operating system of the server, and the frequent application to or release of memory from the operating system requires a frequent system call process, which will reduce the operating efficiency of the server. Therefore, the embodiment of the present application adopts the method of a shared memory area, and applies to the operating system of the shared memory device for a large piece of memory at one time as a shared memory area, and then directly uses the space in the shared memory area when reading and writing data, without applying to the operating system. By using the shared memory area as the intermediate storage medium of the target log, through the CXL protocol, the CPU of the primary and standby computing nodes can directly access the memory control of the shared memory area, which can effectively improve the operating efficiency of the database system and promote the rapid transmission and sharing of data in the primary and standby computing nodes.

本申请实施例中,主计算节点、备计算节点均可以是服务器。具体从形态上来看,该服务器可以是刀片服务器、高密服务器、机架服务器或整机柜服务器;从功能上来看,该服务器可以为通用服务器、图形处理器(graphics process ing unit,GPU)服务器、人工智能(art ificial intel l igence)服务器等。图4为服务器的系统架构示意图,如图4所示,该服务器的硬件包括处理器、带外控制器、硬盘以及内存。软件包括带外管理模块以及操作系统(operat ing system,OS)。In the embodiment of the present application, both the main computing node and the backup computing node can be servers. Specifically, in terms of form, the server can be a blade server, a high-density server, a rack server or a whole cabinet server; in terms of function, the server can be a general-purpose server, a graphics processing unit (GPU) server, an artificial intelligence (artificial intelligence) server, etc. FIG. 4 is a schematic diagram of the system architecture of the server. As shown in FIG. 4 , the hardware of the server includes a processor, an out-of-band controller, a hard disk and a memory. The software includes an out-of-band management module and an operating system (OS).

其中,带外管理模块运行于带外控制器内,OS运行于处理器(如图4所示)。The out-of-band management module runs in the out-of-band controller, and the OS runs on the processor (as shown in FIG. 4 ).

其中,带外管理模块可以为非业务模块的管理单元。例如,带外管理模块可以通过专用的数据通道对服务器进行远程维护和管理,该带外管理模块是完全独立于服务器的操作系统之外,可以通过服务器的带外管理接口与OS进行通信。The out-of-band management module may be a management unit of a non-business module. For example, the out-of-band management module may remotely maintain and manage the server through a dedicated data channel. The out-of-band management module is completely independent of the server's operating system and may communicate with the OS through the server's out-of-band management interface.

示例性的,带外管理模块可以包括服务器运行状态的管理单元、处理器外的管理芯片中的管理系统、服务器基板管理控制器(baseboard management control ler,BMC)、系统管理模块(system management mode,SMM)等。需要说明的,本申请实施例对带外管理模块的具体形式并不限定,以上仅为示例性说明。Exemplarily, the out-of-band management module may include a management unit for the server operation status, a management system in a management chip outside the processor, a server baseboard management controller (BMC), a system management module (SMM), etc. It should be noted that the embodiments of the present application do not limit the specific form of the out-of-band management module, and the above is only an exemplary description.

内存,也称为内存储器或主存储器,安装在服务器的主板上的内存插槽中,内存与内存控制器之间通过内存通道(channel)进行通信。内存具有至少一个内存列(rank),每个内存列分别位于内存的一个面上,每个内存列包括至少一个子内存列(subrank),内存列或子内存列包括多个内存芯片(device),每个内存芯片被划分为多个存储阵列组(bankgroup),每个存储阵列组包括多个存储阵列(bank),每个存储阵列划分为多个存储单元(cel l),每个存储单元具有一个行(row)地址和一个列(column)地址,每个存储单元包括一个或多个比特位。在一种划分方式中,内存从上级至下级可以依次划分为内存芯片、存储阵列组、存储阵列,存储行/存储列、存储单元、比特位,其中,内存颗粒、存储阵列组、存储阵列、存储行、存储了列、存储单元、比特位在内存上的地址为真实的物理地址。在另一种划分方式中,CPU基于分页机制将内存芯片划分为多个内存页(page),其中,内存页的地址为虚拟地址,虚拟地址需要转换后才会变为真实的物理地址。The memory, also called internal memory or main memory, is installed in the memory slot on the motherboard of the server. The memory communicates with the memory controller through a memory channel. The memory has at least one memory column, each memory column is located on one side of the memory, each memory column includes at least one sub-memory column, and the memory column or sub-memory column includes multiple memory chips (devices). Each memory chip is divided into multiple storage array groups (bankgroups), each storage array group includes multiple storage arrays (banks), each storage array is divided into multiple storage cells (cells), each storage cell has a row address and a column address, and each storage cell includes one or more bits. In one division method, the memory can be divided into memory chips, storage array groups, storage arrays, storage rows/storage columns, storage cells, and bits from the upper level to the lower level, wherein the addresses of memory particles, storage array groups, storage arrays, storage rows, storage columns, storage cells, and bits on the memory are real physical addresses. In another division method, the CPU divides the memory chip into multiple memory pages based on the paging mechanism, where the address of the memory page is a virtual address that needs to be converted before it becomes a real physical address.

硬盘,可以是服务器上配备的插接式硬盘,智能存储卡(smart media card,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等,也可以是外部存储设备,例如U盘等。The hard disk may be a plug-in hard disk equipped on the server, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., or an external storage device such as a USB flash drive.

需要说明的,本申请实施例描述的系统架构以及应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

图5为本申请实施例提供的一种数据库备份系统的架构示意图,该数据库备份系统也可称为共享文件系统。如图5所示,该系统包括客户端和服务端两部分。客户端可以与用户进程交互,以根据用户进程的指示,通过本地文件访问模块访问客户端本地硬盘。或者,客户端可以根据用户进程的指示,通过通信模块与服务端进行数据交互。例如客户端可以发送读取数据请求,客户端的通信模块将读取数据请求转换为函数,基于远程过程调用协议将函数发送至服务端,服务端的通信模块将函数转化为本地可识别命令,以使得服务端本地文件访问模块根据本地可识别命令访问服务端本地硬盘,以读取数据,并通过通信模块将读取到的数据返回至客户端。Fig. 5 is a schematic diagram of the architecture of a database backup system provided by an embodiment of the present application, and the database backup system can also be referred to as a shared file system. As shown in Fig. 5, the system includes two parts, a client and a server. The client can interact with the user process to access the client's local hard disk through the local file access module according to the instructions of the user process. Alternatively, the client can interact with the server through the communication module according to the instructions of the user process. For example, the client can send a read data request, the client's communication module converts the read data request into a function, sends the function to the server based on the remote procedure call protocol, and the server's communication module converts the function into a locally recognizable command, so that the server's local file access module accesses the server's local hard disk according to the locally recognizable command to read data, and returns the read data to the client through the communication module.

另外,服务端中还部署有认证模块(Rpc.nfsd)和鉴权模块(Rpc.mount),认证模块用于判断客户端是否合法,是否可以连接服务端。鉴权模块用于判断客户端对服务端的操作权限,例如是否允许数据读写。In addition, the server also deploys an authentication module (Rpc.nfsd) and an authorization module (Rpc.mount). The authentication module is used to determine whether the client is legitimate and can connect to the server. The authorization module is used to determine the client's operating authority on the server, such as whether data reading and writing are allowed.

在本申请实例中,共享内存设备中配置有共享文件系统的服务端(具体的,共享内存设备中的处理器负责服务端的运行),主计算节点和备计算节点中分别运行有客户端,以使得两者可以共同访问共享内存设备中的数据。为便于区分,本申请实施例中称主计算节点中运行的客户端为第一客户端,备计算节点中运行的客户端为第二客户端。In the example of the present application, a shared file system server is configured in the shared memory device (specifically, the processor in the shared memory device is responsible for the operation of the server), and clients are respectively run in the main computing node and the standby computing node, so that both can access the data in the shared memory device together. For the sake of distinction, the client running in the main computing node is referred to as the first client in the embodiment of the present application, and the client running in the standby computing node is referred to as the second client.

作为一种示例,该共享文件系统可以是网络文件系统(network fi le system,NFS)。NFS是基于用户数据报协议(user datagram protocol,UDP)协议的文件系统,其实现主要是采用远程过程调用协议连接客户端和服务端,远程过程调用协议提供了一组与机器、操作系统以及底层传送协议无关的存取远程文件的操作。NFS允许远程客户端以与访问本地文件系统类似的方式,来通过网络访问服务端的数据。As an example, the shared file system can be a network file system (NFS). NFS is a file system based on the User Datagram Protocol (UDP). Its implementation mainly uses the Remote Procedure Call protocol to connect the client and the server. The Remote Procedure Call protocol provides a set of operations for accessing remote files that are independent of the machine, operating system, and underlying transmission protocol. NFS allows remote clients to access the data on the server through the network in a similar way to accessing the local file system.

图6为本申请实施例提供的一种数据库备份方法的流程示意图。示例性的,本申请实施例提供的数据库备份方法,可以应用于图2所示的系统架构中。其中,共享内存设备基于CXL协议分别与主计算节点、和备计算节点通信。Fig. 6 is a flow chart of a database backup method provided in an embodiment of the present application. Exemplarily, the database backup method provided in an embodiment of the present application can be applied to the system architecture shown in Fig. 2. The shared memory device communicates with the main computing node and the standby computing node respectively based on the CXL protocol.

如图6所示,本申请实施例提供的数据库备份方法具体可以包括以下步骤:As shown in FIG6 , the database backup method provided in the embodiment of the present application may specifically include the following steps:

S601、主计算节点基于提交的事务,生成目标日志。S601. The main computing node generates a target log based on the submitted transaction.

S602、主计算节点从日志缓冲区中获取目标日志。S602: The main computing node obtains the target log from the log buffer.

其中,目标日志存储于日志缓冲区中,日志缓冲区部署于主计算节点中,用于缓存主计算节点运行过程中生成的日志。目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况。The target log is stored in the log buffer, which is deployed in the main computing node and used to cache the logs generated during the operation of the main computing node. The target log is used to record the data changes caused by transactions in the database of the main computing node.

针对上述S601-S602,如前所述,主计算节点可以对外提供服务。主计算节点在对外提供服务的过程中,会提交各种事务,这些事务伴着大量的数据操作(例如数据的增删改查等操作),这些数据操作会导致数据库中的数据发生变化。因此,主计算节点会生成目标日志以记录这些数据变化情况。这些目标日志暂存在主计算节点的日志缓冲区中,后续在进行日志备份时,主计算节点可以从日志缓冲区中获取这些目标日志。With respect to the above S601-S602, as mentioned above, the main computing node can provide services to the outside. In the process of providing services to the outside, the main computing node will submit various transactions, which are accompanied by a large number of data operations (such as data addition, deletion, modification, and query operations). These data operations will cause the data in the database to change. Therefore, the main computing node will generate a target log to record these data changes. These target logs are temporarily stored in the log buffer of the main computing node. When performing log backup later, the main computing node can obtain these target logs from the log buffer.

应理解,通过日志记录事务导致的数据变化情况,一方面可以使得主计算节点在数据丢失时,可以基于日志进行数据恢复。另一方面,可以使得备计算节点根据日志与主计算节点保持数据同步。It should be understood that by recording data changes caused by transactions in logs, on the one hand, the primary computing node can recover data based on the logs when data is lost, and on the other hand, the backup computing node can keep data synchronized with the primary computing node based on the logs.

S603、主计算节点向共享内存设备发送目标日志;相应的,共享内存设备接收主计算节点发送的目标日志。S603. The main computing node sends a target log to the shared memory device; correspondingly, the shared memory device receives the target log sent by the main computing node.

在本申请实施例中,当日志缓冲区中生成目标日志时,主计算节点可以获取这些目标日志,并向共享内存设备发送目标日志,以使得备计算节点从共享内存设备中获取目标日志。In an embodiment of the present application, when target logs are generated in the log buffer, the primary computing node may obtain these target logs and send the target logs to the shared memory device so that the standby computing node obtains the target logs from the shared memory device.

在一种实现方式中,主计算节点和共享内存设备可以通过图5所示的共享文件系统,实现目标日志的传递。其中,主计算节点配置有第一客户端,共享内存设备配置有共享文件系统的服务端。通过运行客户端和服务端,可以在主计算节点与共享内存设备之间建立通信链路。因此,上述S603可以实现为:主计算节点运行第一客户端,向共享内存设备发送目标日志。相应的,共享内存设备通过服务端,接收第一客户端发送的目标日志。In one implementation, the main computing node and the shared memory device can achieve the transmission of the target log through the shared file system shown in Figure 5. Among them, the main computing node is configured with a first client, and the shared memory device is configured with a server of the shared file system. By running the client and the server, a communication link can be established between the main computing node and the shared memory device. Therefore, the above S603 can be implemented as follows: the main computing node runs the first client and sends the target log to the shared memory device. Correspondingly, the shared memory device receives the target log sent by the first client through the server.

在一种实现方式中,共享内存设备中配置有传送缓冲区,传送缓冲区用于存储待发送至备计算节点的日志。在上述S603中,共享内存设备节点主计算节点发送的目标日志之后,共享内存设备还执行如下:将目标日志保存到传送缓冲区。以便于后续备计算节点从传送缓冲区中读取目标日志。In one implementation, a transmission buffer is configured in the shared memory device, and the transmission buffer is used to store logs to be sent to the standby computing node. In the above S603, after the shared memory device node sends the target log to the master computing node, the shared memory device also performs the following: save the target log to the transmission buffer. So that the subsequent standby computing node can read the target log from the transmission buffer.

应理解,将传送缓冲区设置到共享内存设备中,可以有效避免相关技术中,主计算节点故障导致传送缓冲区中日志丢失的情况发生,保证数据库系统的容灾性能。另外,传送缓冲区设置到独立的共享内存设备中,可以保证传送缓冲区具有足够的容量空间。避免主计算节点在高负荷运行时,由于传送缓冲区容量不足导致主计算节点无法写入日志,从而影响主计算节点的运行性能。It should be understood that setting the transmission buffer in a shared memory device can effectively avoid the situation in the related art where the main computing node fails and causes the loss of logs in the transmission buffer, thereby ensuring the disaster recovery performance of the database system. In addition, setting the transmission buffer in an independent shared memory device can ensure that the transmission buffer has sufficient capacity space. This avoids the main computing node being unable to write logs due to insufficient transmission buffer capacity when the main computing node is running under high load, thereby affecting the operating performance of the main computing node.

在一种实现方式中,目标日志存储于传送缓冲区中的目标区域。在上述共享内存设备将目标日志保存到传送缓冲区之后,共享内存设备还执行:对目标区域配置占用标识,该占用标识用于指示目标区域中的内容不可被覆盖。In one implementation, the target log is stored in the target area in the transmission buffer. After the shared memory device saves the target log to the transmission buffer, the shared memory device further performs: configuring an occupation mark for the target area, the occupation mark is used to indicate that the content in the target area cannot be overwritten.

其中,共享内存设备中处理器通过运行操作系统,实现对占用标识的管理。该占用标识可以存储在操作系统的内核空间中,保证占用标识可以被操作系统快速访问和修改,保证文件的高效访问和管理。The processor in the shared memory device manages the occupation flag by running the operating system. The occupation flag can be stored in the kernel space of the operating system, ensuring that the occupation flag can be quickly accessed and modified by the operating system, ensuring efficient access and management of files.

S604、主计算节点将目标日志存储在主计算节点的硬盘中。S604: The main computing node stores the target log in the hard disk of the main computing node.

应理解,如前所述,日志缓冲区为内存区域,内存区域一般是用于暂时存储数据的。因此,为了保证目标日志不丢失,主计算节点可以将目标日志持久存储在自身的硬盘中,保证目标日志的持久性,便于后续需要时根据目标日志进行数据恢复。It should be understood that, as mentioned above, the log buffer is a memory area, and the memory area is generally used to temporarily store data. Therefore, in order to ensure that the target log is not lost, the main computing node can store the target log persistently in its own hard disk to ensure the persistence of the target log, so as to facilitate data recovery based on the target log when needed later.

需要说明的是,本申请实施例对上述S603和S604的具体执行顺次不作限定,两个步骤互相独立,可以先后执行,也可以同时执行。It should be noted that the embodiment of the present application does not limit the specific execution sequence of the above S603 and S604. The two steps are independent of each other and can be executed successively or simultaneously.

S605、备计算节点向共享内存设备发送数据读请求;相应的,共享内存设备接收备计算节点的数据读请求。S605: The standby computing node sends a data read request to the shared memory device; correspondingly, the shared memory device receives the data read request from the standby computing node.

其中,数据读请求用于请求读取目标日志。The data read request is used to request to read the target log.

在本申请实施例中,备计算节点可以实时地,或者在预设条件下,向共享内存设备发送数据读请求,以请求读取目标日志。相应的,共享内存设备可以接收到数据读请求并响应。In the embodiment of the present application, the standby computing node can send a data read request to the shared memory device in real time or under preset conditions to request to read the target log. Correspondingly, the shared memory device can receive the data read request and respond.

作为一种示例,预设条件可以是备计算节点接收到关于日志备份的指令,该指令可以来自于主计算节点,数据库管理员的终端等。或者,预设条件可以是传送缓冲区中的日志数量达到一定阈值(共享内存设备可以实时检测传送缓冲区的日志数量,或者传送缓冲区的已占用空间大小,在日志数量或已占用空间大小超过一定阈值时指示备计算节点读取)。As an example, the preset condition may be that the standby computing node receives an instruction on log backup, which may come from the main computing node, a terminal of a database administrator, etc. Alternatively, the preset condition may be that the number of logs in the transmission buffer reaches a certain threshold (the shared memory device may detect the number of logs in the transmission buffer or the size of the occupied space in the transmission buffer in real time, and instruct the standby computing node to read when the number of logs or the size of the occupied space exceeds a certain threshold).

在一种实现方式中,备计算节点和共享内存设备可以通过图5所示的共享文件系统,实现目标日志的读取。其中,备计算节点配置有第二客户端,共享内存设备配置有共享文件系统的服务端。通过运行客户端和服务端,可以在备计算节点与共享内存设备之间建立通信链路。因此,上述S605可以实现为:备计算节点运行第二客户端,向共享内存设备发送数据读请求。相应的,共享内存设备通过服务端,接收第二客户端发送的数据读请求。In one implementation, the standby computing node and the shared memory device can read the target log through the shared file system shown in Figure 5. Among them, the standby computing node is configured with a second client, and the shared memory device is configured with a server of the shared file system. By running the client and the server, a communication link can be established between the standby computing node and the shared memory device. Therefore, the above S605 can be implemented as follows: the standby computing node runs the second client and sends a data read request to the shared memory device. Correspondingly, the shared memory device receives the data read request sent by the second client through the server.

S606、共享内存设备响应于数据读请求,向备计算节点发送所述目标日志;相应的,备计算节点接收共享内存设备发送的目标日志。S606: The shared memory device sends the target log to the standby computing node in response to the data read request; correspondingly, the standby computing node receives the target log sent by the shared memory device.

在本申请实施例中,共享内存设备在接收到来自备计算节点的数据读请求后,可以响应于该请求,发送目标日志至备计算节点。其中,共享内存设备可以记录目标日志的备份情况(即是否已向备计算节点发送过),在接收到备计算节点的数据读请求后,共享内存设备可以获取还未备份过的目标日志,并发送至备计算节点。备计算节点中配置有日志接收区,备计算节点在接收到目标日志后,可以将目标日志存储在日志接收区,以便于后续对目标日志做进一步处理,如执行下述S607和S608。In an embodiment of the present application, after receiving a data read request from a standby computing node, the shared memory device can respond to the request and send a target log to the standby computing node. Among them, the shared memory device can record the backup status of the target log (i.e., whether it has been sent to the standby computing node). After receiving the data read request from the standby computing node, the shared memory device can obtain the target log that has not been backed up and send it to the standby computing node. A log receiving area is configured in the standby computing node. After receiving the target log, the standby computing node can store the target log in the log receiving area to facilitate further processing of the target log later, such as executing S607 and S608 below.

在一种实现方式中,共享内存设备中配置有传送缓冲区,传送缓冲区用于存储待发送至备计算节点的日志。因此,上述S606可以实现为:响应于数据读请求,从传送缓冲区获取目标日志,并向备计算节点发送目标日志。In one implementation, a transmission buffer is configured in the shared memory device, and the transmission buffer is used to store logs to be sent to the standby computing node. Therefore, the above S606 can be implemented as: in response to the data read request, obtaining the target log from the transmission buffer and sending the target log to the standby computing node.

可以看出,通过设置传送缓冲区存储待发送至备计算节点的日志,可以在接收到备计算节点的数据读请求后,统一获取传送缓冲区累积的目标日志并发送,以有效节省网络资源的消耗。It can be seen that by setting a transmission buffer to store logs to be sent to the standby computing node, after receiving a data read request from the standby computing node, the target logs accumulated in the transmission buffer can be uniformly obtained and sent, thereby effectively saving network resource consumption.

在一种实现方式中,在上述共享内存设备从传送缓冲区中获取目标日志之后,共享内存设备还执行:删除目标区域配置的占用标识。In an implementation manner, after the shared memory device obtains the target log from the transmission buffer, the shared memory device further executes: deleting an occupation identifier configured in the target area.

应理解,通过配置和删除占用标识,可以实现共享内存设备记录目标日志的备份情况。无需主计算节点或共享内存设备通过信息交互告知备计算节点哪些日志是新生成的,哪些日志是已经备份过的。共享内存设备在接收到数据读请求后,可以从配置有占用标识的目标区域获取目标日志并发送至备计算节点。然后,将这些目标区域的占用标识删除,避免下次向备计算节点发送日志时,重复获取以前已经备份过的日志。It should be understood that by configuring and deleting the occupation mark, the shared memory device can record the backup status of the target log. There is no need for the main computing node or the shared memory device to inform the standby computing node which logs are newly generated and which logs have been backed up through information interaction. After receiving a data read request, the shared memory device can obtain the target log from the target area configured with the occupation mark and send it to the standby computing node. Then, the occupation marks of these target areas are deleted to avoid repeatedly obtaining the previously backed-up logs when sending logs to the standby computing node next time.

示例性的,共享内存设备的传送缓冲区中划分为10个区域(分别为区域1-区域10)。共享内存设备接收主计算节点发送的目标日志,将目标日志存储在区域1中。进一步的,共享内存设备可以针对区域1配置占用标识。这样,若主计算节点再次发送新的目标日志,则不能覆盖区域1中的内容,避免日志的丢失。同样的,备计算节点发送数据读请求后,共享内存设备可以查询哪些区域具备占用标识。共享内存设备可以确定具备占用标识的区域1中的目标日志是还未进行备份的目标日志,可以获取并发送至备计算节点。Exemplarily, the transmission buffer of the shared memory device is divided into 10 areas (area 1 to area 10 respectively). The shared memory device receives the target log sent by the main computing node and stores the target log in area 1. Furthermore, the shared memory device can configure an occupation mark for area 1. In this way, if the main computing node sends a new target log again, the content in area 1 cannot be overwritten, thereby avoiding the loss of the log. Similarly, after the standby computing node sends a data read request, the shared memory device can query which areas have occupation marks. The shared memory device can determine that the target log in area 1 with the occupation mark is a target log that has not been backed up, and can be obtained and sent to the standby computing node.

另外,在内存空间紧张时,共享内存设备可以将新的目标日志覆盖保存在没有配置占用标识的区域,保证共享内存设备中存储空间的充分利用。In addition, when the memory space is tight, the shared memory device can overwrite and save the new target log in the area without the configuration occupation mark, so as to ensure the full utilization of the storage space in the shared memory device.

S607、备计算节点根据目标日志,更新备计算节点中数据库的数据。S607: The standby computing node updates the data in the database of the standby computing node according to the target log.

在本申请实施例中,如前所述,目标日志记录了主计算节点中数据库的数据变化情况。在进行数据库备份的过程中,备计算节点可以根据目标日志的内容,更新自身数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步。In the embodiment of the present application, as described above, the target log records the data changes in the database in the primary computing node. During the database backup process, the standby computing node can update the data in its own database according to the content of the target log, so that the data in the database in the standby computing node is synchronized with the data in the database in the primary computing node.

S608、将所述目标日志存储在所述备计算节点的硬盘中。S608: Store the target log in the hard disk of the standby computing node.

与上述S604相同的理由,为了保证目标日志不丢失,备计算节点可以将目标日志持久存储在自身的硬盘中,保证目标日志的持久性,便于后续需要时根据目标日志进行数据恢复。For the same reason as in S604 above, in order to ensure that the target log is not lost, the standby computing node may persistently store the target log in its own hard disk to ensure the persistence of the target log and facilitate subsequent data recovery based on the target log when needed.

需要说明的是,本申请实施例对上述S607和S608的具体执行顺次不作限定,两个步骤互相独立,可以先后执行,也可以同时执行。It should be noted that the embodiment of the present application does not limit the specific execution sequence of the above S607 and S608. The two steps are independent of each other and can be executed successively or simultaneously.

本申请实施例提供的一种数据库备份方法,应用于图2所示的数据库系统,包括如下步骤:A database backup method provided in an embodiment of the present application is applied to the database system shown in FIG2 , and includes the following steps:

1、主计算节点基于提交的事务,生成目标日志;其中目标日志存储于日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;1. The main computing node generates a target log based on the submitted transaction. The target log is stored in the log buffer, which is deployed on the main computing node and used to cache the logs generated during the operation of the main computing node. The target log is used to record the data changes caused by the transaction in the database of the main computing node.

2、主计算节点从日志缓冲区获取目标日志,并向共享内存设备发送的目标日志;2. The master computing node obtains the target log from the log buffer and sends the target log to the shared memory device;

3、主计算节点将日志缓冲区中的目标日志存储在主计算节点的硬盘中;3. The main computing node stores the target log in the log buffer in the hard disk of the main computing node;

4、备计算节点向共享内存设备发送数据读请求,数据读请求用于请求读取目标日志;4. The standby computing node sends a data read request to the shared memory device. The data read request is used to request to read the target log.

5、共享内存设备响应于数据读请求,向备计算节点发送目标日志;5. The shared memory device responds to the data read request and sends the target log to the standby computing node;

6、备计算节点根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;6. The standby computing node updates the data in the database of the standby computing node according to the target log, so that the data in the database of the standby computing node is synchronized with the data in the database of the primary computing node;

7、备计算节点将目标日志存储在备计算节点的硬盘中。7. The standby computing node stores the target log in the hard disk of the standby computing node.

应理解,上述步骤2和步骤3可以换顺序执行,也可以同时执行。同样的,上述步骤6和步骤7也可以换顺序执行,也可以同时执行。It should be understood that the above steps 2 and 3 can be performed in a different order or simultaneously. Similarly, the above steps 6 and 7 can be performed in a different order or simultaneously.

下面对本申请实施例提供的数据库备份方案进行总结说明。开始,主、备节点通过CXL协议连接到共享内存设备,并事先在共享内存设备中配置共享内存区域,并在共享内存区域中配置共享文件系统的服务端。其次,针对数据库主、备节点配置共享文件系统的访问策略:主计算节点运行第一客户端,通过第一客户端访问到共享内存设备进行写入目标日志的操作。备计算节点运行第二客户端,通过第二客户端访问到共享内存设备进行读取目标日志的操作。针对共享内存设备配置读写策略:主计算节点在目标区域写入目标日志后,共享内存设备对目标区域配置占用标识;备计算节点在目标区域读取数据后,共享内存设备删除目标区域配置的占用标识。然后,修改主计算节点的配置,将原来主计算节点中的传送缓冲区配置到共享内存设备中,且备计算节点从共享内存设备中读取目标日志。在运行过程中,主计算节点从传送缓冲区写入目标日志,备计算节点从传送缓冲区读取目标日志,以循环使用共享文件系统。The following is a summary of the database backup solution provided by the embodiment of the present application. At the beginning, the master and standby nodes are connected to the shared memory device through the CXL protocol, and the shared memory area is configured in the shared memory device in advance, and the server of the shared file system is configured in the shared memory area. Secondly, the access strategy of the shared file system is configured for the master and standby nodes of the database: the master computing node runs the first client, and accesses the shared memory device through the first client to write the target log. The standby computing node runs the second client, and accesses the shared memory device through the second client to read the target log. The read-write strategy is configured for the shared memory device: after the master computing node writes the target log in the target area, the shared memory device configures an occupation mark for the target area; after the standby computing node reads the data in the target area, the shared memory device deletes the occupation mark configured in the target area. Then, modify the configuration of the master computing node, configure the transmission buffer in the original master computing node to the shared memory device, and the standby computing node reads the target log from the shared memory device. During operation, the master computing node writes the target log from the transmission buffer, and the standby computing node reads the target log from the transmission buffer to cyclically use the shared file system.

本申请实施例提供一种数据库备份方法,该方法在主计算节点和备计算节点之间引入共享内存设备,主备计算节点分别通过CXL协议与共享内存设备通信。在主计算节点提交事务,在日志缓冲区生成目标日志后,主计算节点可以将目标日志发送到共享内存设备中,使得后续备计算节点向共享内存设备发送数据读请求后,共享内存设备可以向备计算节点发送目标日志。这样,备计算节点可以根据目标日志更新数据,实现数据库备份过程。这种通过设备独立的共享内存设备来存储待发送至备计算节点的目标日志的方式,可以保证主计算节点故障不会影响到未发送至备计算节点的日志,避免日志丢失导致主备计算节点间数据不同步的情况发生,保证数据库系统的可靠性。另外,CXL协议是高速互联协议,通过CXL协议进行通信,可以保证日志的传输效率,提高数据库系统的运行性能。The embodiment of the present application provides a database backup method, which introduces a shared memory device between the main computing node and the standby computing node, and the main and standby computing nodes communicate with the shared memory device respectively through the CXL protocol. After the main computing node commits a transaction and generates a target log in the log buffer, the main computing node can send the target log to the shared memory device, so that after the subsequent standby computing node sends a data read request to the shared memory device, the shared memory device can send the target log to the standby computing node. In this way, the standby computing node can update data according to the target log to realize the database backup process. This method of storing the target log to be sent to the standby computing node through an independent shared memory device of the device can ensure that the failure of the main computing node will not affect the log that has not been sent to the standby computing node, avoid the situation where the data between the main and standby computing nodes is not synchronized due to the loss of the log, and ensure the reliability of the database system. In addition, the CXL protocol is a high-speed interconnection protocol. Communication through the CXL protocol can ensure the transmission efficiency of the log and improve the operating performance of the database system.

上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,本申请实施例提供了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the embodiment of the present application provides a hardware structure and/or software module corresponding to each function. It should be easily appreciated by those skilled in the art that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of 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 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 application.

在示例性的实施例中,本申请实施例还提供一种数据库备份装置。该数据库备份装置可以是上述主计算节点、共享内存设备或备计算节点。该数据库备份装置可以包括一个或多个功能模块,用于实现以上方法实施例的数据库备份方法。In an exemplary embodiment, the present application also provides a database backup device. The database backup device may be the above-mentioned main computing node, shared memory device or standby computing node. The database backup device may include one or more functional modules for implementing the database backup method of the above method embodiment.

例如,图7为本申请实施例提供的一种数据库备份装置的组成示意图。如图7所示,该数据库备份装置包括:接收模块701和发送模块702;For example, Fig. 7 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application. As shown in Fig. 7, the database backup device includes: a receiving module 701 and a sending module 702;

接收模块701用于,接收主计算节点发送的目标日志;目标日志用于记录主计算节点中数据库的数据变化情况;The receiving module 701 is used to receive the target log sent by the main computing node; the target log is used to record the data changes in the database of the main computing node;

接收模块701还用于,接收备计算节点的数据读请求,数据读请求用于请求读取目标日志;The receiving module 701 is further used to receive a data read request from a standby computing node, where the data read request is used to request to read a target log;

发送模块702用于,响应于数据读请求,向备计算节点发送目标日志。The sending module 702 is used to send the target log to the standby computing node in response to the data read request.

一种可能的实现方式中,共享内存设备配置有传送缓冲区,传送缓冲区用于存储待发送至备计算节点的日志;上述装置还包括:保存模块703。保存模块703用于,将目标日志保存到传送缓冲区;发送模块702具体用于,响应于数据读请求,从传送缓冲区获取目标日志,并向备计算节点发送目标日志。In a possible implementation, the shared memory device is configured with a transmission buffer, and the transmission buffer is used to store the log to be sent to the standby computing node; the above-mentioned device also includes: a saving module 703. The saving module 703 is used to save the target log to the transmission buffer; the sending module 702 is specifically used to obtain the target log from the transmission buffer in response to the data read request, and send the target log to the standby computing node.

另一种可能的实现方式中,目标日志存储于传送缓冲区中的目标区域。上述装置还包括:配置模块704。配置模块704用于,对目标区域配置占用标识;占用标识用于指示目标区域中的内容不可被覆盖。In another possible implementation, the target log is stored in the target area in the transmission buffer. The above device also includes: a configuration module 704. The configuration module 704 is used to configure an occupation mark for the target area; the occupation mark is used to indicate that the content in the target area cannot be overwritten.

又一种可能的实现方式中,配置模块704还用于,删除目标区域配置的占用标识。In yet another possible implementation, the configuration module 704 is further configured to delete an occupation flag configured in the target area.

又一种可能的实现方式中,共享内存设备配置有共享文件系统的服务端;接收模块,具体用于,通过服务端,接收第一客户端发送的目标日志;第一客户端配置于主计算节点。接收模块具体用于,通过服务端,接收第二客户端发送的数据读请求;第二客户端配置于备计算节点。In another possible implementation, the shared memory device is configured with a server of a shared file system; the receiving module is specifically used to receive the target log sent by the first client through the server; the first client is configured on the main computing node. The receiving module is specifically used to receive the data read request sent by the second client through the server; the second client is configured on the standby computing node.

例如,图8为本申请实施例提供的一种数据库备份装置的组成示意图。如图8所示,该数据库备份装置包括:该装置包括:生成模块801、获取模块802、发送模块803和存储模块804;For example, Figure 8 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application. As shown in Figure 8, the database backup device includes: the device includes: a generating module 801, an acquiring module 802, a sending module 803 and a storing module 804;

生成模块801用于,基于提交的事务,生成目标日志;其中目标日志存储于日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;The generation module 801 is used to generate a target log based on the submitted transaction; wherein the target log is stored in a log buffer, which is deployed on the main computing node and is used to cache the logs generated during the operation of the main computing node; the target log is used to record the data changes caused by the transaction in the database of the main computing node;

获取模块802用于,从日志缓冲区中获取目标日志;The acquisition module 802 is used to acquire the target log from the log buffer;

发送模块803用于,向共享内存设备发送目标日志,以使得备计算节点从共享内存设备中获取目标日志;The sending module 803 is used to send the target log to the shared memory device so that the standby computing node obtains the target log from the shared memory device;

存储模块804用于,将日志缓冲区中的目标日志存储在主计算节点的硬盘中。The storage module 804 is used to store the target log in the log buffer in the hard disk of the main computing node.

例如,图9为本申请实施例提供的一种数据库备份装置的组成示意图。如图9所示,该数据库备份装置包括:发送模块901、接收模块902、更新模块903和存储模块904;For example, Figure 9 is a schematic diagram of the composition of a database backup device provided in an embodiment of the present application. As shown in Figure 9, the database backup device includes: a sending module 901, a receiving module 902, an updating module 903 and a storage module 904;

发送模块901用于,向共享内存设备发送数据读请求;数据读请求用于请求读取目标日志,目标日志用于记录主计算节点中数据库的数据变化情况;The sending module 901 is used to send a data read request to the shared memory device; the data read request is used to request to read the target log, and the target log is used to record the data changes in the database in the main computing node;

接收模块902用于,接收共享内存设备发送的目标日志;The receiving module 902 is used to receive the target log sent by the shared memory device;

更新模块903用于,根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;The updating module 903 is used to update the data in the database of the standby computing node according to the target log, so that the data in the database of the standby computing node is synchronized with the data in the database of the main computing node;

存储模块904用于,将目标日志存储在备计算节点的硬盘中。The storage module 904 is used to store the target log in the hard disk of the standby computing node.

在示例性的实施例中,本申请实施例还提供了一种服务器。图10为本申请实施例提供的服务器的组成示意图。如图10所示,该服务器可以包括:处理器1001和存储器1002;存储器1002存储有处理器1001可执行的指令;处理器1001被配置为执行指令时,使得服务器实现如前述方法实施例中描述的方法。In an exemplary embodiment, the embodiment of the present application further provides a server. FIG10 is a schematic diagram of the composition of the server provided in the embodiment of the present application. As shown in FIG10 , the server may include: a processor 1001 and a memory 1002; the memory 1002 stores instructions executable by the processor 1001; when the processor 1001 is configured to execute the instructions, the server implements the method described in the aforementioned method embodiment.

本申请实施例提供一种数据库系统,包括主计算节点,备计算节点以及共享内存设备;共享内存设备基于CXL协议分别与主计算节点和备计算节点通信;主计算节点用于,基于提交的事务,生成目标日志;其中目标日志存储于日志缓冲区中,日志缓冲区部署于主计算节点,用于缓存主计算节点运行过程中生成的日志;目标日志用于记录主计算节点中数据库由于事务导致的数据变化情况;主计算节点还用于,从日志缓冲区获取目标日志,并向共享内存设备发送目标日志;主计算节点还用于,将日志缓冲区中的目标日志存储在主计算节点的硬盘中;备计算节点用于,向共享内存设备发送数据读请求,数据读请求用于请求读取目标日志;共享内存设备用于,响应于数据读请求,向备计算节点发送目标日志;备计算节点还用于,根据目标日志,更新备计算节点中数据库的数据,以使得备计算节点中数据库的数据与主计算节点中数据库的数据保持同步;备计算节点还用于,将目标日志存储在主计算节点的硬盘中。The embodiment of the present application provides a database system, including a main computing node, a standby computing node and a shared memory device; the shared memory device communicates with the main computing node and the standby computing node respectively based on the CXL protocol; the main computing node is used to generate a target log based on a submitted transaction; wherein the target log is stored in a log buffer, the log buffer is deployed on the main computing node, and is used to cache logs generated during the operation of the main computing node; the target log is used to record data changes in the database of the main computing node due to transactions; the main computing node is also used to obtain the target log from the log buffer and send the target log to the shared memory device; the main computing node is also used to store the target log in the log buffer in the hard disk of the main computing node; the standby computing node is used to send a data read request to the shared memory device, the data read request is used to request to read the target log; the shared memory device is used to send the target log to the standby computing node in response to the data read request; the standby computing node is also used to update the data of the database in the standby computing node according to the target log, so that the data of the database in the standby computing node is synchronized with the data of the database in the main computing node; the standby computing node is also used to store the target log in the hard disk of the main computing node.

本申请实施例还提供了一种计算机可读存储介质。上述方法实施例中的全部或者部分流程可以由计算机指令来指示相关的硬件完成,该程序可存储于上述计算机可读存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。计算机可读存储介质可以是前述任一实施例的或内存。上述计算机可读存储介质也可以是上述数据库备份装置的外部存储设备,例如上述数据库备份装置上配备的插接式硬盘,智能存储卡(smart mediacard,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等。进一步地,上述计算机可读存储介质还可以既包括上述数据库备份装置的内部存储单元也包括外部存储设备。上述计算机可读存储介质用于存储上述计算机程序以及上述数据库备份装置所需的其他程序和数据。上述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by computer instructions to instruct the relevant hardware, and the program can be stored in the above computer-readable storage medium. When the program is executed, it may include the processes of the above method embodiments. The computer-readable storage medium can be the memory or memory of any of the above embodiments. The above computer-readable storage medium can also be an external storage device of the above database backup device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the above database backup device. Further, the above computer-readable storage medium can also include both the internal storage unit of the above database backup device and an external storage device. The above computer-readable storage medium is used to store the above computer program and other programs and data required for the above database backup device. The above computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.

本申请实施例还提供一种计算机程序产品,该计算机产品包含计算机程序,当该计算机程序产品在计算机上运行时,使得该计算机执行上述实施例中所提供的任一项数据库备份方法。An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program product is run on a computer, the computer is enabled to execute any one of the database backup methods provided in the above embodiments.

尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看附图、公开内容、以及所附权利要求书,可理解并实现公开实施例的其他变化。在权利要求中,“包括”(Compris ing)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application is described herein in conjunction with various embodiments, in the process of implementing the present application for which protection is sought, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the term "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple components. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (10)

1.一种数据库备份方法,其特征在于,应用于共享内存设备,所述共享内存设备基于计算快速链路CXL协议分别与主计算节点、以及备计算节点通信;所述方法包括:1. A database backup method, characterized in that it is applied to a shared memory device, wherein the shared memory device communicates with a primary computing node and a backup computing node respectively based on a computing fast link CXL protocol; the method comprises: 接收所述主计算节点发送的目标日志;所述目标日志用于记录所述主计算节点中数据库的数据变化情况;Receive a target log sent by the master computing node; the target log is used to record data changes in the database in the master computing node; 接收所述备计算节点的数据读请求,所述数据读请求用于请求读取所述目标日志;receiving a data read request from the standby computing node, where the data read request is used to request to read the target log; 响应于所述数据读请求,向所述备计算节点发送所述目标日志。In response to the data read request, the target log is sent to the standby computing node. 2.根据权利要求1所述的方法,其特征在于,所述共享内存设备配置有传送缓冲区,所述传送缓冲区用于存储待发送至备计算节点的日志;2. The method according to claim 1, characterized in that the shared memory device is configured with a transmission buffer, and the transmission buffer is used to store logs to be sent to the standby computing node; 在接收所述主计算节点发送的目标日志之后,所述方法还包括:After receiving the target log sent by the main computing node, the method further includes: 将所述目标日志保存到所述传送缓冲区;Saving the target log to the transmission buffer; 响应于所述数据读请求,向所述备计算节点发送所述目标日志,包括:In response to the data read request, sending the target log to the standby computing node includes: 响应于所述数据读请求,从所述传送缓冲区获取所述目标日志,并向所述备计算节点发送所述目标日志。In response to the data read request, the target log is obtained from the transmission buffer, and the target log is sent to the standby computing node. 3.根据权利要求2所述的方法,其特征在于,所述目标日志存储于所述传送缓冲区中的目标区域;在将所述目标日志保存到传送缓冲区之后,所述方法还包括:3. The method according to claim 2, wherein the target log is stored in a target area in the transmission buffer; after the target log is saved in the transmission buffer, the method further comprises: 对所述目标区域配置占用标识;所述占用标识用于指示所述目标区域中的内容不可被覆盖。An occupation flag is configured for the target area; the occupation flag is used to indicate that the content in the target area cannot be overwritten. 4.根据权利要求3所述的方法,其特征在于,在从所述传送缓冲区中获取所述目标日志之后,所述方法还包括:4. The method according to claim 3, characterized in that, after obtaining the target log from the transmission buffer, the method further comprises: 删除所述目标区域配置的所述占用标识。The occupancy flag configured in the target area is deleted. 5.根据权利要求1-4任一项所述的方法,其特征在于,所述共享内存设备配置有共享文件系统的服务端;所述接收所述主计算节点发送的目标日志,包括:5. The method according to any one of claims 1 to 4, characterized in that the shared memory device is configured with a server of a shared file system; the receiving the target log sent by the main computing node comprises: 通过所述服务端,接收第一客户端发送的所述目标日志;所述第一客户端配置于所述主计算节点;Receiving, through the server, the target log sent by the first client; the first client is configured on the main computing node; 所述接收所述备计算节点的数据读请求,包括:The receiving a data read request from the standby computing node includes: 通过所述服务端,接收第二客户端发送的所述数据读请求;所述第二客户端配置于所述备计算节点。The data read request sent by the second client is received through the server; the second client is configured on the standby computing node. 6.一种数据库备份方法,其特征在于,应用于主计算节点,所述主计算节点基于计算快速链路CXL协议与共享内存设备通信,所述方法包括:6. A database backup method, characterized in that it is applied to a main computing node, the main computing node communicates with a shared memory device based on a computing fast link CXL protocol, and the method comprises: 所述主计算节点基于提交的事务,生成目标日志;其中所述目标日志存储在日志缓冲区中,所述日志缓冲区部署于所述主计算节点,用于缓存所述主计算节点运行过程中生成的日志;所述目标日志用于记录所述主计算节点中数据库由于所述事务导致的数据变化情况;The master computing node generates a target log based on the submitted transaction; wherein the target log is stored in a log buffer, which is deployed on the master computing node and is used to cache logs generated during the operation of the master computing node; the target log is used to record data changes in the database of the master computing node caused by the transaction; 从所述日志缓冲区获取所述目标日志;Acquire the target log from the log buffer; 向所述共享内存设备发送所述目标日志,以使得备计算节点从所述共享内存设备中获取所述目标日志;Sending the target log to the shared memory device so that the standby computing node obtains the target log from the shared memory device; 将所述日志缓冲区中的所述目标日志存储在所述主计算节点的硬盘中。The target log in the log buffer is stored in the hard disk of the master computing node. 7.一种数据库备份方法,其特征在于,应用于备计算节点,所述备计算节点基于计算快速链路CXL协议与共享内存设备通信,所述方法包括:7. A database backup method, characterized in that it is applied to a standby computing node, the standby computing node communicates with a shared memory device based on a computing fast link CXL protocol, and the method comprises: 向所述共享内存设备发送数据读请求;所述数据读请求用于请求读取目标日志,所述目标日志用于记录所述主计算节点中数据库的数据变化情况;Sending a data read request to the shared memory device; the data read request is used to request to read a target log, and the target log is used to record data changes in the database in the main computing node; 接收所述共享内存设备发送的所述目标日志;Receiving the target log sent by the shared memory device; 根据所述目标日志,更新所述备计算节点中数据库的数据,以使得所述备计算节点中数据库的数据与所述主计算节点中数据库的数据保持同步;According to the target log, update the data in the database of the standby computing node so that the data in the database of the standby computing node is synchronized with the data in the database of the primary computing node; 将所述目标日志存储在所述备计算节点的硬盘中。The target log is stored in the hard disk of the standby computing node. 8.一种数据库备份方法,其特征在于,应用于数据库系统,所述数据库系统包括主计算节点、共享内设备和备计算节点;所述共享内存设备基于计算快速链路CXL协议分别与所述主计算节点和所述备计算节点通信;8. A database backup method, characterized in that it is applied to a database system, wherein the database system includes a main computing node, a shared memory device and a standby computing node; the shared memory device communicates with the main computing node and the standby computing node respectively based on a computing fast link CXL protocol; 所述主计算节点基于提交的事务,生成目标日志;其中所述目标日志存储在日志缓冲区中,所述日志缓冲区部署于所述主计算节点,用于缓存所述主计算节点运行过程中生成的日志;所述目标日志用于记录所述主计算节点中数据库由于所述事务导致的数据变化情况;The master computing node generates a target log based on the submitted transaction; wherein the target log is stored in a log buffer, which is deployed on the master computing node and is used to cache logs generated during the operation of the master computing node; the target log is used to record data changes in the database of the master computing node caused by the transaction; 所述主计算节点从所述日志缓冲区获取目标日志,并向所述共享内存设备发送的目标日志;The main computing node obtains the target log from the log buffer and sends the target log to the shared memory device; 所述主计算节点将所述日志缓冲区中的所述目标日志存储在所述主计算节点的硬盘中;The main computing node stores the target log in the log buffer in the hard disk of the main computing node; 所述备计算节点向所述共享内存设备发送数据读请求,所述数据读请求用于请求读取所述目标日志;The standby computing node sends a data read request to the shared memory device, where the data read request is used to request to read the target log; 所述共享内存设备响应于所述数据读请求,向所述备计算节点发送所述目标日志;The shared memory device sends the target log to the standby computing node in response to the data read request; 所述备计算节点根据所述目标日志,更新所述备计算节点中数据库的数据,以使得所述备计算节点中数据库的数据与所述主计算节点中数据库的数据保持同步;The standby computing node updates the data in the database of the standby computing node according to the target log, so that the data in the database of the standby computing node is synchronized with the data in the database of the primary computing node; 所述备计算节点将所述目标日志存储在所述备计算节点的硬盘中。The standby computing node stores the target log in a hard disk of the standby computing node. 9.一种服务器,其特征在于,所述服务器包括处理器和存储器;所述处理器与所述存储器耦合;所述存储器用于存储计算机指令,所述计算机指令由所述处理器加载并执行以使服务器实现如权利要求1-7任一项所述的数据库备份方法。9. A server, characterized in that the server comprises a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the server to implement the database backup method as described in any one of claims 1-7. 10.一种共享内存设备,其特征在于,用于执行如权利要求1-5任一项所述的数据库备份方法。10. A shared memory device, characterized in that it is used to execute the database backup method according to any one of claims 1 to 5.
CN202410390963.0A 2024-04-01 2024-04-01 A database backup method, server and shared memory device Pending CN118467243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410390963.0A CN118467243A (en) 2024-04-01 2024-04-01 A database backup method, server and shared memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410390963.0A CN118467243A (en) 2024-04-01 2024-04-01 A database backup method, server and shared memory device

Publications (1)

Publication Number Publication Date
CN118467243A true CN118467243A (en) 2024-08-09

Family

ID=92159520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410390963.0A Pending CN118467243A (en) 2024-04-01 2024-04-01 A database backup method, server and shared memory device

Country Status (1)

Country Link
CN (1) CN118467243A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119520371A (en) * 2024-12-04 2025-02-25 天翼云科技有限公司 Data forwarding method, device, computer equipment, readable storage medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119520371A (en) * 2024-12-04 2025-02-25 天翼云科技有限公司 Data forwarding method, device, computer equipment, readable storage medium and program product

Similar Documents

Publication Publication Date Title
US12155722B2 (en) Metadata journal in a distributed storage system
CN100405304C (en) Implementation method of high-speed solid-state storage device based on storage area network
US12229094B2 (en) Proxy-based database scaling
CN110457261B (en) Data access method, device and server
CN102521114B (en) File system log storage system under virtualization environment
CN107832423B (en) A file reading and writing method for distributed file system
US9940152B2 (en) Methods and systems for integrating a volume shadow copy service (VSS) requester and/or a VSS provider with virtual volumes (VVOLS)
CN111708719B (en) Computer storage acceleration method, electronic equipment and storage medium
CN103455577A (en) Multi-backup nearby storage and reading method and system of cloud host mirror image file
US20220253252A1 (en) Data processing method and apparatus
US20060117074A1 (en) Method and apparatus for database cluster recovery
CN105681402A (en) Distributed high speed database integration system based on PCIe flash memory card
WO2022033269A1 (en) Data processing method, device and system
CN117311593A (en) Data processing method, device and system
CN118467243A (en) A database backup method, server and shared memory device
CN106406750A (en) Data operation method and system
WO2024169299A1 (en) Storage method and apparatus, device, and non-volatile readable storage medium
CN115878311A (en) Computing node cluster, data aggregation method and related equipment
WO2025092543A1 (en) Dual-machine hot standby management method and computing device
WO2024131379A1 (en) Data storage method, apparatus and system
CN115793957A (en) Method and device for writing data and computer storage medium
EP4152163A1 (en) Method for processing metadata in storage device and related device
CN115129247A (en) A data writing method, system, device and readable storage medium
WO2022222523A1 (en) Log management method and apparatus
CN115858237A (en) Data processing method and storage device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination