Distributed object storage method and device, equipment and medium
By splitting the objects to be stored in the object storage service into multiple key-value pairs of data, and determining their corresponding data storage nodes in the distributed object storage system, the problem of local overload of the cluster in the object storage service is solved, and the problem of "local overload" in the object storage service is realized. Load balancing and efficient storage.
Patent Information
- Application Number
- CN202411472759.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Existing object storage services have local cluster overload problems, which affects service availability.
By splitting the target object to be stored into multiple key-value pair data, and determining the target partition corresponding to the multiple key-value pair data from multiple partitions of the preset distributed object storage system, the preset The partition view determines the data storage node currently holding the target partition, obtains the data storage node corresponding to the multiple key-value pairs of data, and finally caches the multiple key-value pairs of data into the corresponding data storage nodes.
By splitting the target object with key-value pairs and cache multiple key-value pairs in the corresponding data storage nodes in a distributed manner, the purpose of node load dispersed is achieved, thereby effectively alleviating the problem of local overload of the cluster of object storage services.
Smart Images

Figure CN119441171A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a distributed object storage method, apparatus, device and medium. Background Art
[0002] Object storage services can store and call various unstructured data files including text, pictures, audio and video at any time through the network. They are usually provided to users in the form of cloud services. They have the characteristics of high scalability, low cost, high durability, etc., and can effectively meet the needs of massive data storage. However, existing object storage services have the problem of local cluster overload, that is, the load of local nodes in the cluster exceeds its processing capacity, thus affecting service availability. Therefore, there is an urgent need to improve object storage services. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a distributed object storage method, apparatus, device and medium.
[0004] An embodiment of the present disclosure provides a distributed object storage method, the method comprising: splitting a target object to be stored into multiple key-value pairs; determining target partitions corresponding to each of the multiple key-value pairs from multiple partitions of a preset distributed object storage system; determining a data storage node currently holding the target partition based on a preset partition view, and obtaining data storage nodes corresponding to each of the multiple key-value pairs; wherein the partition view is used to indicate meta information of the multiple partitions, and the meta information at least includes information of the data storage node holding the partition; the data storage node is a storage node of the distributed object storage system; and the multiple key-value pairs are cached in the corresponding data storage nodes.
[0005] Optionally, determining the target partitions corresponding to each of the multiple key-value pair data from multiple partitions of a preset distributed object storage system includes: performing hash processing on the multiple key-value pair data respectively to obtain hash values corresponding to each of the multiple key-value pair data; and determining the target partitions corresponding to each of the multiple key-value pair data from multiple partitions of the preset distributed object storage system based on the hash values corresponding to each of the multiple key-value pair data.
[0006] Optionally, the multiple partitions include a first partition, the first partition is a partition where replica data exists, and the first partition corresponds to multiple data storage nodes, and the multiple identical replica data corresponding to the first partition are distributed on different data storage nodes.
[0007] Optionally, the multiple data storage nodes corresponding to the first partition include a master node and a slave node, wherein the master node is used to write data of the first partition, the slave node is used to copy the data of the first partition written by the master node, and any one of the master node and the slave node is used to read data of the first partition.
[0008] Optionally, the multiple data storage nodes corresponding to the first partition are determined in the following manner: based on a uniform allocation strategy, the multiple data storage nodes corresponding to each first partition in the multiple partitions are determined from a currently available set of data storage nodes, and the uniform allocation strategy is used to indicate that the difference in the number of partitions held by different data storage nodes is within a preset range.
[0009] Optionally, the method further includes: in the event that the currently available set of data storage nodes changes, reallocating multiple data storage nodes corresponding to the first partition based on the changed currently available set of data storage nodes and the even allocation strategy.
[0010] Optionally, the target object to be stored does not belong to first-level hotspot data, the first-level hotspot data is data whose current heat is higher than a preset heat threshold, and the first-level hotspot data is used to be stored in the client cache.
[0011] Optionally, before executing the step of splitting the target object to be stored into multiple key-value pairs, the method also includes: when receiving the object to be stored, determining whether the object to be stored is long-tail data; if so, determining that the object to be stored is the target object to be stored; wherein the target object to be stored is used to be stored in a data storage node corresponding to the server; if not, caching the object to be stored in the memory of the server.
[0012] The embodiment of the present disclosure also provides a distributed object storage device, including: an object splitting module, used to split the target object to be stored into multiple key-value pair data; a partition determination module, used to determine the target partitions corresponding to the multiple key-value pair data from multiple partitions of a preset distributed object storage system; a node determination module, used to determine the data storage node currently holding the target partition based on a preset partition view, and obtain the data storage node corresponding to the multiple key-value pair data; wherein the partition view is used to indicate the meta information of the multiple partitions, and the meta information at least includes the information of the data storage node holding the partition; the data storage node is a storage node of the distributed object storage system; a data caching module, used to cache the multiple key-value pair data into the corresponding data storage nodes.
[0013] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the distributed object storage method provided by the embodiment of the present disclosure.
[0014] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the distributed object storage method provided by the embodiment of the present disclosure.
[0015] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the distributed object storage method provided in the embodiments of the present disclosure.
[0016] The above technical solution provided by the embodiment of the present disclosure can split the target object to be stored into multiple key-value pairs, and determine the target partitions corresponding to the multiple key-value pairs from the multiple partitions of the preset distributed object storage system, and then determine the data storage node currently holding the target partition based on the preset partition view, and obtain the data storage nodes corresponding to the multiple key-value pairs, and then cache the multiple key-value pairs to the corresponding data storage nodes. Through the above method, the target object can be split into key-value pairs, and based on the target partitions corresponding to the multiple key-value pairs obtained by the split, the multiple key-value pairs can be distributed and cached in the corresponding data storage nodes, so as to achieve the purpose of distributing the node load, thereby effectively alleviating the problem of local overload of the cluster of the object storage service.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A schematic diagram of the overall cluster architecture of an object storage service provided by an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of a distributed object storage method provided in an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of partition data replication provided by an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of an object storage provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of partition reallocation provided in an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of a multi-level storage architecture provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of an application of distributed object storage provided by an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of the structure of a distributed object storage device provided in an embodiment of the present disclosure;
[0028] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0031] To facilitate understanding of the object storage service, the present disclosure first provides Figure 1 The overall architecture diagram of an object storage service cluster is shown in the figure. The user side can initiate related requests such as read and write requests to the access layer in the cluster through the domain name method or SDK (Software Development Kit). For ease of understanding, the access layer, storage layer, and index layer are described as follows:
[0032] The access layer can perform parsing based on the object storage protocol, thereby calling the data corresponding to the read and write requests in the storage layer and the index layer. Specifically, the access layer can determine the corresponding object metadata in the index layer and the object data in the storage layer based on the read and write requests, thereby performing read IO operations and performing read IO (Input / Output) operations, etc., and then return the operation results to the upper layer according to the protocol requirements.
[0033] Storage layer: It can include multiple data storage nodes for storing object data. Specifically, a distributed pooled storage system can be used as the underlying storage engine.
[0034] Index layer: It can contain multiple partition nodes, which are used to store object metadata, such as object name, object size, content type, data distribution on the storage engine, etc. Most existing technologies use dictionary ordering technology and other methods to implement it.
[0035] Based on the above architecture, the problem of local cluster overload is prone to occur, that is, the load of the local node of the cluster exceeds its processing capacity, thus affecting service availability. For example, this problem will occur in the following scenarios:
[0036] (1) Hot object scenario: A large number of users request to download the same object. The data IO pressure is concentrated on a single partition of the index layer and a few data disks of the storage layer, causing the corresponding data nodes of the index layer or storage layer to be overloaded.
[0037] (2) High QPS (Queries Per Second) download scenario: Users repeatedly read a batch of data at a high QPS, and the data IO pressure is concentrated on several nodes in the index layer or storage layer, causing the local node CPU (Central Processing Unit) to be overloaded.
[0038] (3) High-throughput download scenario: Users concurrently load a batch of large object data, and the data bandwidth pressure is concentrated on several nodes in the storage layer, causing the disk bandwidth or network bandwidth of the local node to reach the upper limit.
[0039] (4) Download acceleration scenario: In the acceleration scenario, it is usually hoped that the data IO link is as short as possible. On the other hand, due to cost considerations, the underlying index and storage may use slow storage devices.
[0040] In order to improve the local overload problem of the cluster in one or more of the above scenarios, the embodiments of the present disclosure provide a distributed object storage method, device, equipment and medium, which can be well applied to the overall cluster architecture of the above object storage service, such as improving the access layer and other functional layers of the above architecture based on the distributed object storage method provided by the embodiments of the present disclosure. For ease of understanding, the following is a detailed explanation.
[0041] Figure 2 The present invention provides a flow chart of a distributed object storage method provided in an embodiment of the present invention. The method can be executed by a distributed object storage device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device, such as a server. Figure 2 As shown, the method mainly includes the following steps S202 to S208:
[0042] Step S202: split the target object to be stored into a plurality of key-value pairs, wherein the key-value pairs may also be referred to as KV (key-value) fragments.
[0043] The disclosed embodiments do not limit the target object, and the target object may specifically include object metadata and object data. In some embodiments, the target object to be stored may be any object to be stored that is received. In other embodiments, the target object to be stored may be an object that is determined to be cached in a partition of a data storage node after multi-level screening, which is not limited here. The disclosed embodiments do not limit the way the target object is split, such as converting the target object into key-value pairs through a specific slicing method. Exemplarily, one or more of field splitting, size splitting, logical splitting, and time series splitting may be used for the target object. The above are all examples and should not be regarded as limitations here. By splitting the target object, no matter how large the target object is, it can be broken up into smaller key-value pairs, which is more convenient for subsequent processing.
[0044] Step S204, determine the target partitions corresponding to the multiple key-value pairs of data from the multiple partitions of the preset distributed object storage system. In practical applications, the partitions mentioned in the embodiments of the present disclosure may also be referred to as logical partitions corresponding to the user data. The number of partitions may be preset when creating a distributed object storage system (also referred to as a storage cluster), such as presetting N partitions, and the number may be kept unchanged later. In practical applications, partition division may be performed based on the scale of the distributed object storage system. Specifically, the storage space of the distributed object storage system may be predivided into N logical partitions for storing user data, that is, the multiple partitions of the preset distributed object storage system are obtained. After obtaining multiple key-value pairs, the disclosed embodiment can determine the target partition corresponding to each key-value pair based on the partition strategy. In order to ensure that the multiple key-value pairs of the target object can be well scattered and distributed to multiple partitions, the partition strategy can be a hash partition strategy. Specifically, in some embodiments, the multiple key-value pairs can be hashed separately to obtain the hash values corresponding to the multiple key-value pairs; based on the hash values corresponding to the multiple key-value pairs, the target partitions corresponding to the multiple key-value pairs are determined from the multiple partitions of the preset distributed object storage system. The hash algorithm used in the above hash processing can be flexibly set. The disclosed embodiment can use hashing for partitioning, and store each key-value pair in a randomly scattered manner. The metadata required to be recorded in each partition will be correspondingly less. In addition, this method can also effectively ensure load balancing.
[0045] Step S206, based on the preset partition view, determine the data storage node that currently holds the target partition, and obtain the data storage nodes corresponding to each of the multiple key-value pairs; wherein the partition view is used to indicate the meta information of multiple partitions, and the meta information at least includes the information of the data storage node that holds the partition, and the data storage node is a storage node of the distributed object storage system. The information of the data storage node includes the identification information of the data storage node, and may also include the location information, capacity information and other node basic information of the data storage node. By recording the information of the data storage node that holds the partition in the meta information, it can be used to accurately locate the data storage node that holds the partition. In other words, the correspondence between each partition and the data storage node can be accurately known, so that the data storage node that holds the target partition can be quickly determined based on the meta information on the basis of the known target partition. In addition, the meta information of the partition may also include information such as the location of the partition, the allowed capacity size, etc., which is not limited here. In practical applications, a data storage node can hold multiple partitions at the same time, and the target partitions corresponding to each of the multiple key-value pairs can be held by different data storage nodes.
[0046] Step S208: Cache the multiple key-value pair data into the corresponding data storage nodes.
[0047] Through the above method, the target object can be split into key-value pairs, and based on the target partitions corresponding to the multiple key-value pairs obtained by the splitting, the multiple key-value pairs can be distributed and cached in the corresponding data storage nodes to achieve the purpose of node load distribution, thereby effectively alleviating the problem of local overload of the object storage service cluster.
[0048] In some embodiments, multiple partitions include a first partition, the first partition is a partition where replica data exists, and the first partition corresponds to multiple data storage nodes, and the multiple identical replica data corresponding to the first partition are distributed on different data storage nodes. In practical applications, each of the multiple partitions mentioned above can be a first partition, that is, each partition can be a partition where replica data exists. It can be understood that the data of the first partition itself is held by the corresponding data storage node, and the multiple replica data obtained by copying the data of the first partition are also held by different data storage nodes, so it can be regarded that the first partition corresponds to multiple data storage nodes.
[0049] In actual applications, the data corresponding to the partition can be copied to multiple storage devices to solve data reliability and availability problems through data redundancy. Even if a single storage device fails, data will not be lost or inaccessible. At the same time, the IO access pressure can be evenly distributed to multiple nodes. For example, Figure 3 The schematic diagram of partition data replication shown can replicate the partition data into multiple copies, thereby obtaining multiple replica data. Figure 3 It is just a simple illustration of copying two additional copies, which should not be regarded as a limitation. In practical applications, the multiple data storage nodes corresponding to the first partition include a master node and a slave node, wherein the master node is used to write the data of the first partition, the slave node is used to copy the data of the first partition written by the master node, and any of the master node and the slave node is used to read the data of the first partition. In other words, all write requests are processed by the master node, and then the data written by the master node is copied to the slave node in a synchronous or asynchronous manner. The above processing mode can be called a master-slave topology mode, and the above method can also effectively ensure the data consistency between the copies.
[0050] For easier understanding, you can also refer to Figure 4 A schematic diagram of object storage is shown in Figure 4 It is shown in FIG. 1 that the target object to be stored is divided into multiple key-value pairs, and the multiple key-value pairs are mapped to different partitions. Figure 4 There are three partitions in the figure, each of which can hold multiple key-value pairs. Figure 4 It can be seen that multiple key-value pairs can be scattered and mapped to multiple partitions. The specific mapping method may depend on a specific algorithm such as hash partitioning, which is not limited here. Figure 4 It is also shown that partition data can be placed in different data storage nodes in the form of multiple mirror copies. In this way, the node load can be dispersed and the problem of local overload of the cluster can be alleviated.
[0051] In order to further ensure load balancing, the partitions in the cluster are evenly distributed to each data storage node. In some specific implementations, the multiple data storage nodes corresponding to the first partition are determined in the following manner: Based on the even distribution strategy, the multiple data storage nodes corresponding to each first partition in the multiple partitions are determined from the currently available data storage node set. The even distribution strategy is used to indicate that the difference in the number of partitions held by different data storage nodes is within a preset range. The preset range can be flexibly set, assuming 0 to M. For any two data storage nodes, if the difference in the number of partitions they hold is within this range, then the two data storage nodes can be regarded as evenly distributed partitions. Among them, the currently available data storage node set can be obtained through the node view, and the node view can be used to indicate the information of the currently available data storage nodes. In actual applications, each partition and the corresponding replica can be evenly distributed to each data storage node according to the number of partitions indicated by the partition view and the replica strategy of each partition, and a partition list can be generated. The partition list can be used to indicate the partition ID and the information of the data storage node holding each partition (such as access address, master-slave information, etc.), which is not limited here.
[0052] Furthermore, the method provided by the embodiment of the present disclosure also includes: in the case where the currently available data storage node set changes, that is, a data storage node goes offline, etc., then the multiple data storage nodes corresponding to the first partition can be reallocated based on the changed currently available data storage node set and the uniform allocation strategy. For ease of understanding, taking the case where a data storage node goes offline as an example, you can refer to Figure 5 The diagram of partition redistribution is shown in the figure. The available nodes are A, B and C. For example, there are 4 partitions, each of which corresponds to 2 data storage nodes. The data and replicas corresponding to partition 1 are held by nodes A and B respectively. Similarly, partition 2 corresponds to nodes C and A, partition 3 corresponds to nodes B and C, and partition 4 corresponds to nodes A and B. In other words, node A holds the data of partitions 1, 2 and 4 at the same time, node B holds the data of partitions 1, 3 and 4, and node C holds the data of partitions 2, 3 and 4. The above distribution method can achieve load balancing well. After node C goes offline, partition redistribution is performed based on the uniform distribution strategy. Please refer to Figure 5In the right figure, since partitions 1 and 4 both correspond to nodes A and B, they are not affected. Partition 2 originally corresponded to nodes C and A, but was reallocated to correspond to nodes B and A. Partition 3 originally corresponded to nodes B and C, but was reallocated to correspond to nodes B and A. In other words, after the reallocation, nodes A and B both hold the data of partitions 1, 2, 3, and 4, and load balancing can still be achieved.
[0053] Considering that the existing single disk cache method has certain limitations, in the face of hot request traffic, there is still a risk of stability being impaired when the single disk load is too high. In order to reasonably allocate cache resources and improve the single-machine read and write capabilities with high concurrency and low latency, the disclosed embodiment can adopt a multi-level cache strategy to cache the first-level hot data (also known as the head hot data) directly on the client, that is, the target object to be stored in the disclosed embodiment does not belong to the first-level hot data. The first-level hot data is data with a current heat higher than a preset heat threshold, and the first-level hot data is used to be stored in the client cache. Exemplarily, the least recently used data can be preferentially eliminated based on algorithms such as LRU (Least Recently Used) so that the first-level hot data is cached in the client, and the recent first-level hot data is cached in the client with a small space (such as 1%), so as to quickly respond to users' related requests for the data, greatly reduce the delay of such data, and reduce the pressure on the server. As mentioned above, the first-level hotspot data can be cached in the client, and the non-first-level hotspot data can be stored through the server. Specifically, before executing the step of splitting the target object to be stored into multiple key-value pairs of data, the method provided in the embodiment of the present disclosure also includes the following steps a to c:
[0054] Step a, upon receiving the object to be stored, determine whether the object to be stored is long-tail data. If yes, execute step b, if no, execute step c. It is understandable that the storage data involved in the object storage service is mostly distributed in a long-tail manner, and there is a large amount of data with a low access frequency. Such data is long-tail data. The identification method of long-tail data can refer to the relevant technology and will not be repeated here. Exemplarily, a Bloom filter can be used to determine whether the object to be stored is long-tail data.
[0055] Step b, determining that the object to be stored is the target object to be stored; wherein the target object to be stored is used to be stored in the data storage node corresponding to the server. If the object to be stored is long-tail data, it can be considered to use the aforementioned method provided by the embodiment of the present disclosure to disperse and store the multiple key-value pairs of data split from the object to be stored in multiple data storage nodes, that is, to store through the external memory corresponding to the server. In other words, the object is stored through the disk corresponding to the server, and data can be written in a manner such as Append Only, that is, each write is appended to the end of the existing data on the disk, rather than updating or deleting at a random position, which helps to reduce random read and write operations of the disk and improve write efficiency. In addition, the FIFO (First In First Out) algorithm can be used to eliminate the earliest written data. In other words, when space needs to be freed up, deletion starts from the earliest written data. In practical applications, the above-mentioned target object to be stored can implement disk caching with the help of the partition engine of the server.
[0056] Step c, cache the objects to be stored in the memory of the server. If the object to be stored is not long-tail data, it means that it is relatively hot data, so it can be stored in the memory of the server first, and can be access controlled by algorithms such as TinyLFU (Tiny Least Frequently Used), such as deciding whether the data can enter the memory cache. When new data needs to be stored, if the memory is full, less frequently used data may be eliminated according to the TinyLFU algorithm. In addition, it is also possible to set up mandatory access policies, allowing some objects to be stored to be written to the server's memory even if they are not permitted by TinyLFU.
[0057] For easier understanding, please refer to Figure 6 The diagram of a multi-level storage architecture shown in the figure can cache the first-level hot spot data in the client cache first, the relatively hot spot data can be cached in the server's memory cache, and the subsequent data can be stored in the server's disk cache. In actual applications, the server-side memory cache can be implemented through the server-side memory engine, and the server's memory can be used to store data to provide faster access speeds. The server-side disk cache can be implemented through the server-side partition engine, that is, the corresponding data storage nodes of the server can be used to implement partitioned storage, such as data that is not cached in the client or server memory can be cached with the help of the server disk. In addition, Figure 6 The data source is also indicated, and data can be persistently stored. When querying the stored data, the client cache can be queried first (primary query), and then the data stored on the server can be queried (secondary query), and then the source data can be queried.
[0058] Further, for ease of understanding, the present disclosure also provides Figure 7 An application diagram of a distributed object storage is shown. Users can implement object storage through access layer 1 or access layer 2. For example, access layer 1 can be an application programming interface for object storage, which can specifically correspond to SDK traffic. Access layer 2 can be a routing server, which can specifically correspond to domain name traffic. The SDKs indicated by access layer 1 and access layer 2 respectively can be SDKs that provide cache services, that is, the access layer needs to access the cache service based on the SDK; in other words, the access layer performs read and write cache through the SDK that provides cache services, and the target object to be stored can be converted into a key-value pair and written to the cache service through a specific slicing method. There are two types of servers corresponding to the cache service, one type of server corresponds to the metadata management node, and the other type of server corresponds to the data storage node. The metadata management node is responsible for cluster data partitioning, partition scheduling, and replica master selection. The distribution information of the partition can be queried through the metadata management node to achieve data access. Figure 7 The circle with arrows between multiple metadata management nodes is used to briefly indicate that synchronization and master election can be performed between multiple metadata management nodes. The data storage node can be used to provide a semantic interface such as a key-value pair and can read and write the partition data it holds. Figure 7 The access layer briefly illustrates that the access layer communicates with the partition API (Application Programming Interface) through the SDK that provides cache services, thereby realizing data reading and writing through the data storage node, and the partition data can have multiple copies. Accordingly, the multiple data storage nodes corresponding to the partition can be divided into master nodes and slave nodes. The data storage node and the metadata management node can interact to realize data reading and writing. When reading data later, the metadata management node can confirm which data storage node the partition corresponding to the key-value pair data is located in, so as to accurately access the node.
[0059] In summary, the distributed object storage method provided by the embodiments of the present disclosure has the following advantages:
[0060] (1) By dividing an object into multiple key-value pairs, the multiple key-value pairs can be scattered and stored in multiple preset partitions, and thus held by multiple data storage nodes. In other words, the object can be split and stored on multiple data storage nodes, which can effectively solve the single-machine storage space problem. In addition, distributing the load to multiple nodes not only helps to achieve load balancing, but also effectively improves service throughput.
[0061] (2) Data redundancy is achieved through data replication, and the replica data of the partition is synchronized to multiple data storage nodes, providing a certain disaster recovery capability for the cache data. In actual applications, the replicas located in different data storage nodes can be read based on demand, solving the problem of requests concentrated on a single node in hot scenarios and increasing the upper limit of the read capacity in the cache system. At the same time, data replication can effectively ensure the data consistency between the replicas.
[0062] (3) Automatic data scheduling can be achieved. That is, when data storage nodes go online or offline, partitions can be automatically redistributed according to the node load. For example, partitions can be automatically scheduled to data storage nodes with lower loads without manual intervention. This can better achieve the elastic expansion and contraction capabilities of the cache system and effectively ensure load balancing.
[0063] (4) A multi-layer cache strategy is proposed, that is, high-concurrency, low-latency read and write capabilities are provided by combining memory cache and disk cache, which can effectively enhance the high-concurrency, low-latency single-machine read and write capabilities.
[0064] In summary, the above method provided by the embodiment of the present disclosure can greatly alleviate the problem of local overload of the cluster, such as alleviating the hot traffic problem of the object storage service, reducing the probability of accidents caused by sudden increase in hot traffic, improving the stability of the object storage system, and accelerating the response to users' hot requests, effectively reducing the average latency of read requests accessing the cache.
[0065] Corresponding to the aforementioned distributed object storage method, the embodiment of the present disclosure further provides a distributed object storage device, Figure 8 This is a schematic diagram of the structure of a distributed object storage device provided in an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device, such as Figure 8 As shown, the distributed object storage device includes:
[0066] The object splitting module 802 is used to split the target object to be stored into multiple key-value pairs;
[0067] A partition determination module 804 is used to determine target partitions corresponding to the multiple key-value pair data from the multiple partitions of the preset distributed object storage system;
[0068] The node determination module 806 is used to determine the data storage node currently holding the target partition based on the preset partition view, and obtain the data storage nodes corresponding to the multiple key-value pairs; wherein the partition view is used to indicate the meta information of the multiple partitions, and the meta information at least includes the information of the data storage node holding the partition; the data storage node is a storage node of the distributed object storage system;
[0069] The data cache module 808 is used to cache the multiple key-value pairs of data into the target partitions in the corresponding data storage nodes.
[0070] Through the above device, the target object can be split into key-value pairs, and the multiple key-value pair data obtained by the split can be distributed and cached in the corresponding partitions, so as to achieve the purpose of distributing the node load, thereby effectively alleviating the problem of local overload of the cluster of the object storage service.
[0071] In some embodiments, the partition determination module 804 is specifically used to: perform hash processing on the multiple key-value pairs respectively to obtain hash values corresponding to the multiple key-value pairs; based on the hash values corresponding to the multiple key-value pairs, determine the target partitions corresponding to the multiple key-value pairs from multiple partitions of a preset distributed object storage system.
[0072] In some embodiments, the multiple partitions include a first partition, where the first partition is a partition where replica data exists, and the first partition corresponds to multiple data storage nodes, and the multiple identical replica data corresponding to the first partition are distributed on different data storage nodes.
[0073] In some embodiments, the multiple data storage nodes corresponding to the first partition include a master node and a slave node, wherein the master node is used to write data of the first partition, the slave node is used to copy the data of the first partition written by the master node, and any one of the master node and the slave node is used to read the data of the first partition.
[0074] In some embodiments, the multiple data storage nodes corresponding to the first partition are determined in the following manner: based on a uniform allocation strategy, the multiple data storage nodes corresponding to each first partition in the multiple partitions are determined from a currently available set of data storage nodes, and the uniform allocation strategy is used to indicate that the difference in the number of partitions held by different data storage nodes is within a preset range.
[0075] In some embodiments, the device also includes a reallocation module for reallocating multiple data storage nodes corresponding to the first partition based on the changed currently available data storage node set and the uniform allocation strategy when the currently available data storage node set changes.
[0076] In some implementations, the target object to be stored does not belong to first-level hotspot data, which is data whose current heat is higher than a preset heat threshold, and the first-level hotspot data is used to be stored in the client cache.
[0077] In some embodiments, the device also includes a hierarchical caching module, which is used to determine whether the object to be stored is long-tail data when the object to be stored is received; if so, determine that the object to be stored is a target object to be stored; wherein the target object to be stored is used to be stored in a data storage node corresponding to the server; if not, cache the object to be stored in the memory of the server.
[0078] The distributed object storage device provided in the embodiments of the present disclosure can execute the distributed object storage method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.
[0080] An embodiment of the present disclosure provides an electronic device, which includes: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any method in the present disclosure.
[0081] Reference below Fig. 9 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0082] like Fig. 9 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0083] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0084] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0085] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the method provided by the embodiments of the present disclosure. The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present disclosure, the programming languages including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0086] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the distributed object storage method provided by the embodiment of the present disclosure.
[0087] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0088] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which implements the distributed object storage method in the embodiments of the present disclosure when executed by a processor.
[0089] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0090] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0091] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0092] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0093] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0094] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A distributed object storage method, characterized in that: include: Split the target object to be stored into multiple key-value pairs; Determine, from a plurality of partitions of a preset distributed object storage system, target partitions corresponding to each of the plurality of key-value pair data; Determine the data storage node currently holding the target partition based on a preset partition view, and obtain the data storage nodes corresponding to each of the multiple key-value pairs; wherein the partition view is used to indicate the meta information of the multiple partitions, and the meta information at least includes the information of the data storage node holding the partition; the data storage node is a storage node of the distributed object storage system; The multiple key-value pair data are cached in the corresponding data storage nodes.
2. The method according to claim 1, characterized in that The step of determining target partitions corresponding to the plurality of key-value pairs of data from the plurality of partitions of the preset distributed object storage system includes: Performing hash processing on the multiple key-value pair data respectively to obtain hash values corresponding to the multiple key-value pair data; Based on the hash values corresponding to the multiple key-value pairs, target partitions corresponding to the multiple key-value pairs are determined from multiple partitions of a preset distributed object storage system.
3. The method according to claim 1, characterized in that The multiple partitions include a first partition, where the first partition is a partition where replica data exists, and the first partition corresponds to multiple data storage nodes, and multiple identical replica data corresponding to the first partition are distributed on different data storage nodes.
4. The method according to claim 3, characterized in that The multiple data storage nodes corresponding to the first partition include a master node and a slave node, wherein the master node is used to write data of the first partition, the slave node is used to copy the data of the first partition written by the master node, and any one of the master node and the slave node is used to read the data of the first partition.
5. The method according to claim 3, characterized in that: The multiple data storage nodes corresponding to the first partition are determined in the following manner: Based on a uniform allocation strategy, multiple data storage nodes corresponding to each first partition in the multiple partitions are determined from a currently available data storage node set, and the uniform allocation strategy is used to indicate that the difference in the number of partitions held by different data storage nodes is within a preset range.
6. The method according to claim 5, characterized in that The method further comprises: In the case where the currently available data storage node set changes, the multiple data storage nodes corresponding to the first partition are reallocated based on the changed currently available data storage node set and the even allocation strategy.
7. The method according to claim 1, characterized in that The target object to be stored does not belong to first-level hotspot data, which is data whose current heat is higher than a preset heat threshold, and is used to be stored in the client cache.
8. The method according to claim 7, characterized in that Before executing the step of splitting the target object to be stored into a plurality of key-value pair data, the method further includes: When receiving the object to be stored, determining whether the object to be stored is long-tail data; If yes, determining that the object to be stored is a target object to be stored; wherein the target object to be stored is used to be stored in a data storage node corresponding to the server; If not, the object to be stored is cached in the memory of the server.
9. A distributed object storage device, characterized in that: include: An object splitting module is used to split the target object to be stored into multiple key-value pairs of data; A partition determination module, used to determine the target partitions corresponding to the plurality of key-value pair data from the plurality of partitions of the preset distributed object storage system; A node determination module, used to determine the data storage node currently holding the target partition based on a preset partition view, and obtain the data storage nodes corresponding to each of the multiple key-value pairs; wherein the partition view is used to indicate the meta information of the multiple partitions, and the meta information at least includes the information of the data storage node holding the partition; the data storage node is a storage node of the distributed object storage system; The data cache module is used to cache the multiple key-value pairs of data into the corresponding data storage nodes.
10. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the distributed object storage method described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the distributed object storage method described in any one of claims 1 to 8.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the distributed object storage method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
File merging method and device
CN103593436A
Low-cost cache system for air ticket search
CN114048235A
Distributed heterogeneous relational database storage method
CN114706850A
Dynamic storage in key-value solid state drive
CN115599290A
Data hierarchical storage method and device, equipment and storage medium
CN115840543A
Cited By
Data processing method, electronic device, storage medium and computer program product
CN120104699A
Data processing method, electronic device, storage medium and computer program product
CN121301648A
Data processing method and device, equipment, storage medium and program product
CN121387767A
Data processing method and system for distributed coordinator, and electronic device
WO2026175066A1