A data storage method, device, medium and product for a software disk array

By introducing compression attribute parameters and target compression algorithms in the RAID system, the problem of low storage efficiency is solved, efficient utilization of storage resources and cost reduction are achieved, and data transmission speed and system performance are improved.

CN120010794BActive Publication Date: 2025-07-11SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510503418.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-07-11
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

Existing RAID systems have challenges in storage efficiency, especially in the big data environment, storage costs are gradually increasing, and how to effectively utilize storage resources has become an urgent problem.

Method used

By introducing compression attribute parameters into the RAID system, configuring the target compression algorithm, using a reasonable and efficient compression algorithm to compress the stored data, and compressing the data during storage, combining storage redundancy technology to ensure the reliability and security of the data.

Benefits of technology

It improves the utilization rate of storage resources, reduces storage costs, enhances data transmission speed, and improves system performance during data transmission and recovery, ensuring data integrity and availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010794B_ABST
    Figure CN120010794B_ABST
Patent Text Reader

Abstract

The present invention discloses a data storage method, device, medium and product for a software disk array, relating to the technical field of data storage. Data is stored in the software disk array. When creating the software disk array, the set creation parameters include not only the configuration parameters preset for the software disk array itself, but also preset compression attribute parameters, configuring a software disk array with compression attributes. The compression attribute parameters can indicate that the software disk array performs corresponding data compression operations when storing data. According to the compression attribute parameters of the configured array, when a user performs data read and write operations on the software disk array, a reasonable and efficient compression algorithm can be used to compress the data; through this intelligent compression process, the occupation of storage space is reduced, the storage efficiency is improved, the storage cost is reduced, the volume of the compressed data is reduced, and thus the data transmission speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and particularly to a data storage method, device, medium and product for a software disk array. Background Art

[0002] The continuous development of information technology has promoted the growth of data storage requirements. With the rapid growth of data storage requirements, users' requirements for storage systems are also getting higher and higher. Currently, traditional RAID (Redundant Arrays of Independent Disks) systems can rely on the redundancy of physical disks to ensure data security and provide data redundancy, but still face challenges in terms of storage efficiency. Especially in the big data environment, the rapid growth of data has gradually increased the storage cost. How to effectively utilize existing storage resources to improve storage efficiency and reduce storage cost has become an urgent problem to be solved.

[0003] It can be seen that how to effectively utilize storage resources is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a data storage method, device, medium and product for a software disk array, which can solve the problem of how to effectively improve the utilization rate of storage resources in a RAID system.

[0005] To solve the above technical problems, the embodiments of the present invention provide a data storage method for a software disk array, including:

[0006] Execute a creation command through a disk array management tool, and create a software disk array according to preset configuration parameters and preset compression attribute parameters; wherein, the compression attribute parameters include a first identification code or a second identification code, the first identification code is used to specify the target compression algorithm selected by the software disk array, and the second identification code is used to characterize the data type to be stored in the software disk array;

[0007] If there is input of data to be stored, determine the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters;

[0008] Compress the data to be stored using the target compression algorithm to obtain compressed data;

[0009] Store the compressed data in the hard disk corresponding to the software disk array.

[0010] On the one hand, the compression attribute parameter further includes a compression switch bit, and the compression switch bit is used to control the enabling and disabling of the data compression function of the software disk array; before determining the target compression algorithm currently selected by the software disk array based on the configuration parameter and / or the compression attribute parameter, it further includes:

[0011] Configure the compression switch bit to the corresponding state for enabling the data compression function.

[0012] On the one hand, the software disk array further includes an algorithm library and application programming interfaces corresponding to each of the compression algorithms in the algorithm library, and the algorithm library is used to provide compression algorithms; compressing the data to be stored by using the target compression algorithm to obtain compressed data includes:

[0013] Call the application programming interface corresponding to the target compression algorithm to compress the data to be stored by using the target compression algorithm to obtain compressed data.

[0014] On the one hand, it further includes:

[0015] If there is compressed data input, decompress the compressed data by using the target compression algorithm corresponding to the compressed data to obtain the original data.

[0016] On the one hand, determining the target compression algorithm currently selected by the software disk array based on the configuration parameter and / or the compression attribute parameter includes:

[0017] If there is data to be stored input, generate a compression request for the data to be stored based on the data to be stored, the configuration parameter, and the compression attribute parameter; the compression request includes the memory address of the data to be stored, the data size of the data to be stored, and the target compression algorithm currently selected by the software disk array;

[0018] Receive the compression request, and determine the target compression algorithm currently selected by the software disk array based on the compression request;

[0019] Storing the compressed data into the hard disk corresponding to the software disk array includes:

[0020] Generate a compression response for the data to be stored based on the compressed data and the target compression algorithm; the compression response includes the memory address of the compressed data, the data size of the compressed data, and the target compression algorithm used when the data to be stored is compressed;

[0021] Receive the compression response, and store the compressed data into the hard disk corresponding to the software disk array based on the compression response.

[0022] On the one hand, it further includes:

[0023] Cache the compression requests to be processed to generate a request queue;

[0024] Receive the compression requests, including:

[0025] Read the compression requests from the request queue.

[0026] On the one hand, it further includes:

[0027] Cache the compression responses to be processed to generate a response queue;

[0028] Receive the compression responses, including:

[0029] Read the compression responses from the response queue.

[0030] On the one hand, determine the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters, including:

[0031] Obtain a first identification code from the preset compression attribute parameters;

[0032] Determine the target compression algorithm currently selected by the software disk array based on the preset corresponding relationship between the compression algorithm and the first identification code.

[0033] On the one hand, determine the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters, including:

[0034] Obtain a second identification code from the preset compression attribute parameters;

[0035] Determine the data type to be stored by the software disk array currently based on the preset corresponding relationship between the data type and the second identification code;

[0036] Determine the target compression algorithm currently selected by the software disk array according to the data type to be stored by the software disk array currently.

[0037] On the one hand, determine the target compression algorithm currently selected by the software disk array according to the data type to be stored by the software disk array currently, including:

[0038] Determine the available compression algorithms that support the data type to be stored by the software disk array currently from the algorithm library;

[0039] Determine the compression algorithm with the highest compression ratio among several available compression algorithms whose compression efficiency is greater than the first preset value as the target compression algorithm.

[0040] On the one hand, determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters includes:

[0041] Determining the array level of the current software disk array based on the configuration parameters;

[0042] Determining the target compression algorithm currently selected by the software disk array according to the array level of the current software disk array.

[0043] On the one hand, determining the target compression algorithm currently selected by the software disk array according to the array level of the current software disk array includes:

[0044] If the current software disk array is a disk striping array, determining the compression algorithm with the fastest compression speed in the algorithm library as the target compression algorithm;

[0045] If the current software disk array is a disk mirror array, determining the compression algorithm with the highest compression ratio in the algorithm library as the target compression algorithm.

[0046] To solve the above technical problems, an embodiment of the present invention further provides an electronic device, including:

[0047] A memory for storing a computer program;

[0048] A processor for executing the computer program to implement the steps of the data storage method of the software disk array as described above.

[0049] To solve the above technical problems, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data storage method of the software disk array as described above are implemented.

[0050] To solve the above technical problems, an embodiment of the present invention further provides a computer program product, including computer programs / instructions, and when the computer programs / instructions are executed by a processor, the steps of the data storage method of the software disk array as described above are implemented.

[0051] As can be seen from the above technical solution, data is stored in a software disk array. When creating the software disk array, the set creation parameters include not only the configuration parameters preset for the software disk array itself, but also the preset compression attribute parameters, configuring a software disk array with compression attributes. The compression attribute parameters can instruct the software disk array to perform corresponding data compression operations when storing data. The beneficial effect of the present invention is that according to the compression attribute parameters of the configured array, when the user performs data read and write operations on the software disk array, a reasonable and efficient compression algorithm can be used to compress the data. Through this intelligent compression process, the occupation of storage space is reduced, the storage efficiency is improved, the storage cost is reduced, the volume of the compressed data is reduced, and thus the data transmission speed is increased. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0053] Figure 1 It is a schematic flowchart of a data storage method for a software disk array provided by an embodiment of the present invention;

[0054] Figure 2 It is a schematic structural diagram of a software disk array provided by an embodiment of the present invention;

[0055] Figure 3 It is a schematic flowchart of data compression for a software disk array provided by an embodiment of the present invention;

[0056] Figure 4 It is a schematic diagram of the first selection method of the compression algorithm provided by an embodiment of the present invention;

[0057] Figure 5 It is a schematic diagram of the second selection method of the compression algorithm provided by an embodiment of the present invention;

[0058] Figure 6 It is a schematic diagram of the third selection method of the compression algorithm provided by an embodiment of the present invention;

[0059] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0060] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0061] The terms "including" and "having" in the specification of the present invention and the accompanying drawings above, as well as any variations related to "including" and "having", are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.

[0062] In order to enable those skilled in the art of the present technology to better understand the solutions of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] Next, a data storage method for a software disk array provided by an embodiment of the present invention will be introduced in detail. Refer to Figure 1 as shown Figure 1 is a schematic flowchart of a data storage method for a software disk array provided by an embodiment of the present invention; the data storage method for the software disk array includes:

[0064] S11: Execute a creation command through a disk array management tool, and create a software disk array according to preset configuration parameters and preset compression attribute parameters; wherein, the compression attribute parameters include a first identification code or a second identification code, the first identification code is used to specify the target compression algorithm selected by the software disk array, and the second identification code is used to characterize the data type to be stored in the software disk array.

[0065] It can be understood that, in order to effectively improve the storage efficiency of the software RAID, when constructing a RAID array for the host, the configuration parameters and the compression attribute parameters will be used as the creation parameters for creating the RAID array at the same time to create the RAID array. The configuration parameters include the name of the created RAID array, the level of the RAID array, the number of disks in the RAID array, the disk device list, etc., and the compression attribute parameters include a compression switch and a first identification code and / or a second identification code that can characterize the compression method of the RAID array. When creating the RAID array, the disk array management tool can determine the hard disks corresponding to the software RAID to be created according to the configuration parameters, and at the same time use the compression attribute parameters to define the compression method that the currently created software RAID needs to use when storing data later, that is, the target compression algorithm.

[0066] It is not difficult to understand that the disk array management tool is specifically the mdadm tool. The mdadm tool can create a RAID array. At the same time, in the process of creating a RAID by the mdadm tool in this application, relevant parameters related to the compression of the RAID array are additionally configured. Finally, a RAID array with a compression attribute can be created and configured, and a compression management module is built into the MDRAID (Multiple Device RAID) to implement data compression and decompression. According to the compression attribute of the configured array, when the user performs data read and write operations on the array, the IO (Input / Output) data can be compressed or decompressed by adopting a reasonable and efficient compression algorithm. By reusing the creation command (creat instruction) during the creation of the software disk array, a RAID array integrated with a compression function is implemented. The creation command creat is used to specify the creation of a new RAID array. This application does not make specific limitations on the specific configuration values of the configuration parameters and the compression attribute parameters, etc., which can be selected and set according to the storage function required by the host. This application does not make specific limitations on the specific types and implementation methods of the first identification code and the second identification code, etc.

[0067] As a specific embodiment, the RAID management tool mdadm supports configuring an array with compression attributes through the create command. A compression attribute parameter is added to the create command parameters. The specific parameter structure of the compression attribute parameter is shown in Table 1. Among them, compress represents the compression switch, and generally 0 or 1 is used to indicate whether the RAID array compression function is enabled. algo represents the specified compression algorithm for the RAID array, that is, the first identification code; data_type represents the data type that the RAID array will store when in use, that is, the second identification code. The first identification code and the second identification code are not limited to one byte shown in Table 1, and multiple bytes can also be used. For example, corresponding different IDs (Identifiers) can be defined in advance for several compression algorithms of different types. When a compression algorithm needs to be specified for a certain RAID array, the ID corresponding to the compression algorithm is directly configured as the first identification code into the compression attribute parameter; another example is that different IDs are defined in advance for different types of data. When the data format that a certain RAID array needs to store is determined, the ID corresponding to the data format is directly configured as the second identification code into the compression attribute parameter. By configuring the first identification code and / or the second identification code in the compression attribute parameter, it can help the compression management module determine the target compression algorithm that the RAID array needs to use when compressing or decompressing data subsequently. The first identification code and the second identification code generally serve as part of the compression attribute parameter structure at the same time, that is, the compression attribute parameter includes both the first identification code and the second identification code. If the data type to be stored by the host is relatively fixed, the second identification code will be configured with a corresponding value, and the first identification code will remain in a null or invalid value state. If the compression algorithms supported by the host are relatively fixed, the first identification code will be configured with a corresponding value, and the second identification code will remain in a null or invalid value state.

[0068] Table 1 Schematic table of the parameter structure of the compression attribute parameter

[0069]

[0070] S12: If there is input of data to be stored, determine the target compression algorithm selected by the current software disk array based on the configuration parameters and / or the compression attribute parameters.

[0071] S13: Compress the data to be stored using the target compression algorithm to obtain compressed data.

[0072] It is not difficult to understand that after the creation of the RAID array, MD RAID can save the compression attributes of the RAID array, especially the target compression algorithm, to a preset location by parsing the creation parameters when creating the array with the mdadm tool, so as to perform data reading and writing operations based on the target compression algorithm subsequently. When writing data, that is, storing data, the target compression algorithm selected by the current software disk array is determined from the preset location, and the target compression algorithm is used to compress the data to be stored.

[0073] It should be noted that the present invention also adds a compression management module to the MD RAID driver module. The compression management module is responsible for compressing or decompressing data with a reasonable and efficient compression algorithm in the algorithm library according to the compression attributes in the input message of the IO data in the input queue, and putting the compressed data into the output queue. That is, steps S12, S13, and S14 are implemented through the compression management module. Subsequently, MD RAID writes the processed data to the disk or returns it to the user from the output queue.

[0074] S14: Store the compressed data in the hard disk corresponding to the software disk array.

[0075] It can be understood that the compressed data can be formally written and stored in the hard disk corresponding to the software disk array. The hard disk corresponding to the software disk array is also the hard disk specified in the configuration parameters when creating the software disk array. A RAID array may have multiple corresponding hard disks. Therefore, the storage redundancy of the data can be achieved by storing the compressed data in multiple hard disks simultaneously to improve the security and reliability of storage. The specific type and implementation method of the hard disk corresponding to the RAID array are not particularly limited in this application.

[0076] Furthermore, for a host, several RAID arrays corresponding to it can be created according to requirements. Since the compression attribute configuration of the entire RAID array is directly completed during the creation in this application, for the RAID arrays in this application, data compression is performed with one array as a unit, and only one corresponding target compression algorithm can be used for one RAID array. Therefore, when a host needs to implement different types of compressed storage, it can choose to construct several RAID arrays corresponding one by one to several required compression methods, and each RAID array uses a different compression algorithm to meet the host's requirements for different types of compression methods. When using the second identification code to represent the target compression algorithm, it is best that only one type of data is stored in one RAID array. Therefore, when constructing a RAID array, it is necessary to determine the data type to be stored in the host according to the storage requirements of the host, and define the second identification code according to this data type, so as to create the RAID arrays required by the host. If the host has multiple different types of data to be stored, or as the host function expands, there are other types of data to be stored, then it is necessary to increase the creation of several RAID arrays corresponding one by one to several data types of the host IO data, and each RAID array corresponds to one data type to achieve the compressed storage and decompressed reading of the IO data of one data type. When using the array level to determine the target compression algorithm, the level corresponding to each RAID array is fixed. At this time, the storage requirements of the host can be achieved by creating several RAID arrays with different levels.

[0077] It should be noted that, as shown in Figure 2 the following figure, Figure 2 is a schematic diagram of the implementation structure of a software disk array provided by an embodiment of the present invention; the RAID management tool is set in the user space of the host, which is convenient for users to define configuration parameters and compression attribute parameters, and create different RAID arrays according to their own storage requirements or data compression requirements. MDRAID and the file system layer are set in the kernel space of the host. The RAID common layer can extract the common characteristics of various levels of RAID, register upward according to the implementation template of the block device, and at the same time provide common functions and interface registration functions to the RAID personality layer. The RAID personality layer is the personality manifestation of various levels of RAID. It registers the personality interface to the RAID common layer, uses the common functions provided by the RAID common layer, and realizes personalized functions based on the lower layer. The RAID personality is implemented in the form of an independent module and can be dynamically loaded. Specifically, it can be implemented through independent RAID arrays of different levels such as RAID 0, RAID 1, and RAID 4 / 5 / 6. At the same time, a compression management module is additionally set in MDRAID to realize data compression and decompression during the entire data storage / read-write process. At the same time, MDRAID corresponds to several hard disks at the hardware level to achieve data storage.

[0078] As a specific embodiment, the entire data storage process includes the following steps: First, configure the RAID system. Use the mdadm tool to configure an MDRAID array with the compression switch turned on. Then, data input can be performed. Input the data to be stored, which can include data of types such as text, images, audio, and video. When there is data input, the compression management module will select a compression algorithm through data type recognition or other means. According to the data type to be stored by the user or the RAID level, select the corresponding compression algorithm. Then, continue with data compression. Call the algorithm interface corresponding to the compression algorithm to compress the data to be compressed. After the compression process, perform data storage. Store the compressed data in chunks according to different RAID levels onto the hard disk. The process for the user to read data from the RAID system is the opposite of the above data storage process. First, read out the stored compressed data. Determine the corresponding compression algorithm for the data based on the compression process of the data. Call the algorithm interface corresponding to the compression algorithm to decompress the compressed data. The decompressed data is then returned to the user.

[0079] Furthermore, in order to improve the reliability and security of data storage, in application scenarios with relatively high requirements for data reliability, compression redundancy can be set. For a certain input data to be stored, set two or more RAID arrays corresponding to the data to be stored. These two or more RAID arrays use different target compression algorithms, compress the data to be stored, generate compressed data for storage. When the data needs to be read, these two or more RAID arrays decompress the data simultaneously for data reading. Finally, determine the accuracy of the data by comparing the data read from each RAID array, avoiding problems such as data corruption caused by compression errors or other anomalies. When the data to be stored is stored in each RAID array, further combine storage redundancy. Achieve higher-reliability data storage through the combination of storage redundancy and compression redundancy.

[0080] The present invention develops a new data storage method for software disk arrays, including steps such as class recognition of data, selection of compression algorithms, data compression, storage of compressed data, and data decompression and recovery. It realizes MDRAID that supports data compression, effectively implements data compression in the MD RAID system, not only can improve storage efficiency, through intelligent compression technology, reduce the occupation of storage space and improve storage efficiency, but also can enhance performance during data transmission and recovery. The volume of compressed data is reduced, improving the data transmission speed. Through performance analysis and dynamic adjustment, the RAID system can optimize storage and transmission performance according to actual needs, realizing the optimization of the dynamic performance of the RAID system. Through the integration of the compression function, the RAID system can automatically compress and decompress data without affecting the user experience, thereby improving the utilization rate of storage space and the overall performance of the system. The storage redundancy technology in MDRAID can also ensure the reliability of data, and even in the case of partial disk failures, it can ensure the integrity and availability of data.

[0081] On the one hand, the compression attribute parameter further includes a compression switch bit, and the compression switch bit is used to control the opening and closing of the data compression function of the software disk array; before determining the target compression algorithm selected by the current software disk array based on the configuration parameter and / or the compression attribute parameter, it further includes:

[0082] Configure the compression switch bit to the corresponding state for enabling the data compression function.

[0083] It is not difficult to understand that the opening or closing of the compression function of the RAID array can be achieved by configuring the compression switch bit in the compression attribute parameter. If the compression switch bit indicates that the data compression function is enabled, when there is data input to the RAID array, the compression management module in the RAID array will be triggered to perform processes such as identification of the target compression algorithm and data compression. If the compression switch bit indicates that the data compression function is disabled, the compression management module will not be triggered, and the input data will be directly allocated to the corresponding hard disk for storage. In this application, the RAID array needs to enable the compression function to achieve higher utilization data storage, so it is necessary to pre-configure the compression switch bit to the corresponding state for enabling the data compression function. When the RAID array has an original storage requirement in actual application, the compression switch bit can be adjusted to the corresponding state indicating that the data compression function is disabled. The specific implementation method and configuration method of the compression switch bit are not particularly limited in this application, and the two corresponding states of opening or closing can be achieved by assigning a value of 0 or 1 to one byte, and the configuration can mainly be achieved by manual assignment by the user.

[0084] Specifically, the flexible control of the compression function of the RAID array is achieved by configuring the compression switch bit, enabling the RAID array to not only store data by compressing the data, but also meet the original storage requirements in specific application scenarios, further improving the flexibility of the RAID system and expanding the applicable scenarios of the RAID system.

[0085] On the one hand, the software disk array also includes an algorithm library and application programming interfaces corresponding to each compression algorithm in the algorithm library. The algorithm library is used to provide compression algorithms. Compressing the data to be stored using the target compression algorithm to obtain compressed data includes:

[0086] Invoking the application programming interface corresponding to the target compression algorithm to compress the data to be stored using the target compression algorithm to obtain compressed data.

[0087] It can be understood that, to facilitate the RAID array to implement different compression methods in different application scenarios, an algorithm library can also be directly set in the RAID array. The algorithm library includes various compression algorithms of different types. After the compression management module determines the target compression algorithm required by the current RAID array, it can directly call the corresponding application programming interface from the algorithm library to implement the invocation of the target compression algorithm for data compression. When data decompression is required, the compression management module can also use the same method to implement the invocation of the target compression algorithm for data decompression. Therefore, the RAID array also needs to configure the API (Application Programming Interface) interfaces corresponding to each compression algorithm in the algorithm library so that the compression management module can provide the corresponding API interfaces. The specific implementation method of the algorithm library and the like are not particularly limited in this application, and the algorithm library can also be set in the corresponding host. The specific implementation method of the application programming interface and the like are not particularly limited in this application, and different compression algorithms can also be invoked through other means, which are not particularly limited in this embodiment.

[0088] Specifically, the selection and invocation of the target compression algorithm can be achieved through the cooperation of setting the algorithm library and the API interface. Just encapsulate the compression algorithm in the API and directly call it when needed, realizing the reuse of the compression algorithm, which is beneficial to the rapid implementation of the entire data reading and writing process; setting the algorithm library facilitates the RAID system to directly call different compression algorithms in different application scenarios.

[0089] See Figure 3 as shown Figure 3 is a schematic diagram of the data compression process of a software disk array provided by an embodiment of the present invention; on the one hand, it also includes:

[0090] If there is compressed data input, the target compression algorithm corresponding to the compressed data is used to decompress the compressed data to obtain the original data.

[0091] It is not difficult to understand that the software disk array is not only set for data storage, but also involves the data reading process. When the data to be stored is compressed and then stored on the hard disk, when the user reads the data, the compression management module needs to decompress the data to obtain the original data, so as to return the original data to the user and realize data reading. That is, the operations of compressing when a set of corresponding data is written and decompressing when the data is read. The data is input into the compression management module in a FIFO (First In First Out) manner, and after being processed by the compression management module for compression / decompression, it is output from the compression management module in a FIFO manner. The decompression can use the same target compression algorithm as in the corresponding compression process. Therefore, for a created RAID array, generally only one target compression algorithm is used in its entire data reading and writing process.

[0092] Furthermore, there are two situations for the input data input into the compression management module at this time. One is the input of the data to be stored, and the other is the input of the compressed data to be read. At this time, the software RAID or the compression management module can determine whether the data belongs to the data to be stored or the data to be read according to the source of the input data and / or its output target, so as to trigger the compression or decompression operation correspondingly.

[0093] Specifically, when the user reads the data, the corresponding data decompression operation is also required to restore the data, so as to ensure that the data returned to the user is the original data, which is convenient for the user to directly view and process, and improves the data usage efficiency.

[0094] On the one hand, determine the target compression algorithm selected by the current software disk array based on the configuration parameters and / or compression attribute parameters, including:

[0095] If there is input of data to be stored, generate a compression request for the data to be stored based on the data to be stored, configuration parameters, and compression attribute parameters; the compression request includes the memory address of the data to be stored, the data size of the data to be stored, and the target compression algorithm selected by the current software disk array;

[0096] Receive the compression request, and determine the target compression algorithm selected by the current software disk array based on the compression request;

[0097] Store the compressed data into the hard disk corresponding to the software disk array, including:

[0098] Generate a compression response for the data to be stored based on the compressed data and the target compression algorithm; the compression response includes the memory address of the compressed data, the data size of the compressed data, and the target compression algorithm used when the data to be stored is compressed.

[0099] Receive the compression response and store the compressed data in the hard disk corresponding to the software disk array based on the compression response.

[0100] It can be understood that during the entire data reading and writing process, the request and response method can be used to implement data compression and decompression. When there is data input, the compression management module directly determines the target compression algorithm from a preset position, and then synthesizes a data packet request based on the input data and the target compression algorithm. At this time, the input data may be the data to be stored or the compressed data to be read out. If the input data is the data to be stored, the corresponding request is a compression request and the response is a compression response; if the input data is the data to be read out, the corresponding request is a decompression request and the response is a decompression response. This embodiment takes the compression operation as an example for illustration, and the decompression operation is similar, which will not be elaborated in this application. The format structure of the input data packet request is shown in Table 2, where addr represents the memory address of the input data, size represents the data size of the input data, the compression management module can obtain the input data to be stored according to addr and size after receiving this request, and compress or decompress it. algo represents the type of compression algorithm specified by the compression attribute parameter, that is, the first identification code in the compression attribute parameter, d_type represents the data type that will be stored when this RAID array is in use, that is, the second identification code, and level represents the array level of the RAID array, which can be obtained from the configuration parameters. Generally, the three parameters algo, d_type, and level are included in the request at the same time. If the compression management module determines the target compression algorithm according to the first identification code in the compression attribute parameter, the value of algo is obtained in the request, and the other two parameters remain null or invalid; if the compression management module determines the target compression algorithm according to the second identification code in the compression attribute parameter, the value of d_type is obtained in the request, and the other two parameters remain null or invalid; if the compression management module determines the target compression algorithm according to the array level, the value of level in the configuration parameter is obtained in the request, and the other two parameters remain null or invalid.

[0101] Table 2 Schematic table of the request structure input to the compression management module

[0102]

[0103] Correspondingly, after the compression management module completes the compression or decompression operation on the data, it will generate a compression response or decompression response corresponding to the compression request or decompression request, so as to output the compressed data for storage or output the decompressed data back to the user. The format structure of the output response is shown in Table 3. The input and output in this embodiment refer to the data input to the compression management module and output from the compression management module. Among them, addr represents the memory address of the output data, size represents the data size of the output data. After the data processing is completed, the compression management module can store the compressed data in the corresponding location or send the decompressed data to the corresponding location according to addr and size. algo represents the type of compression algorithm used in the compression or decompression process, that is, the target compression algorithm; result represents the processing result, which is a flag indicating whether the current data processing is successful. Users or operators can check whether the compression or decompression of the compression management module is completed normally according to this field.

[0104] Table 3 Schematic Diagram of the Response Structure Output by the Compression Management Module

[0105]

[0106] Specifically, by implementing the compression / decompression processing of data in the form of requests and responses, the data is input with the request and output with the response, which is convenient for statistical analysis of the usage of the compression algorithm by information such as the sending time of the request, the return time of the response, the parameters of the request, and the result of the response, so as to timely discover performance problems or abnormal situations in the system and perform corresponding optimization and adjustment. It is possible to request both compression operations and decompression operations, which facilitates the invocation of the compression algorithm in different requirements and scenarios.

[0107] On the one hand, it also includes: caching the compression requests to be processed to generate a request queue.

[0108] Receiving the compression request includes: reading the compression request from the request queue.

[0109] On the one hand, it also includes: caching the compression responses to be processed to generate a response queue.

[0110] Receiving the compression response includes: reading the compression response from the response queue.

[0111] It is not difficult to understand that considering that the compression management module may face multiple requests, and the processed data may not be directly output to the corresponding location due to transmission delay and other situations, corresponding request queues and response queues can also be set up. The request queue can cache data requests that need to be compressed or decompressed, that is, the input queue of the compression management module; the response queue can cache data responses after being compressed or decompressed, that is, the output queue of the compression management module. The compression management module sequentially reads the request messages in the request queue, processes the data, and places the processed responses into the response queue. The data transmission module in the software RAID sequentially reads the response messages in the response queue and outputs the processed data to the hard disk for storage or returns it to the user.

[0112] Specifically, by setting up the request queue and the response queue, it is possible to effectively cache the requests and responses during the data processing process, thereby avoiding the loss of requests and responses, realizing the ordered storage and management of requests and responses, waiting for the processing of the compression management module or the data transmission module, avoiding abnormal situations such as the collapse of the RAID system caused by instantaneous high load, ensuring the stable operation of the RAID system under high concurrency, ensuring that requests can be effectively processed and responses can be reliably transmitted to the corresponding location.

[0113] See Figure 4 as shown in Figure 4 is a schematic diagram of the first selection method of the compression algorithm provided by the embodiment of the present invention; on the one hand, determining the target compression algorithm selected by the current software disk array based on configuration parameters and / or compression attribute parameters, including:

[0114] Obtaining a first identification code from the preset compression attribute parameters;

[0115] Determining the target compression algorithm selected by the current software disk array based on the preset corresponding relationship between the compression algorithm and the first identification code.

[0116] It can be understood that the compression attribute parameters can directly specify a target compression algorithm for the software disk array by directly configuring the first identification code. The compression management module can directly call the corresponding API interface according to the specified algorithm type. Since the first identification code will be implemented in the form of an identifier, etc., it is necessary to establish a preset corresponding relationship between the compression algorithm and the first identification code in advance, so that the compression management module can directly determine and call the corresponding target compression algorithm according to the first identification code. The specific implementation method of the preset corresponding relationship between the compression algorithm and the first identification code and the like are not particularly limited in this application, and can be stored in the host or the RAID array in advance in the form of a corresponding relationship table. For example Figure 4As shown, directly specifying the LZMA algorithm (Lempel-Ziv-Markov chain algorithm), Bzip2 algorithm, or Deflate algorithm for each RAID array allows for the compression or decompression of data by directly calling the corresponding algorithm from the algorithm library when data processing is required.

[0117] Specifically, the target compression algorithm used by its corresponding RAID array can be directly specified according to the application requirements of the host, which is flexible, effective, and easy to implement, enabling the RAID array to meet the data compression requirements of specific application scenarios.

[0118] See Figure 5 as shown Figure 5 is a schematic diagram of the second method for selecting a compression algorithm provided by an embodiment of the present invention; on the one hand, determining the target compression algorithm selected by the current software disk array based on configuration parameters and / or compression attribute parameters, including:

[0119] Obtaining a second identification code from the preset compression attribute parameters;

[0120] Determining the data type to be stored by the current software disk array based on the preset correspondence between the data type and the second identification code;

[0121] Determining the target compression algorithm selected by the current software disk array according to the data type to be stored by the current software disk array.

[0122] It is not difficult to understand that a reasonable and efficient compression algorithm can also be provided according to the data type data_type. Therefore, the second identification code in the compression attribute parameters can also be defined according to the actual data storage requirements of the host to inform the compression management module of the data type that the current RAID array needs to process, and then the corresponding target compression algorithm is selected according to the data type. Therefore, a preset correspondence between the data type and the second identification code needs to be established in advance to help identify the data type that the current RAID array needs to process. The specific implementation manner of the preset correspondence between the data type and the second identification code is not particularly limited in this application. The correspondence between the data type and the target compression algorithm can also be selected and set according to the actually available compression algorithms. For example, Figure 5 as shown, for text data, Huffman Coding can be selected; for image data, JPEG compression (Joint Photographic Experts Group compression) can be selected; for video data, H.264 coding (ITU-T H.264 / ISO / IEC MPEG-4 AVC) can be selected, etc.

[0123] Specifically, different types of data have different characteristics. Identifying and determining the data compression method required for the current RAID array according to the data type can enable the selected target data compression algorithm to fully adapt to the characteristics of the stored data, achieve a high compression ratio, improve the compression speed, ensure the data quality after compression and decompression processing, and effectively balance the data quality and the occupation of storage space.

[0124] On the one hand, determining the target compression algorithm selected by the current software disk array according to the data type of the data to be stored in the current software disk array includes:

[0125] Determining the available compression algorithms in the algorithm library that support the data type of the data to be stored in the current software disk array;

[0126] Determining the compression algorithm with the highest compression ratio among several available compression algorithms whose compression efficiency is greater than the first preset value as the target compression algorithm.

[0127] It can be understood that when identifying and determining the target data compression algorithm according to the data type, it is first necessary to consider the data formats supported by each compression algorithm. Therefore, it is necessary to first select several available compression algorithms in the algorithm library that support this data type, and then determine the optimal compression algorithm as the target compression algorithm by comparing the compression efficiency and the compression ratio. The determination method of the optimal compression algorithm is not limited to the method proposed in this embodiment of determining the compression algorithm with the highest compression ratio among several available compression algorithms whose compression efficiency is greater than the first preset value. There are various implementation methods, and the present application does not make special limitations here. The specific value and implementation method of the first preset value are not specially limited in the present application.

[0128] Furthermore, after determining the available compression algorithms, select two or more relatively excellent compression algorithms from the available compression algorithms to achieve compression redundancy. Taking two redundancies as an example, determine the compression algorithm with the highest compression ratio among several available compression algorithms whose compression efficiency is greater than the first preset value as the target compression algorithm for the first RAID array, and determine the compression algorithm with the highest compression efficiency among several available compression algorithms whose compression ratio is greater than the second preset value as the target compression algorithm for the second RAID array, or determine the compression algorithm with the second highest compression ratio among several available compression algorithms whose compression efficiency is greater than the first preset value as the target compression algorithm for the second RAID array. Respectively use these two target compression algorithms to compress and store the data to be stored in the first RAID array and the second RAID array to achieve compression redundancy.

[0129] Specifically, on the basis of supporting the corresponding data format, the selection of the target compression algorithm can be realized by comprehensively considering the compression efficiency and the compression ratio, so as to ensure the compression / decompression speed during the data reading and writing process and ensure the rapid response of the RAID system.

[0130] See Figure 6 as shown Figure 6 which is a schematic diagram of the third selection method of the compression algorithm provided by the embodiment of the present invention; on the one hand, determining the target compression algorithm selected by the current software disk array based on configuration parameters and / or compression attribute parameters, including:

[0131] Determining the array level of the current software disk array based on configuration parameters;

[0132] Determining the target compression algorithm selected by the current software disk array according to the array level of the current software disk array.

[0133] It is not difficult to understand that the corresponding default compression algorithm can also be selected for different RAID levels level. At this time, the configuration parameters of the software disk array can be directly read to determine the array level of the current software disk array, and then the corresponding target compression algorithm can be selected. The corresponding relationship between the array level and the target compression algorithm can also be selected and set according to the actually available compression algorithms. For example Figure 6 as shown, for RAID 0 (disk striping array), the LZ4 (Lempel-Ziv-4) algorithm can be selected; for RAID 1 (disk mirroring array), the LZMA algorithm or the Zopfli algorithm can be selected; for RAID 5 (independent disk array with distributed parity), the LZMA algorithm or the Deflate algorithm can be selected; for RAID 6 (independent disk array with dual distributed parity), the LZMA algorithm or the Zopfli algorithm can be selected.

[0134] Specifically, the ways of storing data in different levels of RAID arrays, including redundancy methods, read and write performance, etc., are different. Therefore, different target data compression algorithms can be selected by identifying the level of the RAID array, so that the selected target data compression algorithm can fully adapt to the characteristics of the stored data, achieve a high compression ratio, and improve the compression speed.

[0135] On the one hand, determining the target compression algorithm selected by the current software disk array according to the array level of the current software disk array, including:

[0136] If the current software disk array is a disk striping array, then determine the compression algorithm with the fastest compression speed in the algorithm library as the target compression algorithm;

[0137] If the current software disk array is a disk mirroring array, then determine the compression algorithm with the highest compression ratio in the algorithm library as the target compression algorithm.

[0138] It is understandable that RAID 0 improves performance through striping, but has no redundancy mechanism. It is suitable for scenarios with high performance requirements but low data security requirements. Since RAID 0 has no data redundancy, the selection of compression algorithms should focus on improving performance. You can consider using algorithms with fast compression speed, such as LZ4, to maximize IO throughput. RAID 1 provides the highest level of redundancy, and each hard disk has a mirror. It is suitable for scenarios with strict requirements on data redundancy. Since the data volume of RAID 1 is twice that of a single hard disk, you can consider using algorithms with high compression ratios such as LZMA or Bzip2 to optimize storage space. RAID 5 uses striping technology with distributed parity, which provides a good balance between performance and reliability. It is suitable for applications with more random reads and writes and intensive data. You can choose algorithms such as LZMA or Deflate to balance the compression ratio and speed. When selecting a compression algorithm, you need to balance the compression ratio and compression speed. Specifically, you can use a compression algorithm with the highest compression ratio among several compression algorithms with a compression speed greater than a third preset value as the target compression algorithm. RAID 6 adds an extra parity check information on the basis of RAID 5, providing higher data redundancy. It is suitable for scenarios with extremely high data security requirements. You can consider using compression algorithms such as LZMA or Zopfli to ensure high data compression ratio and security. When selecting a compression algorithm, you need to balance the compression ratio and compressed data integrity. Specifically, you can use a compression algorithm with the highest compression ratio among several compression algorithms whose compressed data integrity is greater than the fourth preset value to determine it as the target compression algorithm.

[0139] Furthermore, for different levels of RAID arrays, two or more optimal compression algorithms can be selected from the compression algorithms according to their requirements to achieve compression redundancy. Taking two redundancies as an example, for RAID 0, the compression algorithm with the fastest compression speed in the algorithm library can be determined as the target compression algorithm for the first RAID array, and the second-ranked compression algorithm with the compression speed second only to the fastest can be determined as the target compression algorithm for the second RAID array. For RAID 1, the compression algorithm with the highest compression ratio in the algorithm library can be determined as the target compression algorithm for the first RAID array, and the second-ranked compression algorithm with the compression ratio second only to the highest can be determined as the target compression algorithm for the second RAID array. For RAID 5, the compression algorithm with the highest compression ratio among several compression algorithms in the algorithm library with the compression speed greater than the third preset value can be determined as the target compression algorithm for the first RAID array, and the compression algorithm with the highest compression speed among several compression algorithms in the algorithm library with the compression ratio greater than the fourth preset value can be determined as the target compression algorithm for the second RAID array. For RAID 5, the compression algorithm with the highest compression ratio among several compression algorithms in the algorithm library with the compression data integrity greater than the fifth preset value can be determined as the target compression algorithm for the first RAID array, and the compression algorithm with the best compression data integrity among several compression algorithms in the algorithm library with the compression ratio greater than the sixth preset value can be determined as the target compression algorithm for the second RAID array. The data to be stored is compressed and stored in the first RAID array and the second RAID array respectively using the corresponding two target compression algorithms to achieve compression redundancy.

[0140] Specifically, for different levels of RAID arrays, the different compression effects of each compression algorithm can be comprehensively considered, and the most suitable compression algorithm for each RAID level can be selected, so as to balance different compression parameters such as compression / decompression speed, compression ratio, and data integrity during the data reading and writing process, and achieve the optimal compression effect.

[0141] To solve the above technical problems, an embodiment of the present invention further provides a data storage device for a software disk array, including:

[0142] A creation unit, configured to execute a creation command through a disk array management tool and create a software disk array according to preset configuration parameters and preset compression attribute parameters; wherein, the compression attribute parameters include a first identification code or a second identification code, the first identification code is used to specify the target compression algorithm selected by the software disk array, and the second identification code is used to characterize the data type to be stored in the software disk array;

[0143] An algorithm determination unit, configured to determine the target compression algorithm selected by the current software disk array based on the configuration parameters and / or the compression attribute parameters if there is data to be stored input;

[0144] A compression unit for compressing the data to be stored by using the target compression algorithm to obtain compressed data;

[0145] A storage unit for storing the compressed data into the hard disk corresponding to the software disk array.

[0146] For the description of the features in the data storage device of the software disk array provided in the embodiments of the present invention, reference may be made to the relevant descriptions in the embodiments of the data storage method of the software disk array, which will not be elaborated here one by one.

[0147] See Figure 7 as shown Figure 7 which is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. To solve the above technical problems, an embodiment of the present invention also provides an electronic device, including:

[0148] A memory for storing a computer program;

[0149] A processor for executing the computer program to implement the steps of the data storage method of the software disk array as described above.

[0150] The electronic device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.

[0151] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computing operations related to machine learning.

[0152] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601. After the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the data storage method of the software disk array disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602, data 603, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, the data in the data storage method of the software disk array.

[0153] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.

[0154] Those skilled in the art can understand that Figure 7 the structure shown in

[0155] does not constitute a limitation on the electronic device, and it may include more or fewer components than those shown in the figure. For the description of the features in the electronic device provided in the embodiments of the present invention, reference may be made to the relevant descriptions in the embodiments of the data storage method of the software disk array, which will not be elaborated here one by one.

[0156] It can be understood that if the data storage method of the software disk array in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The foregoing storage media include: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical disks, etc., which can store program codes.

[0157] To solve the above technical problems, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the data storage method of the software disk array as described above.

[0158] For the description of the features in the computer-readable storage medium provided by the embodiments of the present invention, reference can be made to the relevant description in the embodiments of the data storage method of the software disk array, which will not be elaborated here one by one.

[0159] To solve the above technical problems, the embodiments of the present invention further provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the aforementioned data storage method of the software disk array.

[0160] For the description of the features in the computer program product provided by the embodiments of the present invention, reference can be made to the relevant description in the embodiments of the data storage method of the software disk array, which will not be elaborated here one by one.

[0161] The above has introduced in detail a data storage method, device, medium, and product of a software disk array provided by the embodiments of the present invention. Each embodiment in the specification is described in a progressive manner, and the key point of each embodiment is the difference from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0162] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0163] The above has introduced in detail a data storage method, device, medium, and product of a software disk array provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the present invention.

Claims

1. A data storage method for a software disk array, characterized in that Including: Execute a creation command through a disk array management tool, and create a software disk array according to preset configuration parameters and preset compression attribute parameters; wherein, the compression attribute parameters include a first identification code or a second identification code, the first identification code is used to specify the target compression algorithm selected by the software disk array, and the second identification code is used to characterize the data type to be stored in the software disk array; If there is input of data to be stored, determine the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters; Compress the data to be stored using the target compression algorithm to obtain compressed data; Store the compressed data in the hard disk corresponding to the software disk array; Determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters includes: If there is input of data to be stored, generate a compression request for the data to be stored based on the data to be stored, the configuration parameters, and the compression attribute parameters; the compression request includes the memory address of the data to be stored, the data size of the data to be stored, and the target compression algorithm currently selected by the software disk array; Receive the compression request, and determine the target compression algorithm currently selected by the software disk array based on the compression request; Storing the compressed data in the hard disk corresponding to the software disk array includes: Generate a compression response for the data to be stored based on the compressed data and the target compression algorithm; the compression response includes the memory address of the compressed data, the data size of the compressed data, and the target compression algorithm used when the data to be stored is compressed; Receive the compression response, and store the compressed data in the hard disk corresponding to the software disk array based on the compression response.

2. The data storage method of the software disk array according to claim 1, characterized in that, The compression attribute parameters further include a compression switch bit, and the compression switch bit is used to control the opening and closing of the data compression function of the software disk array; before determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters, it further includes: Configure the compression switch bit to the corresponding state for enabling the data compression function.

3. The data storage method of the software disk array according to claim 1, characterized in that, The software disk array further includes an algorithm library and application programming interfaces corresponding to each of the compression algorithms in the algorithm library, and the algorithm library is used to provide compression algorithms; Compressing the data to be stored using the target compression algorithm to obtain compressed data includes: Call the application programming interface corresponding to the target compression algorithm to compress the data to be stored using the target compression algorithm to obtain compressed data.

4. The data storage method of the software disk array according to claim 1, wherein, It also includes: If there is input of compressed data, decompress the compressed data using the target compression algorithm corresponding to the compressed data to obtain the original data.

5. The data storage method of the software disk array according to claim 1, characterized in that, It also includes: Cache the compression requests to be processed to generate a request queue; Receiving the compression request includes: Read the compression request from the request queue.

6. The data storage method of the software disk array according to claim 1, characterized in that, It also includes: Cache the compression responses to be processed to generate a response queue; Receiving the compression response includes: Read the compression response from the response queue.

7. The data storage method of the software disk array according to any one of claims 1 to 6, characterized in that, Determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters includes: Obtaining a first identification code from the preset compression attribute parameters; Determining the target compression algorithm currently selected by the software disk array based on the preset correspondence between the compression algorithm and the first identification code.

8. The data storage method of the software disk array according to any one of claims 1 to 6, characterized in that, Determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters includes: Obtaining a second identification code from the preset compression attribute parameters; Determining the data type to be stored in the current software disk array based on the preset correspondence between the data type and the second identification code; Determining the target compression algorithm currently selected by the software disk array according to the data type to be stored in the current software disk array.

9. The data storage method of the software disk array according to claim 8, wherein Determining the target compression algorithm currently selected by the software disk array according to the data type to be stored in the current software disk array includes: Determining the available compression algorithms in the algorithm library that support the data type to be stored in the current software disk array; Determining the compression algorithm with the highest compression ratio among several available compression algorithms with a compression efficiency greater than the first preset value as the target compression algorithm.

10. The data storage method of the software disk array according to any one of claims 1 to 6, characterized in that, Determining the target compression algorithm currently selected by the software disk array based on the configuration parameters and / or the compression attribute parameters includes: Determining the array level of the current software disk array based on the configuration parameters; Determining the target compression algorithm currently selected by the software disk array according to the array level of the current software disk array.

11. The data storage method of the software disk array according to claim 10, characterized in that, Determining the target compression algorithm currently selected by the software disk array according to the array level of the current software disk array includes: If the current software disk array is a disk striping array, determining the compression algorithm with the fastest compression speed in the algorithm library as the target compression algorithm; If the current software disk array is a disk mirroring array, determining the compression algorithm with the highest compression ratio in the algorithm library as the target compression algorithm.

12. An electronic device, characterized in that, Includes: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the data storage method of the software disk array according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the data storage method of the software disk array according to any one of claims 1 to 11 are implemented.

14. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the data storage method of the software disk array according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Data compression method and device

    CN110430168A

  • Implementing redundant array of independent disks (RAID) arrays having compressed data stored therein

    CN111752478A

  • Data compression method and device, data decompression method and device, electronic equipment and storage medium

    CN111835686A