Distributed storage management method, electronic device, storage medium, and program product

By writing cyclic redundancy check codes into metadata in a distributed storage system and adopting a metadata separation transmission method, the delay problem caused by frequent thread switching is solved and the performance of distributed storage is improved.

CN120296065BActive Publication Date: 2025-10-10JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510772012.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-10-10
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

Existing distributed storage systems have the problem of frequent thread switching when processing client requests, resulting in large delays and low performance.

Method used

By writing the cyclic redundancy check code of the data into the metadata, the amount of metadata written to the distributed key-value storage database is reduced, and the metadata separation transmission method is adopted to avoid data copying and improve read and write performance.

Benefits of technology

It improves the read and write performance of the distributed storage system, reduces the amount of metadata written, and improves the performance of the distributed key-value storage database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296065B_ABST
    Figure CN120296065B_ABST
Patent Text Reader

Abstract

The application discloses a distributed storage management method, an electronic device, a storage medium and a program product, relates to the technical field of distributed storage, and writes a cyclic redundancy check code corresponding to data into metadata, reduces the amount of metadata written into a distributed key-value storage database, and improves the performance of the distributed key-value storage database. The application extends a network transmission protocol, supports a metadata separate transmission mode, supports a data logical block pointer and an independent metadata logical block pointer when a distributed storage protocol access layer processes a read-write request, reduces data copying of the distributed storage through the metadata separate transmission mode, and improves read-write performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed storage technology, and in particular to a distributed storage management method, electronic device, storage medium, and program product. Background Art

[0002] In related technologies, client requests are processed by setting up primary storage nodes and backup storage nodes. However, each storage node needs to switch threads multiple times when processing client requests, such as communication threads, threads for writing data to the local disk, threads for writing data to the local database, etc. Each thread switch involves request entry and exit from the queue, resulting in a large delay in client request processing and low performance of distributed storage. Summary of the Invention

[0003] The present application provides a distributed storage management method, electronic device, storage medium and program product to at least solve the problems of large client request processing delay and low distributed storage performance in related technologies.

[0004] This application provides a distributed storage management method, including:

[0005] Receive write requests sent by the client;

[0006] In response to receiving a write request sent by a client, determining a cyclic redundancy check code of target business data corresponding to the write request;

[0007] Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0008] Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0009] Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0010] In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0011] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the following steps of the distributed storage management method when executing the computer program:

[0012] Receive write requests sent by the client;

[0013] In response to receiving a write request sent by a client, determining a cyclic redundancy check code of target business data corresponding to the write request;

[0014] Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0015] Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0016] Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0017] In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0018] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the following steps of the distributed storage management method are implemented:

[0019] Receive write requests sent by the client;

[0020] In response to receiving a write request sent by a client, determining a cyclic redundancy check code of target business data corresponding to the write request;

[0021] Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0022] Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0023] Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0024] In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0025] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the following steps of the distributed storage management method:

[0026] Receive write requests sent by the client;

[0027] In response to receiving a write request sent by a client, determining a cyclic redundancy check code of target business data corresponding to the write request;

[0028] Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0029] Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0030] Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0031] In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0032] This application reduces the amount of metadata written to a distributed key-value storage database by writing the cyclic redundancy check code corresponding to the data into the metadata, thereby improving the performance of the distributed key-value storage database. This application extends the network transmission protocol to support metadata separation transmission. When the distributed storage protocol access layer processes read and write requests, the cyclic redundancy check code is placed in an independent metadata logical block pointer to avoid data copying and improve read and write performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0034] Figure 1 A schematic diagram of a write request processing flow in Ceph, an open source distributed storage, is provided for an embodiment of the present application to provide a distributed storage management method;

[0035] Figure 2 A schematic diagram of the logical architecture of distributed file storage for a distributed storage management method provided in an embodiment of the present application;

[0036] Figure 3 An application environment diagram of a distributed storage management method is provided for an embodiment of the present application;

[0037] Figure 4 A schematic diagram of the overall process of a distributed storage management method is provided for an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a write request processing flow for a distributed storage management method is provided for an embodiment of the present application;

[0039] Figure 6 A schematic diagram of a flow chart of a method for generating NVME metadata for a distributed storage management method is provided in an embodiment of the present application;

[0040] Figure 7 A schematic diagram of a read request processing flow of a distributed storage management method is provided for an embodiment of the present application;

[0041] Figure 8 A data copy process diagram of a distributed storage management method is provided for an embodiment of the present application;

[0042] Figure 9 A schematic diagram of a buffer pointer-based write request processing flow for a distributed storage management method is provided in an embodiment of the present application;

[0043] Figure 10 A schematic diagram of a read request processing flow based on a buffer pointer is provided for a distributed storage management method according to an embodiment of the present application;

[0044] Figure 11 FIG. 1 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0045] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0046] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0047] It should be noted that the terms "S1", "S2", etc. are used only for the purpose of describing the steps and do not specifically refer to the order or sequence, nor are they used to limit this application. They are merely for the convenience of describing the method of this application and should not be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0048] In order to meet the demand for high-speed storage, the NVMe (Non-Volatile Memory Express, designed to access non-volatile memory media connected through the PCI-Express bus) protocol was born in 2011. It brings more efficient performance to non-volatile storage devices such as SSDs. However, NVMe was initially only able to connect to servers through the PCIe bus, which limited the scalability of storage. To solve this problem, NVMe-oF (NVMe over Fabrics, a storage network protocol that allows hosts to access remote NVMe SSD devices through the network) was launched in 2016. It extends the NVMe protocol to the network, allowing remote access to NVMe storage devices through various network structures. NVMe-oF supports multiple transmission protocols, including Ethernet, InfiniBand (InfiniBand) and Fibre Channel. With the continuous advancement of technology, the performance of NVMe-oF will be further improved and the cost will gradually decrease. If NVMe-oF technology can be used in distributed storage, the performance of distributed storage will be improved; NVMe Meta includes two transmission methods. The first is a continuous method, that is, data and metadata use a block of Data Buffer (data buffer), the metadata of each logical block is stored behind the data of the logical block. The second is the separation method, that is, the data and metadata each use an independent Buffer (buffer). In related technologies, such as Figure 1 As shown, taking the open source distributed storage ceph (unified distributed storage system) as an example, the write request processing flow is as follows: the protocol access layer receives the write request from the protocol client; sends a write request to the OSD (storage node) master, carrying the object ID (unique identifier) ​​and the offset within the object; the OSD master sends a write request to the two standby nodes, and the message communication uses the communication component inside Ceph. Taking 3-copy redundancy as an example, 3 OSD processes need to be written. One of the 3 OSDs acts as the master node and replicates the write request to the standby node; the OSD master and OSD standby allocate hard disk space for the object according to the object ID, write the data to the local disk, and then write the object size and data CRC to the local database; the data CRC is used to perform a CRC (cyclic redundancy check) check when reading data to check the correctness of the data; the OSD master receives the response and sends a response to the protocol access layer. According to the background technology, the performance of the communication component of the related technology ceph is better than that of the open source spdk (Storage Performance Development The open-source SPDK (Open Source Storage Performance Development Kit) implements the NVMe-oF protocol and uses a polling thread model. This eliminates locks during I / O processing, resulting in higher performance. However, each OSD needs to switch threads multiple times when processing a write request, including the communication thread, the thread that writes data to the local disk, and the thread that writes to the local database. Each thread switch involves queueing and dequeuing requests, resulting in long latency in processing write requests.

[0049] To solve the above technical problems, the present application provides a distributed storage management method, electronic device, storage medium and program product. By writing the cyclic redundancy check code corresponding to the data into the metadata, the amount of metadata written to the distributed key-value storage database is reduced, and the performance of the distributed key-value storage database is improved. The present application extends the network transmission protocol to support metadata separation transmission mode. When the distributed storage protocol access layer processes read and write requests, the cyclic redundancy check code is placed in an independent metadata logical block pointer to avoid data copying and improve read and write performance.

[0050] For the convenience of explanation, the terms appearing in the embodiments of this application are first explained in a unified manner:

[0051] OSD: Object-based Storage Device, object storage device, is a storage node responsible for storing and retrieving data. A node has multiple OSD processes. Each OSD is a process that mounts a data hard disk and can read and write data to the disk.

[0052] PG: Placement Group, a carrier for placing objects. A storage pool creates multiple PGs.

[0053] Object: Business object, distributed in each PG. A PG stores a large number of objects, and data is stored in data blocks.

[0054] RDMA: Remote Direct Memory Access, is a high-performance, low-latency network data transmission technology that can directly transfer data from the memory of one computer to the memory of another without passing through the CPU (central processing unit), thereby reducing the time and complexity of CPU participation in the transmission and improving data transmission efficiency and throughput.

[0055] NVMe: Non-Volatile Memory Express is a protocol for highly parallel data transmission, mainly used in non-volatile storage devices such as solid-state drives (SSDs). NVMe commands map input / output (I / O) and responses to the host computer's memory and transmit them through the PCIe interface. It supports parallel I / O with multi-core processors to improve throughput and solve CPU bottleneck problems.

[0056] NVMe SSD (Non-Volatile Memory Express Solid State Drive): is a solid state drive that uses the NVMe protocol and has the characteristics of high performance, low latency, multiple queues, and high concurrency.

[0057] LBA: Logical Block Addressing. In the LBA model, data is divided into multiple logical blocks. Each logical block is usually 512 bytes or 4KB. These logical blocks are the basic units of data storage and access. Each logical block has a unique identifier, namely the LBA address.

[0058] NVMe-oF (Non-Volatile Memory Express over Fabrics) is a technology that uses network fabrics to extend the NVMe protocol to external server storage. It inherits the low latency and high throughput characteristics of the NVMe protocol and can be extended across various network fabrics, including Ethernet, Fibre Channel (FC), and InfiniBand. This allows for flexible allocation and expansion of storage resources to meet the needs of data centers and enterprises of varying sizes.

[0059] NVMe metadata: Additional information for each logical block of data, usually used to store data protection information, such as CRC (cyclic redundancy check) and ECC (error correction code), to ensure the reliability of data transmission and storage. There are two ways to transmit metadata: one is continuous, in which the metadata of each logical block is stored after the logical block; the other is separate, in which metadata and data use different caches.

[0060] Distributed KV: A database that stores data in the form of key-value pairs on multiple nodes, with high availability, scalability, and fault tolerance.

[0061] The present application embodiment is applied to a distributed file storage system, such as Figure 2 As shown, Figure 2 This is a logical architecture diagram of distributed file storage. The protocol access layer processes requests from protocol clients. Taking write requests as an example, data is written to the storage pool and a file metadata update request is sent to the MDS (File Metadata Service). The MDS first updates the metadata cache and then writes the file metadata to the distributed KV database. Finally, a success is returned to the protocol access layer. The protocol access layer is a data transmission device configured with the NVMeoF protocol.

[0062] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0063] The distributed storage management method provided in this application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with a data processing platform provided on the server 104 via a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0064] like Figure 4 As shown, the embodiment of the present application provides a distributed storage management method, which is applied to Figure 3 The following steps are explained using the terminal in as an example: (the technical terms involved must be explained).

[0065] S1: Receives the write request sent by the client.

[0066] It should be noted that a write request refers to a type of information sent by the client to the server for writing data or performing operations. A write request usually includes three parts: a request line, a request header, and a request body. Among them, the request line refers to the request method (such as GET, POST, PUT, etc.) and the target URL of the request. The request header is used to provide additional information about the request, such as user agent, cookies, content type, etc. The request body contains data to be sent to the server, such as form data or uploaded files. The write request in this application contains the business data to be written and the business object corresponding to the business data. The business object refers to the business that uses the business data.

[0067] S2: In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request.

[0068] It should be noted that the cyclic redundancy check code refers to a check code obtained based on CRC. It is a check code calculated by a fast algorithm based on data such as network data packets or computer files to generate a short fixed-bit check code. It is mainly used to detect or check errors that may occur after data transmission or storage.

[0069] S3: Generate target metadata based on cyclic redundancy check code and data writing mechanism.

[0070] It should be noted that the data writing mechanism is to write the cyclic redundancy check code into the nvme metadata of the corresponding logical block to obtain the final target metadata.

[0071] S4: Generate target storage data based on the mapping relationship between the target business data, target metadata and logical block addresses.

[0072] It should be noted that the logical block refers to the smallest storage unit of the hard disk space, and the logical block address refers to the lba address, which is determined by the logical block to which the data needs to be written.

[0073] S5: Based on the network transmission protocol, the target storage data is written to the storage node corresponding to the logical block address.

[0074] It should be noted that the network transmission protocol refers to the NVMe-oF protocol, which is a storage network protocol. The storage nodes refer to the primary storage node and the secondary storage node, such as the primary OSD, backup OSD1, backup OSD2, etc. shown in the figure.

[0075] S6: In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0076] It should be noted that the distributed key-value storage database refers to distributed KV. The mapping relationship is used to record the correspondence between the business object range corresponding to the stored data and the internal object range. The internal object refers to the hard disk space in the pre-applied storage node, the business object range refers to the data range corresponding to the business object, and the internal object range refers to the range of data stored in the internal object. Distributed KV is used to store the correspondence between internal objects and the addresses of logical blocks in each storage node.

[0077] In the above implementation, data CRC is written into NVMe metadata, which reduces the amount of metadata written to the distributed KV and improves the performance of the distributed KV. For example, taking 4MB of data as an example, each 4KB NVMe logical block needs to calculate 4 bytes of CRC, and 1MB of data corresponds to 256 CRCs, occupying 4KB of space. When the value of the distributed KV is greater than 1KB, the modification will cause a large write amplification, resulting in a decrease in the performance of the distributed KV. Therefore, reducing the amount of metadata written can improve the performance of the distributed KV.

[0078] In some embodiments, such as Figure 5 As shown, in response to receiving a write request sent by a client, before determining a cyclic redundancy check code of target service data corresponding to the write request, the method includes:

[0079] Detect whether the process of the protocol access layer corresponding to the network transmission protocol has been started, wherein the network transmission protocol is the above-mentioned NVMe-oF protocol;

[0080] In response to the process of the protocol access layer corresponding to the network transmission protocol being started, the internal object pre-application operation is performed, that is, the protocol access layer begins to perform the internal object pre-application operation after the process is started, so that when a client write request is received, the internal object can be written directly. The role of the internal object is to apply for hard disk space on the data OSD in advance.

[0081] In some specific implementations, in response to a process at a protocol access layer corresponding to a network transmission protocol being started, performing an internal object pre-application operation includes:

[0082] In response to the process of the protocol access layer corresponding to the network transmission protocol being started, sending an internal object pre-application request to the primary storage node;

[0083] In response to the primary storage node receiving the internal object pre-application request, the primary storage node sends the internal object pre-application request to multiple backup storage nodes through the primary storage node. That is, after the primary OSD receives the internal object pre-application request, it sends the pre-application request to the data OSD (i.e., the backup storage node). Among them, one internal object pre-application can apply for a larger space, for example, 64MB. Assuming that the size of each service request is 1MB, one pre-application can process 64 service requests;

[0084] In response to the backup storage node receiving the internal object pre-application request, allocating hard disk space for the internal object through the backup storage node according to the hard disk space size corresponding to the internal object pre-application request;

[0085] In response to the allocation completion, the response result of the internal object pre-application request is returned to the main storage node. The response result includes the logical block address of the allocated hard disk space, that is, the data OSD allocates hard disk space for the internal object and returns the pre-application request response result. The response result includes the lba address of the locally allocated space.

[0086] In some specific embodiments, after returning the response result of the internal object pre-application request to the primary storage node, the method further includes:

[0087] The logical block address is written into the distributed key-value storage database through the primary storage node and returned to the protocol access layer. That is, the primary OSD writes the lba address of the internal object on each data OSD into the distributed KV. Taking 3 replicas as an example, 3 lba addresses are recorded. Then, the pre-application response result returned by the primary OSD carries the lba address on each OSD.

[0088] In the above embodiment, the protocol access layer performs an internal object pre-application operation after the process is started, so that when a client data write request is received, the internal object can be directly written, thereby improving data writing efficiency.

[0089] In some specific implementations, obtaining the hard disk space size corresponding to the multiple task applications of the internal object pre-application request;

[0090] The space size requested by the target task is divided and classified according to the preset space step size. The preset space step size can be set according to actual needs. For example, 4KB means that the space requested is in the range of 0-4KB, which belongs to the first category, and the space requested is in the range of 4-8KB, which belongs to the second category, etc.

[0091] In response to the number of occurrences of the target category corresponding to the spatial size corresponding to the target task being greater than a preset threshold, mapping the spatial range value corresponding to the target category with the target task to generate a mapping relationship, and saving the mapping relationship;

[0092] If it is detected again that the target task applies for hard disk space, the corresponding space range value is determined based on the mapping relationship, the maximum value in the range value is selected as the hard disk space to be applied for, and the hard disk space is allocated based on the hard disk space to be applied for.

[0093] In the above implementation, by determining the mapping relationship between the target task and the space range value, the accuracy of hard disk space allocation can be improved, thereby avoiding resource waste or insufficient resource allocation, and improving the performance of the distributed storage system.

[0094] In some specific implementations, in response to receiving a write request sent by a client, determining a cyclic redundancy check code of target service data corresponding to the write request includes:

[0095] Initialize a cyclic redundancy check register, which is used to calculate a cyclic redundancy check code for target service data;

[0096] The target business data is segmented according to the size of the logic block, and the segmented target business data is processed based on the cyclic redundancy check register to obtain the cyclic redundancy check code corresponding to the segmented target business data.

[0097] In some specific implementations, generating target metadata based on a cyclic redundancy check code and a data writing mechanism includes:

[0098] Determining a target logical block corresponding to a target cyclic redundancy check code and metadata of the target logical block;

[0099] The target cyclic redundancy check code is written into the metadata of the target logic block to obtain target metadata corresponding to the target logic block.

[0100] Specifically, such as Figure 6As shown, after receiving the write request of the client, the protocol access layer calculates the CRC, generates the nvme metadata, wherein data copying is required in the process of generating the nvme metadata, the original data (i.e. target business data) is segmented in 4KB (the size of the nvme logical block) granularity, then the CRC of each 4KB data is calculated, and the CRC is written into the nvme metadata of the logical block to obtain the target metadata.

[0101] In the above embodiment, the CRC of the business data is calculated and written into the nvme metadata, so as to verify the data after the data transmission operation is performed, thereby improving the security of reading the data.

[0102] In some specific embodiments, generating the target storage data based on the mapping relationship among the target business data, the target metadata and the logical block address comprises:

[0103] Obtaining the hard disk space size required for the target business data and the target metadata corresponding to the target business data;

[0104] Based on the hard disk space size, determining the logical block corresponding to the target business data and the target metadata corresponding to the target business data;

[0105] Obtaining the address of the logical block;

[0106] Based on the target business data, the target metadata and the address of the logical block, generating the mapping relationship;

[0107] Based on the mapping relationship, generating the target storage data.

[0108] In some specific embodiments, writing the target storage data into the storage node corresponding to the logical block address based on the network transmission protocol comprises:

[0109] Obtaining the logical block address in the target storage data, and defining the network transmission protocol as a storage network protocol;

[0110] Based on the storage network protocol, writing the target storage data into the storage node corresponding to the logical block address.

[0111] In some specific embodiments, in response to the writing completion, writing the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node into the distributed key-value storage database comprises:

[0112] In response to the writing completion, obtaining the data range stored in the corresponding hard disk space of the target storage data and the data range corresponding to the target storage data;

[0113] Based on the data range stored in the corresponding hard disk space of the target storage data and the data range corresponding to the target storage data, generating the mapping relationship;

[0114] write the mapping relationship into the distributed key-value storage database.

[0115] Specifically, the protocol access layer writes a message including data, nvme metadata, and an lba address into each data OSD through the nvme-of protocol; after the protocol access layer collects the responses, that is, the write operation is completed, the forward relationship (the mapping relationship) is written into the distributed KV, wherein the forward relationship records the corresponding relationship between the business object range and the internal object range, for example, 0-1MB of the business object obj_service is written into 2MB-3MB of obj_internal.

[0116] In the above embodiment, by writing the mapping relationship into the distributed KV, the corresponding data can be directly obtained through the mapping relationship when responding to the read request subsequently, thereby improving the processing efficiency of the data read request.

[0117] In some specific embodiments, the method further includes:

[0118] In response to receiving the read request sent by the client, sending a mapping relationship query request to the distributed key-value storage database through the protocol access layer;

[0119] Receiving a response result of the mapping relationship query request returned by the distributed key-value storage database, the response result at least including a mapping relationship between a business object range corresponding to the target storage data and an internal object range in the storage node, and a logical block address of a read range corresponding to the read request on the internal object;

[0120] Based on the logical block address, obtaining data corresponding to the read request and metadata corresponding to the data.

[0121] In some specific embodiments, based on the logical block address, obtaining data corresponding to the read request includes:

[0122] Based on the storage network protocol and the logical block address, sending a read request to the primary storage node and / or the backup storage node, and receiving data corresponding to the read request and metadata corresponding to the data.

[0123] In some specific embodiments, after obtaining data corresponding to the read request based on the logical block address, the method includes:

[0124] In response to the data corresponding to the read request being received, verifying the data according to a cyclic redundancy check code in the metadata corresponding to the data;

[0125] In response to the verification being successful, deleting the metadata and returning the data to the client.

[0126] Specifically, as Figure 7 and Figure 8As shown in the figure, for read requests, the processing flow is as follows: the protocol access layer receives the read request from the client; the protocol access layer sends a query mapping relationship request to the distributed KV; the protocol access layer obtains the LBA address of the internal object in the client's read range based on the mapping relationship, and sends an NVMe-of read request to the data OSD; after the protocol access layer receives the response result from the data OSD, it performs a CRC check based on the NVMe metadata; after successful verification, the protocol access layer copies the data, deletes the NVMe metadata, carries the copied data in the response message sent to the client, and sends it to the client.

[0127] In the above embodiment, the data to be read is determined by the mapping relationship stored in the distributed KV, and a verification operation is performed after the data is read, thereby improving the data reading efficiency and ensuring the reliability of the read data.

[0128] In some embodiments, the method further comprises:

[0129] In response to the write request including a first logical block pointer of target metadata and a second logical block pointer of target business data, the read request issued by the client is responded to according to the first logical block pointer and the second logical block pointer, wherein the first logical block pointer refers to the NVMe metadata buffer pointer and the second logical block pointer refers to the original data buffer pointer.

[0130] Specifically, such as Figure 9 As shown, the protocol access layer receives the client's write request, calculates CRC, and generates NVMe metadata. The calculation process does not require copying the original data. When sending the NVMe-of write request, it carries the original data buffer pointer and the NVMe metadata buffer pointer, as shown in Figure 10 As shown in the figure, when the protocol access layer processes a read request, it sends an nvme-of read request to the OSD, carrying a data buffer pointer and an nvme metadata buffer pointer. After receiving the CRC check result, the protocol access layer sends the data in the data buffer to the client without the need to copy the data.

[0131] In the above implementation, by extending the NVMe-of protocol to support NVMe metadata separation transmission, the distributed storage protocol access layer puts the CRC into an independent NVMe metadata buffer when processing read and write requests, avoiding data copying and improving read and write performance.

[0132] In the above-mentioned distributed storage management method, the method includes: receiving a write request sent by a client; in response to receiving the write request sent by the client, determining a cyclic redundancy check code of the target business data corresponding to the write request; generating target metadata based on the cyclic redundancy check code and the data writing mechanism; generating target storage data based on the mapping relationship between the target business data, the target metadata and the logical block address; writing the target storage data into the storage node corresponding to the logical block address based on the network transmission protocol; in response to the completion of the write, writing the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node into the distributed key-value storage database. This application supports the protocol access layer to directly write data to the SSD through the NVMe-OF protocol, and utilizes the low latency and high throughput characteristics of NVMe-OF to improve the performance of distributed storage; this application supports writing data CRC into the NVMe metadata, reducing the writing of distributed KV, and improving the performance of distributed KV. This application extends the NVMe-OF protocol to support the NVMe metadata separation transmission method. The distributed storage protocol access layer reduces memory copying and improves write performance.

[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0134] It should be understood that although Figures 4-10 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figures 4-10 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0135] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a distributed storage management method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0136] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0137] An embodiment of the present application provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform steps in an embodiment of a distributed storage management method, including:

[0138] S1: Receives the write request sent by the client;

[0139] S2: In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request;

[0140] S3: Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0141] S4: Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0142] S5: Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0143] S6: In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0144] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the steps of the embodiment of the distributed storage management method when running, including:

[0145] S1: Receives the write request sent by the client;

[0146] S2: In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request;

[0147] S3: Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0148] S4: Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0149] S5: Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0150] S6: In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0151] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0152] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the embodiment of the distributed storage management method are implemented, including:

[0153] S1: Receives the write request sent by the client;

[0154] S2: In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request;

[0155] S3: Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0156] S4: Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0157] S5: Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0158] S6: In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0159] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the embodiment of the distributed storage management method are implemented, including:

[0160] S1: Receives the write request sent by the client;

[0161] S2: In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request;

[0162] S3: Generate target metadata based on cyclic redundancy check code and data writing mechanism;

[0163] S4: Generate target storage data based on the mapping relationship between target business data, target metadata and logical block addresses;

[0164] S5: Based on the network transmission protocol, the target storage data is written into the storage node corresponding to the logical block address;

[0165] S6: In response to the writing being completed, the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node is written into the distributed key-value storage database.

[0166] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0167] The above is a detailed introduction to the distributed storage management method, device, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A distributed storage management method, characterized in that: The method comprises: Receive write requests sent by the client; In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request; generating target metadata based on the cyclic redundancy check code and the data writing mechanism; generating target storage data based on a mapping relationship among the target service data, the target metadata, and the logical block address; Based on a network transmission protocol, writing the target storage data into a storage node corresponding to the logical block address; In response to the writing being completed, writing the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node into the distributed key-value storage database; In response to receiving a write request sent by the client, determining a cyclic redundancy check code of target service data corresponding to the write request includes: Initialize cyclic redundancy check register; Segmenting the target service data according to the size of the logical blocks, and processing the segmented target service data based on the cyclic redundancy check register to obtain cyclic redundancy check codes corresponding to the segmented target service data; Generating target metadata based on the cyclic redundancy check code and the data writing mechanism includes: Determining a target logical block corresponding to a target cyclic redundancy check code and metadata of the target logical block; Writing the target cyclic redundancy check code into the metadata of the target logic block to obtain target metadata corresponding to the target logic block; Writing the target storage data into the storage node corresponding to the logical block address based on the network transmission protocol includes: Obtaining a logical block address in the target storage data, and defining the network transmission protocol as a storage network protocol; Based on the storage network protocol, the target storage data is written into the storage node corresponding to the logical block address.

2. The distributed storage management method according to claim 1, characterized in that: Before determining, in response to receiving a write request sent by a client, a cyclic redundancy check code of target service data corresponding to the write request, the method includes: Detecting whether a process of a protocol access layer corresponding to the network transmission protocol has been started; In response to the process of the protocol access layer corresponding to the network transmission protocol being started, an internal object pre-application operation is performed.

3. The distributed storage management method according to claim 2, characterized in that: In response to the process of the protocol access layer corresponding to the network transmission protocol being started, performing the internal object pre-application operation includes: In response to the process of the protocol access layer corresponding to the network transmission protocol being started, sending an internal object pre-application request to the primary storage node; In response to the primary storage node receiving the internal object pre-application request, sending the internal object pre-application request to multiple backup storage nodes through the primary storage node; In response to the backup storage node receiving the internal object pre-application request, allocating hard disk space for the internal object through the backup storage node according to the hard disk space size corresponding to the internal object pre-application request; In response to the allocation being completed, a response result of the internal object pre-application request is returned to the primary storage node, wherein the response result includes the logical block address of the allocated hard disk space.

4. The distributed storage management method according to claim 3, characterized in that: After returning the response result of the internal object pre-application request to the primary storage node, the method further includes: The logical block address is written into the distributed key-value storage database through the primary storage node, and the logical block address is returned to the protocol access layer.

5. The distributed storage management method according to claim 1, characterized in that: Generating target storage data based on a mapping relationship among the target business data, the target metadata, and the logical block address includes: Obtaining the hard disk space required for the target business data and target metadata corresponding to the target business data; Determining the target business data and a logic block corresponding to the target business data based on the size of the hard disk space; Obtaining the address of the logic block; generating a mapping relationship based on the target service data, the target metadata, and the address of the logic block; Based on the mapping relationship, the target storage data is generated.

6. The distributed storage management method according to claim 1, characterized in that: In response to the writing being completed, writing the mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node into the distributed key-value storage database includes: In response to the writing being completed, obtaining a data range of the target storage data stored in the corresponding hard disk space and a data range corresponding to the target storage data; Generate a mapping relationship based on a data range of the target storage data stored in the corresponding hard disk space and a data range corresponding to the target storage data; The mapping relationship is written into the distributed key-value storage database.

7. The distributed storage management method according to claim 1, characterized in that: The method further comprises: In response to receiving the read request sent by the client, sending a mapping relationship query request to the distributed key-value storage database through the protocol access layer; Receive a response result of the mapping relationship query request returned by the distributed key-value storage database, the response result including at least a mapping relationship between the business object range corresponding to the target storage data and the internal object range in the storage node, and a logical block address of the read range corresponding to the read request on the internal object; Based on the logical block address, data corresponding to the read request and metadata corresponding to the data are obtained.

8. The distributed storage management method according to claim 7, characterized in that: Acquiring data corresponding to the read request based on the logical block address includes: Based on the storage network protocol and the logical block address, the read request is sent to the primary storage node and / or the backup storage node, and the data corresponding to the read request and metadata corresponding to the data are received.

9. The distributed storage management method according to claim 8, characterized in that: After obtaining the data corresponding to the read request based on the logical block address, the method includes: In response to the data corresponding to the read request having been received, verifying the data according to a cyclic redundancy check code in metadata corresponding to the data; In response to successful verification, the metadata is deleted and the data is returned to the client.

10. The distributed storage management method according to claim 1, characterized in that: The method further comprises: In response to the first logical block pointer of the target metadata and the second logical block pointer of the target business data included in the write request, the read request issued by the client is responded to according to the first logical block pointer and the second logical block pointer.

11. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the distributed storage management method according to any one of claims 1 to 10 when executing the computer program.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the distributed storage management method according to any one of claims 1 to 10.

13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the distributed storage management method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Data storage method and device, equipment and storage medium

    CN119739348A