Data writing method, system, device and readable storage medium

By partitioning and mounting the solid-state drive into the F2FS file system, the data writing method under the Ceph architecture is optimized, which solves the problem of low writing performance and waste of solid-state drives under the Ceph architecture, and improves the writing capability and response of the storage system. speed.

CN115129247BActive Publication Date: 2024-10-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210747686.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2024-10-22
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

When using the FileStore mode under the Ceph architecture, the disk writing performance is low, and the solid-state drive has the problem of exclusive waste.

Method used

Divide the solid state drive into the first partition and the second partition, encapsulate the second partition and the HDD hard disk into logical partitions, mount them to the F2FS file system, and write the transaction log data to the first partition first, and the data to the logical partition. And divide the sub-partitions according to the capacity ratio of the HDD hard disk, and write to the efficient SSD hard disk space first.

Benefits of technology

Make full use of the idle area and data reading and writing speed of the solid-state drive in the storage system to improve the data writing capability and responsiveness of the storage system, avoiding waste of solid-state drive space and limitations in HDD writing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129247B_ABST
    Figure CN115129247B_ABST
Patent Text Reader

Abstract

The present invention proposes a data writing method, comprising: dividing a solid state hard disk into a first partition and a second partition, and encapsulating the second partition and a HDD hard disk into a logical partition and mounting it to a file system; carrying the transaction log data of the file system through the first partition and writing data corresponding to the transaction log data into the logical partition. Through the data writing method proposed by the present invention, the storage space of the idle area of ​​the solid state hard disk in the storage system and the data reading and writing speed of the solid state hard disk are fully utilized to replace the HDD hard disk directly as the disk landing device of the storage system, so as to improve the data writing capability and response capability of the storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computers, and in particular relates to a data writing method, system, device and readable storage medium. Background Art

[0002] The present invention is based on the extension of Ceph open source framework. At present, Ceph has become a highly sought-after open source storage solution in the OpenStack community. The Ceph storage system can effectively solve the scale changes, equipment changes, and data changes caused by large-scale deployment of clusters, and has high reliability, high automation, and high scalability. As a provider in the storage field, in specific scenarios, limited hardware resources should be used to accurately control the read and write performance improvement specific to the block size, and meet business requirements while considering costs.

[0003] Existing storage technologies based on the Ceph framework, except for algorithm optimization, face scenarios with multiple write requirements, such as Figure 2 As shown in the figure, from the perspective of the file system, most of the write performance improvements are achieved based on the filestore disk method. In the rados architecture, the files that users need to store or access are sliced ​​into 2M or 4M size to get objects. Each object is first calculated by the HASH algorithm to get the corresponding PG (Placement Group, which is used to organize the storage and position mapping of the object). Finally, the PG is responsible for mapping the object to the corresponding OSD through the CRUSH algorithm. OSD can be abstracted into two parts: system and daemon (OSD Daemon). Each OSD has its own OSD Daemon. This Daemon is responsible for completing all the logical functions of the OSD; while the system part of the OSD occupies part of the computing power, a certain amount of memory and a hard disk (usually one OSD corresponds to one hard disk) and network resources, and an independent file system is installed for data storage.

[0004] At the OSD layer, each object is considered a file by FileStore. The attributes (xattr) of the object are accessed using the attributes of the file. Due to the length restrictions on attributes in some file systems, attributes that exceed the length are stored as omap. Usually, FileStore uses the XFS file system to store objects by default. That is, Ceph introduces transactions and logs to achieve the atomicity of data write operations and solve the problem of data inconsistency. This is the so-called "ceph data double write": first encapsulate all the data into a transaction, write it as a log, and then flush the data back to the object file regularly to persist it in the ceph-osd filestore. Based on the above process, SSD can be used as the underlying storage device of ceph-osdjournal, which improves the writing performance of small blocks.

[0005] Since the ceph-osd journal has the characteristics of circular writing and periodic flushing in its implementation logic, this will result in a very low utilization rate of the SSD device capacity space; even if the journal write efficiency is improved, in a mixed media storage system, the HDD where the data is actually written to the disk generally uses a SATA or SAS disk, which will also limit the improvement of the write efficiency. Summary of the invention

[0006] In order to solve the above problems, the present invention provides a data writing method, comprising:

[0007] Divide the solid state drive into a first partition and a second partition, and encapsulate the second partition and the HDD hard disk into a logical partition and mount it to the file system;

[0008] The transaction log data of the file system is carried by the first partition and data corresponding to the transaction log data is written into the logical partition.

[0009] In some embodiments of the present invention, dividing the solid state drive into a first partition and a second partition, and encapsulating the second partition and the HDD hard disk into a logical partition and mounting the partition to the file system includes:

[0010] The second partition is divided into corresponding sub-partitions according to the number of HDD hard disks, and the HDD hard disk and the corresponding sub-partitions are mounted to the F2FS file system as an OSD partition.

[0011] In some implementations of the present invention, dividing the second partition into corresponding sub-partitions according to the number of HDD hard disks includes:

[0012] The ratio of the corresponding HDD hard disk capacity to the total capacity of all HDD hard disks is used as the weight of the sub-partition, and the second partition is divided based on the weight.

[0013] In some embodiments of the invention, the method further comprises:

[0014] The first partition and the logical partition are mounted to a Ceph system and an F2FS file system, and storage locations of the first partition and the logical partition are specified in the Ceph system and the F2FS file system.

[0015] In some embodiments of the present invention, specifying the storage location of the first partition and the logical partition in the Ceph system and the F2FS file system includes:

[0016] Using the first partition as a storage location for transaction log data and using the logical partition as a data storage location in the Ceph system;

[0017] The first partition is used as a metadata storage area in the F2FS file system, and a plurality of parameters in the F2FS system are aligned with the first partition.

[0018] In some embodiments of the invention, the method further comprises:

[0019] In response to receiving a data writing task, the transaction log data in the writing task is written to the first partition and the data of the writing task is written to the logical partition through the F2FS file system.

[0020] In some implementations of the present invention, writing the data of the write task to the logical partition includes:

[0021] Establishing a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially writing the data to the sub-partition based on the mapping relationship; and

[0022] In response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into a HDD hard disk corresponding to the sub-partition through the F2FS file system.

[0023] Another aspect of the present invention further provides a data writing system, comprising:

[0024] A management module, the management module is configured to divide the solid state drive into a first partition and a second partition, and encapsulate the second partition and the HDD hard disk into a logical partition and mount it to a file system;

[0025] A data writing module is configured to carry the transaction log data of the file system through the first partition and write data corresponding to the transaction log data into the logical partition.

[0026] Another aspect of the present invention further provides a computer device, comprising:

[0027] at least one processor; and

[0028] A memory, wherein the memory stores computer instructions that can be executed on the processor, and when the instructions are executed by the processor, the steps of the method described in any one of the above-mentioned embodiments are implemented.

[0029] Another aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the above-mentioned embodiments are implemented.

[0030] Through the data writing method proposed in the present invention, the storage space of the idle area of ​​the solid-state hard disk in the storage system and the data reading and writing speed of the solid-state hard disk are fully utilized to replace the HDD hard disk directly as the disk writing device of the storage system, so as to improve the data writing capability and response capability of the storage system. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A method flow chart of a data writing method provided by an embodiment of the present invention;

[0033] Figure 2 A schematic diagram of an application of a Ceph architecture in the prior art provided by an embodiment of the present invention;

[0034] Figure 3 An application schematic diagram of the improved Ceph architecture of the present invention provided in an embodiment of the present invention;

[0035] Figure 4 A schematic diagram of the architecture of a data writing system provided by an embodiment of the present invention;

[0036] Figure 5 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention;

[0037] Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0039] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0040] The present invention aims to solve the problem that the disk write performance is low when using the FileStore mode to store data under the Ceph architecture, and the solid-state hard disk used has exclusive waste. Figure 2 As shown in the figure, in the traditional implementation of Ceph architecture, in the data placement stage (i.e. operating the disk to write data to the disk), in order to achieve the atomicity of the data placement operation and solve the data consistency problem, Ceph encapsulates the data into a transaction and writes the whole as a log to Ceph-osdjournal, i.e. filejournal, to persist the data in the form of filejournal. In FileStore mode, the corresponding filejournal will first be written to a storage device with a higher speed, such as SSD / nvme solid-state hard disk as cache. In addition, due to the limitations of Ceph architecture, the cache in FileStore mode is generally set to about 10GB, that is, only 10GB of space of SSD / nvme solid-state hard disk is used (BlueStore mode uses SSD as cache more often, which is a direct management of raw devices under Ceph. It abandons the original file system and uses a specific file system blueFS to connect to RocksDB. The metadata is saved in the KV database in the form of KV.) This causes a waste of SSD space on the device. Of course, the 10GB space can also be replaced by memory as cache to save the consumption of SSD hard disk, but it will cause memory space shortage.

[0041] like Figure 1 As shown, in order to solve the above problems, the present invention proposes a data writing method, comprising:

[0042] Step S1, dividing the solid state drive into a first partition and a second partition, and encapsulating the second partition and the HDD hard disk into a logical partition and mounting it to the file system;

[0043] Step S2: Carry the transaction log data of the file system through the first partition and write data corresponding to the transaction log data into the logical partition.

[0044] In the embodiment of the invention, in step S1, Figure 3 As shown, the solid state drive is divided into a first partition (SSDPART1 in the figure) and a second partition (SSDPART2 in the figure). SSDPART2 and HDD are further encapsulated into logical partitions and mounted to the F2FS file system. F2FS (Flash Friendly File System) is a log-appending file system designed specifically for flash memory devices. It replaces the original XFS file system in the Ceph architecture. The filejournal data sent by Ceph after the F2FS file system is stored in the first and second partitions according to the data writing method of the filejournal under Ceph.

[0045] In step S2, the filejournal is specifically written into the first partition through the F2FS file system, and the metadata and log under the F2FS file system are also written into the first partition. The data to be permanently stored is written into the second area through the F2FS file system.

[0046] In some embodiments of the present invention, dividing the solid state drive into a first partition and a second partition, and encapsulating the second partition and the HDD hard disk into a logical partition and mounting the partition to the file system includes:

[0047] The second partition is divided into corresponding sub-partitions according to the number of HDD hard disks, and the HDD hard disk and the corresponding sub-partitions are mounted to the F2FS file system as an OSD partition.

[0048] In this embodiment, when partitioning the solid state drive, the size of the first partition can be set to 10 GB by default according to Ceph. For the second partition, the remaining SSD hard disk space is divided into a corresponding number of sub-partitions according to the number of HDD hard disks. If the number of HDD hard disks is 10, the remaining hard disk space is divided into 10 sub-partitions.

[0049] Furthermore, the HDD hard disk and the corresponding sub-partitions are encapsulated into an OSD partition under the Ceph architecture and mounted on the F2FS file system. Correspondingly, the OSD partition needs to be bound on the Ceph architecture. Figure 3 As shown in the figure, when Ceph sends the corresponding filejournal based on FielStore, the F2FS file system implements storing the filejournal data under the Ceph architecture in the OSD partition.

[0050] In some implementations of the present invention, dividing the second partition into corresponding sub-partitions according to the number of HDD hard disks includes:

[0051] The ratio of the corresponding HDD hard disk capacity to the total capacity of all HDD hard disks is used as the weight of the sub-partition, and the second partition is divided based on the weight.

[0052] In this embodiment, when the second partition (PART2) of the solid-state hard disk is divided into corresponding sub-partitions, the storage space distribution ratio of the HDD hard disk is used as the weight for dividing the corresponding sub-partitions. That is, ideally, if the storage space of the HDD hard disk is the same, the size of all sub-partitions of the second partition will be the same. If the storage space of the HDD hard disk is different, it is necessary to obtain the available space size of the corresponding HDD hard disk from the system, and then calculate the total storage space size of all HDD hard disks and calculate the ratio of the HDD hard disk storage space to the total storage space based on the storage space size of the corresponding HDD hard disk, and then divide the corresponding proportion of SSD space in the second partition according to the ratio. It should be noted that the division of the second partition sub-partition of the present invention must rely on the proportion of HDD hard disk space. Since the FileStore mode under the Ceph system sends filejournal in a load-balanced manner, when the sub-partition corresponding to the second partition and the corresponding HDD are encapsulated into an OSD partition under the Ceph architecture, the load balancing strategy of FileStore will send filejournal to the corresponding OSD partition according to the size of the OSD partition. If the second sub-partition division does not match the HDD space, it may cause the sub-partition storage space of the OSD with a large HDD storage space to not match the HDD storage space. However, when F2FS writes data, it gives priority to writing the corresponding sub-partition. Since the HDD hard disk storage space is large, FileStore sends more filejournals to the OSD partition, which can easily cause the sub-partition data to be easily filled in some cases. The HDD with a smaller storage space has a smaller filejournal allocated, but its corresponding SSD sub-partition is the same size as the sub-partition of the HDD hard disk with a larger storage space. In this case, the sub-partition of the HDD hard disk with a smaller storage space will be idle. This causes the acceleration effect of the present invention to fail.

[0053] Specifically, take three HDD hard disks as an example, assuming that the sizes of the three hard disks are 1TB, 2TB, and 3TB respectively. If the second partition of the SSD hard disk is evenly divided, assuming that the size of the second partition is 60GB, each hard disk will be allocated 20GB. When the OSD partition is formed and mounted on the F2FS and Ceph systems, FileStore will send the corresponding filejournal data to the OSD partitions corresponding to the three hard disks in a ratio of 1:2:3. According to the ratio of 1:2:3, it is easy to cause the data of the sub-partition corresponding to the third hard disk to be full. When the third sub-partition is full, there is still a lot of free space in the first and second sub-partitions. Therefore, the correct situation should be to allocate the second partition in a ratio of 1:2:3, that is, the first hard disk is allocated 10GB of space, the second hard disk is allocated 20GB of space, and the third hard disk is allocated 30GB of SSD space.

[0054] In some embodiments of the invention, the method further comprises:

[0055] The first partition and the logical partition are mounted to a Ceph system and an F2FS file system, and storage locations of the first partition and the logical partition are specified in the Ceph system and the F2FS file system.

[0056] In this embodiment, in order to enable the Ceph system to support the F2FS file system of the present invention as the underlying data writing system, the first partition and the logical partition (OSD partition) need to be configured to the Ceph system and the F2FS file system respectively. Specifically, the first partition is mounted to the / Ceph / Data / Osd / osd-nvme-(device SN)-partx / journal directory of the Ceph system, and the corresponding logical partition is mounted to / Ceph / Data / Osd / osd-nvme-(device sn)-partx.

[0057] In some embodiments of the present invention, specifying the storage location of the first partition and the logical partition in the Ceph system and the F2FS file system includes:

[0058] Using the first partition as a storage location for transaction log data and using the logical partition as a data storage location in the Ceph system;

[0059] The first partition is used as a metadata storage area in the F2FS file system, and a plurality of parameters in the F2FS system are aligned with the first partition.

[0060] In this embodiment, it is necessary to specify the disk location of the filejournal log and data in the Ceph system, that is, modify the osd part of the Ceph architecture configuration file ceph.conf. For example, the configuration parameters of OSD partition 0 are as follows:

[0061] [osd.0]

[0062] host = corresponding IP address

[0063] public addr = corresponding IP address

[0064] cluster addr = corresponding IP address

[0065] osdjournal= / Ceph / Data / Osd / osd-nvme-SSDPE2KX040T8L_PHLJ903500PF4P0DGN-part1 / journal

[0066] osddata= / Ceph / Data / Osd / osd-nvme-SSDPE2KX040T8L_PHLJ903500PF4P0DGN-part1;

[0067] osd_numa_node=0;

[0068] The above-mentioned osdjournal indicates the storage location of the filejournal log, which should point to the first partition. osd data indicates the corresponding data disk location and the corresponding HDD hard disk sub-partition. When in use, the Ceph system will use the F2FS file system to write the log data in the load-balanced data of OSD partition 0 (0 indicates the first OSD partition numbered in the computer, and the OSD partition refers to an HDD hard disk and an OSD partition encapsulated by a sub-partition of the second partition in the aforementioned content) to osdjournal, and write the disk data to osddata.

[0069] Furthermore, in the F2FS system, it is also necessary to specify the location of the journal and metadata in the F2FS file system, that is, F2FS is a file writing system developed specifically for flash memory, so there will be a relationship between metadata and data in the storage mechanism based on the SSD hard disk (the characteristics of SSD storage are that the corresponding data address is indexed in the flash memory through metadata). Therefore, in the present invention, the first partition of the SSD hard disk is used as the storage location of the filejournal data of Ceph at the same time, and the metadata of the F2FS system is also stored in the first partition.

[0070] Therefore, the metadata storage area (CP, SIT, NAT, SSA) of F2FS needs to be pointed to the first partition and aligned. (To avoid misalignment between the file system and flash storage, F2FS aligns the starting block address of CP with the Segment size. At the same time, F2FS aligns the starting block address of the Main Area with the Zone size.)

[0071] In some embodiments of the invention, the method further comprises:

[0072] In response to receiving a data writing task, the transaction log data in the writing task is written to the first partition and the data of the writing task is written to the logical partition through the F2FS file system.

[0073] In this embodiment, when data is received from Ceph's FileStore, the data is processed by the F2FS file system, the filejournal data is written to the first partition, and the corresponding disk data is written to the encapsulated OSD partition, i.e., the logical partition. In this embodiment, the xattr method of the F2FS file system is used to implement data being stored on different disk media.

[0074] In some implementations of the present invention, writing the data of the write task to the logical partition includes:

[0075] Establishing a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially writing the data to the sub-partition based on the mapping relationship; and

[0076] In response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into a HDD hard disk corresponding to the sub-partition through the F2FS file system.

[0077] In this embodiment, after the OSD partition is mounted to the F2FS file system, in order to receive the disk data sent by the Ceph system, and to save the disk data in the sub-partition whose storage medium is a high-speed SSD solid-state hard disk first, and then quickly write the data content of the sub-partition to the corresponding HHD hard disk in a sequential write manner, it is necessary to distinguish and establish a mapping relationship between the sub-partition in the OSD partition and the corresponding HDD hard disk in the F2FS file system to prevent random writing of the OSD partition. In this embodiment, the fsrepair HDD hard disk and SSD sub-partition in the F2FS file system are used, for example:

[0078] fsrepair.f2fs / opt / ceph / f2fs / conf / f2fs-nvme-INTEL_SSDPEDME016T4S_CVMD4475003T1P6KGN-part1.conf-o 0-m / dev / disk / by-id / scsi-35000c500b80bf447-part1, / dev / disk / by-id / scsi-35000c500b80acb7f-part1-d 0.

[0079] -m indicates that the content in the sub-partition is to be written to the address of the corresponding HDD hard disk. In this way, the F2FS system will give priority to writing the data sent by the Ceph system to the sub-partition, and then read the data from the sub-partition and write it to the HDD hard disk. With the help of the high-speed performance of the SSD hard disk, the data response capability of the FileStore mode under the Ceph system can be greatly improved, that is, by dropping the data into the SSD sub-partition of the OSD, the corresponding filejournal log data can be cleared, based on which the log transaction data and disk data of the filejournal in the FileStore mode can be quickly processed.

[0080] Furthermore, in some embodiments of the present invention, in order to improve the writing efficiency to the HDD hard disk, a threshold value for writing data from a corresponding sub-partition to a corresponding HDD hard disk is set in the F2FS system, that is, when a certain amount of disk data in the sub-partition is stored, data writing to the HDD hard disk is triggered, thereby improving the writing efficiency to the HDD hard disk and preventing frequent triggering of IO requests but a low data writing amount, resulting in reduced IO efficiency of the entire system.

[0081] Through the data writing method proposed in the present invention, the storage space of the idle area of ​​the solid-state hard disk in the storage system and the data reading and writing speed of the solid-state hard disk are fully utilized to replace the HDD hard disk directly as the disk writing device of the storage system, so as to improve the data writing capability and response capability of the storage system.

[0082] The present invention optimizes the filestore backend storage disk mode and makes full use of the journal cache device, thereby achieving the following effects: avoiding the space waste caused by allocating a separate SSD / NVMe device to the filejournal; the F2FS file system solves the problem that the metadata journal of the original file system is located on the HDD by specifying the metadata location on the cache device, causing a bottleneck due to the journal; during the data disk drop process, the newly written data directly returns success after the cache disk is completed, and when the cache disk reaches the threshold, the data is flushed to the HDD, thereby improving the writing efficiency.

[0083] like Figure 4 As shown, another aspect of the present invention further provides a data writing system, comprising:

[0084] A management module 1, wherein the management module 1 is configured to divide the solid state drive into a first partition and a second partition, and encapsulate the second partition and the HDD hard disk into a logical partition and mount the partition to a file system;

[0085] The data writing module 2 is configured to carry the transaction log data of the file system through the first partition and write data corresponding to the transaction log data into the logical partition.

[0086] like Figure 5 As shown, another aspect of the present invention further provides a computer device, comprising:

[0087] at least one processor 21; and

[0088] A memory 22, wherein the memory 22 stores computer instructions 23 that can be run on the processor 21, and when the instructions 23 are executed by the processor 21, a data writing method is implemented, including:

[0089] Divide the solid state drive into a first partition and a second partition, and encapsulate the second partition and the HDD hard disk into a logical partition and mount it to the file system;

[0090] The transaction log data of the file system is carried by the first partition and data corresponding to the transaction log data is written into the logical partition.

[0091] In some embodiments of the present invention, dividing the solid state drive into a first partition and a second partition, and encapsulating the second partition and the HDD hard disk into a logical partition and mounting the partition to the file system includes:

[0092] The second partition is divided into corresponding sub-partitions according to the number of HDD hard disks, and the HDD hard disk and the corresponding sub-partitions are mounted to the F2FS file system as an OSD partition.

[0093] In some implementations of the present invention, dividing the second partition into corresponding sub-partitions according to the number of HDD hard disks includes:

[0094] The ratio of the corresponding HDD hard disk capacity to the total capacity of all HDD hard disks is used as the weight of the sub-partition, and the second partition is divided based on the weight.

[0095] In some embodiments of the invention, the method further comprises:

[0096] The first partition and the logical partition are mounted to a Ceph system and an F2FS file system, and storage locations of the first partition and the logical partition are specified in the Ceph system and the F2FS file system.

[0097] In some embodiments of the present invention, specifying the storage location of the first partition and the logical partition in the Ceph system and the F2FS file system includes:

[0098] Using the first partition as a storage location for transaction log data and using the logical partition as a data storage location in the Ceph system;

[0099] The first partition is used as a metadata storage area in the F2FS file system, and a plurality of parameters in the F2FS system are aligned with the first partition.

[0100] In some embodiments of the invention, the method further comprises:

[0101] In response to receiving a data writing task, the transaction log data in the writing task is written to the first partition and the data of the writing task is written to the logical partition through the F2FS file system.

[0102] In some implementations of the present invention, writing the data of the write task to the logical partition includes:

[0103] Establishing a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially writing the data to the sub-partition based on the mapping relationship; and

[0104] In response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into a HDD hard disk corresponding to the sub-partition through the F2FS file system.

[0105] like Figure 6 In another aspect of the present invention, there is also a computer-readable storage medium 401, wherein the computer-readable storage medium 401 stores a computer program 402, and when the computer program 402 is executed by a processor, a data writing method is implemented, including:

[0106] Divide the solid state drive into a first partition and a second partition, and encapsulate the second partition and the HDD hard disk into a logical partition and mount it to the file system;

[0107] The transaction log data of the file system is carried by the first partition and data corresponding to the transaction log data is written into the logical partition.

[0108] In some embodiments of the present invention, dividing the solid state drive into a first partition and a second partition, and encapsulating the second partition and the HDD hard disk into a logical partition and mounting the partition to the file system includes:

[0109] The second partition is divided into corresponding sub-partitions according to the number of HDD hard disks, and the HDD hard disk and the corresponding sub-partitions are mounted to the F2FS file system as an OSD partition.

[0110] In some implementations of the present invention, dividing the second partition into corresponding sub-partitions according to the number of HDD hard disks includes:

[0111] The ratio of the corresponding HDD hard disk capacity to the total capacity of all HDD hard disks is used as the weight of the sub-partition, and the second partition is divided based on the weight.

[0112] In some embodiments of the invention, the method further comprises:

[0113] The first partition and the logical partition are mounted to a Ceph system and an F2FS file system, and storage locations of the first partition and the logical partition are specified in the Ceph system and the F2FS file system.

[0114] In some embodiments of the present invention, specifying the storage location of the first partition and the logical partition in the Ceph system and the F2FS file system includes:

[0115] Using the first partition as a storage location for transaction log data and using the logical partition as a data storage location in the Ceph system;

[0116] The first partition is used as a metadata storage area in the F2FS file system, and a plurality of parameters in the F2FS system are aligned with the first partition.

[0117] In some embodiments of the invention, the method further comprises:

[0118] In response to receiving a data writing task, the transaction log data in the writing task is written to the first partition and the data of the writing task is written to the logical partition through the F2FS file system.

[0119] In some implementations of the present invention, writing the data of the write task to the logical partition includes:

[0120] Establishing a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially writing the data to the sub-partition based on the mapping relationship; and

[0121] In response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into a HDD hard disk corresponding to the sub-partition through the F2FS file system.

[0122] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0123] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.

[0124] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0125] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0126] The step of the method or algorithm described in conjunction with the disclosure here can be directly included in hardware, in a software module executed by a processor, or in a combination of the two. The software module can reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or a storage medium of any other form known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium or write information to the storage medium. In an alternative, the storage medium can be integrated with the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In an alternative, the processor and the storage medium can reside in a user terminal as discrete components.

[0127] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A data writing method, characterized in that: include: Divide the solid-state hard disk into a first partition and a second partition, encapsulate the second partition and the HDD hard disk into a logical partition and mount it to the file system, divide the second partition into corresponding sub-partitions according to the number of HDD hard disks, and mount the HDD hard disk and the corresponding sub-partitions to the F2FS file system as an OSD partition; Carrying the transaction log data of the file system through the first partition and writing the data corresponding to the transaction log data into the logical partition, in response to receiving a data writing task, writing the transaction log data in the writing task into the first partition and writing the data of the writing task into the logical partition through the F2FS file system, establishing a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially writing the data into the sub-partition based on the mapping relationship; And in response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into the HDD hard disk corresponding to the sub-partition through the F2FS file system.

2. The method according to claim 1, characterized in that The step of dividing the second partition into corresponding sub-partitions according to the number of HDD hard disks includes: The ratio of the corresponding HDD hard disk capacity to the total capacity of all HDD hard disks is used as the weight of the sub-partition, and the second partition is divided based on the weight.

3. The method according to claim 1, further characterized in that Also includes: The first partition and the logical partition are mounted to a Ceph system and an F2FS file system, and storage locations of the first partition and the logical partition are specified in the Ceph system and the F2FS file system.

4. The method according to claim 3, characterized in that The specifying the storage location of the first partition and the logical partition in the Ceph system and the F2FS file system includes: Using the first partition as a storage location for transaction log data and using the logical partition as a data storage location in the Ceph system; The first partition is used as a metadata storage area in the F2FS file system, and a plurality of parameters in the F2FS system are aligned with the first partition.

5. A data writing system, characterized in that: include: A management module, the management module is configured to divide the solid-state hard disk into a first partition and a second partition, encapsulate the second partition and the HDD hard disk into a logical partition and mount it to the file system, divide the second partition into corresponding sub-partitions according to the number of HDD hard disks, and mount the HDD hard disk and the corresponding sub-partitions to the F2FS file system as an OSD partition; a data writing module, the data writing module being configured to carry the transaction log data of the file system through the first partition and write data corresponding to the transaction log data into the logical partition, in response to receiving a data writing task, write the transaction log data in the writing task into the first partition and write the data of the writing task into the logical partition through the F2FS file system, establish a mapping relationship between the HDD hard disk and the corresponding sub-partition in the F2FS file system, and preferentially write the data into the sub-partition based on the mapping relationship; And in response to the data in the sub-partition reaching a preset threshold value, the data in the sub-partition is written into the HDD hard disk corresponding to the sub-partition through the F2FS file system.

6. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.