A storage processing method and device, electronic equipment and computer storage medium
By constructing a mesh structure to dynamically adjust the association between storage blocks and parity bits, the problem of frequent storage space configuration adjustments for small and medium-sized enterprises is solved, enabling flexible storage management, reducing operational and maintenance pressure, and improving data security.
Patent Information
- Application Number
- CN202211455468.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-11-21
AI Technical Summary
In existing technologies, the storage space configuration of small and medium-sized enterprises needs to be frequently expanded or released, which increases the pressure on operation and maintenance. Moreover, each configuration change requires shutdown and formatting, which affects data security.
By constructing a mesh structure, the association between storage blocks and parity bits can be dynamically adjusted based on demand data and data to be stored, enabling flexible management of storage configuration and reducing dependence on controllers and RAID cards.
It enables flexible adjustment of storage configuration without downtime, reducing operational and maintenance pressure, minimizing the impact of hardware failures, and improving data security.
Smart Images

Figure CN116126226B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed storage, and in particular to a storage processing method and device, electronic equipment and computer storage medium. BACKGROUND
[0002] With the increasing demand for IT products by a large number of small and medium-sized enterprises, the required storage space needs to be small in size, have multiple configurations, and change frequently.
[0003] The required storage space of an enterprise needs to be expanded or released continuously by manual means due to project conditions, and each time the storage configuration is changed, the system needs to be shut down for the change, and the original disks also need to be formatted, so that the configuration change operation cannot be performed on the basis of the original configuration, which affects the security of the data and increases the operation and maintenance pressure. SUMMARY
[0004] Therefore, the embodiments of the present application provide a storage processing method and device, electronic equipment and computer storage medium to solve the problem of increased operation and maintenance pressure in the prior art.
[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions.
[0006] The first aspect of the embodiments of the present application shows a storage processing method, which comprises:
[0007] receiving a new configuration instruction submitted by a user, the new configuration instruction carrying demand data and to-be-stored data;
[0008] determining the number of required storage blocks based on the demand data, and the number of required check bits for the required storage blocks;
[0009] determining whether the first mesh structure meets the requirements based on the number of required check bits for the required storage blocks and the number of available check bits of the first mesh structure, the first mesh structure being generated by processing a storage;
[0010] if yes, creating an association between the first mesh structure and the required storage blocks based on the number of required storage blocks, the available check bits of the first mesh structure, the initial storage blocks corresponding to the available check bits, and the to-be-stored data;
[0011] if no, constructing a second mesh structure based on the demand data, the to-be-stored data, the number of required storage blocks, and the number of required check bits for the required storage blocks.
[0012] Optionally, the process of generating the first mesh structure by processing the storage comprises:
[0013] Splitting the space of the memory to obtain initial storage blocks;
[0014] Constructing a first mesh structure based on the check bits, data bits and position codes of the initial storage blocks.
[0015] Optionally, based on the number of required storage blocks, the available check bits of the first mesh structure, the storage blocks corresponding to the available check bits and the data to be stored, an association relationship between the first mesh structure and the required storage blocks is created, comprising:
[0016] Storing the data to be stored into the number of required storage blocks;
[0017] Generating corresponding check information based on the data to be stored;
[0018] Constructing the association relationship between the first mesh structure and the required storage blocks based on the check information, the available check bits of the first mesh structure and the storage blocks corresponding to the available check bits.
[0019] Optionally, constructing a second mesh structure based on the required data, the data to be stored, the number of required storage blocks and the number of check bits required by the required storage blocks, comprising:
[0020] Storing the data to be stored into the number of required storage blocks;
[0021] Generating corresponding check information based on the data to be stored, and determining the number of check information;
[0022] Determining a first storage block for storing check information according to the number of check bits required by the required storage blocks;
[0023] Constructing the second mesh structure based on the check information and the first storage block.
[0024] Optionally, receiving an expansion configuration instruction of the storage block to be upgraded submitted by a user;
[0025] If it is determined that the number of owned storage blocks does not reach a preset number, and the number of remaining check bits meets the required number for upgrading, performing expansion processing on the storage block to be upgraded based on a second storage block and an upgrading mode to obtain a processed storage block to be upgraded;
[0026] If it is determined that the number of owned storage blocks reaches the preset number, and the number of remaining check bits meets the required number for upgrading, performing expansion processing on the storage block to be upgraded based on a third storage block and an upgrading mode to obtain a processed storage block to be upgraded;
[0027] If the number of the owned storage blocks reaches the preset number and the number of the remaining check bits does not satisfy the required number, information that the configuration cannot be changed is prompted to the user.
[0028] Optionally, the user-submitted structure-reducing instruction is received.
[0029] If it is determined that the user-submitted structure-reducing instruction carries a storage block to be reduced, the storage block to be reduced is obtained from the structure-reducing instruction.
[0030] If it is determined that the check bit storage information of the storage block to be reduced has a null value, the association between the storage block to be reduced and the first mesh structure is removed.
[0031] Optionally, the method further comprises:
[0032] If it is determined that the user-submitted structure-reducing instruction does not carry a storage block to be reduced, data bit storage information of a storage block owned by the first mesh structure is obtained based on the structure-reducing instruction.
[0033] If it is determined that the data bit storage information of the fourth storage block owned by the first mesh structure has a null value, the association between the fourth storage block whose data bit storage information does not have data and the first mesh structure is removed.
[0034] A second aspect of the embodiment of the present application shows a storage processing device, which comprises:
[0035] A receiving unit is configured to receive a user-submitted new configuration instruction, wherein the new configuration instruction carries required data and data to be stored.
[0036] A determining unit is configured to determine the number of required storage blocks and the number of check bits required by the required storage blocks based on the required data.
[0037] A processing unit is configured to determine whether a first mesh structure meets the requirements based on the number of check bits required by the required storage blocks and the number of available check bits of the first mesh structure, wherein the first mesh structure is constructed based on a first construction unit.
[0038] A creating unit is configured to, if the first mesh structure meets the requirements, create an association between the first mesh structure and the required storage blocks based on the number of required storage blocks, the available check bits of the first mesh structure, initial storage blocks corresponding to the available check bits, and the data to be stored.
[0039] A second construction unit is configured to, if the first mesh structure does not meet the requirements, construct a second mesh structure based on the required data, the data to be stored, the number of required storage blocks, and the number of check bits required by the required storage blocks.
[0040] The third aspect of the embodiment of the present application shows an electronic device for running a program, wherein the program performs the storage processing method shown in the first aspect of the embodiment of the present application when running.
[0041] The fourth aspect of the embodiment of the present application shows a computer storage medium comprising a program, wherein the program controls the device where the storage medium is located to perform the storage processing method shown in the first aspect of the embodiment of the present application when running.
[0042] Based on the storage processing method, device, electronic device and computer storage medium provided by the embodiment of the present application, the method comprises: receiving a new configuration instruction submitted by a user, wherein the new configuration instruction carries demand data and to-be-stored data; determining the number of required storage blocks and the number of required check bits of the required storage blocks based on the demand data; determining whether the first mesh structure meets the requirements based on the number of required check bits of the required storage blocks and the number of available check bits of the first mesh structure, wherein the first mesh structure is generated by processing the storage; if yes, creating an association relationship between the first mesh structure and the required storage blocks based on the number of required storage blocks, the available check bits of the first mesh structure, the initial storage block corresponding to the available check bits and the to-be-stored data; if no, constructing a second mesh structure based on the demand data, the to-be-stored data, the number of required storage blocks and the number of required check bits of the required storage blocks. In the embodiment of the present application, the storage blocks in the mesh structure are used to store data, so as to reduce the degree of dependence on the controller and the array card; when different configuration instructions are received, the configuration instructions are processed to change the current mesh structure or reconstruct a new mesh structure. In the above manner, the user is assisted in management and configuration, so as to reduce the operation and maintenance pressure and further reduce the influence of hardware failure. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on the provided drawings.
[0044] Figure 1 The flowchart of the storage processing method shown in the embodiment of the present application is shown in the figure;
[0045] Figure 2 The specific structure diagram of the storage block shown in the embodiment of the present application is shown in the figure;
[0046] Figure 3 The schematic diagram of the first mesh structure shown in the embodiment of the present application is shown in the figure;
[0047] Figure 4 An example diagram of a storage block shown in an embodiment of the present application;
[0048] Figure 5 Another example diagram of a storage block shown in an embodiment of the present application;
[0049] Figure 6 A flow diagram of another storage processing method shown in an embodiment of the present application;
[0050] Figure 7 A flow diagram of still another storage processing method shown in an embodiment of the present application;
[0051] Figure 8 A structure diagram of a storage processing device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work are within the protection scope of the present application.
[0053] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0054] It should be noted that the description involving "first", "second" and the like in the present application is only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of various embodiments can be combined with each other, but must be based on the realization of a person skilled in the art, when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist, nor is it within the protection scope required by the present application.
[0055] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0056] In order to better understand the terms shown in the embodiments of the present invention, the following description is given.
[0057] A Redundant Array of Independent Disks (RAID) is a redundant array of independent disks. A RAID combines multiple disks into a single, massive disk group, leveraging the synergistic effect of individual disks providing data to improve overall disk system performance. This technology allows data to be divided into multiple segments and stored on separate hard drives. RAID also utilizes the concept of parity checking, allowing data to be read even if any hard drive in the array fails. During data reconstruction, the data is recalculated and relocated to a new hard drive.
[0058] RAID 0 means no redundancy and 100% disk utilization.
[0059] RAID 1 indicates high redundancy and 50% disk utilization.
[0060] RAID 5 indicates redundancy and a disk utilization ratio of n-1 / n, where n is the number of disks.
[0061] RAID 6 indicates redundancy and a disk utilization ratio of n-2 / n, where n is the number of disks.
[0062] Cold standby means that when the target device fails or becomes unavailable, the cold standby device enters the operating state from the standby state and assumes the work tasks of the failed device.
[0063] Virtualization is a resource management technology that abstracts and transforms a computer's physical resources, such as servers, networks, memory, and storage, to create a more tangible representation. This breaks down the barriers between physical structures and allows users to utilize these resources in a more efficient way than in their original configuration.
[0064] See also Figure 1A flowchart of a storage processing method is shown in an embodiment of the present application, and the method comprises the following steps:
[0065] Step S101: receiving a new configuration instruction submitted by a user.
[0066] In step S101, the new configuration instruction carries demand data and to-be-stored data.
[0067] In the embodiment of the present application, the configuration of the mesh structure can be of three types, specifically, three types of new configuration, expansion configuration and reduction configuration.
[0068] Optionally, the user can upload a new configuration instruction through a client terminal to perform new configuration on an existing mesh structure, i.e., a first mesh structure.
[0069] In the process of implementing step S101, the new configuration instruction uploaded by the user is received, which carries demand data and to-be-stored data.
[0070] It should be noted that the demand data includes storage space required for storing the to-be-stored data, as well as storage mode and backup strategy.
[0071] The storage mode includes RAID5, RAID6 and three backup modes.
[0072] Step S102: determining the number of required storage blocks and the number of required check bits of the required storage blocks based on the demand data.
[0073] It should be noted that in the process of implementing step S102, the following steps are included:
[0074] Step S11: obtaining the required storage space and storage mode in the demand data.
[0075] In the process of implementing step S11, the storage space required for storing the to-be-stored data and the storage mode filled in by the user in the demand data are extracted.
[0076] Optionally, the storage space can also be calculated according to the size of the to-be-stored data.
[0077] The storage mode at least includes RAID5 storage mode, RAID6 storage mode and three backup storage mode.
[0078] Step S12: determining the number of required check bits of the required storage blocks based on the storage mode.
[0079] It should be noted that the check bits required by different storage modes are pre-set. For example, the check bits required by the RAID5 storage mode are 1, the check bits required by the RAID6 storage mode are 2, and the check bits required by the three-backup storage mode are X3.
[0080] In the process of implementing step S12, the number of check bits corresponding to the storage mode is found through the storage mode.
[0081] Step S13: Based on the storage space, the number of check bits, and the preset storage amount, the number of required storage blocks is determined.
[0082] In step S13, the preset storage amount refers to the size of the storage data of each storage block. Since the size of the data that each storage block can store, i.e., the storage amount, is pre-set;
[0083] In the process of implementing step S13, the storage space D1, the number of check bits D2, and the storage amount S1 of the preset storage block are substituted into formula (1) for calculation to obtain the number of required storage blocks Sum.
[0084] Formula (1):
[0085] Sum = (D1 ÷ S1) + D2 (1)
[0086] Wherein, D1 is the storage space, D2 is the number of check bits, and S1 is the storage amount of the preset storage block.
[0087] Step S103: Based on the number of check bits required by the required storage block and the number of available check bits of the first mesh structure, it is determined whether the first mesh structure meets the requirements. If it meets the requirements, step S104 is executed, if it does not meet the requirements, step S105 is executed.
[0088] In step S103, the first mesh structure is generated by processing the storage.
[0089] It should be noted that the process of generating the first mesh structure by processing the storage includes the following steps:
[0090] Step S21: The space of the storage is split to obtain an initial storage block.
[0091] In the process of implementing step S21, the space of the storage is split according to the storage amount of each storage block into one small initial storage block.
[0092] It should be noted that the storage amount of each storage block is pre-set by the technical personnel and is a fixed value.
[0093] The memory can be a disk or the like.
[0094] Optionally, the initial storage block is virtualized to obtain a virtualized storage block.
[0095] In a specific implementation, due to different scenarios in which the storage block is used, some may require better read-write performance, some may require more space, and some may require more stable operation. Therefore, after the initial storage block is virtualized, different types of disks can be inserted, and thus the initial storage block is virtualized into different storage blocks.
[0096] Step S22: based on the check bits, data bits, and position codes of the initial storage block, a first mesh structure is established.
[0097] It should be noted that the first mesh structure is composed of a plurality of initial storage blocks.
[0098] The data bits, position codes, and check bits refer to the specific structure of the initial storage block, which can be as shown in Figure 2 .
[0099] In the process of implementing step S22, each initial storage block is processed to divide the initial storage block into data bits, position codes, and check bits; the system data of each application system of the current company is obtained, and the system data is sequentially stored into the initial storage block according to the system type and the storage capacity of the initial storage block; and the corresponding initial check information is generated based on the system data in each storage block; the initial check information is stored into other storage blocks except the storage block itself according to a preset rule; and the position information of the other storage blocks is stored into the position code of the initial storage block corresponding to the initial check information, so as to construct the association relationship between the data bits and the check bits of each storage block, thereby constituting the first mesh structure.
[0100] It should be noted that the preset rule can set that there is a certain association between the initial storage block of the system data for generating the initial check information and the system data of the storage block to be stored.
[0101] The first mesh structure refers to a storage block model with data bits, position codes, and check bits based on virtualized storage design. Using this model, different RAID configuration structures can be structured into a few configuration categories, and through the function of the position code, the dependence on hardware such as array cards and controllers is reduced.
[0102] The data bits are used to store the data required to be stored by the storage block.
[0103] The position code is used to store the position information of the storage block for checking by the storage block.
[0104] The check bits are used to store the data information required to be responsible for checking by the storage block.
[0105] The mesh design model of the storage block as a storage unit can use the model to more conveniently adjust the original difficult-to-adjust configuration.
[0106] For example, the first mesh structure Q can be as shown in Figure 3 The first mesh structure Q includes the connection between eight initial storage blocks, specifically, initial storage block Z1, initial storage block Z2, initial storage block Z3, initial storage block X, initial storage block Y, initial storage block s1, initial storage block s2, and initial storage block s3.
[0107] The check information 2 generated by the system data 2 stored in the data bit of the initial storage block X is stored in the check bit of the initial storage block Z1, the initial storage block Z2, and the initial storage block Z3, and therefore the position information Z of the initial storage block Z1, the initial storage block Z2, and the initial storage block Z3 is stored in the position code of the initial storage block X; the check information 1 generated by the system data 1 stored in the data bit of the initial storage block s1, the initial storage block s2, and the initial storage block s3 is stored in the check bit of the initial storage block X and the initial storage block Y, and therefore the position information X of the initial storage block X and the position information Y of the initial storage block Y are stored in the position code of the initial storage block s1, the initial storage block s2, and the initial storage block s3.
[0108] Optionally, when the memory is divided, a hard disk type is assigned to each divided initial storage block. For the same type, the data bit of the storage block can be normally read and written, but the check bit of the storage block of another type cannot be read and written, and no abnormality occurs due to different performances of the storage blocks.
[0109] In the process of implementing step S103, it is determined whether the number of available check bits of the first mesh structure is greater than or equal to the number of required check bits of the required storage block. If yes, it is determined that the first mesh structure meets the requirement, and step S104 is performed. If no, it is determined that the first mesh structure does not meet the requirement, and step S105 is performed.
[0110] Step S104: based on the number of required storage blocks, the available check bits of the first mesh structure, the storage blocks corresponding to the available check bits, and the to-be-stored data, an association relationship between the first mesh structure and the required storage blocks is created.
[0111] It should be noted that in the process of implementing step S104, the following steps are included:
[0112] Step S31: storing the to-be-stored data into the required storage blocks.
[0113] In the implementation of step S31, the to-be-stored data is divided according to the storage capacity of each storage block, and the divided to-be-stored data is stored in each storage block in sequence.
[0114] It should be noted that the storage capacity of each storage block is a fixed value preset by the technician.
[0115] Step S32: generating corresponding check information based on the to-be-stored data.
[0116] In the implementation of step S32, the check information capable of recovering the to-be-stored data is generated based on the to-be-stored data.
[0117] The number of check information is related to the storage mode, for example, the required storage block of RAID5 storage mode, regardless of the number of required storage blocks at this time, the corresponding check information is 1; the required storage block of RAID6 storage mode, regardless of the number of required storage blocks at this time, the corresponding check information is 2; the required storage block of three backup storage mode, the corresponding check information of each required storage block is 3.
[0118] Step S33: constructing the association relationship between the first mesh structure and the required storage block based on the check information, the available check bits of the first mesh structure, and the storage block corresponding to the available check bits.
[0119] In the implementation of step S33, the check information is stored in the available check bits of the first mesh structure; and the position information of the storage block corresponding to the available check bits is stored in the position code of the required storage block, so as to construct the association relationship between the corresponding storage block in the first mesh structure and the required storage block.
[0120] For example, as shown in Figure 4 The right side is the required storage block of RAID5 storage mode, and the number of required storage blocks is 6; the storage block on the left side is the storage block X corresponding to the available check bits of the first mesh structure. The check information 1 capable of recovering the to-be-stored data Q is generated; the check information 1 is stored in the available check bits of the first mesh structure, and the check bit of the storage block X is 1 at this time; and the position information X of the storage block corresponding to the available check bits is stored in the position code of the required storage block, and the position code is X at this time, so as to construct the association relationship between the corresponding storage block X in the first mesh structure and the required storage block.
[0121] For example, as shown in Figure 5As shown, the right side is the required storage block of the RAID6 storage mode, and the number of required storage blocks is 6; the storage blocks on the left side are the storage blocks X and Y corresponding to the available parity bits of the first mesh structure. The check information 1 capable of recovering the data to be stored is generated by the data to be stored Q; the check information 1 is stored in the available parity bits of the first mesh structure, at which time the parity bits of the storage blocks X and Y are both 1; then the position information of the storage blocks X and Y corresponding to the available parity bits is stored in the position code of the required storage blocks, at which time the position code is XY, so as to construct the association relationship between the storage blocks X and Y corresponding to the first mesh structure and the required storage blocks.
[0122] Step S105: constructing a second mesh structure based on the requirement data, the data to be stored, the number of required storage blocks, and the number of required storage blocks requiring parity bits.
[0123] It should be noted that the process of implementing step S105 includes the following steps:
[0124] Step S41: storing the data to be stored in the number of required storage blocks.
[0125] Step S42: generating corresponding check information based on the data to be stored, and determining the number of check information.
[0126] It should be noted that the specific implementation process of step S41 and step S42 is the same as the specific implementation process of step S31 and step S32.
[0127] Step S43: determining the first storage block storing the check information according to the number of required storage blocks requiring parity bits.
[0128] In the process of implementing step S43, the first storage block not storing the data to be stored is set, and the number of first storage blocks is determined according to the number of required storage blocks requiring parity bits.
[0129] It should be noted that the number of required storage blocks requiring parity bits is the same as the number of first storage blocks.
[0130] Step S44: constructing the second mesh structure based on the check information and the first storage block.
[0131] In the process of implementing step S43, the check information is stored in the parity bits of the first storage block; then the position information of the first storage block is stored in the position code of the required storage blocks, the association between the first storage block and the required storage blocks is established, and the second mesh structure is constructed based on the association relationship between the first storage block and the required storage blocks.
[0132] In the embodiment of the present application, the data is stored in the storage blocks in the mesh structure to reduce the dependence on the controller and the array card; when different configuration instructions are received, the configuration instructions are processed to change the current mesh structure or rebuild a new mesh structure. In the above manner, the user is assisted in managing the configuration to reduce the operation and maintenance pressure, and thus the influence of the hardware failure is reduced.
[0133] Based on the storage processing method shown in the above embodiment of the present application, correspondingly, another flowchart of a storage processing method is shown in the embodiment of the present application, as shown in Figure 6 The method comprises the following steps:
[0134] Step S601: receiving an expansion configuration instruction of a storage block to be upgraded submitted by a user.
[0135] In the process of implementing step S601, based on the storage block to be upgraded carried in the expansion configuration instruction, the number of the owned storage blocks in the first mesh structure where the storage block to be upgraded is located, the upgrade storage mode, the number of the remaining check bits and the number of the second storage blocks of the remaining check bits are obtained.
[0136] It should be noted that the storage block to be upgraded belongs to the owned storage blocks of the first mesh structure.
[0137] Step S602: judging whether the number of the owned storage blocks reaches a preset number and whether the number of the remaining check bits meets the required number for upgrade, if the number of the owned storage blocks does not reach the preset number and the number of the remaining check bits meets the required number for upgrade, step S603 is executed; if the number of the owned storage blocks reaches the preset number and the number of the remaining check bits meets the required number for upgrade, step S604 is executed; if the number of the owned storage blocks reaches the preset number and the number of the remaining check bits does not meet the required number for upgrade, step S605 is executed.
[0138] In step S602, the required number for upgrade is determined according to the upgrade storage mode.
[0139] In the implementation of step S602, too many storage blocks will cause too much calculation pressure and performance problems, so the number of owned storage blocks is compared with the preset number, and the number of remaining check bits is compared with the required number for upgrading to ensure that the space of the first mesh structure meets the requirement; if the number of owned storage blocks does not reach the preset number and the number of remaining check bits meets the required number for upgrading, step S603 is performed; if the number of owned storage blocks reaches the preset number and the number of remaining check bits meets the required number for upgrading, step S604 is performed; if the number of owned storage blocks reaches the preset number and the number of remaining check bits does not meet the required number for upgrading, step S605 is performed.
[0140] It should be noted that the required number for upgrading is determined according to the upgrading storage mode, for example, the upgrading storage mode is upgraded from RAID5 storage mode to RAID6 storage mode, at this time, the required number for upgrading can be determined, that is, the required check information is 1. The upgrading storage mode is upgraded from double backup storage mode to triple backup storage mode, at this time, the required number for upgrading can be determined as n*3-n*2, that is, the required check information is n, wherein n is the number of storage blocks to be upgraded.
[0141] The preset value is set by the technician in advance, which refers to the peak value of the storage blocks in the first mesh structure.
[0142] Step S603: based on the second storage block and the upgrading mode, the storage block to be upgraded is expanded to obtain the processed storage block to be upgraded.
[0143] In the implementation of step S603, the configuration in the first mesh structure can be changed directly at this time, the new check information to be added is generated based on the data stored in the data bits of the storage block to be upgraded, and the new check information is added to the check bits of the second storage block through the backup strategy of the upgrading mode; then the position information of the second storage block is stored in the position code of the storage block to be upgraded to determine the processed storage block to be upgraded.
[0144] It should be noted that the backup strategy of the upgrading mode refers to the storage of the check code, for example, the storage block of the RAID5 storage mode is upgraded to the storage block of the RAID6 storage mode, at this time, the required number for upgrading is 1, at this time, the backup strategy of the RAID6 storage mode refers to adding the new check information to be added to any one of the remaining storage blocks; the upgrading storage mode is upgraded from double backup storage mode to triple backup storage mode, at this time, the required number for upgrading is determined as the number n of the storage block to be upgraded. At this time, the backup strategy of the triple backup storage mode refers to adding the new check information to be added to n remaining storage blocks respectively.
[0145] Step S604: performing expansion processing on the to-be-upgraded storage block based on the third storage block and the upgrade mode, to obtain a processed to-be-upgraded storage block.
[0146] In step S604, the third storage block is determined according to the number of owned storage blocks and a preset number.
[0147] In the process of implementing step S604, the first mesh structure needs to be expanded. First, new check information that needs to be added is generated based on the data stored in the data bits of the to-be-upgraded storage block. The number of new storage blocks that can still be added is determined based on the number of owned storage blocks and a preset number. From the new storage blocks that can still be added, a same number of storage blocks as the number required for upgrading is selected, and the selected storage blocks are set as third storage blocks for storing new check information. The new check information is added to the check bits of the third storage blocks through the backup strategy of the upgrade mode. Then, the position information of the third storage blocks is stored in the position code of the to-be-upgraded storage block, to determine the processed to-be-upgraded storage block.
[0148] Step S605: prompting the user with information that the configuration cannot be changed.
[0149] In the process of implementing step S605, the user is prompted with information that the configuration cannot be changed, to prompt the user that the first mesh structure has reached the upper limit and the configuration cannot be changed.
[0150] In the embodiments of the present application, the storage blocks in the mesh structure store data, to reduce the degree of dependence on the controller and the array card. When different configuration instructions are received, the configuration instructions are processed to change the current mesh structure or to rebuild a new mesh structure. In the above manner, the user is assisted in managing the configuration, to reduce the operation and maintenance pressure, and to reduce the impact of hardware failures.
[0151] Optionally, based on the method shown in the embodiments of the present application, correspondingly, the present application also shows another flowchart of a storage processing method, as shown in Figure 7 The method comprises the following steps:
[0152] Step S701: receiving a user-submitted shrinking structure instruction.
[0153] Step S702: determining whether the user-submitted shrinking structure instruction carries a to-be-shrunk storage block. If it is determined that the user-submitted shrinking structure instruction carries a to-be-shrunk storage block, steps S703 to S705 and step S709 are executed. If it is determined that the user-submitted shrinking structure instruction does not carry a to-be-shrunk storage block, i.e., the case of excess space is processed, i.e., steps S706 to S709 are executed.
[0154] Step S703: obtaining to-be-reduced storage blocks from the to-be-reduced structure instruction.
[0155] In the implementation of step S703, the to-be-reduced storage blocks that meet the submitted requirement of reducing storage are obtained from the to-be-reduced structure instruction.
[0156] Step S704: judging whether the check bit storage information of the to-be-reduced storage block has a null value, if yes, executing step S705, if not, not needing to delete the storage block.
[0157] In the implementation of step S704, it is judged whether the data bit corresponding to the check bit in each to-be-reduced storage block exists, if not, it is considered that the data bit corresponding to the check bit in the to-be-reduced storage block is a null value, and step S705 is executed, if yes, not needing to delete the storage block.
[0158] Step S705: canceling the association between the to-be-reduced storage block and the first mesh structure.
[0159] In the implementation of step S705, the association between the to-be-reduced storage block with a null data bit and the first mesh structure is canceled, and then the storage space thereof is released.
[0160] Step S706: obtaining the data bit storage information of the storage block owned by the first mesh structure based on the reduced structure instruction.
[0161] In the implementation of step S706, when the reduced structure instruction submitted by the user is received, the data bit storage information of the storage block owned by the current structure, i.e., the first mesh structure, is obtained.
[0162] It should be noted that the data bit storage information refers to whether the check bit corresponding to the data bit exists.
[0163] Step S707: judging whether there is a null value in the data bit storage information of the fourth storage block owned by the first mesh structure, if yes, executing step S708, if not, not needing to delete the fourth storage block.
[0164] In the implementation of step S707, it is judged whether the check bit corresponding to the data bit of the fourth storage block exists, if not, step S708 is executed, if not, not needing to delete the fourth storage block.
[0165] Step S708: canceling the association between the fourth storage block with no data bit storage information and the first mesh structure.
[0166] In the implementation of step S708, the association between the fourth storage block with the null value of the check bit and the first mesh structure is released; then, the storage space of the fourth storage block with the null value of the data bit is released, so as to obtain a new first mesh structure, and the association of the first mesh structure is updated.
[0167] It should be noted that for the RAID configuration, the specific process of updating the association of the first mesh structure can be recalculating the check information corresponding to the data stored in the data bit in the current remaining fourth storage block, so as to update the association of the first mesh structure.
[0168] In the embodiment of the application, the storage blocks in the mesh structure are used to store data, so as to reduce the dependence on the controller and the array card; when different configuration instructions are received, the configuration instructions are processed to change the current mesh structure or to rebuild a new mesh structure. In the above manner, the user is assisted to manage and configure, so as to reduce the operation and maintenance pressure, and to reduce the influence of hardware failure.
[0169] Based on the storage processing method shown in the above embodiment of the application, correspondingly, another structure diagram of a storage processing device is also disclosed in the embodiment of the application, as shown in Figure 8 The device comprises:
[0170] The receiving unit 801 is configured to receive a new configuration instruction submitted by a user, and the new configuration instruction carries demand data and to-be-stored data.
[0171] The determining unit 802 is configured to determine the number of required storage blocks and the number of check bits required by the required storage blocks based on the demand data.
[0172] The processing unit 803 is configured to determine whether the first mesh structure meets the requirements based on the number of check bits required by the required storage blocks and the number of available check bits of the first mesh structure, wherein the first mesh structure is constructed based on the first construction unit 804.
[0173] The creating unit 805 is configured to, if the first mesh structure meets the requirements, create an association between the first mesh structure and the required storage blocks based on the number of required storage blocks, the available check bits of the first mesh structure, the initial storage blocks corresponding to the available check bits, and the to-be-stored data.
[0174] The second construction unit 806 is configured to, if the first mesh structure does not meet the requirements, construct a second mesh structure based on the demand data, the to-be-stored data, the number of required storage blocks, and the number of check bits required by the required storage blocks.
[0175] It should be noted that the specific principles and execution processes of each unit in the storage processing device disclosed in the embodiments of the present application are the same as the storage processing method disclosed in the embodiments of the present application, and can be referred to the corresponding part of the storage processing method disclosed in the embodiments of the present application, which will not be described here.
[0176] In the embodiments of the present application, the data is stored in the storage blocks in the mesh structure to reduce the degree of dependence on the controller and the array card; when different configuration instructions are received, the configuration instructions are processed to change the current mesh structure or rebuild a new mesh structure. By the above-mentioned manner, the user can be assisted to manage and configure to reduce the operation and maintenance pressure, and thus reduce the influence of hardware failure.
[0177] Optionally, based on the storage processing device shown in the embodiments of the present application, the first construction unit 804 is specifically configured to: split the space of the storage to obtain an initial storage block.
[0178] The first mesh structure is constructed based on the data bits, the check bits and the position code of the initial storage block.
[0179] Optionally, based on the storage processing device shown in the embodiments of the present application, the creation unit 805 is specifically configured to: store the to-be-stored data into the required storage blocks.
[0180] The corresponding check information is generated based on the to-be-stored data.
[0181] The association relationship between the first mesh structure and the required storage blocks is constructed based on the check information, the available check bits of the first mesh structure, and the storage blocks corresponding to the available check bits.
[0182] Optionally, based on the storage processing device shown in the embodiments of the present application, the second construction unit 806 is specifically configured to: store the to-be-stored data into the required storage blocks.
[0183] The corresponding check information is generated based on the to-be-stored data, and the number of the check information is determined.
[0184] The first storage block for storing the check information is determined according to the number of check bits required by the required storage block.
[0185] The second mesh structure is constructed based on the check information and the first storage block.
[0186] Optionally, based on the storage processing device shown in the embodiments of the present application, the processing unit 803 is further configured to: receive an expansion configuration instruction of a to-be-upgraded storage block submitted by a user.
[0187] If it is determined that the number of owned storage blocks does not reach the preset number and the number of remaining check bits meets the required number for upgrading, the to-be-upgraded storage block is expanded based on a second storage block and an upgrade mode, to obtain a processed to-be-upgraded storage block.
[0188] If it is determined that the number of owned storage blocks reaches the preset number and the number of remaining check bits meets the required number for upgrading, the to-be-upgraded storage block is expanded based on a third storage block and an upgrade mode, to obtain a processed to-be-upgraded storage block.
[0189] If the number of owned storage blocks reaches the preset number and the number of remaining check bits does not meet the required number for upgrading, information that the configuration cannot be changed is prompted to the user.
[0190] Optionally, based on the storage processing apparatus shown in the embodiments of the present application, the processing unit 803 is further configured to:
[0191] If it is determined that the to-be-reduced storage block is not carried in the reduction structure instruction submitted by the user, the data bit storage information of the owned storage block in the first mesh structure is obtained based on the reduction structure instruction.
[0192] If it is determined that the data bit storage information of the fourth storage block owned in the first mesh structure has a null value, the association between the fourth storage block with no data in the data bit storage information and the first mesh structure is removed.
[0193] The embodiments of the present application further disclose an electronic device configured to run a database storage process, wherein the database storage process is configured to perform the above-mentioned Figures 1 to 7 storage processing method.
[0194] The embodiments of the present application further disclose a computer storage medium, wherein the storage medium comprises a database storage process, and the database storage process is configured to control the device where the storage medium is located to perform the above-mentioned Figures 1 to 7 storage processing method.
[0195] In the context of this disclosure, a computer storage medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more of: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0196] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for the system or system embodiments, since it is basically similar to the method embodiments, it is described more simply, and the relevant part can be referred to the part of the method embodiment. The above-described system and system embodiments are merely illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0197] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0198] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the appended claims are intended to cover all such modifications that do not depart from the true spirit and scope of the application. Therefore, the application is not limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A storage processing method, characterized in that: The method comprises: Receive a new configuration instruction submitted by a user, wherein the new configuration instruction carries required data and data to be stored; Determining the number of required storage blocks and the number of check bits required for the required storage blocks based on the demand data; determining whether the first mesh structure meets the requirement based on the number of check bits required by the required storage block and the number of available check bits of the first mesh structure, where the first mesh structure is generated by processing the memory; If the conditions are met, creating an association relationship between the first network structure and the required storage blocks based on the number of required storage blocks, available check bits of the first network structure, the initial storage blocks corresponding to the available check bits, and the data to be stored; If not, constructing a second network structure based on the demand data, the data to be stored, the number of required storage blocks, and the number of check bits required for the required storage blocks; The process of processing the memory to generate the first network structure includes: Split the memory space to obtain initial storage blocks; constructing a first mesh structure based on the check bits, data bits and position codes of the initial storage block; The second network structure is constructed based on the demand data, the data to be stored, the number of required storage blocks, and the number of check bits required for the required storage blocks, including: storing the data to be stored in the required number of storage blocks; generating corresponding verification information based on the data to be stored, and determining the amount of the verification information; Determine the first storage block for storing the check information according to the number of check bits required by the required storage block; The second mesh structure is constructed based on the verification information and the first storage block.
2. The method according to claim 1, characterized in that Creating an association relationship between the first network structure and the required storage blocks based on the number of the required storage blocks, available check bits of the first network structure, storage blocks corresponding to the available check bits, and data to be stored, includes: storing the data to be stored in the required number of storage blocks; generating corresponding verification information based on the data to be stored; An association relationship between the first mesh structure and the required storage block is established based on the check information, the available check bits of the first mesh structure, and the storage blocks corresponding to the available check bits.
3. The method according to claim 1, characterized in that Also includes: Receive the expansion configuration instruction of the storage block to be upgraded submitted by the user; If it is determined that the number of the owned storage blocks does not reach the preset number and the number of the remaining check bits meets the number required for the upgrade, the storage block to be upgraded is expanded based on the second storage block and the upgrade mode to obtain a processed storage block to be upgraded; If it is determined that the number of the owned storage blocks reaches the preset number and the number of the remaining check bits meets the number required for the upgrade, the storage block to be upgraded is expanded based on the third storage block and the upgrade mode to obtain a processed storage block to be upgraded; If the number of the owned storage blocks reaches the preset number and the number of remaining check bits does not meet the number required for the upgrade, a message indicating that the configuration cannot be changed is prompted to the user.
4. The method according to claim 1, wherein Also includes: receiving a reduction structure instruction submitted by a user; determining that the reduction structure instruction submitted by the user carries a storage block to be reduced, and obtaining the storage block to be reduced from the reduction structure instruction; If it is determined that the parity bit storage information of the storage block to be shrunk has a null value, the association between the storage block to be shrunk and the first network structure is released.
5. The method according to claim 4, characterized in that Also includes: After determining that the structure reduction instruction submitted by the user does not carry the storage block to be reduced, obtaining data bit storage information of the storage block in the first mesh structure based on the structure reduction instruction; If it is determined that the data bit storage information of the fourth storage block in the first network structure contains a null value, the association between the fourth storage block whose data bit storage information contains no data and the first network structure is released.
6. A storage processing device, characterized in that: The device comprises: A receiving unit, configured to receive a new configuration instruction submitted by a user, wherein the new configuration instruction carries required data and data to be stored; a determining unit, configured to determine the number of required storage blocks and the number of check bits required for the required storage blocks based on the demand data; a processing unit, configured to determine whether the first network structure meets the requirement based on the number of check bits required by the required storage block and the number of available check bits of the first network structure, where the first network structure is constructed based on the first construction unit; a creating unit, configured to, if satisfied, create an association relationship between the first network structure and the required storage blocks based on the number of required storage blocks, available check bits of the first network structure, initial storage blocks corresponding to the available check bits, and the data to be stored; a second constructing unit, configured to construct a second network structure based on the demand data, the data to be stored, the number of required storage blocks, and the number of check bits required for the required storage blocks if the requirements are not met; The processing unit for processing the memory to generate the first network structure is specifically configured to: Split the memory space to obtain initial storage blocks; constructing a first mesh structure based on the check bits, data bits and position codes of the initial storage block; Wherein, the second building block is specifically used for: storing the data to be stored in the required number of storage blocks; generating corresponding verification information based on the data to be stored, and determining the amount of the verification information; Determine the first storage block for storing the check information according to the number of check bits required by the required storage block; The second mesh structure is constructed based on the verification information and the first storage block.
7. An electronic device, characterized in that: The electronic device is used to run a program, wherein the program executes the storage processing method according to any one of claims 1 to 5 when running.
8. A computer storage medium, characterized in that The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the storage processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
RAID-based data storage method, data reading method and memory system
CN113703684A
Erasure code storage method and system and electronic equipment
CN114003174A