A namespace setting method, device and readable storage medium

By setting multiple step pointers with different lengths in the namespace to build a multi-level virtual linked list, the problem of high time complexity of namespace indexing in the existing technology is solved, and more efficient namespace indexing and data transmission efficiency are achieved.

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

Patent Information

Application Number
CN202211131081.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2025-01-21
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

In the existing namespace setting method, the index time is relatively complex, and each namespace element in the linked list needs to be indexed in sequence. As the length of the linked list increases, the index efficiency will become lower and lower, resulting in a negative impact on the data transmission efficiency. .

Method used

By setting multiple step pointers with different lengths in the namespace, a multi-level virtual linked list is constructed. After receiving the read instruction, according to the ID of the namespace that needs to be read, the search range is narrowed down starting from the virtual linked list with the highest length, and the search range is obtained. The namespace to be read.

Benefits of technology

The virtual linked list constructed through multi-level step pointers can first determine a larger range, and then narrow the search range in sequence, which improves the indexing efficiency of the namespace and reduces the negative impact on data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525580B_ABST
    Figure CN115525580B_ABST
Patent Text Reader

Abstract

The present application discloses a namespace setting method, device and readable storage medium, and relates to the field of information technology. The namespace setting method provided by the present application establishes a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace, reads the instruction to obtain the ID of the namespace to be read after receiving the read instruction, and starts from the virtual linked list with the longest length, successively narrows the search range in the virtual linked lists of different levels, so as to obtain the namespace to be read. Compared with the existing namespace setting method, the virtual linked list constructed by the multi-level step pointer in this scheme can first determine a larger range, and then narrow the search range in turn, and the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed by the ID, thereby effectively improving the index efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a namespace setting method, device and readable storage medium. Background Art

[0002] In recent years, solid-state drive technology has become increasingly mature. Due to its advantages in performance, power consumption, and reliability, it is gradually replacing traditional mechanical hard drives. In addition, with the development of new fields such as computing storage, the emergence of large-capacity flash memory has brought lower and lower costs, and the market share of solid-state drives has gradually increased. Non-volatile memory (NVMe) is generally used as a peripheral component interconnect express (PCIe) device attached to the host, and the flash memory space in each NVMe solid-state drive can be divided into several independent namespaces.

[0003] The existing namespace setting method is generally managed through linear lists. Common forms of linear lists are arrays and linked lists. Considering the flexibility of linear lists, linked lists are often used. The memory of linked lists is not continuous, and elements can be added arbitrarily. However, the indexing time complexity is high, and each namespace element in the linked list needs to be indexed in turn. As the length of the linked list increases, the indexing efficiency will become lower and lower, which will have a negative impact on data transmission efficiency.

[0004] In view of the above technology, finding a namespace setting method with higher indexing efficiency is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] The purpose of this application is to provide a namespace setting method to solve the problem that the current namespace indexing time complexity is high and each namespace element in the linked list needs to be indexed in turn. As the length of the linked list increases, the indexing efficiency will become lower and lower, which will have a negative impact on data transmission efficiency.

[0006] To solve the above technical problems, the present application provides a namespace setting method, including:

[0007] Receive a read instruction, and parse the read instruction to obtain the ID of the namespace to be read;

[0008] Obtaining a first range of the namespace to be read according to the first virtual linked list and the ID, wherein the first virtual linked list is a virtual linked list pre-constructed by a step pointer with the longest length set in the namespace, and the step pointer is a pointer of the namespace pointing to the namespace after the ID number n;

[0009] Transfer the index of the namespace to the next-level virtual linked list, obtain the second range of the namespace to be read in the first range according to the ID and the next-level virtual linked list, and determine the second range of the namespace to be read;

[0010] Determine whether the current virtual linked list is a basic linked list, where the basic linked list is a linked list with a step pointer length of 1 that is pre-sorted according to the IDs of the namespaces;

[0011] If not, return to the step of transferring the index of the namespace to the next level virtual linked list;

[0012] If so, the namespace to be read is obtained according to the ID serial number.

[0013] Preferably, the step of repeating the above steps until the namespace to be read is obtained from the basic linked list further includes:

[0014] Determine whether the namespace needs to be deleted according to the read instruction;

[0015] If so, the flag position of the namespace is set to 0 to indicate that the namespace no longer receives request instructions.

[0016] Preferably, the solution also includes:

[0017] Upon receiving the namespace creation instruction, searching the basic linked list for the flag bit set to 0;

[0018] If the flag bit is set to 0 in the basic linked list, the flag bit is set to 1 and the corresponding information of the namespace is modified.

[0019] Preferably, after receiving the namespace creation instruction, searching in the basic linked list whether there is the flag bit set to 0, the method further includes:

[0020] If the flag bit set to 0 does not exist in the basic linked list, the namespace is placed at the end of the basic linked list, and the ID of the newly created namespace is the ID value of the previous namespace plus 1.

[0021] Preferably, after placing the namespace at the end of the basic linked list, the method further includes:

[0022] Confirm whether the ID value of the namespace is divisible by each of the virtual linked lists;

[0023] Add the ID of the namespace to all the virtual linked lists that can be divided evenly.

[0024] Preferably, receiving a read instruction, and parsing the read instruction to obtain the ID of the namespace to be read includes:

[0025] The read instruction is received in an asynchronous transmission manner, and the read instruction is parsed in an asynchronous manner to obtain the ID of the namespace to be read.

[0026] Preferably, it also includes:

[0027] Record the time from receiving the read instruction to acquiring the namespace, and determine whether it is longer than a preset time;

[0028] If so, each of the virtual linked lists is rebuilt according to all of the namespaces.

[0029] Preferably, the received read instruction is a communication command between the host and the SSD formulated by NVMe.

[0030] Preferably, the receiving of the read instruction and parsing the read instruction to obtain the ID of the namespace to be read includes:

[0031] After receiving the IO command, parse the command to get the NSID;

[0032] According to the namespace in the NSID, read and write in the flash memory space corresponding to the namespace;

[0033] The ID of the namespace is obtained in the flash memory space.

[0034] Preferably, it also includes:

[0035] When a fault occurs in the virtual linked list, an alarm is issued.

[0036] Preferably, the random linked list and the basic linked list are both ordered linked lists.

[0037] To solve the above problems, the present application also provides a namespace setting device, including:

[0038] A receiving module, used for receiving a read instruction and parsing the read instruction to obtain the ID of the namespace to be read;

[0039] A reading module, used for obtaining a first range of the namespace to be read according to a first virtual linked list and the ID, wherein the first virtual linked list is a virtual linked list pre-constructed by a step pointer with the longest length set in the namespace, and the step pointer is a pointer of the namespace pointing to the namespace after the ID number n;

[0040] A loop module, used for transferring the index of the namespace to the next-level virtual linked list, obtaining the second range of the namespace to be read in the first range according to the ID and the next-level virtual linked list, and determining the second range of the namespace to be read;

[0041] The acquisition module is used to repeatedly perform the loop module until the namespace to be read is obtained from the basic linked list, where the basic linked list is a linked list with a step pointer length of 1 that is pre-sorted according to the ID of each namespace.

[0042] Preferably, the device further comprises:

[0043] A judgment module, used for judging whether the namespace needs to be deleted according to the read instruction, and when the namespace needs to be deleted, starting the reset module;

[0044] The reset module is used to set the flag position of the namespace to 0, so as to indicate that the namespace no longer receives request instructions.

[0045] Preferably, the device further comprises:

[0046] A search module, configured to receive the namespace creation instruction, search the basic linked list for the flag bit set to 0, and start the setting module if the flag bit set to 0 exists in the basic linked list;

[0047] The set 1 module is used to set the flag position to 1 and modify the corresponding information of the namespace.

[0048] Preferably, the device further comprises:

[0049] A creation module is enabled when the flag bit set to 0 does not exist in the basic linked list, and is used to place the namespace at the end of the basic linked list, and the ID of the newly created namespace is the ID value of the previous namespace plus 1.

[0050] Preferably, the device further comprises:

[0051] A confirmation module, used to confirm whether the ID value of the namespace is divisible by each of the virtual linked lists;

[0052] The divisibility module adds the ID of the namespace to all the virtual linked lists that can be divided by an integer.

[0053] Preferably, the device further comprises:

[0054] A recording module, used to record the time from receiving the read instruction to acquiring the namespace, and determine whether it is longer than a preset time. If so, start a reconstruction module;

[0055] A reconstruction module is used to reconstruct each of the virtual linked lists according to all the namespaces.

[0056] To solve the above problems, the present application also provides a namespace setting device, including a memory for storing a computer program;

[0057] A processor is used to implement the steps of the namespace setting method as described above when executing the computer program.

[0058] To solve the above problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the namespace setting method as described above are implemented.

[0059] The namespace setting method provided in the present application establishes a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace. After receiving the read instruction, the instruction is read to obtain the ID of the namespace to be read, and the search range is narrowed down in the virtual linked list of different levels according to the ID of the namespace to be read starting from the virtual linked list with the longest length, so as to obtain the namespace to be read. Compared with the existing namespace setting method, since the existing scheme searches all the namespaces in the linked list in sequence, when the linked list is too long, it takes a long time to verify each namespace, and the indexing efficiency is low. In the present scheme, the virtual linked list constructed by multi-level step pointers can first determine a larger range, and then narrow the search range in sequence, and reasonably set the number of virtual linked lists and the length of each level of virtual linked lists according to the number of namespaces. Since the search is performed through the pointer in the ID, the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed through the ID, thereby effectively improving the indexing efficiency of the namespace.

[0060] The namespace setting device and computer-readable medium of the present application correspond to the above-mentioned namespace method, and the beneficial effects are the same as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0062] Figure 1 A flowchart of a namespace setting method provided in an embodiment of the present application;

[0063] Figure 2 A schematic diagram of a namespace setting device provided in an embodiment of the present application;

[0064] Figure 3 A structural diagram of a namespace setting device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] The core of this application is to provide a namespace setting method to solve the problem that the current namespace indexing time complexity is high and each namespace element in the linked list needs to be indexed in turn. As the length of the linked list increases, the indexing efficiency will become lower and lower, which will have a negative impact on data transmission efficiency.

[0067] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0068] Figure 1 A flowchart of a namespace setting method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0069] S10: receiving a read instruction, and parsing the read instruction to obtain the ID of the namespace to be read;

[0070] It should be noted that namespace is a form of code organization used by many programming languages. Namespaces are used to classify and distinguish different code functions to avoid conflicts caused by the same variable names between different code snippets (usually used by different people to work together or call existing code snippets) when they are used at the same time.

[0071] An identity document (ID), also known as a serial number or account number, is a relatively unique code in a system, equivalent to an "identity card". In a specific thing, the identity number is generally unchanged. As for what is used to identify the thing, it is determined by the rules set by the designer himself.

[0072] In this embodiment, there is no limitation on the read instruction and the object sending the read instruction. It can be understood that the specific subsequent operation of the read instruction can be to call a namespace element in the memory, or to delete a namespace element in the memory, etc. In this embodiment, there is no limitation on the process after obtaining the namespace to be read. It can be understood that the namespace ID is the independent number of each namespace in the linked list in the memory according to the namespace naming rule.

[0073] S11: Obtain a first range of namespaces to be read according to the first virtual linked list and the ID;

[0074] A linked list is a non-continuous and non-sequential storage structure on a physical storage unit. The logical order of data elements is realized by the pointer link order in the linked list. A linked list consists of a series of nodes (each element in the linked list is called a node), and nodes can be generated dynamically at runtime. Each node consists of two parts: one is the data field for storing data elements, and the other is the pointer field for storing the address of the next node.

[0075] The first virtual linked list is a virtual linked list constructed in advance by setting the longest step pointer in the namespace. The step pointer is a pointer of the namespace pointing to the namespace after ID number n. For example, the length of the step pointer is 4, then the first virtual linked list includes the namespace with ID 0, the namespace with ID 4, and all subsequent namespaces in the same linked list that are divisible by 4. In this embodiment, the specific step and length of the first virtual linked list are not limited. It can be understood that for the first linked list, the specific elements of the first linked list are not constructed by the namespace, but by the step pointer in the namespace, so it is a virtual linked list.

[0076] S12: Enter the next level virtual linked list for indexing, and obtain a more accurate namespace range based on the ID and the next level virtual linked list;

[0077] It should be noted that the next-level virtual linked list in this embodiment refers to the next linked list whose step pointer length is lower than that of the previous-level virtual linked list. For example, if there are step pointers of 2, 4, and 8 in a namespace, the step pointer with a length of 8 constructs the above-mentioned first virtual linked list, and the next-level virtual linked list after the first virtual linked list is a virtual linked list with a length of 4, and the next-level virtual linked list of the virtual linked list with a length of 4 is a virtual linked list with a length of 2. In this embodiment, there is no limitation on the number of virtual linked lists and the corresponding step pointer lengths, etc.

[0078] S13: Determine whether the current virtual linked list is a basic linked list, if so, go to S14, if not, go back to S12;

[0079] It should be noted that the basic linked list is a virtual linked list with a step pointer length of 1, which is pre-sorted according to the ID of each namespace, that is, a linked list containing all namespaces, sorted in sequence by ID, and constructed by the initial pointer in the namespace, that is, the pointer to the previous and next elements.

[0080] S14: Obtain the namespace to be read according to the ID.

[0081] In this embodiment, the specific steps after obtaining the namespace, such as modifying, deleting, and retrieving the content in the namespace, are not limited.

[0082] The namespace setting method provided in this embodiment establishes a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace. After receiving the read instruction, the instruction is read to obtain the ID of the namespace to be read, and the search range is narrowed down in the virtual linked list of different levels starting from the virtual linked list with the longest length according to the ID of the namespace to be read, so as to obtain the namespace to be read. Compared with the existing namespace setting method, since the existing scheme searches all the namespaces in the linked list in sequence, when the linked list is too long, it takes a long time to verify each namespace, and the indexing efficiency is low. In this scheme, the virtual linked list constructed by multi-level step pointers can first determine a larger range, and then narrow the search range in sequence. The number of levels of the virtual linked list and the length of each level of the virtual linked list are reasonably set according to the number of namespaces. Since the search is performed through the pointer in the ID, the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed through the ID, thereby effectively improving the indexing efficiency of the namespace.

[0083] Considering that when deleting a namespace, the step pointer needs to be modified due to the method of constructing the step pointer adopted in this application, a preferred solution is provided here, which includes: after obtaining the namespace to be read according to the ID, the following is also included:

[0084] Determine whether the namespace needs to be deleted based on the read instruction;

[0085] If so, the namespace flag is set to 0 to indicate that the namespace no longer receives request instructions.

[0086] In this application, when adding or deleting namespace instances at the end of a linked list, although it is also necessary to update the step pointers of some namespaces in the linked list, the time consumption is not too long; however, if instances are added or deleted in the middle of a linked list, it is necessary to update the step pointers of some instances before the changed instance and all subsequent instances, which makes the deletion and creation of linked lists extremely complicated, and it is difficult to accept the resource consumption in the creation and deletion of linked lists. In order to solve this problem, we added a flag bit to the linked list elements. When a linked list deletes a namespace instance, it only needs to index the element in the linked list, set the flag bit to 0, and no longer receive requests. In this way, the host layer can consider that the namespace instance is deleted, and there is no need to update the step pointers of other linked lists, thereby saving operating resources and improving operating efficiency.

[0087] Considering the use of storage space when establishing a namespace, a preferred solution is proposed here, which also includes:

[0088] After receiving the namespace creation instruction, search the basic linked list to see if there is a flag bit set to 0;

[0089] If there is a flag bit set to 0 in the base linked list, set the flag bit to 1 and modify the corresponding information of the namespace.

[0090] In this embodiment, the specific creation instruction of the namespace is not limited. It can be understood that the creation instruction can be to create one or more namespaces, and based on the creation of the namespace, it is found whether there is a flag bit that needs to be deleted and is set to 0 as mentioned in the above embodiment. By setting the flag bit to 1 and modifying the corresponding information in the creation instruction to the namespace corresponding to the flag bit, the accurate use of the storage space is guaranteed, and the steps of modifying the step pointer due to the creation of a new namespace can be reduced, thereby increasing the operating efficiency of the system.

[0091] In the process of establishing a new namespace mentioned in the above embodiment, considering that there may be a flag bit set to 0 that does not exist in the basic linked list, a preferred solution is provided here. After receiving the namespace establishment instruction, searching in the basic linked list whether there is a flag bit set to 0, the following further includes:

[0092] If there is no flag set to 0 in the base linked list, the namespace is placed at the end of the base linked list, and the ID of the newly created namespace is the ID value of the previous namespace plus 1.

[0093] That is, after detecting that there is no flag bit set to 0, the namespace is placed at the end of the table, and a new ID is assigned to the namespace according to the naming rules. It can be understood that the number of newly created namespaces is not limited in this embodiment, so multiple namespaces can be placed at the end at the same time and their IDs are added by 1 at a time according to the naming rules. In this embodiment, no specific identification is performed, and the above method is used to ensure the timely establishment and accurate naming of the namespace.

[0094] In the above embodiment, it is proposed that after there is no flag bit set to 0, the namespace is placed at the end of the table. Considering the existence of the step pointer, a preferred solution is provided here. After the namespace is placed at the end of the basic linked list, the embodiment further includes:

[0095] Confirm whether the ID value of the namespace is divisible by each virtual linked list;

[0096] Add the namespace ID to all divisible virtual linked lists.

[0097] That is, a step pointer is established for the newly created namespace, and the step pointer is added to the corresponding virtual linked list to ensure the integrity and accuracy of the index.

[0098] In order to further increase the operating efficiency in data transmission and reading, a read instruction is received, and the read instruction is parsed to obtain the ID of the namespace to be read, including;

[0099] The read instruction is received through asynchronous transmission, and the read instruction is parsed asynchronously to obtain the ID of the namespace to be read.

[0100] Asynchronous Transfer Mode (ATM) is a transmission method in which each character forms a frame independently. A continuous string of characters is also encapsulated into continuous independent frames for transmission. The intervals between characters can be arbitrary, so this transmission method is called asynchronous transmission. Asynchronous transfer mode is a cell switching and multiplexing technology. ATM uses cells as the transmission unit. Cells have a fixed length of 53 bytes in total. The first 5 bytes are the header and the remaining 48 bytes are the data segment. The header contains information such as the logical address of the cell's destination, priority, header error control, and flow control. The data segment is loaded with user information or other management information of various services that are decomposed into data blocks and transparently passes through the network. The asynchronous transmission method is adopted to increase the efficiency of transmission and indexing.

[0101] Considering the specific detection of actual utilization efficiency, a preferred solution is provided here, and the method further includes:

[0102] Record the time from receiving the read instruction to obtaining the namespace, and determine whether it is higher than the preset time;

[0103] If so, rebuild each virtual linked list based on all namespaces.

[0104] In this embodiment, there is no specific limitation on the preset time, which may be determined according to the length of the linked list. For example, the average time taken to search the namespace in sequence in a traditional way may be used as the preset time in this embodiment, so as to determine whether it is more efficient than the traditional way. If it is less efficient than the traditional way, it means that the range and length of the constructed virtual linked lists at all levels are not reasonable, so the length and range of the virtual linked lists are reconstructed, so as to ensure that the less efficient virtual linked list construction method can be adjusted in time.

[0105] In the above embodiments, the namespace setting method is described in detail, and the present application also provides an embodiment corresponding to the namespace setting device. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.

[0106] The above embodiments do not specifically limit the communication method. Here, a preferred solution is proposed to receive a read instruction as a communication command between the host and the SSD formulated by NVMe.

[0107] Solid State Drives (SSD), referred to as solid disk, are hard disks made of solid-state electronic storage chip arrays, consisting of a control unit and a storage unit (FLASH chip, DRAM chip). SSDs are exactly the same as traditional hard disks in terms of interface specifications and definitions, functions and usage methods. They are also completely consistent with traditional hard disks in product appearance and size, but their I / O performance is greatly improved compared to traditional hard disks.

[0108] Namespace, referred to as NS, divides the flash memory space in the SSD into several independent logical spaces. The address of each independent logical space ranges from 0 to N-1. We call each divided logical space a namespace. The globally unique identifier of the namespace is NSID. Through this embodiment, the communication is limited to the communication between the host and the SSD, that is, the storage of the namespace is limited to the SSD, so the storage performance is more powerful.

[0109] According to the above preferred solution that the storage space is a namespace, a further preferred solution is provided here, receiving a read instruction, and parsing the read instruction to obtain the ID of the namespace to be read includes:

[0110] After receiving the IO command, parse the command to get the NSID;

[0111] According to the namespace in NSID, read and write in the flash memory space corresponding to the namespace;

[0112] Get the ID of the namespace in the flash memory.

[0113] Flash memory is an electronic form of programmable read-only memory that can be erased and written multiple times during operation. This technology is mainly used for general data storage and data exchange between computers and other digital products (such as memory cards and flash drives). Flash memory is a special storage written in macroblocks. In the early stages, once the flash memory is erased, the data on the entire chip will be erased. According to the flash memory provided in this embodiment, the security performance of the data is guaranteed.

[0114] Considering that problems in reading and writing virtual linked lists need to be solved in time to prevent data loss, a preferred solution is provided here, which also includes:

[0115] When a virtual linked list fails, an alarm is issued.

[0116] It should be noted that the specific alarm method is not limited in this embodiment, and a warning light, buzzer, etc. can be used, or other methods can be used, such as sending a warning message to the device terminal, thereby ensuring it by adding an alarm.

[0117] Figure 2 A schematic diagram of a namespace setting device provided in an embodiment of the present application, the device comprising:

[0118] The receiving module 10 is used to receive a read instruction and parse the read instruction to obtain the ID of the namespace to be read;

[0119] The reading module 11 is used to obtain the first range of the namespace to be read according to the first virtual linked list and the ID, wherein the first virtual linked list is a virtual linked list constructed in advance by using the longest step pointer set in the namespace, and the step pointer is a pointer of the namespace pointing to the namespace after the ID number n;

[0120] The loop module 12 is used to transfer the index of the namespace to the next-level virtual linked list, obtain the second range of the namespace to be read in the first range according to the ID and the next-level virtual linked list, and determine the second range of the namespace to be read;

[0121] The acquisition module 13 is used to repeat the loop module 12 until the namespace to be read is obtained from the basic linked list, where the basic linked list is a linked list with a step pointer length of 1 that is pre-sorted according to the ID of each namespace.

[0122] Preferably, the device further comprises:

[0123] The judgment module is used to judge whether the namespace needs to be deleted according to the read instruction. When the namespace needs to be deleted, the reset module is turned on;

[0124] The reset module is used to set the flag position of the namespace to 0, which is used to indicate that the namespace no longer receives request instructions.

[0125] Preferably, the device further comprises:

[0126] A search module is used to receive a namespace creation instruction, search whether there is a flag bit set to 0 in the basic linked list, and if there is a flag bit set to 0 in the basic linked list, start the setting module;

[0127] The set 1 module is used to set the flag position to 1 and modify the corresponding information of the namespace.

[0128] Preferably, the device further comprises:

[0129] The creation module is turned on when there is no flag set to 0 in the base linked list. It is used to place the namespace at the end of the base linked list, and the ID of the newly created namespace is the ID value of the previous namespace plus 1.

[0130] Preferably, the device further comprises:

[0131] The confirmation module is used to confirm whether the ID value of the namespace can be divided by each virtual linked list;

[0132] The divisibility module adds the namespace ID to all divisible virtual linked lists.

[0133] Preferably, the device further comprises:

[0134] The recording module is used to record the time from receiving the read instruction to obtaining the namespace, and determine whether it is higher than the preset time. If so, the reconstruction module is started;

[0135] The reconstruction module is used to rebuild each virtual linked list according to all namespaces.

[0136] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0137] The namespace setting device provided in the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can establish a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace. After receiving the read instruction, the instruction is read to obtain the ID of the namespace to be read, and the search range is narrowed down in the virtual linked list of different levels starting from the virtual linked list with the longest length according to the ID of the namespace to be read, so as to obtain the namespace to be read. Compared with the existing namespace setting method, since the existing scheme searches all the namespaces in the linked list in sequence, when the linked list is too long, it takes a long time to verify each namespace, and the indexing efficiency is low. In the present scheme, the virtual linked list constructed by multi-level step pointers can first determine a larger range, and then narrow the search range in sequence. The number of levels of the virtual linked list and the length of each level of the virtual linked list are reasonably set according to the number of namespaces. Since the search is performed through the pointer in the ID, the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed down through the ID, thereby effectively improving the indexing efficiency of the namespace.

[0138] Figure 3 A structural diagram of a namespace setting device provided in another embodiment of the present application, such as Figure 3 As shown, the namespace setting device includes: a memory 20, for storing a computer program;

[0139] The processor 21 is used to implement the steps of the namespace setting method mentioned in the above embodiment when executing the computer program.

[0140] The namespace setting device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0141] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0142] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the namespace setting disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include, but is not limited to, the data involved in the namespace setting method provided in the above embodiments, etc.

[0143] In some embodiments, the namespace setting device may also include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0144] Those skilled in the art will understand that Figure 3 The structure shown in does not constitute a limitation on the namespace setting device and may include more or fewer components than shown in the figure.

[0145] The namespace setting device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the namespace setting method provided in the above embodiment.

[0146] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0147] The namespace setting device provided in the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can establish a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace. After receiving the read instruction, the instruction is read to obtain the ID of the namespace to be read, and the search range is narrowed down in the virtual linked list of different levels starting from the virtual linked list with the longest length according to the ID of the namespace to be read, so as to obtain the namespace to be read. Compared with the existing namespace setting method, since the existing scheme searches all the namespaces in the linked list in sequence, when the linked list is too long, it takes a long time to verify each namespace, and the indexing efficiency is low. In the present scheme, the virtual linked list constructed by multi-level step pointers can first determine a larger range, and then narrow the search range in sequence. The number of levels of the virtual linked list and the length of each level of the virtual linked list are reasonably set according to the number of namespaces. Since the search is performed through the pointer in the ID, the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed down through the ID, thereby effectively improving the indexing efficiency of the namespace.

[0148] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0149] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0150] Since the embodiments of the readable storage medium part correspond to the embodiments of the method part, the embodiments of the device part and their corresponding beneficial effects can be found in the description of the embodiments of the method part, which will not be repeated here.

[0151] The computer-readable storage medium provided by the present application can achieve the goal of establishing a multi-level virtual linked list by setting multiple step pointers of different lengths in the namespace when the program stored therein is executed, and after receiving the read instruction, the instruction is read to obtain the ID of the namespace to be read, and the search range is narrowed down in the virtual linked list of different levels according to the ID of the namespace to be read and starting from the virtual linked list with the longest length, so as to obtain the namespace to be read. Compared with the existing namespace setting method, since the existing scheme searches all the namespaces in the linked list in sequence, when the linked list is too long, it takes a long time to verify each namespace, and the indexing efficiency is low. In the present scheme, the virtual linked list constructed by multi-level step pointers can first determine a larger range, and then narrow the search range in sequence, and reasonably set the number of virtual linked lists and the length of each level of virtual linked lists according to the number of namespaces. Since the search is performed through the pointer in the ID, the search range in the virtual linked list is more efficient, and the index range can be gradually narrowed by the ID, thereby effectively improving the indexing efficiency of the namespace.

[0152] The above is a detailed introduction to a namespace setting method, device and readable storage medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0153] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A namespace setting method, characterized in that: include: Receive a read instruction, and parse the read instruction to obtain the ID of the namespace to be read; Obtaining a first range of the namespace to be read according to the first virtual linked list and the ID, wherein the first virtual linked list is a virtual linked list pre-constructed by a step pointer with the longest length set in the namespace, and the step pointer is a pointer of the namespace pointing to the namespace after the ID number n; Transfer the index of the namespace to the next-level virtual linked list, obtain the second range of the namespace to be read in the first range according to the ID and the next-level virtual linked list, and determine the second range of the namespace to be read; Determine whether the current virtual linked list is a basic linked list, where the basic linked list is a linked list with a step pointer length of 1 that is pre-sorted according to the IDs of the namespaces; If not, return to the step of transferring the index of the namespace to the next level virtual linked list; If so, the namespace to be read is obtained according to the ID serial number.

2. The namespace setting method according to claim 1, characterized in that: After obtaining the namespace to be read according to the ID serial number, the method further includes: Determine whether the namespace needs to be deleted according to the read instruction; If so, the flag position of the namespace is set to 0 to indicate that the namespace no longer receives request instructions.

3. The namespace setting method according to claim 2, characterized in that: Also includes: Upon receiving the namespace creation instruction, searching the basic linked list for the flag bit set to 0; If the flag bit is set to 0 in the basic linked list, the flag bit is set to 1 and the corresponding information of the namespace is modified.

4. The namespace setting method according to claim 3, characterized in that: After receiving the namespace creation instruction, searching in the basic linked list whether there is the flag bit set to 0, the method further includes: If the flag bit set to 0 does not exist in the basic linked list, the namespace is placed at the end of the basic linked list, and the ID of the newly created namespace is the ID value of the previous namespace plus 1.

5. The namespace setting method according to claim 4, characterized in that: After placing the namespace at the end of the base linked list, the method further includes: Confirm whether the ID value of the namespace is divisible by each of the virtual linked lists; Add the ID of the namespace to all the virtual linked lists that can be divided evenly.

6. The namespace setting method according to any one of claims 1 to 5, characterized in that: Receive a read instruction, and parse the read instruction to obtain the ID of the namespace to be read, including: The read instruction is received in an asynchronous transmission manner, and the read instruction is parsed in an asynchronous manner to obtain the ID of the namespace to be read.

7. The namespace setting method according to claim 6, characterized in that: Also includes: Record the time from receiving the read instruction to acquiring the namespace, and determine whether the namespace time is higher than a preset time; If so, each of the virtual linked lists is rebuilt according to all of the namespaces.

8. The namespace setting method according to claim 7, characterized in that: The received read instruction is a communication command between the host and the SSD formulated by NVMe.

9. The namespace setting method according to claim 8, characterized in that: The receiving of the read instruction and parsing the read instruction to obtain the ID of the namespace to be read includes: After receiving the IO command, parse the command to get the NSID; According to the namespace in the NSID, read and write in the flash memory space corresponding to the namespace; The ID of the namespace is obtained in the flash memory space.

10. The namespace setting method according to claim 1, characterized in that: Also includes: When a fault occurs in each of the virtual linked lists, an alarm is issued.

11. The namespace setting method according to claim 10, characterized in that: The virtual linked list and the basic linked list are both ordered linked lists.

12. The namespace setting method according to claim 10, characterized in that: When each of the virtual linked lists fails, after an alarm is issued, the method further includes: Reset the virtual linked list, enter the step of receiving the read instruction, and parse the read instruction to obtain the ID of the namespace to be read.

13. A namespace setting device, characterized in that: include: A receiving module, used for receiving a read instruction and parsing the read instruction to obtain the ID of the namespace to be read; A reading module, used for obtaining a first range of the namespace to be read according to a first virtual linked list and the ID, wherein the first virtual linked list is a virtual linked list pre-constructed by a step pointer with the longest length set in the namespace, and the step pointer is a pointer of the namespace pointing to the namespace after the ID number n; A loop module, used for transferring the index of the namespace to the next-level virtual linked list, obtaining the second range of the namespace to be read in the first range according to the ID and the next-level virtual linked list, and determining the second range of the namespace to be read; A judging module, used to judge whether the current virtual linked list is a basic linked list, wherein the basic linked list is a linked list with a step pointer length of 1 which is pre-sorted according to the IDs of the namespaces. If not, return to the loop module; if yes, enter the acquisition module; The acquisition module is used to acquire the namespace that needs to be read according to the ID serial number.

14. A namespace setting device, characterized in that: comprising a memory for storing a computer program; A processor, configured to implement the steps of the namespace setting method as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the namespace setting method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Method and device for realizing equipment virtualization and computer readable storage medium

    CN111651269A

  • Data storage system and method adopting variable step length skip list

    CN113065964A