Data redundancy method and device, storage medium and electronic equipment

By dynamically determining the redundancy of data blocks in the data storage system, the problem of being unable to balance storage costs and performance in the data storage system is solved, and the effects of reducing storage costs and improving storage performance are achieved.

CN118732952APending Publication Date: 2024-10-01JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410868466.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, data storage systems have difficulties in balancing storage cost and storage performance, and cannot effectively solve this problem.

Method used

By dynamically determining the redundancy mode of data blocks in the data storage system, and dynamically selecting the target redundancy mode according to the number of data blocks and the number of data strips and check stripes in the redundancy sub-mode, the data blocks are stored.

Benefits of technology

It realizes the dynamic selection of redundancy mode based on the number of data blocks, reduces storage costs and improves storage performance, balancing storage costs and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118732952A_ABST
    Figure CN118732952A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data redundancy method and device, a storage medium and electronic device.The method comprises the steps that the first number of data blocks included in target data is determined, and a redundancy mode for storing the target data is determined; the redundancy mode comprises one or more redundancy sub-modes, and the number of data strips and the number of verification strips are set in each redundancy sub-mode; determining a second number of data strips set in each redundancy sub-mode; determining a target redundancy mode of each data block included in the storage target data based on the first quantity and the second quantity, the target redundancy mode including one or more redundancy sub-modes; and storing each data block into a target storage device included in the data storage system according to the target redundancy mode. Through the method and the device, the problem that the storage cost and the storage performance cannot be balanced in the prior art is solved, and the effects of reducing the storage cost and improving the storage performance are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a data redundancy method, device, storage medium, and electronic device. Background Art

[0002] In a data storage system, using a static redundant method for data storage cannot balance storage cost and storage performance.

[0003] It can be seen from this that there is a problem in the related technology that the storage cost and storage performance cannot be balanced.

[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention

[0005] The embodiments of the present application provide a data redundancy method, device, storage medium and electronic device to at least solve the problem of being unable to balance storage cost and storage performance in the related art.

[0006] According to one embodiment of the present application, a data redundancy method is provided, comprising: being applied to a data storage system, wherein the data storage system comprises a plurality of storage devices, and the storage devices are used to store target data, comprising: in the event that the target data changes, determining a first number of data blocks included in the target data, and determining a redundant mode for storing the target data; wherein the redundant mode comprises one or more redundant sub-modes, and each redundant sub-mode is provided with a number of data stripes and a number of check stripes; determining a second number of data stripes provided for each redundant sub-mode; determining a target redundant mode for storing each data block included in the target data based on the first number and the second number, wherein the target redundant mode comprises one or more redundant sub-modes; and storing each data block in a target storage device included in the data storage system according to the target redundant mode.

[0007] In an exemplary embodiment, determining the target redundancy mode for each of the data blocks included in storing the target data based on the first number and the second number includes: repeatedly performing a target operation until an exit condition is met; when the exit condition is met, determining the target redundancy mode for each of the data blocks based on the first redundancy mode obtained by performing the target operation each time; wherein the target operation includes: determining a third number included in the second number that is less than or equal to the first number; determining the target redundancy sub-mode corresponding to the maximum number included in the third number as the first redundancy mode; determining a target difference between the first number and the maximum number; when the target difference is greater than zero, updating the first number to the target difference; when the target difference is equal to zero, determining that the exit condition is met.

[0008] In an exemplary embodiment, the target redundancy mode of each of the data blocks is determined based on the first redundancy mode obtained by executing the target operation each time, including: when the first redundancy mode includes one target redundancy sub-mode, determining the target redundancy mode of each of the data blocks to be the first redundancy mode; when the first redundancy mode includes N target redundancy sub-modes, determining the number of data stripes set in each of the target redundancy sub-modes to obtain N fourth quantities; grouping the data blocks of the first quantity to obtain N sub-data block groups, the number of data blocks included in the N sub-data block groups corresponding one-to-one to the N fourth quantities; and determining the target redundancy mode of each sub-data block group to be the target redundancy sub-mode corresponding to the fourth quantity corresponding to the sub-data block group.

[0009] In an exemplary embodiment, determining the redundancy mode for storing the target data includes: determining a target redundancy number included in a received redundancy mode setting instruction; and determining a mode with a redundancy number equal to the target redundancy number as the redundancy mode.

[0010] In an exemplary embodiment, when the data type of the target data indicates that the target data is a directory, a redundant mode setting attribute is obtained; when the redundant mode setting attribute indicates a default redundant mode, the redundant mode of the directory is determined to be the default redundant mode; when the redundant mode setting attribute indicates an inherited redundant mode, a second redundant mode of the directory is determined, and the data under the directory is controlled to inherit the second redundant mode so that the redundant mode of the data under the directory is the second redundant mode; when the redundant mode setting attribute indicates a recursive inheritance redundant mode, a third redundant mode of the directory is determined, and the subdirectories under the directory and the subdirectories under the subdirectories are controlled to inherit the third redundant mode so that the subdirectories under the directory and the subdirectories under the subdirectories are the third redundant mode.

[0011] In an exemplary embodiment, storing each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method includes: determining a target data block and a check data block for each of the data blocks; determining a first storage device to store the target data block in the data storage system; determining a second storage device to store the check data block in the data storage system, wherein the first storage device is different from the second storage device, and the first storage device and the second storage device are determined as the target storage devices. In an exemplary embodiment, storing each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method includes: writing the data block to the target storage device in a full stripe manner in accordance with the target redundancy method; after writing the data block to the target storage device in a full stripe manner in accordance with the target redundancy method, the method further includes: reading the data block stored in the target storage device in the full stripe manner.

[0012] According to another embodiment of the present application, a data redundancy device is provided, which is applied to a data storage system, wherein the data storage system includes multiple storage devices, and the storage devices are used to store target data, including: a first determination module, used to determine a first number of data blocks included in the target data, and determine a redundant mode for storing the target data when the target data changes; wherein the redundant mode includes one or more redundant sub-modes, and each redundant sub-mode is provided with a number of data stripes and a number of check stripes; a second determination module, used to determine a second number of data stripes set in each redundant sub-mode; a third determination module, used to determine a target redundant mode for storing each data block included in the target data based on the first number and the second number, wherein the target redundant mode includes one or more redundant sub-modes; a redundant module, used to store each data block in a target storage device included in the data storage system according to the target redundant mode.

[0013] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0014] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0016] Through the present application, in a data storage system, the data storage system includes a plurality of storage devices, and the storage devices are used to store target data. When the target data changes, the first number of data blocks included in the target data can be determined, and the redundancy mode for storing the target data can be determined; wherein the redundancy mode includes one or more redundancy sub-modes, and each redundancy sub-mode is provided with the number of data stripes and the number of check stripes; the second number of data stripes set in each redundancy sub-mode is determined; based on the first number and the second number, a target redundancy mode for storing each data block included in the target data is determined, wherein the target redundancy mode includes one or more redundancy sub-modes; and each data block is stored in the target storage device included in the data storage system according to the target redundancy mode. Since the target redundancy mode for storing each data block can be determined according to the first number of data blocks included in the target data and the second number of data stripes set in each redundancy sub-mode, the target redundancy mode is dynamically selected according to the first number of data blocks, and therefore, the problem of being unable to balance storage cost and storage performance in the related art can be solved, and the effect of reducing storage cost and improving storage performance can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a server device of a data redundancy method according to an embodiment of the present application;

[0018] Figure 2 is a flow chart of a data redundancy method according to an embodiment of the present application;

[0019] Figure 3 It is a schematic diagram of a redundant technology with a fault redundancy of 2;

[0020] Figure 4 is a schematic diagram of a process for determining a target redundancy method according to an embodiment of the present application;

[0021] Figure 5 is a schematic diagram of storing a database in a target storage device according to an embodiment of the present application;

[0022] Figure 6 It is a structural block diagram of a data redundancy device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0025] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data redundancy method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data redundancy method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0028] In this embodiment, a data redundancy method is provided, which is applied to a data storage system. The data storage system includes a plurality of storage devices, and the storage devices are used to store target data. Figure 2is a flow chart of a data redundancy method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0029] Step S202, when the target data changes, determining a first number of data blocks included in the target data, and determining a redundancy mode for storing the target data; wherein the redundancy mode includes one or more redundancy sub-modes, each of which is provided with a number of data stripes and a number of check stripes;

[0030] Step S204, determining a second number of data stripes set in each of the redundancy sub-modes;

[0031] Step S206, determining a target redundancy mode for storing each of the data blocks included in the target data based on the first number and the second number, wherein the target redundancy mode includes one or more of the redundancy sub-modes;

[0032] Step 5208: Store each of the data blocks in the target storage device included in the data storage system according to the target redundancy method.

[0033] In the above embodiment, the data storage system may include a distributed storage system and a local storage system. The distributed storage system may include a distributed file system, a distributed database, a distributed object system, a distributed block system, a distributed database storage system or other systems with data storage functions, etc., and all of its stripes are scattered to different storage devices. The data storage system is also suitable for all stand-alone scenarios that need to store data, local file systems, local databases, local object systems, etc., and all of its stripes are scattered to different storage disks. The data storage system may include multiple storage devices for storing target data. Among them, when the data storage system is a distributed storage system, the storage device may include a storage server and a disk, and when the data storage system is a local storage system, the storage device may include a disk. The target data may include data units and data objects. Redundancy methods may include replicas, RAID (redundant arrays of independent disks) or EC (erasure code) technology, etc. The use of replicas, RAID or EC technology can improve system reliability and ensure that when a certain proportion of servers fail, the data can still be accessed and recovered. The schematic diagram of the redundancy technology with a fault redundancy of 2 can be found in the attached Figure 3 ,like Figure 3 As shown, Figure 3There are four redundancy modes: triple copy, Raid6 (2+2), EC (4+2) and EC (8+2). They all allow two storage devices to fail at the same time without data loss. The storage medium utilization and performance parameters of each redundancy mode can be found in Table 1.

[0034] Table 1

[0035] Storage media utilization Small IO concurrent reading Data to be read when writing a non-full stripe Three copies 33% 3 1 Raid6(2+2) 50% 1 2 EC(4+2) 67% 1 4 EC(8+2) 80% 1 8

[0036] As shown in Table 1, the storage medium utilization rate of three copies is the lowest, which means that its storage cost is the highest. It requires more storage media to store the same user data, but its read performance is good. When reading small IO, it sends read requests to three storage devices at the same time. As long as one request is successfully returned, it can be fed back to the user, so its read latency is the lowest and the read IOPS is high. Each stripe in its full stripe has the same data. If you want to modify a data stripe, you only need to read one data stripe to calculate the check block, and there is no problem of read amplification.

[0037] EC (8+2) has the highest storage medium utilization rate. 80% of its storage space is valid data for users, and the storage cost is low. However, when reading data, it needs to read 1 copy of data from 1 storage device, or read 9 other blocks to calculate the block to be read before returning it to the user. Therefore, its read IO latency is high and its read IOPS is low. There is data in 8 of the full stripes. If you want to modify a data stripe, you need to read 8 data stripes so that you can calculate the check block. Therefore, the write at this time has 8 times the read amplification, which affects performance.

[0038] The size of a single target data changes dynamically, and the optimal redundancy method also changes dynamically. Assuming the block size is 4KB, when the size of a file is less than or equal to 4KB, three copies require three blocks to store, Raid6 (2+2) requires four blocks to store, EC (4+2) requires six blocks to store, and EC (8+2) requires 10 blocks to store. If only storage efficiency is considered, three copies are the best; when the size of a file is 32KB, three copies require 24 blocks to store, Raid6 (2+2) requires 16 blocks to store, EC (4+2) requires 12 blocks to store, and EC (8+2) requires 10 blocks to store. If only storage efficiency is considered, EC (8+2) is the best.

[0039] In the same object system or file system, different buckets or directories have different requirements for redundancy depending on the application requirements. If a bucket or directory is used to store compiled intermediate data, it is required that no matter how large the object or file is, it must be stored in a copy so that its IO speed is fast; if a bucket or directory is used to store large backup data, it pursues storage medium utilization, so the redundancy method with the highest storage medium utilization should be used. Therefore, when the target data changes, the first number of data blocks included in the target data and the second number of data stripes set in each redundant sub-mode can be determined. Among them, the number of data stripes and the number of check stripes are set in each redundant sub-mode. The naming method of the redundant sub-mode can be redundant encoding mode_D full score strip number, P full score strip number. RP3 means three copies (no need to specify data stripes and parity stripes), RAID6_D2P2 forms a full stripe of 2 data stripes and 2 parity stripes in raid6 mode, EC_D4P2 forms a full stripe of 4 data stripes and 2 parity stripes in EC mode, and EC_D8P2 forms a full stripe of 8 data stripes and 2 parity stripes in EC mode. When the redundancy sub-mode is copy, there is no need to specify data stripes and parity stripes, that is, data stripes and parity stripes can be 0, 1, 2, or any other value.

[0040] In the above embodiment, the redundancy mode can be classified according to the redundancy number, that is, the redundancy degree. The redundancy degree is used to indicate the number of check stripes. The redundancy mode may include a redundancy mode with a redundancy number of 0, a redundancy mode with a redundancy number of 1, a redundancy mode with a redundancy number of 2, a redundancy mode with a redundancy number of 3, etc. Among them, the basic data structure of the redundancy sub-mode included in each redundancy mode is as follows:

[0041]

[0042]

[0043] The following is the default redundancy change mode of a distributed file system, which includes 4 redundancy change modes with redundancy numbers from 0 to 3. The definitions are as follows:

[0044] REDUN default_redun[4][]={{RP1},

[0045] {RP2, RAID5_D2P1, RAID5_D4P1, RAID5_D8P1},

[0046] {RP3, RAID6 _ D2P2, EC_D4P2, EC_D8P2},

[0047] {RP4, EC_D4P3, EC_D16P3, EC_D32P3}};

[0048] When the redundancy number is 2, the redundancy sub-modes included in the redundancy mode are {RP3, RAID6_D2P2, EC_D4P2, EC_D8P2}.

[0049] It should be noted that the above redundancy sub-mode is only an exemplary description, and other data stripes and check stripes may also be set in the redundancy sub-mode, and the present invention is not limited to this.

[0050] In the above embodiment, the first number of data blocks included in the target data may be determined when the target data changes, wherein the target data transmission change includes a change in the number of data blocks in the target data, for example, an increase or decrease in the number of data blocks in the target data. It may also include a change in the content of the data block.

[0051] In the above embodiment, the second number of data strips set in each redundant sub-mode can be determined, and the target redundant mode of each data block can be determined according to the second number of data strips and the first number of data blocks, and each data block can be stored in the target storage device included in the data storage system according to the target redundant mode. When the number of databases increases, the historical redundant mode of the first data block stored in the target data can be determined. If the historical redundant mode is different from the target redundant mode, the first data block stored in the data storage system according to the historical redundant mode is deleted, and the first data block is stored in the target storage device according to the target redundant mode. The target redundant mode can include one or more redundant sub-modes, that is, data blocks can be stored in different redundant sub-modes, so as to reduce storage costs and improve storage performance.

[0052] Through the present application, in a data storage system, the data storage system includes a plurality of storage devices, and the storage devices are used to store target data. When the target data changes, the first number of data blocks included in the target data can be determined, and the redundancy mode for storing the target data can be determined; wherein the redundancy mode includes one or more redundancy sub-modes, and each redundancy sub-mode is provided with the number of data stripes and the number of check stripes; the second number of data stripes set in each redundancy sub-mode is determined; based on the first number and the second number, a target redundancy mode for storing each data block included in the target data is determined, wherein the target redundancy mode includes one or more redundancy sub-modes; and each data block is stored in the target storage device included in the data storage system according to the target redundancy mode. Since the target redundancy mode for storing each data block can be determined according to the first number of data blocks included in the target data and the second number of data stripes set in each redundancy sub-mode, the target redundancy mode is dynamically selected according to the first number of data blocks, and therefore, the problem of being unable to balance storage cost and storage performance in the related art can be solved, and the effect of reducing storage cost and improving storage performance can be achieved.

[0053] The execution subject of the above steps may be a data storage system, etc., but is not limited thereto.

[0054] In an exemplary embodiment, the determination of the target redundancy mode for each data block included in the target data based on the first number and the second number includes: repeatedly performing the target operation until an exit condition is satisfied; when the exit condition is satisfied, determining the target redundancy mode for each data block based on the first redundancy mode obtained by each execution of the target operation; wherein the target operation includes: determining a third number included in the second number that is less than or equal to the first number; determining the target redundancy sub-mode corresponding to the maximum number included in the third number as the first redundancy mode; determining a target difference between the first number and the maximum number; when the target difference is greater than zero, updating the first number to the target difference; when the target difference is equal to zero, determining that the exit condition is satisfied. In this embodiment, when the size of a target data changes, its redundancy mode will change with the change in the number of its data blocks. Assume that the redundancy mode includes redundancy sub-modes (d1, p1), (d2, p2), ..., (dn, pn), and d1 < d2 < ... < dn, wherein d1, d2 ... dn represent the second number of data stripes set in each redundancy sub-mode, and the size of the target data is N data blocks of equal size. The flowchart for determining the target redundancy mode can be found in the attached Figure 4 ,like Figure 4As shown, 1) if N is zero, that is, when the target difference is 0, the entire segmentation algorithm is completed; 2) because d1 to dn are in ascending order, find the largest stripe from back to front, that is, the largest number in the third number, so that it is less than or equal to the size of N. After finding it, allocate a full stripe with a width of di+pi to the target data, and the data blocks and check blocks are distributed to different storage devices; 3) N minus di; 4) Repeat the above 3 steps until all N data blocks are allocated.

[0055] In the above embodiment, the user specifies a system redundancy number, and the storage system will change the redundancy mode in a default manner according to the redundancy number. For example, the specified redundancy number is 2, and the default redundancy sub-modes of the storage system include three copies, Raid6 (2+2), EC (4+2) and EC (8+2). Then the target data will look for the most suitable full stripe in the above order. For example, the first number of data blocks included in a target data is 23 blocks, and the second number of data stripes set for each redundancy sub-mode is unlimited, 2, 4, and 8 respectively. Then a third number less than the first number can be determined in the second number, which is unlimited, 2, 4, and 8 respectively. The maximum value of the third number is determined to be 8, and the 8 corresponding redundancy sub-modes are determined as the first redundancy mode, that is, EC (8+2) is determined as the redundancy sub-mode. The target difference between the first number and the maximum number is determined, that is, 23-8=15. If the target difference is greater than zero, the first number is updated to the target difference. That is, the current first quantity is 15, and the third quantity less than the first quantity is determined in the second quantity, which are unlimited, 2, 4, and 8 respectively. The maximum value of the third quantity is determined to be 8, and the redundant sub-mode corresponding to 8 is determined as the first redundant mode, that is, EC(8+2) is determined as the redundant sub-mode. The target difference between the first quantity and the maximum quantity is determined again, that is, 15-8=7, and the target difference is greater than zero, and the first quantity is updated to the target difference. That is, the current first quantity is 7, and the third quantity less than the first quantity is determined in the second quantity, which are unlimited, 2, and 4 respectively. The maximum value of the third quantity is determined to be 4, and the redundant sub-mode corresponding to 4 is determined as the first redundant mode, that is, EC(4+2) is determined as the first redundant mode. The target difference between the first quantity and the maximum quantity is determined again, that is, 7-4=3, and the target difference is greater than zero, and the first quantity is updated to the target difference. That is, the current first quantity is 3, and the third quantity less than the first quantity is determined in the second quantity, which are unlimited and 2 respectively. Determine that the maximum value of the third quantity is 2, then determine the redundant sub-mode corresponding to 2 as the first redundant mode, that is, determine Raid6(2+2) as the first redundant mode. Determine the target difference between the first quantity and the maximum quantity again, that is, 7-4=3, and if the target difference is greater than zero, then update the first quantity to the target difference. That is, the current first quantity is 3, and a third quantity smaller than the first quantity is determined in the second quantity, which are unlimited and 2, respectively. Determine that the maximum value of the third quantity is 2, then determine the redundant sub-mode corresponding to 2 as the first redundant mode, that is, determine Raid6(2+2) as the first redundant mode. Determine the target difference between the first quantity and the maximum quantity again, that is, 3-2=1, and if the target difference is greater than zero, then update the first quantity to the target difference. That is, the current first quantity is 1, and a third quantity smaller than the first quantity is determined in the second quantity, which are unlimited, respectively.If the maximum value of the third number is determined to be unlimited, the corresponding redundancy sub-mode is determined to be the first redundancy mode, that is, three copies are determined to be the first redundancy mode. Therefore, the target data of 23 blocks will be divided into two EC (8+2) full stripes, one EC (4+2) full stripe, one Raid6 (2+2) full stripe, and one full stripe of three copies, for a total of 33 blocks (23 data blocks and 10 check data blocks).

[0056] In the above embodiment, as the size of a single target data changes, its redundancy mode changes dynamically, so that the storage performance and storage medium utilization are optimized at the same time; when the target data is large enough, try to use large full stripes to reduce storage costs; by allowing a target data to use different redundancy modes, all writes are full stripe writes, thereby achieving the purpose of improving the performance of the storage system; at the same time, the storage is easy to manage and maintain, and is convenient for users to use.

[0057] In an exemplary embodiment, the target redundancy mode of each data block is determined based on the first redundancy mode obtained by executing the target operation each time, including: when the first redundancy mode includes one target redundancy sub-mode, determining the target redundancy mode of each data block to be the first redundancy mode; when the first redundancy mode includes N target redundancy sub-modes, determining the number of data stripes set in each target redundancy sub-mode to obtain N fourth numbers; grouping the first number of data blocks to obtain N sub-data block groups, the number of data blocks included in the N sub-data block groups corresponds one-to-one to the N fourth numbers; determining the target redundancy mode of each sub-data block group to be the target redundancy sub-mode corresponding to the fourth number corresponding to the sub-data block group. In this embodiment, when the first redundancy mode includes one target redundancy sub-mode, for example, the first redundancy mode includes two EC(8+2), each data block is stored in the EC(8+2) mode. The first redundancy mode includes one EC (8+2) and one EC (4+2), so 8 data blocks in the target data can be stored in the EC (8+2) mode, and 4 data blocks in the target data can be stored in the EC (4+2) mode. Which data blocks are stored in the EC (8+2) mode and which data blocks are stored in the EC (4+2) mode can be randomly determined, and the present invention does not limit this.

[0058] In an exemplary embodiment, determining the redundant mode for storing the target data includes: determining a target redundancy number included in a received redundant mode setting instruction; and determining a mode with a redundancy number equal to the target redundancy number as the redundant mode. In this embodiment, a user may specify a redundant mode. A user may select a redundant mode through a redundant mode setting instruction. For example, a user may select a target redundancy number through a redundant mode setting instruction, and a data storage system may include multiple default redundancy modes, and a redundant mode with a redundancy number equal to the target redundancy number may be screened out from the multiple default redundancy modes.

[0059] In the above embodiment, the redundant mode setting instruction can be typedef struct location{

[0060]

[0061] Among them, LOCATION specifies the location of a stripe by machine number, disk number, and offset; STIPE (full stripe) records the redundancy mode, the location of all stripes, and the total number of stripes; inode will record the redundancy mode it uses, the full stripes it has, and the total number of full stripes. If i_redun is empty, the directory will use the system default redundancy mode.

[0062] In the above embodiment, the redundant mode setting instruction may include the system identification information of the data storage system to be set, and the data storage system to be set can be found according to the system identification information. The redundant mode setting instruction may also include a target redundant number, and the redundant mode can be determined according to the target redundant number. The redundant mode setting instruction can be used to set the redundant mode, and can also be used to modify the redundant mode of the target data for which the redundant mode has been set. For example, all the target data in a data set are temporary files during compilation. At this time, for the sake of performance, it can specify its redundant change mode as (double copy). At this time, no matter how large the target data is, it is saved in double copies. At this time, the performance is better and the storage overhead is small; the target data in a data set is 8K high-definition video, the file is relatively large and important, and here the user can specify its redundant mode as (four copies, EC (4+3), EC (16+3), EC (32+3), EC (196+3)), so as to meet the needs of the user.

[0063] In the above embodiment, the user can specify the number of redundancies or the method of changing the redundancy. If the number of redundancies is specified, the system will use the default redundancy change method; if the method of changing the redundancy is specified, the redundancy method will be changed according to the user's specification, so as to achieve the result required by the user. That is, according to the user's needs and the type of target data, the user can set the redundancy method through the redundancy method setting instruction, so that the set redundancy method can meet the performance requirements or the user's needs, and improve the user experience.

[0064] In an exemplary embodiment, when the data type of the target data indicates that the target data is a directory, a redundant mode setting attribute is obtained; when the redundant mode setting attribute indicates a default redundant mode, the redundant mode of the directory is determined to be the default redundant mode; when the redundant mode setting attribute indicates an inherited redundant mode, a second redundant mode of the directory is determined, and the data under the directory is controlled to inherit the second redundant mode, so that the redundant mode of the data under the directory is the second redundant mode; when the redundant mode setting attribute indicates a recursive inheritance redundant mode, a third redundant mode of the directory is determined, and the subdirectories under the directory and the subdirectories under the subdirectories are controlled to inherit the third redundant mode, so that the redundancy modes of the subdirectories under the directory and the subdirectories under the subdirectories are the third redundant mode. In this embodiment, a user can specify a specific redundant mode for a file and a directory to meet the user's needs. When specifying a redundant mode for a directory, inheritance issues will be involved. This includes whether the files under the directory inherit the redundant mode of its parent directory, whether the subdirectories under the directory inherit the redundant mode of its parent directory, and whether the inheritance is recursive.

[0065] In the above embodiment, the redundancy mode setting instruction can be expressed as:

[0066]

[0067]

[0068] Among them, d_redun is an array of redundant modes; d_redun_size records the number of redundant modes in the d_redun array. If d_redun is empty, the directory will use the system default redundant mode; if d_redun_flag is zero, the files and directories under the directory will not inherit its redundant mode; if in d_redun_flag, only DREDUN_FILE_INHERIT is set, it means that all files under the directory will inherit its redundant mode; if in d_redun_flag, only DREDUN_DIR_INHERIT is set, it means that all directories under the directory will inherit its redundant mode, but will not inherit recursively; if in d_redun_flag, DREDUN__RECURSIVE_INHERIT and DREDUN_DIR_INHERIT are set, it means that all directories under the directory will inherit its redundant mode, and its subdirectories must copy the above three parameters in their parent directory for recursive inheritance.

[0069] In the above embodiment, after the user issues a redundant mode setting instruction, the distributed file system to be set in the redundant mode setting instruction can be determined, the redundant mode corresponding to the redundant number to be set can be determined, and the redundant mode to be modified can be determined. When the redundant mode setting instruction indicates the redundant mode of modifying the directory, the directory to be modified in the redundant mode setting instruction can be determined; the redundant mode of the directory can be modified to the redundant mode defined by the user; if the redundant mode is different from the previously defined one, the content of the directory can be copied according to the new redundant mode, and then the old directory data can be deleted. In the case where the redundant mode setting instruction indicates the inheritance mode of setting the redundant mode of the directory, the files and directories to be modified can be determined. When the redundant mode setting instruction indicates the redundant mode of modifying the file, the file to be modified indicated by the redundant mode setting instruction can be determined; the redundant mode of the file can be modified to the redundant mode defined by the user; if the redundant mode is different from the previously defined one, the content of the file can be copied according to the new redundant mode, and then the old file data can be deleted.

[0070] In the above embodiment, for the intermediate target data (directory or bucket), the redundancy change mode can be specified according to the actual application situation, and whether to inherit can be decided, so as to better control the redundancy mode.

[0071] In an exemplary embodiment, storing each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method includes: determining the target data block and the check data block of each of the data blocks; determining a first storage device to store the target data block in the data storage system; determining a second storage device to store the check data block in the data storage system, wherein the first storage device is different from the second storage device, and the first storage device and the second storage device are determined as the target storage devices. In this embodiment, each stripe of a full stripe can be assigned to a different fault domain so that data is not lost in the event of a failure. Assume that the redundancy methods are: three copies, Raid6 (2+2), EC (4+2) and EC (8+2). For a schematic diagram of storing the database in the target storage device, please refer to the attached figure. Figure 5 ,like Figure 5 As shown, when the size of the target data is one block, it is composed of a three-copy full stripe, and i_stipes_size is 1; when the size of the target data is two blocks, it is composed of a Raid6 (2+2) full stripe, and i_stipes_size is 1; when the size of the target data is three blocks, it is composed of a Raid6 (2+2) full stripe and a three-copy full stripe, and i_stipes_size is 2; when the size of the target data is four blocks, it is composed of an EC (4+2) full stripe, and i_stipes_size is 1; when the size of the target data is five blocks, it is composed of an EC (4+2) full stripe and a three-copy full stripe, and i_stipes_size is 2; when the size of the target data is six blocks, it is composed of an EC (4+2) full stripe and a Raid6 (2+2) full stripe, and i_stipes_size is 2. In order for all storage devices to store approximately the same number of stripes, the starting point of each stripe can be set to random.

[0072] In the above embodiment, by storing the verification data block and the target database in different storage devices, it is ensured that the data is not lost when a data storage device fails, thereby improving the security of the data and the reliability of the system.

[0073] In an exemplary embodiment, storing each data block in the target storage device included in the data storage system according to the target redundancy mode includes: when the data block is a newly added data block included in the target data, storing the data block in the target storage device according to the target redundancy mode; when the data block is a historical data block included in the target data, determining the historical redundancy mode of the data block, and when the historical redundancy mode is different from the target redundancy mode, deleting the data block stored in the data storage system according to the historical redundancy mode, and storing the data block in the target storage device according to the target redundancy mode. In this embodiment, the data blocks in the target data can be dynamically changed, that is, the target data can be increased, reduced, or changed. When the target data changes, the first number of data blocks currently included in the target data can be determined, and the target redundancy mode can be reallocated to the data blocks currently included in the target data according to the first number and the second number. When the target redundancy mode is the same as the historical redundancy mode, there is no need to change the data blocks stored in the data storage system. When the two are different, the data blocks stored according to the historical redundancy mode can be deleted and the data blocks can be stored according to the target redundancy mode. When the data block is newly added data and there is no historical redundancy method, it can be stored according to the target redundancy method.

[0074] In the above embodiment, when the target data changes, the target redundancy mode can be reassigned to each data block included in the target data. When the target redundancy mode is the same as the historical redundancy mode, there is no need to change the data blocks stored in the data storage system. When the two are different, the data blocks stored in the historical redundancy mode can be deleted and stored in the target redundancy mode. When the data block is newly added data and has no historical redundancy mode, it can be stored in the target redundancy mode, which realizes that the redundancy mode changes dynamically with the change of the size of the single target data, thereby optimizing the storage performance and storage medium utilization at the same time.

[0075] In an exemplary embodiment, storing each of the data blocks in the target storage device included in the data storage system according to the target redundancy method includes: writing the data block to the target storage device in a full stripe manner according to the target redundancy method; after writing the data block to the target storage device in a full stripe manner according to the target redundancy method, the method further includes: reading the data block stored in the target storage device in a full stripe manner. In this embodiment, when storing data blocks through the target storage device, the static redundancy mode can be broken. When the target data is large enough, a large full stripe is used as much as possible to reduce the storage cost; by allowing a target data to use different redundancy methods, all writes are full stripe writes, thereby achieving the purpose of improving the performance of the storage system; at the same time, the storage is easy to manage and maintain, and convenient for users to use.

[0076] In the above embodiment, writing the data block to the target storage device in a full stripe manner according to the target redundancy method may include, when the size of the data block is smaller than the capacity of the target stripe, writing the data block to the target stripe, and filling the capacity of the target stripe except the data block with padding data, for example, filling with 0, so that the target stripe stores the data block in a full stripe manner.

[0077] In the above embodiment, when storing data, all writes are full-strip writes, thereby avoiding non-full-strip reads and writes, the latter of which has low IO efficiency. For example, non-full-strip writes must first read all data and then write in a full-strip manner, which has a large IO amplification; while full-strip writes do not require reading and can be written directly. All reads and writes are full-strip writes to improve IO efficiency. Complex and inefficient non-full-strip writes are avoided, and all writes are efficient full-strip writes, so that storage performance and storage medium utilization can reach the optimal balance point at the same time.

[0078] In an exemplary embodiment, determining a first storage device to store the target data block in the data storage system includes: determining a load condition of each storage device included in the data storage system, and selecting a storage device with the smallest load as the first storage device according to the load condition.

[0079] Determining the first storage device to store the target data block in the data storage system also includes: determining the total storage space and remaining storage space of each storage device included in the data storage system, determining the ratio of the remaining storage space to the total storage space, and determining the storage device corresponding to the minimum ratio as the first storage device.

[0080] Determining the second storage device to store the verification data block in the data storage system includes: determining the load condition of each storage device included in the data storage system, determining a third storage device with the smallest load included in the data storage system based on the load condition, determining whether the third storage device is the same as the first storage device, and if they are the same, determining a server with the smallest load other than the third storage device included in the data storage system and different from the first storage device as the second storage device; and if the third storage device is different from the first storage device, determining the third storage device as the second storage device.

[0081] Determining in the data storage system a second storage device to store the verification data block also includes: determining the total storage space and the remaining storage space of each storage device included in the data storage system, determining the ratio of the remaining storage space to the total storage space, determining a fourth storage device corresponding to the storage device corresponding to the minimum ratio, determining whether the fourth storage device is the same as the first storage device, and if they are the same, determining that the server included in the data storage system, except for the fourth storage device, has the smallest ratio and is different from the first storage device, as the second storage device; and if the fourth storage device is different from the first storage device, determining the fourth storage device as the second storage device.

[0082] Through the above method, the storage devices included in the data storage system can store data evenly, thereby improving the data storage performance.

[0083] In the above embodiment, as the size of a single target data changes, its redundancy mode changes dynamically, so that storage performance and storage medium utilization are optimized at the same time; the user can specify the number of redundancies or the method of redundancy change. If the number of redundancies is specified, the system will use the default redundancy change method; if the method of redundancy change is specified, the redundancy mode will be changed according to the user's specification, so as to achieve the desired result. For the intermediate target data (directory or bucket), the redundancy change method can be specified according to the actual application situation, and it can be decided whether to inherit, so as to better control the redundancy mode.

[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0085] In this embodiment, a data redundancy device is also provided, which is applied to a data storage system, wherein the data storage system includes a plurality of storage devices, and the storage devices are used to store target data. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0086] Figure 6 is a structural block diagram of a data redundancy device according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:

[0087] A first determination module 62 is used to determine a first number of data blocks included in the target data and determine a redundancy mode for storing the target data when the target data changes; wherein the redundancy mode includes one or more redundancy sub-modes, each of which is provided with a number of data stripes and a number of check stripes;

[0088] A second determination module 64, configured to determine a second number of data stripes set in each of the redundancy sub-modes;

[0089] A third determining module 66, configured to determine a target redundancy mode for storing each of the data blocks included in the target data based on the first number and the second number, wherein the target redundancy mode includes one or more of the redundancy sub-modes;

[0090] The redundancy module 68 is used to store each of the data blocks in a target storage device included in the data storage system according to the target redundancy mode.

[0091] In an exemplary embodiment, the third determination module 66 can implement the target redundancy mode of each data block included in the storage of the target data based on the first number and the second number in the following manner: repeatedly perform the target operation until the exit condition is met; when the exit condition is met, determine the target redundancy mode of each data block based on the first redundancy mode obtained by performing the target operation each time; wherein the target operation includes: determining a third number included in the second number that is less than or equal to the first number; determining the target redundancy sub-mode corresponding to the maximum number included in the third number as the first redundancy mode; determining the target difference between the first number and the maximum number; when the target difference is greater than zero, updating the first number to the target difference; when the target difference is equal to zero, determining that the exit condition is met.

[0092] In an exemplary embodiment, the third determination module 66 can implement the determination of the target redundancy mode of each of the data blocks based on the first redundancy mode obtained by executing the target operation each time in the following manner: when the first redundancy mode includes one target redundancy sub-mode, determine the target redundancy mode of each of the data blocks as the first redundancy mode; when the first redundancy mode includes N target redundancy sub-modes, determine the number of data stripes set in each of the target redundancy sub-modes to obtain N fourth quantities; group the data blocks of the first quantity to obtain N sub-data block groups, and the number of data blocks included in the N sub-data block groups corresponds one-to-one to the N fourth quantities; determine the target redundancy mode of each sub-data block group as the target redundancy sub-mode corresponding to the fourth quantity corresponding to the sub-data block group.

[0093] In an exemplary embodiment, the first determination module 62 may implement the determination of the redundancy mode for storing the target data in the following manner: determining a target redundancy number included in a received redundancy mode setting instruction; and determining a mode with a redundancy number equal to the target redundancy number as the redundancy mode.

[0094] In an exemplary embodiment, the device can be used to obtain a redundancy mode setting attribute when the data type of the target data indicates that the target data is a directory; when the redundancy mode setting attribute indicates a default redundancy mode, determine the redundancy mode of the directory as the default redundancy mode; when the redundancy mode setting attribute indicates an inherited redundancy mode, determine a second redundancy mode of the directory, control the data under the directory to inherit the second redundancy mode, so that the redundancy mode of the data under the directory is the second redundancy mode; when the redundancy mode setting attribute indicates a recursive inheritance redundancy mode, determine a third redundancy mode of the directory, control the subdirectories under the directory, and the subdirectories under the subdirectories to inherit the third redundancy mode, so that the subdirectories under the directory, and the subdirectories under the subdirectories are the third redundancy mode.

[0095] In an exemplary embodiment, the redundancy module 68 can implement the storage of each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method in the following manner: determine the target data block and the check data block of each of the data blocks; determine a first storage device in the data storage system to store the target data block; determine a second storage device in the data storage system to store the check data block, wherein the first storage device is different from the second storage device, and the first storage device and the second storage device are determined as the target storage devices.

[0096] In an exemplary embodiment, the redundancy module 68 can implement the storing of each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method in the following manner: when the data block is a newly added data block included in the target data, the data block is stored in the target storage device in accordance with the target redundancy method; when the data block is a historical data block included in the target data, the historical redundancy method of the data block is determined, and when the historical redundancy method is different from the target redundancy method, the data block stored in the data storage system in accordance with the historical redundancy method is deleted, and the data block is stored in the target storage device in accordance with the target redundancy method.

[0097] In an exemplary embodiment, the redundancy module 68 can implement the storage of each of the data blocks in the target storage device included in the data storage system in accordance with the target redundancy method in the following manner: writing the data blocks to the target storage device in a full stripe manner in accordance with the target redundancy method; the device can also be used to read the data blocks stored in the target storage device in a full stripe manner after writing the data blocks to the target storage device in a full stripe manner in accordance with the target redundancy method.

[0098] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0099] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

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

[0101] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0102] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0103] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0104] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0105] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0106] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data redundancy method, characterized in that: Applied to a data storage system, the data storage system includes a plurality of storage devices, the storage devices are used to store target data, include: In the case where the target data changes, determining a first number of data blocks included in the target data, and determining a redundancy mode for storing the target data; wherein the redundancy mode includes one or more redundancy sub-modes, and each of the redundancy sub-modes is provided with a number of data stripes and a number of check stripes; Determine a second number of data stripes set in each of the redundancy sub-modes; Determine a target redundancy mode for storing each of the data blocks included in the target data based on the first number and the second number, wherein the target redundancy mode includes one or more of the redundancy sub-modes; Each of the data blocks is stored in a target storage device included in the data storage system according to the target redundancy mode.

2. The method according to claim 1, characterized in that The determining, based on the first quantity and the second quantity, a target redundancy mode for storing each of the data blocks included in the target data comprises: Repeat the target operation until the exit condition is met; When the exit condition is met, determining the target redundancy mode of each of the data blocks based on a first redundancy mode obtained by executing the target operation each time; The target operation includes: determining a third number included in the second number that is less than or equal to the first number; Determine the target redundancy sub-mode corresponding to the maximum number included in the third number as the first redundancy mode; determining a target difference between the first number and the maximum number; When the target difference is greater than zero, updating the first quantity to the target difference; When the target difference is equal to zero, it is determined that the exit condition is met.

3. The method according to claim 2, characterized in that The determining the target redundancy mode of each of the data blocks based on the first redundancy mode obtained by executing the target operation each time includes: In a case where the first redundancy mode includes a target redundancy sub-mode, determining the target redundancy mode of each of the data blocks to be the first redundancy mode; In a case where the first redundancy mode includes N target redundancy sub-modes, determining the number of data stripes set in each of the target redundancy sub-modes to obtain N fourth numbers; Grouping the first number of data blocks to obtain N sub-data block groups, wherein the number of data blocks included in the N sub-data block groups corresponds one-to-one to the N fourth numbers; The target redundancy mode of each of the sub-data block groups is determined to be the target redundancy sub-mode corresponding to the fourth number corresponding to the sub-data block group.

4. The method according to claim 1, characterized in that: The determining a redundant manner for storing the target data includes: determining a target redundancy number included in a received redundancy mode setting instruction; A mode in which the redundancy number is the target redundancy number is determined as the redundancy mode.

5. The method according to claim 1, characterized in that The method further comprises: When the data type of the target data indicates that the target data is a directory, obtaining a redundancy mode setting attribute; In a case where the redundancy mode setting attribute indicates a default redundancy mode, determining the redundancy mode of the directory as the default redundancy mode; In the case where the redundancy mode setting attribute indicates inheriting the redundancy mode, determining a second redundancy mode of the directory, and controlling the data under the directory to inherit the second redundancy mode, so that the redundancy mode of the data under the directory is the second redundancy mode; In the case where the redundant mode setting attribute indicates recursively inheriting the redundant mode, the third redundant mode of the directory is determined, and the subdirectories under the directory and the subdirectories under the subdirectories are controlled to inherit the third redundant mode, so that the redundant mode of the subdirectories under the directory and the subdirectories under the subdirectories is the third redundant mode.

6. The method according to claim 1, characterized in that The step of storing each of the data blocks in a target storage device included in the data storage system in accordance with the target redundancy mode includes: Determine a target data block and a check data block for each of the data blocks; Determining a first storage device to store the target data block in the data storage system; Determining in the data storage system a second storage device to store the check data block, wherein the first storage device is different from the second storage device, The first storage device and the second storage device are determined as the target storage devices.

7. The method according to claim 1, characterized in that The step of storing each of the data blocks in a target storage device included in the data storage system in accordance with the target redundancy mode includes: In a case where the data block is a newly added data block included in the target data, storing the data block in the target storage device according to the target redundancy mode; In the case where the data block is a historical data block included in the target data, a historical redundancy mode of the data block is determined; and in the case where the historical redundancy mode is different from the target redundancy mode, the data block stored in the data storage system according to the historical redundancy mode is deleted, and the data block is stored in the target storage device according to the target redundancy mode.

8. The method according to any one of claims 1 to 7, characterized in that: The storing each of the data blocks in the target storage device included in the data storage system according to the target redundancy mode includes: writing the data blocks in the target storage device in a full stripe mode according to the target redundancy mode; After writing the data block to the target storage device in a full-strip manner according to the target redundancy manner, the method further includes: reading the data block stored in the target storage device in the full-strip manner.

9. A data redundancy device, characterized in that: Applied to a data storage system, the data storage system includes a plurality of storage devices, the storage devices are used to store target data, include: A first determination module is used to determine a first number of data blocks included in the target data and determine a redundancy mode for storing the target data when the target data changes; wherein the redundancy mode includes one or more redundancy sub-modes, and each of the redundancy sub-modes is provided with a number of data stripes and a number of check stripes; A second determination module, used to determine a second number of data stripes set in each of the redundant sub-modes; A third determination module is used to determine a target redundancy mode for storing each of the data blocks included in the target data based on the first quantity and the second quantity, wherein the target redundancy mode includes one or more redundancy sub-modes; and a redundancy module is used to store each of the data blocks in a target storage device included in the data storage system according to the target redundancy mode.

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

11. An electronic 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, the steps of the method described in any one of claims 1 to 8 are implemented.