Data read / write methods, systems, devices, and storage media based on skip lists

CN116680275BActive Publication Date: 2026-05-26HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
Filing Date
2023-06-25
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

When the keys are long, comparison operations in skip list-based data structures incur significant resource overhead, impacting data read and write performance.

Method used

By introducing the concept of eigenvalues, each node generates a first eigenvalue relative to its predecessor node, records the fork position of the key and the partial values ​​after the fork, reduces the repeated comparison process, and optimizes the data read and write method.

Benefits of technology

By omitting repeated comparisons of common parts, comparison overhead is effectively saved, and data read and write performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680275B_ABST
    Figure CN116680275B_ABST
Patent Text Reader

Abstract

This specification provides one or more embodiments of a skip list-based data read / write method, system, device, and storage medium. Nodes in the skip list store keys and first characteristic values. The first characteristic value records the fork position of the node's key relative to the key of its predecessor node, and at least a portion of the value of the node's key after the fork position. The method includes: obtaining the target key of the element to be read / written; if the target key is different from the key of the first node in the skip list, determining the next node pointed to by the first node at the highest index level as the comparison node, and repeatedly executing the following process until a preset condition is met: comparing the second characteristic value of the target key with the first characteristic value of the comparison node; if they are different, determining the comparison node for the next iteration based on the size relationship indicated by the comparison result; if the preset condition is met, performing read / write operations on the element to be read / written based on the comparison node from the last iteration. This method helps reduce comparison overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of data read and write technology, and in particular to a data read and write method, storage system, electronic device and computer-readable storage medium based on skip list. Background Technology

[0002] A skip list is a randomized data structure, essentially an ordered linked list that allows for binary search. Skip lists add multi-level indexes to the original ordered linked list, enabling fast lookups. Skip lists not only improve search performance but also the performance of insertion and deletion operations. In the process of adding, deleting, querying, and modifying data, an unavoidable step is to compare the key (i.e., the key in key-value pair storage) of the tuple to be added, deleted, or modified with the key stored in the skip list node to locate the insertion, deletion, or modification position.

[0003] For example, during the search process, the key of the element to be searched needs to be compared with the keys in the nodes of the skip list to locate the node to be searched, and then the specific content of the element to be searched can be read using the key of the node to be searched as an index; however, when the key is long, the comparison operation requires a large amount of runtime resources. Summary of the Invention

[0004] In view of the above, one or more embodiments of this specification provide a data read / write method, storage system, electronic device, and computer-readable storage medium based on a skip list.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a data read / write method based on a skip list is proposed. The skip list includes multiple index layers, and nodes in the skip list are used to store keys and a first feature value. The first feature value is used to record the fork position of the key of the current node relative to the key of the predecessor node, and at least a portion of the value of the key of the current node after the fork position. The method includes:

[0007] Get the target key of the element to be read or written;

[0008] If the target key is different from the key of the first node of the skip list, determine the next node pointed to by the first node at the highest index level as the node to be compared, and repeat the following process until a preset condition is met:

[0009] The second feature value of the target key is compared with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position;

[0010] If the two are different, determine the node to be compared in the next iteration based on the size relationship indicated by the comparison result;

[0011] If the preset conditions are met, the read and write operations of the element to be read and written are performed based on the node to be compared in the last loop process.

[0012] According to a second aspect of one or more embodiments of this specification, a storage system is provided, including a data read / write device and a skip list; the skip list includes multiple index layers, and nodes in the skip list are used to store keys and a first feature value of the node relative to its predecessor node, the first feature value being used to record fork position information of the key of the node and the key of the predecessor node and at least a portion of the value after the fork position.

[0013] The data read / write device is used to perform the method described in any one of the first aspects.

[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0015] processor;

[0016] Memory used to store processor-executable instructions;

[0017] Wherein, when the processor executes the executable instructions, it is used to implement the method described in the first aspect.

[0018] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of any of the methods described above.

[0019] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0020] In this embodiment of the disclosure, by obtaining the first feature value of the node in the skip list and the second feature value of the target key, and comparing the second feature value of the target key with the first feature value of the node to be compared, the repeated comparison process of the common part is omitted, effectively saving comparison overhead and optimizing read and write performance.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0022] Figure 1This is a schematic diagram of an ordered linked list and feature values ​​provided in an exemplary embodiment.

[0023] Figure 2 This is a schematic diagram of a skip list and a first feature value provided in an exemplary embodiment.

[0024] Figure 3 This is a schematic diagram of a skip list-based data read / write method provided in an exemplary embodiment.

[0025] Figure 4 This is a schematic diagram of the first characteristic value of a composite bond provided in an exemplary embodiment.

[0026] Figure 5 This is a schematic diagram of the first characteristic value of another composite bond provided in an exemplary embodiment.

[0027] Figure 6 This is a schematic diagram of a storage system provided in an exemplary embodiment.

[0028] Figure 7 This is a schematic diagram of the structure of a device provided in an exemplary embodiment. Detailed Implementation

[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0030] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0031] A database is a repository for organizing, storing, and managing data according to a data structure. It is a large collection of organized, shareable, and centrally managed data that is stored permanently on a computer.

[0032] Key-value storage, or KV storage for short, is a type of NoSQL (Not Only SQL, non-relational database) storage. It organizes, indexes, and stores data in key-value pairs. Key-value storage is well-suited for data storage that doesn't involve numerous data relationships and offers better read and write performance than traditional database storage.

[0033] Databases and key-value pairs typically require large storage spaces, so they must be stored according to a specific design; otherwise, the efficiency of data searching, deleting, and inserting operations will be very low. One data structure used for storing data is the LSM-Tree (Log Structured Merge Tree). The LSM-Tree is a hierarchical, ordered, disk-oriented data structure. Its core idea is to improve write performance by transforming all random writes into sequential writes. Its main process is that all write requests are first appended to the log file (WAL file), and then inserted into the MemTable in memory. When memory reaches a certain limit, the data is sequentially written to disk to form an internally ordered disk file. When reading data, a multi-way merge method is used, reading from both the memory file and the disk file.

[0034] WAL stands for Write-Ahead Log, a common technique in key-value (KV) storage / database systems used to ensure the atomicity and durability of data operations. Disk I / O operations are typically a major bottleneck for the efficiency of KV storage / databases. With the same amount of data, using WAL logs during transaction commits can reduce the amount of I / O data and convert random writes into sequential writes, thereby improving system performance.

[0035] MemTable is the memory storage structure for WAL file content. It is usually implemented using a skip list and provides interfaces for writing, deleting, and reading key-value pairs.

[0036] A skip list is a randomized data structure, essentially an ordered linked list that allows for binary search. Skip lists add multi-level indexes to the original ordered linked list, enabling fast lookups. Skip lists not only improve search performance but also the performance of insertion and deletion operations. In the process of adding, deleting, querying, and modifying data, an unavoidable step is to compare the key (i.e., the key in key-value pair storage) of the tuple to be added, deleted, or modified with the key stored in the skip list node to locate the insertion, deletion, or modification position.

[0037] For example, during a search, the key of the element to be searched needs to be compared with the keys of the nodes in the skip list to locate the node to be searched, and then the specific content of the element to be searched can be read using the key of the node to be searched as an index; however, when the key is long, the comparison operation requires significant runtime resources. For example, please refer to [link to example]. Figure 1 The sorted linked list shown (using a single-level index as an example) includes 5 nodes: {a, b, c, d, e}. Assume the linked list contains ( Figure 1 The gray part in the text stores the key, and the key data type is string. If you want to locate whether there is a node in the linked list whose string is equal to the string S to be searched, the relevant technology is to perform a full string comparison one by one until a node whose string is greater than or equal to string S is located. When the string is long, the comparison operation has a large overhead.

[0038] To address the problems in related technologies, embodiments of this specification introduce the concept of eigenvalues, reducing comparison overhead through eigenvalue comparison. Examples of eigenvalues ​​are provided here; please refer to [link to relevant documentation]. Figure 1 The inventors considered that sorted linked lists have certain common prefixes. In order to reduce repetitive and inefficient operations, they implemented an additional recording of the end position of the common prefix of each node and its predecessor node. In addition, in order to make more efficient use of memory, they also recorded at least some of the node-specific data of each node and its predecessor node after the fork.

[0039] Please see Figure 1 (1) Node a has no predecessor node, and the default fork position index is 0, forming the feature value (0,ABC); (2) Node b's predecessor node a has a common prefix of ABCD, forming the feature value (4,XYZ); (3) Node c's predecessor node b has a common prefix of ABCDX, forming the feature value (5,ZZZ); (4) Node d's predecessor node c has a common prefix of ABC, forming the feature value (3,OXY); (5) Node e's predecessor node d has a common prefix of ABCOX, forming the feature value (5,ZMN).

[0040] To address the problems in related technologies, this specification provides an embodiment that generates a first feature value for each node relative to its predecessor node during the skip list creation process and records it in the nodes of the skip list. The skip list includes multiple index layers, and the nodes in the skip list store keys and the first feature value. The first feature value records the fork position of the node's key relative to the predecessor node's key, and at least a portion of the node's key value after the fork position. The fork position refers to the position where the difference between the value of the node's key and the value of the predecessor node's key begins.

[0041] For example, please refer to Figure 2The skip list shown has strings as the keys stored in its nodes, and each node includes at least one first feature value. For example, the number of first feature values ​​for each node is equal to the number of index layers corresponding to that node. In other words, if each node in the skip list (excluding the first node) has N index layers, then it has N predecessor nodes, and therefore N first feature values, where N is a positive integer. The first node in the skip list has no predecessor nodes, and we can assume its branching position is 0.

[0042] Please see Figure 2 Assuming the length of the common prefix of the record node relative to its predecessor node and the 3 characters after the fork, then:

[0043] (1) Node a has no predecessor node. The default subscript of the fork position is 0. It corresponds to the highest, second highest and lowest 3 index layers. Then there are 3 first feature values, all of which are (0,ABC).

[0044] (2) Node b corresponds to the lowest index layer. The predecessor node in the lowest index layer is a. The common prefix of nodes a and b is ABCD, which forms the first feature value (4,XYZ).

[0045] (3) Node c corresponds to the second highest and lowest two index layers. The predecessor node in the second highest index layer is a. The common prefix of node a and node c is ABCD, which forms the first feature value (4,XZZ). The predecessor node in the lowest index layer is b. The common prefix of node b and node c is ABCDX, which forms the first feature value (5,ZZZ).

[0046] (4) Node d corresponds to the lowest index layer. The predecessor node in the lowest index layer is c. The common prefix of the two is ABC, which forms the first feature value (3,OXY).

[0047] (5) Node e corresponds to the highest, second highest and lowest three index layers. The predecessor node in the highest index layer is a, and the common prefix of the two is ABC, which forms the first feature value (3,OXZ). The predecessor node in the second highest index layer is c, and the common prefix of the two is ABC, which forms the first feature value (3,OXZ). The predecessor node in the lowest index layer is d, and the common prefix of the two is ABCOX, which forms the first feature value (5,ZMN).

[0048] For questions regarding the relevant technologies, please refer to Figure 3 This specification provides a data read / write method based on a skip list, which can be executed by a data read / write device. The method includes:

[0049] In S101, obtain the target key of the element to be read or written.

[0050] In S102, if the target key is different from the key of the first node of the skip list, the next node pointed to by the first node at the highest index level is determined as the node to be compared, and the following process is executed repeatedly until a preset condition is met: the second feature value of the target key is compared with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the key of the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position; if the two are different, the node to be compared in the next loop process is determined according to the size relationship indicated by the comparison result.

[0051] In S103, if the preset conditions are met, the read and write operations of the element to be read and written are performed based on the node to be compared in the last loop process.

[0052] This embodiment transforms the comparison process between the target key of the element to be read and written and the key of the node in the skip list into a comparison process between the second feature value of the target key and the first feature value of the node to be compared. This eliminates the repetitive comparison process of common parts, effectively saves comparison overhead, and achieves performance optimization.

[0053] In some embodiments, the element to be read and written includes an element to be read and an element to be written.

[0054] If the element to be read is a node, the preset conditions include: the target key is the same as the key of the node to be compared. If the preset conditions are met, the node to be compared in the last iteration can be used to determine the read node in the skip list corresponding to the target key. The specific content of the element to be read is then read from the corresponding storage location using the key in that read node as an index. In one possible case, if it is determined that the keys of all nodes in the skip list are different from the target key of the element to be read, a prompt message indicating that the content of the element to be read has not been stored can be output.

[0055] If it is an element to be written, there are two possibilities: one is to modify the content of an already stored element, and the other is to write a new element.

[0056] For the first case, the preset conditions include: the target key is the same as the key of the node to be compared; if the preset conditions are met, the node to be compared in the last loop process can be used to determine the write node corresponding to the target key in the skip list, and the specific content of the element to be written at the corresponding storage location can be modified using the key in the write node as the index.

[0057] For the second scenario, the preset conditions include: no next node to be compared; that is, the comparison process has already determined the size relationship between the keys of all nodes in the skip list and the key of the element to be written, so no further comparison is needed. If the preset conditions are met, the insertion position of the node corresponding to the element to be written can be determined based on the node to be compared in the last iteration, thus enabling the write operation on the element to be written. For example, assuming the skip list is sorted in ascending order, if the node to be compared in the last iteration is greater than the target key of the element to be written, then the position preceding the node to be compared in the last iteration is determined as the insertion position; if the node to be compared in the last iteration is less than the target key of the element to be written, then the position following the node to be compared in the last iteration is determined as the insertion position.

[0058] In some embodiments, if the target key is the same as the key of the first node of the skip list, no further comparison is required. If it is a read element, the content of the read element is read from the corresponding storage location using the key in the first node as an index. If it is a write element, and it falls under the first case described above, the content of the write element at the corresponding storage location is modified using the key in the first node as an index.

[0059] In some embodiments, the nodes in the skip list can be sorted by key from smallest to largest or by key from largest to smallest. The comparison results will be different depending on the sorting order.

[0060] If the nodes in the skip list are sorted by key from smallest to largest, then if the target key is greater than the key of the first node in the skip list, the next node pointed to by the first node at the highest index level is determined as the node to be compared. The following process is repeated until a preset condition is met: the second feature value of the target key is compared with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the key of the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position; if the comparison result indicates that the target key is less than the key of the node to be compared, the next node pointed to by the predecessor node of the node to be compared at the next index level is determined as the node to be compared in the next loop process; if the comparison result indicates that the target key is greater than the key of the node to be compared, the next node pointed to by the node to be compared at this index level is determined as the node to be compared in the next loop process.

[0061] If the nodes in the skip list are sorted by key from largest to smallest, then if the target key is less than the key of the first node in the skip list, the next node pointed to by the first node at the highest index level is determined as the node to be compared. The following process is repeated until a preset condition is met: the second feature value of the target key is compared with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the key of the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position; if the comparison result indicates that the target key is greater than the key of the node to be compared, the next node pointed to by the predecessor node of the node to be compared at the next index level is determined as the node to be compared in the next loop process; if the comparison result indicates that the target key is less than the key of the node to be compared, the next node pointed to by the node to be compared at this index level is determined as the node to be compared in the next loop process.

[0062] In some embodiments, the data type of the key stored in any node of the skip list can be a string. See also... Figure 2 The first characteristic value of any node includes: the first length of the common prefix between the key of the node and the key of the predecessor node, and at least a portion of the characters of the key of the node after the common prefix. The second characteristic value of the target key includes: the second length of the common prefix between the target key and the key of the predecessor node of the node to be compared, and at least a portion of the characters of the target key after the common prefix.

[0063] Understandably, the number of at least some characters following the common prefix in the first and second feature values ​​can be specifically set according to the actual application scenario, for example... Figure 2 The first characteristic value of the string includes the key of the node relative to the key of the predecessor node after the common prefix. It can also be 2, 4, or all remaining characters; this embodiment does not impose any restrictions. The string comparison process compares each character character by character according to its corresponding ASCII code value. For example, for strings ABC and ACD, the first characters are the same, and the second character B is less than C; therefore, string ABC is less than string ACD.

[0064] Due to the multi-level indexing characteristics of skip lists, any node other than the first node corresponds to at least one index layer and has at least one predecessor node. Any node other than the first node corresponds to N index layers and has N predecessor nodes, which correspond to N first feature values, where N is an integer greater than 0.

[0065] The following example illustrates the comparison process using a skip list where nodes are sorted by keys in ascending order:

[0066] First, compare the target key with the key of the first node of the skip list. If the target key is the same as the key of the first node of the skip list, determine the matching node, and then no further operation is needed. Perform the subsequent read and write operations based on the matching node. If the target key is different from the key of the first node of the skip list, specifically, (1) if the target key is less than the key of the first node of the skip list, it means that the target key does not exist in the skip list. For the case of writing a new element, the insertion position can be determined before the first node to realize the write operation of the element to be written. For other cases, if the target key does not exist in the skip list, an error message can be output.

[0067] (2) If the target key is greater than the key of the first node of the skip list, the comparison needs to continue to generate a second feature value of the target key relative to the first node. The second feature value is used for the fork position of the target key relative to the key of the first node and at least part of the value of the target key after the fork position. The next node pointed to by the first node at the highest index level is determined as the node to be compared. The following process is executed repeatedly until the preset condition is met: the second feature value of the target key is compared with the first feature value of the node to be compared; if the two are different, the node to be compared in the next loop process is determined according to the size relationship indicated by the comparison result.

[0068] It is understood that the second feature value of the target key being compared and the first feature value of the node to be compared are generated relative to the same predecessor node. In the first case, if the second length is greater than the first length, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next iteration.

[0069] In the second case, if the second length is less than the first length, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

[0070] In the third case, if the second length is equal to the first length and the character in the second feature value is less than the character in the first feature value, the target key is indicated to be less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0071] In the fourth case, if the second length is equal to the first length and the character in the second feature value is greater than the character in the first feature value, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

[0072] For example, please refer to Figure 2 Assuming there is a target key S (let's say ******), in order to save comparison steps, in the absence of a predecessor node, assuming the fork position is 0, we can generate the feature value (0, ***) of the target key S and compare it with the first feature value (0, ABC) of the highest index layer of the head node a. At the same time, we generate the second feature value of the target key S relative to the head node a, let's say (α, β).

[0073] If the target key S is less than the head node a, then the target key S does not exist in the skip list, and the search is terminated. For example, suppose the target key S is ABADAB, the head node has no predecessor node, and the fork position is 0. Then the characteristic value (0, ABA) of the target key S is generated and compared with the first characteristic value (0, ABC) of the highest index layer of the head node a. Since ABA is less than ABC, the target key S is less than the head node a.

[0074] If the target key S is greater than the head node a, determine the next node e pointed to by the head node a at the highest index level as the node to be compared. For example, assuming the target key S is ABDDAB, the head node has no predecessor node, and the fork position is 0, the feature value (0, ABD) of the target key S can be generated and compared with the first feature value (0, ABC) of the highest index level of the head node a. If ABD is greater than ABC, then the target key S is greater than the head node a.

[0075] The second eigenvalue of the target key S (assumed to be (α, β)) is compared with the first eigenvalue (3, OXZ) of the highest index layer of the node to be compared. The following cases exist:

[0076] (1) α>3 indicates that the target key S and node a have a longer common prefix, and node e is larger than the target key S. Therefore, no comparison is needed, and the next node to be compared is the next node c pointed to by node a in the second-highest index level. For example, assuming the target key S is ABCDABC, the second characteristic value (α, β) of the target key S relative to the head node a is (4, ABC). The first length of the node to be compared, e, is 3, indicating that the character "O" at the fourth position of node e is larger than the character "D" at the fourth position of node a. The first length of the target key is 4, indicating that the character "D" at the fourth position of the target key S is the same as the character "D" at the fourth position of node a. Therefore, it is clear that the character "O" at the fourth position of node e is larger than the character "D" at the fourth position of the target key S, and node e is larger than the target key S.

[0077] (2) α < 3 indicates that the target key S and node a have a shorter common prefix. The target key S is larger than node a, which means that the target key S is also larger than node e. A second characteristic value of the target key S relative to node e is generated. The next node to be compared is the node following node e at the highest index level. For example, assuming the target key S is ABXXABC, then the second characteristic value (α, β) of the target key S relative to the head node a is (2, XXA). The first length of the node to be compared, e, is 3, indicating that the character at the third position of node e is the same as the character at the third position of node a. The first length of the target key is 2, indicating that the character at the third position of the target key S is greater than the character at the third position of node a. Therefore, the character at the third position of the target key S is obviously greater than the character at the third position of node e, meaning the target key S is greater than node e.

[0078] (3) α = 3, indicating that the fork positions are the same, then proceed with the next character comparison process. If β in the target key S is less than OXZ in node e, it means that the target key S is less than node e. The next node to be compared is the next node c pointed to by node a in the second highest index level.

[0079] (4) α = 3, indicating that the fork positions are the same, then proceed with the next character comparison process. If β in the target key S is greater than OXZ in node e, it means that the target key S is greater than node e. Generate the second feature value of the target key S relative to node e. The next node to be compared is the next node pointed to by node e at the highest index level.

[0080] In one possible implementation, if the characters in the first feature value and the characters in the second feature value are not all the remaining characters after the common prefix, and the second feature value is the same as the first feature value, the remaining characters of the target key after the common prefix and the remaining characters of the node to be compared after the common prefix can be compared.

[0081] For example, suppose we have keys A (ABCDEF), B (ABCEDFJE), and C (ABCEDFGF). Key B, relative to key A, shares the common prefix ABC and stores the three characters after the fork position, which is (3, EDF). Key C, relative to key A, also shares the common prefix ABC and stores the three characters after the fork position, which is also (3, EDF). The common prefixes are the same, and the three characters stored are also the same, but the stored characters are not all the remaining characters after the fork position. Therefore, comparing the last remaining part is comparing "JE" in key B and "GF" in key C.

[0082] In the first case, if the former is greater than the latter, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next iteration.

[0083] In the second case, if the former is less than the latter, the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0084] In the third case, if the remaining value in the target key is equal to the remaining value in the key of the node to be compared, indicating that the target key is the same as the key of the node to be compared, then the loop ends.

[0085] Using the example above, please refer to Figure 2 During the comparison of the second feature value of the target key S (let's say (α, β)) with the first feature value (3, OXZ) of the highest index level of the node to be compared, if they are the same (i.e., the fork positions are the same and the characters after the fork positions are also the same), then the remaining characters after the fork positions are compared, comparing the string content of the target key S and node e from the 6th character onwards. If the target key S is greater than node e, the second feature value of the target key S relative to node e is generated, and the next node to be compared is the node after node e in the highest index level. If the target key S is less than node e, the next node to be compared is the node c after node a in the second highest index level.

[0086] Those skilled in the art will understand that the above example illustrates that nodes in the skip list are sorted by keys from smallest to largest. Sorting nodes in the skip list by keys from largest to smallest also applies to this solution, and will not be elaborated upon here.

[0087] In this embodiment, for the key data type is string, by generating the first feature value and the second feature value mentioned above and comparing the two, the comparison process of the common prefix part is avoided, the comparison overhead is reduced, and the comparison efficiency is improved.

[0088] In other embodiments, the key stored in any node of the skip list is a composite key, which is a key composed of two or more attributes that uniquely identify any record in the table. The data types of the different keys in the composite key can be string type or integer type.

[0089] Here, the first and second eigenvalues ​​corresponding to the compound bond form are illustrated by example:

[0090] Please see Figure 4 The data structure for the first feature value shown includes the index of the forked key. If the data type of the forked key is string, the first feature value also includes the first length of the common prefix between the forked key of the node and the forked key of the predecessor node, and at least a portion of the characters of the forked key of the node relative to the forked key of the predecessor node after the common prefix. If the data type of the forked key is integer and has N bits, the first feature value also includes the high M bits of the N-bit integer of the forked key of the node, where M ≤ N.

[0091] In other words, if the data type of the forked key is string, the fork position information in the first feature value includes the index of the forked key and the first length; if the data type of the forked key is integer, the fork position information in the second feature value includes the index of the forked key.

[0092] Similarly, the second feature value includes the index of the forked key of the target key and the forked key of the predecessor node of the node to be compared. If the data type of the forked key is string, the second feature value also includes the second length of the common prefix between the forked key in the target key and the forked key of the predecessor node of the node to be compared, and at least a portion of the characters of the forked key in the target key relative to the forked key of the predecessor node of the node to be compared, after the common prefix. If the data type of the forked key is integer and the number of bits is N, the second feature value also includes the high M bits of the N-bit integer of the forked key in the target key; M≤N.

[0093] In other words, if the data type of the forked key is string, the fork position information in the second feature value includes the index of the forked key and the second length; if the data type of the forked key is integer, the fork position information in the second feature value includes the index of the forked key.

[0094] For example, in Table 1 below, the composite key can include grade, class, and name, where the data type of grade and class is integer, and the data type of name is string.

[0095] Table 1

[0096] grade class name score 1 3 Zhang San 95 2 4 Li Si 80 3 3 Zhang San 88 4 2 Wang Wu 65 5 1 Li Si 78

[0097] For example, the data type of the indices of different keys in a composite key can be integer. For instance, the indices of the different keys can be set to ascending order from left to right, with the first key having an index of 0, the second key an index of 1, the third key an index of 2, the fourth key an index of 3, and so on. Using the previous example, the index of the first key "Grade" would be 0, the index of the second key "Class" would be 1, and the index of the third key "Name" would be 2.

[0098] For example, the data type of the indices of different keys in a composite key can also be a character type. For instance, the index of the first key can be set to 'a', the index of the second key to 'b', the index of the third key to 'c', the index of the fourth key to 'd', and so on, in ascending order from left to right.

[0099] If the data type of the forked key is an integer and it is a signed integer, the signed integer must first be converted to an unsigned integer before taking the high M bits; this avoids the influence of the sign and ensures the accuracy of the comparison result.

[0100] For example, assuming M is 33, if the data type of the forked key is an integer and it is a signed integer, preprocessing is required. If the forked key is a 64-bit signed integer, add 0x8000000000000000 to convert it into a comparable 64-bit unsigned positive integer. If the forked key is a 32-bit or shorter signed integer, add 0x80000000 to convert it into a comparable 32-bit unsigned positive integer. After conversion to an unsigned positive integer, select the high 33 bits and discard the low bits. If the data type of the forked key is an integer and it is an unsigned integer, and if the forked key is an unsigned integer within 32 bits, use the original value directly; otherwise, select the high 33 bits and discard the low bits.

[0101] The following example illustrates the comparison process using a skip list where nodes are sorted by keys in ascending order, and the indices of different keys in a composite key increase sequentially from left to right.

[0102] First, the target key is compared with the key of the first node of the skip list. If the target key is greater than the key of the first node of the skip list, a second feature value of the target key relative to the first node is generated. The second feature value includes the index of the key of the branch of the target key relative to the first node, and the next node pointed to by the first node at the highest index level is determined as the node to be compared. The following process is repeated until a preset condition is met: the second feature value of the target key is compared with the first feature value of the node to be compared; if they are different, the node to be compared in the next loop is determined according to the size relationship indicated by the comparison result.

[0103] In the first case, if the index in the second feature value is greater than the index in the first feature value, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0104] In the second case, if the index in the second feature value is less than the index in the first feature value, it indicates that the target key is greater than the key of the node to be compared, generates a second feature value of the target key relative to the node to be compared, and determines the next node pointed to by the node to be compared in this index layer as the node to be compared in the next loop process.

[0105] In the third case, if the index in the second feature value is equal to the index in the first feature value, it indicates that the target key and the key of the branching node to be compared are the same. Then, based on the size relationship between the target key and the key of the node to be compared, indicated by the remaining content of the second feature value and the remaining content of the first feature value, the node to be compared in the next loop process is determined.

[0106] In one possible implementation, if the data type of the forked key is an integer, the second characteristic value of the target key also includes the high M bits of the N-bit integer of the forked key; M ≤ N. The first characteristic value of the node to be compared also includes the high M bits of the N-bit integer of the forked key; M ≤ N.

[0107] In the first case, if the integer in the second feature value is less than the integer in the first feature value, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0108] In the second case, if the integer in the second feature value is greater than the integer in the first feature value, it indicates that the target key is greater than the key of the node to be compared, generates a second feature value of the target key relative to the node to be compared, and determines the next node pointed to by the node to be compared in this index layer as the node to be compared in the next loop process.

[0109] In the third case, if the integer in the second feature value is equal to the integer in the first feature value, then the remaining content in the target key and the remaining content in the node to be compared are compared.

[0110] In another possible implementation, if the data type of the forked key is string, the first characteristic value of the node to be compared also includes the first length of the common prefix between the forked key of the node and the forked key of the predecessor node, and at least a portion of the characters of the forked key of the node after the common prefix; the second characteristic value of the target key also includes the second length of the common prefix between the forked key of the target key and the forked key of the predecessor node of the node to be compared, and at least a portion of the characters of the forked key of the target key after the common prefix.

[0111] In the first case, if the second length is greater than the first length, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0112] In the second case, if the second length is less than the first length, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

[0113] In the third case, if the second length is equal to the first length and the character in the second feature value is less than the character in the first feature value, the target key is indicated to be less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process.

[0114] In the fourth case, if the second length is equal to the first length and the character in the second feature value is greater than the character in the first feature value, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

[0115] For the forked key with a string data type, the relevant comparison process can be found in the description process for keys with a string data type, and will not be repeated here.

[0116] Those skilled in the art will understand that the above example illustrates that nodes in the skip list are sorted by keys from smallest to largest. Sorting nodes in the skip list by keys from largest to smallest also applies to this solution, and will not be elaborated upon here.

[0117] In this embodiment, for composite bonds, by generating the first and second feature values ​​and comparing them, the comparison of identical bonds is skipped, and the comparison starts from the forked bonds, which reduces the comparison overhead and improves the comparison efficiency.

[0118] In some embodiments, considering dynamic insertion / deletion scenarios, it's possible that node M might be inserted between adjacent nodes X and Y during a query. If a path X->M->Y is used for the search, when comparing node Y, the feature value of the key to be searched relative to M is used. However, the current record for node Y might still be the first feature value of node Y relative to node X, which hasn't been updated yet. This mismatched comparison could lead to incorrect comparison results. Therefore, please refer to... Figure 5 The first feature value further includes a first identifier of the predecessor node. The second feature value further includes a second identifier of the predecessor node of the node to be compared. In the process of comparing the second feature value of the target key with the first feature value of the node to be compared, the first identifier in the first feature value of the node to be compared is first compared with the second identifier in the second feature value of the target key. If they are the same, it indicates that the predecessor node of the node to be compared and the target key are the same. Then, other contents of the second feature value of the target key can be compared with other contents of the first feature value of the node to be compared. The relevant comparison process can be found in the above description and will not be repeated here.

[0119] If the first identifier in the first feature value of the node to be compared is different from the second identifier in the second feature value of the target key, then the target key is compared with the key of the node to be compared, that is, the entire content of the target key is compared with the entire content of the key of the node to be compared, so as to avoid mismatches that may lead to incorrect comparison results and ensure the accuracy of the comparison.

[0120] It is understood that this embodiment does not impose any limitation on the number of bits for the first and second feature values, and can be specifically set according to the actual application scenario. In one example, the number of bits for the first and second feature values ​​can be 64 bits. In another example, the number of bits for the first and second feature values ​​can be 128 bits. This embodiment of the specification does not impose any limitations on this.

[0121] For example, combining Figure 5 For example, let's take a first characteristic value that is 64 bits as an example. Figure 5 The diagram illustrates the number of bits in different parts of the first characteristic value; for example, the first identifier of the predecessor node can be 28 bits, and the index of the fork key can be 3 bits. If the fork key is an integer type, then... Figure 5 M is 33 bits; if the forked key is a string, the first length is 9 bits, and the length of the characters after the common prefix is ​​24 bits.

[0122] In some embodiments, nodes in the skip list are used to store keys, pointers to the next node, and a first feature value; wherein the first feature value and the pointer can be stored in the same cache line, thereby reducing the probability of cache misses during the comparison process. The various technical features in the above embodiments can be arbitrarily combined, as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, not all combinations are described individually; therefore, any combination of the various technical features in the above embodiments is also within the scope of this specification.

[0123] In some embodiments, please refer to Figure 6 This specification also provides a storage system including a data read / write device and a skip list; the system includes multiple index layers, and the nodes in the skip list are used to store keys and a first feature value of the node relative to its predecessor node. The first feature value is used to record the fork position information of the key of the node and the key of the predecessor node, as well as at least a portion of the value after the fork position; the data read / write device is used to execute the method described in any of the above embodiments.

[0124] For example, the data read / write device includes a target key acquisition module, a comparison module, and a read / write module.

[0125] The target key acquisition module is used to acquire the target key of the element to be read or written.

[0126] The comparison module is configured to, if the target key is different from the key of the first node of the skip list, determine the next node pointed to by the first node at the highest index level as the node to be compared, and repeatedly execute the following process until a preset condition is met: compare the second feature value of the target key with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the key of the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position; if the two are different, determine the node to be compared in the next loop process according to the size relationship indicated by the comparison result;

[0127] The read / write module is used to perform read / write operations on the element to be read / written based on the comparison node in the last loop process if preset conditions are met.

[0128] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0129] In some embodiments, Figure 7 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 7At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, memory 708, and non-volatile memory 710, and may also include other hardware required for business operations. One or more embodiments of this specification can be implemented in software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into memory 708 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0130] in, Figure 6 The data read / write device shown can be applied to, for example... Figure 7 The device shown is used to implement the technical solution described in this specification.

[0131] In some embodiments, this specification also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor implements the method described in any one of the above embodiments by executing the executable instructions.

[0132] In some embodiments, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the method as described in any of the preceding embodiments.

[0133] In some embodiments, the electronic device integrates a computer program product, and when the electronic device executes the computer program product, it implements the data read / write method provided in the embodiments of this specification.

[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0135] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.

[0136] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0137] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0138] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0139] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0140] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0141] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0142] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."

[0143] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A data read / write method based on a skip list, characterized in that, The skip list includes multiple index layers. Nodes in the skip list store keys and a first feature value. The first feature value records the fork position of the node's key relative to the key of its predecessor node, and at least a portion of the value of the node's key after the fork position. The method includes: Get the target key of the element to be read or written; If the target key is different from the key of the first node of the skip list, determine the next node pointed to by the first node at the highest index level as the node to be compared, and repeat the following process until a preset condition is met: The second feature value of the target key is compared with the first feature value of the node to be compared; wherein, the second feature value is used to record the fork position of the target key relative to the predecessor node of the node to be compared, and at least a portion of the value of the target key after the fork position; If the two are different, the node to be compared in the next loop process is determined according to the size relationship indicated by the comparison result. The node to be compared in the next loop process is the next node pointed to by the current node to be compared in this index layer or the next node pointed to by the predecessor node of the current node to be compared in the next index layer. If the preset conditions are met, the read and write operations of the element to be read and written are performed based on the node to be compared in the last loop process.

2. The method according to claim 1, characterized in that, The elements to be read and written include elements to be read and elements to be written. If it is an element to be read, the preset conditions include: the target key is the same as the key of the node to be compared; If it is an element to be written, the preset conditions include: the target key is the same as the key of the node to be compared or there is no next node to be compared.

3. The method according to claim 1, characterized in that, The step of determining the node to be compared in the next iteration based on the size relationship indicated by the comparison result includes: If the nodes in the skip list are sorted by key from smallest to largest, and if the comparison result indicates that the target key is less than the key of the node to be compared, the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process; if the comparison result indicates that the target key is greater than the key of the node to be compared, the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process. If the nodes in the skip list are sorted by key from largest to smallest, if the comparison result indicates that the target key is greater than the key of the node to be compared, the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process; if the comparison result indicates that the target key is less than the key of the node to be compared, the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

4. The method according to any one of claims 1 to 3, characterized in that, The data type of the key stored in any node of the skip list is string; The first characteristic value of any node includes: the first length of the common prefix between the key of the node and the key of the predecessor node, and at least a portion of the characters of the key of the node after the common prefix; The second characteristic value of the target key includes: the second length of the common prefix between the target key and the key of the predecessor node of the node to be compared, and at least a portion of the characters of the target key after the common prefix.

5. The method according to claim 4, characterized in that, The method further includes: If the target key is different from the key of the first node of the skip list, generate a second feature value of the target key relative to the first node; If the nodes in the skip list are sorted in ascending order of keys, and if the two are different, the node to be compared in the next iteration is determined based on the size relationship indicated by the comparison result, including: If the second length is greater than the first length, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process; If the second length is less than the first length, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process; If the second length is equal to the first length and the character in the second feature value is less than the character in the first feature value, the target key is indicated to be less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process. If the second length is equal to the first length and the character in the second feature value is greater than the character in the first feature value, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

6. The method according to claim 5, characterized in that, In the case where the characters in the first feature value and the characters in the second feature value are not all the remaining characters after the common prefix, the following is also included: If the second feature value is the same as the first feature value, compare the remaining characters in the target key after the common prefix with the remaining characters in the node to be compared after the common prefix. If the former is greater than the latter, generate a second feature value of the target key relative to the node to be compared, and determine the next node pointed to by the node to be compared in this index layer as the node to be compared in the next loop process; If the former is smaller than the latter, the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process; If the former equals the latter, it indicates that the target key is the same as the key of the node to be compared, and the loop ends.

7. The method according to any one of claims 1 to 3, characterized in that, The key stored in any node of the skip list is a composite key, and the data types of the different keys in the composite key include string type or integer type; The first feature value of any node includes the index of the key from which the node branches off to its predecessor node; if the data type of the branch key is string, the first feature value also includes the first length of the common prefix between the branch key of the node and the branch key of the predecessor node, and at least a portion of the characters of the branch key of the node after the common prefix; if the data type of the branch key is integer and the number of bits is N, the first feature value also includes the high M bits of the N-bit integer of the branch key of the node, where M≤N; The second feature value includes the index of the forked key of the target key and the predecessor node of the node to be compared; if the data type of the forked key is string type, the second feature value also includes the second length of the common prefix between the forked key in the target key and the forked key of the predecessor node of the node to be compared, and at least a portion of the characters of the forked key in the target key after the common prefix; if the data type of the forked key is integer type and the number of bits is N, the second feature value also includes the high M bits of the N-bit integer of the forked key in the target key; M≤N.

8. The method according to claim 7, characterized in that, The method further includes: If the target key is different from the key of the first node of the skip list, generate a second feature value of the target key relative to the first node; If the nodes in the skip list are sorted in ascending order of keys, and if the two are different, the node to be compared in the next iteration is determined based on the size relationship indicated by the comparison result, including: If the index in the second feature value is greater than the index in the first feature value, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process. If the index in the second feature value is less than the index in the first feature value, it indicates that the target key is greater than the key of the node to be compared, generates the second feature value of the target key relative to the node to be compared, and determines the next node pointed to by the node to be compared in this index layer as the node to be compared in the next loop process; If the index in the second feature value is equal to the index in the first feature value, the node to be compared in the next iteration is determined based on the size relationship between the target key and the key of the node to be compared, as indicated by the remaining content of the second feature value and the remaining content of the first feature value.

9. The method according to claim 8, characterized in that, When the data type of the forked key is an integer, determining the node to be compared in the next iteration based on the size relationship between the target key and the key of the node to be compared, as indicated by the remaining content of the second feature value and the remaining content of the first feature value, includes: If the integer in the second feature value is less than the integer in the first feature value, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process. If the integer in the second feature value is greater than the integer in the first feature value, it indicates that the target key is greater than the key of the node to be compared, generates the second feature value of the target key relative to the node to be compared, and determines the next node pointed to by the node to be compared in this index layer as the node to be compared in the next loop process.

10. The method according to claim 8, characterized in that, When the data type of the forked key is string, determining the node to be compared in the next iteration based on the size relationship between the target key and the key of the node to be compared, as indicated by the remaining content of the second feature value and the remaining content of the first feature value, includes: If the second length is greater than the first length, it indicates that the target key is less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process; If the second length is less than the first length, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process; If the second length is equal to the first length and the character in the second feature value is less than the character in the first feature value, the target key is indicated to be less than the key of the node to be compared, and the next node pointed to by the predecessor node of the node to be compared in the next index layer is determined as the node to be compared in the next loop process. If the second length is equal to the first length and the character in the second feature value is greater than the character in the first feature value, the target key is indicated to be greater than the key of the node to be compared, a second feature value of the target key relative to the node to be compared is generated, and the next node pointed to by the node to be compared in this index layer is determined as the node to be compared in the next loop process.

11. The method according to claim 1, characterized in that, The first feature value also includes a first identifier of the predecessor node; the second feature value also includes a second identifier of the predecessor node of the node to be compared. The step of comparing the second feature value of the target key with the first feature value of the node to be compared includes: If the first identifier in the first feature value of the node to be compared is the same as the second identifier in the second feature value of the target key, then the other contents in the second feature value of the target key are compared with the other contents in the first feature value of the node to be compared. The method further includes: If the first identifier in the first feature value of the node to be compared is different from the second identifier in the second feature value of the target key, then the target key is compared with the key of the node to be compared.

12. A storage system, characterized in that, It includes a data read / write device and a skip list; the nodes in the skip list are used to store keys and a first feature value of the node relative to the predecessor node, the first feature value being used to record the fork position information of the key of the node and the key of the predecessor node and at least a portion of the value after the fork position. The data read / write device is used to perform the method described in any one of claims 1 to 11.

13. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1 to 11 by executing the executable instructions.

14. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1 to 11.