CN115981559A - Distributed data storage method and device, electronic equipment and readable medium - Google Patents

Distributed data storage method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN115981559A
CN115981559A CN202211678664.4A CN202211678664A CN115981559A CN 115981559 A CN115981559 A CN 115981559A CN 202211678664 A CN202211678664 A CN 202211678664A CN 115981559 A CN115981559 A CN 115981559A
Authority
CN
China
Prior art keywords
data
cluster
bloom filter
access frequency
data files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211678664.4A
Other languages
Chinese (zh)
Inventor
吕洋
景磊
江洋
蔡庆明
陈雪
高玉凤
张旭
田帅
侯琳
赵双嗣
董文涛
郝敬龙
陈林芳
丁贵军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202211678664.4A priority Critical patent/CN115981559A/en
Publication of CN115981559A publication Critical patent/CN115981559A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides a distributed data storage method, an apparatus, an electronic device, and a readable medium, which may be applied to the fields of cloud computing, databases, intelligent supply chains, and the like, wherein the distributed data storage method includes: determining the access frequency of data files stored in the three-copy cluster; and writing the data files of the specified type into the EC cluster according to the access frequency, and pointing the data pointers of the successfully written data files to the EC cluster. Through the embodiment of the disclosure, data conversion can be efficiently performed, resources occupied by storage data are reduced, and reliability and stability of storage service are improved.

Description

Distributed data storage method and device, electronic equipment and readable medium
Technical Field
The present disclosure relates to the field of data storage technologies, and in particular, to a distributed data storage method and apparatus, an electronic device, and a readable medium.
Background
At present, with the wide popularization of cloud computing under modern IT frameworks, more and more enterprises start to integrally move own IT systems to the cloud to seek a one-stop IT solution, and partial enterprises with capabilities also build private clouds to improve the overall IT efficiency of the enterprises.
In the related art, the storage system is part of infrastructure as a service (IaaS) on the cloud, which is both the core base of the cloud and the cornerstone of enterprise data persistence storage.
However, because the construction and operation of the storage system need to consume a large amount of server resources and human resource cost, how to reduce the storage cost to the maximum extent on the basis of ensuring the service stability and data reliability becomes an urgent need for cost reduction and efficiency improvement of enterprises.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a distributed data storage method, apparatus, electronic device and readable medium for overcoming, at least to some extent, the problem of large distributed cluster storage pressure due to the limitations and drawbacks of the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided a distributed data storage method, including: determining the access frequency of data files stored in the three-copy cluster; and writing the data files of the specified type into the EC cluster according to the access frequency, and pointing the data pointers of the successfully written data files to the EC cluster.
In an exemplary embodiment of the present disclosure, before determining the access frequency of the data files stored in the three-copy cluster, the method further includes: storing the data file in the three-copy cluster in a distributed manner; creating a data interaction channel between an engine layer of the three-copy cluster and an engine layer of the EC cluster, wherein the interaction channel is used for interaction of the data file between the three-copy cluster and the EC cluster.
In an exemplary embodiment of the present disclosure, writing a data file of a specified type to an EC cluster according to the access frequency, and pointing a data pointer of a successfully written data file to the EC cluster includes: judging whether the access frequency is less than or equal to a preset access frequency; and if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into the EC cluster.
In an exemplary embodiment of the present disclosure, if it is determined that the access frequency is less than or equal to the preset access frequency, writing the data file into the EC cluster includes: if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into a spot cache region; and when the storage capacity of the data file of the spot cache region reaches a preset storage threshold value, writing the data file of the spot cache region into the EC cluster.
In an exemplary embodiment of the present disclosure, determining the access frequency of the data files stored in the three-copy cluster comprises: determining key value structures corresponding to the data files in the three-copy cluster; and determining the access frequency according to the keys in the key value structure.
In an exemplary embodiment of the present disclosure, determining the access frequency of the data files stored in the three-copy cluster further comprises: storing a key map of a data file in the three-copy cluster to a plurality of hash bits by a bloom filter, the bloom filter being composed of an array of one of the hash bits, the bloom filter providing an addItem process and a hasItem process, the addItem process calculating, by a first hash function, a position that an element occupies in the array of bits, the hasItem process calculating, by a second hash function, a hash value corresponding to the element, the element being data stored in the bloom filter; and determining the access frequency of the data files which are stored in the mapping mode through the bloom filter.
In an exemplary embodiment of the present disclosure, determining, by the bloom filter, a frequency of access to the data file for which the mapping storage has been completed comprises: dividing all the bloom filters into a current bloom filter and a plurality of historical bloom filters according to attribute information of elements in the bloom filters, wherein the attribute information comprises preset time and/or granularity; if the number of the keys in the current bloom filter is detected to exceed the preset number, and/or the creation time of the current bloom filter is detected to exceed the creation time of the historical bloom filter, merging the current bloom filter to the historical bloom filter, and creating a new current bloom filter; traversing the current bloom filter and the historical bloom filter to determine hits for the key in response to a query request for the key in the bloom filter; and determining the access times according to the hit result.
According to a second aspect of embodiments of the present disclosure, there is provided a distributed data storage apparatus comprising: a determining module configured to determine access frequency of data files stored in the three-copy cluster; and the storage module is set to write the data files of the specified type into the EC cluster according to the access frequency and point the data pointers of the successfully written data files to the EC cluster.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a memory; and a processor coupled to the memory, the processor configured to perform the method of any of the above based on instructions stored in the memory.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing the distributed data storage method as described in any one of the above.
According to the embodiment of the disclosure, the access frequency of the data files stored in the three copy clusters is determined, the data files of the specified type are written into the EC cluster according to the access frequency, and then the data pointers of the successfully written data files point to the EC cluster, so that the storage distribution of the data files is optimized, the data storage pressure and the deployment cost are reduced, and the access efficiency of the data files stored in a distributed manner is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
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 disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 illustrates a schematic diagram of an exemplary system architecture in which embodiments of the present invention may be applied to a distributed data storage scheme;
FIG. 2 is a flow chart of a distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart of another distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 4 is a flow chart of another distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 5 is a flow chart of another distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 6 is a flow chart of another distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 7 is a flow chart of another method of distributed data storage in an exemplary embodiment of the disclosure;
FIG. 8 is a flow chart of another distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a three-copy cluster in a distributed data storage method in an exemplary embodiment of the present disclosure;
FIG. 10 is a schematic diagram of an EC cluster in a distributed data storage method in an exemplary embodiment of the disclosure;
FIG. 11 is an interaction diagram of a distributed data storage scheme in an exemplary embodiment of the present disclosure;
FIG. 12 is an architecture diagram of a distributed data storage scheme in an exemplary embodiment of the present disclosure;
FIG. 13 is a schematic diagram of a bloom filter of a distributed data storage scheme in an exemplary embodiment of the disclosure;
FIG. 14 is a block diagram of a bloom filter of a distributed data storage scheme in an exemplary embodiment of the disclosure;
FIG. 15 is a schematic illustration of a storage process of a distributed data storage scheme in an exemplary embodiment of the disclosure;
FIG. 16 is a block diagram of a distributed data storage device in an exemplary embodiment of the present disclosure;
fig. 17 is a block diagram of an electronic device in an exemplary embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Further, the drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
FIG. 1 illustrates a schematic diagram of an exemplary system architecture to which the distributed data storage scheme of an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, and the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like.
In some embodiments, the distributed data storage method provided by the embodiment of the present invention is generally executed by the server 105, and accordingly, the distributed data storage apparatus is generally disposed in the terminal device 103 (which may also be the terminal device 101 or 102). In other embodiments, some terminals may have similar functionality as the server device to perform the method.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
Fig. 2 is a flow chart of a distributed data storage method in an exemplary embodiment of the disclosure.
Referring to fig. 2, the distributed data storage method may include:
step S202, determining the access frequency of the data files stored in the three-copy cluster.
Step S204, writing the data files of the specified type into the EC cluster according to the access frequency, and pointing the data pointers of the successfully written data files to the EC cluster.
According to the data file access method and device, the access frequency of the data files stored in the three copy clusters is determined, the data files of the specified type are written into the EC cluster according to the access frequency, and then the data pointers of the successfully written data files point to the EC cluster, so that the storage distribution of the data files is optimized, the data storage pressure and the deployment cost are reduced, and the access efficiency of the data files stored in a distributed mode is improved.
The following describes each step of the distributed data storage method in detail.
In an exemplary embodiment of the disclosure, as shown in fig. 3, before determining the access frequency of the data file stored in the three-copy cluster, the method further includes:
step S302, storing the data files in the three-copy cluster in a distributed manner.
Step S304, a data interaction channel is created between the engine layers of the three copy clusters and the engine layer of the EC cluster, and the interaction channel is used for interaction between the three copy clusters and the EC cluster of the data file.
In the above embodiment, as shown in fig. 9, the three copies 900 are a storage model widely used by the current distributed storage system, each piece of data of the user is stored in the storage system in 3 copies, which are respectively denoted as copy 1, copy 2, and copy 3, and the copies are stored on different physical disks of different servers according to a certain distributed storage algorithm, and a failure of a single hardware device does not affect a service.
In the above embodiment, as shown in fig. 10, EC (Erasure Code) is a coding technique, which can cut an original Data into n Data partitions (Data partitions), add m check partitions (Code partitions), and restore the original Data through any n Data partitions in n + m partitions. That is, if any data with the number of M or less fails, the original data can still be restored through the remaining fragments, for example, the nodes storing the data fragments are denoted as N1, N2, and N3, and the nodes storing the check fragments are denoted as M1 and M2.
The erasure code can obtain higher data reliability with smaller data redundancy, but 1 part of data is stored on n + m nodes in a scattered manner, so that a higher IOPS (Input/output operation per second, i.e., the number of times of read/write (I/O) operations per second) is required for reading and writing of the data, and in addition, the data encoding method of the EC cluster 1000 is complicated, a large amount of calculation is required for data repair when a fragment is damaged, and the reading performance is also affected, so that the storage model of the EC cluster 1000 is suitable for storing warm and cold data.
As shown in fig. 3, 9, and 10, the embodiment of the present application may dynamically switch storage engines for data according to the access frequency of a data file, store data with a high access frequency (hot data) in three copy engines, store data with a medium-low access frequency in an EC storage engine, and dynamically adjust the storage engines according to the change of the access frequency of the data to reduce the storage pressure of a cluster.
In the three-copy storage model, each piece of data is self-complete, so that the data file has good performance in the aspects of reading the data file and automatically reconstructing the damaged copy, and is suitable for storing and accessing the data with higher heat.
As shown in fig. 11, a process 1100 of transferring the warm and cold data of the inventory from the three copy clusters to the EC storage cluster includes three steps of data copy (copy object), check and swap (check and swap), and read from EC, which are as follows:
1. a bucket for replication data (hereinafter referred to as a destination bucket) is prepared, which is the EC engine.
2. A bucket containing warm and cold data (hereinafter referred to as a source bucket) is added as a data conversion task of the data-transfer and is regularly scheduled to be executed by a data-transfer service.
3. When the data-transfer executes a task, the source bucket is traversed, and the data meeting the warm and cold conditions is copied (copy object) to the destination bucket, at this time, a piece of data (the Key of which is denoted as Key = src-Key) completely consistent with the content in the source bucket exists in the destination bucket (the Key of which is denoted as Key = dest-Key), and the data exists in the EC storage engine.
4. And performing MD5 comparison on the source data and the destination data once to confirm the validity of the copied data.
5. And executing a conditional operation, and performing index swap (swap Path) on metadata (meta) of the same data in the source bucket and the destination bucket, wherein the metadata are swapped for both the Path = ec-Path and the Path =3 rd-rep-Path. After the exchange is successful, the user data will be read from the EC cluster, and the data in the original three copies of the user will be backed up to the destination bucket.
6. And periodically cleaning the data configuration declaration period in the destination storage bucket.
The above process has no perception to the user side, and after the conversion task is completed, the user data will be stored in the EC cluster, taking the EC storage cluster of 3+2 as an example, the data storage cost will be reduced from the original 3 copies to 1.6 copies, the hard disk storage space occupied by about 1.4 copies is saved, and the hardware resource cost of the cluster is greatly reduced.
As shown in fig. 12, the distributed data storage architecture 1200 of the present disclosure supports dynamic layering of data in a storage engine layer, and dynamically switches the storage engine where the data file is located according to the access frequency of the data file, and a core module of the 3-copy storage engine 1206 includes an access record manager (accesrorcordmanager) and a data converter (BlobTransfer).
(1) The access record manager is used for accurately counting access frequency information of each file in a period of time, and the information is used for evaluating the cold and hot degree of the data. Compared with the old scheme in which the cold and hot recognition of the file can be performed more accurately according to the statistics of the file creation time.
(2) The data converter obtains the access frequency of each file through the access record manager, and converts the warm and cold files into the EC storage engine 1208. The data converter also solves the performance bottleneck problem of the IOPS during small file conversion.
Also, since all of the work of the scheme is done at the data engine level, the Object API level 1202 and the metadata level 1204 are unaware of any additional work at both levels during data conversion, which also eliminates the extra workload at both levels.
In an exemplary embodiment of the present disclosure, as shown in fig. 4, writing a data file of a specified type into an EC cluster according to the access frequency, and pointing a data pointer of a successfully written data file to the EC cluster includes:
step S402, judging whether the access frequency is less than or equal to a preset access frequency.
Step S404, if it is determined that the access frequency is less than or equal to the preset access frequency, writing the data file into the EC cluster.
In an exemplary embodiment of the present disclosure, as shown in fig. 5, if it is determined that the access frequency is less than or equal to the preset access frequency, writing the data file into the EC cluster includes:
step S502, if the access frequency is judged to be less than or equal to the preset access frequency, the data file is written into a spot cache region.
Step S504, when it is detected that the storage amount of the data file in the blob buffer reaches a preset storage threshold, writing the data file in the blob buffer into the EC cluster.
In an exemplary embodiment of the present disclosure, as shown in fig. 6, determining the access frequency of the data files stored in the three-copy cluster comprises:
step S602, determining key value structures corresponding to the data files in the three-copy cluster.
Step S604, determining the access frequency according to the key in the key value structure.
In the above embodiment, the number of access times of each file is stored in a KV structure in the form of { key, num }, and the data converter periodically traverses the files in the storage cluster and queries the number of access times of the file in the KV structure according to the key of the file to determine the cold and hot status, as shown in table 1 below.
TABLE 1
key num
hello
1
foo 4
ping 10
According to the assumed 1000QPS access case, assuming that the size of each KV record is 100 bytes, and one month of access records are stored as the thermal analysis samples, the total required storage space size is 1000x3600 x 24 x 30 x 100/1024/1024/1024=241gb. Such huge storage space requirement can not be realized in the memory at all, and only data persistence can be carried out, so that on one hand, extra storage maintenance cost is increased, on the other hand, a large amount of disk IO requests are additionally generated when cold and hot judgment is carried out at every time, and the conversion performance is greatly reduced. This solution is therefore not satisfactory.
In an exemplary embodiment of the present disclosure, as shown in fig. 7, determining the access frequency of the data files stored in the three-copy cluster further comprises:
step S702, mapping and storing keys of the data files in the three copy clusters to a plurality of hash bits through a bloom filter, wherein the bloom filter is composed of an array of the hash bits, the bloom filter provides an addItem process and a hasItem process, the addItem process calculates positions occupied by elements in the array of the bits through a first hash function, the hasItem process calculates hash values corresponding to the elements through a second hash function, and the elements are data stored in the bloom filter.
Step S704, determining, by the bloom filter, the access frequency of the data file whose mapping storage is completed.
In the above embodiment, the bloom filter is an efficient hash mapping table, in which keys are mapped to different hash bit bits through multiple hash functions to ensure uniqueness of one key, and the bloom filter does not store the keys themselves, so that a very small storage space can be used to store a large number of data values.
As shown in fig. 13, bloom filter 1300 is composed of four-dimensional attributes:
n: the number of elements stored in the filter.
P: false positive rate.
M: memory space occupied by bloom filters.
K: the number of hash functions.
In the above embodiment, as long as any three values of NPMK are known, another value can be obtained, for example, a user wants to use 10 hash functions (K) to store 1000 elements (N) in the filter, and if the false positive rate is lower than 0.001 (P), the memory space required by the filter can be obtained.
In the above embodiment, the bloom filter 1300 provides addItem and hasltem methods to the outside, the inside of the bloom filter is composed of a bit array, addItem calculates the occupied position of a certain element in the filter bit array through a hash function, for example, a certain filter has 4 hash functions h1, h2, h3, and h4, and for element e, the calculated values of the four hash functions are i1, i2, i3, and i4, respectively, so that the four subscript positions i1, i2, i3, and i4 of the bit array are set to 1. The hasItem also uses four hash functions to calculate four hash values of the target element, and if the subscripts corresponding to the four hash values are all 1 in the bit array of the filter, it indicates that the element exists in the filter.
As shown in fig. 13, the data file Obj1 determines the storage space through the Fun1 path, the Fun2 path, and the Fun3 path, i.e., the 1 st bit, the 3rd bit, and the 12 th bit are denoted as 1, and the data file Obj2 determines the storage space through the Fun1 path, the Fun2 path, and the Fun3 path, i.e., the 3rd bit, the 8 th bit, and the 13 th bit are denoted as 1.
In an exemplary embodiment of the present disclosure, as shown in fig. 8, determining, by the bloom filter, an access frequency of the data file for which the mapping storage is completed includes:
step S802, dividing all the bloom filters into a current bloom filter and a plurality of historical bloom filters according to the attribute information of the elements in the bloom filters, wherein the attribute information comprises preset time and/or granularity.
Step S804, if it is detected that the number of keys in the current bloom filter exceeds a preset number, and/or it is detected that the creation time of the current bloom filter exceeds the creation time of the historical bloom filter, merging the current bloom filter to the historical bloom filter, and creating a new current bloom filter.
Step S806, in response to the query request for the key in the bloom filter, traversing the current bloom filter and the historical bloom filter to determine the hit result of the key.
And step S808, determining the access times according to the hit result.
Since the bloom filter does not store the key itself (similar to a set rather than a map structure), if the number of times of key access is to be recorded, the problem can be solved by cutting a plurality of bloom filters according to minute or hour granularity and summarizing the hit results of the bloom filters in statistics.
Based on the above-described embodiment, the bloom filter scheme may be preferentially selected as a technical alternative of the access log manager, and as shown in fig. 14, the access log manager 1400 is composed of the following several modules.
(1) Bloom filter: the method comprises the steps that a currently used bloom filter (current filter shown in fig. 14) and a set of historical bloom filters (history filter1, history filter2 and history filter3 shown in fig. 14) are combined, if the number of keys of the current bloom filter exceeds a threshold value or the creation time of the current bloom filter exceeds a threshold value, the current bloom filter is added into the historical set, and a new current bloom filter is generated.
When the user calls the access record manager to determine whether a key is in the filter, the access record manager traverses the current bloom filter and bloom filters of all histories, and adds the hit results to obtain the final hit number, that is, the access heat of the key in a certain period of time.
When the upper-layer service system has a reading request, an access record index is synchronously added into the Bloom filter, and data support is provided for subsequent heat analysis.
(2) Filter reader: the module is to periodically load a bloom filter of the history from the persistent storage into the history set. The access record manager periodically calls the Filter reader logic to keep the latest and latest access records maintained in the memory.
(3) Filter writer: the module is used for periodically persisting a newly generated historical bloom Filter which is not persisted, and the access record manager periodically calls a Filter writer logic to prevent the loss of historical access records caused by service restart or system crash.
(4) Filter GC: this module is used to periodically invoke a bloom Filter that a Filter GC (logic clean) has expired, and assuming a sample period of 1 month is set, bloom filters that are more than one month will be cleaned up by the periodic logic.
(5) Filter storage client: the module provides an interface for accessing the persisted bloom filter, and the developer can select the persisted implementation at his or her discretion. Filter reader, filter writer, and Filter GC all rely on this module.
As shown in fig. 15, the Data Transfer (Data Transfer) is composed of the following modules.
(1) A scheduler: the module is responsible for periodically scanning data in the 3-copy cluster, inquiring and accessing the recorded heat condition in the record manager for each data, and writing the data into the blob cache for temporary storage if the data conforms to the warm-cold characteristic, namely a step of writing cold/arm data to the cache shown in fig. 14.
(2) blob cache: the blob cache is used for temporarily storing warm and cold data to be written into the EC cluster, and when the cache reaches a threshold value, the cache is written into the EC cluster as an integral file, namely a step of 'flush world blob cache to EC' shown in FIG. 14, so that the problem of frequent writing of small files is avoided.
(3) transfer client: the writing logic responsible for actually executing data can be implemented by a developer to select different storage backend, which may be EC storage or other storage with lower cost (such as tape).
After the warm and cold data is successfully written into the EC, the data pointer of the file in the 3-copy cluster points to the EC cluster, that is, as shown in fig. 15, an "update block pointer to EC" step, and subsequent read-write operations are all supported by the EC cluster.
Corresponding to the above method embodiments, the present disclosure also provides a distributed data storage apparatus, which may be used to execute the above method embodiments.
FIG. 16 is a block diagram of a distributed data storage device in an exemplary embodiment of the present disclosure.
Referring to fig. 16, the distributed data storage apparatus 1600 may include:
a determining module 1602 configured to determine access frequencies of data files stored in the three-copy cluster.
The storage module 1604 is configured to write the data file of the specified type into the EC cluster according to the access frequency, and point the data pointer of the successfully written data file to the EC cluster.
In an exemplary embodiment of the disclosure, the storage module 1604 is further configured to: storing the data file in the three-copy cluster in a distributed manner; and creating a data interaction channel between an engine layer of the three copy clusters and an engine layer of the EC cluster, wherein the interaction channel is used for interaction of the data files between the three copy clusters and the EC cluster.
In an exemplary embodiment of the disclosure, the storage module 1604 is further configured to: judging whether the access frequency is less than or equal to a preset access frequency; and if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into the EC cluster.
In an exemplary embodiment of the disclosure, the storage module 1604 is further configured to: if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into a spot cache region; and when the storage capacity of the data file of the spot cache region reaches a preset storage threshold value, writing the data file of the spot cache region into the EC cluster.
In an exemplary embodiment of the disclosure, the determining module 1602 is further configured to: determining key value structures corresponding to the data files in the three-copy cluster; and determining the access frequency according to the keys in the key value structure.
In an exemplary embodiment of the disclosure, the determining module 1602 is further configured to: storing a key map of a data file in the three-copy cluster to a plurality of hash bits by a bloom filter, the bloom filter being composed of an array of one of the hash bits, the bloom filter providing an addItem process and a hasItem process, the addItem process calculating, by a first hash function, a position that an element occupies in the array of bits, the hasItem process calculating, by a second hash function, a hash value corresponding to the element, the element being data stored in the bloom filter; and determining the access frequency of the data files which are stored in the mapping mode through the bloom filter.
In an exemplary embodiment of the disclosure, the determining module 1602 is further configured to: dividing all the bloom filters into a current bloom filter and a plurality of historical bloom filters according to attribute information of elements in the bloom filters, wherein the attribute information comprises preset time and/or granularity; if the number of the keys in the current bloom filter is detected to exceed the preset number, and/or the creation time of the current bloom filter is detected to exceed the creation time of the historical bloom filter, merging the current bloom filter to the historical bloom filter, and creating a new current bloom filter; traversing the current bloom filter and the historical bloom filter to determine hits for the key in response to a query request for the key in the bloom filter; and determining the access times according to the hit result.
Since the functions of the distributed data storage device 1600 have been described in detail in the corresponding method embodiments, the disclosure is not repeated herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1700 according to this embodiment of the present invention is described below with reference to fig. 17. The electronic device 1700 shown in fig. 17 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 17, electronic device 1700 is in the form of a general purpose computing device. Components of electronic device 1700 may include, but are not limited to: the at least one processing unit 1710, the at least one memory unit 1720, and the bus 1730 that couples the various system components including the memory unit 1720 and the processing unit 1710.
Wherein the storage unit stores program code that is executable by the processing unit 1710 to cause the processing unit 1710 to perform steps according to various exemplary embodiments of the present invention described in the above section "exemplary method" of the present specification. For example, the processing unit 1710 may perform methods as shown in embodiments of the present disclosure.
The storage unit 1720 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM) 17201 and/or a cache memory unit 17202, and may further include a read-only memory unit (ROM) 17203.
Storage unit 1720 may also include a program/utility 17204 having a set (at least one) of program modules 17205, such program modules 17205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
Bus 1730 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1700 may also communicate with one or more external devices 1740 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1700 to communicate with one or more other computing devices. Such communication can occur via an input/output (I/O) interface 1750. Also, the electronic device 1700 can communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 1760. As shown, the network adapter 1760 communicates with the other modules of the electronic device 1700 over the bus 1730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 1700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product for implementing the above method according to an embodiment of the present invention may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A distributed data storage method, comprising:
determining the access frequency of data files stored in the three-copy cluster;
and writing the data files of the specified type into the EC cluster according to the access frequency, and pointing the data pointers of the successfully written data files to the EC cluster.
2. The distributed data storage method of claim 1, further comprising, prior to determining the frequency of access to the data files stored in the three-copy cluster:
storing the data files in the three-copy cluster in a distributed manner;
and creating a data interaction channel between an engine layer of the three copy clusters and an engine layer of the EC cluster, wherein the interaction channel is used for interaction of the data files between the three copy clusters and the EC cluster.
3. The distributed data storage method of claim 1 or 2, wherein writing data files of a specified type to an EC cluster according to the access frequency, and pointing data pointers of successfully written data files to the EC cluster comprises:
judging whether the access frequency is less than or equal to a preset access frequency;
and if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into the EC cluster.
4. The distributed data storage method of claim 3, wherein if it is determined that the access frequency is less than or equal to the preset access frequency, writing the data file to the EC cluster comprises:
if the access frequency is judged to be less than or equal to the preset access frequency, writing the data file into a spot cache region;
and when the storage capacity of the data file of the spot cache region reaches a preset storage threshold value, writing the data file of the spot cache region into the EC cluster.
5. The distributed data storage method of any of claims 1-4, wherein determining a frequency of access of data files stored in a triple-copy cluster comprises:
determining key value structures corresponding to the data files in the three-copy cluster;
and determining the access frequency according to the keys in the key value structure.
6. The distributed data storage method of any of claims 1-4, wherein determining a frequency of access of data files stored in a triple-copy cluster further comprises:
storing a key map of a data file in the three-copy cluster to a plurality of hash bits by a bloom filter, the bloom filter being composed of an array of one of the hash bits, the bloom filter providing an addItem process and a hasItem process, the addItem process calculating, by a first hash function, a position that an element occupies in the array of bits, the hasItem process calculating, by a second hash function, a hash value corresponding to the element, the element being data stored in the bloom filter;
and determining the access frequency of the data files which are stored in the mapping mode through the bloom filter.
7. The distributed data storage method of claim 6, wherein determining, by the bloom filter, a frequency of access of data files for which the map store has been completed comprises:
dividing all the bloom filters into a current bloom filter and a plurality of historical bloom filters according to attribute information of elements in the bloom filters, wherein the attribute information comprises preset time and/or granularity;
if the number of the keys in the current bloom filter is detected to exceed the preset number, and/or the creation time of the current bloom filter is detected to exceed the creation time of the historical bloom filter, merging the current bloom filter to the historical bloom filter, and creating a new current bloom filter;
traversing the current bloom filter and the historical bloom filter to determine hits for the key in response to a query request for the key in the bloom filter;
and determining the access times according to the hit result.
8. A distributed data storage device, comprising:
the determining module is arranged for determining the access frequency of the data files stored in the three-copy cluster;
and the storage module is set to write the data files of the specified type into the EC cluster according to the access frequency and point the data pointers of the successfully written data files to the EC cluster.
9. An electronic device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the distributed data storage method of any of claims 1-7 based on instructions stored in the memory.
10. A computer-readable storage medium on which a program is stored, which program, when executed by a processor, implements the distributed data storage method of any one of claims 1-7.
CN202211678664.4A 2022-12-26 2022-12-26 Distributed data storage method and device, electronic equipment and readable medium Pending CN115981559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211678664.4A CN115981559A (en) 2022-12-26 2022-12-26 Distributed data storage method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211678664.4A CN115981559A (en) 2022-12-26 2022-12-26 Distributed data storage method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN115981559A true CN115981559A (en) 2023-04-18

Family

ID=85971837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211678664.4A Pending CN115981559A (en) 2022-12-26 2022-12-26 Distributed data storage method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN115981559A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117420953A (en) * 2023-10-07 2024-01-19 国家电网有限公司华东分部 Data storage method and device, computer equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117420953A (en) * 2023-10-07 2024-01-19 国家电网有限公司华东分部 Data storage method and device, computer equipment and readable storage medium
CN117420953B (en) * 2023-10-07 2024-03-26 国家电网有限公司华东分部 Data storage method and device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN110291509B (en) Method and system for storing data in a region of a decentralized storage network
US9519435B2 (en) Synchronous extent migration protocol for paired storage
US8131927B2 (en) Fast accessible compressed thin provisioning volume
US7076622B2 (en) System and method for detecting and sharing common blocks in an object storage system
US8769225B2 (en) Optimization of data migration between storage mediums
US20130166844A1 (en) Storage in tiered environment for colder data segments
WO2019001521A1 (en) Data storage method, storage device, client and system
US11314431B2 (en) Distributed data blocks using storage path cost values
CN109840051B (en) Data storage method and device of storage system
CN111124945B (en) Method, apparatus and computer readable medium for providing cache services
CN115981559A (en) Distributed data storage method and device, electronic equipment and readable medium
US8572343B2 (en) Synchronous extent migration protocol for paired storage
EP4170499A1 (en) Data storage method, storage system, storage device, and storage medium
US11182107B2 (en) Selective allocation of redundant data blocks to background operations
CN115993932A (en) Data processing method, device, storage medium and electronic equipment
US11340964B2 (en) Systems and methods for efficient management of advanced functions in software defined storage systems
US20230305728A1 (en) Management system, storage system, and management processing method
CN114296649B (en) Inter-cloud service migration system
US20230315691A1 (en) Read amplification reduction in a virtual storage system when compression is enabled for a zoned checksum scheme
CN115687170A (en) Data processing method, storage device and system
CN113973112A (en) Method for optimizing access to data nodes of a data cluster using a data access gateway and a bid based on metadata mapping
CN113973137A (en) Method and system for optimizing access to data nodes of a data cluster using a data access gateway and a bid counter
CN113973138A (en) Method and system for optimizing access to data nodes of a data cluster using a data access gateway

Legal Events

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