Erasure code strip data updating method and device, electronic equipment and medium
By utilizing preset storage unit caching and differential update technology in the erasure code stripe data update method, data update requests for erasure code stripes are processed centrally, which solves the problem of increased storage device access and low system throughput caused by frequent updates. problem, achieving more efficient data updates.
Patent Information
- Application Number
- CN202410861730.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-17
AI Technical Summary
Existing erasure coded stripe data update methods lead to increased access to storage devices in frequent update scenarios, resulting in low system throughput and high overhead.
The data update requests sent by the client are cached through the preset storage unit. When the total storage capacity reaches the threshold, all data update requests belonging to the same erasure code strip are processed centrally, and differential update and aggregation rules are used to reduce storage device access. , improve throughput.
It effectively reduces the overhead of erasure code stripe update, improves the throughput of system data update, and reduces the number of accesses to storage devices.
Smart Images

Figure CN118656378A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer storage technology, and more specifically, to a method, device, electronic device and medium for updating erasure code stripe data. Background Art
[0002] With the rapid development of information technology, massive amounts of new data are generated every moment and need to be stored persistently. In order to avoid data loss due to equipment failure, existing storage systems usually use erasure coding technology to provide redundancy to maintain system reliability and reduce storage costs.
[0003] In the prior art, after adopting the erasure code technology, data update requests are usually formed in units of data blocks, and each data update request is processed separately to achieve the update of the original data in different erasure code stripes. However, since the erasure code stripe contains multiple data blocks, when multiple data blocks need to be updated in different time periods, the above method will inevitably lead to a large number of accesses to the storage device. In the scenario of frequent updates, the access to the storage device will be further increased, resulting in an increase in the overhead of updating the erasure code stripe and a low throughput of the entire system. Summary of the invention
[0004] In view of the defects of the prior art, the purpose of this application is to reduce the overhead of updating erasure code stripe data and improve the throughput of erasure code stripe updates, aiming to solve the problems in the prior art of increased overhead caused by the erasure code stripe data update method and low throughput of the entire system.
[0005] To achieve the above objectives, in a first aspect, the present application provides a method for updating erasure code stripe data, comprising:
[0006] Receive multiple data update requests carrying target data information from a client, and store each of the data update requests in a preset storage unit; the target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data;
[0007] When the total capacity of the update data stored in the preset storage unit reaches a preset threshold, all target data update requests whose data block numbers belong to the same erasure code stripe are obtained from the preset storage unit according to the data block numbers carried by each of the data update requests;
[0008] The erasure code stripe is updated based on the update data and update address of the data block carried by each of the target data update requests.
[0009] According to a method for updating erasure code stripe data provided by the present invention, the data of the erasure code stripe is updated based on the update data and update address of the data block carried by each target data update request, including:
[0010] Performing a union operation on the update addresses carried by each of the target data update requests, determining the update area of each target data block that needs to be updated on the erasure code stripe, and reading the original data of the update area of each of the target data blocks;
[0011] Determining update data corresponding to each of the target data blocks based on update data of the data blocks carried by each of the target data update requests;
[0012] Updating the original data of the update area of each of the target data blocks into corresponding update data;
[0013] Based on the original data and the updated data in the updated area of each of the target data blocks, data of the check blocks on the erasure code stripe are updated.
[0014] According to a method for updating erasure code stripe data provided by the present invention, the data of the check blocks on the erasure code stripe is updated based on the original data and the update data of the update area of each target data block, including:
[0015] Performing a logical exclusive OR operation on the original data and the updated data in the updated area of each target data block to obtain an updated difference corresponding to each target data block;
[0016] The check block is updated in a differential update manner based on the update differential corresponding to each target data block and the original data of the check block.
[0017] According to a method for updating erasure code stripe data provided by the present invention, the method of using differential update to update the data of the check block based on the update differential corresponding to each target data block and the original data of the check block includes:
[0018] Obtaining encoding matrix coefficients of the check block;
[0019] Calculating an update difference of the check block based on the update difference and the coding matrix coefficient of the check block;
[0020] Performing a logical exclusive OR operation on the original data of the check block and the updated difference of the check block to generate updated data of the check block;
[0021] The original data of the check block is updated to the updated data of the check block.
[0022] According to a method for updating erasure code stripe data provided by the present invention, when the total capacity of update data stored in the preset storage unit reaches a preset threshold, after obtaining all target data update requests with the same data block number belonging to an erasure code stripe from the preset storage unit according to the data block number carried by each data update request, the method further comprises:
[0023] Processing all the target data update requests according to a preset aggregation rule to obtain a plurality of processed data update requests;
[0024] Based on the updated data and updated addresses of the data blocks carried by the processed multiple data update requests, updating data on the erasure code stripe;
[0025] The preset aggregation rule is used to aggregate any two target data update requests into a new data update request when it is determined that there is an intersection in the data block update addresses of any two target data update requests among the target data update requests, and merge the target data information carried by the any two target data update requests, and use the merged data information as the target data information carried by the new data update request.
[0026] According to a method for updating erasure code stripe data provided by the present invention, the total capacity of update data of data blocks carried by a plurality of target data update requests corresponding to the erasure code stripe is the largest.
[0027] According to a method for updating erasure code stripe data provided by the present invention, the preset storage unit includes a solid state drive and a storage queue; the storing each data update request in the preset storage unit includes:
[0028] Cache each of the data update requests and the update data carried by it in the solid state drive, and store the data block number, update address and update data capacity carried by each of the data update requests in the storage queue;
[0029] The storage queue is used to store the data block number, update address and update data capacity carried by all data update requests belonging to the same erasure code stripe as one element, and to sort the queue according to the sum of the update data capacity in each element.
[0030] In a second aspect, the present application provides an erasure code stripe data update device, comprising:
[0031] A storage module, configured to receive multiple data update requests carrying target data information sent by a client, and store each of the data update requests in a preset storage unit; the target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data;
[0032] an acquisition module, configured to acquire, from the preset storage unit, all target data update requests whose data block numbers belong to the same erasure code stripe, according to the data block numbers carried by each of the data update requests, when the total capacity of the update data stored in the preset storage unit reaches a preset threshold;
[0033] An update module is used to update the data of the erasure code stripe based on the update data and update address of the data block carried by each target data update request.
[0034] In a third aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0036] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0037] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0038] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0039] The erasure code stripe data update method, device, electronic device and medium provided by the present invention utilize a preset storage unit to cache each data update request sent by a client, wherein the data update request carries a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data, until the total capacity of the update data stored in the storage unit reaches a preset threshold, all data update requests belonging to the same erasure code stripe are extracted from the preset storage unit for centralized processing, and by integrating the traditional data update method based on data blocks into the data update method based on erasure code stripes, the access of the erasure code stripe update to the storage device can be effectively reduced, the overhead of the erasure code stripe update can be reduced, and the throughput of the system data update can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is one of the flowcharts of the erasure code stripe data updating method provided in the embodiment of the present application;
[0041] Figure 2 This is the second flow chart of the erasure code stripe data update method provided in the embodiment of the present application;
[0042] Figure 3 It is a structural schematic diagram of an erasure code stripe data updating device provided in an embodiment of the present application;
[0043] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0046] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0047] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0048] For ease of understanding, the relevant technical terms involved in the embodiments of the present application are explained and described below.
[0049] (1) Erasure Code Stripe
[0050] Through erasure coding technology, the original data can be divided into several data blocks, and then several check blocks are generated by performing specific matrix operations on these data blocks. These data blocks and the check blocks form a stripe, which can also be described as an erasure code stripe.
[0051] For example, in a storage system based on the erasure code RS(n,k), a file is divided into k original data blocks, which are encoded into n total data blocks through a coding matrix, where n=m+k, where m is the number of check blocks, and the set of n total data blocks is called a "stripe". An erasure code stripe is the smallest coding unit in the erasure code. Usually, each data block in a stripe is stored in a different storage node. If no more than m nodes fail, the failed data can be repaired from the remaining k nodes.
[0052] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0053] Figure 1 FIG. 1 is one of the flow charts of the erasure code stripe data updating method provided by the present invention, such as Figure 1 As shown, including:
[0054] Step 110, receiving multiple data update requests carrying target data information from the client, and storing each data update request in a preset storage unit; the target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data;
[0055] Step 120, when the total capacity of the update data stored in the preset storage unit reaches a preset threshold, all target data update requests with the same data block number belonging to an erasure code stripe are obtained from the preset storage unit according to the data block number carried by each data update request;
[0056] Step 130: Update the data of the erasure code stripe based on the update data and update address of the data block carried by each target data update request.
[0057] Specifically, the data block number described in the embodiment of the present invention refers to the number of the data block in the erasure code stripe that needs to be updated. It can be understood that the corresponding erasure code stripe can be located according to the data block number.
[0058] The update address of the data block described in the embodiment of the present invention refers to the address of the area in the erasure code stripe where the data block needs to be updated, which can be specifically expressed as offset information relative to the start address of the data block.
[0059] It can be understood that, in the embodiment of the present invention, the capacity of updating data refers to the size of the data required to be updated in the data block.
[0060] The data update request described in the embodiment of the present invention refers to a service request sent by a client, which is used to request data update of an erasure code stripe in an erasure code storage system.
[0061] The target data information described in the embodiment of the present invention includes a data block number, update data and update address of the data block corresponding to the number, and the capacity of the update data, which is associated with a data update request, that is, each data update request carries its corresponding target data information.
[0062] The preset storage unit described in the embodiment of the present invention refers to a pre-set storage unit, which can specifically be one of a hard disk and a memory, or a combination of a hard disk and a memory.
[0063] The preset threshold described in the embodiment of the present invention refers to a data capacity threshold, which can be specifically determined according to the storage space of the preset storage unit used, and can be set by system default or by user customization. It is understandable that the larger the storage space of the preset storage unit, the more data it can store, and the larger the preset threshold provided by it.
[0064] The target data update request described in the embodiment of the present invention refers to a data update request for updating data on the same erasure code stripe among all data update requests sent by the client.
[0065] In an embodiment of the present invention, in step 110, after receiving the data update request sent by the client, the target data information carried by each data update request can be obtained, including the number of the data block to be updated, the update data and update address of the data block, and the capacity of the update data, and then each data update request, including the above-mentioned target data information carried by it, can be stored in a preset storage unit.
[0066] Further, in an embodiment of the present invention, in step 120, by recording the total capacity of the updated data in the preset storage unit, when it is determined that it reaches the preset threshold, the erasure code stripe located by each data update request can be determined according to the data block number carried by each data update request, and then, all target data update requests whose data block numbers belong to the same erasure code stripe can be obtained from the preset storage unit.
[0067] That is, through the above method in step 120, all data update requests stored in the preset storage unit can be grouped according to the erasure code stripe, and all data update requests corresponding to each erasure code stripe that needs to be updated can be obtained by integration.
[0068] It should be noted that in step 120, when it is determined that the total capacity of the cached update data in the preset storage unit does not reach the preset threshold, the data update request is continued to be received until the total capacity of the cached update data reaches the preset threshold.
[0069] Further, in an embodiment of the present invention, in step 130, the erasure code stripe is updated based on the update data and update address of the data block carried by each target data update request. Specifically, the original data of all data areas that need to be updated on the erasure code stripe can be read from the storage device storing the erasure code stripe at one time according to the update address carried by each target data update request, thereby reducing the subsequent access to the storage device, reducing the data processing overhead, and facilitating the subsequent data update of the erasure code stripe.
[0070] Optionally, in an embodiment of the present invention, in step 130, target data update requests with overlapping addresses may be merged in advance according to the update addresses carried by each target data update request, so as to reduce the number of data update requests, and then, according to the reduced data update requests, the erasure code stripe may be updated with data in the one-time reading manner described above, which may further reduce the system data processing overhead.
[0071] The erasure code stripe data update method of the embodiment of the present invention utilizes a preset storage unit to cache each data update request sent by the client, wherein the data update request carries a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data, until the total capacity of the update data stored in the storage unit reaches a preset threshold, all data update requests belonging to the same erasure code stripe are extracted from the preset storage unit for centralized processing, and by integrating the traditional data update method based on data blocks into the data update method based on erasure code stripes, the access of the erasure code stripe update to the storage device can be effectively reduced, the overhead of the erasure code stripe update can be reduced, and the throughput of the system data update can be improved.
[0072] Based on the content of the above embodiment, as an optional embodiment, the total capacity of the update data of the data blocks carried by each target data update request corresponding to the erasure code stripe is the largest.
[0073] Specifically, in an embodiment of the present invention, when the total capacity of updated data stored in a preset storage unit reaches a preset threshold, all target data update requests whose data block numbers belong to the same target erasure code stripe can be obtained from the preset storage unit, wherein the total capacity of updated data of data blocks carried by each target data update request corresponding to the target erasure code stripe is the largest.
[0074] It can be understood that for the target erasure code stripe, the amount of data that needs to be updated is the largest, so the probability that the corresponding target data update requests can be aggregated is also the largest.
[0075] Furthermore, in an embodiment of the present invention, the update addresses of the data blocks carried by each target data update request can be aggregated to aggregate the data update requests with overlapping update addresses into one request, thereby reducing the number of update requests that need to be processed by the target erasure code stripe. Furthermore, the target erasure code stripe can be updated based on the aggregated target data update requests and the update data they carry.
[0076] The method of the embodiment of the present invention can increase the probability of data update request aggregation, reduce the number of update requests that need to be processed, and reduce the cost of erasure code stripe updates by selecting the stripe with the largest total capacity for update data for priority processing.
[0077] Based on the content of the above embodiment, as an optional embodiment, the preset storage unit includes a solid state drive and a storage queue; storing each data update request in the preset storage unit includes:
[0078] Cache each data update request and the update data it carries in the solid-state hard disk, and store the data block number, update address, and update data capacity carried by each data update request in the storage queue;
[0079] The storage queue is used to store the data block number, update address and update data capacity carried by all data update requests belonging to the same erasure code stripe as one element, and sort the queue according to the sum of the update data capacity in each element.
[0080] Specifically, in an embodiment of the present invention, the preset storage unit includes a solid state drive and a storage queue, and the storage queue is set in the local memory.
[0081] In the embodiment of the present invention, the number of the data block, the data block update address and the capacity of the updated data of the data block can be used as metadata of the data update request. In this way, the target data information carried by the data update request includes the metadata and the updated data of the data block.
[0082] In an embodiment of the present invention, after receiving multiple data update requests carrying target data information from a client, each data update request and the update data it carries can be cached in a high-speed storage solid-state hard disk, and based on the total capacity of the update data of each erasure code stripe, the data update requests can be maintained in units of stripes through a storage queue.
[0083] The storage queue can store the metadata carried by all data update requests belonging to the same erasure code stripe, i.e., the data block number, update address, and update data capacity, as one element, and sort the queue according to the sum of the update data capacity in each element. Thus, the first element in the storage queue can be arranged as the metadata of all data update requests of a stripe with the largest update data size.
[0084] In an embodiment of the present invention, by recording the total capacity of the updated data cached in the solid state drive, if the total capacity of the data exceeds a preset threshold, the following operations are performed:
[0085] The first element is taken out from the storage queue, and all data update requests for the stripe in the solid-state drive are read into the memory. After the reading is completed, these data update requests are deleted from the solid-state drive cache.
[0086] Then, for all data update requests of the stripe corresponding to the first element, the area of the stripe that needs to be updated is calculated, and the update data of the data block carried by each target data update request is used to update the data of the update area corresponding to the stripe.
[0087] The method of the embodiment of the present invention utilizes a solid-state hard disk to quickly cache each data update request and the updated data it carries, and utilizes a storage queue to maintain the metadata of each data update request in units of stripes, and combines the queue's priority sorting rules to sort the metadata of the data update request corresponding to each stripe, thereby optimizing the update order of the erasure code stripe data, which is beneficial to further reduce the overhead of erasure code stripe updates and improve the throughput of system data updates.
[0088] Based on the content of the above embodiment, as an optional embodiment, based on the update data and update address of the data block carried by each target data update request, the erasure code stripe is updated, including:
[0089] Performing a union operation on the update addresses carried by each target data update request, determining the update area of each target data block to be updated on the erasure code stripe, and reading the original data of the update area of each target data block;
[0090] Determine the update data corresponding to each target data block based on the update data of the data block carried by each target data update request;
[0091] Updating the original data of the update area of each target data block to the corresponding update data;
[0092] Based on the original data and the updated data in the update area of each target data block, the data of the check block on the erasure code stripe is updated.
[0093] Specifically, the target data block described in the embodiment of the present invention refers to a data block on an erasure code stripe that needs to be updated.
[0094] In an embodiment of the present invention, after obtaining the update data and update address of the data block carried by each target data update request, a union operation is first performed on the update addresses carried by each target data update request one by one, and the update area of each target data block that needs to be updated on the erasure code stripe is calculated to obtain all the update areas that need to be updated on the stripe, and the original data of the update area of each target data block on the stripe is read from the hard disk into the memory at one time.
[0095] In an embodiment of the present invention, based on the update data of the data block carried by each target data update request, the update data required for each target data block on the erasure code stripe can be correspondingly determined.
[0096] Furthermore, in an embodiment of the present invention, original data in the update area of each target data block is updated to corresponding update data, thereby completing the data update of the data block to be updated on the stripe.
[0097] At the same time, in an embodiment of the present invention, the original data and updated data of the update area of each target data block obtained above are used to perform difference analysis, and the data of the check block on the erasure code stripe is updated in combination with the association relationship between the data block and the check block.
[0098] The method of the embodiment of the present invention can read the original data of the update area of each target data block at one time by performing a union operation on the update address carried by each target data update request. Therefore, the original data and update data of the update area of each target data block can be used to centrally update the data blocks and check blocks on the same erasure code stripe, which is beneficial to improving the efficiency of erasure code stripe data update.
[0099] Based on the content of the above embodiment, as an optional embodiment, based on the original data and update data of the update area of each target data block, the check block on the erasure code stripe is updated, including:
[0100] Performing a logical XOR operation on the original data and the updated data in the updated area of each target data block to obtain an updated difference corresponding to each target data block;
[0101] The difference update method is adopted to update the data of the check block based on the update difference corresponding to each target data block and the original data of the check block.
[0102] Specifically, the update difference described in the embodiment of the present invention refers to the difference value between the data before and after the data block is updated.
[0103] In an embodiment of the present invention, the original data of the update area of each target data block can be read from the storage hard disk, and the update data of each target data block can be read from a preset storage unit such as a solid state hard disk. Furthermore, a logical exclusive OR operation can be performed on the original data and the update data of the update area of each target data block to obtain the update difference corresponding to each target data block.
[0104] Furthermore, in an embodiment of the present invention, a differential update method can be adopted to calculate the update differential of the check block based on the update differential corresponding to each target data block, and then the updated data of the check block is calculated in combination with the original data of the check block, thereby finally completing the data update of the check block.
[0105] The method of the embodiment of the present invention adopts a differential update method and uses the updated differential of each data block and the original data of the check block to calculate the updated data of the check block, thereby improving the reliability and accuracy of the obtained check block update data and ensuring the effectiveness of the erasure code stripe data update.
[0106] Based on the content of the above embodiment, as an optional embodiment, a differential update method is adopted to update the data of the check block based on the update difference corresponding to each target data block and the original data of the check block, including:
[0107] Obtaining the coding matrix coefficients of the check block;
[0108] Calculating the update difference of the check block based on the update difference and the coding matrix coefficient of the check block;
[0109] Performing a logical XOR operation on the original data of the check block and the updated difference of the check block to generate updated data of the check block;
[0110] The original data of the check block is updated with the updated data of the check block.
[0111] Specifically, the coding matrix coefficients described in the embodiments of the present invention refer to coefficients in a linear coding matrix used to generate a check block.
[0112] In an embodiment of the present invention, after obtaining the update difference corresponding to each target data block and the original data of the check block, the coding matrix coefficients of the check block are further obtained, and linear encoding is performed using the coding matrix coefficients of the check block and the update difference to calculate the update difference of the check block.
[0113] Furthermore, in an embodiment of the present invention, the updated data of the check block can be directly generated by logically XORing the original data of the check block with the updated difference of the check block, and then the original data of the check block can be updated to the generated updated data of the check block, thereby finally completing the data update of the check block.
[0114] The method of the embodiment of the present invention calculates the update difference of the check block by using the coding matrix coefficient of the check block and the update difference of the data block, and performs a logical XOR operation on the original data of the check block and the update difference of the check block to ensure the reliability and accuracy of the generated check block update data.
[0115] Based on the content of the above embodiment, as an optional embodiment, when the total capacity of the update data stored in the preset storage unit reaches a preset threshold, after obtaining all target data update requests whose data block numbers belong to the same erasure code stripe from the preset storage unit according to the data block numbers carried by each data update request, the method further includes:
[0116] Processing each target data update request according to a preset aggregation rule to obtain multiple processed data update requests;
[0117] Based on the updated data and updated addresses of the data blocks carried by the processed multiple data update requests, data is updated on the erasure code stripe;
[0118] The preset aggregation rule is used to aggregate any two target data update requests into a new data update request when it is determined that there is an intersection in the data block update addresses of any two target data update requests in each target data update request, and merge the target data information carried by the any two target data update requests, and use the merged data information as the target data information carried by the new data update request.
[0119] Specifically, in an embodiment of the present invention, after all target data update requests are obtained from a preset storage unit, the preset aggregation rules can be further used to perform aggregation calculations on the target data update requests belonging to the same stripe. Specifically, when it is determined that the data block update addresses of any two target data update requests among the target data update requests are intersected, the any two target data update requests are aggregated into a new data update request, so that by traversing all target data update requests, several new data update requests and / or target data update requests that cannot be aggregated can be obtained, thereby obtaining multiple processed data update requests.
[0120] At the same time, in an embodiment of the present invention, it is also necessary to merge the target data information carried by any two target data update requests that can be aggregated, that is, to merge the data block number, the updated data and update address of the data block, and the capacity of the updated data carried by the two target data update requests respectively to obtain the merged data information, and the merged data information can be used as the target data information carried by a new data update request.
[0121] Furthermore, in an embodiment of the present invention, data is updated on the erasure code stripe based on the updated data and updated addresses of the data blocks carried by the processed multiple data update requests.
[0122] The method of the embodiment of the present invention can reduce the number of data update requests that need to be processed by aggregating all target data update requests belonging to the same stripe using preset aggregation rules, thereby further reducing the system data processing overhead and improving the system data update throughput.
[0123] Figure 2 This is a second flow chart of the method for updating erasure code stripe data provided in an embodiment of the present application, such as Figure 2 As shown, in the embodiment of the present invention, the erasure code parameter is RS(4,2). Figure 2 As shown in step 1 of , the data update request sent by the client is cached by the solid-state drive, and the request carries the data block number of the data block to be updated, the update address and update data of the data block, and the capacity of the update data, wherein the solid-state drive specifically caches each data update request and the update data of the data block it carries. As shown in the figure, the solid-state drive caches data update requests for multiple data blocks such as data block A and data block B.
[0124] At the same time, in the embodiment of the present invention, the metadata consisting of the data block number of the data block to be updated, the update address of the data block, and the capacity of the update data is stored in a storage queue set in the memory. Through the data structure of the storage queue, the size of the update data of each stripe in the cache is maintained in units of stripes, and the first element of the queue is the metadata part of all data update requests of the stripe with the largest update data capacity.
[0125] Optionally, if the update addresses of the data blocks carried by any two data update requests belonging to the same stripe intersect, the two data update requests are merged into one update request, and the most recently updated data is obtained from the obtained intersection area.
[0126] like Figure 2 As shown in step 2 of , in an embodiment of the present invention, the total capacity of the update data cached in the solid state drive is recorded. When the total capacity of the update data of the data update request cached by the solid state drive reaches a preset threshold, all data update requests of the stripe with the largest update data capacity are taken out from the solid state drive cache to the memory, and these update requests are deleted from the solid state drive cache. Figure 2 As shown, all update requests of a stripe are taken out from the cache, and several updates are performed on data block N and data block K from the same stripe.
[0127] like Figure 2 As shown in step 3, a union operation is performed on the update address of the stripe that needs to be updated, and the union of the update areas corresponding to all data update requests is taken, so as to obtain the update areas of all data blocks that need to be updated on the stripe, and then the corresponding original data of these data blocks before the update can be read from the hard disk into the memory, where the hard disk is used to store the data blocks and check block data of each stripe. Figure 2 In the process, the corresponding original data parts of the data blocks N, K and the check blocks P, Q of the same stripe are read from the hard disk into the memory for subsequent differential update calculation of the check blocks.
[0128] like Figure 2 As shown in step 4 of FIG. 1 , the check block on the stripe is updated by differential update, and the original data of the update area on the data block of the stripe is modified to the corresponding update data. Figure 2 In the example, the updated data blocks are N′, K′, and the check blocks are P′, Q′.
[0129] like Figure 2 As shown in step 5, the updated data is written back to the hard disk, that is, the updated data of each data block to be updated and the corresponding check block are written back to the hard disk.
[0130] In a specific embodiment of the present invention, for the erasure code RS (6,4), for 3414 stripes with a total size of 20GB, the size of each data block is 1MB, and the size of the solid-state hard disk is 9.6GB, the traditional update method and the update method of merging the same stripe provided by the present invention are respectively used, and only the partial area of the stripe that needs to be updated is read, and the time consumption performance of the two methods is compared and analyzed. Experiments show that compared with the traditional solution, the present invention can significantly reduce disk access, reduce the update overhead of the erasure code stripe, and thus improve the throughput of the erasure code stripe update.
[0131] The erasure code stripe data updating device provided by the present invention is described below. The erasure code stripe data updating device described below and the erasure code stripe data updating method described above can be referred to each other.
[0132] Figure 3 is a schematic diagram of the structure of the erasure code stripe data updating device provided by the present invention, such as Figure 3 As shown, including:
[0133] The storage module 310 is used to receive multiple data update requests carrying target data information sent by the client, and store each data update request in a preset storage unit; the target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data;
[0134] The acquisition module 320 is used to acquire all target data update requests whose data block numbers belong to the same erasure code stripe from the preset storage unit according to the data block numbers carried by each data update request when the total capacity of the update data stored in the preset storage unit reaches a preset threshold;
[0135] The update module 330 is used to update the data of the erasure code stripe based on the update data and update address of the data block carried by each target data update request.
[0136] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0137] The erasure code stripe data update device of the embodiment of the present invention utilizes a preset storage unit to cache each data update request sent by the client, wherein the data update request carries a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data, until the total capacity of the update data stored in the storage unit reaches a preset threshold, then all data update requests belonging to the same erasure code stripe are extracted from the preset storage unit for centralized processing, and by integrating the traditional data update method based on data blocks into the data update method based on erasure code stripes, the access of the erasure code stripe update to the storage device can be effectively reduced, the overhead of the erasure code stripe update can be reduced, and the throughput of the system data update can be improved.
[0138] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0139] Based on the method in the above embodiment, the embodiment of the present application provides an electronic device, which may include: a processor (Processor) 410, a communication interface (Communications Interface) 420, a memory (Memory) 430 and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logic instructions in the memory 430 to execute the method in the above embodiment.
[0140] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0141] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0142] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0143] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0144] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0145] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0146] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0147] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for updating erasure code stripe data, characterized in that: include: Receiving multiple data update requests carrying target data information from a client, and storing each of the data update requests in a preset storage unit; The target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data; When the total capacity of the update data stored in the preset storage unit reaches a preset threshold, all target data update requests whose data block numbers belong to the same erasure code stripe are obtained from the preset storage unit according to the data block numbers carried by each of the data update requests; The erasure code stripe is updated based on the update data and update address of the data block carried by each of the target data update requests.
2. The erasure code stripe data updating method according to claim 1, characterized in that: The updating of data on the erasure code stripe based on the update data and update address of the data block carried by each of the target data update requests includes: Performing a union operation on the update addresses carried by each of the target data update requests, determining the update area of each target data block that needs to be updated on the erasure code stripe, and reading the original data of the update area of each of the target data blocks; Determining update data corresponding to each of the target data blocks based on update data of the data blocks carried by each of the target data update requests; Updating the original data of the update area of each of the target data blocks into corresponding update data; Based on the original data and the updated data in the updated area of each of the target data blocks, data of the check blocks on the erasure code stripe are updated.
3. The erasure code stripe data updating method according to claim 2, characterized in that: The updating of data of the check blocks on the erasure code stripe based on the original data and the updated data of the update area of each of the target data blocks comprises: Performing a logical exclusive OR operation on the original data and the updated data in the updated area of each target data block to obtain an updated difference corresponding to each target data block; The check block is updated in a differential update manner based on the update differential corresponding to each target data block and the original data of the check block.
4. The erasure code stripe data updating method according to claim 3, characterized in that: The method of adopting the difference update method to update the data of the check block based on the update difference corresponding to each target data block and the original data of the check block includes: Obtaining encoding matrix coefficients of the check block; Calculating an update difference of the check block based on the update difference and the coding matrix coefficient of the check block; Performing a logical exclusive OR operation on the original data of the check block and the updated difference of the check block to generate updated data of the check block; The original data of the check block is updated to the updated data of the check block.
5. The erasure code stripe data updating method according to claim 1, characterized in that: When the total capacity of the update data stored in the preset storage unit reaches a preset threshold, after obtaining all target data update requests whose data block numbers belong to the same erasure code stripe from the preset storage unit according to the data block numbers carried by each of the data update requests, the method further includes: Processing all the target data update requests according to a preset aggregation rule to obtain a plurality of processed data update requests; Based on the updated data and updated addresses of the data blocks carried by the processed multiple data update requests, updating data on the erasure code stripe; The preset aggregation rule is used to aggregate any two target data update requests into a new data update request when it is determined that there is an intersection in the data block update addresses of any two target data update requests among the target data update requests, and merge the target data information carried by the any two target data update requests, and use the merged data information as the target data information carried by the new data update request.
6. The method for updating erasure code stripe data according to any one of claims 1 to 5, characterized in that: The total capacity of update data of data blocks carried by the multiple target data update requests corresponding to the erasure code stripe is the largest.
7. The method for updating erasure code stripe data according to any one of claims 1 to 5, characterized in that: The preset storage unit includes a solid state drive and a storage queue; storing each of the data update requests in the preset storage unit includes: Cache each of the data update requests and the update data carried by it in the solid state drive, and store the data block number, update address and update data capacity carried by each of the data update requests in the storage queue; The storage queue is used to store the data block number, update address and update data capacity carried by all data update requests belonging to the same erasure code stripe as one element, and to sort the queue according to the sum of the update data capacity in each element.
8. A device for updating erasure code stripe data, characterized in that: include: A storage module, used for receiving multiple data update requests carrying target data information from a client, and storing each of the data update requests in a preset storage unit; The target data information includes a data block number, update data and update address of the data block corresponding to the data block number, and the capacity of the update data; an acquisition module, configured to acquire, from the preset storage unit, all target data update requests whose data block numbers belong to the same erasure code stripe, according to the data block numbers carried by each of the data update requests, when the total capacity of the update data stored in the preset storage unit reaches a preset threshold; An update module is used to update the data of the erasure code stripe based on the update data and update address of the data block carried by each target data update request.
9. An electronic device, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the erasure code stripe data updating method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor executes the erasure code stripe data updating method as described in any one of claims 1-7.
Citation Information
Cited By
Erasure code coding method and device with low repair bandwidth
CN119127564A
Metadata management method and system based on block chain
CN119807201A
