Matrix block storage method and device, electronic equipment and storage medium

By sorting and grouping the overwrite frequency of non-zero submatrix blocks in the storage device, the problem of garbage data generated by overwrite operations is solved, achieving more efficient storage and extending device life.

CN121233488APending Publication Date: 2025-12-30SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511422616.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

Existing storage devices generate a large amount of garbage data during overwrite operations, requiring additional garbage collection mechanisms for cleanup.

Method used

By obtaining the overwrite frequency of non-zero sub-matrix blocks in the storage device, sorting them, and storing them in the corresponding candidate reclamation unit group, non-zero sub-matrix blocks with different overwrite frequencies are separated to reduce the generation of garbage data.

Benefits of technology

It effectively reduces the generation of junk data, improves the write efficiency of storage devices, and extends the lifespan of the devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233488A_ABST
    Figure CN121233488A_ABST
Patent Text Reader

Abstract

The invention discloses a matrix block storage method and device, electronic equipment and a storage medium, and relates to the technical field of storage, and the method comprises the steps: obtaining the number of non-zero sub-matrix blocks of each candidate recovery unit group and the overwriting frequency of each non-zero sub-matrix block; and based on the overwriting frequency, sorting the non-zero sub-matrix blocks to obtain an overwriting frequency sorting value of each non-zero sub-matrix block. For each non-zero sub-matrix block, a candidate recovery unit group of each non-zero sub-matrix block can be determined according to an overwriting frequency sorting value of the non-zero sub-matrix block and the number of the non-zero sub-matrix blocks of each candidate recovery unit group, and the non-zero sub-matrix blocks are stored in the corresponding candidate recovery unit groups. Therefore, the non-zero sub-matrix blocks with different overwriting frequencies are placed in different candidate recovery unit groups, the non-zero sub-matrix blocks with higher overwriting frequencies can be recovered more frequently, but most of the data are to-be-covered data, namely, the proportion of junk data is lower, so that the generation of the junk data can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, in particular to a matrix block storage method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the field of storage technology, some storage devices cannot perform overwrite operations on any physical address during the execution of write operations, and can only perform erasure of entire blocks of data. As a result, when performing overwrite operations, garbage data is generated, and an additional garbage collection mechanism is required to clean up the garbage data. For example, during the process of updating the data of a page, the storage device needs to first read out and temporarily store the valid data in the block where the page is located (this part of data is garbage data), write the new data and the read-out valid data to a new block, and then erase all the data in the old block.

[0003] Under such a mechanism, the storage device generates a large amount of garbage data. SUMMARY

[0004] The present application provides a matrix block storage method, device, electronic equipment, storage medium and program product to solve the problem of a large amount of garbage data generated by the storage device.

[0005] The present application provides a matrix block storage method, comprising: obtaining the number of non-zero sub-matrix blocks corresponding to each of a plurality of candidate recycling unit groups included in a storage device; obtaining the overwrite frequency corresponding to each of at least one non-zero sub-matrix block; sorting each non-zero sub-matrix block in the at least one non-zero sub-matrix block according to the overwrite frequency corresponding to each non-zero sub-matrix block, to obtain an overwrite frequency sorting value of each non-zero sub-matrix block; determining a target candidate recycling unit group corresponding to a target non-zero sub-matrix block from the plurality of candidate recycling unit groups according to the overwrite frequency sorting value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to each of the plurality of candidate recycling unit groups, wherein the target non-zero sub-matrix block is any one of the at least one non-zero sub-matrix block; storing the target non-zero sub-matrix block into the target candidate recycling unit group.

[0006] The present application also provides a matrix block storage device, comprising: an obtaining module configured to obtain the number of non-zero sub-matrix blocks corresponding to each of a plurality of candidate recycling unit groups included in a storage device, and obtain the overwrite frequency corresponding to each of at least one non-zero sub-matrix block; The sorting module is used to sort each non-zero sub-matrix block in at least one non-zero sub-matrix block according to the overwrite frequency corresponding to each non-zero sub-matrix block, so as to obtain the overwrite frequency sorting value of each non-zero sub-matrix block. The determination module is used to determine the target candidate recycling unit group corresponding to the target non-zero matrix block from multiple candidate recycling unit groups based on the overwrite frequency sorting value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to the multiple candidate recycling unit groups respectively, wherein the target non-zero sub-matrix block is any one of at least one non-zero sub-matrix block. The storage module is used to store the target non-zero submatrix blocks into the target candidate recycling unit group.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the storage method of any of the above-described matrix blocks when executing the computer program.

[0008] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described matrix block storage methods.

[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described matrix block storage methods.

[0010] This application first obtains the number of non-zero sub-matrix blocks that can be stored in each candidate reclamation unit group and the overwrite frequency of each non-zero sub-matrix block. The overwrite frequency affects the amount of garbage data generated; therefore, based on the overwrite frequency, each non-zero sub-matrix block can be sorted to obtain its overwrite frequency ranking value. For each non-zero sub-matrix block, the corresponding candidate reclamation unit group can be determined based on its own overwrite frequency ranking value and the number of non-zero sub-matrix blocks in each candidate reclamation unit group. Then, the non-zero sub-matrix block is stored in the corresponding candidate reclamation unit group. Under this process, non-zero sub-matrix blocks with different overwrite frequencies are placed in different candidate reclamation unit groups. Non-zero sub-matrix blocks with higher overwrite frequencies will be reclaimed more frequently, but most of the data in these blocks is data that is about to be overwritten, meaning the proportion of valid data (valid data refers to data that has not been modified by the user but needs to be migrated due to the storage device's mechanism) is low. Therefore, garbage data (i.e., the aforementioned valid data) can be reduced. Attached Figure Description

[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This application provides a schematic diagram of the architecture of a storage device. Figure 2 A flowchart illustrating a method for storing matrix blocks provided in an embodiment of this application; Figure 3 A schematic diagram of a matrix block provided in an embodiment of this application; Figure 4 A schematic diagram of a storage matrix block provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of a storage device for a matrix block provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0015] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] The matrix block storage method provided in this application can be implemented by a storage device, such as... Figure 1As shown, a storage device may include a storage controller and a storage medium. The storage controller may include a cache. For example, the storage device may be a solid-state drive (SSD), and the storage medium may be flash memory (NAND). The storage controller may include a cache for caching data. The storage device may also store firmware that controls its operation.

[0017] The following explanation uses solid-state drives (SSDs) as an example of storage devices.

[0018] SSDs are storage devices that use semiconductor flash memory as their core storage medium. Their performance, power consumption, and reliability differ significantly from traditional hard disk drives (HDDs). From an operational perspective, the main difference between SSDs and HDDs lies in write operation handling. Unlike HDDs, SSDs cannot perform overwrite operations on arbitrary physical addresses; they can only erase entire blocks of data. This results in the generation of garbage data during overwrite operations, requiring an additional garbage collection mechanism to clean up this data.

[0019] The Non-Volatile Memory Express (NVME) specification is an interface that SSD firmware designers expose to external users. NVME provides the Flexible Data Placement (FDP) extension. From the perspective of the Flash Translation Layer (FTL), the core of the FDP extension is to grant users partial control over garbage collection.

[0020] In NVME, a Reclaim Unit (RU) corresponds to an erasable data unit. NVME is a communication interface between the host and non-volatile memory, commonly used for communication between the host and SSD. The host can be a central processing unit, such as the CPU in a server. In non-FDP (Folded Deleted) mode, which RU is used as the destination physical location for newly written data is entirely determined by the File Transfer Layer (FTL) in the firmware. In FDP mode, this decision is partially delegated to the user. Each time a write command is sent, the user can specify a destination RU using a Reclaim Unit Handle (RUH) assigned to the user by the firmware during initialization. Both the user and the FTL have the authority to assign any RUH to a new empty RU when appropriate, allowing older RUs to be garbage collected.

[0021] In the configuration options provided to users by the firmware, each RUH is assigned an isolation attribute, which can be set by the firmware to one of the following two states: First, Initially Isolated: Before the first RUH switchover, all data stored in the RU pointed to by the RUH originates from write commands from users whose destination is that RUH. However, once the RUH is switched over, the new RU no longer needs to guarantee that all data stored therein originates from the original RUH.

[0022] Second, Persistently Isolated: In addition to meeting the initial isolation requirements, even if a RUH switch occurs, the new RU must still ensure that all data stored therein originates from write commands destined for that RUH. That is, the FTL garbage collection system is never allowed to move write data destined for other RUHs to the RU pointed to by that RUH.

[0023] In addition, all RUs are divided into different Reclaim Unit Groups (RGs). Each RG needs to maintain an independent list of RUHs. In each write command, the user must specify not only the RUH but also which RG to write to. During garbage collection, FTL does not allow data to be moved across RGs. In summary, the firmware ensures that no data movement operations other than the user's write commands occur between different RGs and between different Persistently Isolated Reclaim Unit Handles (PIRUHs). In other words, if the user writes all valid data to a specific RG without overwriting, i.e., no garbage data is generated in that RG, then no additional write operations will occur within that RG, achieving 100% write efficiency.

[0024] Embodiments of this application provide a method for storing matrix blocks, which can be executed by a storage device, such as... Figure 2 As shown, the specific processing steps of the matrix block storage method may include: Step S201: Obtain the number of non-zero sub-matrix blocks corresponding to the multiple candidate reclamation unit groups included in the storage device.

[0025] The storage medium of the storage device can be configured with multiple reclamation unit groups, and multiple candidate reclamation unit groups can be configured within these reclamation unit groups specifically for storing non-zero submatrix blocks.

[0026] Specifically, since a target matrix block can include non-zero sub-matrix blocks and zero sub-matrix blocks (where all matrix elements are zero and non-zero sub-matrix blocks contain non-zero matrix elements), to reduce storage space usage during the storage of the target matrix block, only non-zero sub-matrix blocks can be stored. Accordingly, the storage device can set the number of sub-matrix blocks that can be stored for each candidate reclamation unit group.

[0027] For example, in Electronic Design Automation (EDA) software systems, circuit simulation often involves dealing with a type of matrix block. This type of matrix block exhibits a two-level structure: the outer layer displays sparse matrix characteristics, while the inner layer displays dense matrix characteristics. The target matrix block processed in this solution is this type of matrix block. The sparse matrix characteristic means that most of the sub-matrix blocks that construct this type of matrix block are zero sub-matrix blocks, while a small portion are non-zero sub-matrix blocks, and the positions of the non-zero sub-matrix blocks within the matrix block remain unchanged. The dense matrix characteristic means that non-zero sub-matrix blocks contain almost no zero matrix elements, and even if they do, the position of the zero matrix element within its corresponding non-zero sub-matrix block is not fixed.

[0028] The dimensions of the sub-matrix blocks included in the target matrix block described above can be the same or different. For example... Figure 3 As shown, the numbers on the left represent the ordinate, the numbers at the top represent the abscissa, the numbers on the right represent the number of rows in the submatrix block, and the numbers at the bottom represent the number of columns in the submatrix block. Diagonal boxes represent non-zero submatrix blocks, and white boxes represent zero submatrix blocks. A 5×5 submatrix contains only 8 non-zero submatrix blocks.

[0029] Step S202: Obtain the overwrite frequency corresponding to at least one non-zero sub-matrix block.

[0030] Specifically, since the data in different non-zero sub-blocks is rewritten at different frequencies, but the rewriting frequency of the same sub-block remains essentially constant throughout its lifetime, the storage device can pre-calculate the rewrite frequency for each non-zero sub-block and record it in the cache or firmware. When deciding to store a non-zero sub-block in flash memory, the rewrite frequency for each non-zero sub-block is then directly retrieved for subsequent storage operations.

[0031] Step S203: Sort each non-zero sub-matrix block in the at least one non-zero sub-matrix block according to the overwrite frequency corresponding to each non-zero sub-matrix block, and obtain the overwrite frequency sorting value of each non-zero sub-matrix block.

[0032] Specifically, the storage device can sort each non-zero sub-matrix block in at least one non-zero sub-matrix block according to the overwrite frequency corresponding to each non-zero sub-matrix block, from largest to smallest or smallest to largest, to obtain the overwrite frequency sorting value of each non-zero sub-matrix block.

[0033] For example, storage devices can be sorted according to their overwrite frequency in ascending order to obtain a permutation array s = (s i i=0, ...,n b -1), n b s is the number of non-zero submatrix blocks. i Denotes a non-zero submatrix block whose overwrite frequency sort value is i, where, f represents the overwrite frequency.

[0034] Step S204: Based on the overwrite frequency sorting value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to the multiple candidate recycling unit groups, determine the target candidate recycling unit group corresponding to the target non-zero sub-matrix block from the multiple candidate recycling unit groups.

[0035] The target non-zero sub-matrix block is any non-zero sub-matrix block among at least one non-zero sub-matrix block.

[0036] Specifically, taking a target non-zero sub-matrix block as an example, the storage device can allocate a candidate reclamation unit group to the target non-zero sub-matrix block based on its overwrite frequency ranking value and the number of non-zero sub-matrix blocks corresponding to the multiple candidate reclamation unit groups. For each non-zero sub-matrix block, the candidate reclamation unit group can be determined in a similar manner.

[0037] For example, if the number of non-zero sub-matrix blocks in candidate reclamation unit group 0 is 2, the number of non-zero sub-matrix blocks in candidate reclamation unit group 1 is 2, and the number of non-zero sub-matrix blocks in candidate reclamation unit group 2 is 1, the storage device can write the overwrite frequency sorting values ​​of 0 and 1 into candidate reclamation unit group 0, write the non-zero sub-matrix blocks with overwrite frequency sorting values ​​of 2 and 3 into candidate reclamation unit group 1, and then write the non-zero sub-matrix block with overwrite frequency sorting value of 4 into candidate reclamation unit group 2.

[0038] Step S205: Store the target non-zero sub-matrix block into the target candidate recycling unit group.

[0039] Specifically, the storage device can store each non-zero submatrix block separately in its corresponding candidate reclamation unit group. Taking the target non-zero submatrix block as an example, the storage device can store the target non-zero submatrix block in the target candidate reclamation unit group.

[0040] The matrix block storage method of this application first obtains the number of non-zero sub-matrix blocks that each candidate reclamation unit group can store and the overwrite frequency of each non-zero sub-matrix block. The overwrite frequency affects the amount of garbage data generated; therefore, based on the overwrite frequency, each non-zero sub-matrix block can be sorted to obtain its overwrite frequency ranking value. For each non-zero sub-matrix block, the candidate reclamation unit group corresponding to each non-zero sub-matrix block can be determined according to its own overwrite frequency ranking value and the number of non-zero sub-matrix blocks in each candidate reclamation unit group, and then the non-zero sub-matrix block is stored in the corresponding candidate reclamation unit group. Under this processing, non-zero sub-matrix blocks with different overwrite frequencies are placed in different candidate reclamation unit groups. Non-zero sub-matrix blocks with higher overwrite frequencies will be reclaimed more frequently, but most of the data in them is data that is about to be overwritten, that is, the proportion of effective data (effective data refers to data that has not been modified by the user but needs to be migrated due to the storage device mechanism) is low. Therefore, garbage data (i.e., the aforementioned effective data) can be reduced.

[0041] In addition, if data with high and low overwrite frequency are stored together, the data with low overwrite frequency will be frequently migrated, which significantly increases write amplification. By separating hot and cold data by overwrite frequency, cold data is stored in candidate reclamation units that are not reclaimed for a long time and hardly participates in data migration, which can significantly reduce write amplification and extend the life of storage devices.

[0042] In some optional implementations, step S201 described above may include the following specific steps: Step 1: Perform a division operation with remainder based on the number of candidate recycling unit groups and the number of non-zero sub-matrix blocks to obtain the quotient and remainder.

[0043] Step 2: If the remainder is determined to be zero, the quotient is determined as the number of non-zero sub-matrix blocks in the multiple candidate recycling unit groups.

[0044] Alternatively, in step three, if the remainder is determined to be non-zero, the quotient is determined as the first quantity, and the second quantity is determined based on the quotient and the first preset value.

[0045] Step four: Based on the remainder, divide the multiple candidate recycling units into a first set and a second set.

[0046] Step 5: Determine the number of non-zero sub-matrix blocks corresponding to the candidate recycling unit groups in the first set as the first quantity, and determine the number of non-zero sub-matrix blocks corresponding to the candidate recycling unit groups in the second set as the second quantity.

[0047] For example, step one can be expressed as follows: n b =(G-1)H+R(1) Where, n b G represents the number of non-zero submatrix blocks, G represents the number of reclaimable unit groups included in the storage device, G-1 represents the number of candidate reclaimable unit groups, H represents the quotient, and R represents the remainder.

[0048] In step four, the storage device may determine the candidate reclamation unit group whose number precedes the remainder as the second set, and the candidate reclamation unit group whose number follows the remainder (including the remainder) as the first set. Alternatively, the storage device may determine the candidate reclamation unit group whose number precedes the remainder as the first set, and the candidate reclamation unit group whose number follows the remainder (including the remainder) as the second set. The former will be used as an example below.

[0049] Accordingly, the number of non-submatrix blocks that each candidate reclamation unit group is responsible for storing can be expressed as: (2) Where i=0, ..., G-2 are the numbers of the candidate recycling unit groups. It can be the number of the candidate recycling unit group in the second set. It can be the number of the candidate reclamation unit group in the first set. The overwrite frequency of the non-zero sub-matrix blocks stored in the candidate reclamation units in the second set is higher than that of the non-zero sub-matrix blocks stored in the candidate reclamation units in the first set.

[0050] In this way, some candidate reclamation unit groups (which can be called the first type of candidate reclamation unit groups) can store non-zero sub-matrix blocks with high overwrite frequency, while some candidate reclamation unit groups (which can be called the second type of candidate reclamation unit groups) can store non-zero sub-matrix blocks with low overwrite frequency, and the number of non-zero sub-matrix blocks stored in these two groups also differs. Since non-zero sub-matrix blocks with high overwrite frequency occupy more storage resources in subsequent overwrite processes, and non-zero sub-matrix blocks with low overwrite frequency occupy less storage resources in subsequent overwrite processes, the number of non-zero sub-matrix blocks stored in the first type of candidate reclamation unit groups is less than the number of non-zero sub-matrix blocks in the second type of candidate reclamation unit groups. This can achieve wear leveling among the candidate reclamation unit groups and improve the overall lifespan of the storage device.

[0051] In some optional implementations, the aforementioned overwrite frequency can be calculated by the storage device during the information collection phase. Accordingly, before step S202, the storage device can perform the following specific steps: Step 1: Obtain the write command.

[0052] Step 2: Based on the first position information, obtain the first data type indicator information corresponding to the first sub-matrix block.

[0053] Step 3: When the first data type indicator is determined to be the first preset indicator, a write failure indicator is generated.

[0054] Alternatively, in step four, after determining that the first data type indication information is not the first preset indication information, based on the first position information and the second position information, determine whether there is a first cached write command in the cached write commands stored in the storage device's cache that matches both the first sub-matrix block and the first matrix element.

[0055] Step 5: Once it is determined that the first cached write command exists in the cache of the storage device, replace the second write value in the first cached write command with the first write value.

[0056] Alternatively, in step six, once it is determined that the first cached write command does not exist in the storage device's cache, the write command is stored in the storage device's cache.

[0057] The write command may include the first position information of the first sub-matrix block within its parent target matrix block, or it may include the second position information of the first matrix element within its parent first sub-matrix block, and the first write value corresponding to the first matrix element. The first sub-matrix block is any one of the multiple sub-matrix blocks included in the target matrix block.

[0058] The first data type indication information can be either a first preset indication information or a second preset indication information. The first preset indication information can be used to indicate that the submatrix block is a zero submatrix block, and the second preset indication information can be used to indicate that the submatrix block is a non-zero submatrix block. The write failure indication information is used to indicate that there is an error in the write command.

[0059] Specifically, since submatrix blocks can be zero submatrix blocks or non-zero submatrix blocks, there are many zero submatrix blocks, but they indicate less information. For submatrix blocks with all zero matrix elements, there will be no change throughout the entire lifecycle of the target matrix block. Therefore, in order to save storage space and improve write operation efficiency, the storage device does not need to perform write operations.

[0060] Accordingly, to achieve this technical objective, the storage device can pre-store the position information of the sub-matrix block within the target matrix block (e.g., Figure 3The write command includes a mapping relationship between the row and column coordinates of the sub-matrix block within the target matrix block and data type indication information. It also includes at least the position information of the sub-matrix block within the target matrix block. Thus, after the storage device receives a write command from the host or a write command generated by the storage controller based on preset rules, it can extract the first position information of the first sub-matrix block within the target matrix block from the write command. Based on this first position information, it can determine the first data type indication information corresponding to the first position information from the aforementioned mapping relationship. The host can be the central processing unit (CPU) of a computer device, which can be a server.

[0061] Furthermore, the storage device can perform operations corresponding to the first data type indication information based on the different first data type indication information, specifically: In step three, when the data type indication information is determined to be the first preset indication information, the storage device can determine that the first sub-matrix block is a zero sub-matrix block, that is, there is actually no write command to modify the first sub-matrix block. This write command is an erroneous write command. At this time, the storage device can directly generate a write failure indication information and return it to the host, indicating that the technician has an error in the write command and that modifying the first matrix element may cause errors in the simulation.

[0062] In step four, when the first data type indication information is determined to be the second preset indication information, the storage device can determine that the first sub-matrix block is a non-zero sub-matrix block. At this time, since there may be a latest write command related to the first sub-matrix block and the first matrix element in the cache, in order to improve the write operation efficiency and reduce the wear and tear on the flash memory, it can first determine whether there is a first cached write command in the storage device's cache that matches both the first sub-matrix block and the first matrix element. If yes, it means that the latest data has not yet been written to the flash memory, and the storage device can directly replace the second write value in the first cached write command with the first write value and update the overwrite frequency corresponding to the first sub-matrix block. If no, the write command can be stored in the storage device's cache first, so that the storage device can subsequently perform the storage operation of storing the first sub-matrix block according to the overwrite frequency of each non-zero sub-matrix block.

[0063] For example, the write command can be (r b c b r i c i ,v). r b and c b The first position information, r, constitutes the first sub-matrix block. b The row number of the first sub-matrix block in the target matrix block (e.g.) Figure 3 (the number on the left), c bThe column number of the first sub-matrix block in the target matrix block (e.g.) Figure 3 (the number on the top), r i and c i The second positional information, r, constitutes the elements of the first matrix. i c is the row number of the first matrix element in the first submatrix block. i is the column number of the first matrix element in the first submatrix block, and v is the first written value.

[0064] In some optional implementations, the write command mentioned above can be a write command obtained during the information collection phase. Accordingly, in step five above, the storage device can also update the overwrite frequency corresponding to the first sub-matrix block. Then, when the storage device detects that the number of cached write commands in the cache is equal to a preset threshold, or when there is no free storage space in the cache, it can obtain the overwrite frequencies of multiple non-zero sub-matrix blocks. Then, the storage device can switch to the collection completion phase and execute steps S202 to S205 above. After all non-zero sub-matrix blocks are stored in the corresponding candidate reclamation units, the storage device can clear the write commands in the cache for subsequent write commands to continue using.

[0065] In some optional implementations, in step S205 above, the storage device may also obtain the starting address of the target non-zero submatrix block in the target candidate reclamation unit group and record it in the cache or firmware of the storage device so that the values ​​of each matrix element in the target non-zero submatrix block can be read from the candidate reclamation unit group during subsequent read operations.

[0066] In some alternative implementations, during the execution of the write command or the writing of non-zero submatrix blocks to candidate reclamation units, the storage device may also need to perform a read operation. Accordingly, the storage device may perform the following specific steps: Step 1: Obtain the read command.

[0067] Step 2: Obtain the size information of each of the multiple sub-matrix blocks included in the target matrix block.

[0068] Step 3: Determine the fourth position information of the second sub-matrix block in the target matrix block based on the size information and third position information corresponding to one or more sub-matrix blocks respectively.

[0069] Step 4: Based on the fourth position information, obtain the second data type indicator information corresponding to the second sub-matrix block.

[0070] Step 5: When the second data type indicator information is determined to be the first preset indicator information, return zero value directly.

[0071] Alternatively, in step six, when it is determined that the second data type indication information is not the first preset indication information, the fifth position information of the second matrix element in the second sub-matrix block is determined based on the third position information and the fourth position information.

[0072] Step 7: Based on the fourth and fifth position information, determine whether there is a second cached write command that matches both the second sub-matrix block and the second matrix element among the cached write commands stored in the storage device's cache.

[0073] Step 8: When it is determined that there is a second cached write command among the cached write commands stored in the storage device's cache, the third write value is read directly from the second cached write command and returned.

[0074] Alternatively, in step nine, when it is determined that there is no second cached write command among the cached write commands stored in the cache of the storage device, the starting address corresponding to the second sub-matrix block is obtained.

[0075] Step 10: Determine the target address of the second matrix element in the storage device based on the starting address corresponding to the second sub-matrix block, the position information of the second sub-matrix block, and the fifth position information.

[0076] Step 11: Based on the target address, read the value corresponding to the second matrix element from the storage area corresponding to the target address in the storage device and return it.

[0077] The read command can include the third position information of the second matrix element within the target matrix block. For example, if the target matrix block includes multiple matrix elements, and the second matrix element is one of them, the third position information can include the row and column numbers of the second matrix element within the target matrix block, which can be represented as (r, c). Matrix elements can be divided into different sub-matrix blocks based on certain rules. Accordingly, the second sub-matrix block is the sub-matrix block to which the second matrix element belongs among multiple sub-matrix blocks.

[0078] The size information of the sub-matrix block can be { , i=0,……,n-1}, where, Indicates the row number of the submatrix block. This represents the number of columns in the submatrix block, where n is the number of submatrix blocks included in the target matrix block. The size information of the submatrix blocks can be stored in the firmware.

[0079] Specifically, when the storage device receives a read command sent by the host or a read command generated by the storage controller based on certain rules, it can extract the third position information of the second matrix element in the target matrix block from the read command.

[0080] Since the second data type indication information mentioned above is set according to the dimension of sub-matrix blocks, in order to improve the efficiency of read operations, after obtaining the read command, it can also be determined whether the sub-matrix block targeted by the read command is a zero matrix block or a non-zero matrix block. Therefore, the storage device can obtain the size information of each sub-matrix block included in the target matrix block, and then, based on the size information and third position information corresponding to multiple sub-matrix blocks respectively, determine the fourth position information of the second sub-matrix block in the target matrix block.

[0081] When the third location information includes the first row number and the first column number, in determining the fourth location information, the storage device can first compare the first row number with the row number of the sub-matrix block in row 0 to determine if the first row number falls within the row number range of the sub-matrix block in row 0. If it does, the second matrix element is located in the sub-matrix block in row 0. If not, the total number of rows can be calculated based on the row number of the sub-matrix block in row 0 and the row number of the sub-matrix block in row 1, and then the first row number can be determined to fall within the total number of rows. If it does, the second matrix element is located in the sub-matrix block in row 1, and so on, to determine the row number of the second sub-matrix block to which the second matrix element belongs. Similarly, the storage device can determine the column number of the second sub-matrix block to which the second matrix element belongs. Thus, the row number and column number of the second sub-matrix block constitute the fourth location information.

[0082] It should be noted that the number of sub-matrix block size information used in the above process is determined by the position of the second sub-matrix block within the target matrix block. For example, for the sub-matrix block at position (0, 0), the size information array { is used as described above. When i = 0, ..., n-1, only the first data is needed. This allows us to determine the fourth position of the second sub-matrix block within the target matrix block. For the sub-matrix block at position (0, 1), we need to use the first data in the array ( ) and the second data ( Determine the fourth position information.

[0083] For example, the third position information could be (2, 7), see reference. Figure 3 In determining the fourth position information, the sub-matrix block in row 0 has 3 rows. Therefore, the storage device can determine that the second matrix element is located in the non-zero sub-matrix block in row 0 based on row number 2. The sub-matrix block in column 0 has 5 columns, the sub-matrix block in column 1 has 5 columns, and the sub-matrix block in column 1 has 3 columns. Therefore, the storage device can determine that the second matrix element is located in the sub-matrix block in column 1 based on column number 7. In summary, the second matrix element is located in the sub-matrix block in row 0 and column 1, which means the fourth position information is determined to be (0, 1).

[0084] Then, the storage device can determine the second data type indication information corresponding to the second sub-matrix block from the above mapping relationship information based on the fourth location information, and perform the operation corresponding to the second data type indication information based on the second data type indication information, specifically: When the storage device determines that the second data type indication information is the first preset indication information, it can determine that the second sub-matrix block is a zero matrix block. Since the values ​​of all matrix elements in the zero matrix block are zero, the storage device does not need to perform a data reading operation and can directly return the zero value to the host or storage controller.

[0085] Alternatively, when the storage device determines that the second data type indication information is the second preset indication information, it can determine that the second sub-matrix block is a non-zero matrix block. In this case, the storage device can determine the fifth position information of the second matrix element in the second sub-matrix block based on the size information and the third position information of the second sub-matrix block.

[0086] Specifically, when the third location information includes the second row number and the second column number, and the fourth location information includes the third row number and the third column number, the storage device can determine whether the second sub-matrix block is the first row sub-matrix block in the target matrix block based on the third row number. If it is, the third row number can be directly determined as the row number of the second matrix element in the second sub-matrix. If not, the total number of rows in the sub-matrix blocks preceding the second sub-matrix block (in terms of row direction) can be calculated, and then the row number of the second matrix element in the second sub-matrix block can be determined based on the total number of rows in the sub-matrix blocks and the third row number. Similarly, the storage device can also determine the column number of the second matrix element in the second sub-matrix block. Thus, the row number and column number of the second matrix element in the second sub-matrix block constitute the fifth location information.

[0087] For example, the third position information is (2, 7), and the fourth position information is (0, 1), for reference. Figure 3 Based on row number 0 in the fourth position information, we can determine that the second sub-matrix block is the first row sub-matrix block in the target matrix block. Therefore, the row number of the second matrix element in the second sub-matrix block is 2. Based on column number 1 in the fourth position information, we can determine that the second sub-matrix block is not the first column sub-matrix block in the target matrix block. The sub-matrix block before column 1 has 5 rows. Subtracting 5 from column number 7 in the third position information gives us the column number. Therefore, the column number of the second matrix element in the second sub-matrix block is 2. Thus, the fifth position information is determined to be (2, 2).

[0088] It should be noted that in the above process, whether or not size information is used, and if size information is used, the number of sub-matrix blocks whose size information is used, is determined by the fourth position information of the second sub-matrix block in the target matrix block (that is, whether the second sub-matrix block is the first row sub-matrix block or the first column sub-matrix block in the target matrix block).

[0089] Similar to the write command operation, the storage device's cache may contain the latest cached write command that matches both the second sub-matrix block and the second matrix element. Therefore, to improve read operation efficiency, the storage device can first determine in the cache whether a second cached write command exists that matches both the second sub-matrix block and the second matrix element, based on the fourth and fifth position information. If so, the third write value can be directly read from the cached write command and returned directly to the host or storage controller. If not, data needs to be read from the storage medium. In this case, the starting address of the second sub-matrix block can be read from the cache or firmware based on the fifth position information of the second sub-matrix block. Based on the starting address corresponding to the second sub-matrix block, the size information of the second sub-matrix block, and the fifth position information, the target address of the second matrix element in the storage device can be determined.

[0090] The storage device can first determine the offset of the second matrix element based on the row number included in the size information of the second sub-matrix block and the row and column numbers in the fifth position information, and then determine the target address by the sum of the starting address and the offset. For example, the storage device can use the following expression: w2=w1+r i u r +c i (3) Where w1 is the target address, w2 is the starting address, and r i u is the row number of the second matrix element in the second submatrix block. r c is the row number of the second submatrix block. i r is the column number of the second matrix element in the target matrix block. i u r + c i The offset mentioned above.

[0091] For example, the size information of the second sub-matrix block is (4, 4), the starting address is 100, the third position information of the second matrix element in the second sub-matrix block is (1, 2), and the target address can be determined by expression (3) as 106. The value of the second matrix element can be read directly from the logical address 106 of the flash memory.

[0092] Finally, based on the target address, the storage device reads the value corresponding to the second matrix element from the storage area corresponding to the target address in the candidate reclamation unit where the second sub-matrix block is located, and returns it to the host or storage controller.

[0093] In some alternative implementations, the storage device may perform the following specific steps each time it is powered on: Step 1: Read the first and second arrays from the target recycling unit group of the storage device.

[0094] Step 2: Initialize the data type indicator information of each submatrix block to the first preset indicator information.

[0095] Step 3: Based on the sorting value of the first non-zero sub-matrix block in each row of the target matrix block among all non-zero sub-matrix blocks and the ordinate of each non-zero sub-matrix block in the target matrix block, update the data type indication information of each non-zero sub-matrix block to the second preset indication information.

[0096] The first array includes the sorting value of the first non-zero sub-matrix block in each row of the target matrix block among all non-zero sub-matrix blocks, and the number of non-zero sub-matrix blocks included in the target matrix block. The vertical axis can be the column number.

[0097] Specifically, among the multiple reclaimable unit groups included in the storage device, a dedicated target reclaimable unit group can be set up to store the first array and the second array. Accordingly, upon each power-on, the storage device can extract the first array and the second array from the target reclaimable unit group and determine the data type indication information for each non-zero submatrix block based on the first array and the second array.

[0098] For example, the first array could be p = {0, 2, 3, 4, 6, 8}, and the second array could be l = {1, 4, 3, 0, 1, 3, 2, 4}. The storage device can be initialized with m(i, j) = -1 for any row and column number.

[0099] For row 1, based on the positional order value of 0 (first non-zero submatrix block in row 0) and 2 (first non-zero submatrix block in row 1), subtracting 0 from 2 determines that row 0 contains two non-zero submatrix blocks. Then, extracting the first two values ​​from the second array as the ordinate and 0 as the abscissa, we can determine (0, 1) and (0, 4). The storage device can then set m(0, 1) to 0 and m(0, 4) to 1. Similarly, the storage device can determine that row 1 contains one non-zero matrix block, (1, 3), and set m(1, 3) to 2. The storage device can determine that row 2 contains one non-zero matrix block, (2, 0), and set m(2, 0) to 3. The storage device can determine that row 3 contains two non-zero matrix blocks, (3, 1) and (3, 3), and set m(3, 1) to 4 and m(3, 3) to 5. The storage device can determine that the fourth row includes two non-zero matrix blocks (8-6), namely (4,2) and (4,4), based on the number of non-zero submatrix blocks (8) and the x-coordinate of the first non-zero submatrix block in the fourth row (6). The storage device can set m(4,2) to 6 and m(4,4) to 7.

[0100] Under this processing, the aforementioned "-1" can be used to indicate the first preset indication information, and each number from "0 to 7" can be used to indicate the second preset indication information.

[0101] Thus, if each non-zero submatrix block stores a data type indicator, a large number of non-zero submatrix blocks would require a significant amount of storage space. Therefore, by storing the first array and the second array, compressed storage can be achieved. After power-on, the data type indicator information can be recovered, which can greatly save storage space.

[0102] In some alternative implementations, the size information of each submatrix block and the starting address of each non-zero submatrix block in the storage device may also be stored in the target recycling unit group.

[0103] In some alternative implementations, the first array and the second array described above may be determined through the following specific steps: Step 1: Identify at least one non-zero sub-matrix block among the multiple sub-matrix blocks included in the target matrix block, and obtain the position information of the at least one non-zero sub-matrix block in the target matrix block.

[0104] Step 2: Sort each non-zero sub-matrix block according to its position information in the target matrix block to obtain the position sorting value of each non-zero sub-matrix block.

[0105] Step 3: Generate the first array based on the position information of each non-zero sub-matrix block in the target matrix block and the sorting value of each non-zero sub-matrix block.

[0106] Step 4: Generate a second array based on the position information of each non-zero sub-matrix block in the target matrix block.

[0107] Specifically, the storage device can first identify whether each sub-matrix block in the target matrix block is a zero sub-matrix block or a non-zero sub-matrix block. If it is the latter, the storage device can further determine the position information of the non-zero sub-matrix blocks in the target matrix block. Then, the storage device can sort each non-zero sub-matrix block according to its position information in the target matrix block, obtaining the position sorting value of each non-zero sub-matrix block. Finally, based on the position information of each non-zero sub-matrix block in the target matrix block and the sorting value of each non-zero sub-matrix block, a first array is generated.

[0108] For example, in Figure 3 In the target matrix block, the identified non-zero sub-matrix blocks are located at positions (0, 1), (0, 4), (1, 3), (2, 0), (3, 1), (3, 3), (4, 2), and (4, 4). Their positional order from front to back is 0, 1, 2, 3, 4, 5, 6, and 7. The first non-zero sub-matrix block in row 0 of the target matrix block has a positional order of 0, the first non-zero sub-matrix block in row 1 has a positional order of 2, the first non-zero sub-matrix block in row 2 has a positional order of 3, the first non-zero sub-matrix block in row 3 has a positional order of 4, and the first non-zero sub-matrix block in row 4 has a positional order of 6. Therefore, the storage device can generate a first array based on the positional order of the first non-zero sub-matrix block in each row and the number of non-zero sub-matrix blocks. The first array can be p = {0, 2, 3, 4, 6, 8}. The storage device generates a second array based on the ordinate of the position information of each non-zero submatrix block, for example, l={1, 4, 3, 0, 1, 3, 2, 4}.

[0109] like Figure 4 As shown, i h i is the number of the recycling unit group. h =G-1's reclamation unit group (i.e., the candidate reclamation unit group mentioned above) can be used to store the outer sparse structure of the target matrix block, namely the first array and the second array mentioned above, where the first array can be represented as p={p i i=0, ...,n r -1}, the second array can be represented as l={l i i=0, ...,n b-1}, the storage device can use firmware to write received write commands into the cache, that is Figure 4 Command 0 in and Command 1 Each sub-matrix block (i.e., the sub-block data in the diagram) can be stored in the corresponding candidate reclamation unit group according to the overwrite frequency from low to high, that is, numbered i. h =0……G-2 candidate recycling unit group.

[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0111] Embodiments of this application also provide a storage device for matrix blocks, such as... Figure 5 As shown, it includes: The acquisition module 510 is used to acquire the number of non-zero sub-matrix blocks corresponding to the multiple candidate reclamation unit groups included in the storage device; and to acquire the overwrite frequency corresponding to at least one non-zero sub-matrix block. The sorting module 520 is used to sort each non-zero sub-matrix block in at least one non-zero sub-matrix block according to the overwrite frequency corresponding to each non-zero sub-matrix block, so as to obtain the overwrite frequency sorting value of each non-zero sub-matrix block. The determining module 530 is used to determine the target candidate recycling unit group corresponding to the target non-zero matrix block from multiple candidate recycling unit groups based on the overwrite frequency sorting value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to the multiple candidate recycling unit groups respectively, wherein the target non-zero sub-matrix block is any one of at least one non-zero sub-matrix block. Storage module 540 is used to store the target non-zero submatrix block into the target candidate recycling unit group.

[0112] In some alternative implementations, the acquisition module 510 is further configured to: Obtain the write command, wherein the write command includes the first position information of the first sub-matrix block in its belonging target matrix block; Based on the first position information, obtain the first data type indication information corresponding to the first sub-matrix block; When the first data type indicator is determined to be the first preset indicator, a write failure indicator is generated. The first preset indicator is used to indicate that the submatrix block is a zero matrix block, and the write failure indicator is used to indicate that there is an error in the write command.

[0113] In some optional implementations, the write command further includes second position information of the first matrix element within its respective first sub-matrix block, and a first write value corresponding to the first matrix element; the acquisition module 510 is also used for: After determining that the first data type indication information is not the first preset indication information, based on the first position information and the second position information, it is determined whether there is a first cached write command in the cached write command stored in the cache of the storage device that matches both the first sub-matrix block and the first matrix element; Once it is determined that a first cached write command exists in the cache of the storage device, the second write value in the first cached write command is replaced with the first write value; or, Once it is determined that the first cached write command does not exist in the storage device's cache, the write command is stored in the storage device's cache.

[0114] In some alternative implementations, the acquisition module 510 is further configured to: Obtain the read command, which includes the third position information of the second matrix element in the target matrix block; Obtain the size information of each of the multiple sub-matrix blocks included in the target matrix block; Based on the size information and third position information corresponding to one or more sub-matrix blocks respectively, determine the fourth position information of the second sub-matrix block in the target matrix block, wherein the second sub-matrix block is the sub-matrix block to which the second matrix element belongs among multiple sub-matrix blocks; Based on the fourth position information, obtain the second data type indication information corresponding to the second sub-matrix block; When the second data type indicator is determined to be the first preset indicator, a zero value is returned directly.

[0115] In some alternative implementations, the acquisition module 510 is further configured to: When it is determined that the second data type indication information is not the first preset indication information, the fifth position information of the second matrix element in the second sub-matrix block is determined according to the third position information and the fourth position information; Based on the fourth and fifth position information, determine whether there is a second cached write command that matches both the second sub-matrix block and the second matrix element among the cached write commands stored in the cache of the storage device; When it is determined that a second cached write command exists among the cached write commands stored in the storage device's cache, the third write value is read directly from the second cached write command and returned.

[0116] In some alternative implementations, the acquisition module 510 is further configured to: When it is determined that there is no second cached write command among the cached write commands stored in the cache of the storage device, obtain the starting address corresponding to the second sub-matrix block; Based on the starting address corresponding to the second sub-matrix block, the size information of the second sub-matrix block, and the fifth position information, determine the target address of the second matrix element in the storage device; Based on the target address, read the value corresponding to the second matrix element from the storage area corresponding to the target address in the storage device and return it.

[0117] In some alternative implementations, the acquisition module 510 is further configured to: After the storage device is powered on, a first array and a second array are read from the target reclamation unit group of the storage device. The first array includes the position sorting value of the first non-zero sub-matrix block in each row of the target matrix block among all non-zero sub-matrix blocks and the number of non-zero matrix blocks included in the target matrix block. The second array includes the y-coordinate of each non-zero matrix block in the target matrix block. Initialize the data type indicator information of each sub-matrix block to the first preset indicator information; Based on the sorting value of the first non-zero sub-matrix block in each row of the target matrix block among all non-zero sub-matrix blocks and the ordinate of each non-zero sub-matrix block in the target matrix block, the data type indication information for each non-zero sub-matrix block is updated to the second preset indication information, wherein the second preset indication information is used to indicate that the sub-matrix block is a non-zero sub-matrix block.

[0118] For a description of the features in the embodiment corresponding to the storage device of the matrix block, please refer to the relevant description in the embodiment corresponding to the storage method of the matrix block, which will not be repeated here.

[0119] Embodiments of this application also provide an electronic device, such as... Figure 6 As shown, the device includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above-described embodiments of the matrix block storage method. The electronic device may be the aforementioned storage device or storage controller.

[0120] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described matrix block storage method embodiments when running.

[0121] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0122] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described matrix block storage method embodiments.

[0123] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described matrix block storage method embodiments.

[0124] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0125] The foregoing has provided a detailed description of a matrix block storage method, apparatus, electronic device, storage medium, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A storage method of a matrix block, characterized by, The method comprises the following steps: obtaining the number of non-zero sub-matrix blocks corresponding to each of a plurality of candidate recycling unit groups included in a storage device; obtaining the overwrite frequency corresponding to each of at least one non-zero sub-matrix block; sorting each of the at least one non-zero sub-matrix block according to the overwrite frequency corresponding to the non-zero sub-matrix block to obtain an overwrite frequency sorting value of the non-zero sub-matrix block; determining a target candidate recycling unit group corresponding to a target non-zero sub-matrix block from the plurality of candidate recycling unit groups according to the overwrite frequency sorting value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to each of the plurality of candidate recycling unit groups, wherein the target non-zero sub-matrix block is any one of the at least one non-zero sub-matrix block; storing the target non-zero sub-matrix block into the target candidate recycling unit group.

2. The storage method of the matrix block according to claim 1, characterized in that, Before the step of obtaining the overwrite frequency corresponding to each of the at least one non-zero sub-matrix block, the method further comprises: obtaining a write command, wherein the write command comprises first position information of a first sub-matrix block in a target matrix block to which the first sub-matrix block belongs; obtaining first data type indication information corresponding to the first sub-matrix block according to the first position information; generating write failure indication information when it is determined that the first data type indication information is first preset indication information, wherein the first preset indication information is used to indicate that the sub-matrix block is a zero matrix block, and the write failure indication information is used to indicate that the write command has an error.

3. The method of claim 2, wherein, The write command further comprises second position information of a first matrix element in the first sub-matrix block to which the first matrix element belongs, and a first write value corresponding to the first matrix element; the method further comprises: when it is determined that the first data type indication information is not the first preset indication information, determining whether there is a first cached write command matching the first sub-matrix block and the first matrix element in cached write commands stored in the cache of the storage device according to the first position information and the second position information; when it is determined that there is the first cached write command in the cache of the storage device, replacing a second write value in the first cached write command with the first write value; or, when it is determined that there is no first cached write command in the cache of the storage device, storing the write command into the cache of the storage device.

4. The storage method of the matrix block according to claim 2 or 3, characterized by, The method further comprises: obtaining a read command, wherein the read command comprises third position information of a second matrix element in the target matrix block; obtaining size information corresponding to each of a plurality of sub-matrix blocks included in the target matrix block; determining fourth position information of a second sub-matrix block in the target matrix block according to the size information corresponding to each of one or more sub-matrix blocks and the third position information, wherein the second sub-matrix block is a sub-matrix block to which the second matrix element belongs in the plurality of sub-matrix blocks; obtaining second data type indication information corresponding to the second sub-matrix block according to the fourth position information; directly returning a zero value when it is determined that the second data type indication information is the first preset indication information.

5. The storage method of the matrix block according to claim 4, characterized in that, The method further comprises: determining fifth position information of the second matrix element in the second sub-matrix block according to the third position information and the fourth position information when it is determined that the second data type indication information is not the first preset indication information; determining whether there is a second cached write command matching both the second sub-matrix block and the second matrix element in the cached write commands stored in the cache of the storage device according to the fourth position information and the fifth position information; reading a third write value directly from the second cached write command and returning when it is determined that the second cached write command exists in the cached write commands stored in the cache of the storage device.

6. The storage method of the matrix block according to claim 5, wherein, The method further comprises: obtaining a starting address corresponding to the second sub-matrix block when it is determined that the second cached write command does not exist in the cached write commands stored in the cache of the storage device; determining a target address of the second matrix element in the storage device according to the starting address corresponding to the second sub-matrix block, the size information of the second sub-matrix block and the fifth position information; reading a value corresponding to the second matrix element from a storage area corresponding to the target address in the storage device according to the target address and returning.

7. The method of claim 4, wherein, The method further comprises: reading a first array and a second array from a target recycling unit group of the storage device after the storage device is powered on, wherein the first array includes position ordering values of a first non-zero sub-matrix block of each row in the target matrix block in all non-zero sub-matrix blocks and a number of non-zero sub-matrix blocks included in the target matrix block, and the second array includes a vertical coordinate of each non-zero sub-matrix block in the target matrix block; initializing data type indication information of each sub-matrix block to the first preset indication information; updating the data type indication information of each non-zero sub-matrix block to a second preset indication information according to the ordering values of the first non-zero sub-matrix block of each row in the target matrix block in all non-zero sub-matrix blocks and the vertical coordinate of each non-zero sub-matrix block in the target matrix block, wherein the second preset indication information is used to indicate that the sub-matrix block is a non-zero sub-matrix block.

8. A memory device of a matrix block, characterized by, comprise: an obtaining module, configured to obtain a number of non-zero sub-matrix blocks corresponding to a plurality of candidate recycling unit groups respectively included in a storage device; obtain an overwrite frequency corresponding to at least one non-zero sub-matrix block respectively; an ordering module, configured to order each non-zero sub-matrix block in at least one non-zero sub-matrix block according to the overwrite frequency corresponding to at least one non-zero sub-matrix block respectively, to obtain an overwrite frequency ordering value of each non-zero sub-matrix block; a determining module, configured to determine a target candidate recycling unit group corresponding to a target non-zero sub-matrix block from the plurality of candidate recycling unit groups according to the overwrite frequency ordering value of the target non-zero sub-matrix block and the number of non-zero sub-matrix blocks corresponding to the plurality of candidate recycling unit groups respectively, wherein the target non-zero sub-matrix block is any one of the at least one non-zero sub-matrix block. A storage module is configured to store the target non-zero sub-matrix block into the target candidate recycling unit group.

9. An electronic device, comprising: The application further provides a computer readable storage medium having stored therein a computer program, wherein the computer program is configured to implement the steps of the matrix block storage method according to any one of claims 1 to 7 when executed by a processor. The application further provides a computer readable storage medium having stored therein a computer program, wherein the computer program is configured to implement the steps of the matrix block storage method according to any one of claims 1 to 7 when executed by a processor. The application further provides a computer readable storage medium having stored therein a computer program, wherein the computer program is configured to implement the steps of the matrix block storage method according to any one of claims 1 to 7 when executed by a processor.

10. A computer-readable storage medium, characterized in that, ​