Database multi-transaction processing method, device, equipment and storage medium

By introducing transaction timing identification and index query scope in the database, the performance bottlenecks and low retrieval efficiency caused by the traditional lock mechanism are solved, and efficient multi-transaction concurrent processing and read and write efficiency improvements are achieved.

CN119248799BActive Publication Date: 2025-03-28JIANGSU HUAKU DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411784114.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

In the scenario of multi-transaction high concurrent access to databases, the traditional locking mechanism leads to performance bottlenecks and concurrency reduction, and the retrieval efficiency of multi-version records is low and time-consuming.

Method used

By generating a transaction timing identifier in response to the write transaction request and the read transaction request, the write transaction request is executed for the target key, the index query scope is determined, and the read transaction request bound with the index key value is executed to determine the target query result.

Benefits of technology

By introducing index query scope and transaction timing identification, the entry of B+ tree index is improved without losing, and the key-value entry is quickly locked, the index query scope is automatically updated, and the query results of the unique visible version is judged, which improves the database's multi-transaction concurrency processing capability and read and write efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248799B_ABST
    Figure CN119248799B_ABST
Patent Text Reader

Abstract

The present invention provides a database multi-transaction processing method and device, equipment and storage medium, which can be applied to the field of database technology. The method includes: in response to at least one write transaction request and read transaction request for a database, obtaining a transaction timing identifier corresponding to each of the write transaction request and the read transaction request; executing at least one write transaction request for a target key of the database, obtaining at least one key value and an operation attribute corresponding to each of the at least one key value; determining the index query range corresponding to each of the i-1 key value and the i-th key value according to the transaction timing identifier corresponding to the i-th write transaction request, wherein the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer; executing a read transaction request bound to an index key value, and determining the target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and operation attribute of each of the at least one key value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a database multi-transaction processing method and device, equipment and storage medium. Background Art

[0002] In the database, under different transaction isolation levels, the same query statement may retrieve different results. This feature can be achieved by using a locking mechanism. However, in the scenario of multiple transactions accessing the database with high concurrency, the traditional locking mechanism will lead to performance bottlenecks and reduced concurrency. Therefore, under the trend of rapid development of hardware in today's society, multi-version records are introduced in traditional database implementations, and multi-version records are stored on disk. However, when retrieving a version record of a row of data through an index, it may be necessary to access the disk file multiple times to obtain the version record visible to the transaction, and then filter the version record according to the index conditions. When multiple transactions access the disk concurrently, data chain queuing is often required, and the processing efficiency is low and time-consuming. Summary of the invention

[0003] In view of the above problems, the present invention provides a database multi-transaction processing method and apparatus, device and storage medium.

[0004] According to a first aspect of the present invention, a database multi-transaction processing method is provided, comprising: in response to at least one write transaction request and a read transaction request for a database, obtaining a transaction timing identifier corresponding to each of the write transaction request and the read transaction request, wherein the transaction timing identifier is determined based on a timing relationship between response moments of the transaction requests and a transaction attribute identifier; executing at least one write transaction request for a target key of the database, obtaining at least one key value and an operation attribute corresponding to each of the at least one key value; determining an index query range corresponding to each of the i-1 key value and the i key value according to the transaction timing identifier corresponding to the i-th write transaction request, wherein the i-th key value is obtained based on an i-th write transaction request operation, i is greater than 1, and i is a positive integer; executing a read transaction request bound with an index key value, and determining a target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and operation attribute of each of the at least one key value.

[0005] Optionally, the operation attributes include an operation version and an operation type; wherein, executing a read transaction request bound to an index key value, and determining a target query result according to a transaction timing identifier corresponding to the read transaction request and an index query range and operation attributes of at least one key value, comprises: executing a read transaction request bound to an index key value, and determining a target index key value from at least one key value; when the transaction timing identifier corresponding to the read transaction request is within the index query range of the target index key value, determining an execution result visible type according to the operation type associated with the target index key value; and obtaining a target query result corresponding to the read transaction request according to the execution result visible type and the operation version associated with the target index key value.

[0006] Optionally, determining the visible type of the execution result according to the operation type associated with the target index key value includes: when the operation type represents a deletion type, determining the visible type of the execution result to be a visible type; when the operation type represents a modification type, determining the visible type of the execution result to be an invisible type.

[0007] Optionally, based on the execution result visible type and the operation version associated with the target index key value, a target query result corresponding to the read transaction request is obtained, including: when the execution result visible type is a visible type, the execution result corresponding to the operation version associated with the target index key value is determined as the target query result; when the execution result visible type is an invisible type, a target query result representing a query failure is obtained.

[0008] Optionally, the index query range includes an index query lower limit value and an index query upper limit value; wherein, according to the transaction timing identifier corresponding to the i-th write transaction request, determining the index query range corresponding to the i-1th key value and the i-th key value respectively includes: updating the index query upper limit value in the index query range corresponding to the i-1th key value according to the transaction timing identifier corresponding to the i-th write transaction request; determining the transaction timing identifier corresponding to the i-th write transaction request as the index query lower limit value in the index query range corresponding to the i-th key value.

[0009] Optionally, the transaction timing identifier corresponding to the write transaction request is determined based on the following operation: determining the transaction timing identifier of each of the at least one write transaction request according to the timing relationship between the response times of the at least one write transaction request and an identifier adding rule.

[0010] Optionally, the transaction timing identifier corresponding to the read transaction request is determined based on the following operations: based on the transaction attribute identifier, when the mth read transaction request and the nth read transaction request are the same read transaction request, the transaction timing identifier of the mth read transaction request is determined as the transaction timing identifier of the nth read transaction request, where m is less than or equal to n, and m and n are both positive integers; when the response time of the read transaction request is between the response time of the i-1th write transaction request and the response time of the i-th write transaction request, the transaction timing identifier of the read transaction request is determined according to the transaction timing identifier of the i-1th write transaction request.

[0011] A second aspect of the present invention provides a database multi-transaction processing device, comprising:

[0012] a response module, configured to obtain, in response to at least one write transaction request and a read transaction request for a database, a transaction timing identifier corresponding to each of the write transaction request and the read transaction request, wherein the transaction timing identifier is determined based on a timing relationship between response times of the transaction requests and a transaction attribute identifier;

[0013] A first execution module, configured to execute at least one write transaction request for a target key of a database, and obtain at least one key value and an operation attribute corresponding to each of the at least one key value;

[0014] a determination module, configured to determine, according to a transaction timing identifier corresponding to an i-th write transaction request, an index query range corresponding to each of an i-1th key value and an i-th key value, wherein the i-th key value is obtained based on an i-th write transaction request operation, i is greater than 1, and i is a positive integer;

[0015] The second execution module is used to execute a read transaction request bound to an index key value, and determine a target query result according to a transaction timing identifier corresponding to the read transaction request and an index query range and an operation attribute of at least one key value.

[0016] The third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned database multi-transaction processing method.

[0017] The fourth aspect of the present invention further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned database multi-transaction processing method.

[0018] According to the database multi-transaction processing method, device, equipment and storage medium provided by the present invention, at least one write transaction request is executed for the target key of the database to obtain at least one key value; according to the transaction sequence identifier corresponding to the i-th write transaction request, the index query range corresponding to the i-1th key value and the i-th key value is determined; the read transaction request bound to the index key value is executed, and the target query result is determined according to the transaction sequence identifier corresponding to the read transaction request and the index query range and operation attribute of at least one key value. Due to the introduction of the index query range stored in the memory, the entry of the B+ tree index is guaranteed not to be lost in a variety of complex scenarios such as adding, deleting, modifying, and checking, so as to quickly lock the key value entry of the B+ tree based on the index key value bound in the read transaction request; the index query range of the key value is automatically updated according to the transaction sequence identifier of the write transaction request, and the relationship between the transaction sequence identifier of the read transaction request and the index query range is compared, and then the target query result of the only visible version is determined according to the operation attribute, so as to realize the index visibility judgment of the database and improve the multi-transaction concurrent processing capability and read-write efficiency of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings.

[0020] Figure 1 The application scenario of the database multi-transaction processing method and device according to the embodiment of the present invention is shown.

[0021] Figure 2 A flowchart of a database multi-transaction processing method according to an embodiment of the present invention is shown.

[0022] Figure 3 A flow chart for determining a target query result according to an embodiment of the present invention is shown.

[0023] Figure 4 A structural block diagram of a database multi-transaction processing device according to an embodiment of the present invention is shown.

[0024] Figure 5 A block diagram of an electronic device suitable for implementing a database multi-transaction processing method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0025] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.

[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0028] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0029] In the process of implementing the present invention, it is found that in the database, under different transaction isolation levels, the same query statement may retrieve different results. This feature can be achieved by using a lock mechanism. However, the traditional lock mechanism will lead to performance bottlenecks and concurrency reduction in the scenario of multiple transactions accessing the database with high concurrency. Therefore, under the trend of rapid development of hardware in today's society, multi-version records are introduced in the traditional database implementation, and the multi-version records are stored on the disk. However, when retrieving a version record of a row of data through an index, it may be necessary to access the disk file multiple times to obtain the version record visible to the transaction, and then filter the version record according to the index condition. When multiple transactions access the disk concurrently, it is often necessary to queue the data chain, and the processing efficiency is low and the time consumption is long.

[0030] In view of this, an embodiment of the present invention provides a database multi-transaction processing method and apparatus, device and storage medium. The method includes: in response to at least one write transaction request and read transaction request for a database, obtaining a transaction timing identifier corresponding to each of the write transaction request and the read transaction request; executing at least one write transaction request for a target key of the database, obtaining at least one key value and an operation attribute corresponding to each of the at least one key value; determining the index query range corresponding to each of the i-1 key value and the i key value according to the transaction timing identifier corresponding to the i-th write transaction request, wherein the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer; executing a read transaction request bound to an index key value, and determining the target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and operation attribute of each of the at least one key value.

[0031] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0032] Figure 1 The application scenario of the database multi-transaction processing method and device according to the embodiment of the present invention is shown.

[0033] like Figure 1 As shown, the business system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a cluster server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the cluster server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0034] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the cluster server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0036] The cluster server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The cluster distributed database is deployed on the cluster server 105, and the cluster server 105 includes multiple server nodes that can analyze and process the received user request and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.

[0037] It should be noted that the database multi-transaction processing method provided in the embodiment of the present invention can generally be executed by the cluster server 105. Accordingly, the database multi-transaction processing device provided in the embodiment of the present invention can generally be set in the cluster server 105. The database multi-transaction processing method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the cluster server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the cluster server 105. Accordingly, the database multi-transaction processing device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the cluster server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the cluster server 105.

[0038] Alternatively, the database multi-transaction processing method provided in the embodiment of the present invention may also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or may also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the database multi-transaction processing apparatus provided in the embodiment of the present invention may also be arranged in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or may be arranged in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.

[0039] It should be understood that Figure 1 The number of the first terminal device, the second terminal device, the third terminal device, the network and the cluster server in the embodiment is only for illustration. According to the implementation requirements, there may be any number of the first terminal device, the second terminal device, the third terminal device, the network and the cluster server.

[0040] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.

[0041] Figure 2 A flowchart of a database multi-transaction processing method according to an embodiment of the present invention is shown.

[0042] like Figure 2 As shown, the method 200 includes operations S210 to S240.

[0043] In operation S210, in response to at least one write transaction request and a read transaction request for a database, a transaction timing identifier corresponding to each of the write transaction request and the read transaction request is obtained.

[0044] Optionally, a write transaction request is used to perform operations such as deletion, insertion, and update on table data in the database. A read transaction request is used to perform query operations on table data in the database.

[0045] Optionally, the server generates transaction timing identifiers corresponding to the write transaction request and the read transaction request respectively according to the timing relationship between response times of the transaction requests and the transaction attribute identifiers in response to at least one write transaction request and a read transaction request for the database.

[0046] Optionally, the transaction timing identifier is determined based on the timing relationship between the response times of the transaction request and the transaction attribute identifier. The transaction timing identifier is used to identify the transaction request. The response time of the transaction request represents the time when the transaction request is initiated or submitted.

[0047] Optionally, a write transaction request generates a globally unique self-incrementing transaction sequence identifier. For example, the server receives a write transaction request a at a response time of 4.00, and obtains a transaction sequence identifier of 8 for the write transaction request a. The server receives a write transaction request b at a response time of 4.02, and obtains a transaction sequence identifier of 10 for the write transaction request b.

[0048] Optionally, the transaction attribute identifier is used to determine whether the read transaction requests corresponding to different response times are the same read transaction. The transaction timing identifier of the same read transaction request is the same, and the read transaction request will also generate a global self-incrementing transaction timing identifier. For example, the server receives a read transaction request c at the 4.01 response time, and obtains a transaction timing identifier of 9 for the read transaction request c. If the read transaction request d at the 4.03 response time and the read transaction request c at the 4.01 response time are the same read transaction, then the transaction timing identifier of the read transaction request d at the 4.03 response time is also 9.

[0049] In operation S220, at least one write transaction request is executed for a target key of the database to obtain at least one key value and an operation attribute corresponding to each of the at least one key value.

[0050] Optionally, the table attributes of the database include a target key, which facilitates the index search tree (B-tree, B+) to find data. A write transaction request is executed for the target key of the database to obtain the key value corresponding to the write transaction request. For example, there is an original data record R1: (id: 1, name: tom) in the database, where the target key is id, the key value is 1, and the data is tom. After executing a write transaction request for the target key of the database, a new data record R2: (id: 2, name: tony) is obtained, and the key value corresponding to the write transaction request is 2, and the data is tony.

[0051] Optionally, the B+ tree is a tree data structure with n subtree nodes containing n target keys. Each target key does not store data and is used for indexing. All key values ​​and data are stored in leaf nodes.

[0052] Optionally, the operation attribute is used to record the operation type information of the write transaction request and the operation version information corresponding to each operation.

[0053] In operation S230, according to the transaction timing identifier corresponding to the i-th write transaction request, the index query ranges corresponding to the i-1th key value and the i-th key value are determined.

[0054] Optionally, the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer. The i-1-th key value is obtained based on the i-1-th write transaction request operation, and i represents the order of the write transaction request.

[0055] Optionally, the index query range represents the visible life cycle of the data record associated with the key value. The index query range of the key value is stored in memory. The index query range is an open and closed interval.

[0056] For example, taking the write transaction request a at the response time of 4.00 and the write transaction request b at the response time of 4.02 as examples, the transaction sequence identifier of the write transaction request a is 8, and the key value 3 is obtained based on the write transaction request a. Then, the index query range corresponding to the key value 3 is [8, ); For the write transaction request b after the write transaction request a, the transaction sequence identifier of the write transaction request b is 10. Based on the write transaction request b, the key value 4 is obtained, and the index query range corresponding to the key value 3 is [8, 10), and the index query range corresponding to the key value 4 is [10, ).

[0057] In operation S240, a read transaction request bound with an index key value is executed, and a target query result is determined according to a transaction timing identifier corresponding to the read transaction request and an index query range and an operation attribute of at least one key value.

[0058] Optionally, a read transaction request bound to an index key value may provide an entry in the index B+ tree to quickly locate a leaf node where the index key value is located from at least one key value.

[0059] Optionally, it is determined whether the index key value has operation version information and reading rules, etc. according to the operation attribute corresponding to the index key value. When the operation version information is obtained, the transaction sequence identifier corresponding to the read transaction request and the index query range corresponding to the index key value are compared, and the visibility of the index key value and the associated data is determined, so as to obtain the target query result corresponding to the operation version information from the database based on the reading rule.

[0060] Optionally, by introducing the index query range stored in the memory, the entry of the B+ tree index is guaranteed not to be lost in various complex scenarios such as adding, deleting, modifying, and searching, so as to quickly lock the key value entry of the B+ tree based on the index key value bound in the read transaction request; the index query range of the key value is automatically updated according to the transaction timing identifier of the write transaction request, and the relationship between the transaction timing identifier of the read transaction request and the index query range is compared, and then the target query result is queried according to the operation attributes, thereby realizing the index visibility judgment of the database and improving the multi-transaction concurrent processing capability and read-write efficiency of the database.

[0061] Optionally, the transaction timing identifier corresponding to the write transaction request is determined based on the following operation: determining the transaction timing identifier of each of the at least one write transaction request according to the timing relationship between the response times of the at least one write transaction request and an identifier adding rule.

[0062] Optionally, the identifier increment rule is a rule for globally incrementing the transaction sequence identifier of the write transaction request.

[0063] For example, the identifier increment rule is a global auto-increment value of 5. According to the timing relationship between the response times of the write transaction requests and the identifier increment rule, it can be obtained that the transaction timing identifier of the i-th write transaction request increases by 5 compared to the transaction timing identifier of the i-1-th write transaction request.

[0064] For example, the response time of the i-1th write transaction request is 4.30, the transaction timing identifier of the i-1th write transaction request is 15, the response time of the i-th write transaction request is 4.40, and the transaction timing identifier of the i-th write transaction request is 20.

[0065] Optionally, the transaction timing identifier corresponding to the read transaction request is determined based on the following operations: based on the transaction attribute identifier, when the mth read transaction request and the nth read transaction request are the same read transaction request, the transaction timing identifier of the mth read transaction request is determined as the transaction timing identifier of the nth read transaction request, where m is less than or equal to n, and m and n are both positive integers; when the response time of the read transaction request is between the response time of the i-1th write transaction request and the response time of the i-th write transaction request, the transaction timing identifier of the read transaction request is determined according to the transaction timing identifier of the i-1th write transaction request.

[0066] Optionally, when the transaction attribute identifier of the mth read transaction request and the transaction attribute identifier of the nth read transaction request are the same identifier, the mth read transaction request and the nth read transaction request are the same read transaction request. The transaction timing identifiers of the same read transaction request are the same.

[0067] Optionally, when the response time of the read transaction request is between the response time of the i-1th write transaction request and the response time of the i-th write transaction request, the i-1th write transaction request is characterized as a write transaction request that is closest to the response time of the read transaction request. Determining the transaction timing identifier of the read transaction request according to the transaction timing identifier of the i-1th write transaction request may include: determining the transaction timing identifier of the read transaction request according to a preset auto-increment rule of the read transaction and the transaction timing identifier of the i-1th write transaction request.

[0068] Optionally, if there is no transaction attribute identifier identical to a certain read transaction request in the system, the transaction timing identifier of this read transaction request needs to be determined based on the transaction timing identifier of the i-1th write transaction request; if there is a transaction attribute identifier identical to a certain read transaction request in the system, the transaction timing identifier of this read transaction request is the same as the transaction timing identifier of the same read transaction request.

[0069] For example, the preset self-increment rule of the read transaction is to globally increase by 1. Taking the above-mentioned i-1th write transaction request response time of 4.30 and the i-th write transaction request response time of 4.40 as an example, the transaction timing identifier of the i-1th write transaction request is 15. After the response time 4.30, the server receives the read transaction request e and the read transaction request f. The response time of the read transaction request e is 4.35, and the response time of the read transaction request f is 4.38. Based on the transaction attribute identifier, the system is searched. If there is no read transaction request identical to the read transaction request e, the transaction timing identifier of the read transaction request e is increased by 1 to 16 on the transaction timing identifier of the i-1th write transaction request; if there is no read transaction request identical to the read transaction request f, the transaction timing identifier of the read transaction request f is also increased by 1 to 16 on the transaction timing identifier of the i-1th write transaction request; if there is a read transaction request identical to the read transaction request f, and the transaction timing identifier of the same read transaction request is 9, then the transaction timing identifier of the read transaction request f is 9.

[0070] Optionally, the index query range includes an index query lower limit value and an index query upper limit value; wherein, according to the transaction timing identifier corresponding to the i-th write transaction request, determining the index query range corresponding to the i-1th key value and the i-th key value respectively includes: updating the index query upper limit value in the index query range corresponding to the i-1th key value according to the transaction timing identifier corresponding to the i-th write transaction request; determining the transaction timing identifier corresponding to the i-th write transaction request as the index query lower limit value in the index query range corresponding to the i-th key value.

[0071] Optionally, the index query range is a half-open, half-closed interval consisting of an index query lower limit value and an index query upper limit value. The index query lower limit value represents the minimum value of the visible life cycle of the data record associated with the key value, and the index query upper limit value represents the maximum value of the visible life cycle of the data record associated with the key value.

[0072] For example, the index query range of the key value is [8, 10), where the index query lower limit value is 8 and the index query upper limit value is 10.

[0073] Optionally, the index query upper limit value in the index query range corresponding to the i-1th key value may be modified according to the transaction timing identifier of the i-th write transaction request. The index lower limit value in the index query range corresponding to the i-1th key value is determined based on the transaction timing identifier of the i-1th write transaction request.

[0074] Optionally, the index lower limit value in the index query range corresponding to the i-th key value is determined based on the transaction timing identifier of the i-th write transaction request. If no write transaction request is initiated after the i-th write transaction request in the system, the index upper limit value in the index query range corresponding to the i-th key value is positive infinity.

[0075] For example, the server receives a write transaction request g at response time 5.00, the transaction sequence identifier of the write transaction request g is 20, and the key value 5 is obtained based on the write transaction request g. Then, the index query range corresponding to the key value 5 is [20, ); When the server receives the write transaction request h at the response time 5.05, the transaction sequence identifier of the write transaction request h is obtained as 25. Based on the write transaction request h, the key value 6 is obtained, and the index query range corresponding to the key value 5 is obtained as [20, 25), and the index query range corresponding to the key value 6 is obtained as [25, ).

[0076] Figure 3 A flow chart for determining a target query result according to an embodiment of the present invention is shown.

[0077] like Figure 3 As shown, the process 300 of determining the target query result includes steps S310 to S330.

[0078] In step S310, a read transaction request bound to an index key value is executed, and a target index key value is determined from at least one key value.

[0079] In step S320, when the transaction sequence identifier corresponding to the read transaction request is within the index query range of the target index key value, the visible type of the execution result is determined according to the operation type associated with the target index key value.

[0080] In step S330, a target query result corresponding to the read transaction request is obtained according to the visible type of the execution result and the operation version associated with the target index key value.

[0081] Optionally, a read transaction request bound with an index key value can provide an entry in the index B+ tree, and quickly locate the leaf node where the index key value is located from at least one key value. For example, there are leaf nodes where key values ​​1, 2, and 3 are located on the B+ tree, and the index key value id=3 is bound in the read transaction request, so the leaf node where key value 3 is located can be quickly located. Key value 3 is the target index key value.

[0082] Optionally, the operation attributes include the operation version and the operation type. The operation version is used to record the operation of the write transaction request on the database. The operation version is described by the operation version number. Each time a write transaction request is executed, the system will generate a unique operation version number. Therefore, the key value obtained by the write transaction request will be marked with the operation version number. There are multiple operation version data records in the system. The operation version number mark is used to maintain the index entry in the B+ tree. If the target index key value is associated with the operation version number mark, it can be determined based on the visibility judgment logic whether the current read transaction can see the data record associated with the target key value.

[0083] Optionally, when the target index key value is associated with an operation version number tag and the transaction sequence identifier corresponding to the read transaction request is within the index query range of the target index key value, the visible type of the execution result is determined according to the operation type associated with the target index key value. The visible type of the execution result represents the visible category of the data record associated with the target index key value. The visible type of the execution result can be a visible type or an invisible type.

[0084] Optionally, the key value obtained for the write transaction request is bound with an operation type tag, and the operation type is determined according to the operation type tag. For example, an operation type tag of 1 determines that the operation type is a delete operation; an operation type tag of 2 determines that the operation type is an insert operation; and an operation type tag of 3 determines that the operation type is an update operation.

[0085] Optionally, based on the visible type of the execution result and the operation version associated with the target index key value, the data record corresponding to the operation version number is determined, and then the data record corresponding to the operation version number is determined as the target query result corresponding to the current read transaction request.

[0086] Optionally, when the target index key value is associated with an operation version number tag and the transaction sequence identifier corresponding to the read transaction request is not within the index query range of the target index key value, the current read transaction request cannot obtain the target query result.

[0087] Optionally, by comparing the relationship between the transaction timing identifier of the read transaction request and the index query range, and then determining the target query result of the only visible version according to the operation type and operation version, the problem of how to uniquely determine the data record of the visible operation version when concurrent read transaction requests are bound to index key values ​​to query data when multiple operation versions exist on the data record is solved, and multi-version concurrent retrieval with index is realized, thereby improving the database's multi-transaction concurrent processing capability and read and write efficiency.

[0088] Optionally, determining the visible type of the execution result based on the operation type associated with the target index key value includes: when the operation type represents a deletion type, determining the visible type of the execution result to be an invisible type; when the operation type represents a modification type, determining the visible type of the execution result to be a visible type.

[0089] Optionally, when the operation type associated with the target index key value represents a deletion type, the visible type of the execution result is determined to be a visible type, and thus the data record associated with the target index key value cannot be obtained.

[0090] Optionally, the modification type may include an insert type and an update type. When the operation type associated with the target index key value is an insert type and an update type, the visible type of the execution result is determined to be a visible type, and the data record associated with the target index key value can be obtained.

[0091] Optionally, based on the execution result visible type and the operation version associated with the target index key value, a target query result corresponding to the read transaction request is obtained, including: when the execution result visible type is a visible type, the execution result corresponding to the operation version associated with the target index key value is determined as the target query result; when the execution result visible type is an invisible type, a target query result representing a query failure is obtained.

[0092] For example, a data record R1 is initially written into the database: (id: 1, name: tom, level: 2, flag: DEL|VER)), and the index query range TS of key value 1 is [0, ), where the target key is id, the key value is 1, level represents the level of storage space occupied by data records, DEL represents the operation type, and VER represents the operation version. The server receives a read transaction request RT1 at response time 3.00. The transaction sequence identifier of RT1 is 8, and the isolation level is repeatable read. When the read transaction request RT1 queries with the index key value id=1, the transaction sequence identifier 8 of RT1 is in the index query range [0, ), data record R1 can be read.

[0093] Optionally, the server receives a write transaction request WT2 at response time 3.05. The transaction sequence identifier of the write transaction request WT2 is 10, and the operation type is a delete type. The transaction sequence identifier of WT2 is 10. After executing the write transaction request WT2, data record R2 is obtained. The key value in data record R2 is 2. The index query range TS of R1 is: [0, 10), and the index query range TS of R2 is: (10, ).

[0094] Optionally, the server receives a read transaction request RT2 at response time 3.10. When the read transaction request RT2 queries with the index key value id=2, and the data record R2 has an operation version, the visibility judgment logic can be used. When the transaction sequence identifier 15 of RT2 is in the index query range of key value 2 [10, ), the operation type associated with the target index key value 2 is the deletion type, and the visible type of the execution result is the invisible type. Therefore, the read transaction request RT2 cannot read the data record R2, and returns the target query result representing the query failure.

[0095] Optionally, for transaction RT1, according to the principle of repeatable read, although data record R1 is deleted, it should still be readable by RT1. The transaction sequence identifier of write transaction request WT2 is 10, which means that read transaction requests with transaction sequence identifiers before 10 can see data record R1, and read transaction requests after 10 can only see a deleted data record, that is, this data record is invisible.

[0096] For example, take the data record R1 and the read transaction request RT1 in the above database as an example. The transaction sequence identifier of RT1 is 8. The server receives a write transaction request WT3 at the response time 3.10. The operation type is the insert type. The transaction sequence identifier of WT3 is 10. After executing the write transaction request WT3, the data record R2 is obtained: (id: 2, name: tony, level: 1, flag: 2|002)). The id changes from 1 to 2. The DEL|VER mark is marked on 1 in the B+ tree. The index query range TS of R1 is: [0,10), and the index query range TS of R2 is: (10, ). When the read transaction request RT1 uses the index key value id=1 to query, the data record R1 can be read, but when the index key value id=1 is used to query, the data record R2 cannot be read.

[0097] Optionally, the server receives a read transaction request RT2 at response time 3.15, which is bound with index key value 2, operation version, and operation type. The transaction sequence identifier 15 of the read transaction request RT2 is within the index query range (10, ), the visible type of the execution result representing the visible type is obtained according to the insertion type, and then the execution result corresponding to the operation version 002 associated with the target index key value 2 is determined as the target query result, and the execution result corresponding to the operation version 002 is the data record R2, and the transaction request RT2 can read the data record R2.

[0098] For example, taking the data record R1 and the read transaction request RT1 in the above database as an example, the transaction sequence identifier of RT1 is 8, and the server receives a write transaction request WT4 at the response time 3.10. After executing the write transaction request WT4, the data record R2 is obtained: (id: 2, name: tom, level: 2, flag: 3|002)), the operation type is the update type, and the transaction sequence identifier of WT4 is 10. When transaction RT1 queries with the index key value id=1, the data record R1 is still queried. When RT1 queries with the index key value id=2, the data record R2 cannot be queried.

[0099] Based on the above database multi-transaction processing method, the present invention also provides a database multi-transaction processing device. Figure 4The device is described in detail.

[0100] Figure 4 A structural block diagram of a database multi-transaction processing device according to an embodiment of the present invention is shown.

[0101] like Figure 4 As shown, the database multi-transaction processing device 400 of this embodiment includes a response module 410 , a first execution module 420 , a determination module 430 and a second execution module 440 .

[0102] The response module 410 is used to respond to at least one write transaction request and a read transaction request for the database, and obtain a transaction timing identifier corresponding to each of the write transaction request and the read transaction request, wherein the transaction timing identifier is determined based on the timing relationship between the response moments of the transaction requests and the transaction attribute identifier. In one embodiment, the response module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0103] The first execution module 420 is used to execute at least one write transaction request for the target key of the database, and obtain at least one key value and an operation attribute corresponding to each of the at least one key value. In one embodiment, the first execution module 420 can be used to execute the operation S220 described above, which will not be repeated here.

[0104] The determination module 430 is used to determine the index query range corresponding to the i-1th key value and the i-th key value according to the transaction timing identifier corresponding to the i-th write transaction request, wherein the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer. In one embodiment, the determination module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0105] The second execution module 440 is used to execute the read transaction request bound to the index key value, and determine the target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and operation attribute of at least one key value. In one embodiment, the second execution module 440 can be used to execute the operation S240 described above, which will not be repeated here.

[0106] Optionally, the second execution module 440 includes a first execution submodule, a second execution submodule and a third execution submodule.

[0107] The first execution submodule is used to execute a read transaction request bound to an index key value, and determine a target index key value from at least one key value.

[0108] The second execution submodule is used to determine the visible type of the execution result according to the operation type associated with the target index key value when the transaction sequence identifier corresponding to the read transaction request is within the index query range of the target index key value.

[0109] The third execution submodule is used to obtain the target query result corresponding to the read transaction request according to the operation version associated with the visible type of the execution result and the target index key value.

[0110] Optionally, the second execution submodule includes a first execution unit and a second execution unit.

[0111] The first execution unit is configured to determine that the visible type of the execution result is a visible type when the operation type represents a deletion type.

[0112] The second execution unit is used to determine that the visible type of the execution result is an invisible type when the operation type represents a modification type.

[0113] Optionally, the third execution submodule includes a third execution unit and a fourth execution unit.

[0114] The third execution unit is used to determine the execution result corresponding to the operation version associated with the target index key value as the target query result when the visible type of the execution result is a visible type.

[0115] The fourth execution unit is used to obtain a target query result representing a query failure when the visible type of the execution result is an invisible type.

[0116] Optionally, the determination module 430 includes a first determination submodule and a second determination submodule.

[0117] The first determining submodule is used to update the index query upper limit value in the index query range corresponding to the (i-1)th key value according to the transaction timing identifier corresponding to the i-th write transaction request.

[0118] The second determining submodule is used to determine the transaction timing identifier corresponding to the i-th write transaction request as the index query lower limit value in the index query range corresponding to the i-th key value.

[0119] Optionally, the response module 410 includes a first response submodule and a second response submodule.

[0120] The first response submodule is used to determine the transaction timing identifier of the mth read transaction request as the transaction timing identifier of the nth read transaction request based on the transaction attribute identifier, when the mth read transaction request and the nth read transaction request are the same read transaction request, wherein m is less than or equal to n, and both m and n are positive integers.

[0121] The second response submodule is used to determine the transaction timing identifier of the read transaction request according to the transaction timing identifier of the i-1th write transaction request when the response time of the read transaction request is between the response time of the i-1th write transaction request and the response time of the i-th write transaction request.

[0122] Optionally, any multiple modules among the response module 410, the first execution module 420, the determination module 430, and the second execution module 440 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. Optionally, at least one of the response module 410, the first execution module 420, the determination module 430, and the second execution module 440 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the response module 410, the first execution module 420, the determination module 430, and the second execution module 440 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0123] Figure 5 A block diagram of an electronic device suitable for implementing a database multi-transaction processing method according to an embodiment of the present invention is shown.

[0124] Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0125] like Figure 5 As shown, the computer electronic device 500 according to an embodiment of the present invention includes a processor 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an on-board memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0126] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in one or more memories.

[0127] Optionally, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.

[0128] Optionally, the method flow according to the embodiment of the present invention can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present invention are executed. Optionally, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0129] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the database multi-transaction processing method according to the embodiment of the present invention is implemented.

[0130] Optionally, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0131] For example, optionally, the computer-readable storage medium may include the ROM 502 and / or the RAM 503 described above and / or one or more memories other than the ROM 502 and the RAM 503 .

[0132] An embodiment of the present invention also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the database multi-transaction processing method provided by the embodiment of the present invention.

[0133] When the computer program is executed by the processor 501, the above functions defined in the system / device of the embodiment of the present invention are performed. Optionally, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0134] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0135] Optionally, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages, specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present invention can be combined and / or combined in various ways, even if such a combination or combination is not explicitly recorded in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features recorded in the various embodiments of the present invention can be combined and / or combined in various ways. All these combinations and / or combinations fall within the scope of the present invention.

[0137] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A database multi-transaction processing method, characterized in that: The method comprises: In response to at least one write transaction request and a read transaction request for a database, a transaction timing identifier corresponding to each of the write transaction request and the read transaction request is obtained, wherein the transaction timing identifier is determined based on a timing relationship between response times of the transaction requests and a transaction attribute identifier, and the transaction attribute identifier is used to determine a relationship between read transaction requests corresponding to different response times; Execute the at least one write transaction request for a target key of the database to obtain at least one key value and an operation attribute corresponding to each of the at least one key value; According to the transaction timing identifier corresponding to the i-th write transaction request, determining the index query ranges corresponding to the i-1-th key value and the i-th key value respectively includes: Update the index query upper limit value in the index query range corresponding to the (i-1)th key value according to the transaction timing identifier corresponding to the (i)th write transaction request; Determine the transaction timing identifier corresponding to the i-th write transaction request as the index query lower limit value in the index query range corresponding to the i-th key value, wherein the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer, the index query range represents the visible life cycle of the data record associated with the key value, the index query range is stored in the memory, and the index query range includes the index query lower limit value and the index query upper limit value; Executing the read transaction request bound to the index key value, and determining the target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and the operation attribute of each of the at least one key value includes: Execute the read transaction request bound to the index key value, and determine a target index key value from the at least one key value; When the transaction sequence identifier corresponding to the read transaction request is within the index query range of the target index key value, determining the visible type of the execution result according to the operation type associated with the target index key value includes: In a case where the operation type represents a deletion type, determining that the visible type of the execution result is an invisible type; In the case where the operation type represents a modification type, determining that the visible type of the execution result is a visible type; According to the visible type of the execution result and the operation version associated with the target index key value, a target query result corresponding to the read transaction request is obtained, wherein the operation attributes include the operation version and the operation type, the index key value is used to index the at least one key value in the search tree, the operation version is described by an operation version number, the key value is marked with the operation version number, and the operation version number is used to maintain the index entry in the search tree.

2. The method according to claim 1, characterized in that The obtaining of the target query result corresponding to the read transaction request according to the visible type of the execution result and the operation version associated with the target index key value comprises: In a case where the visible type of the execution result is the visible type, determining the execution result corresponding to the operation version associated with the target index key value as the target query result; In a case where the visible type of the execution result is the invisible type, the target query result representing a query failure is obtained.

3. The method according to claim 1, characterized in that The transaction timing identifier corresponding to the write transaction request is determined based on the following operations: The transaction timing identifier of each of the at least one write transaction request is determined according to the timing relationship between the response times of the at least one write transaction request and the identifier adding rule.

4. The method according to claim 3, characterized in that The transaction timing identifier corresponding to the read transaction request is determined based on the following operations: Based on the transaction attribute identifier, when the mth read transaction request and the nth read transaction request are the same read transaction request, determining the transaction timing identifier of the mth read transaction request as the transaction timing identifier of the nth read transaction request, where m is less than or equal to n, and both m and n are positive integers; When the response time of the read transaction request is between the response time of the i-1th write transaction request and the response time of the i-th write transaction request, the transaction timing identifier of the read transaction request is determined according to the transaction timing identifier of the i-1th write transaction request.

5. A database multi-transaction processing device, characterized in that: The device comprises: a response module, configured to obtain, in response to at least one write transaction request and a read transaction request for a database, a transaction timing identifier corresponding to each of the write transaction request and the read transaction request, wherein the transaction timing identifier is determined based on a timing relationship between response moments of the transaction requests and a transaction attribute identifier, and the transaction attribute identifier is used to determine a relationship between read transaction requests corresponding to different response moments; A first execution module, configured to execute the at least one write transaction request for a target key of the database, and obtain at least one key value and an operation attribute corresponding to each of the at least one key value; A determination module, used to determine the index query ranges corresponding to the (i-1)th key value and the (i)th key value respectively according to the transaction timing identifier corresponding to the (i)th write transaction request, the determination module comprising a first determination submodule and a second determination submodule; A first determining submodule is configured to update an index query upper limit value in an index query range corresponding to the (i-1)th key value according to a transaction timing identifier corresponding to the (i)th write transaction request; a second determination submodule, configured to determine the transaction timing identifier corresponding to the i-th write transaction request as the index query lower limit value in the index query range corresponding to the i-th key value, wherein the i-th key value is obtained based on the i-th write transaction request operation, i is greater than 1, and i is a positive integer, the index query range represents the visible life cycle of the data record associated with the key value, the index query range is stored in a memory, and the index query range includes the index query lower limit value and the index query upper limit value; A second execution module is used to execute the read transaction request bound to the index key value, and determine the target query result according to the transaction timing identifier corresponding to the read transaction request and the index query range and the operation attribute of each of the at least one key value, the second execution module includes a first execution submodule, a second execution submodule and a third execution submodule; A first execution submodule, configured to execute the read transaction request bound with the index key value, and determine a target index key value from the at least one key value; A second execution submodule, configured to determine a visible type of an execution result according to an operation type associated with the target index key value when the transaction timing identifier corresponding to the read transaction request is within the index query range of the target index key value, the second execution submodule comprising a first execution unit and a second execution unit; A first execution unit, configured to determine that the visible type of the execution result is an invisible type when the operation type represents a deletion type; A second execution unit, configured to determine that the visible type of the execution result is a visible type when the operation type represents a modification type; The third execution submodule is used to obtain the target query result corresponding to the read transaction request according to the visible type of the execution result and the operation version associated with the target index key value, wherein the operation attributes include the operation version and the operation type, the index key value is used to index the at least one key value in the search tree, the operation version is described by an operation version number, the key value is marked with the operation version number, and the operation version number is used to maintain the index entry in the search tree.

6. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Global optimization key value storage method and device

    CN115599288A

  • Predicate indexing method supporting batch multi-version transactions of key value database

    CN118227619A