Data processing method and device

By setting up row cache in the Lsm-Tree architecture and determining the sequence number range, the problem of slow query speed caused by multiple versions of the same key in traditional systems is solved, efficient data query is achieved, and the user experience is improved.

CN111723092BActive Publication Date: 2024-08-27ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010514158.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-08
Publication Date
2024-08-27
Estimated Expiration
2040-06-08

AI Technical Summary

Technical Problem

In the traditional Lsm-Tree system, there are multiple versions of different data versions of the same key, which requires multiple I/O operations during query, seriously affecting the data query speed and thus affecting the user experience.

Method used

By setting up the row cache in the Lsm-Tree architecture, the relationship between the read request and the sequence number range maintained by the storage engine is determined, the value corresponding to the key of the data to be queried is queried in the row cache, and the value is returned as the query result, shortening the query path. Ensure that only the latest version of data is stored in the row cache, implement global row cache, and directly query the corresponding value from the row cache to improve query performance.

Benefits of technology

It effectively shortens the query path, greatly improves query performance, ensures data accuracy and query speed, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111723092B
    Figure CN111723092B
Patent Text Reader

Abstract

This specification provides a data processing method and device, wherein the data processing method includes: receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried; querying the primary key in a memory table; querying the primary key in a row cache when the primary key is not found in the memory table and the read request sequence number meets a first preset condition; determining and returning a key value corresponding to the primary key when the primary key is found in the row cache. By setting a row cache, determining the relationship between the read request and the sequence number range maintained by the storage engine, querying the value corresponding to the key of the data to be queried in the row cache, and returning the value as a query result, the query path is effectively shortened and the query performance is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more particularly to a data processing method, a data processing device, a computing device, and a computer-readable storage medium. Background Art

[0002] The Log-Structured Merge-Tree (Lsm-Tree) storage engine is the underlying index structure of many modern databases. The basic idea of ​​this index structure is to first save the data change operations in the memory. When the data size in the memory reaches a threshold, the data in the memory is written to the disk in batches and in order, and the new data on the disk is rolled and merged with the old data through a certain hierarchical sorting algorithm. Among them, in the LSM-tree index structure, data is stored in the form of key-value pairs. Each key stores a corresponding value. The corresponding data value (also called data item) can be found through the key name, and then certain operations can be performed on the data item.

[0003] In traditional Lsm-Tree systems, different data with the same key are usually distinguished in the form of multiple versions, using increasing version numbers to identify them. After the memory table is flushed to disk, the data in the persistence layer still exists in multiple versions. When querying data, the data is searched layer by layer from the newest to the oldest according to the write order until the desired data is found. This process may require more than one I / O, which seriously affects the speed of data query and greatly affects the user experience.

[0004] In the prior art, it takes a lot of time to query data, and thus a simpler and more convenient method is needed to process the data. Summary of the invention

[0005] In view of this, the embodiments of this specification provide a data processing method. This specification also relates to a data processing device, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0006] According to a first aspect of an embodiment of this specification, a data processing method is provided, including:

[0007] Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0008] Query the primary key in the memory table;

[0009] If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache;

[0010] When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned.

[0011] Optionally, the method further includes:

[0012] If the primary key is not found in the memory table and the read request sequence number does not meet the first preset condition, query the primary key in the block cache;

[0013] When the primary key is found in the block cache, a key value corresponding to the primary key is determined and returned.

[0014] Optionally, the method further includes:

[0015] If the primary key is not found in the block cache, query the primary key in the persistence layer;

[0016] When the primary key is found in the persistence layer, determining and returning a key value corresponding to the primary key;

[0017] When the primary key is not found in the persistence layer, a query failure message is returned.

[0018] Optionally, the method further includes:

[0019] If the primary key is not found in the row cache, query the primary key in the block cache;

[0020] When the primary key is found in the block cache, a key value corresponding to the primary key is determined and returned.

[0021] Optionally, the method further includes:

[0022] If the primary key is not found in the block cache, query the primary key in the persistence layer;

[0023] When the primary key is found in the persistence layer, determining and returning a key value corresponding to the primary key;

[0024] When the primary key is not found in the persistence layer, a query failure message is returned.

[0025] Optionally, the first preset condition includes: the read request sequence number is greater than or equal to the minimum value of the sequence number range of the storage engine.

[0026] Optionally, after determining and returning the key value corresponding to the primary key, the method further includes:

[0027] When the read request sequence number satisfies a second preset condition, the primary key and the key value are written into the row cache.

[0028] Optionally, the second preset condition includes: the read request sequence number is greater than the maximum value of the sequence number range.

[0029] Optionally, the memory table includes an active memory table and a frozen memory table;

[0030] The serial number range is determined by the following steps:

[0031] When the active memory table is converted to the frozen memory table or the persistence layer is flushed according to the data in the frozen memory table, the largest sequence number in the frozen memory table is obtained as the first sequence number, and the largest sequence number in the persistence layer is obtained as the second sequence number;

[0032] A sequence number range is determined according to the first sequence number and the second sequence number, wherein the first sequence number is a maximum value of the sequence number range and the second sequence number is a minimum value of the sequence number range.

[0033] Optionally, flushing the persistence layer according to the data in the frozen memory table includes:

[0034] Obtaining the primary key of each piece of data in the frozen memory table in turn;

[0035] The data corresponding to the primary key is deleted in the row cache and the persistence layer.

[0036] Optionally, querying the primary key in the row cache includes:

[0037] Convert the primary key into a corresponding primary key hash value according to a preset hash function;

[0038] Determine a target hash bucket corresponding to the primary key in the row cache according to the primary key hash value;

[0039] The target hash bucket is queried for the primary key.

[0040] Optionally, writing the primary key and the key value into the row cache includes:

[0041] Convert the primary key into a corresponding primary key hash value according to a preset hash function;

[0042] Determine, in the row cache, a target hash bucket corresponding to the primary key hash value according to the primary key hash value;

[0043] The primary key and the key value are written into the target hash bucket accordingly.

[0044] Optionally, the memory table includes an active memory table and a frozen memory table;

[0045] Querying the primary key in the memory table includes:

[0046] Query the primary key in the active memory table;

[0047] When the primary key is found in the active memory table, a key value corresponding to the primary key is determined and returned;

[0048] If the primary key is not found in the active memory table, query the primary key in the frozen memory table;

[0049] When the primary key is found in the frozen memory table, determining and returning a key value corresponding to the primary key;

[0050] When the primary key is not found in the frozen memory table, it is determined that the primary key is not found in the memory table.

[0051] According to a second aspect of an embodiment of this specification, there is provided a data processing device, including:

[0052] A receiving module, configured to receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0053] A memory query module, configured to query the primary key in the memory table;

[0054] a row cache query module, configured to query the primary key in the row cache if the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition;

[0055] The row cache returning module is configured to determine and return a key value corresponding to the primary key when the primary key is found in the row cache.

[0056] According to a third aspect of an embodiment of this specification, there is provided a data processing system, including:

[0057] A row cache query module is configured to receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried, and if the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, query the primary key in the row cache, and if the primary key is found in the row cache, execute the return module;

[0058] a block cache query module configured to query the primary key in the block cache if the primary key is not found in the row cache or the read request sequence number does not meet the first preset condition, and execute the return module if the primary key is found in the block cache;

[0059] A persistence layer query module is configured to query the primary key in the persistence layer if the primary key is not found in the block cache, and to execute a return module if the primary key is found in the persistence layer, and to return a query failure message if the primary key is not found in the persistence layer;

[0060] a writing module configured to write the primary key and the key value corresponding to the primary key into the row cache if the primary key is found in the block cache or the persistence layer and the read request sequence number satisfies a second preset condition;

[0061] The return module is configured to determine and return the key value corresponding to the primary key.

[0062] According to a fourth aspect of an embodiment of this specification, a computing device is provided, including:

[0063] Memory and processor;

[0064] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0065] Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0066] Query the primary key in the memory table;

[0067] If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache;

[0068] When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned.

[0069] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any of the data processing methods are implemented.

[0070] The data processing method provided in the present specification receives a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried; queries the primary key in a memory table; if the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, queries the primary key in a row cache; if the primary key is found in the row cache, determines and returns a key value corresponding to the primary key.

[0071] The data processing method provided in this specification is applied to the storage engine of the Lsm-Tree architecture. By setting a row cache and judging the relationship between the read request and the sequence number range maintained by the storage engine, the value corresponding to the key of the data to be queried is queried in the row cache, and the value is returned as the query result, which effectively shortens the query path and greatly improves the query performance. By maintaining and updating the sequence number range, it is ensured that only the latest version of the data is stored in the row cache, and a global row cache is implemented. For a specified key, the corresponding value can be queried directly from the row cache, which effectively shortens the read path of the read request and improves the query performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 is a flow chart of a data processing method provided by an embodiment of this specification;

[0073] Figure 2 It is a schematic diagram of the architecture of a data processing method provided in an embodiment of this specification;

[0074] Figure 3 is a flowchart of a data processing method provided by another embodiment of this specification;

[0075] Figure 4 It is a structural schematic diagram of a data processing device provided in an embodiment of this specification;

[0076] Figure 5 It is a data processing system architecture diagram provided by an embodiment of this specification;

[0077] Figure 6 It is a structural block diagram of a computing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0078] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0079] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

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

[0081] First, the terms involved in one or more embodiments of this specification are explained.

[0082] Active memory table: The memory table that is currently active and can write data in the storage engine.

[0083] Frozen memory table: When the data stored in the storage engine reaches the preset threshold, no more data is written to the memory table. The frozen memory table is a read-only table.

[0084] Sequence number: Each piece of data is assigned an incremental sequence number when it is submitted, such as writing, querying, etc.

[0085] Log-structured merge tree: Designed specifically for key-value storage systems, it has the advantage of fast write speed.

[0086] In this specification, a data processing method is provided. This specification also relates to a data processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0087] Figure 1 A flowchart of a data processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps:

[0088] Step 102: Receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried.

[0089] The data to be queried is the data that needs to be queried. In the index structure of the log structure merge tree architecture (Lsm-Tree) storage engine, the data is stored in the form of key-value pairs (Key-Value), and each primary key (key) is stored in correspondence with its corresponding key value (Value).

[0090] The read request for the data to be queried includes the read request sequence number corresponding to the read request and the key of the data to be queried. The sequence number is an increasing sequence number assigned by the storage engine when each piece of data is submitted. The read request sequence number of the read request identifies the order in which the read request is obtained, that is, the read request can only query data with a sequence number less than the read request sequence number. The specific valve of the data to be queried needs to be determined according to the key of the data to be queried.

[0091] In a specific implementation manner provided in the present specification, a read request R1 for data to be queried is received, the read request sequence number of the read request R1 is 170, and the key of the data to be queried is C.

[0092] In another specific implementation manner provided in the present specification, a read request R2 for data to be queried is received, the read request sequence number of the read request R2 is 200, and the key of the data to be queried is A.

[0093] Step 104: Query the primary key in the memory table.

[0094] The data in the storage engine of the Lsm-Tree architecture is first saved in the memory table. The data in the memory table is the latest data. When a read request is made, it is necessary to query the memory table now.

[0095] Optionally, the memory table includes an active memory table and a frozen memory table; querying the primary key in the memory table includes: querying the primary key in the active memory table; in case the primary key is found in the active memory table, determining and returning a key value corresponding to the primary key; in case the primary key is not found in the active memory table, querying the primary key in the frozen memory table; in case the primary key is found in the frozen memory table, determining and returning a key value corresponding to the primary key; in case the primary key is not found in the frozen memory table, determining that the primary key is not found in the memory table.

[0096] The memory table includes two types of memory tables, namely active memory tables and frozen memory tables, wherein the active memory table is a memory table in the storage engine that can currently write data, and the frozen memory table is a memory table that will no longer continue to write when the data in the active memory table reaches a preset threshold. When querying the primary key in the memory table, first query the primary key in the active memory table, and when the primary key is found, determine and return the key value corresponding to the primary key, and end the read request for the data to be queried; if the primary key is not found in the active memory table, query the primary key in the frozen memory table, and when the primary key is found in the frozen memory table, determine and return the key value corresponding to the primary key, and end the read request for the data to be queried; if the primary key is not found in the frozen memory table, determine that the primary key is not found in the memory table.

[0097] In a specific implementation provided in this specification, the data in the active memory table includes (M, m)-210, where M is Key, m is Value, and 210 is the sequence number corresponding to the data. If the primary key of the data to be queried is M, the value m corresponding to M is returned, and the read request is terminated at the same time.

[0098] In another specific implementation provided in this specification, the data in the active memory table includes (M, m)-210, and the data in the frozen memory table includes (N, n)-209, (O, o)-208. The key of the data to be queried is O, and no data with the key O is found in the active memory table. Then, the frozen memory table is searched, and the value corresponding to the key O is found to be o, then o is returned, and the read request is terminated at the same time.

[0099] In another specific implementation provided in this specification, the data in the active memory table includes (M, m)-210, and the data in the frozen memory table includes (N, n)-209, (O, o)-208. The key of the data to be queried is P, and no data with the key of P is found in the active memory table, and then the frozen memory table is queried, and no data with the key of P is found in the frozen memory table, then it is determined that no data with the key of P is found in the memory table.

[0100] Step 106: If the primary key is not found in the memory table and the read request sequence number meets a first preset condition, query the row cache for the primary key.

[0101] Optionally, the first preset condition includes: the read request sequence number is greater than or equal to the minimum value of the sequence number range of the storage engine.

[0102] Specifically, the serial number range is determined by the following steps: when the active memory table is converted to the frozen memory table or the persistence layer is flushed according to the data in the frozen memory table, the largest serial number in the frozen memory table is obtained as the first serial number, and the largest serial number in the persistence layer is obtained as the second serial number; the serial number range is determined according to the first serial number and the second serial number, wherein the first serial number is the maximum value of the serial number range and the second serial number is the minimum value of the serial number range.

[0103] In actual applications, whenever an active memory table is converted to a frozen memory table, or the persistence layer is flushed according to the data in the frozen memory table, the serial number range of the storage engine is updated. Specifically, the largest serial number in the frozen memory table is obtained as the first serial number, the largest serial number in the persistence layer is obtained as the second serial number, and the first serial number is used as the maximum value of the serial number range, and the second serial number is used as the minimum value of the serial number range to determine the serial number range of the storage engine.

[0104] In a specific implementation provided in this specification, the sequence number range of the storage engine is (160, 180), and the data in the row cache includes (A, a)-100, (B, b)-150. The read request sequence number of the data to be queried is 170, and the key of the data to be queried is C. At this time, the read request sequence number of the data to be queried meets the first preset condition, that is, the read request sequence number 170 is greater than the minimum value of the sequence number range 160, and the data with the key C is queried in the row cache.

[0105] In another specific implementation provided in this specification, the sequence number range of the storage engine is (160, 180), and the data in the row cache includes (A, a)-100, (B, b)-150. The read request sequence number of the data to be queried is 200, and the key of the data to be queried is A. At this time, the read request sequence number of the data to be queried meets the first preset condition, that is, the read request sequence number 200 is greater than the minimum value of the sequence number range 160, and the data with the key A is queried in the row cache.

[0106] In another specific implementation provided in this specification, the sequence number range of the storage engine is (160, 180), and the data in the row cache includes (A, a)-100, (B, b)-150. The read request sequence number of the data to be queried is 140, and the key of the data to be queried is D. At this time, the read request sequence number of the data to be queried does not meet the first preset condition, that is, the read request sequence number 140 is less than the minimum value of the sequence number range 160, and the data with the key D cannot be queried in the row cache.

[0107] In order to improve the query efficiency of the primary key in the row cache, a hash table is maintained in advance in the row cache, and the primary key is converted into a corresponding primary key hash value according to a preset hash function; a target hash bucket corresponding to the primary key is determined in the row cache according to the primary key hash value; and the primary key is queried in the target hash bucket. The hash table can greatly reduce the time consumed in querying data in the row cache, thereby improving the efficiency of querying data.

[0108] Optionally, in the data method provided in this specification, flushing the persistence layer according to the data in the frozen memory table includes: obtaining the primary key of each data in the frozen memory table in turn; and deleting the data corresponding to the primary key in the row cache and the persistence layer.

[0109] In actual applications, the row cache can only process data without multiple versions. When there are multiple versions of the same key in the data of the persistence layer, the accuracy of the query data cannot be ensured. Therefore, it is necessary to flush the persistence layer according to the data in the frozen memory table. Specifically, each data in the frozen memory table is scanned to obtain the key of each data. According to the key value of each data, the deletion operation is performed in the row cache and the persistence layer to delete the data with the same key in the row cache and the persistence layer to ensure that there is only one version of the value for the same key in the storage engine. Flushing the persistence layer according to the data in the frozen memory table is a relatively long process. After the flushing is completed, the metadata of the storage engine will be updated. The metadata records the storage location of the value corresponding to each key. Before the metadata is updated, multiple versions of the value data are invisible to read requests.

[0110] In a specific implementation provided in this specification, the data in the frozen memory table includes (N, n)-209, (O, o)-208, and the data with key=N and key=O in the row cache and persistence layer are deleted according to key=N and key=O in the frozen memory table.

[0111] Optionally, the data processing method provided in this specification can also maintain multiple versions of the data chain for the same key in the row cache, and update the data chain when the data in the frozen memory table is flushed to the persistence layer. This method requires storing more information to distinguish different versions of data corresponding to the same key, and requires excess storage space to redundantly store multiple versions of data.

[0112] Step 108: When the primary key is found in the row cache, determine and return the key value corresponding to the primary key.

[0113] In a specific implementation provided in this specification, the data in the row cache includes (A, a)-100, (B, b)-150. The read request sequence number of the data to be queried is 200, and the key of the data to be queried is A. After querying, there is data with key A in the row cache, and the value corresponding to the data with key A is determined to be a in the row cache, and a is returned as the query result corresponding to the data to be queried.

[0114] Optionally, if the primary key is not found in the memory table and the read request sequence number does not meet the first preset condition, or the read request sequence number meets the first preset condition but the primary key is not found in the row cache, the method further includes: querying the primary key in the block cache; if the primary key is found in the block cache, determining and returning the key value corresponding to the primary key; if the primary key is not found in the block cache, querying the primary key in the persistence layer; if the primary key is found in the persistence layer, determining and returning the key value corresponding to the primary key; if the primary key is not found in the persistence layer, returning a failed query message.

[0115] In actual applications, read requests are executed in the order of row cache, block cache, and persistence layer. Read requests are executed in this order until the value corresponding to the key in the read request is found or a message indicating that the query was unsuccessful is returned.

[0116] In a specific implementation provided in the present specification, the read request sequence number is 170, the key of the read request is C, the data in the row cache includes (A, a)-100, (B, b)-150, and the sequence number range is (160-180). At this time, the read request sequence number 170 is greater than the minimum value of the sequence number range 160, and then the row cache can be queried. After the query, the row cache does not include the data with key=C, and then the block cache is queried. In the block cache, the data with key=C is found with value=c, and c is returned as the query result corresponding to the data to be queried.

[0117] In another specific implementation provided in the present specification, the read request sequence number is 140, the key of the read request is D, the data in the row cache includes (A, a)-100, (B, b)-150, and the sequence number range is (160-180). At this time, the read request sequence number 140 is less than the minimum value of the sequence number range 160, and it cannot be queried in the row cache, so it is queried in the block cache. After the query, the data with key=D is not found in the block cache, and the query in the persistence layer continues. Finally, the data with key=D and value=d is found in the persistence layer, and d is returned as the result corresponding to the data to be queried.

[0118] Optionally, the data processing method provided in this specification, after querying the primary key in the block cache or persistence layer and determining and returning the key value corresponding to the primary key, also includes: when the read request serial number meets the second preset condition, writing the primary key and the key value to the row cache.

[0119] Since the read request of the data to be queried can be considered as data that will be frequently queried, the data queried in the block cache or persistence layer can be written to the row cache, so that when the data is queried again later, the data can be directly queried in the row cache to improve query efficiency.

[0120] The second preset condition is that the read request sequence number is greater than the maximum value of the sequence number range. When the value corresponding to the read request key is queried in the block cache or the persistence layer, it is necessary to determine whether the read request sequence number is greater than the maximum value of the sequence number range. If the read request sequence number is not greater than the maximum value of the sequence number range, it will appear that the data in the frozen memory table has been flushed to the persistence layer. If the queried data is written to the row cache, there is a possibility that the data is not the latest version. In order to ensure data consistency, the operation of inserting the queried data into the row cache will only be executed when the read request sequence number is greater than the maximum value of the sequence number range.

[0121] Optionally, in order to improve the efficiency of writing the queried data into the row cache and shorten the query time when querying again, according to the hash table maintained in advance in the row cache, the primary key is converted into a corresponding primary key hash value using a preset hash function; according to the primary key hash value, a target hash bucket corresponding to the primary key is determined in the row cache; and the primary key and the key value are correspondingly written into the target hash bucket. The hash table can greatly reduce the time of writing data into the row cache and improve the writing efficiency.

[0122] The data processing method provided in this specification is applied to the storage engine of the Lsm-Tree architecture. By setting a row cache and judging the relationship between the read request and the sequence number range maintained by the storage engine, the value corresponding to the key of the data to be queried is queried in the row cache, and the value is returned as the query result, which effectively shortens the query path and greatly improves the query performance.

[0123] Secondly, when no data is found in the row cache or the read request sequence number does not meet the first preset condition, the value corresponding to the key is queried in the block cache or the persistence layer, and the value is returned as the query result. At the same time, the relationship between the read request sequence number and the second preset condition is judged. When the read request sequence number meets the second preset condition, the key-value is written to the row cache, which can shorten the query time when querying again. When the read request sequence number does not meet the second preset condition, the key-value is not written to the row cache, thereby ensuring the accuracy of the data in the storage engine.

[0124] Thirdly, a preset hash table is maintained in the row cache. When querying or writing data in the row cache, the hash value corresponding to the key is calculated according to the preset hash table, and the corresponding target hash bucket is located. Reading or writing the value of the corresponding key in the target hash bucket can greatly reduce the reading or writing time and improve efficiency.

[0125] The following combination Figure 2 and Figure 3 The data processing method provided in this specification is further explained, wherein: Figure 2 The schematic diagram of the data processing method provided in this specification is shown. Figure 3 The flowchart of the data processing method provided in an embodiment of the present specification is shown, which specifically includes the following steps:

[0126] Step 302: Receive a read request for the data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried.

[0127] Step 304: Determine whether the memory table has the primary key. If so, execute step 320; if not, execute step 306.

[0128] Step 306: Determine whether the read request sequence number meets the first preset condition, if so, execute step 308, if not, execute step 312.

[0129] Step 308: Query the primary key in the row cache.

[0130] Step 310: Determine whether the primary key is found in the row cache, if so, execute step 320, if not, execute step 312.

[0131] Step 312: Query the primary key in the block cache.

[0132] Step 314: Determine whether the primary key is found in the block cache. If so, execute step 320; if not, execute step 316.

[0133] Step 316: Query the primary key in the persistence layer.

[0134] Step 318: Determine whether the primary key is found in the persistence layer. If so, execute step 320; if not, execute step 326.

[0135] Step 320: Determine and return the key value corresponding to the primary key.

[0136] Step 322: Determine whether the read request sequence number meets the second preset condition, if so, execute step 324, if not, no operation.

[0137] Step 324: Write the primary key and the key value corresponding to the primary key into the row cache.

[0138] Step 326: Return a message indicating that the query was not successful.

[0139] The present description is further explained below in conjunction with a specific embodiment. The data in the row cache includes (A, a), (B, b), (C, c), and (D, d). At this time, the sequence number range in the storage engine is (260, 280).

[0140] A read request R0 with key G is received. The read request sequence number of R0 is 255. No data with key=G is retrieved in the memory table. Then, it is determined whether the read request sequence number 255 of R0 meets the first preset condition (the read request sequence number is greater than or equal to the minimum value of the sequence number range). After comparison, the read request sequence number 255 is less than the minimum value 260 of the sequence number range, that is, the first preset condition is not met. Then, the data with key=G cannot be queried in the row cache, and the block cache is queried. If the data with key=G is not queried in the block cache, the persistence layer is queried. After the query, the value=g corresponding to key=G is found in the persistence layer, and value=g is determined and returned. At this time, it is determined whether the read request sequence number 255 of R0 meets the second preset condition (the read request sequence number is greater than the maximum value of the sequence number range). After comparison, the request sequence number 255 is less than the maximum value 280 of the sequence number range. The second preset condition is not met, and there is no need to write (G, g) into the row cache.

[0141] A read request R1 with key C is received. The read request sequence number of R1 is 270. Data with key=C is not retrieved in the memory table. Then, it is determined whether the read request sequence number 270 of R1 meets the first preset condition. After comparison, the read request sequence number 270 is greater than the minimum value of the sequence number range, that is, it meets the first preset condition. Then, the data with key=C is queried in the row cache. After the query, the data with key=C is found in the row cache, that is, the value=c corresponding to key=C is determined, and value=c is returned.

[0142] A read request R2 with key E is received. The read request sequence number of R2 is 276. Data with key=E is not retrieved in the memory table. Then, it is determined whether the read request sequence number 276 of R2 meets the first preset condition. After comparison, the read request sequence number 276 is greater than the minimum value 260 of the sequence number range, that is, the first preset condition is met. Then, the data with key=E is queried in the row cache. After query, data with key=E is not found in the row cache. Then, the query in the block cache is continued. After query, value=e corresponding to key=E is found in the block cache. Then value=e is determined and returned. At this time, it is determined whether the read request sequence number 276 of R2 meets the second preset condition (the read request sequence number is greater than the maximum value of the sequence number range). After comparison, the request sequence number 276 is less than the maximum value 280 of the sequence number range. If the second preset condition is not met, there is no need to write (E, e) to the row cache.

[0143] A read request R3 with key F is received. The read request sequence number of R3 is 290. No data with key=F is retrieved in the memory table. Then, it is determined whether the read request sequence number 290 of R3 meets the first preset condition. After comparison, the read request sequence number 290 is greater than the minimum value 260 of the sequence number range, that is, the first preset condition is met. Then, the data with key=F is queried in the row cache. After querying, no data with key=F is queried in the row cache. Then, the query in the block cache is continued. No data with key=F is queried in the block cache. F's data is queried in the persistence layer. After querying the persistence layer, the value = f corresponding to key = F is found, and value = f is determined and returned. At this time, it is determined whether the read request sequence number 290 of R3 meets the second preset condition. After comparison, the request sequence number 290 is greater than the maximum value 280 of the sequence number range, and the second preset condition is met. Then (F, f) is written to the row cache. At this time, the data in the row cache includes (A, a), (B, b), (C, c), (D, d), and (F, f).

[0144] In an embodiment provided by the present application, at this time, the data in the frozen data table includes (C, c1)..., the data in the frozen data table reaches a preset threshold, and the data in the frozen data table needs to be flushed to the persistence layer. At this time, the maximum sequence number in the frozen data table is 300, and the maximum sequence number in the persistence layer is 280, then the new sequence table range is determined to be (280, 300), and data is queried in the row cache and the persistence layer according to key=C in (C, c1), and the data with key=C in the row cache and the persistence layer is deleted. At this time, the data in the row cache includes (A, a), (B, b), (D, d), (F, f), and after the data with key=C in the persistence layer is deleted, (C, c1) in the frozen data table is written to the persistence layer, and the metadata of the storage engine is updated. Thereafter, when the data with key=C is queried again, the latest value=c1 corresponding to key=C can be queried.

[0145] The data processing method provided in this specification is applied to the storage engine of the Lsm-Tree architecture. By setting a row cache and judging the relationship between the read request and the sequence number range maintained by the storage engine, the value corresponding to the key of the data to be queried is queried in the row cache, and the value is returned as the query result, which effectively shortens the query path and greatly improves the query performance. By maintaining and updating the sequence number range, it is ensured that only the latest version of the data is stored in the row cache, and a global row cache is implemented. For a specified key, the corresponding value can be queried directly from the row cache without looking up the metadata to find the corresponding value in the persistence layer, which effectively shortens the read path of the read request and improves the query performance.

[0146] Secondly, when no data is found in the row cache or the read request sequence number does not meet the first preset condition, the value corresponding to the key is queried in the block cache or the persistence layer, and the value is returned as the query result. At the same time, the relationship between the read request sequence number and the second preset condition is judged. When the read request sequence number meets the second preset condition, the key-value is written to the row cache, which can shorten the query time when querying again. When the read request sequence number does not meet the second preset condition, the key-value is not written to the row cache, thereby ensuring the accuracy of the data in the storage engine.

[0147] Thirdly, a preset hash table is maintained in the row cache. When querying or writing data in the row cache, the hash value corresponding to the key is calculated according to the preset hash table, and the corresponding target hash bucket is located. Reading or writing the value of the corresponding key in the target hash bucket can greatly reduce the reading or writing time and improve efficiency.

[0148] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 4FIG. 1 shows a schematic diagram of the structure of a data processing device provided by an embodiment of the present specification. Figure 4 As shown, the device comprises:

[0149] The receiving module 402 is configured to receive a read request for the data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0150] A memory query module 404 is configured to query the primary key in the memory table;

[0151] A row cache query module 406 is configured to query the primary key in the row cache if the primary key is not found in the memory table and the read request sequence number meets a first preset condition;

[0152] The row cache returning module 408 is configured to determine and return a key value corresponding to the primary key when the primary key is found in the row cache.

[0153] Optionally, the device further comprises:

[0154] a block cache query module, configured to query the primary key in the block cache if the primary key is not found in the memory table and the read request sequence number does not meet a first preset condition;

[0155] The block cache returning module is configured to determine and return a key value corresponding to the primary key when the primary key is found in the block cache.

[0156] Optionally, the device further comprises:

[0157] A persistence layer query module, configured to query the primary key in the persistence layer if the primary key is not found in the block cache;

[0158] A first persistence layer return module, configured to determine and return a key value corresponding to the primary key when the primary key is found in the persistence layer;

[0159] The second return module of the persistence layer is configured to return a query failure success message if the primary key is not found in the persistence layer.

[0160] Optional,

[0161] The block cache query module is further configured to query the primary key in the block cache if the primary key is not found in the row cache;

[0162] The block cache returning module is further configured to determine and return a key value corresponding to the primary key when the primary key is found in the block cache.

[0163] Optional,

[0164] The persistence layer query module is further configured to query the primary key in the persistence layer if the primary key is not found in the block cache;

[0165] The persistence layer first return module is further configured to determine and return a key value corresponding to the primary key when the primary key is queried in the persistence layer;

[0166] The second persistent layer return module is further configured to return a failed query message if the primary key is not found in the persistent layer.

[0167] Optionally, the first preset condition includes: the read request sequence number is greater than or equal to the minimum value of the sequence number range of the storage engine.

[0168] Optionally, the device further comprises:

[0169] The writing module is configured to write the primary key and the key value into the row cache when the read request sequence number satisfies a second preset condition.

[0170] Optionally, the second preset condition includes: the read request sequence number is greater than the maximum value of the sequence number range.

[0171] Optionally, the memory table includes an active memory table and a frozen memory table;

[0172] The device also includes:

[0173] An acquisition module is configured to, when the active memory table is converted to the frozen memory table or the persistence layer is flushed according to the data in the frozen memory table, acquire the largest sequence number in the frozen memory table as the first sequence number and acquire the largest sequence number in the persistence layer as the second sequence number;

[0174] A determination module is configured to determine a sequence number range according to the first sequence number and the second sequence number, wherein the first sequence number is a maximum value of the sequence number range and the second sequence number is a minimum value of the sequence number range.

[0175] Optionally, the device further comprises:

[0176] The flushing module is configured to sequentially obtain the primary key of each piece of data in the frozen memory table; and delete the data corresponding to the primary key in the row cache and the persistence layer.

[0177] Optionally, the row cache query module 406 is further configured to convert the primary key into a corresponding primary key hash value according to a preset hash function; determine a target hash bucket corresponding to the primary key in the row cache according to the primary key hash value; and query the primary key in the target hash bucket.

[0178] Optionally, the writing module is further configured to convert the primary key into a corresponding primary key hash value according to a preset hash function; determine a target hash bucket corresponding to the primary key hash value in the row cache according to the primary key hash value; and write the primary key and the key value into the target hash bucket accordingly.

[0179] Optionally, the memory table includes an active memory table and a frozen memory table;

[0180] The memory query module 404 is further configured to query the primary key in the active memory table; if the primary key is found in the active memory table, determine and return the key value corresponding to the primary key; if the primary key is not found in the active memory table, query the primary key in the frozen memory table; if the primary key is found in the frozen memory table, determine and return the key value corresponding to the primary key; if the primary key is not found in the frozen memory table, determine that the primary key is not found in the memory table.

[0181] The data processing device provided in this specification is configured in the storage engine of the Lsm-Tree architecture. By setting a row cache and judging the relationship between a read request and a sequence number range maintained by the storage engine, the value corresponding to the key of the data to be queried is queried in the row cache, and the value is returned as the query result, thereby effectively shortening the query path and greatly improving the query performance.

[0182] Secondly, when no data is found in the row cache or the read request sequence number does not meet the first preset condition, the value corresponding to the key is queried in the block cache or the persistence layer, and the value is returned as the query result. At the same time, the relationship between the read request sequence number and the second preset condition is judged. When the read request sequence number meets the second preset condition, the key-value is written to the row cache, which can shorten the query time when querying again. When the read request sequence number does not meet the second preset condition, the key-value is not written to the row cache, thereby ensuring the accuracy of the data in the storage engine.

[0183] Thirdly, a preset hash table is maintained in the row cache. When querying or writing data in the row cache, the hash value corresponding to the key is calculated according to the preset hash table, and the corresponding target hash bucket is located. Reading or writing the value of the corresponding key in the target hash bucket can greatly reduce the reading or writing time and improve efficiency.

[0184] The above is a schematic scheme of a data processing device of this embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above data processing method belong to the same concept, and the details of the technical scheme of the data processing device that are not described in detail can be referred to the description of the technical scheme of the above data processing method.

[0185] Figure 5 FIG. 1 shows a data processing system architecture diagram provided by an embodiment of the present specification, such as Figure 5 As shown, the system includes:

[0186] The row cache query module 502 is configured to receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried, and when the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, the primary key is queried in the row cache, and when the primary key is found in the row cache, the return module is executed.

[0187] The block cache query module 504 is configured to query the primary key in the block cache if the primary key is not found in the row cache or the read request sequence number does not meet the first preset condition, and execute the return module if the primary key is found in the block cache.

[0188] The persistence layer query module 506 is configured to query the primary key in the persistence layer if the primary key is not found in the block cache, and to execute the return module if the primary key is found in the persistence layer, and to return a message indicating that the query was not successful if the primary key is not found in the persistence layer.

[0189] The writing module 508 is configured to write the primary key and the key value corresponding to the primary key into the row cache if the primary key is found in the block cache or the persistence layer and the read request sequence number meets a second preset condition.

[0190] The return module 510 is configured to determine and return the key value corresponding to the primary key.

[0191] The data processing system provided in this specification sets a row cache, determines the relationship between a read request and a sequence number range maintained by a storage engine, queries the row cache for the value corresponding to the key of the data to be queried, and returns the value as a query result, thereby effectively shortening the query path and greatly improving the query performance.

[0192] Secondly, when no data is found in the row cache or the read request sequence number does not meet the first preset condition, the value corresponding to the key is queried in the block cache or persistence layer, and the value is returned as the query result. At the same time, the key-value is written to the row cache, which can shorten the query time when querying again.

[0193] The above is a schematic scheme of a data processing system of this embodiment. It should be noted that the technical scheme of the data processing system and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the data processing device can be referred to the description of the technical scheme of the above data processing method.

[0194] Figure 6 The structure block diagram of a computing device 600 provided according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0195] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0196] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0197] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0198] The processor 620 is used to execute the following computer executable instructions:

[0199] Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0200] Query the primary key in the memory table;

[0201] If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache;

[0202] When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned.

[0203] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data processing method.

[0204] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:

[0205] Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried;

[0206] Query the primary key in the memory table;

[0207] If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache;

[0208] When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned.

[0209] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data processing method.

[0210] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0211] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0212] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.

[0213] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0214] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried; Query the primary key in the memory table; If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache, wherein the first preset condition includes that the read request sequence number is greater than or equal to the minimum value of the sequence number range of the storage engine; When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned; If the primary key is not found in the memory table and the read request sequence number does not meet the first preset condition, query the primary key in the block cache; When the primary key is found in the block cache, determining and returning a key value corresponding to the primary key; If the primary key is not found in the block cache, query the primary key in the persistence layer; When the primary key is found in the persistence layer, determining and returning a key value corresponding to the primary key; When the primary key is not found in the persistence layer, a query failure message is returned.

2. The data processing method according to claim 1, further comprising: If the primary key is not found in the row cache, query the primary key in the block cache; When the primary key is found in the block cache, a key value corresponding to the primary key is determined and returned.

3. The data processing method according to claim 2, further comprising: If the primary key is not found in the block cache, query the primary key in the persistence layer; When the primary key is found in the persistence layer, determining and returning a key value corresponding to the primary key; When the primary key is not found in the persistence layer, a query failure message is returned.

4. The data processing method according to claim 1, after determining and returning the key value corresponding to the primary key, further comprising: When the read request sequence number satisfies a second preset condition, the primary key and the key value are written into the row cache, wherein the second preset condition includes that the read request sequence number is greater than a maximum value of the sequence number range.

5. The data processing method according to claim 1, wherein the memory table comprises an active memory table and a frozen memory table; The serial number range is determined by the following steps: When the active memory table is converted to the frozen memory table or the persistence layer is flushed according to the data in the frozen memory table, the largest sequence number in the frozen memory table is obtained as the first sequence number, and the largest sequence number in the persistence layer is obtained as the second sequence number; A sequence number range is determined according to the first sequence number and the second sequence number, wherein: The first sequence number is a maximum value in the sequence number range, and the second sequence number is a minimum value in the sequence number range.

6. The data processing method according to claim 5, flushing the persistence layer according to the data in the frozen memory table, comprising: Obtaining the primary key of each piece of data in the frozen memory table in turn; The data corresponding to the primary key is deleted in the row cache and the persistence layer.

7. The data processing method according to claim 1, querying the primary key in the row cache comprises: Convert the primary key into a corresponding primary key hash value according to a preset hash function; Determine a target hash bucket corresponding to the primary key in the row cache according to the primary key hash value; The target hash bucket is queried for the primary key.

8. The data processing method according to claim 4, writing the primary key and the key value into the row cache comprises: Convert the primary key into a corresponding primary key hash value according to a preset hash function; Determine, in the row cache, a target hash bucket corresponding to the primary key hash value according to the primary key hash value; The primary key and the key value are written into the target hash bucket accordingly.

9. The data processing method according to claim 1, wherein the memory table comprises an active memory table and a frozen memory table; Querying the primary key in the memory table includes: Query the primary key in the active memory table; When the primary key is found in the active memory table, a key value corresponding to the primary key is determined and returned; If the primary key is not found in the active memory table, query the primary key in the frozen memory table; When the primary key is found in the frozen memory table, determining and returning a key value corresponding to the primary key; When the primary key is not found in the frozen memory table, it is determined that the primary key is not found in the memory table.

10. A data processing device, comprising: A receiving module, configured to receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried; A memory query module, configured to query the primary key in the memory table; a row cache query module, configured to query the primary key in the row cache if the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, wherein the first preset condition includes that the read request sequence number is greater than or equal to a minimum value of a sequence number range of a storage engine; a row cache returning module, configured to determine and return a key value corresponding to the primary key when the primary key is found in the row cache; a block cache query module, configured to query the primary key in the block cache if the primary key is not found in the memory table and the read request sequence number does not meet a first preset condition; a block cache return module, configured to determine and return a key value corresponding to the primary key when the primary key is found in the block cache; A persistence layer query module, configured to query the primary key in the persistence layer if the primary key is not found in the block cache; A first persistence layer return module, configured to determine and return a key value corresponding to the primary key when the primary key is found in the persistence layer; The second return module of the persistence layer is configured to return a query failure success message if the primary key is not found in the persistence layer.

11. A data processing system comprising: A row cache query module is configured to receive a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried, and if the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, query the primary key in the row cache, and if the primary key is found in the row cache, execute a return module, wherein the first preset condition includes that the read request sequence number is greater than or equal to a minimum value of a sequence number range of a storage engine; a block cache query module configured to query the primary key in the block cache if the primary key is not found in the row cache or the read request sequence number does not meet the first preset condition, and execute the return module if the primary key is found in the block cache; A persistence layer query module is configured to query the primary key in the persistence layer if the primary key is not found in the block cache, and to execute a return module if the primary key is found in the persistence layer, and to return a query failure message if the primary key is not found in the persistence layer; a writing module configured to write the primary key and the key value corresponding to the primary key into the row cache if the primary key is queried in the block cache or the persistence layer and the read request sequence number satisfies a second preset condition, wherein the second preset condition includes that the read request sequence number is greater than the maximum value of the sequence number range; The return module is configured to determine and return the key value corresponding to the primary key.

12. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: Receiving a read request for data to be queried, wherein the read request includes a read request sequence number and a primary key of the data to be queried; Query the primary key in the memory table; If the primary key is not found in the memory table and the read request sequence number satisfies a first preset condition, querying the primary key in the row cache, wherein the first preset condition includes that the read request sequence number is greater than or equal to the minimum value of the sequence number range of the storage engine; When the primary key is found in the row cache, a key value corresponding to the primary key is determined and returned; If the primary key is not found in the memory table and the read request sequence number does not meet the first preset condition, query the primary key in the block cache; When the primary key is found in the block cache, determining and returning a key value corresponding to the primary key; If the primary key is not found in the block cache, query the primary key in the persistence layer; When the primary key is found in the persistence layer, determining and returning a key value corresponding to the primary key; When the primary key is not found in the persistence layer, a query failure message is returned.

13. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 9.