Data query method, medium, equipment and product

By snub table storage joint index, and using hash tables and bidirectional linked lists for data query, the file sorting loss problem caused by B+ tree storage is solved, and the query performance of the database is improved.

CN120256445APending Publication Date: 2025-07-04KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510346209.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, when using B+ tree to store joint indexes, the additional file sorting loss caused by the out-of-order of leaf node data reduces the data query performance.

Method used

The joint index is stored by skipping tables, and data query is carried out through hash tables and two-way linked lists to avoid file sorting operations and improve query performance.

Benefits of technology

There is no need for additional file sorting operations when querying data, which significantly improves the query performance of the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256445A_ABST
    Figure CN120256445A_ABST
Patent Text Reader

Abstract

The invention provides a data query method, a medium, equipment and a product, and the method comprises the steps: analyzing a data query request, and obtaining a query condition; based on query fields in the query conditions and the to-be-queried data table, determining a hit target joint index and the number of the hit fields; in a skip list storing the target joint index, querying a hash table of a hierarchy corresponding to the number of fields, the number of the layers of the skip list being determined based on the total number of index fields contained in the target joint index, and each node of a bottom layer linked list of the skip list storing a primary key of each piece of data and a corresponding joint index field value according to a primary key sequence of a to-be-queried data table; and in response to a hash value matched with the field value in the query condition in the hash table, executing a data query operation based on the target double linked list corresponding to the hash value. According to the method, the target joint index can be stored by using the skip list, file sorting operation does not need to be executed when data query is executed, and the query performance of the database is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of Internet technology, data processing and application technology, and in particular, to a data query method, medium, device and product. Background Art

[0002] With the development and application of Internet technology, data query is applied in more scenarios and fields, and the requirement for data query speed is also getting higher and higher. Establishing a composite index is a commonly used way to optimize query performance.

[0003] In the related art, the composite index is stored in the form of a B+ tree. In the B+ tree structure, each data is recorded in the order of the fields of the composite index. Therefore, the identifiers of the data recorded in the leaf nodes are out of order. When using this composite index for data query, it causes additional file sorting loss and reduces the data query performance. Summary of the Invention

[0004] To solve the above technical problems, embodiments of the present disclosure provide a data query method, medium, device and product.

[0005] According to a first aspect of the embodiments of the present disclosure, a data query method is provided, including:

[0006] Parsing a data query request to obtain a query condition;

[0007] Based on the query fields in the query condition and the data table to be queried, determining the hit target composite index and the number of hit fields;

[0008] In the skip list storing the target composite index, querying the hash table at the level corresponding to the number of fields. The number of layers of the skip list is determined based on the total number of index fields included in the target composite index. Each node of the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding composite index field value in the order of the primary key of the data table to be queried;

[0009] In response to the hash table having a hash value matching the field value in the query condition, performing a data query operation based on the target doubly linked list corresponding to the hash value.

[0010] In some embodiments of the present disclosure, the performing a data query operation based on the target doubly linked list corresponding to the hash value includes:

[0011] Traversing each node in the target doubly linked list;

[0012] Based on the pointers of each node in the target doubly linked list pointing to the nodes in the next-level linked list, obtaining the data that meets the query condition from the bottom linked list of the skip list.

[0013] In still some other embodiments of the present disclosure, in response to receiving an operation of adding new data based on the skip list, the method further includes:

[0014] Insert a new data node into the bottom - level linked list of the skip list, and update the pointer information of the previous node of the new data node. The node information of each node in the bottom - level linked list of the skip list includes the forward pointer, backward pointer, and node data of the node;

[0015] Determine whether there is a hash value corresponding to the new data node in the hash table of the upper level of the skip list;

[0016] In response to there being no hash value corresponding to the new data node in the hash table of the upper level of the skip list, add the hash value corresponding to the new data node to the hash table of the upper level, create a doubly - linked list based on the hash value corresponding to the new data node, and add the corresponding node to the created doubly - linked list;

[0017] In response to there being a hash value corresponding to the new data node in the hash table of the upper level of the skip list, add the node corresponding to the new data node to the doubly - linked list of the hash value corresponding to the new data node;

[0018] Iteratively execute the operation of determining whether there is a hash value corresponding to the new data node in the hash table of the upper level of the skip list until the update operation based on the new data node is completed for all levels of the linked lists of the skip list.

[0019] In still some other embodiments of the present disclosure, in response to receiving an operation of modifying data based on the skip list, the method further includes:

[0020] Modify the source data indicated by the modify - data operation in the bottom - level linked list of the skip list to the target data. The source data is the original data corresponding before executing the modify - data operation, and the target data is the data obtained after executing the modification operation based on the modify - data operation;

[0021] Delete the node corresponding to the source data indicated by the modify - data operation in the linked list of the upper level of the skip list, and determine whether there is a hash value corresponding to the target data in the hash table of the upper level of the skip list;

[0022] In response to there being no hash value corresponding to the target data in the hash table of the upper level of the skip list, add the hash value corresponding to the target data to the hash table of the upper level, create a doubly - linked list based on the hash value corresponding to the target data, and add the node corresponding to the target data to the created doubly - linked list;

[0023] In response to the hash value corresponding to the target data being present in the hash table of the upper level of the skip list, adding a node corresponding to the target data to the doubly linked list of the hash value corresponding to the target data;

[0024] Iteratively execute the operation of determining whether the hash value corresponding to the target data is present in the hash table of the upper level of the skip list until the update operations based on the target data are completed for all levels of the linked lists of the skip list.

[0025] In some other embodiments of the present disclosure, in response to receiving a delete data operation based on the skip list, the method further includes:

[0026] Deleting the nodes corresponding to the data indicated by the delete data operation in all levels of the linked lists of the skip list.

[0027] In some other embodiments of the present disclosure, determining the target combined index that is hit and the number of fields that are hit based on the query fields in the query condition and the data table to be queried includes:

[0028] Determining the fields that the query condition hits and the number of fields;

[0029] According to the leftmost prefix principle, selecting, from the combined indexes of the data table to be queried, the combined index that matches the fields as the target combined index.

[0030] In some other embodiments of the present disclosure, after querying the hash table of the level corresponding to the number of fields, it further includes:

[0031] In response to there being no hash value in the hash table that matches the field value in the query condition, generating a prompt message indicating that the query result is empty.

[0032] According to a second aspect of the embodiments of the present disclosure, there is provided a data query device, including:

[0033] A parsing module, configured to parse a data query request to obtain a query condition;

[0034] A first determination module, configured to determine the target combined index that is hit and the number of fields that are hit based on the query fields in the query condition and the data table to be queried;

[0035] A query module, configured to query the hash table of the level corresponding to the number of fields in a skip list storing the target combined index, where the number of levels of the skip list is determined based on the total number of index fields included in the target combined index, and each node of the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding combined index field value in the order of the primary key of the data table to be queried;

[0036] An execution module, configured to perform a data query operation based on a target doubly linked list corresponding to a hash value in response to there being a hash value in the hash table that matches a field value in the query condition.

[0037] In some embodiments of the present disclosure, the execution module includes:

[0038] A traversal sub-module, configured to traverse each node in the target doubly linked list;

[0039] An acquisition sub-module, configured to acquire data that meets the query condition from the bottom-level linked list of the skip list based on pointers of each node in the target doubly linked list that point to nodes in the next-level linked list.

[0040] In still some other embodiments of the present disclosure, the apparatus further includes:

[0041] An insertion module, configured to insert a newly added data node into the bottom-level linked list of the skip list and update pointer information of the previous node of the newly added data node, where node information of each node in the bottom-level linked list of the skip list includes a forward pointer, a backward pointer, and node data;

[0042] A second determination module, configured to determine whether there is a hash value corresponding to the newly added data node in the hash table of the upper level of the skip list;

[0043] A first addition module, configured to, in response to there being no hash value corresponding to the newly added data node in the hash table of the upper level of the skip list, add the hash value corresponding to the newly added data node to the hash table of the upper level, create a doubly linked list based on the hash value corresponding to the newly added data node, and add corresponding nodes to the created doubly linked list;

[0044] A second addition module, configured to, in response to there being a hash value corresponding to the newly added data node in the hash table of the upper level of the skip list, add the node corresponding to the newly added data node to the doubly linked list corresponding to the hash value of the newly added data node;

[0045] A first iteration module, configured to iteratively perform the operation of determining whether there is a hash value corresponding to the newly added data node in the hash table of the upper level of the skip list until update operations based on the newly added data node are completed for linked lists of all levels of the skip list.

[0046] In still some other embodiments of the present disclosure, the apparatus further includes:

[0047] A modification module for modifying the source data indicated by the modification data operation in the underlying linked list of the skip list into target data, where the source data is the original data corresponding before the execution of the modification data operation, and the target data is the data obtained after the modification operation is executed based on the modification data operation;

[0048] A third determination module for deleting the node corresponding to the source data indicated by the modification data operation in the linked list of the upper level of the skip list, and determining whether there is a hash value corresponding to the target data in the hash table of the upper level of the skip list;

[0049] A third addition module for, in response to there being no hash value corresponding to the target data in the hash table of the upper level of the skip list, adding the hash value corresponding to the target data in the upper level hash table, and creating a doubly linked list based on the hash value corresponding to the target data and adding the node corresponding to the target data in the created doubly linked list;

[0050] A fourth addition module for, in response to there being a hash value corresponding to the target data in the hash table of the upper level of the skip list, adding the node corresponding to the target data in the doubly linked list corresponding to the hash value of the target data;

[0051] A second iteration module for iteratively executing the operation of determining whether there is a hash value corresponding to the target data in the hash table of the upper level of the skip list until the update operations based on the target data are completed for the linked lists of all levels of the skip list.

[0052] In some other embodiments of the present disclosure, the apparatus further includes:

[0053] A deletion module for, in response to receiving a data deletion operation based on the skip list, deleting the nodes corresponding to the data indicated by the data deletion operation in the linked lists of all levels of the skip list.

[0054] In some other embodiments of the present disclosure, the first determination module includes:

[0055] A determination sub-module for determining the fields and the number of fields hit by the query condition;

[0056] A selection sub-module for, in accordance with the leftmost prefix principle, selecting the combined index that matches the fields in each combined index of the data table to be queried as the target combined index.

[0057] In some other embodiments of the present disclosure, the apparatus further includes:

[0058] A prompt module for, in response to there being no hash value in the hash table that matches the field value in the query condition, generating a prompt message indicating that the query result is empty.

[0059] According to the third aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. The storage medium stores computer program instructions, and when the computer program instructions are executed, the above data query method is implemented.

[0060] According to the fourth aspect of the embodiments of the present disclosure, an electronic device is provided. The electronic device includes:

[0061] A memory for storing a computer program product;

[0062] A processor for executing the computer program product stored in the memory, and when the computer program product is executed, the above data query method is implemented.

[0063] According to the fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including computer program instructions, and when the computer program instructions are executed by a processor, the above data query method is implemented.

[0064] Based on the above embodiments of the present disclosure, when a data query request is received, the data query request is parsed to obtain query conditions; based on the query conditions, the target combined index and the number of fields hit are determined; in the skip list storing the target combined index, the hash table at the level corresponding to the number of fields is queried. The number of levels of the skip list is determined based on the total number of index fields included in the target combined index. Each node in the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding combined index field value in the order of the primary key of the data table to be queried. In response to the existence of a hash value in the hash table that matches the field value in the query conditions, a data query operation is performed based on the target doubly linked list corresponding to the hash value. Thus, the technical solution of the present disclosure can use a skip list to store the target combined index. Since the node data in the bottom linked list of the skip list is stored in the order of the primary key of the data table to be queried, no file sorting operation needs to be performed during data query, improving the query performance of the database.

[0065] The technical solution of the present disclosure will be further described in detail below with reference to the drawings and embodiments. Description of the Drawings

[0066] By describing the embodiments of the present disclosure in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present disclosure will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation to the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0067] Figure 1 It is a flowchart of the data query method provided for an exemplary embodiment of the present disclosure;

[0068] Figure 2 Schematic diagram of jump representation corresponding to the storage target union of the present disclosure;

[0069] Figure 3 Flowchart of data query execution based on a target doubly linked list provided by an exemplary embodiment of the present disclosure;

[0070] Figure 4 Flowchart of data addition provided by an exemplary embodiment of the present disclosure;

[0071] Figure 5 Flowchart of data modification provided by an exemplary embodiment of the present disclosure;

[0072] Figure 6 Flowchart of determining a target union index provided by an exemplary embodiment of the present disclosure;

[0073] Figure 7 Schematic diagram of the structure of a data query device provided by an exemplary embodiment of the present disclosure;

[0074] Figure 8 Schematic diagram of the structure of a data query device provided by another exemplary embodiment of the present disclosure;

[0075] Figure 9 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. Detailed implementation manners

[0076] Hereinafter, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the exemplary embodiments described herein.

[0077] It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present disclosure.

[0078] Those skilled in the art can understand that terms such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and do not represent any specific technical meaning, nor do they indicate an inevitable logical order between them.

[0079] It should also be understood that in the embodiments of the present disclosure, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.

[0080] It should also be understood that for any component, data or structure mentioned in the embodiments of the present disclosure, unless clearly defined or given a contrary indication in the context, it can generally be understood as one or more.

[0081] In addition, the term "and / or" in this disclosure is merely a description of the relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0082] It should also be understood that the descriptions of the various embodiments in this disclosure emphasize the differences between the embodiments, and the same or similar aspects can be referred to each other. For the sake of brevity, they will not be elaborated one by one.

[0083] At the same time, it should be understood that for the convenience of description, the dimensions of the various parts shown in the drawings are not drawn in actual proportional relationships.

[0084] The following description of at least one exemplary embodiment is actually only illustrative and in no way limits the present disclosure and its application or use.

[0085] Well-known technologies, methods, and devices for those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said technologies, methods, and devices should be regarded as part of the specification.

[0086] It should be noted that like reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0087] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0088] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0089] Overview of the present disclosure

[0090] In the process of implementing the present disclosure, the inventors found that when storing a composite index in the manner of a B+ tree, the data is recorded in the B+ tree structure in the order of the fields of the composite index. Therefore, the data recorded in the leaf nodes is out of order. When using this composite index for data query, additional file sorting overhead is generated, reducing the data query performance.

[0091] In the data query method provided by the present disclosure, the composite index is stored in the form of a skip list. When querying data, no additional file sorting operation is required, improving the data query performance.

[0092] Exemplary method

[0093] Figure 1 It is a flowchart of the data query method provided by an exemplary embodiment of the present disclosure. This method can be applied to electronic devices (such as computers, servers), as Figure 1 The method shown includes step 101-step 104. Each step will be described separately below.

[0094] In step 101, the data query request is parsed to obtain the query condition.

[0095] Among them, the data query request is a request sent by the user through the client to query data in the database. In this embodiment, the data query request is a query request based on a composite index. For example, the user uses the sql statement "select * from tab where col1 = A1 and col2 = B1 order by id;" to trigger the data query request, which contains two query fields "col1" and "col2".

[0096] Among them, the query condition is used to filter out data records that meet the conditions, and may include the field values of the query fields and the data table to be queried. For example, the query condition indicated by the above query statement "select * from tab where col1 = A1 and col2 = B1 order by id;" is the data records in the tab table that satisfy col1 = A1 and col2 = B1, and the retrieval result is sorted in the order of the id primary key.

[0097] In step 102, based on the query fields and the data table to be queried in the query condition, determine the hit target composite index and the number of hit fields.

[0098] Among them, the target composite index is used to indicate the composite index hit by the query condition. For example, the query condition indicates retrieving data according to two query fields "col1" and "col2". Since when using a composite index for query, the query condition needs to follow the leftmost prefix principle of the columns in the index and match from left to right, the target composite index that is hit can be obtained from the data table to be queried according to the query fields in the query condition.

[0099] In the present disclosure, in order to improve the query performance of the data table to be queried, multiple composite indexes may be created for the query of the data table to be queried according to common query conditions, and each composite index is stored using a skip list. For example, for table1, two composite indexes are created. The index fields included in composite index 1 are "gender" and "score", and the index fields included in composite index 2 are "class" and "score". If a certain data query request wants to query the results where "gender = female" and "score > 90 points" in table1, then according to the query fields and the data table to be queried, it can be determined that the target composite index that is hit is composite index 1.

[0100] In this embodiment, the number of hit fields is the number of query fields.

[0101] In step 103, in the skip list storing the target composite index, query the hash table at the level corresponding to the number of query fields.

[0102] Among them, the skip list storing the target composite index is a multi-level linked list.

[0103] In the present disclosure, the number of layers of the skip list storing the target composite index is determined based on the total number of index fields included in the target composite index. The number of layers of the skip list is 1 more than the total number of index fields of the target composite index. For example, if the total number of index fields of the target composite index is 3, then the number of layers of the skip list of the target composite index is 4.

[0104] Among them, the field number corresponding level is used to indicate the level in the skip list that matches the number of fields in the query condition. In the present disclosure, except for the bottom linked list, other levels each include a hash table and one or more linked lists with the same number of hash values as in the hash table, and each linked list is a doubly linked list.

[0105] In the present disclosure, the hash table of the field number corresponding level refers to the hash table of the level in the skip list that matches the number of fields in the query condition.

[0106] In the present disclosure, each node of the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding combined index field value in the order of the primary key of the data table to be queried. The bottom linked list of the skip list is a doubly linked list, and each node in the linked list stores the primary key of each piece of data and the corresponding combined index field value, and each node is stored in the order of the primary key.

[0107] Exemplarily, referring to Table 1, which illustrates 8 pieces of data in the data table table1.

[0108] Table 1

[0109] id col1 col2 col3 1 A2 B1 C2 2 A1 B1 C1 3 A1 B1 C2 4 A2 B2 C1 5 A1 B1 C1 6 A2 B1 C3 7 A1 B1 C1 8 A2 B2 C2

[0110] In Table 1, id is the primary key of the data table table1, and col1, col2, and col3 are the fields of the data table. For the data table table1, a target combined index including col1, col2, and col3 is created, and the skip list storing the target combined index is as Figure 2 shown, as Figure 2 In it, the bottom linked list is a doubly linked list, and each node in the bottom linked list stores the combined index field value in the order of id. Each layer above the bottom linked list includes a hash table and one or more doubly linked lists corresponding to each hash value in the hash table. The hash table also stores the head and tail information of the doubly linked list corresponding to each hash value. For example, in the hash table of the layer above the bottom linked list, the field value of the index field col1 is stored. Based on each node in the bottom linked list, it can be known that there are only two field values, A1 and A2, for the index field col1. Therefore, there are two hash values, "col1:A1" and "col1:A2", recorded in the hash table, and the doubly linked list corresponding to the hash value "col1:A2" includes 4 nodes, which respectively point to the four nodes with id:1, id:4, id:6, and id:8 in the bottom linked list.

[0111] In step 104, in response to there being a hash value in the hash table that matches the field value in the query condition, based on the target doubly linked list corresponding to the hash value, perform a data query operation.

[0112] Among them, after obtaining the hash value that matches the field value in the query condition in the hash table, the doubly linked list corresponding to the hash value can be determined as the target doubly linked list, and the query result can be obtained according to the pointer information of each node in the target doubly linked list. For the specific implementation method, please refer to Figure 3 the embodiments shown, which will not be elaborated here for the time being.

[0113] In some other implementation manners, in response to the absence of a hash value in the hash table that matches the field value in the query condition, a prompt message indicating that the query result is empty is generated to prompt the user that the query result of the data query request is empty.

[0114] Through the above steps 101 - 104, when receiving a data query request, the data query request is parsed to obtain a query condition; based on the query condition, the hit target composite index and the number of hit fields are determined; in the skip list storing the target composite index, the hash table at the level corresponding to the number of fields is queried. Each node in the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding composite index field value in the primary key order of the data table to be queried; in response to the presence of a hash value in the hash table that matches the field value in the query condition, a data query operation is performed based on the target doubly linked list corresponding to the hash value. Thus, the technical solution of the present disclosure can use a skip list to store the target composite index. Since the node data in the bottom linked list of the skip list is stored in the primary key order of the data table to be queried, there is no need to perform a file sorting operation during data query, improving the query performance of the database.

[0115] Figure 3 FIG. is a flowchart of performing data query based on a target doubly linked list provided by an exemplary embodiment of the present disclosure. The embodiments of the present disclosure are exemplarily described by taking how to perform data query as an example. On the basis of the above Figure 1 shown embodiments, step 104 includes the following steps 141 - 142. Each step will be described separately below.

[0116] In step 141, each node in the target doubly linked list is traversed.

[0117] Among them, after obtaining the hash value that matches the field value in the query condition in the hash table, the doubly linked list corresponding to the hash value can be determined as the target doubly linked list, and each node in the target doubly linked list is traversed.

[0118] Preferably, in the embodiment of the present disclosure, the target doubly linked list is traversed in the order from the head to the tail of the list, which can ensure that the retrieved query result is sorted in the primary key order of the data.

[0119] Among them, each node in the target doubly linked list contains three pointer information, namely, a forward pointer, a backward pointer, and a pointer pointing to a node in the linked list of the next level. The forward pointer is a pointer pointing to the previous node, the backward pointer is a pointer pointing to the next node, and the pointer pointing to a node in the linked list of the next level is a pointer pointing to a node in the doubly linked list of the next level of the skip list. According to the pointers pointing to the nodes in the linked list of the next level in each level linked list, the corresponding nodes in the bottom linked list can be found to implement data retrieval.

[0120] It can be understood that the forward pointer of the header node is usually NULL, which is used to identify the start position of the linked list, and the backward pointer of the tail node is usually NULL, which is used to identify the end position of the linked list.

[0121] In step 142, based on the pointers pointing to the nodes in the linked list of the next level of each node in the target doubly linked list, the data that meets the query conditions is obtained from the bottom linked list of the skip list.

[0122] In the present disclosure, all nodes in the target doubly linked list can be obtained according to the forward pointer and backward pointer of each node in the target doubly linked list, while the query result that meets the query conditions in the bottom linked list can be obtained according to the pointer pointing to the node in the linked list of the next level of each node in the target doubly linked list.

[0123] Exemplarily, refer to Figure 2 , in response to receiving a data query request indicated by the query statement "select * from table1 where col1 = A1 and col2 = B1 order by id;", since the hash value matched by the field values in the query condition is "col1 = A1 col2 = B1", the hash value is obtained from the hash table on the second layer above the bottom linked list, and the target doubly linked list corresponding to the hash value is obtained. Its header is the node indicated by label 21, and its tail is the node indicated by label 22. By traversing the target doubly linked list, four nodes can be obtained; according to the pointer pointing to the node in the linked list of the next level of the node indicated by label 21, the node with label 23 can be queried, and according to the pointer pointing to the node in the linked list of the next level of the node with label 23, the node with label 24 in the bottom linked list can be obtained, and the query result that meets the query conditions is obtained. By analogy, all query results that meet the conditions can be obtained based on the pointers pointing to the nodes in the linked list of the next level of other nodes in the target doubly linked list.

[0124] Through the above-mentioned Step 141 - Step 142, an implementation method for obtaining a query result according to a doubly linked list corresponding to a hash value is disclosed. By means of the pointers of the doubly linked list, the query result that meets the query conditions can be quickly retrieved, and it can be ensured that the retrieved query result is sorted according to the primary key of the data, without the need to perform a sorting operation again, thus improving the query efficiency.

[0125] Figure 4 The flowchart of data addition provided by an exemplary embodiment of the present disclosure. This embodiment takes how to add data in a skip list as an example for exemplary illustration. As Figure 4 shown, it includes the following steps 401 - Step 405. Each step will be described separately below.

[0126] In Step 401, insert a newly added data node into the bottom - layer linked list of the skip list, and update the pointer information of the previous node of the newly added data node. The node information of each node in the bottom - layer linked list of the skip list includes the forward pointer, backward pointer, and node data of the node.

[0127] In the present disclosure, when inserting newly added data into a data table, correspondingly, it is necessary to query the index of the newly added data in the skip list of the composite index of the data table.

[0128] In specific implementation, the node corresponding to the newly added data can be inserted into the bottom - layer linked list of the skip list first. Since when adding new data to a data table, it is usually inserted at the end of the data table, when inserting a newly added data node into the bottom - layer linked list of the skip list of the composite index, the newly added data node is also added at the end of the bottom - layer linked list. For example, if the original end of the bottom - layer linked list is the node with id 8, and a new node with id 9 is added at this time, then the backward pointer of the node with id 8 needs to be changed to the node with id 9, and the forward pointer of the newly added data node points to the node with id 8, and the backward pointer points to NULL. The node data of the newly added data node is the same as the data inserted into the data table.

[0129] In Step 402, determine whether there is a hash value corresponding to the newly added data node in the hash table of the upper level of the skip list.

[0130] In this embodiment, after inserting the newly added data node into the bottom - layer linked list, it is necessary to update each upper - layer linked list layer by layer.

[0131] In specific implementation, after inserting the newly added data node into the bottom - layer linked list, it can be determined layer by layer whether there is a hash value corresponding to the newly added data node in the hash table of the upper level. For example, if the node data corresponding to the newly added data node is "col1 = A3 col2 = B1 col3 = C1", then Figure 2There is no hash value of "col1 = A3" in the hash table of the upper layer of the middle-bottom linked list; if the node data corresponding to the newly added data node is "col1 = A1 col2 = B1 col3 = C1", then in Figure 2 there is a hash value of "col1 = A1" in the hash table of the upper layer of the middle-bottom linked list.

[0132] Further, if there is no hash value corresponding to the newly added data node in the hash table of the upper level of the skip list, execute step 403; if there is a hash value corresponding to the newly added data node in the hash table of the upper level of the skip list, execute step 404.

[0133] In step 403, add the hash value corresponding to the newly added data node to the hash table of the upper level, create a doubly linked list based on the hash value corresponding to the newly added data node, and add the corresponding node to the created doubly linked list.

[0134] Among them, if there is no hash value corresponding to the newly added data node in the hash table of the upper level, the hash value corresponding to the index field of this level can be added to the hash table. For example, add the hash value of "col1 = A" to the hash table of the upper level of the bottom linked list. After adding this hash value, the doubly linked list corresponding to this hash value can be created.

[0135] It can be understood that the initial value of the newly created doubly linked list is empty. After adding the corresponding node to the created doubly linked list, this node is both the head node and the tail node. Therefore, the forward pointer and the backward pointer of this node are both NULL.

[0136] In step 404, add the node corresponding to the newly added data node to the doubly linked list corresponding to the hash value of the newly added data node.

[0137] Among them, if there is a hash value corresponding to the newly added data node in the hash table of the upper level, the node corresponding to the newly added data node at this level can be directly added to the doubly linked list corresponding to this hash value, and the pointer information of the previous node of this node can be correspondingly changed, such as the way of the newly added node in the bottom linked list.

[0138] In step 405, determine whether the update operations of all levels of the skip list based on the newly added data node have been completed.

[0139] In some embodiments, after completing the update operation of the linked list of this level, it can be determined whether the update operations of all levels of the skip list based on the newly added data node have been completed; if not, iterate and execute step 402; if the update operations of all levels of the skip list based on the newly added data node have been completed, the operation is completed.

[0140] Through the above steps 401 - 405, the implementation method of the combined index according to the inserted new data is disclosed, realizing that as the data in the data table is updated, the skip list of the combined index of the data table is automatically synchronously updated to ensure the accuracy of retrieving data based on the combined index.

[0141] Figure 5 The flowchart of data modification provided by an exemplary embodiment of the present disclosure. This embodiment takes how to add data in the skip list as an example for exemplary illustration. As Figure 5 shown, it includes the following steps 501 - 505. Each step will be described separately below.

[0142] In step 501, modify the source data indicated by the data modification operation to the target data in the bottom - layer linked list of the skip list.

[0143] Among them, the source data is the original data corresponding before the data modification operation, and the target data is the data obtained after the modification operation based on the data modification operation.

[0144] In the present disclosure, when modifying the existing data in the data table, correspondingly, it is necessary to modify the index of the data in the skip list of the combined index of the data table.

[0145] In specific implementation, the source data indicated by the data modification operation can be first modified to the target data in the bottom - layer linked list. For example, the node data of the node with id 7 at the end of the original bottom - layer linked list is "col1 = A1 col2 = B1 col3 = C1". According to the data modification operation, the node data of this node is modified to "col1 = A2 col2 = B1 col3 = C1", then the node data of the node with id 7 can be directly changed in the bottom - layer linked list without changing the pointer information of the node.

[0146] In step 502, delete the node corresponding to the source data in the upper - level linked list, and determine whether there is a hash value corresponding to the target data in the hash table of the upper - level of the skip list.

[0147] In this embodiment, after modifying the node data of a node from the source data to the target data in the bottom - layer linked list, it is necessary to update each upper - level linked list layer by layer.

[0148] In specific implementation, the node corresponding to the source data in the upper - level linked list can be deleted layer by layer, and it is determined whether there is a hash value corresponding to the target data in the upper - level hash table. For example, if the node data corresponding to the target data is "col1 = A3 col2 = B1col3 = C1", then Figure 2There is no hash value of "col1 = A3" in the hash table of the upper layer of the middle-bottom linked list; if the node data corresponding to the target data is "col1 = A1 col2 = B1 col3 = C1", then in Figure 2 there is a hash value of "col1 = A1" in the hash table of the upper layer of the middle-bottom linked list.

[0149] In some implementation manners, after deleting the node corresponding to the source data in the upper-level linked list, it is necessary to correspondingly modify the pointer information of the previous node and the next node in the doubly linked list where the node is located. It can be understood that deleting the corresponding node includes deleting the pointer information of the node.

[0150] Further, if there is no hash value corresponding to the target data in the hash table of the upper level of the skip list, step 503 is executed; if there is a hash value corresponding to the target data in the hash table of the upper level of the skip list, step 504 is executed.

[0151] In step 503, add the hash value corresponding to the target data to the hash table of the upper level, create a doubly linked list based on the hash value corresponding to the target data, and add the node corresponding to the target data to the created doubly linked list.

[0152] Among them, if there is no hash value corresponding to the target data in the hash table of the upper level, the hash value corresponding to the index field of this level can be added to the hash table. For example, add the hash value of "col1 = A" to the hash table of the upper level of the bottom linked list. After adding this hash value, the doubly linked list corresponding to this hash value can be created.

[0153] It can be understood that the initial value of the newly created doubly linked list is empty. After adding the corresponding node to the created doubly linked list, this node is both the head node and the tail node. Therefore, the forward pointer and the backward pointer of this node are both NULL.

[0154] In step 504, add the node corresponding to the target data to the doubly linked list corresponding to the hash value of the target data.

[0155] Among them, if there is a hash value corresponding to the target data in the hash table of the upper level, the node corresponding to the target data at this level can be directly added to the doubly linked list corresponding to this hash value, and the pointer information of the previous node of this node is correspondingly changed, such as the way of adding a new node in the bottom linked list.

[0156] In step 505, determine whether the update operations of the linked lists of all levels of the skip list based on the target data are all completed.

[0157] In some embodiments, after completing the update operation of the linked list at this level, it can be determined whether the update operations of modifying data have been completed for all levels of the skiplist; if not, step 502 is iteratively executed, and if the update operations of modifying data have been completed for all levels of the skiplist, the operation is completed.

[0158] Through the above steps 501 - step 505, an implementation method of modifying the skiplist of the combined index according to the modified data is disclosed, realizing that as the data in the data table is modified, the skiplist of the combined index of the data table is automatically synchronously modified, ensuring the accuracy of retrieving data based on the combined index, and significantly reducing the overhead of database queries.

[0159] In another alternative implementation, if a certain data is deleted from the data table, the corresponding nodes of the data indicated by the delete data operation can be deleted from the linked lists of all levels of the skiplist, avoiding unnecessary resource waste and performance degradation, and also ensuring the accuracy of retrieving data based on the combined index.

[0160] Figure 6 The flowchart for determining the target combined index provided by an exemplary embodiment of the present disclosure. This embodiment takes how to determine the target combined index as an example for exemplary illustration. As Figure 6 shown, it includes the following steps 601 - step 602. Each step will be described separately below.

[0161] In step 601, determine the query fields and the number of fields hit by the query condition.

[0162] Among them, the hit query fields are the fields in the query condition. For example, if the query condition contains the fields "col1" and "col2", and the fields of the combined index include "col1", "col2", and "col3", then the hit query fields of the query condition are "col1" and "col2", and the number of fields is 2.

[0163] In step 602, according to the leftmost prefix principle, select the combined index that matches the query fields from the combined indexes of the data table to be queried as the target combined index.

[0164] Among them, the leftmost prefix principle is used to indicate the principle of matching in the order from left to right.

[0165] In the present disclosure, in order to improve the query performance of the data table to be queried, multiple composite indexes may be created for the query of the data table to be queried according to common query conditions, and skip lists are used to store each composite index respectively. For example, for table1, two composite indexes are created. The index fields included in composite index 1 are "gender" and "score", and the index fields included in composite index 2 are "class" and "score". If a data query request is to query the results where "gender = female" and "score > 90 points" in table1, then according to the query fields and the data table to be queried, it can be determined that the target composite index hit is composite index 1.

[0166] Through the above steps 601 - step 602, an implementation manner of determining the target composite index among multiple composite indexes of the data table to be queried based on the query conditions is disclosed. Based on the query fields and the number of fields in the query conditions, the matching target composite index can be quickly obtained, the data that needs to be located can be found faster, unnecessary full - table scans are reduced, and thus the query efficiency is improved.

[0167] Exemplary apparatus

[0168] Figure 7 It is a schematic structural diagram of a data query device provided by an exemplary embodiment of the present disclosure. As Figure 7 shown, the device includes:

[0169] A parsing module 71, configured to parse the data query request to obtain the query conditions;

[0170] A first determination module 72, configured to determine the hit target composite index and the number of hit fields based on the query fields in the query conditions and the data table to be queried;

[0171] A query module 73, configured to query the hash table at the level corresponding to the number of fields in the skip list storing the target composite index. The number of layers of the skip list is determined based on the total number of index fields included in the target composite index. Each node of the bottom - layer linked list of the skip list stores the primary key of each piece of data and the corresponding composite index field value in the order of the primary key of the data table to be queried;

[0172] An execution module 74, configured to, in response to the presence of a hash value matching the field value in the query conditions in the hash table, perform a data query operation based on the target doubly - linked list corresponding to the hash value.

[0173] Figure 8 It is a schematic structural diagram of a data query device provided by another exemplary embodiment of the present disclosure. As Figure 8 shown, on the basis of the embodiment shown in Figure 7 In some embodiments of the present disclosure, the execution module 74 includes:

[0174] The traversal sub-module 741 is used to traverse each node in the target doubly linked list;

[0175] The acquisition sub-module 742 is used to obtain data that meets the query conditions from the bottom-level linked list of the skip list based on the pointers of each node in the target doubly linked list that point to the nodes in the next-level linked list.

[0176] In some other embodiments of the present disclosure, the device further includes:

[0177] The insertion module 75 is used to, in response to receiving an operation of adding new data based on the skip list, insert a new data node into the bottom-level linked list of the skip list and update the pointer information of the previous node of the new data node. The node information of each node in the bottom-level linked list of the skip list includes the forward pointer, backward pointer, and node data of the node;

[0178] The second determination module 76 is used to determine whether there is a hash value corresponding to the new data node in the hash table of the upper level of the skip list;

[0179] The first addition module 77 is used to, in response to there being no hash value corresponding to the new data node in the hash table of the upper level of the skip list, add the hash value corresponding to the new data node to the hash table of the upper level, create a doubly linked list based on the hash value corresponding to the new data node, and add the corresponding node to the created doubly linked list;

[0180] The second addition module 78 is used to, in response to there being a hash value corresponding to the new data node in the hash table of the upper level of the skip list, add the node corresponding to the new data node to the doubly linked list with the hash value corresponding to the new data node;

[0181] The first iteration module 79 is used to iteratively execute the operation of determining whether there is a hash value corresponding to the new data node in the hash table of the upper level of the skip list until the update operations of all levels of the linked list of the skip list based on the new data node are completed.

[0182] In some other embodiments of the present disclosure, the device further includes:

[0183] The modification module 80 is used to modify the source data indicated by the modification data operation in the bottom-level linked list of the skip list to the target data. The source data is the original data corresponding before the execution of the modification data operation, and the target data is the data obtained after the modification operation is executed based on the modification data operation;

[0184] The third determination module 81 is used to delete the node corresponding to the source data indicated by the modification data operation in the linked list of the upper level of the skip list and determine whether there is a hash value corresponding to the target data in the hash table of the upper level of the skip list;

[0185] A third newly added module 82, configured to, in response to there being no hash value corresponding to the target data in the hash table of the upper level of the skip list, add the hash value corresponding to the target data to the hash table of the upper level, create a doubly linked list based on the hash value corresponding to the target data, and add a node corresponding to the target data to the created doubly linked list;

[0186] A fourth newly added module 83, configured to, in response to there being a hash value corresponding to the target data in the hash table of the upper level of the skip list, add a node corresponding to the target data to the doubly linked list corresponding to the hash value of the target data;

[0187] A second iterative module 84, configured to iteratively execute an operation of determining whether there is a hash value corresponding to the target data in the hash table of the upper level of the skip list until the linked lists of all levels of the skip list have completed the update operation based on the target data.

[0188] In some other embodiments of the present disclosure, the apparatus further includes:

[0189] A deletion module 85, configured to, in response to receiving a delete data operation based on the skip list, delete the nodes corresponding to the data indicated by the delete data operation in the linked lists of all levels of the skip list.

[0190] In some other embodiments of the present disclosure, the first determination module 72 includes:

[0191] A determination sub-module 721, configured to determine the fields hit by the query condition and the number of fields;

[0192] A selection sub-module 722, configured to select, according to the leftmost prefix principle, a combined index that matches the fields in each combined index of the data table to be queried as the target combined index.

[0193] In some other embodiments of the present disclosure, the apparatus further includes:

[0194] A prompt module 86, configured to, in response to there being no hash value in the hash table that matches the field value in the query condition, generate a prompt message indicating that the query result is empty.

[0195] The apparatus according to the embodiments of the present disclosure can be used to implement the methods of the above embodiments of the present disclosure. The specific implementations between the two correspond to each other, and the specific implementations of the relevant parts are mutually referred to and will not be elaborated here.

[0196] Exemplary electronic device, computer program product, and computer-readable storage medium

[0197] The embodiments of the present disclosure further provide an electronic device, including: a memory, configured to store a computer program; a processor, configured to execute the computer program stored in the memory, and when the computer program is executed, implement the data query method of any one of the above embodiments of the present disclosure.

[0198] Next, with reference to Figure 9 the electronic device according to an embodiment of the present disclosure will be described, in which the device for implementing the method of the embodiment of the present disclosure can be integrated. Figure 9 The structural diagram of the electronic device provided by an illustrative embodiment of the present disclosure is as Figure 9 shown. The electronic device includes one or more processors 91, a memory 92 of one or more computer-readable storage media, and a computer program stored on the memory and executable on the processor. When executing the program of the memory 92, the above data query method can be implemented.

[0199] Specifically, in practical applications, the electronic device may further include components such as an input device 93 and an output device 94, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). Those skilled in the art can understand that Figure 9 the structure of the electronic device shown in

[0200] does not limit the electronic device, and it may include more or fewer components than shown, or certain components, or different component arrangements. Among them:

[0201] The processor 91 may be a central processing unit (CPU) or other forms of processing units with data query capabilities and / or instruction execution capabilities. By running or executing software programs and / or modules stored in the memory 92, and calling data stored in the memory 92, various functions are executed and data is processed, thereby overall monitoring the electronic device.

[0202] The input device 93 can be used to receive input digital or character information. The input device 93 may include a keyboard, a mouse, a joystick, etc. related to user settings and function controls.

[0203] The output device 94 can output various information to the outside, including the determined distance information, direction information, etc. The output device 94 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0204] The electronic device may further include a power supply for powering various components, which can be logically connected to the processor 91 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. The power supply may further include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.

[0205] Of course, for simplicity, Figure 9 only some of the components related to the present disclosure in the electronic device are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device may further include any other appropriate components.

[0206] In addition to the above methods and devices, embodiments of the present disclosure may also be computer program products, which include computer program instructions that, when run on a processor, cause the processor to execute the steps in the data query methods according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0207] The computer program product can be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0208] Furthermore, embodiments of the present disclosure may also be computer-readable storage media, on which computer program instructions are stored, and when the computer program instructions are run on a processor, cause the processor to execute the steps in the data query methods according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0209] A computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0210] The basic principles of the present disclosure have been described above in connection with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for the purpose of illustration and facilitating understanding, and are not limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0211] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and reference can be made to the relevant part of the method embodiment for the related content.

[0212] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk, or optical disk and other media that can store program codes.

[0213] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present disclosure are not limited to the above specific description order unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.

[0214] The description of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or to limit the disclosure to the forms disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments were chosen and described in order to best explain the principles of the disclosure and its practical application, and to enable others of ordinary skill in the art to understand the disclosure and design various embodiments with various modifications suited to particular uses.

Claims

1. A data query method, characterized in that, Including: Parsing a data query request to obtain query conditions; Based on the query fields in the query conditions and the data table to be queried, determining the hit target composite index and the number of hit fields; In the skip list storing the target composite index, querying the hash table at the level corresponding to the number of fields, where the number of layers of the skip list is determined based on the total number of index fields included in the target composite index, and each node in the bottom linked list of the skip list stores the primary key of each piece of data and the corresponding composite index field value in the order of the primary key of the data table to be queried; In response to there being a hash value in the hash table that matches the field value in the query conditions, performing a data query operation based on the target doubly linked list corresponding to the hash value.

2. The method according to claim 1, characterized in that The performing a data query operation based on the target doubly linked list corresponding to the hash value includes: Traversing each node in the target doubly linked list; Based on the pointers of each node in the target doubly linked list pointing to the nodes in the next-level linked list, obtaining the data that meets the query conditions from the bottom linked list of the skip list.

3. The method according to any one of claims 1-2, characterized in that, In response to receiving an operation of adding new data based on the skip list, the method further includes: Inserting a new data node into the bottom linked list of the skip list and updating the pointer information of the previous node of the new data node, where the node information of each node in the bottom linked list of the skip list includes the forward pointer, backward pointer, and node data of the node; Determining whether there is a hash value corresponding to the new data node in the hash table at the upper level of the skip list; In response to there being no hash value corresponding to the new data node in the hash table at the upper level of the skip list, adding the hash value corresponding to the new data node to the hash table at the upper level, creating a doubly linked list based on the hash value corresponding to the new data node, and adding the corresponding node to the created doubly linked list; In response to there being a hash value corresponding to the new data node in the hash table at the upper level of the skip list, adding the node corresponding to the new data node to the doubly linked list corresponding to the hash value of the new data node; Iteratively performing the operation of determining whether there is a hash value corresponding to the new data node in the hash table at the upper level of the skip list until the update operation based on the new data node is completed for all levels of the linked list of the skip list.

4. The method according to any one of claims 1-2, characterized in that, In response to receiving an operation of modifying data based on the skip list, the method further includes: Modifying the source data indicated by the modify data operation in the bottom linked list of the skip list to the target data, where the source data is the original data before performing the modify data operation, and the target data is the data obtained after performing the modify operation based on the modify data operation; Deleting the node corresponding to the source data indicated by the modify data operation in the linked list at the upper level of the skip list, and determining whether there is a hash value corresponding to the target data in the hash table at the upper level of the skip list; In response to the hash value corresponding to the target data not existing in the hash table of the upper level of the skip list, adding the hash value corresponding to the target data to the hash table of the upper level, creating a doubly linked list based on the hash value corresponding to the target data, and adding a node corresponding to the target data to the created doubly linked list; In response to the hash value corresponding to the target data existing in the hash table of the upper level of the skip list, adding a node corresponding to the target data to the doubly linked list corresponding to the hash value corresponding to the target data; Iteratively execute the operation of determining whether the hash value corresponding to the target data exists in the hash table of the upper level of the skip list until the update operations based on the target data are completed for all levels of the linked lists of the skip list.

5. The method according to any one of claims 1-2, characterized in that, In response to receiving a data deletion operation based on the skip list, the method further includes: Deleting the nodes corresponding to the data indicated by the data deletion operation in all levels of the linked lists of the skip list.

6. The method according to any one of claims 1-5, characterized in that The determining of the target composite index and the number of fields hit based on the query fields in the query condition and the data table to be queried includes: Determining the query fields and the number of fields hit by the query condition; Selecting, according to the leftmost prefix principle, the composite index that matches the query fields from the composite indexes of the data table to be queried as the target composite index.

7. According to the method described in any one of claims 1-6, characterized in that, After querying the hash table of the level corresponding to the number of fields, it further includes: In response to no hash value matching the field value in the query condition existing in the hash table, generating a prompt message indicating that the query result is empty.

8. A computer-readable storage medium storing computer program instructions, which, when executed, implement the method according to any one of claims 1-7 above.

9. An electronic device, comprising: A memory for storing a computer program product; A processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method according to any one of claims 1-7 above.

10. A computer program product, comprising computer program instructions, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1-7 above is implemented.