NVme memory recovery method and device, equipment and storage medium

By generating masks and processing index pointers in segments, the problems of out-of-order and low bandwidth utilization in NVMe memory recycling are solved, and more efficient resource management and bandwidth utilization are achieved, ensuring the sequential execution of tasks and the safe release of resources.

CN120407436APending Publication Date: 2025-08-01SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510584808.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the NVMe memory recycling management process, there are problems such as out of order and low bandwidth utilization, resulting in insufficient robust and efficient resource management.

Method used

By generating the mask of the target index pointer, the recyclable index pointer segment is read in segments based on the preset mask analysis order, and stored in the pointer access queue, and the operations are read and cleared in sequence to recycle it to the target index pool, using mask information to improve bandwidth utilization and reduce the number of times AXI write data is initiated.

Benefits of technology

It improves the robustness and bandwidth utilization of the NVMe memory recovery system, prevents long-term occupation of bus resources, and ensures the safe release of resources and efficient execution of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407436A_ABST
    Figure CN120407436A_ABST
Patent Text Reader

Abstract

The invention discloses an NVme memory recovery method, device and equipment and a storage medium, and relates to the technical field of resource management.The method comprises the steps that a target index pointer of an NVme memory recovery task is read, and a target mask corresponding to the target index pointer is generated; sequentially analyzing the target masks based on a preset mask analysis sequence so as to read recyclable index pointer segments from the target index pointer in a segmented manner, and storing pointer information of the recyclable index pointer segments into a pointer access queue based on the preset mask analysis sequence; based on the access sequence of the pointer access queue and the pointer information, sequentially reading the recyclable index pointer segments, and based on the memory pool numbers corresponding to the recyclable index pointer segments, determining a target index pool corresponding to the recyclable index pointer segments; and performing zero clearing operation on pointer data of the recyclable index pointer segment to obtain a to-be-recycled index pointer, and recycling the to-be-recycled index pointer to the target index pool. Therefore, the robustness, the universality and the bus utilization rate of the resource recovery system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource management, and particularly to an NVme memory recycling method, device, equipment and storage medium. Background Art

[0002] The memory resource pool of NVMe (Non-volatile memory express, that is, the non-volatile memory host controller interface specification) can often be divided into DDR (Double Data Rate, dynamic random access memory) and on-chip storage (such as the flash memory inside NVMe SSD), etc. In actual use, there are often multiple different storage media, and NVMe will uniformly manage them in the form of prp-list. However, the distances of these different storage media from the transaction initiator may be different, and the data processing speeds are also different. After the initiator initiates an AXI (Advanced eXtensible Interface, a bus protocol) write request, the order in which the request reaches the slave cannot be guaranteed, resulting in a large difference in access latency for different targets. When the Master accesses the Slave, it can send the next operation without waiting for the previous operation to complete, so that the Slave can be pipelined in the control flow processing, improving the transmission speed, which is called outstanding. At the same time, the Master may need to access different Slave addresses. Since the response times of the Slave for different addresses may be different, the data or responses returned to the Master may also be in sequence, not necessarily in the order in which the Master issues the control. This phenomenon is out-of-order operation. This will result in different return times of the done signal when AXI write operations are initiated successively for different targets, resulting in an out-of-order result. In addition, during the process of NVMe memory recycling management, the hardware needs to continuously initiate AXI operations to update the prp-list. Long-term and frequent AXI operations often occupy a large bandwidth and have low utilization.

[0003] It can be seen that how to avoid out-of-order phenomena and improve bandwidth utilization during memory recycling is a problem that those skilled in the art need to solve. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide an NVme memory recycling method, device, equipment and storage medium, which can improve the robustness, generality and bus utilization rate of the resource recycling system. The specific solutions are as follows:

[0005] In a first aspect, the present application discloses an NVme memory recycling method, including:

[0006] Read the target index pointer of the NVme memory recycling task and generate a target mask corresponding to the target index pointer;

[0007] Analyze the target mask sequentially based on a preset mask analysis order to segmentally read the recyclable index pointer segments from the target index pointer, and store the pointer information of the recyclable index pointer segments into a pointer access queue based on the preset mask analysis order;

[0008] Read the recyclable index pointer segments sequentially based on the access order and pointer information of the pointer access queue, and determine the target index pool corresponding to the recyclable index pointer segments based on the memory pool number corresponding to the recyclable index pointer segments;

[0009] Clear the pointer data of the recyclable index pointer segments to obtain the index pointers to be recycled, and recycle the index pointers to be recycled to the target index pool.

[0010] Optionally, reading the target index pointer of the NVme memory recycling task and generating a target mask corresponding to the target index pointer includes:

[0011] Obtain the NVme memory recycling task, and perform task parsing on the NVme memory recycling task to determine the storage location of the index of the NVme memory recycling task;

[0012] If the storage location of the index is in a preset memory pool, access the preset memory pool to read the corresponding discrete index pointer of the NVme memory recycling task to obtain the target index pointer;

[0013] Perform data validity verification on the discrete index pointer; the data validity verification includes cyclic redundancy check and data legality check;

[0014] If the discrete index pointer passes the data validity verification, generate a target mask corresponding to the discrete index pointer based on the verification result of the data validity verification.

[0015] Optionally, clearing the pointer data of the recyclable index pointer segments to obtain the index pointers to be recycled and recycling the index pointers to be recycled to the target index pool includes:

[0016] Determine the number of calls of the first preset bus protocol based on the pointer information, and clear the pointer data of the recyclable index pointer segments to obtain the index pointers to be recycled;

[0017] Call the first preset bus protocol based on the number of calls and the memory pool number to recycle the index pointers to be recycled to the target index pool.

[0018] Optionally, read the target index pointer of the NVme memory recycling task and generate a target mask corresponding to the target index pointer, including:

[0019] Obtain the NVme memory recycling task, and perform task parsing on the NVme memory recycling task to determine the storage location of the index of the NVme memory recycling task;

[0020] If the storage location of the index is in the physical area page list, access the preset memory pool to read the corresponding target physical area page list of the NVme memory recycling task;

[0021] Read a target number of index pointers from the target physical area page list to obtain the target index pointer, and perform data validity verification on the target index pointer; the target number of index pointers are consecutive pointers; the data validity verification includes cyclic redundancy check and data legality check;

[0022] If the target index pointer passes the data validity verification, generate a target mask corresponding to the target index pointer based on the verification result of the data validity verification.

[0023] Optionally, after sequentially reading the recyclable index pointer segments based on the access order and pointer information of the pointer access queue, and determining the target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment, further include:

[0024] Send the pointer information of the recyclable index pointer segment and the task number corresponding to the NVme memory recycling task to the team information cache queue corresponding to the target index pool; the team information cache queue stores the task numbers of different NVme memory recycling tasks and the corresponding pointer information; the queue depth of the team information cache queue is determined based on the number of different NVme memory recycling tasks.

[0025] Optionally, perform a zeroing operation on the pointer data of the recyclable index pointer segment to obtain a recyclable index pointer, and recycle the recyclable index pointer to the target index pool, including:

[0026] Determine the number of calls of the second preset bus protocol based on the pointer information, and set the value of the preset counter to the current value based on the number of calls; the value of the number of calls is equal to the current value;

[0027] Initiate a pointer recycling request to the target index pool based on the memory pool number;

[0028] Determine the currently to-be-processed index pointer from the recyclable index pointer segment, and perform a zeroing operation on the pointer data of the currently to-be-processed index pointer to obtain a recyclable index pointer;

[0029] Send a call request to the second preset bus protocol based on the pointer recycling request, and use the call request to recycle the index pointer to be recycled to the target index pool;

[0030] Obtain the corresponding completion instruction generated by the target index pool after obtaining the index pointer to be recycled, and modify the value of the preset counter based on the completion instruction; The modification operation is to subtract the value 1 from the current value to obtain a new current value;

[0031] Determine whether the current value of the preset counter is 0;

[0032] If the current value of the preset counter is not 0, jump to the step of determining the current index pointer to be processed from the recyclable index pointer segment and clearing the pointer data of the current index pointer to be processed to obtain the index pointer to be recycled;

[0033] If the current value of the preset counter is 0, complete the recycling operation of the recyclable index pointer segment, so that the memory pool number can recycle the index pointers in other NVme memory recycling tasks or the index pointers in other NVme memory recycling tasks.

[0034] Optionally, analyze the target mask in sequence based on the preset mask analysis order to read the recyclable index pointer segment from the target index pointer in segments, and store the pointer information of the recyclable index pointer segment in the pointer access queue based on the preset mask analysis order, including:

[0035] Traverse the target mask in sequence based on the preset mask analysis order to determine continuous mask data segments from the target mask; The mask value of the continuous mask data segment indicates that the corresponding target index pointer is a recyclable index pointer segment;

[0036] Determine the data length of the continuous mask data segment and the address of the first mask as the pointer information of the recyclable index pointer segment;

[0037] Store the pointer information in the pointer access queue in sequence based on the preset mask analysis order.

[0038] In a second aspect, the present application discloses an NVme memory recycling device, including:

[0039] A mask generation module, configured to read the target index pointer of the NVme memory recycling task and generate a target mask corresponding to the target index pointer;

[0040] An information storage module, configured to analyze the target mask in sequence based on the preset mask analysis order to read the recyclable index pointer segment from the target index pointer in segments, and store the pointer information of the recyclable index pointer segment in the pointer access queue based on the preset mask analysis order;

[0041] An index reading module, configured to sequentially read recyclable index pointer segments based on the access order of the pointer access queue and pointer information, and determine a target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment;

[0042] An index recycling module, configured to clear the pointer data of the recyclable index pointer segment to obtain a recyclable index pointer to be recycled, and recycle the recyclable index pointer to be recycled to the target index pool.

[0043] In a third aspect, the present application discloses an electronic device, including:

[0044] A memory, configured to store a computer program;

[0045] A processor, configured to execute the computer program to implement the foregoing NVme memory recycling method.

[0046] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program, and when the computer program is executed by a processor, the foregoing NVme memory recycling method is implemented.

[0047] It can be seen that in the present invention, the target index pointer of the NVme memory recycling task is read, and a target mask corresponding to the target index pointer is generated; the target mask is sequentially analyzed based on a preset mask analysis order, so as to segmentally read the recyclable index pointer segment from the target index pointer, and store the pointer information of the recyclable index pointer segment into the pointer access queue based on the preset mask analysis order; the recyclable index pointer segment is sequentially read based on the access order and pointer information of the pointer access queue, and the target index pool corresponding to the recyclable index pointer segment is determined based on the memory pool number corresponding to the recyclable index pointer segment; the pointer data of the recyclable index pointer segment is cleared to obtain a recyclable index pointer to be recycled, and the recyclable index pointer to be recycled is recycled to the target index pool.

[0048] It can be seen from the above technical solutions that by using mask information to segmentally determine the recyclable index pointer segment, the present invention can improve the bandwidth utilization rate, reduce the number of AXI write data initiations, and prevent long-term occupation of bus resources. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 It is a schematic diagram of an NVme memory recycling structure disclosed by the present invention;

[0051] Figure 2 Schematic diagram of the composition of a prp_list and free index values disclosed by the present invention;

[0052] Figure 3 Flowchart of an NVme memory recycling method disclosed by the present invention;

[0053] Figure 4 Flowchart for finding a sequence of consecutive 1s in a specific mask analysis disclosed by the present invention;

[0054] Figure 5 Flowchart for finding a sequence of consecutive 1s in a specific mask analysis disclosed by the present invention;

[0055] Figure 6 Schematic diagram of disorder in a specific NVme memory recycling disclosed by the present invention;

[0056] Figure 7 Schematic diagram of a specific NVme memory recycling method disclosed by the present invention;

[0057] Figure 8 Schematic diagram of the structure of an NVme memory recycling device disclosed by the present invention;

[0058] Figure 9 Schematic diagram of the structure of an electronic device disclosed by the present invention. Detailed implementation manners

[0059] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

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

[0061] To enable those skilled in the art of the present technology to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0062] In the NVme memory reclaim operation, when different target AXI write operations are initiated successively, the return time of the done signal is different, resulting in an out-of-order result. In addition, long-term and frequent AXI operations often occupy a large bandwidth and have low utilization. The present invention will specifically introduce an NVme memory reclaim method that can combine the search sequence and how to handle AXI out-of-order, which can effectively improve the robustness of the NVme memory hardware management module, improve the bandwidth utilization rate, reduce the number of AXI write data initiations, and prevent long-term occupation of bus resources.

[0063] First, as Figure 1 shown, in the NVme memory reclaim operation, the resource reclaim management module accesses two resource pools through two AXIGROUP ports respectively. The resource pools can be divided into a memory pool and an index pointer pool according to the type. The memory pool represents the actual physical space stored on the chip and is used to store tasks, prp_list, prp_entry, and discrete index pointers and other contents. The index pointer pool corresponds one-to-one with the physical memory space and is used to store and manage the starting address pointing to a continuous memory space within the physical memory space, that is, the index part in the prp_list free index value mentioned above. After we complete the reclaim management of the prp_list, we need to return the index content to the index pointer pool to provide sustainable resources for subsequent creation of the prp linked list. Here, the present invention assumes that memory pool 0 stores prp_entry information, memory pool 1 is located on the chip storage, and memory pool 2 is located on the DD (a common computer data storage unit) and is often used to store some volatile storage data and power-off data protection resources. The prp_list page is stored in memory pool 1, and the index part in the free index value of each page points to a continuous memory space of 4KB or larger. The memory reclaim management module and the memory pool are all connected to the AXI bus. The memory reclaim management module acts as an AXI Master (i.e., the requester, initiating access), and the memory pool acts as an AXI Slave.

[0064] Based on organizing data in the manner of the NVMe protocol PRP list, the present invention defines the data organization format of PRP_list. Each free index value contains 1 bit of valid data, a memory pool ID (Identity Document, i.e., identification) number (Pool ID), an index pointer pool tag bit (index tag), a memory page pointer, and a CRC (Cyclic Redundancy Check) bit. Among them, the POOL ID represents the memory pool to be pointed to, the index tag represents the index pointer pool corresponding to the index pointer (i.e., which index pointer pool it originally belongs to for management), the bit width of the PO0L ID number indication bit is determined by the number of index pointer pools, and the memory page pointer represents the address offset information in the physical memory space managed by the index pointer pool corresponding to its index tag. Assuming that each page has 256 free index values, the composition of prp_list and free index values is as Figure 2 shown. Among them, it should be noted that the POOL ID is stored in the index value of the next page, that is, it points to which memory pool the next page of prp list is stored in. Since there are many discrete index pointers in the memory pool in addition to prp_list, the recycling of these discrete index pointers is called the discrete mode, and the list mode refers to the recycling of the already constructed prp_list list.

[0065] See Figure 2 shown, an embodiment of the present application discloses an NVme memory recycling method, including:

[0066] Step S11: Read the target index pointer of the NVme memory recycling task and generate a target mask corresponding to the target index pointer.

[0067] In this embodiment, when a task is received, the task will first be parsed and then processed separately according to the discrete mode and the list mode after classification.

[0068] Specifically, when in discrete mode, at this time, the target index pointer of the NVme memory recovery task is read, and a target mask corresponding to the target index pointer is generated, including: obtaining the NVme memory recovery task, and performing task parsing on the NVme memory recovery task to determine the storage location of the index of the NVme memory recovery task; if the storage location of the index is in the preset memory pool, the preset memory pool is accessed to read the corresponding discrete index pointer of the NVme memory recovery task to obtain the target index pointer; the discrete index pointer is subjected to data validity verification; the data validity verification includes a cyclic redundancy check and a data legitimacy check; if the discrete index pointer passes the data validity verification, the target mask corresponding to the discrete index pointer is generated based on the verification result of the data validity verification. Specifically, the NVme memory recovery task will be parsed first, and subsequent processing will be performed according to the discrete mode. It should be noted here that the data validity verification part mainly performs valid verification and CRC verification on the read-back prpentry and discrete memory index pointer. In discrete mode, subsequent operations will be segmented and cleared based on the mask information of the read-back discrete free index pointers. However, if only one index pointer is read, the next read cannot be initiated until the verification and recovery are complete, which will consume a lot of bus resources. Therefore, a burst length of 16 read operations is selected at a time to avoid excessive bus resource utilization and waste of bus resources. After the data is returned, the index pointer is first checked by CRC. Only after passing the CRC check is the valid value checked again and a 16-bit mask is generated. A mask value of 1 indicates that the valid index pointer needs to be recycled.

[0069] Specifically, when in the list mode, the target index pointer is located at prp_list. Read the target index pointer of the NVme memory reclaim task and generate a target mask corresponding to the target index pointer, including: obtaining the NVme memory reclaim task and performing task parsing on the NVme memory reclaim task to determine the storage location of the index of the NVme memory reclaim task; if the storage location of the index is in the physical area page list, access the preset memory pool to read the corresponding target physical area page list of the NVme memory reclaim task; read a target number of index pointers from the target physical area page list to obtain the target index pointer, and perform data validity verification on the target index pointer; the target number of index pointers are consecutive pointers; the data validity verification includes cyclic redundancy check and data legality check; if the target index pointer passes the data validity verification, generate a target mask corresponding to the target index pointer based on the verification result of the data validity verification. Specifically, in the list mode, since the index values in the same prp list may point to many different memory pools, the corresponding memory pool ID number is included in the index values within each list. When reclaiming prp_list, 64 consecutive index pointers are read at one time. After the data is returned, the index pointer is first subjected to a valid check. After passing, the crc value is subjected to a secondary check, and then a 64-bit mask is generated according to the valid and crc check result values. A mask of 1 indicates that the free index pointer needs to be reclaimed, and then a clearing operation on the free index pointers in prp_list is initiated in segments.

[0070] Step S12: Analyze the target mask in sequence based on the preset mask analysis order to segmentally read the recyclable index pointer segments from the target index pointer, and store the pointer information of the recyclable index pointer segments into the pointer access queue based on the preset mask analysis order.

[0071] In this embodiment, as Figure 4 shown, analyze the target mask in sequence based on the preset mask analysis order to segmentally read the recyclable index pointer segments from the target index pointer, and store the pointer information of the recyclable index pointer segments into the pointer access queue based on the preset mask analysis order, including: traverse the target mask in sequence based on the preset mask analysis order to determine continuous mask data segments from the target mask; the mask value of the continuous mask data segment represents that the corresponding target index pointer is a recyclable index pointer segment; determine the data length of the continuous mask data segment and the address of the first mask as the pointer information of the recyclable index pointer segment; store the pointer information into the pointer access queue in sequence based on the preset mask analysis order. Specifically, as Figure 5As shown in the figure, taking the hash mode as an example, assume that the Mask mask value is 000111110110111. It can be seen that there are three consecutive 1s in total, and the AXI write lengths to be initiated are 5, 2, and 3 respectively. Taking this mask value as an example, the solution is described as follows: Each time a sequence of consecutive 1s is found, it is placed in the sequence buffer. Taking the first output result as an example, {3,5} means that it can be recycled from the index pointer represented by Mask[3], and the recycling length is 5. In this way, by finding consecutive 1 sequences to generate the Mask mask, and accordingly segmentally initiating the index pointer return operation (i.e., the AXI write operation). This method not only significantly improves the utilization efficiency of the bandwidth, but also reduces the number of times of initiating AXI write data, further reducing the occupation time of the bus resources, thus significantly improving the overall performance of the system.

[0072] In addition, when extracting the content of consecutive 1s in the mask information, image location technology can be used, that is, converting the data in the mask information into an image, and then according to the border of 1, sequentially identifying the numbers in the mask information to extract the content of consecutive 1s. Using the mask value of 000111110110111, the numbers inside can be converted into a picture. Then, according to the border of 1, from left to right (from right to left), compare them in turn. If the borders of "0" and "1" do not match, skip them; if "1" is the same as "1", adopt it. It can be concluded that there are three consecutive 1s in the above mask.

[0073] Step S13: Sequentially read the recyclable index pointer segments based on the access order and pointer information of the pointer access queue, and determine the target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment.

[0074] In this embodiment, the recyclable index pointer segments are sequentially read based on the access order and pointer information of the pointer access queue, and the memory pool number corresponding to the recyclable index pointer segment is determined from the pointer information, so as to determine the target index pool corresponding to the recyclable index pointer segment according to the memory pool number.

[0075] However, in the actual operation process, such as Figure 6As shown in the figure, in order to improve the utilization rate of the bus bandwidth, all AXI interfaces of functional classes are often integrated into a group. Since the execution process is always an outstanding operation, when the Master accesses the Slave, it can send the next operation without waiting for the previous operation to complete. In this way, the Slave can be pipelined in the processing of the control flow, improving the transmission speed. Therefore, it is assumed that transactions with the same ID issued by the master may also access different slaves. At the same time, the Master may need to access different Slave addresses. Since the response times of the Slave for different addresses may be different, the data or responses returned to the Master may be in a certain order, not necessarily in the order of the control issued by the Master. This phenomenon is called out-of-order operation. There will be no problem of out-of-order return of done in the single-target case, but in the multi-target scenario with outstanding operations, due to this out-of-order situation, it is difficult to identify whether the returned done is for the current task or the next task, or even the next-next task. When each task has multiple access targets, if the counting method is simply used and the AXI write behavior is not managed according to the granularity of the task, it is very easy to have a counting exception problem. Therefore, it is necessary to manage the process of recycling resources according to the granularity of the task. Therefore, for the list mode, in this embodiment, after sequentially reading the recyclable index pointer segment based on the access order and pointer information of the pointer access queue and determining the target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment, it further includes: sending the pointer information of the recyclable index pointer segment and the task number corresponding to the NVme memory recycling task to the team information cache queue corresponding to the target index pool; the team information cache queue stores the task numbers of different NVme memory recycling tasks and the corresponding pointer information; the queue depth of the team information cache queue is determined based on the number of different NVme memory recycling tasks. That is, a team information cache queue is set for each target index pool to store the task numbers of different NVme memory recycling tasks and the corresponding pointer information. In the memory recycling scenario, if there are m target memory pools in the scenario, then m memory pool corresponding task execution sequence cache FIFOs (First Input First Output, that is, first-in-first-out queues) are set. A finish status signal with a bit width of m is set for each NVme memory recycling task, and each bit corresponds to a memory pool. In the list mode, when recycling prp_list, 64 consecutive index pointers are read at one time, and after generating a Mask mask, a segment-by-segment clear operation is performed.And the sequence of consecutive 1s in each 64-bit mask is the corresponding free index pointer that needs to be cleared in actual operations. The number of segments of consecutive 1s in this 64-bit mask represents the number of AXI write operations that need to be initiated next. Cache this number and the task number of the NVme memory recovery task into the team information cache queue.

[0076] Step S14: Clear the pointer data of the recyclable index pointer segment to obtain the to-be-recycled index pointer, and recycle the to-be-recycled index pointer to the target index pool.

[0077] In this embodiment, when the target index pointer is a discrete pointer, clearing the pointer data of the recyclable index pointer segment to obtain the to-be-recycled index pointer and recycling the to-be-recycled index pointer to the target index pool includes: determining the number of calls of the first preset bus protocol based on the pointer information, and clearing the pointer data of the recyclable index pointer segment to obtain the to-be-recycled index pointer; calling the first preset bus protocol based on the number of calls and the memory pool number to recycle the to-be-recycled index pointer to the target index pool. Figure 5 Taking the Mask mask value of 000111110110111 as an example, it can be seen that there are a total of three segments of consecutive 1s, and the lengths of the AXI writes to be initiated are 5, 2, and 3 respectively. When performing the index pointer recycling operation, each time a sequence of consecutive 1s is found, it is placed in the sequence buffer. Taking the first output result as an example, {3,5} means that the index pointer represented by Mask[3] can be recycled, and the recycling length is 5: until the end state position 1, the sequence buffer can be read, and the number of reads is determined according to the number of segments of consecutive 1s in a mask. After calculating the address based on the first 1 coordinate, initiate an AXI write operation with a length of the corresponding value to complete the recycling area pointed to by the corresponding valid recycled index pointer. Therefore, there will be a counter externally. When the corresponding number of reads is completed, it is considered that this 16-bit index pointer has been executed. In this way, it has strong applicability to the memory resource recovery management module that needs to frequently initiate bus requests, and can achieve a lower bus occupancy rate whether in discrete mode or list mode.

[0078] In this embodiment, when the target index pointer is located in the prp_list, the pointer data of the recyclable index pointer segment is cleared to obtain the to-be-recycled index pointer, and the to-be-recycled index pointer is recycled to the target index pool, including: determining the number of calls of the second preset bus protocol based on the pointer information, and setting the value of the preset counter to the current value based on the number of calls; the value of the number of calls is equal to the current value; sending a pointer recycling request to the target index pool based on the memory pool number; determining the current to-be-processed index pointer from the recyclable index pointer segment, and clearing the pointer data of the current to-be-processed index pointer to obtain the to-be-recycled index pointer; sending a call request to the second preset bus protocol based on the pointer recycling request, and recycling the to-be-recycled index pointer to the target index pool by using the call request; obtaining the corresponding completion instruction generated by the target index pool after obtaining the to-be-recycled index pointer, and modifying the value of the preset counter based on the completion instruction; the modification operation is to subtract the value 1 from the current value to obtain a new current value; determining whether the current value of the preset counter is 0; if the current value of the preset counter is not 0, then jump to the step of determining the current to-be-processed index pointer from the recyclable index pointer segment, and clearing the pointer data of the current to-be-processed index pointer to obtain the to-be-recycled index pointer; if the current value of the preset counter is 0, then complete the recycling operation of the recyclable index pointer segment, so that the memory pool number can recycle other index pointers in the NVme memory recycling task or index pointers in other NVme memory recycling tasks. That is, when performing the memory recycling task, when the number of returned ACK (Acknowledge character) is equal to this value, it means that all AXI writes have obtained responses, and next, it only needs to wait for the doe corresponding to the corresponding number to return to determine that this operation is completed. Of course, it is not possible to read back 64 pieces of data every time because the prp_list has a length limit. Suppose there are 65 idle index pointers to be recycled, which means that a read or write with a length of 64 and an AXI read or write with a length of 1 will be initiated. When the length is 1, the non-existent mask mask bit at the back is automatically filled with 0. Take Figure 7 as an example for illustration. Suppose the maximum processing capacity of resource recycling in the memory recycling of the present invention is 4 NVme memory recycling tasks. Then it means that the NVme memory recycling tasks on the bus cannot exceed four. Figure 7 is the order of the target memory pools that tasks 0 to 3 need to access during the execution process. As mentioned before, the number of times of accessing a certain memory pool is determined by the continuous number of 1s in the Mask mask. Each box in the figure represents a batch of AXI write operations parsed from a 64-bit mask, and the number in front represents the number of initiations. Since the destination of reading 64 pieces of data is the same target, each box will only access the same memory pool.

[0079] To prevent the impact caused by out-of-order AXI, each memory pool corresponds to a Task cache queue. Whenever an operation on this memory pool is initiated, the task number of the corresponding NVme memory recovery task and the number of AXI operations to be initiated are generated and cached. The queue depth is determined by the processing capacity of the set NVme memory recovery tasks. Taking the above 4 tasks as an example, the situation of the TASK ID (NVme memory recovery task ID) cache queue of each memory pool during the execution of the four tasks should be as shown in Table 1 below:

[0080] Table 1

[0081]

[0082] By adopting this method, the binding relationship between the NVme memory recovery task and each initiated AXI write can be located, effectively avoiding the situation where the operation of the next NVme memory recovery task affects the execution judgment of the previous task. When the target memory pool returns done, the memory pool Task cache queue is read out, and the number of AXI operations initiated currently is decremented according to the TASK ID. Each time a done is returned, it is decremented by 1. Only when it is decremented to 0 can the next read be initiated, indicating that the number of done corresponding to this memory pool has been waited for. For example, if the NVme memory recovery task 0 initiates 1 read request to the memory pool 0, then the value of the memory pool Task cache queue and the corresponding preset counter is initially set to 1. After initiating 1 read request, the memory pool 0 returns a done. For the NVme memory recovery task 0, when the number of AXI requests initiated in the current task = the number of received done, it means that this operation is completed, then the next data is read out, and 2 read requests are initiated to the memory pool 2. For the memory pool 0, when a done is generated, the value of the preset counter is decremented by 1, and then the value of the preset counter becomes 0. When the value of the preset counter is 0, the memory pool 0 can accept 1 read request initiated by the NVme memory recovery task 1 to the memory pool 0 and continue with the memory recovery operation. It should be noted here that a 4-bit finish status bit is set for each NVme memory recovery task. The default value of the Finish status bit is 0. When the counter is cleared, the finish status bit of the corresponding target memory pool is set to 1. Taking every 64 free index pointers read back and the sequence search as a unit, when all finish status bits are 1 and there are no subsequent AXI write operations to be executed for the current task, it means that the current task is completed.

[0083] That is, by setting a corresponding team information cache queue in each memory pool, and each team information cache queue has two counters for each memory pool. When the number of operations initiated by a task and the number of returned "done" are consistent, the corresponding memory recovery space is released to continue executing the next task. In this way, through the precise task numbering and efficient counting mechanism, not only the sequential execution of tasks is ensured, but also the correct release of resources is ensured, thus completely eliminating the risk of out-of-order AXI writes, and further ensuring the safe release of resources and the efficient and orderly execution of tasks.

[0084] It can be seen that in this embodiment, the target index pointer of the NVme memory recovery task is read and the target mask corresponding to the target index pointer is generated; based on the preset mask analysis order, the target mask is analyzed sequentially to segmentally read the recyclable index pointer segment from the target index pointer, and the pointer information of the recyclable index pointer segment is stored in the pointer access queue based on the preset mask analysis order; based on the access order and pointer information of the pointer access queue, the recyclable index pointer segment is read sequentially, and the target index pool corresponding to the recyclable index pointer segment is determined based on the memory pool number corresponding to the recyclable index pointer segment; the pointer data of the recyclable index pointer segment is cleared to obtain the to-be-recycled index pointer, and the to-be-recycled index pointer is recycled to the target index pool. It can be seen from the above technical solution that in this embodiment, by using the mask information to segmentally determine the recyclable index pointer segment, the bandwidth utilization rate can be improved, the number of AXI write data initiations can be reduced, and the long-term occupation of bus resources can be prevented.

[0085] Reference Figure 8 , this application embodiment also correspondingly discloses an NVme memory recovery device, including:

[0086] A mask generation module 11, configured to read the target index pointer of the NVme memory recovery task and generate a target mask corresponding to the target index pointer;

[0087] An information storage module 12, configured to sequentially analyze the target mask based on the preset mask analysis order to segmentally read the recyclable index pointer segment from the target index pointer, and store the pointer information of the recyclable index pointer segment in the pointer access queue based on the preset mask analysis order;

[0088] An index reading module 13, configured to sequentially read the recyclable index pointer segment based on the access order and pointer information of the pointer access queue, and determine the target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment;

[0089] An index recovery module 14, configured to clear the pointer data of the recyclable index pointer segment to obtain the to-be-recycled index pointer, and recycle the to-be-recycled index pointer to the target index pool.

[0090] It can be seen that in this embodiment, by using mask information to segment and determine the recyclable index pointer segments, the bandwidth utilization rate can be improved, the number of AXI write data initiations can be reduced, and the long-term occupation of bus resources can be prevented.

[0091] Furthermore, an embodiment of the present application also discloses an electronic device. Figure 9 It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation to the scope of use of the present application. This electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store computer programs, and the computer programs are loaded and executed by the processor 21 to implement the relevant steps in the NVme memory recycling method disclosed in any of the foregoing embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0092] In this embodiment, the power supply 23 is used to provide working voltages for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and no specific limitation is made here.

[0093] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, computer programs 222, etc., and the storage method may be temporary storage or permanent storage.

[0094] Among them, the operating system 221 is used to manage and control each hardware device and computer programs 222 on the electronic device, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer programs that can be used to complete the NVme memory recycling method executed by the electronic device disclosed in any of the foregoing embodiments, the computer programs 222 may further include computer programs that can be used to complete other specific tasks.

[0095] Furthermore, the present application also discloses a computer-readable storage medium for storing computer programs; wherein, when the computer programs are executed by a processor, the NVme memory recycling method disclosed above is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0096] Furthermore, the present application also discloses a computer program product, including computer programs / instructions; wherein, when the computer programs / instructions are executed by a processor, the foregoing disclosed alarm aggregation method is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0097] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference may be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple. For related parts, reference may be made to the description in the method section.

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

[0099] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the technical field.

[0100] Finally, it should also be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0101] The above has introduced the technical solution provided by the present application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. An NVme memory recycling method, characterized in that, Including: Read the target index pointer of the NVme memory recycling task and generate a target mask corresponding to the target index pointer; Analyze the target mask in sequence based on a preset mask analysis order, so as to segmentally read the recyclable index pointer segments from the target index pointer, and store the pointer information of the recyclable index pointer segments into a pointer access queue based on the preset mask analysis order; Read the recyclable index pointer segments in sequence based on the access order of the pointer access queue and the pointer information, and determine the target index pool corresponding to the recyclable index pointer segments based on the memory pool number corresponding to the recyclable index pointer segments; Clear the pointer data of the recyclable index pointer segments to obtain a to-be-recycled index pointer, and recycle the to-be-recycled index pointer to the target index pool.

2. The NVme memory recycling method according to claim 1, wherein The reading of the target index pointer of the NVme memory recycling task and generating a target mask corresponding to the target index pointer includes: Obtain the NVme memory recycling task, and perform task parsing on the NVme memory recycling task to determine the storage location of the index of the NVme memory recycling task; If the storage location of the index is in a preset memory pool, access the preset memory pool to read the corresponding discrete index pointer of the NVme memory recycling task to obtain a target index pointer; Perform data validity verification on the discrete index pointer; the data validity verification includes cyclic redundancy check and data legality check; If the discrete index pointer passes the data validity verification, generate a target mask corresponding to the discrete index pointer based on the verification result of the data validity verification.

3. The NVme memory recovery method according to claim 2, wherein The clearing of the pointer data of the recyclable index pointer segments to obtain a to-be-recycled index pointer and recycling the to-be-recycled index pointer to the target index pool includes: Determine the call times of a first preset bus protocol based on the pointer information, and clear the pointer data of the recyclable index pointer segments to obtain a to-be-recycled index pointer; Call the first preset bus protocol based on the call times and the memory pool number to recycle the to-be-recycled index pointer to the target index pool.

4. The NVme memory recycling method according to claim 1, characterized in that The reading of the target index pointer of the NVme memory recycling task and generating a target mask corresponding to the target index pointer includes: Obtain the NVme memory recycling task, and perform task parsing on the NVme memory recycling task to determine the storage location of the index of the NVme memory recycling task; If the storage location of the index is in the physical area page list, access a preset memory pool to read the corresponding target physical area page list of the NVme memory recycling task; Read a target number of index pointers from the target physical area page list to obtain a target index pointer, and perform data validity verification on the target index pointer; the target number of index pointers are consecutive pointers; the data validity verification includes cyclic redundancy check and data legality check; If the target index pointer passes the data validity check, a target mask corresponding to the target index pointer is generated based on the check result of the data validity check.

5. The NVme memory recycling method according to claim 4, wherein After sequentially reading the recyclable index pointer segments based on the access order of the pointer access queue and the pointer information, and determining the target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment, the method further includes: Sending the pointer information of the recyclable index pointer segment and the task number corresponding to the NVme memory recycling task to the team information cache queue corresponding to the target index pool; the team information cache queue stores the task numbers of different NVme memory recycling tasks and the corresponding pointer information; the queue depth of the team information cache queue is determined based on the number of different NVme memory recycling tasks.

6. The NVme memory recycling method according to claim 5, wherein The step of clearing the pointer data of the recyclable index pointer segment to obtain a recyclable index pointer and recycling the recyclable index pointer to the target index pool includes: Determining the number of calls of the second preset bus protocol based on the pointer information, and setting the value of a preset counter to the current value based on the number of calls; the value of the number of calls is equal to the current value; Sending a pointer recycling request to the target index pool based on the memory pool number; Determining a currently to-be-processed index pointer from the recyclable index pointer segment, and clearing the pointer data of the currently to-be-processed index pointer to obtain a recyclable index pointer; Sending a call request to the second preset bus protocol based on the pointer recycling request, and recycling the recyclable index pointer to the target index pool by using the call request; Obtaining a corresponding completion instruction generated by the target index pool after obtaining the recyclable index pointer, and modifying the value of the preset counter based on the completion instruction; the modification operation is to subtract the value 1 from the current value to obtain a new current value; Determining whether the current value of the preset counter is 0; If the current value of the preset counter is not 0, jump to the step of determining a currently to-be-processed index pointer from the recyclable index pointer segment, and clearing the pointer data of the currently to-be-processed index pointer to obtain a recyclable index pointer; If the current value of the preset counter is 0, complete the recycling operation of the recyclable index pointer segment, so that the target memory pool can recycle other index pointers in the NVme memory recycling task or index pointers in other NVme memory recycling tasks.

7. The NVMe memory recycling method according to any one of claims 1 to 6, characterized in that Analyzing the target mask sequentially based on a preset mask analysis order to segmentally read recyclable index pointer segments from the target index pointer, and storing the pointer information of the recyclable index pointer segments into a pointer access queue based on the preset mask analysis order, includes: Traversing the target mask sequentially based on a preset mask analysis order to determine continuous mask data segments from the target mask; the mask value of the continuous mask data segment indicates that the corresponding target index pointer is a recyclable index pointer segment. Determine the data length of the continuous mask data segment and the address of the first mask as the pointer information of the recyclable index pointer segment; Based on the preset mask analysis order, store the pointer information into the pointer access queue in sequence.

8. An NVme memory recycling device, characterized in that, Comprising: A mask generation module, configured to read a target index pointer of an NVme memory recycling task and generate a target mask corresponding to the target index pointer; An information storage module, configured to analyze the target mask in sequence based on the preset mask analysis order, so as to segmentally read a recyclable index pointer segment from the target index pointer, and store the pointer information of the recyclable index pointer segment into the pointer access queue based on the preset mask analysis order; An index reading module, configured to sequentially read the recyclable index pointer segment based on the access order of the pointer access queue and the pointer information, and determine a target index pool corresponding to the recyclable index pointer segment based on the memory pool number corresponding to the recyclable index pointer segment; An index recycling module, configured to clear the pointer data of the recyclable index pointer segment to obtain a to-be-recycled index pointer, and recycle the to-be-recycled index pointer to the target index pool.

9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the NVme memory recycling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the NVme memory recycling method according to any one of claims 1 to 7 are implemented.