Storage device, data writing method for storage device
Patent Information
- Application Number
- CN202510521653.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2026-10-23
AI Technical Summary
在存储设备的主控芯片中,一般会设置有固定大小的SRAM(Static Random-Access Memory,静态随机存取存储器)用于XoR Buffer(异或缓冲器),在某些应用场景下,SSD中的XoR Buffer存在不够用的问题
[0014]本申请的有益效果有:存储设备包括m个异或条带和n个异或缓冲器,m大于n,n大于等于1。m个异或条带被配置为执行异或操作,n个异或缓冲器配置为存储m个异或条带中的n个异或条带的异或操作数据。其中,将n个异或条带中的第一目标类型条带的异或操作数据进行释放,以存储m个异或条带中的其余异或条带的异或操作数据。通过从已将数据存储于异或缓冲器的n个异或条带中进行判断,确定第一目标类型条带,并将第一目标类型条带对应的异或缓冲器进行释放,以存储其他异或条带的数据,提高异或缓冲器的利用率,进而提高了存储设备的可靠性和可用性。
Smart Images

Figure CN122963437A_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed in this application relate to the field of data storage technology, and more specifically, to a storage device and a method for writing data to a storage device. Background Technology
[0002] In SSD (Solid State Drive) and related storage technologies, caching is a type of temporary storage used to store frequently accessed data to accelerate data access speed. The controller chip of a storage device typically has a fixed-size SRAM (Static Random-Access Memory) for the XoR buffer. In some application scenarios, the XoR buffer in an SSD may be insufficient. Summary of the Invention
[0003] According to embodiments of this application, this application proposes a storage device and a data writing method for the storage device to solve the above-mentioned problems.
[0004] The first aspect of this application discloses a storage device comprising: m XOR stripes configured to perform XOR operations; n XOR buffers configured to store XOR operation data of n XOR stripes among the m XOR stripes; wherein, XOR operation data of a first target type stripe among the n XOR stripes is released to store XOR operation data of the remaining XOR stripes among the m XOR stripes; m is greater than n, and n is greater than or equal to 1.
[0005] In some embodiments, the first target type stripe is determined by a least recently used list, which is used to record the access frequency of the n XOR stripes.
[0006] In some embodiments, determining the first target type stripe by using a least recently used linked list includes: obtaining the access frequencies of the n XOR stripes; and determining the first target type stripe from the n XOR stripes, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes.
[0007] In some embodiments, the n XOR buffers are configured to store XOR operation data of a second target type stripe among the n XOR stripes; wherein the second target type stripe is determined by a least recently used list, which is used to record the access frequency of the n XOR stripes.
[0008] In some embodiments, determining the second target type stripe by using a least recently used linked list includes: obtaining the access frequencies of the n XOR stripes; and determining the second target type stripe from the n XOR stripes, wherein the access frequency of the second target type stripe is not the minimum value among the access frequencies of the n XOR stripes.
[0009] In some embodiments, the storage device further includes a non-volatile memory; the XOR operation data of the first target type stripe is written into the non-volatile memory to release the XOR operation data of the first target type stripe.
[0010] In some embodiments, the XOR stripe includes at least one data block configured to: perform the XOR operation to obtain at least one XOR operation result, the at least one XOR operation result being used as the XOR operation data.
[0011] The second aspect of this application discloses a data writing method for a storage device, comprising: releasing the XOR operation data of a first target type stripe among n XOR stripes stored in n XOR buffers, so as to store the XOR operation data of the remaining XOR stripes among m XOR stripes; wherein m is greater than n, and n is greater than or equal to 1.
[0012] In some embodiments, the first target type stripe is determined by a least recently used list, which is used to record the access frequency of the n XOR stripes.
[0013] In some embodiments, determining the first target type stripe by using a least recently used linked list includes: obtaining the access frequencies of the n XOR stripes; and determining the first target type stripe from the n XOR stripes, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes.
[0014] The beneficial effects of this application are as follows: The storage device includes m XOR stripes and n XOR buffers, where m is greater than n and n is greater than or equal to 1. The m XOR stripes are configured to perform XOR operations, and the n XOR buffers are configured to store the XOR operation data of the n XOR stripes out of the m XOR stripes. Specifically, the XOR operation data of the first target type stripe among the n XOR stripes is released to store the XOR operation data of the remaining XOR stripes among the m XOR stripes. By judging from the n XOR stripes that have stored data in the XOR buffers, the first target type stripe is determined, and the XOR buffer corresponding to the first target type stripe is released to store the data of other XOR stripes, the utilization rate of the XOR buffers is improved, thereby improving the reliability and availability of the storage device. Attached Figure Description
[0015] The present application will be further described below with reference to the accompanying drawings and embodiments. In the drawings:
[0016] Figure 1 This is a schematic diagram of the structure of a storage device according to an embodiment of this application;
[0017] Figure 2 This is a schematic diagram of the structure of an XOR strip according to an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of the structure of a storage device according to an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of the structure of a storage device according to another embodiment of this application;
[0020] Figure 5 This is a flowchart illustrating a data writing method for a storage device according to an embodiment of this application. Detailed Implementation
[0021] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0022] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, "many" in this application means two or more. Moreover, the term "at least one" in this application means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. Furthermore, the terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.
[0023] Currently, scenarios where the XoR buffer is insufficient are avoided by increasing the XoR buffer size and / or limiting the number of parallel XoR stripes. The size of the XoR buffer typically refers to the size of the buffer used for encryption or decryption during XOR operations. In some applications, such as Flexible Data Placement (FDP), many XoR stripes are often required in parallel; however, the size of the XoR buffer cannot be increased indefinitely. Furthermore, due to the limited size of the XoR buffer, frequent swapping of the XoR buffer significantly impacts the system performance of the storage device.
[0024] Therefore, this application proposes a storage device and a data writing method for the storage device to solve the above problems.
[0025] To enable those skilled in the art to better understand the technical solution of this application, the technical solution of this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0026] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a storage device according to an embodiment of this application. The storage device 100 includes m XOR stripes 110 and n XOR buffers 120, where m is greater than n and n is greater than or equal to 1.
[0027] The m XOR stripes 110 are configured to perform XOR operations. The XOR (XoR) operation involves XORing data with a key to achieve encryption and decryption. The n XOR buffers 120 are configured to store the XOR operation data of n XOR stripes from the m XOR stripes. The n XOR stripes can be used sequentially by the storage device 100 during operation. The XOR operation data of the n XOR stripes can be, for example, the XOR operation results generated after the n XOR stripes 110 perform their respective XOR operations.
[0028] Furthermore, the XOR operation data of the first target type stripe in the n XOR stripes 110 is released to store the XOR operation data of the remaining XOR stripes in the m XOR stripes 110. For example, the n XOR buffers 120 store the XOR operation data of the first n XOR stripes in the m XOR stripes. The XOR operation data of the (n+1)th XOR stripe 110 needs to use the XOR buffer 120. At this time, the XOR operation data of the first target type stripe in the first n XOR stripes 110 is released, that is, the buffer 120 storing the XOR operation data of the first target type stripe is released to store the XOR operation data of the (n+1)th XOR stripe 110 in the m XOR stripes 110. The first target type stripe is determined based on a preset rule. For example, the first target type stripe can be determined based on a preset rule among the n XOR stripes 110 that have stored data in the XOR buffer 120. Among them, the number of the first target type stripes in the n XOR stripes 110 can be 1, 2, 3, etc.
[0029] In this embodiment, the storage device 100 includes m XOR stripes 110 and n XOR buffers 120, where m is greater than n and n is greater than or equal to 1. The m XOR stripes 110 are configured to perform XOR operations, and the n XOR buffers 120 are configured to store the XOR operation data of the n XOR stripes out of the m XOR stripes. Specifically, the XOR operation data of the first target type stripe among the n XOR stripes 110 is released to store the XOR operation data of the remaining XOR stripes among the m XOR stripes 110. By determining the first target type stripe from the n XOR stripes 110 that have stored data in the XOR buffers 120, and releasing the XOR buffer 120 corresponding to the first target type stripe, data from other XOR stripes 110 can be stored, improving the utilization rate of the XOR buffers 120, thereby improving the reliability and availability of the storage device 110.
[0030] In some embodiments, the XOR strip 110 includes at least one data block 111, which is configured to perform an XOR operation to obtain at least one XOR operation result, which is used as XOR operation data.
[0031] In some examples, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an XOR stripe according to an embodiment of this application. The XOR stripe 110 includes four data blocks 111, namely data block 0, data block 1, data block 2, and data block 3. Of course, Figure 2For illustrative purposes only, in practical applications, the number of data blocks 111 in XOR stripe 110 can be an integer value X, and X is greater than or equal to 2. Data blocks 111 perform XOR operations. For example, within storage device 100, data blocks on an XOR stripe 110 will XOR each other, and the result of the XOR operation between each pair of data blocks is cached in XOR buffer 120. For example, the XOR operation results between data block 0 and data block 1, data block 1 and data block 2, and data block 2 and data block 3 are used as the XOR operation data for XOR stripe 110 and are cached in XOR buffer 120.
[0032] In some embodiments, the first target type stripe is determined by a least recently used list, which is used to record the access frequency of n XOR stripes 110.
[0033] The Least Recently Used (LRU) linked list is used to record the access frequency of n XOR stripes 110. The access frequency can be the number of times data blocks are read and written, etc. Specifically, the LRU linked list can record the access frequency of n XOR stripes 110 that store data in the XOR buffer 120, or it can directly record the access frequency of m XOR stripes 110 in the storage device 100.
[0034] The first target type stripe is determined using a least recently used list. For example, using the least recently used list, one XOR stripe 110 is determined as the first target type stripe from among the n XOR stripes 110 that have stored data in the XOR buffer 120. Further, the XOR operation data of this XOR stripe 110 is released from the XOR buffer 120, that is, the XOR buffer 120 corresponding to this XOR stripe 110 is released so that the XOR operation data of the remaining XOR stripes among the m XOR stripes 110 can be stored.
[0035] In some examples, a virtual XOR buffer management structure can be constructed. This structure includes virtual XOR buffers corresponding to the number of XOR stripes 110 in storage device 100; for example, m XOR stripes 110 can correspond to m virtual XOR buffers. The virtual XOR buffer management structure can be used to maintain the state of each XOR buffer 120 corresponding to each XOR stripe 110, as well as XOR operation status information, etc. When all n XOR buffers 120 are occupied, the virtual XOR buffer management structure can determine one XOR stripe 110 as the first target type stripe from the n XOR stripes 110 that have stored data in the XOR buffers 120, based on the least recently used linked list information.
[0036] In this embodiment, the first target type stripe is determined by the least recently used linked list so that the corresponding XOR operation data is released from the XOR buffer 120 so that the XOR operation data of the remaining XOR stripes 110 can be stored. This achieves intelligent cache management, effectively reduces the frequency of cache swapping, and thus improves the performance and stability of the storage device 100.
[0037] In some embodiments, determining a first target type stripe by using a least recently used linked list includes: obtaining the access frequencies of n XOR stripes 110; and determining a first target type stripe from the n XOR stripes 110, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes 110.
[0038] Obtain the access frequency of the n XOR stripes 110 that have stored data in the XOR buffer 120, and determine the first target type stripe from the n XOR stripes 110, wherein the access frequency of the first target type stripe can be the minimum access frequency of the n XOR stripes 110.
[0039] In some examples, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a storage device according to an embodiment of this application. The storage device 100 includes four XOR stripes 110 and three XOR buffers 120. The four XOR stripes 110 are 110A, 110B, 110C, and 110D, and the three XOR buffers 120 are 120X, 120Y, and 120Z. When XOR buffers 120X, 120Y, and 120Z are completely occupied by data from XOR stripes 110A, 110B, and 110C, the access frequency of XOR stripe 110A is A1, the access frequency of XOR stripe 110B is B1, and the access frequency of XOR stripe 110C is C1, where A1 > B1 > C1.
[0040] When XOR stripe 110D needs to use XOR buffer 120, the access frequencies of the three XOR stripes 110 currently using XOR buffer 120, namely A1, B1, and C1, are obtained. A first target type stripe is determined from the three XOR stripes 110. The access frequency of the first target type stripe can be the minimum access frequency of the n XOR stripes 110, i.e., XOR stripe 110C is determined as the first target type stripe. Further, the XOR operation data of XOR stripe 110C is released, i.e., XOR buffer 120Z is released, so that the XOR operation data of XOR stripe 110D can be stored in XOR buffer 120Z. Subsequently, if XOR stripe 110C needs to use XOR buffer 120 again, the access frequencies of the three XOR stripes 110 currently using XOR buffer 120 can be obtained again, and the first target type stripe can be determined for replacement.
[0041] In this embodiment, the access frequencies of n XOR stripes 110 are obtained, and a first target type stripe is determined from the n XOR stripes 110. The access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes 110. Furthermore, the XOR operation data of the first target type stripe in the n XOR stripes 110 is released to realize the storage of XOR operation data of other XOR stripes. This solves the problem of the size limitation of the XOR buffer 120, improves the utilization rate of the XOR buffer 120, and thus improves the reliability and availability of the storage device 110.
[0042] In some embodiments, at least one XOR buffer 120 is configured to store XOR operation data of a second target type strip among n XOR strips 110; wherein the second target type strip is determined by a least recently used list, which is used to record the access frequency of the n XOR strips 110.
[0043] At least one XOR buffer 120 stores XOR operation data of a second target type strip among n XOR strips 110, wherein the second target type strip is determined by a least recently used linked list, which is used to record the access frequency of the n XOR strips 110.
[0044] The Least Recently Used (LRU) linked list is used to record the access frequency of n XOR stripes 110. The access frequency can be the number of times data blocks are read and written, etc. Specifically, the LRU linked list can record the access frequency of n XOR stripes 110 that store data in the XOR buffer 120, or it can directly record the access frequency of m XOR stripes 110 in the storage device 100.
[0045] The second target type stripe is determined using a least recently used list. For example, using the least recently used list, at least one XOR stripe 110 is determined as the second target type stripe from among the n XOR stripes 110 that have stored data in the XOR buffer 120. For example, when the XOR buffer 120 corresponding to the first target type stripe is released, the remaining XOR buffers 120 continue to store the XOR operation data of the second target type stripe.
[0046] In some embodiments, determining a second target type stripe by using a least recently used list includes: obtaining the access frequencies of n XOR stripes 110; and determining a second target type stripe from the n XOR stripes 110, wherein the access frequency of the second target type stripe is not the minimum value among the access frequencies of the n XOR stripes 110.
[0047] Obtain the access frequency of the n XOR strips 110 that have stored data in the XOR buffer 120, and determine the second target type strip from the n XOR strips 110, wherein the access frequency of the second target type strip is not the minimum value among the access frequencies of the n XOR strips 110.
[0048] In some examples, please refer to [link / reference]. Figure 3 The storage device 100 includes four XOR stripes 110 and three XOR buffers 120. The four XOR stripes 110 are 110A, 110B, 110C, and 110D, and the three XOR buffers 120 are 120X, 120Y, and 120Z. When XOR buffers 120X, 120Y, and 120Z are fully occupied by data from XOR stripes 110A, 110B, and 110C, the access frequency of XOR stripe 110A is A1, the access frequency of XOR stripe 110B is B1, and the access frequency of XOR stripe 110C is C1, where A1 > B1 > C1.
[0049] When XOR stripe 110D needs to use XOR buffer 120, the access frequencies of the three XOR stripes 110 currently using XOR buffer 120, namely A1, B1, and C1, are obtained. A second target type stripe is determined from the three XOR stripes 110, and the access frequency of the second target type stripe is not the minimum access frequency of the n XOR stripes 110. That is, XOR stripes 110A and 110B are determined to be the second target type stripes. After determining that XOR stripes 110A and 110B are the second target type stripes, XOR buffers 120X and 120Y continue to store the XOR operation data of XOR stripes 110A and 110B, while releasing the XOR operation data of stripes that are not the second target type stripes, i.e., releasing XOR buffer 120Z. Thus, the XOR operation data of XOR stripe 110D can be stored in XOR buffer 120Z. Subsequently, if the XOR stripe 110C needs to use the XOR buffer 120 again, the access frequency of the three XOR stripes 110 currently using the XOR buffer 120 can be retrieved again to determine that the second target type stripe remains in the same storage state.
[0050] In some embodiments, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of a storage device according to another embodiment of this application. The storage device 100 further includes a non-volatile memory 130; the XOR operation data of the first target type stripe is written into the non-volatile memory 130 to release the XOR operation data of the first target type stripe.
[0051] In some examples, the XOR operation data of the first target type stripe among the n XOR stripes 110 is released to store the XOR operation data of the remaining XOR stripes among the m XOR stripes 110. For example, an XOR stripe 110 is determined as the first target type stripe from the n XOR stripes 110 whose data has been stored in the XOR buffer 120, and the XOR operation data of the XOR stripe 110 is written into the non-volatile memory 130, thereby releasing the XOR buffer 120 corresponding to the XOR stripe 110 so that the XOR operation data of other XOR stripes 110 can be stored.
[0052] Please see Figure 5 , Figure 5 This is a flowchart illustrating a data writing method for a storage device according to an embodiment of this application. The execution subject of this method can be the aforementioned storage device 100, or an electronic device including the storage device 100, etc. It should be noted that if substantially the same result is achieved, the method of this application does not necessarily require the storage device 100 to produce the same result. Figure 5 The sequence of processes shown is limited.
[0053] In some possible implementations, this method can be implemented by the processor calling computer-readable instructions stored in memory, such as... Figure 5 As shown, the method may include the following steps:
[0054] S51: Release the XOR operation data of the first target type stripe among the n XOR stripes stored in the n XOR buffers, so as to store the XOR operation data of the remaining XOR stripes among the m XOR stripes.
[0055] Storage device 100 includes m XOR stripes 110 and n XOR buffers 120, where m is greater than n and n is greater than or equal to 1. The m XOR stripes 110 are configured to perform XOR operations. The n XOR buffers 120 are configured to store the XOR operation data of n XOR stripes from the m XOR stripes.
[0056] The XOR operation data of the first target type stripe in the n XOR stripes 110 is released to store the XOR operation data of the remaining XOR stripes in the m XOR stripes 110. For example, if the n XOR buffers 120 store the XOR operation data of the first n XOR stripes in the m XOR stripes, and the XOR operation data of the (n+1)th XOR stripe 110 needs to use the XOR buffer 120, then the XOR operation data of the first target type stripe in the first n XOR stripes 110 is released, that is, the buffer 120 storing the XOR operation data of the first target type stripe is released to store the XOR operation data of the (n+1)th XOR stripe 110 in the m XOR stripes 110. The first target type stripe is determined based on a preset rule. For example, the first target type stripe can be determined by judging among the n XOR stripes 110 that have already stored data in the XOR buffer 120.
[0057] In some embodiments, the first target type stripe is determined by a least recently used list, which is used to record the access frequency of n XOR stripes 110.
[0058] The Least Recently Used (LRU) linked list is used to record the access frequency of n XOR stripes 110. The access frequency can be the number of times data blocks are read and written, etc. Specifically, the LRU linked list can record the access frequency of n XOR stripes 110 that store data in the XOR buffer 120, or it can directly record the access frequency of m XOR stripes 110 in the storage device 100.
[0059] The first target type stripe is determined using a least recently used list. For example, using the least recently used list, one XOR stripe 110 is determined as the first target type stripe from among the n XOR stripes 110 that have stored data in the XOR buffer 120. Further, the XOR operation data of this XOR stripe 110 is released, that is, the XOR buffer 120 corresponding to this XOR stripe 110 is released, so that the XOR operation data of the remaining XOR stripes among the m XOR stripes 110 can be stored.
[0060] In some examples, a virtual XOR buffer management structure can be constructed. This structure includes virtual XOR buffers corresponding to the number of XOR stripes 110 in storage device 100; for example, m XOR stripes 110 can correspond to m virtual XOR buffers. The virtual XOR buffer management structure can be used to maintain the state of each XOR buffer 120 corresponding to each XOR stripe 110, as well as XOR operation status information, etc. When all n XOR buffers 120 are occupied, the virtual XOR buffer management structure can determine one XOR stripe 110 as the first target type stripe from the n XOR stripes 110 that have stored data in the XOR buffers 120, based on the least recently used linked list information.
[0061] In some embodiments, determining a first target type stripe by using a least recently used linked list includes: obtaining the access frequencies of n XOR stripes 110; and determining a first target type stripe from the n XOR stripes 110, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes 110.
[0062] Obtain the access frequency of the n XOR stripes 110 that have stored data in the XOR buffer 120, and determine the first target type stripe from the n XOR stripes 110, wherein the access frequency of the first target type stripe can be the minimum access frequency of the n XOR stripes 110.
[0063] In some examples, storage device 100 includes four XOR stripes 110 and three XOR buffers 120. The four XOR stripes 110 are 110A, 110B, 110C, and 110D, and the three XOR buffers 120 are 120X, 120Y, and 120Z. When XOR buffers 120X, 120Y, and 120Z are fully occupied by data from XOR stripes 110B, 110C, and 110D, the access frequency of XOR stripe 110B is B1, the access frequency of XOR stripe 110C is C1, and the access frequency of XOR stripe 110D is D1, where B1 > C1 > D1.
[0064] When XOR stripe 110A needs to use XOR buffer 120, the access frequencies of the three XOR stripes 110 currently using XOR buffer 120, namely B1, C1, and D1, are obtained. A first target type stripe is determined from the three XOR stripes 110. The access frequency of the first target type stripe can be the minimum access frequency of the n XOR stripes 110, i.e., XOR stripe 110D is determined as the first target type stripe. Further, the XOR operation data of XOR stripe 110D is released, i.e., XOR buffer 120Z is released, so that the XOR operation data of XOR stripe 110A can be stored in XOR buffer 120Z. Subsequently, if XOR stripe 110D needs to use XOR buffer 120 again, the access frequencies of the three XOR stripes 110 currently using XOR buffer 120 can be obtained again, and the first target type stripe can be determined for replacement.
[0065] To facilitate understanding, an example of a data writing method for a storage device according to an embodiment of this application is provided. The XOR buffer 120 is initialized. For example, the size of the XOR buffer 120 can be set to an initial value, such as 1024KB, and the length of the least recently used list can be set to an initial value, such as 32 stripes. When all XOR buffers 120 are occupied, the data of the first target type stripe is swapped out according to the least recently used list, and the corresponding XOR buffer 120 is released to enable the writing of new data.
[0066] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0067] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed methods and related devices can be implemented in other ways. For example, the related device implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication disconnection shown or discussed may be indirect coupling or communication disconnection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0069] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0070] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0071] Those skilled in the art will readily recognize that numerous modifications and variations can be made to the apparatus and method while maintaining the teachings of this application. Therefore, the above disclosure should be considered limited only by the scope of the appended claims.
Claims
1. A storage device, characterized in that, include: m XOR stripes are configured to perform XOR operations; n XOR buffers are configured to store XOR operation data of n XOR stripes out of the m XOR stripes; Specifically, the XOR operation data of the first target type strip among the n XOR strips is released to store the XOR operation data of the remaining XOR strips among the m XOR strips; m is greater than n, and n is greater than or equal to 1.
2. The device according to claim 1, characterized in that, The first target type stripe is determined by a least recently used linked list, which is used to record the access frequency of the n XOR stripes.
3. The device according to claim 2, characterized in that, The first target type stripe is determined by using the least recently used linked list, including: Obtain the access frequency of the n XOR stripes; The first target type stripe is determined from the n XOR stripes, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes.
4. The device according to claim 1, characterized in that, The n XOR buffers are configured to store the XOR operation data of the second target type stripe among the n XOR stripes; The second target type stripe is determined by a least recently used linked list, which is used to record the access frequency of the n XOR stripes.
5. The device according to claim 4, characterized in that, The second target type stripe is determined by using the least recently used linked list, including: Obtain the access frequency of the n XOR stripes; The second target type stripe is determined from the n XOR stripes, wherein the access frequency of the second target type stripe is not the minimum value among the access frequencies of the n XOR stripes.
6. The device according to claim 1, characterized in that, The storage device also includes non-volatile memory; The XOR operation data of the first target type stripe is written into the non-volatile memory to release the XOR operation data of the first target type stripe.
7. The device according to claim 1, characterized in that, The XOR stripe includes at least one data block and is configured as follows: Perform the XOR operation to obtain at least one XOR operation result, and the at least one XOR operation result is used as the XOR operation data.
8. A method for writing data to a storage device, characterized in that, include: Release the XOR operation data of the first target type stripe from the n XOR stripes stored in the n XOR buffers, so as to store the XOR operation data of the remaining XOR stripes from the m XOR stripes; Where m is greater than n, and n is greater than or equal to 1.
9. The method according to claim 8, characterized in that, The first target type stripe is determined by a least recently used linked list, which is used to record the access frequency of the n XOR stripes.
10. The method according to claim 9, characterized in that, The first target type stripe is determined by using the least recently used linked list, including: Obtain the access frequency of the n XOR stripes; The first target type stripe is determined from the n XOR stripes, wherein the access frequency of the first target type stripe is the minimum value among the access frequencies of the n XOR stripes.