Multi-copy distributed data storage system and method based on SDS and Ceph
By using SDS and Ceph multi-replica distributed data storage systems, the reliability and scalability issues of centralized train data storage were resolved, achieving high data reliability and flexible scalability.
Patent Information
- Application Number
- CN202510778901.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-11-11
Smart Images

Figure CN120929009A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a distributed data storage system and method based on SDS and Ceph multi-replica. Background Technology
[0002] With the rapid development of technologies such as cloud computing, big data, and artificial intelligence, data volume is experiencing explosive growth, and the demands for data storage security are becoming increasingly stringent. Therefore, traditional storage solutions can no longer meet the high-performance, high-availability, and data security requirements of various businesses. Against this backdrop, there is a need to build a storage system that provides unified resource management and rapid scalability. Software-defined storage (SDS) and unified distributed storage systems (Ceph) have become the main solutions for SDS based on open-source software. This technology decouples highly coupled monolithic hardware into different components and establishes a virtualized software layer around these components. It implements the functions provided by the highly coupled monolithic hardware through APIs, and then manages and controls the hardware resources through software, enabling automated deployment, optimization, and management. Software-defined storage drives and controls resources, providing more flexible services to applications compared to highly coupled monolithic hardware. Currently, this technology is mainly used for cloud storage of images, videos, and log files. It supports diverse data types, version control, redundancy checks, and other functions, ensuring data security and stability.
[0003] In rail transit train monitoring systems, train data is usually stored in a centralized manner, which means storing the data on a single server or data center and managing the data through one or more servers. This centralized storage method has disadvantages such as being prone to single points of failure, poor reliability, storage performance bottlenecks, and poor scalability.
[0004] Currently, there is no effective solution to the problems of poor reliability and poor scalability that arise from the centralized storage method commonly used for train data in related technologies. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a distributed data storage system, method, computer device, and computer-readable storage medium based on SDS and Ceph multi-replica, so as to at least solve the problems of poor reliability and poor scalability of train data that are usually stored in a centralized manner in the related art.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows:
[0007] In a first aspect, embodiments of this application provide a distributed data storage system based on SDS and Ceph multi-replica, the architecture of which includes:
[0008] The RADOS layer is used to divide the raw data to be stored into multiple objects and store the multiple objects.
[0009] The storage pool layer includes multiple storage pools, each of which includes multiple PG placement groups. The PG placement groups are used to organize and manage the storage of the objects and map their locations. The PG placement groups and the objects have a one-to-many mapping relationship.
[0010] The OSD layer includes multiple object storage devices (OSDs) used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
[0011] In some embodiments, the RADOS layer is used to divide the raw data into multiple objects of equal size and configure an identifier for each object, wherein the identifier of the object consists of the identifier of the raw data and the position number of the object in the raw data.
[0012] In some embodiments, the mapping of the object to the PG placement group includes:
[0013] The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system;
[0014] The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1.
[0015] In some embodiments, the mapping of the PG placement group to the OSD includes:
[0016] The CRUSH algorithm is used to map the PG placement group to the OSD based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
[0017] Secondly, embodiments of this application provide a method for distributed data storage based on SDS and Ceph multi-replica, including:
[0018] The raw data to be stored is divided into multiple objects, and the multiple objects are stored in the RADOS layer;
[0019] The object is mapped to a PG placement group in the storage pool layer for storage. The storage pool layer includes multiple storage pools, and each storage pool includes multiple PG placement groups. The PG placement group is used to organize and manage the storage of the object and map its location. There is a one-to-many mapping relationship between the PG placement group and the object.
[0020] The objects in the PG placement group are mapped to object storage devices (OSDs) in the OSD layer for storage. The OSD layer includes multiple OSDs, which are used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
[0021] In some embodiments, the step of dividing the raw data to be stored into multiple objects and storing the multiple objects in the RADOS layer includes:
[0022] The original data is divided into multiple objects of the same size;
[0023] Each object is configured with an identifier, wherein the identifier of the object consists of the identifier of the original data and the position number of the object in the original data;
[0024] The plurality of objects are stored in the RADOS layer.
[0025] In some embodiments, mapping the object to a PG placement group in the storage pool layer for storage includes:
[0026] The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system;
[0027] The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1;
[0028] The object is mapped to the PG placement group for storage.
[0029] In some embodiments, mapping the objects in the PG placement group to an object storage device (OSD) in the OSD layer for storage includes:
[0030] The CRUSH algorithm is used to map the objects in the PG placement group to the OSD for storage, based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
[0031] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the SDS and Ceph multi-replica distributed data storage method as described in the second aspect above.
[0032] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the SDS and Ceph multi-replica distributed data storage method as described in the second aspect above.
[0033] This application adopts the above technical solution. Compared with the prior art, the embodiment of this application provides a distributed data storage system based on SDS and Ceph multi-replica. The system architecture includes three layers: a RADOS layer, used to divide the raw data to be stored into multiple objects and store the multiple objects; a storage pool layer, including multiple storage pools, each of which includes multiple PG placement groups, which are used to organize and manage the storage of the objects and map their locations, wherein there is a one-to-many mapping relationship between the PG placement group and the object; and an OSD layer, including multiple object storage devices (OSDs), which are used to save the objects to physical disks, wherein the Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks. This solves the problems of poor reliability and poor scalability in the centralized storage method commonly used for train data in related technologies, and achieves the effect of improving the reliability, scalability, and redundancy of train data.
[0034] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0035] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0036] Figure 1This is a schematic diagram of the architecture of a distributed data storage system based on SDS and Ceph multi-replica according to an embodiment of this application;
[0037] Figure 2 This is a schematic diagram of the Object to PG placement group and OSD mapping process according to an embodiment of this application;
[0038] Figure 3 This is a flowchart of a distributed data storage method based on SDS and Ceph multi-replica according to an embodiment of this application;
[0039] Figure 4 This is a structural block diagram of a distributed data storage device based on SDS and Ceph multi-replica according to an embodiment of this application;
[0040] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0042] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0043] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0044] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0045] First, the technical terms used in the embodiments of this application are explained as follows:
[0046] SDS: Software Defined Storage.
[0047] Ceph: An open-source distributed storage system.
[0048] RADOS: Reliable Automatic Distributed Object Store.
[0049] API: Application Programming Interface.
[0050] Object: An object.
[0051] PG: Placement Group.
[0052] OSD: Object Storage Device.
[0053] CRUSH: The data distribution algorithm used by Ceph, similar to consistent hashing (Controlled Replication Under Scalable Hashing).
[0054] DISK: Hard disk, physical medium for storing data.
[0055] This embodiment provides a distributed data storage system based on SDS and Ceph multi-replicas. This system can be applied to rail transit train monitoring systems to improve the redundancy, reliability, and scalability of train data storage.
[0056] Figure 1 This is a schematic diagram of the architecture of a distributed data storage system based on SDS and Ceph multi-replica according to an embodiment of this application, such as... Figure 1 As shown, the system architecture may include:
[0057] The RADOS layer is used to divide the raw data to be stored into multiple objects and store the multiple objects.
[0058] The storage pool layer includes multiple storage pools, each of which includes multiple PG placement groups. The PG placement groups are used to organize and manage the storage of the objects and map their locations. The PG placement groups and the objects have a one-to-many mapping relationship.
[0059] The OSD layer includes multiple object storage devices (OSDs) used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
[0060] The architecture design of a rail transit train monitoring system based on SDS and Ceph technologies for implementing multiple data replicas, as proposed in this application embodiment, takes three replicas as an example. Several business data connected to the train's intelligent terminal are divided into fixed-size data blocks, typically 4MB, and each data block is stored as three replicas on different nodes (e.g., Figure 1 As shown, its distribution mechanism follows the consistent hashing or CRUSH algorithm, randomly distributing each replica of the data across different nodes and disks to achieve automatic data balancing and horizontal scaling. When a disk or node fails or is damaged, the system automatically rebuilds a new data replica according to pre-set rules, which is called data reconstruction.
[0061] This application describes a train monitoring system scenario with high latency requirements, including systems under the dispatch center control room, including: train monitoring system, operation and maintenance monitoring system, station monitoring system, and other specialized monitoring systems.
[0062] The three layers in the system architecture will be explained in detail below:
[0063] The RADOS layer is the foundation of a Ceph cluster. In Ceph, everything is stored as objects, and the RADOS layer is responsible for storing these objects, regardless of their data types. The RADOS layer ensures data consistency and reliability.
[0064] In some embodiments, the RADOS layer is used to divide the raw data into multiple objects of equal size and configure an identifier for each object, wherein the identifier of the object consists of the identifier of the raw data and the position number of the object in the raw data.
[0065] In this embodiment, the raw data can be understood as the file (File) that the user wants to store or access, and the object (Object) is the object seen by the RADOS layer. The difference between an Object and a File is that the maximum size of an Object is limited by the RADOS layer (usually 2MB or 4MB) to facilitate the organization and management of the underlying storage. Therefore, when an upper-layer application stores a large File to the RADOS layer, the File needs to be divided into a series of Objects of uniform size (the last one can be of different sizes) for storage. This corresponds to the objects in the application. The purpose of this File-to-Object mapping is to map the File that the user wants to operate on into an Object that the RADOS layer can process. The mapping is very simple; essentially, it involves dividing the File according to the maximum size of the Object. This division has two advantages: first, it transforms Files of unlimited size into Objects of uniform maximum size that can be efficiently managed by the RADOS layer; second, it transforms the serial processing of a single File into parallel processing of multiple Objects. Each Object generated after division will obtain a unique identifier (oid), i.e., Objectid. Its generation method is also a linear mapping; ino is the metadata of the File to be operated on, which can be simply understood as the unique ID of that File. `ono` is the position number of an object generated from the partitioning of the file. `oid` is simply this position number appended to the file ID.
[0066] For example, if a File with the id "Filename" is split into three Objects, their Object indices will be 0, 1, and 2 respectively, and the resulting IoDs will be Filename0, Filename1, and Filename2 respectively. It's important to note that the uniqueness of the object's IoD must be guaranteed; otherwise, subsequent steps will not work correctly.
[0067] The storage pool layer includes multiple storage pools (Pools), each containing many Placement Groups (PGs). The attributes of each PG placement group can include, but are not limited to, owner and access permissions, number of object replicas, number of PGs, and CRUSH rule set. Each PG placement group is used to manage objects, and each object is ultimately mapped to a specific PG placement group through CRUSH calculation. A PG placement group can contain multiple objects.
[0068] The purpose of a PG (Object Storage Group) is to organize and manage the storage and location mapping of objects. One PG is responsible for several objects (potentially thousands or more), but an object can only be mapped to one PG; that is, there is a one-to-many mapping relationship between PGs and objects. Simultaneously, one PG is mapped to n object storage devices (OSDs), and each OSD hosts a large number of PGs; that is, there is a many-to-many mapping relationship between PGs and OSDs. For production environments, at least three OSDs are required. A single OSD can host hundreds of PGs. It should be noted that setting the number of PGs involves the issue of data distribution balance.
[0069] In some embodiments, the mapping of the object to the PG placement group includes:
[0070] The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system;
[0071] The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1.
[0072] like Figure 2 As shown, the mapping from an Object to a Group Placement (PG) occurs after a File is mapped to one or more Objects. Each Object needs to be independently mapped to a PG. The calculation formula is as follows:
[0073] hash(oid) & mask = pgid
[0074] Therefore, the calculation consists of two steps: First, the hash value of the object identifier `oid` is calculated using the static hash function specified by the Ceph system, mapping `oid` to a pseudo-random value with an approximately evenly distributed distribution; then, this random value is bitwise ANDed with the mask to obtain the final PG placement group number `pgid`. According to the design of the RADOS layer, given the total number of PG placement groups is `m` (m should be an integer that is a multiple of 2), the value of the mask is -1. Therefore, the hash value calculation and operation result is actually a roughly uniform random selection from all `m` PG placement groups. Based on this mechanism, when there are a large number of Objects and a large number of PG placement groups, the RADOS layer can guarantee an approximately uniform mapping between Objects and PG placement groups. Furthermore, because Objects are derived from Files, most Objects have the same size, thus this mapping ultimately ensures that the total amount of data of Objects stored in each PG placement group is approximately uniform.
[0075] The OSD layer is responsible for responding to client requests and returning specific data. A typical Ceph cluster has multiple OSDs, and the final data is also saved to disk by the OSDs. The Ceph cluster manages the physical disks by managing the OSDs. OSD stands for Object Storage Device. It's important to note that the number of OSDs is related to the data distribution balance of the system; therefore, the number cannot be too small. Generally, one disk corresponds to one OSD.
[0076] In some embodiments, the mapping of the PG placement group to the OSD includes:
[0077] The CRUSH algorithm is used to map the PG placement group to the OSD based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
[0078] The mapping from PG placement groups to OSDs involves mapping PG placement groups, which are logical organizational units of objects, to the actual storage units of data, OSDs. The RADOS layer uses an algorithm called CRUSH, which calculates which OSDs a PG placement group falls into by evenly distributing it according to a CRUSH map and CRUSH rules. A CRUSH map is a directed acyclic graph where all leaf nodes are OSDs, used to describe the physical organization and hierarchical structure of OSDs. CRUSH rules are the data mapping strategy. Figure 2As shown, given an input PG, the CRUSH algorithm outputs a deterministically ordered storage target vector R. When the input is 4.32, CRUSH utilizes a powerful multi-integer hash function to calculate independent, completely deterministic, and reliable mappings based on the cluster map, location rules, and the PG. Substituting the pgid into this, we obtain a total of n OSDs. These n OSDs are collectively responsible for storing and maintaining all objects in a PG placement group. As described earlier, the value of n can be configured according to the reliability requirements of the actual application; in production environments, it is typically 3. Specifically, for each OSD, its OSD daemon is responsible for performing operations such as storing, accessing, and maintaining metadata of the mapped objects in the local file system. The OSD daemon is primarily responsible for managing all disks in the cluster. The OSD daemon is also responsible for storing data in the local file system and providing data access over the network for different client software or access media.
[0079] So far, Ceph has completed the entire mapping process from File to Object, PG, and OSD through three mappings. Throughout this process, it can be seen that there is no need for any global table lookup operations. The maintenance and operation of the only global data structure, the cluster map, are lightweight and will not adversely affect the system's scalability or performance.
[0080] This application presents an architecture design for a rail transit train monitoring system that utilizes SDS and Ceph technologies to implement multiple data replicas, reducing the vulnerability of data loss and providing a practical deployment method for data security and reliability. This technology can be applied to various important subway stations and other similar facilities, offering the following advantages compared to existing traditional storage architectures:
[0081] (1) Using Ceph storage multi-replica technology to replace traditional centralized storage with storage data block partitioning. Through Ceph's CRUSH algorithm, data blocks are partitioned and distributed to multiple replica nodes, which can achieve maximum reliability of business data storage, avoid data loss in abnormal situations, and also avoid the situation where data loss cannot be recovered, thus providing maximum protection for train data security.
[0082] (2) Using Ceph distributed storage technology to replace the traditional storage server network with a dual-redundant link aggregation network increases the robustness of storage performance transmission, and is faster and more flexible in deployment than traditional deployment.
[0083] This embodiment also provides a distributed data storage method based on SDS and Ceph multi-replica. Figure 3This is a flowchart of a distributed data storage method based on SDS and Ceph multi-replica according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps:
[0084] Step S301: Divide the original data to be stored into multiple objects and store the multiple objects in the RADOS layer;
[0085] Step S302: The object is mapped to a PG placement group in the storage pool layer for storage. The storage pool layer includes multiple storage pools, and each storage pool includes multiple PG placement groups. The PG placement group is used to organize and manage the storage of the object and map its location. There is a one-to-many mapping relationship between the PG placement group and the object.
[0086] Step S303: Map the objects in the PG placement group to the object storage device OSD in the OSD layer for storage. The OSD layer includes multiple OSDs, which are used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
[0087] It should be noted that the above three steps correspond to three data mapping processes: step S301 maps the original data (File) to the object (Object); step S302 maps the object to the PG placement group; and step S303 maps the PG placement group to the OSD. Through these three mapping processes, the problems of poor reliability and scalability inherent in the centralized storage method commonly used for train data in related technologies are solved, thereby improving the reliability, scalability, and redundancy of train data.
[0088] In some embodiments, step S301 divides the raw data to be stored into multiple objects and stores the multiple objects in the RADOS layer, including:
[0089] The original data is divided into multiple objects of the same size;
[0090] Each object is configured with an identifier, wherein the identifier of the object consists of the identifier of the original data and the position number of the object in the original data;
[0091] The plurality of objects are stored in the RADOS layer.
[0092] In some embodiments, step S302, which maps the object to a PG placement group in the storage pool layer for storage, includes:
[0093] The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system;
[0094] The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1;
[0095] The object is mapped to the PG placement group for storage.
[0096] In some embodiments, step S303 maps the objects in the PG placement group to an object storage device (OSD) in the OSD layer for storage:
[0097] The CRUSH algorithm is used to map the objects in the PG placement group to the OSD for storage, based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
[0098] The specific processing procedures for the RADOS layer, storage pool layer, and OSD layer in the above embodiments correspond to those in the system embodiments. Since these specific processing procedures have been described in detail in the above system embodiments, they will not be repeated here.
[0099] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0100] This embodiment provides a distributed data storage device based on SDS and Ceph multi-replica, which is used to implement the above embodiments and preferred embodiments. Details already described will not be repeated. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0101] Figure 4 This is a structural block diagram of a distributed data storage device based on SDS and Ceph multi-replica according to an embodiment of this application, such as... Figure 4 As shown, the device includes:
[0102] The first storage unit 41 is used to divide the original data to be stored into multiple objects and store the multiple objects in the RADOS layer;
[0103] The second storage unit 42 is used to map the object to a PG placement group in the storage pool layer for storage. The storage pool layer includes multiple storage pools, and each storage pool includes multiple PG placement groups. The PG placement group is used to organize and manage the storage of the object and map its location. The PG placement group and the object have a one-to-many mapping relationship.
[0104] The third storage unit 43 is used to map the objects in the PG placement group to object storage devices (OSDs) in the OSD layer for storage. The OSD layer includes multiple OSDs, which are used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
[0105] In some embodiments, the first storage unit 41 includes:
[0106] The segmentation module is used to segment the original data into multiple objects of the same size;
[0107] A configuration module is used to configure an identifier for each object, wherein the identifier of the object consists of the identifier of the original data and the position number of the object in the original data;
[0108] The first storage module is used to store the plurality of objects in the RADOS layer.
[0109] In some embodiments, the second storage unit 42 includes:
[0110] The calculation module is used to calculate the hash value of the object's identifier using a static hash function specified by the Ceph system;
[0111] The AND module is used to perform a bitwise AND operation between the hash value and the mask to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1;
[0112] The second storage module is used to map the object to the PG placement group for storage.
[0113] In some embodiments, the third storage unit 43 includes:
[0114] The mapping module is used to map the objects in the PG placement group to the OSD for storage using the CRUSH algorithm, based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped locally.
[0115] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0116] An embodiment provides a computer device. The SDS and Ceph multi-replica distributed data storage method, as described in this application embodiment, can be implemented using this computer device. Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application.
[0117] The computer device may include a processor 51 and a memory 52 storing computer program instructions.
[0118] Specifically, the processor 51 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0119] The memory 52 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 52 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 52 may include removable or non-removable (or fixed) media. Where appropriate, the memory 52 may be internal or external to a data processing device. In a particular embodiment, the memory 52 is non-volatile memory. In a particular embodiment, the memory 52 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0120] The memory 52 can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 51.
[0121] The processor 51 reads and executes computer program instructions stored in the memory 52 to implement any of the SDS and Ceph multi-replica distributed data storage methods in the above embodiments.
[0122] In some embodiments, the computer device may further include a communication interface 53 and a bus 50. For example, Figure 5 As shown, the processor 51, memory 52, and communication interface 53 are connected through bus 50 and complete communication with each other.
[0123] The communication interface 53 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of this application. The communication interface 53 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0124] Bus 50 includes hardware, software, or both, that couples components of a computer device together. Bus 50 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 50 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 50 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.
[0125] Furthermore, in conjunction with the SDS and Ceph multi-replica distributed data storage methods described in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the SDS and Ceph multi-replica distributed data storage methods described in the above embodiments.
[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A distributed data storage system based on SDS and Ceph with multiple replicas, characterized in that, The architecture of the system includes: The RADOS layer is used to divide the raw data to be stored into multiple objects and store the multiple objects. The storage pool layer includes multiple storage pools, each of which includes multiple PG placement groups. The PG placement groups are used to organize and manage the storage of the objects and map their locations. The PG placement groups and the objects have a one-to-many mapping relationship. The OSD layer includes multiple object storage devices (OSDs) used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
2. The system according to claim 1, characterized in that, The RADOS layer is used to divide the original data into multiple objects of equal size, and to configure an identifier for each object, wherein the identifier of the object consists of the identifier of the original data and the position number of the object in the original data.
3. The system according to claim 2, characterized in that, The mapping of the object to the PG placement group includes: The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system; The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1.
4. The system according to claim 3, characterized in that, The mapping of the PG placement group to the OSD includes: The CRUSH algorithm is used to map the PG placement group to the OSD based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
5. A distributed data storage method based on SDS and Ceph with multiple replicas, characterized in that, include: The raw data to be stored is divided into multiple objects, and the multiple objects are stored in the RADOS layer; The object is mapped to a PG placement group in the storage pool layer for storage. The storage pool layer includes multiple storage pools, and each storage pool includes multiple PG placement groups. The PG placement group is used to organize and manage the storage of the object and map its location. There is a one-to-many mapping relationship between the PG placement group and the object. The objects in the PG placement group are mapped to object storage devices (OSDs) in the OSD layer for storage. The OSD layer includes multiple OSDs, which are used to save the objects to physical disks. The Ceph system manages the physical disks by managing the OSDs, and there is a one-to-one mapping relationship between the OSDs and the physical disks.
6. The method according to claim 5, characterized in that, The step of dividing the raw data to be stored into multiple objects and storing the multiple objects in the RADOS layer includes: The original data is divided into multiple objects of the same size; Each object is configured with an identifier, wherein the identifier of the object consists of the identifier of the original data and the position number of the object in the original data; The plurality of objects are stored in the RADOS layer.
7. The method according to claim 6, characterized in that, The step of mapping the object to a PG placement group in the storage pool layer for storage includes: The hash value of the object's identifier is calculated using the static hash function specified by the Ceph system; The hash value and the mask are bitwise ANDed to obtain the identifier of the PG placement group, wherein when the number of PG placement groups is an integer that is a multiple of 2, the value of the mask is -1; The object is mapped to the PG placement group for storage.
8. The method according to claim 7, characterized in that, The step of mapping the objects in the PG placement group to the object storage device OSD in the OSD layer for storage includes: The CRUSH algorithm is used to map the objects in the PG placement group to the OSD for storage, based on the directed acyclic graph and data mapping strategy of the CRUSH algorithm. The directed acyclic graph is used to describe the physical organization and hierarchical structure of the OSD, and the daemon process in the OSD is used to perform storage and management operations on the objects mapped to the local machine.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 5 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 5 to 8.